xref: /petsc/src/ksp/pc/impls/fieldsplit/ftn-custom/zfieldsplitf.c (revision 218d4943ca41a4b1a0eb642c9b5de5a8b4116578)
11193e19dSBarry 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
6*218d4943SBarry Smith #define pcfieldsplitsetis_            PCFIELDSPLITSETIS
71193e19dSBarry Smith #elif !defined(PETSC_HAVE_FORTRAN_UNDERSCORE)
81193e19dSBarry Smith #define pcfieldsplitgetsubksp_        pcfieldsplitgetsubksp
9*218d4943SBarry 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   }
231193e19dSBarry Smith }
241193e19dSBarry Smith 
25*218d4943SBarry Smith PETSC_EXTERN void PETSC_STDCALL  pcfieldsplitsetis_(PC *pc, CHAR splitname PETSC_MIXED_LEN(len),IS *is, PetscErrorCode *ierr PETSC_END_LEN(len))
26*218d4943SBarry Smith {
27*218d4943SBarry Smith   char *t;
28*218d4943SBarry Smith   FIXCHAR(splitname,len,t);
29*218d4943SBarry Smith   *ierr = PCFieldSplitSetIS(*pc,t,*is);
30*218d4943SBarry Smith   FREECHAR(splitname,t);
31*218d4943SBarry Smith }
32*218d4943SBarry Smith 
33*218d4943SBarry Smith 
34