Actual source code: zplexgeometryf90.c

      1: #include <petsc/private/fortranimpl.h>
      2: #include <petscdmplex.h>
      3: #include <petsc/private/f90impl.h>

      5: #if defined(PETSC_HAVE_FORTRAN_CAPS)
      6:   #define dmplexcomputecellgeometryaffinefem_ DMPLEXCOMPUTECELLGEOMETRYAFFINEFEM
      7:   #define dmplexcomputecellgeometryfvm_       DMPLEXCOMPUTECELLGEOMETRYFVM
      8: #elif !defined(PETSC_HAVE_FORTRAN_UNDERSCORE) && !defined(FORTRANDOUBLEUNDERSCORE)
      9:   #define dmplexcomputecellgeometryaffinefem_ dmplexcomputecellgeometryaffinefem
     10:   #define dmplexcomputecellgeometryfvm_       dmplexcomputecellgeometryfvm
     11: #endif

     13: PETSC_EXTERN void dmplexcomputecellgeometryaffinefem_(DM *dm, PetscInt *cell, F90Array1d *ptrV, F90Array1d *ptrJ, F90Array1d *ptrIJ, PetscReal *detJ, int *ierr PETSC_F90_2PTR_PROTO(ptrVd) PETSC_F90_2PTR_PROTO(ptrJd) PETSC_F90_2PTR_PROTO(ptrIJd))
     14: {
     15:   PetscReal *v0;
     16:   PetscReal *J;
     17:   PetscReal *invJ;

     19:   *ierr = F90Array1dAccess(ptrV, MPIU_REAL, (void **)&v0 PETSC_F90_2PTR_PARAM(ptrVd));
     20:   if (*ierr) return;
     21:   *ierr = F90Array1dAccess(ptrJ, MPIU_REAL, (void **)&J PETSC_F90_2PTR_PARAM(ptrJd));
     22:   if (*ierr) return;
     23:   *ierr = F90Array1dAccess(ptrIJ, MPIU_REAL, (void **)&invJ PETSC_F90_2PTR_PARAM(ptrIJd));
     24:   if (*ierr) return;
     25:   *ierr = DMPlexComputeCellGeometryAffineFEM(*dm, *cell, v0, J, invJ, detJ);
     26: }

     28: PETSC_EXTERN void dmplexcomputecellgeometryfem_(DM *dm, PetscInt *cell, PetscQuadrature *quad, F90Array1d *ptrV, F90Array1d *ptrJ, F90Array1d *ptrIJ, PetscReal *detJ, int *ierr PETSC_F90_2PTR_PROTO(ptrVd) PETSC_F90_2PTR_PROTO(ptrJd) PETSC_F90_2PTR_PROTO(ptrIJd))
     29: {
     30:   PetscReal *v0;
     31:   PetscReal *J;
     32:   PetscReal *invJ;

     34:   *ierr = F90Array1dAccess(ptrV, MPIU_REAL, (void **)&v0 PETSC_F90_2PTR_PARAM(ptrVd));
     35:   if (*ierr) return;
     36:   *ierr = F90Array1dAccess(ptrJ, MPIU_REAL, (void **)&J PETSC_F90_2PTR_PARAM(ptrJd));
     37:   if (*ierr) return;
     38:   *ierr = F90Array1dAccess(ptrIJ, MPIU_REAL, (void **)&invJ PETSC_F90_2PTR_PARAM(ptrIJd));
     39:   if (*ierr) return;
     40:   *ierr = DMPlexComputeCellGeometryFEM(*dm, *cell, *quad, v0, J, invJ, detJ);
     41: }

     43: PETSC_EXTERN void dmplexcomputecellgeometryfvm_(DM *dm, PetscInt *cell, PetscReal *vol, F90Array1d *ptrCentroid, F90Array1d *ptrNormal, int *ierr PETSC_F90_2PTR_PROTO(ptrCentroidd) PETSC_F90_2PTR_PROTO(ptrNormald))
     44: {
     45:   PetscReal *centroid;
     46:   PetscReal *normal;

     48:   *ierr = F90Array1dAccess(ptrCentroid, MPIU_REAL, (void **)&centroid PETSC_F90_2PTR_PARAM(ptrCentroidd));
     49:   if (*ierr) return;
     50:   *ierr = F90Array1dAccess(ptrNormal, MPIU_REAL, (void **)&normal PETSC_F90_2PTR_PARAM(ptrNormald));
     51:   if (*ierr) return;
     52:   *ierr = DMPlexComputeCellGeometryFVM(*dm, *cell, vol, centroid, normal);
     53: }