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; 15d67d17b1SMatthew G. Knepley PETSC_EXTERN PetscClassId DMLABEL_CLASSID; 16e1589f56SBarry Smith 17528c63e0SDave May #define DMLOCATEPOINT_POINT_NOT_FOUND -367 18528c63e0SDave May 1976bdecfbSBarry Smith /*J 208f6c3df8SBarry Smith DMType - String with the name of a PETSc DM 21e1589f56SBarry Smith 22e1589f56SBarry Smith Level: beginner 23e1589f56SBarry Smith 24e1589f56SBarry Smith .seealso: DMSetType(), DM 2576bdecfbSBarry Smith J*/ 2619fd82e9SBarry Smith typedef const char* DMType; 27e1589f56SBarry Smith #define DMDA "da" 28e1589f56SBarry Smith #define DMCOMPOSITE "composite" 29e1589f56SBarry Smith #define DMSLICED "sliced" 30fe1899a2SJed Brown #define DMSHELL "shell" 31ab7f58a0SBarry Smith #define DMPLEX "plex" 328ac4e037SJed Brown #define DMREDUNDANT "redundant" 333a19ef87SMatthew G Knepley #define DMPATCH "patch" 341d72bce8STim Tautges #define DMMOAB "moab" 355f2c45f1SShri Abhyankar #define DMNETWORK "network" 36ef51cf95SToby Isaac #define DMFOREST "forest" 37db4d5e8cSToby Isaac #define DMP4EST "p4est" 38db4d5e8cSToby Isaac #define DMP8EST "p8est" 392fd35b1fSDave May #define DMSWARM "swarm" 40d852a638SPatrick Sanan #define DMPRODUCT "product" 41a3101111SPatrick Sanan #define DMSTAG "stag" 42e1589f56SBarry Smith 43bff4a2f0SMatthew G. Knepley PETSC_EXTERN const char *const DMBoundaryTypes[]; 44140e18c1SBarry Smith PETSC_EXTERN PetscFunctionList DMList; 45014dd563SJed Brown PETSC_EXTERN PetscErrorCode DMCreate(MPI_Comm,DM*); 4638221697SMatthew G. Knepley PETSC_EXTERN PetscErrorCode DMClone(DM,DM*); 4719fd82e9SBarry Smith PETSC_EXTERN PetscErrorCode DMSetType(DM, DMType); 4819fd82e9SBarry Smith PETSC_EXTERN PetscErrorCode DMGetType(DM, DMType *); 49bdf89e91SBarry Smith PETSC_EXTERN PetscErrorCode DMRegister(const char[],PetscErrorCode (*)(DM)); 50014dd563SJed Brown PETSC_EXTERN PetscErrorCode DMRegisterDestroy(void); 51e1589f56SBarry Smith 52014dd563SJed Brown PETSC_EXTERN PetscErrorCode DMView(DM,PetscViewer); 53014dd563SJed Brown PETSC_EXTERN PetscErrorCode DMLoad(DM,PetscViewer); 54014dd563SJed Brown PETSC_EXTERN PetscErrorCode DMDestroy(DM*); 55014dd563SJed Brown PETSC_EXTERN PetscErrorCode DMCreateGlobalVector(DM,Vec*); 56014dd563SJed Brown PETSC_EXTERN PetscErrorCode DMCreateLocalVector(DM,Vec*); 57014dd563SJed Brown PETSC_EXTERN PetscErrorCode DMGetLocalVector(DM,Vec *); 58014dd563SJed Brown PETSC_EXTERN PetscErrorCode DMRestoreLocalVector(DM,Vec *); 59014dd563SJed Brown PETSC_EXTERN PetscErrorCode DMGetGlobalVector(DM,Vec *); 60014dd563SJed Brown PETSC_EXTERN PetscErrorCode DMRestoreGlobalVector(DM,Vec *); 61014dd563SJed Brown PETSC_EXTERN PetscErrorCode DMClearGlobalVectors(DM); 6250eeb1caSToby Isaac PETSC_EXTERN PetscErrorCode DMClearLocalVectors(DM); 63e77ac854SMatthew G. Knepley PETSC_EXTERN PetscErrorCode DMHasNamedGlobalVector(DM,const char*,PetscBool*); 64014dd563SJed Brown PETSC_EXTERN PetscErrorCode DMGetNamedGlobalVector(DM,const char*,Vec*); 65014dd563SJed Brown PETSC_EXTERN PetscErrorCode DMRestoreNamedGlobalVector(DM,const char*,Vec*); 66e77ac854SMatthew G. Knepley PETSC_EXTERN PetscErrorCode DMHasNamedLocalVector(DM,const char*,PetscBool*); 672348bcf4SPeter Brune PETSC_EXTERN PetscErrorCode DMGetNamedLocalVector(DM,const char*,Vec*); 682348bcf4SPeter Brune PETSC_EXTERN PetscErrorCode DMRestoreNamedLocalVector(DM,const char*,Vec*); 69014dd563SJed Brown PETSC_EXTERN PetscErrorCode DMGetLocalToGlobalMapping(DM,ISLocalToGlobalMapping*); 70014dd563SJed Brown PETSC_EXTERN PetscErrorCode DMCreateFieldIS(DM,PetscInt*,char***,IS**); 71014dd563SJed Brown PETSC_EXTERN PetscErrorCode DMGetBlockSize(DM,PetscInt*); 72b412c318SBarry Smith PETSC_EXTERN PetscErrorCode DMCreateColoring(DM,ISColoringType,ISColoring*); 73b412c318SBarry Smith PETSC_EXTERN PetscErrorCode DMCreateMatrix(DM,Mat*); 74014dd563SJed Brown PETSC_EXTERN PetscErrorCode DMSetMatrixPreallocateOnly(DM,PetscBool); 75b06ff27eSHong Zhang PETSC_EXTERN PetscErrorCode DMSetMatrixStructureOnly(DM,PetscBool); 76014dd563SJed Brown PETSC_EXTERN PetscErrorCode DMCreateInterpolation(DM,DM,Mat*,Vec*); 773ad4599aSBarry Smith PETSC_EXTERN PetscErrorCode DMCreateRestriction(DM,DM,Mat*); 786dbf9973SLawrence Mitchell PETSC_EXTERN PetscErrorCode DMCreateInjection(DM,DM,Mat*); 79bd041c0cSMatthew G. Knepley PETSC_EXTERN PetscErrorCode DMCreateMassMatrix(DM,DM,Mat*); 8069291d52SBarry Smith PETSC_EXTERN PetscErrorCode DMGetWorkArray(DM,PetscInt,MPI_Datatype,void*); 8169291d52SBarry Smith PETSC_EXTERN PetscErrorCode DMRestoreWorkArray(DM,PetscInt,MPI_Datatype,void*); 82014dd563SJed Brown PETSC_EXTERN PetscErrorCode DMRefine(DM,MPI_Comm,DM*); 83014dd563SJed Brown PETSC_EXTERN PetscErrorCode DMCoarsen(DM,MPI_Comm,DM*); 84a8fb8f29SToby Isaac PETSC_EXTERN PetscErrorCode DMGetCoarseDM(DM,DM*); 85a8fb8f29SToby Isaac PETSC_EXTERN PetscErrorCode DMSetCoarseDM(DM,DM); 8688bdff64SToby Isaac PETSC_EXTERN PetscErrorCode DMGetFineDM(DM,DM*); 8788bdff64SToby Isaac PETSC_EXTERN PetscErrorCode DMSetFineDM(DM,DM); 88014dd563SJed Brown PETSC_EXTERN PetscErrorCode DMRefineHierarchy(DM,PetscInt,DM[]); 89014dd563SJed Brown PETSC_EXTERN PetscErrorCode DMCoarsenHierarchy(DM,PetscInt,DM[]); 90014dd563SJed Brown PETSC_EXTERN PetscErrorCode DMCoarsenHookAdd(DM,PetscErrorCode (*)(DM,DM,void*),PetscErrorCode (*)(DM,Mat,Vec,Mat,DM,void*),void*); 91dc822a44SJed Brown PETSC_EXTERN PetscErrorCode DMCoarsenHookRemove(DM,PetscErrorCode (*)(DM,DM,void*),PetscErrorCode (*)(DM,Mat,Vec,Mat,DM,void*),void*); 92014dd563SJed Brown PETSC_EXTERN PetscErrorCode DMRefineHookAdd(DM,PetscErrorCode (*)(DM,DM,void*),PetscErrorCode (*)(DM,Mat,DM,void*),void*); 933d8e3701SJed Brown PETSC_EXTERN PetscErrorCode DMRefineHookRemove(DM,PetscErrorCode (*)(DM,DM,void*),PetscErrorCode (*)(DM,Mat,DM,void*),void*); 94014dd563SJed Brown PETSC_EXTERN PetscErrorCode DMRestrict(DM,Mat,Vec,Mat,DM); 95014dd563SJed Brown PETSC_EXTERN PetscErrorCode DMInterpolate(DM,Mat,DM); 96014dd563SJed Brown PETSC_EXTERN PetscErrorCode DMSetFromOptions(DM); 97685405a1SBarry Smith PETSC_STATIC_INLINE PetscErrorCode DMViewFromOptions(DM A,PetscObject obj,const char name[]) {return PetscObjectViewFromOptions((PetscObject)A,obj,name);} 98ca266f36SBarry Smith 99a1b0c543SToby Isaac PETSC_EXTERN PetscErrorCode DMAdaptLabel(DM,DMLabel,DM*); 1000d1cd5e0SMatthew G. Knepley PETSC_EXTERN PetscErrorCode DMAdaptMetric(DM, Vec, DMLabel, DM *); 101df0b854cSToby Isaac 102014dd563SJed Brown PETSC_EXTERN PetscErrorCode DMSetUp(DM); 103014dd563SJed Brown PETSC_EXTERN PetscErrorCode DMCreateInterpolationScale(DM,DM,Mat,Vec*); 104014dd563SJed Brown PETSC_EXTERN PetscErrorCode DMCreateAggregates(DM,DM,Mat*); 105baf369e7SPeter Brune PETSC_EXTERN PetscErrorCode DMGlobalToLocalHookAdd(DM,PetscErrorCode (*)(DM,Vec,InsertMode,Vec,void*),PetscErrorCode (*)(DM,Vec,InsertMode,Vec,void*),void*); 106d4d07f1eSToby Isaac PETSC_EXTERN PetscErrorCode DMLocalToGlobalHookAdd(DM,PetscErrorCode (*)(DM,Vec,InsertMode,Vec,void*),PetscErrorCode (*)(DM,Vec,InsertMode,Vec,void*),void*); 10701729b5cSPatrick Sanan PETSC_EXTERN PetscErrorCode DMGlobalToLocal(DM,Vec,InsertMode,Vec); 108014dd563SJed Brown PETSC_EXTERN PetscErrorCode DMGlobalToLocalBegin(DM,Vec,InsertMode,Vec); 109014dd563SJed Brown PETSC_EXTERN PetscErrorCode DMGlobalToLocalEnd(DM,Vec,InsertMode,Vec); 11001729b5cSPatrick Sanan PETSC_EXTERN PetscErrorCode DMLocalToGlobal(DM,Vec,InsertMode,Vec); 111014dd563SJed Brown PETSC_EXTERN PetscErrorCode DMLocalToGlobalBegin(DM,Vec,InsertMode,Vec); 112014dd563SJed Brown PETSC_EXTERN PetscErrorCode DMLocalToGlobalEnd(DM,Vec,InsertMode,Vec); 113d78e899eSRichard Tran Mills PETSC_EXTERN PetscErrorCode DMLocalToLocalBegin(DM,Vec,InsertMode,Vec); 114d78e899eSRichard Tran Mills PETSC_EXTERN PetscErrorCode DMLocalToLocalEnd(DM,Vec,InsertMode,Vec); 11519fd82e9SBarry Smith PETSC_EXTERN PetscErrorCode DMConvert(DM,DMType,DM*); 116e1589f56SBarry Smith 117c73cfb54SMatthew G. Knepley /* Topology support */ 118c73cfb54SMatthew G. Knepley PETSC_EXTERN PetscErrorCode DMGetDimension(DM,PetscInt*); 119c73cfb54SMatthew G. Knepley PETSC_EXTERN PetscErrorCode DMSetDimension(DM,PetscInt); 120793f3fe5SMatthew G. Knepley PETSC_EXTERN PetscErrorCode DMGetDimPoints(DM,PetscInt,PetscInt*,PetscInt*); 1218e4ac7eaSMatthew G. Knepley PETSC_EXTERN PetscErrorCode DMGetUseNatural(DM,PetscBool*); 1228e4ac7eaSMatthew G. Knepley PETSC_EXTERN PetscErrorCode DMSetUseNatural(DM,PetscBool); 12346e270d4SMatthew G. Knepley 12446e270d4SMatthew G. Knepley /* Coordinate support */ 1256636e97aSMatthew G Knepley PETSC_EXTERN PetscErrorCode DMGetCoordinateDM(DM,DM*); 1261cfe2091SMatthew G. Knepley PETSC_EXTERN PetscErrorCode DMSetCoordinateDM(DM,DM); 12746e270d4SMatthew G. Knepley PETSC_EXTERN PetscErrorCode DMGetCoordinateDim(DM,PetscInt*); 12846e270d4SMatthew G. Knepley PETSC_EXTERN PetscErrorCode DMSetCoordinateDim(DM,PetscInt); 129e8abe2deSMatthew G. Knepley PETSC_EXTERN PetscErrorCode DMGetCoordinateSection(DM,PetscSection*); 13046e270d4SMatthew G. Knepley PETSC_EXTERN PetscErrorCode DMSetCoordinateSection(DM,PetscInt,PetscSection); 1316636e97aSMatthew G Knepley PETSC_EXTERN PetscErrorCode DMGetCoordinates(DM,Vec*); 1326636e97aSMatthew G Knepley PETSC_EXTERN PetscErrorCode DMSetCoordinates(DM,Vec); 1336636e97aSMatthew G Knepley PETSC_EXTERN PetscErrorCode DMGetCoordinatesLocal(DM,Vec*); 13481e9a530SVaclav Hapla PETSC_EXTERN PetscErrorCode DMGetCoordinatesLocalSetUp(DM); 13581e9a530SVaclav Hapla PETSC_EXTERN PetscErrorCode DMGetCoordinatesLocalNoncollective(DM,Vec*); 1362db98f8dSVaclav Hapla PETSC_EXTERN PetscErrorCode DMGetCoordinatesLocalTuple(DM,IS,PetscSection*,Vec*); 1376636e97aSMatthew G Knepley PETSC_EXTERN PetscErrorCode DMSetCoordinatesLocal(DM,Vec); 13862a38674SMatthew G. Knepley PETSC_EXTERN PetscErrorCode DMLocatePoints(DM,Vec,DMPointLocationType,PetscSF*); 13990b157c4SStefano Zampini PETSC_EXTERN PetscErrorCode DMGetPeriodicity(DM,PetscBool*,const PetscReal**,const PetscReal**,const DMBoundaryType**); 14090b157c4SStefano Zampini PETSC_EXTERN PetscErrorCode DMSetPeriodicity(DM,PetscBool,const PetscReal[],const PetscReal[],const DMBoundaryType[]); 141e907e85cSMatthew G. Knepley PETSC_EXTERN PetscErrorCode DMLocalizeCoordinate(DM, const PetscScalar[], PetscBool, PetscScalar[]); 1422e17dfb7SMatthew G. Knepley PETSC_EXTERN PetscErrorCode DMLocalizeCoordinates(DM); 14336447a5eSToby Isaac PETSC_EXTERN PetscErrorCode DMGetCoordinatesLocalized(DM,PetscBool*); 1448f700142SStefano Zampini PETSC_EXTERN PetscErrorCode DMGetCoordinatesLocalizedLocal(DM,PetscBool*); 1453c73bf98SDave May PETSC_EXTERN PetscErrorCode DMGetNeighbors(DM,PetscInt*,const PetscMPIInt**); 146f19dbd58SToby Isaac PETSC_EXTERN PetscErrorCode DMGetCoordinateField(DM,DMField*); 147f19dbd58SToby Isaac PETSC_EXTERN PetscErrorCode DMSetCoordinateField(DM,DMField); 1486636e97aSMatthew G Knepley 1495dbd56e3SPeter Brune /* block hook interface */ 150be081cd6SPeter Brune PETSC_EXTERN PetscErrorCode DMSubDomainHookAdd(DM,PetscErrorCode (*)(DM,DM,void*),PetscErrorCode (*)(DM,VecScatter,VecScatter,DM,void*),void*); 151b3a6b972SJed Brown PETSC_EXTERN PetscErrorCode DMSubDomainHookRemove(DM,PetscErrorCode (*)(DM,DM,void*),PetscErrorCode (*)(DM,VecScatter,VecScatter,DM,void*),void*); 152be081cd6SPeter Brune PETSC_EXTERN PetscErrorCode DMSubDomainRestrict(DM,VecScatter,VecScatter,DM); 1535dbd56e3SPeter Brune 154014dd563SJed Brown PETSC_EXTERN PetscErrorCode DMSetOptionsPrefix(DM,const char []); 15531697293SDave May PETSC_EXTERN PetscErrorCode DMAppendOptionsPrefix(DM,const char []); 15631697293SDave May PETSC_EXTERN PetscErrorCode DMGetOptionsPrefix(DM,const char*[]); 15719fd82e9SBarry Smith PETSC_EXTERN PetscErrorCode DMSetVecType(DM,VecType); 158c0dedaeaSBarry Smith PETSC_EXTERN PetscErrorCode DMGetVecType(DM,VecType*); 15919fd82e9SBarry Smith PETSC_EXTERN PetscErrorCode DMSetMatType(DM,MatType); 160c0dedaeaSBarry Smith PETSC_EXTERN PetscErrorCode DMGetMatType(DM,MatType*); 1618f1509bcSBarry Smith PETSC_EXTERN PetscErrorCode DMSetISColoringType(DM,ISColoringType); 1628f1509bcSBarry Smith PETSC_EXTERN PetscErrorCode DMGetISColoringType(DM,ISColoringType*); 163014dd563SJed Brown PETSC_EXTERN PetscErrorCode DMSetApplicationContext(DM,void*); 164014dd563SJed Brown PETSC_EXTERN PetscErrorCode DMSetApplicationContextDestroy(DM,PetscErrorCode (*)(void**)); 165014dd563SJed Brown PETSC_EXTERN PetscErrorCode DMGetApplicationContext(DM,void*); 166014dd563SJed Brown PETSC_EXTERN PetscErrorCode DMSetVariableBounds(DM,PetscErrorCode (*)(DM,Vec,Vec)); 167014dd563SJed Brown PETSC_EXTERN PetscErrorCode DMHasVariableBounds(DM,PetscBool *); 168b0ae01b7SPeter Brune PETSC_EXTERN PetscErrorCode DMHasColoring(DM,PetscBool *); 1693ad4599aSBarry Smith PETSC_EXTERN PetscErrorCode DMHasCreateRestriction(DM,PetscBool *); 170a7058e45SLawrence Mitchell PETSC_EXTERN PetscErrorCode DMHasCreateInjection(DM,PetscBool *); 171014dd563SJed Brown PETSC_EXTERN PetscErrorCode DMComputeVariableBounds(DM,Vec,Vec); 17293d92d96SBarry Smith 17337bc7515SMatthew G. Knepley PETSC_EXTERN PetscErrorCode DMCreateSubDM(DM, PetscInt, const PetscInt[], IS *, DM *); 1742adcc780SMatthew G. Knepley PETSC_EXTERN PetscErrorCode DMCreateSuperDM(DM[], PetscInt, IS **, DM *); 17516621825SDmitry Karpeev PETSC_EXTERN PetscErrorCode DMCreateFieldDecomposition(DM,PetscInt*,char***,IS**,DM**); 1768d4ac253SDmitry Karpeev PETSC_EXTERN PetscErrorCode DMCreateDomainDecomposition(DM,PetscInt*,char***,IS**,IS**,DM**); 177e30e807fSPeter Brune PETSC_EXTERN PetscErrorCode DMCreateDomainDecompositionScatters(DM,PetscInt,DM*,VecScatter**,VecScatter**,VecScatter**); 178e7c4fc90SDmitry Karpeev 179014dd563SJed Brown PETSC_EXTERN PetscErrorCode DMGetRefineLevel(DM,PetscInt*); 180fef3a512SBarry Smith PETSC_EXTERN PetscErrorCode DMSetRefineLevel(DM,PetscInt); 181014dd563SJed Brown PETSC_EXTERN PetscErrorCode DMGetCoarsenLevel(DM,PetscInt*); 182014dd563SJed Brown PETSC_EXTERN PetscErrorCode DMFinalizePackage(void); 183e1589f56SBarry Smith 1845f1ad066SMatthew G Knepley PETSC_EXTERN PetscErrorCode VecGetDM(Vec, DM*); 1855f1ad066SMatthew G Knepley PETSC_EXTERN PetscErrorCode VecSetDM(Vec, DM); 186c688c046SMatthew G Knepley PETSC_EXTERN PetscErrorCode MatGetDM(Mat, DM*); 187c688c046SMatthew G Knepley PETSC_EXTERN PetscErrorCode MatSetDM(Mat, DM); 188531c7667SBarry Smith PETSC_EXTERN PetscErrorCode MatFDColoringUseDM(Mat,MatFDColoring); 1895f1ad066SMatthew G Knepley 190e1589f56SBarry Smith typedef struct NLF_DAAD* NLF; 191e1589f56SBarry Smith 192bc2bf880SBarry Smith #define DM_FILE_CLASSID 1211221 1937da65231SMatthew G Knepley 1947da65231SMatthew G Knepley /* FEM support */ 195014dd563SJed Brown PETSC_EXTERN PetscErrorCode DMPrintCellVector(PetscInt, const char [], PetscInt, const PetscScalar []); 196014dd563SJed Brown PETSC_EXTERN PetscErrorCode DMPrintCellMatrix(PetscInt, const char [], PetscInt, PetscInt, const PetscScalar []); 1976113b454SMatthew G. Knepley PETSC_EXTERN PetscErrorCode DMPrintLocalVec(DM, const char [], PetscReal, Vec); 1987da65231SMatthew G Knepley 199f9d4088aSMatthew G. Knepley PETSC_EXTERN PetscErrorCode DMSetNullSpaceConstructor(DM, PetscInt, PetscErrorCode (*)(DM, PetscInt, MatNullSpace *)); 200f9d4088aSMatthew G. Knepley PETSC_EXTERN PetscErrorCode DMGetNullSpaceConstructor(DM, PetscInt, PetscErrorCode (**)(DM, PetscInt, MatNullSpace *)); 201f9d4088aSMatthew G. Knepley PETSC_EXTERN PetscErrorCode DMSetNearNullSpaceConstructor(DM, PetscInt, PetscErrorCode (*)(DM, PetscInt, MatNullSpace *)); 202f9d4088aSMatthew G. Knepley PETSC_EXTERN PetscErrorCode DMGetNearNullSpaceConstructor(DM, PetscInt, PetscErrorCode (**)(DM, PetscInt, MatNullSpace *)); 203f9d4088aSMatthew G. Knepley 204e87a4003SBarry Smith PETSC_EXTERN PetscErrorCode DMGetSection(DM, PetscSection *); 205e87a4003SBarry Smith PETSC_EXTERN PetscErrorCode DMSetSection(DM, PetscSection); 2069435951eSToby Isaac PETSC_EXTERN PetscErrorCode DMGetDefaultConstraints(DM, PetscSection *, Mat *); 2079435951eSToby Isaac PETSC_EXTERN PetscErrorCode DMSetDefaultConstraints(DM, PetscSection, Mat); 208e87a4003SBarry Smith PETSC_EXTERN PetscErrorCode DMGetGlobalSection(DM, PetscSection *); 209e87a4003SBarry Smith PETSC_EXTERN PetscErrorCode DMSetGlobalSection(DM, PetscSection); 210014dd563SJed Brown PETSC_EXTERN PetscErrorCode DMGetDefaultSF(DM, PetscSF *); 211014dd563SJed Brown PETSC_EXTERN PetscErrorCode DMSetDefaultSF(DM, PetscSF); 212014dd563SJed Brown PETSC_EXTERN PetscErrorCode DMCreateDefaultSF(DM, PetscSection, PetscSection); 213b21d0597SMatthew G Knepley PETSC_EXTERN PetscErrorCode DMGetPointSF(DM, PetscSF *); 214057b4bcdSMatthew G Knepley PETSC_EXTERN PetscErrorCode DMSetPointSF(DM, PetscSF); 21588ed4aceSMatthew G Knepley 216f7e04a3dSKarl Rupp PETSC_STATIC_INLINE PetscErrorCode DMGetDefaultSection(DM dm, PetscSection *s) {return DMGetSection(dm,s);} 217f7e04a3dSKarl Rupp PETSC_STATIC_INLINE PetscErrorCode DMSetDefaultSection(DM dm, PetscSection s) {return DMSetSection(dm,s);} 218f7e04a3dSKarl Rupp PETSC_STATIC_INLINE PetscErrorCode DMGetDefaultGlobalSection(DM dm, PetscSection *s) {return DMGetGlobalSection(dm,s);} 219f7e04a3dSKarl Rupp PETSC_STATIC_INLINE PetscErrorCode DMSetDefaultGlobalSection(DM dm, PetscSection s) {return DMSetGlobalSection(dm,s);} 220e87a4003SBarry Smith 221e87a4003SBarry Smith 22214f150ffSMatthew G. Knepley PETSC_EXTERN PetscErrorCode DMGetOutputDM(DM, DM *); 223cdb7a50dSMatthew G. Knepley PETSC_EXTERN PetscErrorCode DMGetOutputSequenceNumber(DM, PetscInt *, PetscReal *); 224cdb7a50dSMatthew G. Knepley PETSC_EXTERN PetscErrorCode DMSetOutputSequenceNumber(DM, PetscInt, PetscReal); 225cdb7a50dSMatthew G. Knepley PETSC_EXTERN PetscErrorCode DMOutputSequenceLoad(DM, PetscViewer, const char *, PetscInt, PetscReal *); 22614f150ffSMatthew G. Knepley 2272764a2aaSMatthew G. Knepley PETSC_EXTERN PetscErrorCode DMGetDS(DM, PetscDS *); 2282764a2aaSMatthew G. Knepley PETSC_EXTERN PetscErrorCode DMSetDS(DM, PetscDS); 229af122d2aSMatthew G Knepley PETSC_EXTERN PetscErrorCode DMGetNumFields(DM, PetscInt *); 230af122d2aSMatthew G Knepley PETSC_EXTERN PetscErrorCode DMSetNumFields(DM, PetscInt); 231*44a7f3ddSMatthew G. Knepley PETSC_EXTERN PetscErrorCode DMGetField(DM, PetscInt, DMLabel *, PetscObject *); 232*44a7f3ddSMatthew G. Knepley PETSC_EXTERN PetscErrorCode DMSetField(DM, PetscInt, DMLabel, PetscObject); 233*44a7f3ddSMatthew G. Knepley PETSC_EXTERN PetscErrorCode DMAddField(DM, DMLabel, PetscObject); 234*44a7f3ddSMatthew G. Knepley PETSC_EXTERN PetscErrorCode DMClearFields(DM); 235af122d2aSMatthew G Knepley 2364267b1a3SMatthew G. Knepley /*MC 2374267b1a3SMatthew G. Knepley DMInterpolationInfo - Structure for holding information about interpolation on a mesh 2384267b1a3SMatthew G. Knepley 2394267b1a3SMatthew G. Knepley Level: intermediate 2404267b1a3SMatthew G. Knepley 2414267b1a3SMatthew G. Knepley Synopsis: 2424267b1a3SMatthew G. Knepley comm - The communicator 2434267b1a3SMatthew G. Knepley dim - The spatial dimension of points 2444267b1a3SMatthew G. Knepley nInput - The number of input points 2454267b1a3SMatthew G. Knepley points - The input point coordinates 2464267b1a3SMatthew G. Knepley cells - The cell containing each point 2474267b1a3SMatthew G. Knepley n - The number of local points 2484267b1a3SMatthew G. Knepley coords - The point coordinates 2494267b1a3SMatthew G. Knepley dof - The number of components to interpolate 2504267b1a3SMatthew G. Knepley 2514267b1a3SMatthew G. Knepley .seealso: DMInterpolationCreate(), DMInterpolationEvaluate(), DMInterpolationAddPoints() 2524267b1a3SMatthew G. Knepley M*/ 253e87bb0d3SMatthew G Knepley struct _DMInterpolationInfo { 254e87bb0d3SMatthew G Knepley MPI_Comm comm; 255e87bb0d3SMatthew G Knepley PetscInt dim; /*1 The spatial dimension of points */ 256e87bb0d3SMatthew G Knepley PetscInt nInput; /* The number of input points */ 257e87bb0d3SMatthew G Knepley PetscReal *points; /* The input point coordinates */ 258e87bb0d3SMatthew G Knepley PetscInt *cells; /* The cell containing each point */ 259e87bb0d3SMatthew G Knepley PetscInt n; /* The number of local points */ 260e87bb0d3SMatthew G Knepley Vec coords; /* The point coordinates */ 261e87bb0d3SMatthew G Knepley PetscInt dof; /* The number of components to interpolate */ 262e87bb0d3SMatthew G Knepley }; 263e87bb0d3SMatthew G Knepley typedef struct _DMInterpolationInfo *DMInterpolationInfo; 264e87bb0d3SMatthew G Knepley 26594b4b8a8SMatthew G. Knepley PETSC_EXTERN PetscErrorCode DMInterpolationCreate(MPI_Comm, DMInterpolationInfo *); 26694b4b8a8SMatthew G. Knepley PETSC_EXTERN PetscErrorCode DMInterpolationSetDim(DMInterpolationInfo, PetscInt); 26794b4b8a8SMatthew G. Knepley PETSC_EXTERN PetscErrorCode DMInterpolationGetDim(DMInterpolationInfo, PetscInt *); 26894b4b8a8SMatthew G. Knepley PETSC_EXTERN PetscErrorCode DMInterpolationSetDof(DMInterpolationInfo, PetscInt); 26994b4b8a8SMatthew G. Knepley PETSC_EXTERN PetscErrorCode DMInterpolationGetDof(DMInterpolationInfo, PetscInt *); 27094b4b8a8SMatthew G. Knepley PETSC_EXTERN PetscErrorCode DMInterpolationAddPoints(DMInterpolationInfo, PetscInt, PetscReal[]); 27194b4b8a8SMatthew G. Knepley PETSC_EXTERN PetscErrorCode DMInterpolationSetUp(DMInterpolationInfo, DM, PetscBool); 27294b4b8a8SMatthew G. Knepley PETSC_EXTERN PetscErrorCode DMInterpolationGetCoordinates(DMInterpolationInfo, Vec *); 27394b4b8a8SMatthew G. Knepley PETSC_EXTERN PetscErrorCode DMInterpolationGetVector(DMInterpolationInfo, Vec *); 27494b4b8a8SMatthew G. Knepley PETSC_EXTERN PetscErrorCode DMInterpolationRestoreVector(DMInterpolationInfo, Vec *); 27594b4b8a8SMatthew G. Knepley PETSC_EXTERN PetscErrorCode DMInterpolationEvaluate(DMInterpolationInfo, DM, Vec, Vec); 27694b4b8a8SMatthew G. Knepley PETSC_EXTERN PetscErrorCode DMInterpolationDestroy(DMInterpolationInfo *); 277c58f1c22SToby Isaac 278c58f1c22SToby Isaac PETSC_EXTERN PetscErrorCode DMCreateLabel(DM, const char []); 279c58f1c22SToby Isaac PETSC_EXTERN PetscErrorCode DMGetLabelValue(DM, const char[], PetscInt, PetscInt *); 280c58f1c22SToby Isaac PETSC_EXTERN PetscErrorCode DMSetLabelValue(DM, const char[], PetscInt, PetscInt); 281c58f1c22SToby Isaac PETSC_EXTERN PetscErrorCode DMClearLabelValue(DM, const char[], PetscInt, PetscInt); 282c58f1c22SToby Isaac PETSC_EXTERN PetscErrorCode DMGetLabelSize(DM, const char[], PetscInt *); 283c58f1c22SToby Isaac PETSC_EXTERN PetscErrorCode DMGetLabelIdIS(DM, const char[], IS *); 284c58f1c22SToby Isaac PETSC_EXTERN PetscErrorCode DMGetStratumSize(DM, const char [], PetscInt, PetscInt *); 285c58f1c22SToby Isaac PETSC_EXTERN PetscErrorCode DMGetStratumIS(DM, const char [], PetscInt, IS *); 2864de306b1SToby Isaac PETSC_EXTERN PetscErrorCode DMSetStratumIS(DM, const char [], PetscInt, IS); 287c58f1c22SToby Isaac PETSC_EXTERN PetscErrorCode DMClearLabelStratum(DM, const char[], PetscInt); 288c58f1c22SToby Isaac PETSC_EXTERN PetscErrorCode DMGetLabelOutput(DM, const char[], PetscBool *); 289c58f1c22SToby Isaac PETSC_EXTERN PetscErrorCode DMSetLabelOutput(DM, const char[], PetscBool); 290c58f1c22SToby Isaac 291c58f1c22SToby Isaac PETSC_EXTERN PetscErrorCode DMGetNumLabels(DM, PetscInt *); 292c58f1c22SToby Isaac PETSC_EXTERN PetscErrorCode DMGetLabelName(DM, PetscInt, const char **); 293c58f1c22SToby Isaac PETSC_EXTERN PetscErrorCode DMHasLabel(DM, const char [], PetscBool *); 294c58f1c22SToby Isaac PETSC_EXTERN PetscErrorCode DMGetLabel(DM, const char *, DMLabel *); 295c58f1c22SToby Isaac PETSC_EXTERN PetscErrorCode DMGetLabelByNum(DM, PetscInt, DMLabel *); 296c58f1c22SToby Isaac PETSC_EXTERN PetscErrorCode DMAddLabel(DM, DMLabel); 297c58f1c22SToby Isaac PETSC_EXTERN PetscErrorCode DMRemoveLabel(DM, const char [], DMLabel *); 298c58f1c22SToby Isaac PETSC_EXTERN PetscErrorCode DMCopyLabels(DM, DM); 299c58f1c22SToby Isaac 300a30ec4eaSSatish Balay PETSC_EXTERN PetscErrorCode DMAddBoundary(DM, DMBoundaryConditionType, const char[], const char[], PetscInt, PetscInt, const PetscInt *, void (*)(void), PetscInt, const PetscInt *, void *); 301a6ba4734SToby Isaac PETSC_EXTERN PetscErrorCode DMGetNumBoundary(DM, PetscInt *); 302a30ec4eaSSatish Balay PETSC_EXTERN PetscErrorCode DMGetBoundary(DM, PetscInt, DMBoundaryConditionType *, const char **, const char **, PetscInt *, PetscInt *, const PetscInt **, void (**)(void), PetscInt *, const PetscInt **, void **); 303a6ba4734SToby Isaac PETSC_EXTERN PetscErrorCode DMIsBoundaryPoint(DM, PetscInt, PetscBool *); 304a6ba4734SToby Isaac PETSC_EXTERN PetscErrorCode DMCopyBoundary(DM, DM); 3054d6f44ffSToby Isaac 3060709b2feSToby Isaac PETSC_EXTERN PetscErrorCode DMProjectFunction(DM,PetscReal,PetscErrorCode(**)(PetscInt,PetscReal,const PetscReal[],PetscInt,PetscScalar *,void *),void**,InsertMode,Vec); 3070709b2feSToby Isaac PETSC_EXTERN PetscErrorCode DMProjectFunctionLocal(DM,PetscReal,PetscErrorCode(**)(PetscInt,PetscReal,const PetscReal[],PetscInt,PetscScalar *,void *),void**,InsertMode,Vec); 3082c53366bSMatthew 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); 3091c531cf8SMatthew 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); 310191494d9SMatthew 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); 3111c531cf8SMatthew 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); 3120709b2feSToby Isaac PETSC_EXTERN PetscErrorCode DMComputeL2Diff(DM,PetscReal,PetscErrorCode(**)(PetscInt,PetscReal,const PetscReal[],PetscInt,PetscScalar *,void *),void **,Vec,PetscReal *); 313b698f381SToby Isaac PETSC_EXTERN PetscErrorCode DMComputeL2GradientDiff(DM, PetscReal, PetscErrorCode (**)(PetscInt, PetscReal, const PetscReal [], const PetscReal [], PetscInt, PetscScalar *, void *), void **, Vec, const PetscReal [], PetscReal *); 3141189c1efSToby Isaac PETSC_EXTERN PetscErrorCode DMComputeL2FieldDiff(DM,PetscReal,PetscErrorCode(**)(PetscInt,PetscReal,const PetscReal[],PetscInt,PetscScalar *,void *),void **,Vec,PetscReal *); 3158320bc6fSPatrick Sanan 3160a50eb56SMatthew G. Knepley PETSC_EXTERN PetscErrorCode DMGetNullSpaceConstructor(DM, PetscInt, PetscErrorCode (**)(DM, PetscInt, MatNullSpace *)); 3170a50eb56SMatthew G. Knepley PETSC_EXTERN PetscErrorCode DMSetNullSpaceConstructor(DM, PetscInt, PetscErrorCode (*)(DM, PetscInt, MatNullSpace *)); 318bb104ea6SMatthew G. Knepley 3198320bc6fSPatrick Sanan PETSC_EXTERN PetscErrorCode DMGetCompatibility(DM,DM,PetscBool*,PetscBool*); 320e1589f56SBarry Smith #endif 321