petsc-3.7.3 2016-08-01
Report Typos and Errors

DMForestGetAdaptivityPurpose

Get whether the current DM is being adapted from its source (set with DMForestSetAdaptivityForest()) for the purpose of refinement (DM_FOREST_REFINE), coarsening (DM_FOREST_COARSEN), or undefined (DM_FOREST_NONE). This only matters for the purposes of 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()), then this can cause a memory leak. This method is used by subtypes of DMForest when automatically constructing mesh hierarchies.

Synopsis

#include "petscdmforest.h" 
#include "petscdm.h" 
PetscErrorCode DMForestGetAdaptivityPurpose(DM dm, DMForestAdaptivityPurpose *purpose)
Not collective

Input Parameter

dm -the forest

Output Parameter

purpose -the adaptivity purpose (DM_FOREST_NONE/DM_FOREST_REFINE/DM_FOREST_COARSEN)

See Also

DMForestTemplate(), DMForestSetAdaptivityForest(), DMForestGetAdaptivityForest()

Level:advanced
Location:
src/dm/impls/forest/forest.c
Index of all DM routines
Table of Contents for all manual pages
Index of all manual pages