1e1589f56SBarry Smith /* 2e1589f56SBarry Smith Objects to manage the interactions between the mesh data structures and the algebraic objects 3e1589f56SBarry Smith */ 43c48a1e8SJed Brown #if !defined(__PETSCDM_H) 53c48a1e8SJed Brown #define __PETSCDM_H 62c8e378dSBarry Smith #include <petscmat.h> 71e25c274SJed Brown #include <petscdmtypes.h> 8decb47aaSMatthew G. Knepley #include <petscfetypes.h> 92764a2aaSMatthew G. Knepley #include <petscdstypes.h> 10c58f1c22SToby Isaac #include <petscdmlabel.h> 11e1589f56SBarry Smith 12607a6623SBarry Smith PETSC_EXTERN PetscErrorCode DMInitializePackage(void); 13e1589f56SBarry Smith 14014dd563SJed Brown PETSC_EXTERN PetscClassId DM_CLASSID; 15e1589f56SBarry Smith 16528c63e0SDave May #define DMLOCATEPOINT_POINT_NOT_FOUND -367 17528c63e0SDave May 1876bdecfbSBarry Smith /*J 198f6c3df8SBarry Smith DMType - String with the name of a PETSc DM 20e1589f56SBarry Smith 21e1589f56SBarry Smith Level: beginner 22e1589f56SBarry Smith 23e1589f56SBarry Smith .seealso: DMSetType(), DM 2476bdecfbSBarry Smith J*/ 2519fd82e9SBarry Smith typedef const char* DMType; 26e1589f56SBarry Smith #define DMDA "da" 27e1589f56SBarry Smith #define DMCOMPOSITE "composite" 28e1589f56SBarry Smith #define DMSLICED "sliced" 29fe1899a2SJed Brown #define DMSHELL "shell" 30ab7f58a0SBarry Smith #define DMPLEX "plex" 318ac4e037SJed Brown #define DMREDUNDANT "redundant" 323a19ef87SMatthew G Knepley #define DMPATCH "patch" 331d72bce8STim Tautges #define DMMOAB "moab" 345f2c45f1SShri Abhyankar #define DMNETWORK "network" 35ef51cf95SToby Isaac #define DMFOREST "forest" 36db4d5e8cSToby Isaac #define DMP4EST "p4est" 37db4d5e8cSToby Isaac #define DMP8EST "p8est" 382fd35b1fSDave May #define DMSWARM "swarm" 39e1589f56SBarry Smith 40bff4a2f0SMatthew G. Knepley PETSC_EXTERN const char *const DMBoundaryTypes[]; 41140e18c1SBarry Smith PETSC_EXTERN PetscFunctionList DMList; 42014dd563SJed Brown PETSC_EXTERN PetscErrorCode DMCreate(MPI_Comm,DM*); 4338221697SMatthew G. Knepley PETSC_EXTERN PetscErrorCode DMClone(DM,DM*); 4419fd82e9SBarry Smith PETSC_EXTERN PetscErrorCode DMSetType(DM, DMType); 4519fd82e9SBarry Smith PETSC_EXTERN PetscErrorCode DMGetType(DM, DMType *); 46bdf89e91SBarry Smith PETSC_EXTERN PetscErrorCode DMRegister(const char[],PetscErrorCode (*)(DM)); 47014dd563SJed Brown PETSC_EXTERN PetscErrorCode DMRegisterDestroy(void); 48e1589f56SBarry Smith 49014dd563SJed Brown PETSC_EXTERN PetscErrorCode DMView(DM,PetscViewer); 50014dd563SJed Brown PETSC_EXTERN PetscErrorCode DMLoad(DM,PetscViewer); 51014dd563SJed Brown PETSC_EXTERN PetscErrorCode DMDestroy(DM*); 52014dd563SJed Brown PETSC_EXTERN PetscErrorCode DMCreateGlobalVector(DM,Vec*); 53014dd563SJed Brown PETSC_EXTERN PetscErrorCode DMCreateLocalVector(DM,Vec*); 54014dd563SJed Brown PETSC_EXTERN PetscErrorCode DMGetLocalVector(DM,Vec *); 55014dd563SJed Brown PETSC_EXTERN PetscErrorCode DMRestoreLocalVector(DM,Vec *); 56014dd563SJed Brown PETSC_EXTERN PetscErrorCode DMGetGlobalVector(DM,Vec *); 57014dd563SJed Brown PETSC_EXTERN PetscErrorCode DMRestoreGlobalVector(DM,Vec *); 58014dd563SJed Brown PETSC_EXTERN PetscErrorCode DMClearGlobalVectors(DM); 5950eeb1caSToby Isaac PETSC_EXTERN PetscErrorCode DMClearLocalVectors(DM); 60e77ac854SMatthew G. Knepley PETSC_EXTERN PetscErrorCode DMHasNamedGlobalVector(DM,const char*,PetscBool*); 61014dd563SJed Brown PETSC_EXTERN PetscErrorCode DMGetNamedGlobalVector(DM,const char*,Vec*); 62014dd563SJed Brown PETSC_EXTERN PetscErrorCode DMRestoreNamedGlobalVector(DM,const char*,Vec*); 63e77ac854SMatthew G. Knepley PETSC_EXTERN PetscErrorCode DMHasNamedLocalVector(DM,const char*,PetscBool*); 642348bcf4SPeter Brune PETSC_EXTERN PetscErrorCode DMGetNamedLocalVector(DM,const char*,Vec*); 652348bcf4SPeter Brune PETSC_EXTERN PetscErrorCode DMRestoreNamedLocalVector(DM,const char*,Vec*); 66014dd563SJed Brown PETSC_EXTERN PetscErrorCode DMGetLocalToGlobalMapping(DM,ISLocalToGlobalMapping*); 67014dd563SJed Brown PETSC_EXTERN PetscErrorCode DMCreateFieldIS(DM,PetscInt*,char***,IS**); 68014dd563SJed Brown PETSC_EXTERN PetscErrorCode DMGetBlockSize(DM,PetscInt*); 69b412c318SBarry Smith PETSC_EXTERN PetscErrorCode DMCreateColoring(DM,ISColoringType,ISColoring*); 70b412c318SBarry Smith PETSC_EXTERN PetscErrorCode DMCreateMatrix(DM,Mat*); 71014dd563SJed Brown PETSC_EXTERN PetscErrorCode DMSetMatrixPreallocateOnly(DM,PetscBool); 72b06ff27eSHong Zhang PETSC_EXTERN PetscErrorCode DMSetMatrixStructureOnly(DM,PetscBool); 73014dd563SJed Brown PETSC_EXTERN PetscErrorCode DMCreateInterpolation(DM,DM,Mat*,Vec*); 743ad4599aSBarry Smith PETSC_EXTERN PetscErrorCode DMCreateRestriction(DM,DM,Mat*); 756dbf9973SLawrence Mitchell PETSC_EXTERN PetscErrorCode DMCreateInjection(DM,DM,Mat*); 76bd041c0cSMatthew G. Knepley PETSC_EXTERN PetscErrorCode DMCreateMassMatrix(DM,DM,Mat*); 7769291d52SBarry Smith PETSC_EXTERN PetscErrorCode DMGetWorkArray(DM,PetscInt,MPI_Datatype,void*); 7869291d52SBarry Smith PETSC_EXTERN PetscErrorCode DMRestoreWorkArray(DM,PetscInt,MPI_Datatype,void*); 79014dd563SJed Brown PETSC_EXTERN PetscErrorCode DMRefine(DM,MPI_Comm,DM*); 80014dd563SJed Brown PETSC_EXTERN PetscErrorCode DMCoarsen(DM,MPI_Comm,DM*); 81a8fb8f29SToby Isaac PETSC_EXTERN PetscErrorCode DMGetCoarseDM(DM,DM*); 82a8fb8f29SToby Isaac PETSC_EXTERN PetscErrorCode DMSetCoarseDM(DM,DM); 8388bdff64SToby Isaac PETSC_EXTERN PetscErrorCode DMGetFineDM(DM,DM*); 8488bdff64SToby Isaac PETSC_EXTERN PetscErrorCode DMSetFineDM(DM,DM); 85014dd563SJed Brown PETSC_EXTERN PetscErrorCode DMRefineHierarchy(DM,PetscInt,DM[]); 86014dd563SJed Brown PETSC_EXTERN PetscErrorCode DMCoarsenHierarchy(DM,PetscInt,DM[]); 87014dd563SJed Brown PETSC_EXTERN PetscErrorCode DMCoarsenHookAdd(DM,PetscErrorCode (*)(DM,DM,void*),PetscErrorCode (*)(DM,Mat,Vec,Mat,DM,void*),void*); 88dc822a44SJed Brown PETSC_EXTERN PetscErrorCode DMCoarsenHookRemove(DM,PetscErrorCode (*)(DM,DM,void*),PetscErrorCode (*)(DM,Mat,Vec,Mat,DM,void*),void*); 89014dd563SJed Brown PETSC_EXTERN PetscErrorCode DMRefineHookAdd(DM,PetscErrorCode (*)(DM,DM,void*),PetscErrorCode (*)(DM,Mat,DM,void*),void*); 903d8e3701SJed Brown PETSC_EXTERN PetscErrorCode DMRefineHookRemove(DM,PetscErrorCode (*)(DM,DM,void*),PetscErrorCode (*)(DM,Mat,DM,void*),void*); 91014dd563SJed Brown PETSC_EXTERN PetscErrorCode DMRestrict(DM,Mat,Vec,Mat,DM); 92014dd563SJed Brown PETSC_EXTERN PetscErrorCode DMInterpolate(DM,Mat,DM); 93014dd563SJed Brown PETSC_EXTERN PetscErrorCode DMSetFromOptions(DM); 94685405a1SBarry Smith PETSC_STATIC_INLINE PetscErrorCode DMViewFromOptions(DM A,PetscObject obj,const char name[]) {return PetscObjectViewFromOptions((PetscObject)A,obj,name);} 95ca266f36SBarry Smith 96a1b0c543SToby Isaac PETSC_EXTERN PetscErrorCode DMAdaptLabel(DM,DMLabel,DM*); 970d1cd5e0SMatthew G. Knepley PETSC_EXTERN PetscErrorCode DMAdaptMetric(DM, Vec, DMLabel, DM *); 98df0b854cSToby Isaac 99014dd563SJed Brown PETSC_EXTERN PetscErrorCode DMSetUp(DM); 100014dd563SJed Brown PETSC_EXTERN PetscErrorCode DMCreateInterpolationScale(DM,DM,Mat,Vec*); 101014dd563SJed Brown PETSC_EXTERN PetscErrorCode DMCreateAggregates(DM,DM,Mat*); 102baf369e7SPeter Brune PETSC_EXTERN PetscErrorCode DMGlobalToLocalHookAdd(DM,PetscErrorCode (*)(DM,Vec,InsertMode,Vec,void*),PetscErrorCode (*)(DM,Vec,InsertMode,Vec,void*),void*); 103d4d07f1eSToby Isaac PETSC_EXTERN PetscErrorCode DMLocalToGlobalHookAdd(DM,PetscErrorCode (*)(DM,Vec,InsertMode,Vec,void*),PetscErrorCode (*)(DM,Vec,InsertMode,Vec,void*),void*); 104014dd563SJed Brown PETSC_EXTERN PetscErrorCode DMGlobalToLocalBegin(DM,Vec,InsertMode,Vec); 105014dd563SJed Brown PETSC_EXTERN PetscErrorCode DMGlobalToLocalEnd(DM,Vec,InsertMode,Vec); 106014dd563SJed Brown PETSC_EXTERN PetscErrorCode DMLocalToGlobalBegin(DM,Vec,InsertMode,Vec); 107014dd563SJed Brown PETSC_EXTERN PetscErrorCode DMLocalToGlobalEnd(DM,Vec,InsertMode,Vec); 108d78e899eSRichard Tran Mills PETSC_EXTERN PetscErrorCode DMLocalToLocalBegin(DM,Vec,InsertMode,Vec); 109d78e899eSRichard Tran Mills PETSC_EXTERN PetscErrorCode DMLocalToLocalEnd(DM,Vec,InsertMode,Vec); 11019fd82e9SBarry Smith PETSC_EXTERN PetscErrorCode DMConvert(DM,DMType,DM*); 111e1589f56SBarry Smith 112c73cfb54SMatthew G. Knepley /* Topology support */ 113c73cfb54SMatthew G. Knepley PETSC_EXTERN PetscErrorCode DMGetDimension(DM,PetscInt*); 114c73cfb54SMatthew G. Knepley PETSC_EXTERN PetscErrorCode DMSetDimension(DM,PetscInt); 115793f3fe5SMatthew G. Knepley PETSC_EXTERN PetscErrorCode DMGetDimPoints(DM,PetscInt,PetscInt*,PetscInt*); 1168e4ac7eaSMatthew G. Knepley PETSC_EXTERN PetscErrorCode DMGetUseNatural(DM,PetscBool*); 1178e4ac7eaSMatthew G. Knepley PETSC_EXTERN PetscErrorCode DMSetUseNatural(DM,PetscBool); 11846e270d4SMatthew G. Knepley 11946e270d4SMatthew G. Knepley /* Coordinate support */ 1206636e97aSMatthew G Knepley PETSC_EXTERN PetscErrorCode DMGetCoordinateDM(DM,DM*); 1211cfe2091SMatthew G. Knepley PETSC_EXTERN PetscErrorCode DMSetCoordinateDM(DM,DM); 12246e270d4SMatthew G. Knepley PETSC_EXTERN PetscErrorCode DMGetCoordinateDim(DM,PetscInt*); 12346e270d4SMatthew G. Knepley PETSC_EXTERN PetscErrorCode DMSetCoordinateDim(DM,PetscInt); 124e8abe2deSMatthew G. Knepley PETSC_EXTERN PetscErrorCode DMGetCoordinateSection(DM,PetscSection*); 12546e270d4SMatthew G. Knepley PETSC_EXTERN PetscErrorCode DMSetCoordinateSection(DM,PetscInt,PetscSection); 1266636e97aSMatthew G Knepley PETSC_EXTERN PetscErrorCode DMGetCoordinates(DM,Vec*); 1276636e97aSMatthew G Knepley PETSC_EXTERN PetscErrorCode DMSetCoordinates(DM,Vec); 1286636e97aSMatthew G Knepley PETSC_EXTERN PetscErrorCode DMGetCoordinatesLocal(DM,Vec*); 1296636e97aSMatthew G Knepley PETSC_EXTERN PetscErrorCode DMSetCoordinatesLocal(DM,Vec); 13062a38674SMatthew G. Knepley PETSC_EXTERN PetscErrorCode DMLocatePoints(DM,Vec,DMPointLocationType,PetscSF*); 13190b157c4SStefano Zampini PETSC_EXTERN PetscErrorCode DMGetPeriodicity(DM,PetscBool*,const PetscReal**,const PetscReal**,const DMBoundaryType**); 13290b157c4SStefano Zampini PETSC_EXTERN PetscErrorCode DMSetPeriodicity(DM,PetscBool,const PetscReal[],const PetscReal[],const DMBoundaryType[]); 133e907e85cSMatthew G. Knepley PETSC_EXTERN PetscErrorCode DMLocalizeCoordinate(DM, const PetscScalar[], PetscBool, PetscScalar[]); 1342e17dfb7SMatthew G. Knepley PETSC_EXTERN PetscErrorCode DMLocalizeCoordinates(DM); 13536447a5eSToby Isaac PETSC_EXTERN PetscErrorCode DMGetCoordinatesLocalized(DM,PetscBool*); 1363c73bf98SDave May PETSC_EXTERN PetscErrorCode DMGetNeighbors(DM,PetscInt*,const PetscMPIInt**); 137f19dbd58SToby Isaac PETSC_EXTERN PetscErrorCode DMGetCoordinateField(DM,DMField*); 138f19dbd58SToby Isaac PETSC_EXTERN PetscErrorCode DMSetCoordinateField(DM,DMField); 1396636e97aSMatthew G Knepley 1405dbd56e3SPeter Brune /* block hook interface */ 141be081cd6SPeter Brune PETSC_EXTERN PetscErrorCode DMSubDomainHookAdd(DM,PetscErrorCode (*)(DM,DM,void*),PetscErrorCode (*)(DM,VecScatter,VecScatter,DM,void*),void*); 142b3a6b972SJed Brown PETSC_EXTERN PetscErrorCode DMSubDomainHookRemove(DM,PetscErrorCode (*)(DM,DM,void*),PetscErrorCode (*)(DM,VecScatter,VecScatter,DM,void*),void*); 143be081cd6SPeter Brune PETSC_EXTERN PetscErrorCode DMSubDomainRestrict(DM,VecScatter,VecScatter,DM); 1445dbd56e3SPeter Brune 145014dd563SJed Brown PETSC_EXTERN PetscErrorCode DMSetOptionsPrefix(DM,const char []); 14631697293SDave May PETSC_EXTERN PetscErrorCode DMAppendOptionsPrefix(DM,const char []); 14731697293SDave May PETSC_EXTERN PetscErrorCode DMGetOptionsPrefix(DM,const char*[]); 14819fd82e9SBarry Smith PETSC_EXTERN PetscErrorCode DMSetVecType(DM,VecType); 149c0dedaeaSBarry Smith PETSC_EXTERN PetscErrorCode DMGetVecType(DM,VecType*); 15019fd82e9SBarry Smith PETSC_EXTERN PetscErrorCode DMSetMatType(DM,MatType); 151c0dedaeaSBarry Smith PETSC_EXTERN PetscErrorCode DMGetMatType(DM,MatType*); 1528f1509bcSBarry Smith PETSC_EXTERN PetscErrorCode DMSetISColoringType(DM,ISColoringType); 1538f1509bcSBarry Smith PETSC_EXTERN PetscErrorCode DMGetISColoringType(DM,ISColoringType*); 154014dd563SJed Brown PETSC_EXTERN PetscErrorCode DMSetApplicationContext(DM,void*); 155014dd563SJed Brown PETSC_EXTERN PetscErrorCode DMSetApplicationContextDestroy(DM,PetscErrorCode (*)(void**)); 156014dd563SJed Brown PETSC_EXTERN PetscErrorCode DMGetApplicationContext(DM,void*); 157014dd563SJed Brown PETSC_EXTERN PetscErrorCode DMSetVariableBounds(DM,PetscErrorCode (*)(DM,Vec,Vec)); 158014dd563SJed Brown PETSC_EXTERN PetscErrorCode DMHasVariableBounds(DM,PetscBool *); 159b0ae01b7SPeter Brune PETSC_EXTERN PetscErrorCode DMHasColoring(DM,PetscBool *); 1603ad4599aSBarry Smith PETSC_EXTERN PetscErrorCode DMHasCreateRestriction(DM,PetscBool *); 161a7058e45SLawrence Mitchell PETSC_EXTERN PetscErrorCode DMHasCreateInjection(DM,PetscBool *); 162014dd563SJed Brown PETSC_EXTERN PetscErrorCode DMComputeVariableBounds(DM,Vec,Vec); 16393d92d96SBarry Smith 16437bc7515SMatthew G. Knepley PETSC_EXTERN PetscErrorCode DMCreateSubDM(DM, PetscInt, const PetscInt[], IS *, DM *); 1652adcc780SMatthew G. Knepley PETSC_EXTERN PetscErrorCode DMCreateSuperDM(DM[], PetscInt, IS **, DM *); 16616621825SDmitry Karpeev PETSC_EXTERN PetscErrorCode DMCreateFieldDecomposition(DM,PetscInt*,char***,IS**,DM**); 1678d4ac253SDmitry Karpeev PETSC_EXTERN PetscErrorCode DMCreateDomainDecomposition(DM,PetscInt*,char***,IS**,IS**,DM**); 168e30e807fSPeter Brune PETSC_EXTERN PetscErrorCode DMCreateDomainDecompositionScatters(DM,PetscInt,DM*,VecScatter**,VecScatter**,VecScatter**); 169e7c4fc90SDmitry Karpeev 170014dd563SJed Brown PETSC_EXTERN PetscErrorCode DMGetRefineLevel(DM,PetscInt*); 171fef3a512SBarry Smith PETSC_EXTERN PetscErrorCode DMSetRefineLevel(DM,PetscInt); 172014dd563SJed Brown PETSC_EXTERN PetscErrorCode DMGetCoarsenLevel(DM,PetscInt*); 173014dd563SJed Brown PETSC_EXTERN PetscErrorCode DMFinalizePackage(void); 174e1589f56SBarry Smith 1755f1ad066SMatthew G Knepley PETSC_EXTERN PetscErrorCode VecGetDM(Vec, DM*); 1765f1ad066SMatthew G Knepley PETSC_EXTERN PetscErrorCode VecSetDM(Vec, DM); 177c688c046SMatthew G Knepley PETSC_EXTERN PetscErrorCode MatGetDM(Mat, DM*); 178c688c046SMatthew G Knepley PETSC_EXTERN PetscErrorCode MatSetDM(Mat, DM); 179531c7667SBarry Smith PETSC_EXTERN PetscErrorCode MatFDColoringUseDM(Mat,MatFDColoring); 1805f1ad066SMatthew G Knepley 181e1589f56SBarry Smith typedef struct NLF_DAAD* NLF; 182e1589f56SBarry Smith 183bc2bf880SBarry Smith #define DM_FILE_CLASSID 1211221 1847da65231SMatthew G Knepley 1857da65231SMatthew G Knepley /* FEM support */ 186014dd563SJed Brown PETSC_EXTERN PetscErrorCode DMPrintCellVector(PetscInt, const char [], PetscInt, const PetscScalar []); 187014dd563SJed Brown PETSC_EXTERN PetscErrorCode DMPrintCellMatrix(PetscInt, const char [], PetscInt, PetscInt, const PetscScalar []); 1886113b454SMatthew G. Knepley PETSC_EXTERN PetscErrorCode DMPrintLocalVec(DM, const char [], PetscReal, Vec); 1897da65231SMatthew G Knepley 190*f9d4088aSMatthew G. Knepley PETSC_EXTERN PetscErrorCode DMSetNullSpaceConstructor(DM, PetscInt, PetscErrorCode (*)(DM, PetscInt, MatNullSpace *)); 191*f9d4088aSMatthew G. Knepley PETSC_EXTERN PetscErrorCode DMGetNullSpaceConstructor(DM, PetscInt, PetscErrorCode (**)(DM, PetscInt, MatNullSpace *)); 192*f9d4088aSMatthew G. Knepley PETSC_EXTERN PetscErrorCode DMSetNearNullSpaceConstructor(DM, PetscInt, PetscErrorCode (*)(DM, PetscInt, MatNullSpace *)); 193*f9d4088aSMatthew G. Knepley PETSC_EXTERN PetscErrorCode DMGetNearNullSpaceConstructor(DM, PetscInt, PetscErrorCode (**)(DM, PetscInt, MatNullSpace *)); 194*f9d4088aSMatthew G. Knepley 195e87a4003SBarry Smith PETSC_EXTERN PetscErrorCode DMGetSection(DM, PetscSection *); 196e87a4003SBarry Smith PETSC_EXTERN PetscErrorCode DMSetSection(DM, PetscSection); 1979435951eSToby Isaac PETSC_EXTERN PetscErrorCode DMGetDefaultConstraints(DM, PetscSection *, Mat *); 1989435951eSToby Isaac PETSC_EXTERN PetscErrorCode DMSetDefaultConstraints(DM, PetscSection, Mat); 199e87a4003SBarry Smith PETSC_EXTERN PetscErrorCode DMGetGlobalSection(DM, PetscSection *); 200e87a4003SBarry Smith PETSC_EXTERN PetscErrorCode DMSetGlobalSection(DM, PetscSection); 201014dd563SJed Brown PETSC_EXTERN PetscErrorCode DMGetDefaultSF(DM, PetscSF *); 202014dd563SJed Brown PETSC_EXTERN PetscErrorCode DMSetDefaultSF(DM, PetscSF); 203014dd563SJed Brown PETSC_EXTERN PetscErrorCode DMCreateDefaultSF(DM, PetscSection, PetscSection); 204b21d0597SMatthew G Knepley PETSC_EXTERN PetscErrorCode DMGetPointSF(DM, PetscSF *); 205057b4bcdSMatthew G Knepley PETSC_EXTERN PetscErrorCode DMSetPointSF(DM, PetscSF); 20688ed4aceSMatthew G Knepley 207f7e04a3dSKarl Rupp PETSC_STATIC_INLINE PetscErrorCode DMGetDefaultSection(DM dm, PetscSection *s) {return DMGetSection(dm,s);} 208f7e04a3dSKarl Rupp PETSC_STATIC_INLINE PetscErrorCode DMSetDefaultSection(DM dm, PetscSection s) {return DMSetSection(dm,s);} 209f7e04a3dSKarl Rupp PETSC_STATIC_INLINE PetscErrorCode DMGetDefaultGlobalSection(DM dm, PetscSection *s) {return DMGetGlobalSection(dm,s);} 210f7e04a3dSKarl Rupp PETSC_STATIC_INLINE PetscErrorCode DMSetDefaultGlobalSection(DM dm, PetscSection s) {return DMSetGlobalSection(dm,s);} 211e87a4003SBarry Smith 212e87a4003SBarry Smith 21314f150ffSMatthew G. Knepley PETSC_EXTERN PetscErrorCode DMGetOutputDM(DM, DM *); 214cdb7a50dSMatthew G. Knepley PETSC_EXTERN PetscErrorCode DMGetOutputSequenceNumber(DM, PetscInt *, PetscReal *); 215cdb7a50dSMatthew G. Knepley PETSC_EXTERN PetscErrorCode DMSetOutputSequenceNumber(DM, PetscInt, PetscReal); 216cdb7a50dSMatthew G. Knepley PETSC_EXTERN PetscErrorCode DMOutputSequenceLoad(DM, PetscViewer, const char *, PetscInt, PetscReal *); 21714f150ffSMatthew G. Knepley 2182764a2aaSMatthew G. Knepley PETSC_EXTERN PetscErrorCode DMGetDS(DM, PetscDS *); 2192764a2aaSMatthew G. Knepley PETSC_EXTERN PetscErrorCode DMSetDS(DM, PetscDS); 220af122d2aSMatthew G Knepley PETSC_EXTERN PetscErrorCode DMGetNumFields(DM, PetscInt *); 221af122d2aSMatthew G Knepley PETSC_EXTERN PetscErrorCode DMSetNumFields(DM, PetscInt); 222af122d2aSMatthew G Knepley PETSC_EXTERN PetscErrorCode DMGetField(DM, PetscInt, PetscObject *); 223decb47aaSMatthew G. Knepley PETSC_EXTERN PetscErrorCode DMSetField(DM, PetscInt, PetscObject); 224af122d2aSMatthew G Knepley 225e87bb0d3SMatthew G Knepley struct _DMInterpolationInfo { 226e87bb0d3SMatthew G Knepley MPI_Comm comm; 227e87bb0d3SMatthew G Knepley PetscInt dim; /*1 The spatial dimension of points */ 228e87bb0d3SMatthew G Knepley PetscInt nInput; /* The number of input points */ 229e87bb0d3SMatthew G Knepley PetscReal *points; /* The input point coordinates */ 230e87bb0d3SMatthew G Knepley PetscInt *cells; /* The cell containing each point */ 231e87bb0d3SMatthew G Knepley PetscInt n; /* The number of local points */ 232e87bb0d3SMatthew G Knepley Vec coords; /* The point coordinates */ 233e87bb0d3SMatthew G Knepley PetscInt dof; /* The number of components to interpolate */ 234e87bb0d3SMatthew G Knepley }; 235e87bb0d3SMatthew G Knepley typedef struct _DMInterpolationInfo *DMInterpolationInfo; 236e87bb0d3SMatthew G Knepley 23794b4b8a8SMatthew G. Knepley PETSC_EXTERN PetscErrorCode DMInterpolationCreate(MPI_Comm, DMInterpolationInfo *); 23894b4b8a8SMatthew G. Knepley PETSC_EXTERN PetscErrorCode DMInterpolationSetDim(DMInterpolationInfo, PetscInt); 23994b4b8a8SMatthew G. Knepley PETSC_EXTERN PetscErrorCode DMInterpolationGetDim(DMInterpolationInfo, PetscInt *); 24094b4b8a8SMatthew G. Knepley PETSC_EXTERN PetscErrorCode DMInterpolationSetDof(DMInterpolationInfo, PetscInt); 24194b4b8a8SMatthew G. Knepley PETSC_EXTERN PetscErrorCode DMInterpolationGetDof(DMInterpolationInfo, PetscInt *); 24294b4b8a8SMatthew G. Knepley PETSC_EXTERN PetscErrorCode DMInterpolationAddPoints(DMInterpolationInfo, PetscInt, PetscReal[]); 24394b4b8a8SMatthew G. Knepley PETSC_EXTERN PetscErrorCode DMInterpolationSetUp(DMInterpolationInfo, DM, PetscBool); 24494b4b8a8SMatthew G. Knepley PETSC_EXTERN PetscErrorCode DMInterpolationGetCoordinates(DMInterpolationInfo, Vec *); 24594b4b8a8SMatthew G. Knepley PETSC_EXTERN PetscErrorCode DMInterpolationGetVector(DMInterpolationInfo, Vec *); 24694b4b8a8SMatthew G. Knepley PETSC_EXTERN PetscErrorCode DMInterpolationRestoreVector(DMInterpolationInfo, Vec *); 24794b4b8a8SMatthew G. Knepley PETSC_EXTERN PetscErrorCode DMInterpolationEvaluate(DMInterpolationInfo, DM, Vec, Vec); 24894b4b8a8SMatthew G. Knepley PETSC_EXTERN PetscErrorCode DMInterpolationDestroy(DMInterpolationInfo *); 249c58f1c22SToby Isaac 250c58f1c22SToby Isaac PETSC_EXTERN PetscErrorCode DMCreateLabel(DM, const char []); 251c58f1c22SToby Isaac PETSC_EXTERN PetscErrorCode DMGetLabelValue(DM, const char[], PetscInt, PetscInt *); 252c58f1c22SToby Isaac PETSC_EXTERN PetscErrorCode DMSetLabelValue(DM, const char[], PetscInt, PetscInt); 253c58f1c22SToby Isaac PETSC_EXTERN PetscErrorCode DMClearLabelValue(DM, const char[], PetscInt, PetscInt); 254c58f1c22SToby Isaac PETSC_EXTERN PetscErrorCode DMGetLabelSize(DM, const char[], PetscInt *); 255c58f1c22SToby Isaac PETSC_EXTERN PetscErrorCode DMGetLabelIdIS(DM, const char[], IS *); 256c58f1c22SToby Isaac PETSC_EXTERN PetscErrorCode DMGetStratumSize(DM, const char [], PetscInt, PetscInt *); 257c58f1c22SToby Isaac PETSC_EXTERN PetscErrorCode DMGetStratumIS(DM, const char [], PetscInt, IS *); 2584de306b1SToby Isaac PETSC_EXTERN PetscErrorCode DMSetStratumIS(DM, const char [], PetscInt, IS); 259c58f1c22SToby Isaac PETSC_EXTERN PetscErrorCode DMClearLabelStratum(DM, const char[], PetscInt); 260c58f1c22SToby Isaac PETSC_EXTERN PetscErrorCode DMGetLabelOutput(DM, const char[], PetscBool *); 261c58f1c22SToby Isaac PETSC_EXTERN PetscErrorCode DMSetLabelOutput(DM, const char[], PetscBool); 262c58f1c22SToby Isaac 263c58f1c22SToby Isaac PETSC_EXTERN PetscErrorCode DMGetNumLabels(DM, PetscInt *); 264c58f1c22SToby Isaac PETSC_EXTERN PetscErrorCode DMGetLabelName(DM, PetscInt, const char **); 265c58f1c22SToby Isaac PETSC_EXTERN PetscErrorCode DMHasLabel(DM, const char [], PetscBool *); 266c58f1c22SToby Isaac PETSC_EXTERN PetscErrorCode DMGetLabel(DM, const char *, DMLabel *); 267c58f1c22SToby Isaac PETSC_EXTERN PetscErrorCode DMGetLabelByNum(DM, PetscInt, DMLabel *); 268c58f1c22SToby Isaac PETSC_EXTERN PetscErrorCode DMAddLabel(DM, DMLabel); 269c58f1c22SToby Isaac PETSC_EXTERN PetscErrorCode DMRemoveLabel(DM, const char [], DMLabel *); 270c58f1c22SToby Isaac PETSC_EXTERN PetscErrorCode DMCopyLabels(DM, DM); 271c58f1c22SToby Isaac 272a30ec4eaSSatish Balay PETSC_EXTERN PetscErrorCode DMAddBoundary(DM, DMBoundaryConditionType, const char[], const char[], PetscInt, PetscInt, const PetscInt *, void (*)(void), PetscInt, const PetscInt *, void *); 273a6ba4734SToby Isaac PETSC_EXTERN PetscErrorCode DMGetNumBoundary(DM, PetscInt *); 274a30ec4eaSSatish Balay PETSC_EXTERN PetscErrorCode DMGetBoundary(DM, PetscInt, DMBoundaryConditionType *, const char **, const char **, PetscInt *, PetscInt *, const PetscInt **, void (**)(void), PetscInt *, const PetscInt **, void **); 275a6ba4734SToby Isaac PETSC_EXTERN PetscErrorCode DMIsBoundaryPoint(DM, PetscInt, PetscBool *); 276a6ba4734SToby Isaac PETSC_EXTERN PetscErrorCode DMCopyBoundary(DM, DM); 2774d6f44ffSToby Isaac 2780709b2feSToby Isaac PETSC_EXTERN PetscErrorCode DMProjectFunction(DM,PetscReal,PetscErrorCode(**)(PetscInt,PetscReal,const PetscReal[],PetscInt,PetscScalar *,void *),void**,InsertMode,Vec); 2790709b2feSToby Isaac PETSC_EXTERN PetscErrorCode DMProjectFunctionLocal(DM,PetscReal,PetscErrorCode(**)(PetscInt,PetscReal,const PetscReal[],PetscInt,PetscScalar *,void *),void**,InsertMode,Vec); 2802c53366bSMatthew G. Knepley PETSC_EXTERN PetscErrorCode DMProjectFunctionLabel(DM, PetscReal, DMLabel, PetscInt, const PetscInt[], PetscInt, const PetscInt[], PetscErrorCode (**)(PetscInt, PetscReal, const PetscReal [], PetscInt, PetscScalar *, void *), void **, InsertMode, Vec); 2811c531cf8SMatthew G. Knepley PETSC_EXTERN PetscErrorCode DMProjectFunctionLabelLocal(DM,PetscReal,DMLabel,PetscInt,const PetscInt[],PetscInt,const PetscInt[],PetscErrorCode(**)(PetscInt,PetscReal,const PetscReal[],PetscInt,PetscScalar *,void *),void **,InsertMode,Vec); 282191494d9SMatthew G. Knepley PETSC_EXTERN PetscErrorCode DMProjectFieldLocal(DM,PetscReal,Vec,void (**)(PetscInt,PetscInt,PetscInt,const PetscInt[],const PetscInt[],const PetscScalar[],const PetscScalar[],const PetscScalar[],const PetscInt[],const PetscInt[],const PetscScalar[],const PetscScalar[],const PetscScalar[],PetscReal,const PetscReal[],PetscInt,const PetscScalar[],PetscScalar[]),InsertMode,Vec); 2831c531cf8SMatthew G. Knepley PETSC_EXTERN PetscErrorCode DMProjectFieldLabelLocal(DM,PetscReal,DMLabel,PetscInt,const PetscInt[],PetscInt,const PetscInt[],Vec,void (**)(PetscInt,PetscInt,PetscInt,const PetscInt[],const PetscInt[],const PetscScalar[],const PetscScalar[],const PetscScalar[],const PetscInt[],const PetscInt[],const PetscScalar[],const PetscScalar[],const PetscScalar[],PetscReal,const PetscReal[],PetscInt,const PetscScalar[],PetscScalar[]),InsertMode,Vec); 2840709b2feSToby Isaac PETSC_EXTERN PetscErrorCode DMComputeL2Diff(DM,PetscReal,PetscErrorCode(**)(PetscInt,PetscReal,const PetscReal[],PetscInt,PetscScalar *,void *),void **,Vec,PetscReal *); 285b698f381SToby Isaac PETSC_EXTERN PetscErrorCode DMComputeL2GradientDiff(DM, PetscReal, PetscErrorCode (**)(PetscInt, PetscReal, const PetscReal [], const PetscReal [], PetscInt, PetscScalar *, void *), void **, Vec, const PetscReal [], PetscReal *); 2861189c1efSToby Isaac PETSC_EXTERN PetscErrorCode DMComputeL2FieldDiff(DM,PetscReal,PetscErrorCode(**)(PetscInt,PetscReal,const PetscReal[],PetscInt,PetscScalar *,void *),void **,Vec,PetscReal *); 2878320bc6fSPatrick Sanan 2888320bc6fSPatrick Sanan PETSC_EXTERN PetscErrorCode DMGetCompatibility(DM,DM,PetscBool*,PetscBool*); 289e1589f56SBarry Smith #endif 290