1 #pragma once 2 3 #include <petscmat.h> /*I "petscmat.h" I*/ 4 #include <petscdmforest.h> /*I "petscdmforest.h" I*/ 5 #include <petscbt.h> 6 #include <petsc/private/dmimpl.h> 7 8 typedef struct { 9 PetscInt refct; 10 void *data; 11 PetscErrorCode (*clearadaptivityforest)(DM); 12 PetscErrorCode (*getadaptivitysuccess)(DM, PetscBool *); 13 PetscErrorCode (*transfervec)(DM, Vec, DM, Vec, PetscBool, PetscReal); 14 PetscErrorCode (*transfervecfrombase)(DM, Vec, Vec); 15 PetscErrorCode (*createcellchart)(DM, PetscInt *, PetscInt *); 16 PetscErrorCode (*createcellsf)(DM, PetscSF *); 17 PetscErrorCode (*destroy)(DM); 18 PetscErrorCode (*ftemplate)(DM, DM); 19 PetscBool computeAdaptSF; 20 PetscErrorCode (*mapcoordinates)(DM, PetscInt, PetscInt, const PetscReal[], PetscReal[], void *); 21 void *mapcoordinatesctx; 22 DMForestTopology topology; 23 DM base; 24 DM adapt; 25 DMAdaptFlag adaptPurpose; 26 PetscInt adjDim; 27 PetscInt overlap; 28 PetscInt minRefinement; 29 PetscInt maxRefinement; 30 PetscInt initRefinement; 31 PetscInt cStart; 32 PetscInt cEnd; 33 PetscSF cellSF; 34 PetscSF preCoarseToFine; 35 PetscSF coarseToPreFine; 36 DMLabel adaptLabel; 37 DMForestAdaptivityStrategy adaptStrategy; 38 PetscInt gradeFactor; 39 PetscReal *cellWeights; 40 PetscCopyMode cellWeightsCopyMode; 41 PetscReal weightsFactor; 42 PetscReal weightCapacity; 43 } DM_Forest; 44 45 PETSC_EXTERN PetscErrorCode DMCreate_Forest(DM); 46 PETSC_INTERN PetscErrorCode DMClone_Forest(DM, DM *); 47 PETSC_INTERN PetscErrorCode DMSetFromOptions_Forest(DM, PetscOptionItems); 48 PETSC_INTERN PetscErrorCode DMAdaptLabel_Forest(DM, Vec, DMLabel, DMLabel, DM *); 49