DMForestGetAdaptivityPurpose#

Get whether the current DM is being adapted from its source (set with DMForestSetAdaptivityForest()) for the purpose of refinement (DM_ADAPT_REFINE), coarsening (DM_ADAPT_COARSEN), coarsening only the last level (DM_ADAPT_COARSEN_LAST) or undefined (DM_ADAPT_DETERMINE).

Synopsis#

#include "petscdmforest.h" 
#include "petscdm.h" 
#include "petscdmlabel.h" 
PetscErrorCode DMForestGetAdaptivityPurpose(DM dm, DMAdaptFlag *purpose)

Not Collective

Input Parameter#

  • dm - the forest

Output Parameter#

  • purpose - the adaptivity purpose

Notes#

This only matters for reference counting: during DMDestroy(). Cyclic references can be found between DMs only if the cyclic reference is due to a fine/coarse relationship (See DMSetFineDM()/DMSetCoarseDM()). If the purpose is not refinement or coarsening, and the user does not maintain a reference to the post-adaptation forest (i.e., the one created by DMForestTemplate()), this can cause a memory leak. This method is used by subtypes of DMFOREST when automatically constructing mesh hierarchies.

See Also#

DM, DMFOREST, DMForestTemplate(), DMForestSetAdaptivityForest(), DMForestGetAdaptivityForest(), DMAdaptFlag

Level#

advanced

Location#

src/dm/impls/forest/forest.c


Index of all DMForest routines
Table of Contents for all manual pages
Index of all manual pages