xref: /petsc/src/ksp/pc/impls/fieldsplit/ftn-custom/zfieldsplitf.c (revision 1193e19d1b770727a7312aa10bb1f1b1f18df41a)
1*1193e19dSBarry Smith #include <petsc-private/fortranimpl.h>
2*1193e19dSBarry Smith #include <petscksp.h>
3*1193e19dSBarry Smith 
4*1193e19dSBarry Smith #if defined(PETSC_HAVE_FORTRAN_CAPS)
5*1193e19dSBarry Smith #define pcfieldsplitgetsubksp_        PCFIELDSPLITGETSUBKSP
6*1193e19dSBarry Smith #elif !defined(PETSC_HAVE_FORTRAN_UNDERSCORE)
7*1193e19dSBarry Smith #define pcfieldsplitgetsubksp_        pcfieldsplitgetsubksp
8*1193e19dSBarry Smith #endif
9*1193e19dSBarry Smith 
10*1193e19dSBarry Smith EXTERN_C_BEGIN
11*1193e19dSBarry Smith void PETSC_STDCALL pcfieldsplitgetsubksp_(PC *pc,PetscInt *n_local,KSP *ksp,PetscErrorCode *ierr)
12*1193e19dSBarry Smith {
13*1193e19dSBarry Smith   KSP *tksp;
14*1193e19dSBarry Smith   PetscInt  i,nloc;
15*1193e19dSBarry Smith   CHKFORTRANNULLINTEGER(n_local);
16*1193e19dSBarry Smith   *ierr = PCFieldSplitGetSubKSP(*pc,&nloc,&tksp); if (*ierr) return;
17*1193e19dSBarry Smith   if (n_local) *n_local = nloc;
18*1193e19dSBarry Smith   CHKFORTRANNULLOBJECT(ksp);
19*1193e19dSBarry Smith   if (ksp) {
20*1193e19dSBarry Smith     for (i=0; i<nloc; i++){
21*1193e19dSBarry Smith       ksp[i] = tksp[i];
22*1193e19dSBarry Smith     }
23*1193e19dSBarry Smith   }
24*1193e19dSBarry Smith }
25*1193e19dSBarry Smith 
26*1193e19dSBarry Smith EXTERN_C_END
27