Date: 2025-03-29T05:58:20+00:00

Actual source code: zfddaf90.c

      1: #include <petsc/private/ftnimpl.h>
      2: #include <petscdmcomposite.h>

      4: #if defined(PETSC_HAVE_FORTRAN_CAPS)
      5:   #define dmcompositegetaccessvpvp_     DMCOMPOSITEGETACCESSVPVP
      6:   #define dmcompositerestoreaccessvpvp_ DMCOMPOSITERESTOREACCESSVPVP
      7: #elif !defined(PETSC_HAVE_FORTRAN_UNDERSCORE)
      8:   #define dmcompositegetaccessvpvp_     dmcompositegetaccessvpvp
      9:   #define dmcompositerestoreaccessvpvp_ dmcompositerestoreaccessvpvp
     10: #endif

     12: PETSC_EXTERN void dmcompositegetaccessvpvp_(DM *dm, Vec *v, Vec *v1, F90Array1d *p1, Vec *v2, F90Array1d *p2, PetscErrorCode *ierr PETSC_F90_2PTR_PROTO(ptrd1) PETSC_F90_2PTR_PROTO(ptrd2))
     13: {
     14:   PetscScalar *pp1, *pp2;
     15:   PetscInt     np1, np2;
     16:   *ierr = DMCompositeGetEntries(*dm, 0, &np1, 0, &np2);
     17:   *ierr = DMCompositeGetAccess(*dm, *v, v1, &pp1, v2, &pp2);
     18:   *ierr = F90Array1dCreate(pp1, MPIU_SCALAR, 0, np1 - 1, p1 PETSC_F90_2PTR_PARAM(ptrd1));
     19:   *ierr = F90Array1dCreate(pp2, MPIU_SCALAR, 0, np2 - 1, p2 PETSC_F90_2PTR_PARAM(ptrd2));
     20: }

     22: PETSC_EXTERN void dmcompositerestoreaccessvpvp_(DM *dm, Vec *v, Vec *v1, F90Array1d *p1, Vec *v2, F90Array1d *p2, PetscErrorCode *ierr PETSC_F90_2PTR_PROTO(ptrd1) PETSC_F90_2PTR_PROTO(ptrd2))
     23: {
     24:   *ierr = DMCompositeRestoreAccess(*dm, *v, v1, 0, v2, 0);
     25:   *ierr = F90Array1dDestroy(p1, MPIU_SCALAR PETSC_F90_2PTR_PARAM(ptrd1));
     26:   *ierr = F90Array1dDestroy(p2, MPIU_SCALAR PETSC_F90_2PTR_PARAM(ptrd2));
     27: }