Actual source code: zpartitioner.c

  1: #include <petsc/private/fortranimpl.h>
  2: #include <petscpartitioner.h>

  4: #if defined(PETSC_HAVE_FORTRAN_CAPS)
  5:   #define petscpartitionersettype_         PETSCPARTITIONERSETTYPE
  6:   #define petscpartitionergettype_         PETSCPARTITIONERGETTYPE
  7:   #define petscpartitionerviewfromoptions_ PETSCPARTITIONERVIEWFROMOPTIONS
  8: #elif !defined(PETSC_HAVE_FORTRAN_UNDERSCORE) && !defined(FORTRANDOUBLEUNDERSCORE)
  9:   #define petscpartitionersettype_         petscpartitionersettype
 10:   #define petscpartitionergettype_         petscpartitionergettype
 11:   #define petscpartitionerviewfromoptions_ petscpartitionerviewfromoptions
 12: #endif

 14: PETSC_EXTERN void petscpartitionergettype_(PetscPartitioner *mm, char *name, PetscErrorCode *ierr, PETSC_FORTRAN_CHARLEN_T len)
 15: {
 16:   const char *tname;

 18:   *ierr = PetscPartitionerGetType(*mm, &tname);
 19:   if (*ierr) return;
 20:   if (name != PETSC_NULL_CHARACTER_Fortran) {
 21:     *ierr = PetscStrncpy(name, tname, len);
 22:     if (*ierr) return;
 23:   }
 24:   FIXRETURNCHAR(PETSC_TRUE, name, len);
 25: }

 27: PETSC_EXTERN void petscpartitionerviewfromoptions_(PetscPartitioner *part, PetscObject obj, char *type, PetscErrorCode *ierr, PETSC_FORTRAN_CHARLEN_T len)
 28: {
 29:   char *t;

 31:   FIXCHAR(type, len, t);
 32:   CHKFORTRANNULLOBJECT(obj);
 33:   *ierr = PetscPartitionerViewFromOptions(*part, obj, t);
 34:   if (*ierr) return;
 35:   FREECHAR(type, t);
 36: }

 38: PETSC_EXTERN void petscpartitionersettype_(PetscPartitioner *x, char *type_name, PetscErrorCode *ierr, PETSC_FORTRAN_CHARLEN_T len)
 39: {
 40:   char *t;

 42:   FIXCHAR(type_name, len, t);
 43:   *ierr = PetscPartitionerSetType(*x, t);
 44:   FREECHAR(type_name, t);
 45: }