Actual source code: zfddaf.c

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

      4: #if defined(PETSC_HAVE_FORTRAN_CAPS)
      5:   #define dmcompositegetentries1_          DMCOMPOSITEGETENTRIES1
      6:   #define dmcompositegetentries2_          DMCOMPOSITEGETENTRIES2
      7:   #define dmcompositegetentries3_          DMCOMPOSITEGETENTRIES3
      8:   #define dmcompositegetentries4_          DMCOMPOSITEGETENTRIES4
      9:   #define dmcompositegetentries5_          DMCOMPOSITEGETENTRIES5
     10:   #define dmcompositegetaccess4_           DMCOMPOSITEGETACCESS4
     11:   #define dmcompositescatter4_             DMCOMPOSITESCATTER4
     12:   #define dmcompositerestoreaccess4_       DMCOMPOSITERESTOREACCESS4
     13:   #define dmcompositegetlocalvectors4_     DMCOMPOSITEGETLOCALVECTORS4
     14:   #define dmcompositerestorelocalvectors4_ DMCOMPOSITERESTORELOCALVECTORS4
     15:   #define dmcompositegetglobaliss_         DMCOMPOSITEGETGLOBALISS
     16:   #define dmcompositegetlocaliss_          DMCOMPOSITEGETLOCALISS
     17: #elif !defined(PETSC_HAVE_FORTRAN_UNDERSCORE)
     18:   #define dmcompositegetentries1_          dmcompositegetentries1
     19:   #define dmcompositegetentries2_          dmcompositegetentries2
     20:   #define dmcompositegetentries3_          dmcompositegetentries3
     21:   #define dmcompositegetentries4_          dmcompositegetentries4
     22:   #define dmcompositegetentries5_          dmcompositegetentries5
     23:   #define dmcompositegetaccess4_           dmcompositegetaccess4
     24:   #define dmcompositescatter4_             dmcompositescatter4
     25:   #define dmcompositerestoreaccess4_       dmcompositerestoreaccess4
     26:   #define dmcompositegetlocalvectors4_     dmcompositegetlocalvectors4
     27:   #define dmcompositerestorelocalvectors4_ dmcompositerestorelocalvectors4
     28:   #define dmcompositegetglobaliss_         dmcompositegetglobaliss
     29:   #define dmcompositegetlocaliss_          dmcompositegetlocaliss
     30: #endif

     32: PETSC_EXTERN void dmcompositegetentries1_(DM *dm, DM *da1, PetscErrorCode *ierr)
     33: {
     34:   *ierr = DMCompositeGetEntries(*dm, da1);
     35: }

     37: PETSC_EXTERN void dmcompositegetentries2_(DM *dm, DM *da1, DM *da2, PetscErrorCode *ierr)
     38: {
     39:   *ierr = DMCompositeGetEntries(*dm, da1, da2);
     40: }

     42: PETSC_EXTERN void dmcompositegetentries3_(DM *dm, DM *da1, DM *da2, DM *da3, PetscErrorCode *ierr)
     43: {
     44:   *ierr = DMCompositeGetEntries(*dm, da1, da2, da3);
     45: }

     47: PETSC_EXTERN void dmcompositegetentries4_(DM *dm, DM *da1, DM *da2, DM *da3, DM *da4, PetscErrorCode *ierr)
     48: {
     49:   *ierr = DMCompositeGetEntries(*dm, da1, da2, da3, da4);
     50: }

     52: PETSC_EXTERN void dmcompositegetentries5_(DM *dm, DM *da1, DM *da2, DM *da3, DM *da4, DM *da5, PetscErrorCode *ierr)
     53: {
     54:   *ierr = DMCompositeGetEntries(*dm, da1, da2, da3, da4, da5);
     55: }

     57: PETSC_EXTERN void dmcompositegetaccess4_(DM *dm, Vec *v, void **v1, void **p1, void **v2, void **p2, PetscErrorCode *ierr)
     58: {
     59:   Vec *vv1 = (Vec *)v1, *vv2 = (Vec *)v2;
     60:   *ierr = DMCompositeGetAccess(*dm, *v, vv1, (PetscScalar *)p1, vv2, (PetscScalar *)p2);
     61: }

     63: PETSC_EXTERN void dmcompositescatter4_(DM *dm, Vec *v, void *v1, void *p1, void *v2, void *p2, PetscErrorCode *ierr)
     64: {
     65:   Vec *vv1 = (Vec *)v1, *vv2 = (Vec *)v2;
     66:   *ierr = DMCompositeScatter(*dm, *v, *vv1, (PetscScalar *)p1, *vv2, (PetscScalar *)p2);
     67: }

     69: PETSC_EXTERN void dmcompositerestoreaccess4_(DM *dm, Vec *v, void **v1, void **p1, void **v2, void **p2, PetscErrorCode *ierr)
     70: {
     71:   *ierr = DMCompositeRestoreAccess(*dm, *v, (Vec *)v1, 0, (Vec *)v2, 0);
     72: }

     74: PETSC_EXTERN void dmcompositegetlocalvectors4_(DM *dm, void **v1, void **p1, void **v2, void **p2, PetscErrorCode *ierr)
     75: {
     76:   Vec *vv1 = (Vec *)v1, *vv2 = (Vec *)v2;
     77:   *ierr = DMCompositeGetLocalVectors(*dm, vv1, (PetscScalar *)p1, vv2, (PetscScalar *)p2);
     78: }

     80: PETSC_EXTERN void dmcompositerestorelocalvectors4_(DM *dm, void **v1, void **p1, void **v2, void **p2, PetscErrorCode *ierr)
     81: {
     82:   Vec *vv1 = (Vec *)v1, *vv2 = (Vec *)v2;
     83:   *ierr = DMCompositeRestoreLocalVectors(*dm, vv1, (PetscScalar *)p1, vv2, (PetscScalar *)p2);
     84: }

     86: PETSC_EXTERN void dmcompositegetglobaliss_(DM *dm, IS *iss, PetscErrorCode *ierr)
     87: {
     88:   IS      *ais;
     89:   PetscInt i, ndm;
     90:   *ierr = DMCompositeGetGlobalISs(*dm, &ais);
     91:   if (*ierr) return;
     92:   *ierr = DMCompositeGetNumberDM(*dm, &ndm);
     93:   if (*ierr) return;
     94:   for (i = 0; i < ndm; i++) iss[i] = ais[i];
     95:   *ierr = PetscFree(ais);
     96: }

     98: PETSC_EXTERN void dmcompositegetlocaliss_(DM *dm, IS *iss, PetscErrorCode *ierr)
     99: {
    100:   IS      *ais;
    101:   PetscInt i, ndm;
    102:   *ierr = DMCompositeGetLocalISs(*dm, &ais);
    103:   if (*ierr) return;
    104:   *ierr = DMCompositeGetNumberDM(*dm, &ndm);
    105:   if (*ierr) return;
    106:   for (i = 0; i < ndm; i++) iss[i] = ais[i];
    107:   *ierr = PetscFree(ais);
    108: }