xref: /petsc/src/ksp/pc/impls/fieldsplit/ftn-custom/zfieldsplitf.c (revision e06cc25f388e7e78aff4d13e8bc6525d54dd772a)
1af0996ceSBarry Smith #include <petsc/private/fortranimpl.h>
21193e19dSBarry Smith #include <petscksp.h>
31193e19dSBarry Smith 
41193e19dSBarry Smith #if defined(PETSC_HAVE_FORTRAN_CAPS)
51193e19dSBarry Smith #define pcfieldsplitgetsubksp_        PCFIELDSPLITGETSUBKSP
6218d4943SBarry Smith #define pcfieldsplitsetis_            PCFIELDSPLITSETIS
71193e19dSBarry Smith #elif !defined(PETSC_HAVE_FORTRAN_UNDERSCORE)
81193e19dSBarry Smith #define pcfieldsplitgetsubksp_        pcfieldsplitgetsubksp
9218d4943SBarry Smith #define pcfieldsplitsetis_            pcfieldsplitsetis
101193e19dSBarry Smith #endif
111193e19dSBarry Smith 
128cc058d9SJed Brown PETSC_EXTERN void PETSC_STDCALL pcfieldsplitgetsubksp_(PC *pc,PetscInt *n_local,KSP *ksp,PetscErrorCode *ierr)
131193e19dSBarry Smith {
141193e19dSBarry Smith   KSP      *tksp;
151193e19dSBarry Smith   PetscInt i,nloc;
161193e19dSBarry Smith   CHKFORTRANNULLINTEGER(n_local);
171193e19dSBarry Smith   *ierr = PCFieldSplitGetSubKSP(*pc,&nloc,&tksp); if (*ierr) return;
181193e19dSBarry Smith   if (n_local) *n_local = nloc;
191193e19dSBarry Smith   CHKFORTRANNULLOBJECT(ksp);
201193e19dSBarry Smith   if (ksp) {
212fa5cd67SKarl Rupp     for (i=0; i<nloc; i++) ksp[i] = tksp[i];
221193e19dSBarry Smith   }
23*e06cc25fSBarry Smith   *ierr = PetscFree(tksp);
241193e19dSBarry Smith }
251193e19dSBarry Smith 
26218d4943SBarry Smith PETSC_EXTERN void PETSC_STDCALL  pcfieldsplitsetis_(PC *pc, CHAR splitname PETSC_MIXED_LEN(len),IS *is, PetscErrorCode *ierr PETSC_END_LEN(len))
27218d4943SBarry Smith {
28218d4943SBarry Smith   char *t;
29218d4943SBarry Smith   FIXCHAR(splitname,len,t);
30218d4943SBarry Smith   *ierr = PCFieldSplitSetIS(*pc,t,*is);
31218d4943SBarry Smith   FREECHAR(splitname,t);
32218d4943SBarry Smith }
33218d4943SBarry Smith 
34218d4943SBarry Smith 
35