Actual source code: dmforestimpl.h

  1: #pragma once

  3: #include <petscmat.h>
  4: #include <petscdmforest.h>
  5: #include <petscbt.h>
  6: #include <petsc/private/dmimpl.h>

  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;

 45: PETSC_EXTERN PetscErrorCode DMCreate_Forest(DM);
 46: PETSC_EXTERN PetscErrorCode DMClone_Forest(DM, DM *);
 47: PETSC_EXTERN PetscErrorCode DMSetFromOptions_Forest(DM, PetscOptionItems *);
 48: PETSC_INTERN PetscErrorCode DMAdaptLabel_Forest(DM, Vec, DMLabel, DMLabel, DM *);