# DMForestGetAdaptivitySuccess
Return whether the requested adaptation (refinement, coarsening, repartitioning, etc.) was successful.  PETSC_FALSE indicates that the post-adaptation forest is the same as the pre-adpatation forest.  A requested adaptation may have been unsuccessful if, for example, the requested refinement would have exceeded the maximum refinement level. 
## Synopsis
```
#include "petscdmforest.h" 
#include "petscdm.h" 
#include "petscdmlabel.h" 
PetscErrorCode DMForestGetAdaptivitySuccess(DM dm, PetscBool *success)
```
Collective on dm


## Input Parameter


- ***dm -*** the post-adaptation forest



## Output Parameter


- ***success -*** PETSC_TRUE if the post-adaptation forest is different from the pre-adaptation forest.





## See Also
@*/
PetscErrorCode DMForestGetAdaptivitySuccess(DM dm, PetscBool *success)
{
DM_Forest *forest;

PetscFunctionBegin;
PetscValidHeaderSpecific(dm, DM_CLASSID, 1);
PetscCheck(dm->setupcalled, PetscObjectComm((PetscObject)dm), PETSC_ERR_ARG_WRONGSTATE, "DMSetUp() has not been called yet.");
forest = (DM_Forest *)dm->data;
PetscCall((forest->getadaptivitysuccess)(dm, success));
PetscFunctionReturn(0);
}

/*@
DMForestSetComputeAdaptivitySF - During the pre-setup phase, set whether transfer PetscSFs should be computed
relating the cells of the pre-adaptation forest to the post-adaptiation forest.  After DMSetUp() is called, these transfer PetscSFs can be accessed with DMForestGetAdaptivitySF().

Logically collective on dm


## Input Parameters

- ***dm -*** the post-adaptation forest
- ***computeSF -*** default PETSC_TRUE





## See Also
 `DMForestGetComputeAdaptivitySF()`, `DMForestGetAdaptivitySF()`

## Level
intermediate

## Location
<A HREF="PETSC_DOC_OUT_ROOT_PLACEHOLDER/src/dm/impls/forest/forest.c.html#DMForestGetAdaptivitySuccess">src/dm/impls/forest/forest.c</A>

## Implementations

<A HREF="PETSC_DOC_OUT_ROOT_PLACEHOLDER/src/dm/impls/forest/p4est/pforest.h.html#DMForestGetAdaptivitySuccess_pforest">DMForestGetAdaptivitySuccess_pforest in src/dm/impls/forest/p4est/pforest.h</A><BR>


---
[Edit on GitLab](https://gitlab.com/petsc/petsc/-/edit/release/src/dm/impls/forest/forest.c)


[Index of all DMForest routines](index.md)  
[Table of Contents for all manual pages](/docs/manualpages/index.md)  
[Index of all manual pages](/docs/manualpages/singleindex.md)  
