1*a12302e2SJed Brown #if !defined(_packimpl_h) 2*a12302e2SJed Brown #define _packimpl_h 3*a12302e2SJed Brown 4*a12302e2SJed Brown #include <private/dmimpl.h> /*I "petscdm.h" I*/ 5*a12302e2SJed Brown 6*a12302e2SJed Brown /* 7*a12302e2SJed Brown rstart is where an array/subvector starts in the global parallel vector, so arrays 8*a12302e2SJed Brown rstarts are meaningless (and set to the previous one) except on the processor where the array lives 9*a12302e2SJed Brown */ 10*a12302e2SJed Brown 11*a12302e2SJed Brown typedef enum {DMCOMPOSITE_ARRAY, DMCOMPOSITE_DM} DMCompositeLinkType; 12*a12302e2SJed Brown 13*a12302e2SJed Brown struct DMCompositeLink { 14*a12302e2SJed Brown DMCompositeLinkType type; 15*a12302e2SJed Brown struct DMCompositeLink *next; 16*a12302e2SJed Brown PetscInt n; /* number of owned */ 17*a12302e2SJed Brown PetscInt rstart; /* rstart is relative to this process */ 18*a12302e2SJed Brown PetscInt grstart; /* grstart is relative to all processes */ 19*a12302e2SJed Brown PetscInt nlocal; 20*a12302e2SJed Brown 21*a12302e2SJed Brown /* only used for DMCOMPOSITE_DM */ 22*a12302e2SJed Brown PetscInt *grstarts; /* global row for first unknown of this DM on each process */ 23*a12302e2SJed Brown DM dm; 24*a12302e2SJed Brown 25*a12302e2SJed Brown /* only used for DMCOMPOSITE_ARRAY */ 26*a12302e2SJed Brown PetscMPIInt rank; /* process where array unknowns live */ 27*a12302e2SJed Brown }; 28*a12302e2SJed Brown 29*a12302e2SJed Brown typedef struct { 30*a12302e2SJed Brown PetscInt n,N,rstart; /* rstart is relative to all processors, n unknowns owned by this process, N is total unknowns */ 31*a12302e2SJed Brown PetscInt nghost; /* number of all local entries include DMDA ghost points and any shared redundant arrays */ 32*a12302e2SJed Brown PetscInt nDM,nredundant,nmine; /* how many DM's and seperate redundant arrays used to build DM(nmine is ones on this process) */ 33*a12302e2SJed Brown PetscBool setup; /* after this is set, cannot add new links to the DM*/ 34*a12302e2SJed Brown struct DMCompositeLink *next; 35*a12302e2SJed Brown 36*a12302e2SJed Brown PetscErrorCode (*FormCoupleLocations)(DM,Mat,PetscInt*,PetscInt*,PetscInt,PetscInt,PetscInt,PetscInt); 37*a12302e2SJed Brown } DM_Composite; 38*a12302e2SJed Brown 39*a12302e2SJed Brown EXTERN PetscErrorCode DMGetMatrix_Composite(DM,const MatType,Mat*); 40*a12302e2SJed Brown 41*a12302e2SJed Brown #endif 42