# PetscSectionGetMaxDof
Return the maximum number of degrees of freedom on any point in the chart 
## Synopsis
```
#include "petscsection.h"   
PetscErrorCode PetscSectionGetMaxDof(PetscSection s, PetscInt *maxDof)
```
Not Collective


## Input Parameters

- ***s -*** the `PetscSection`



## Output Parameter

- ***maxDof -*** the maximum dof





## Note
The returned number is up-to-date without need for `PetscSectionSetUp()`.


## Developer Note
The returned number is calculated lazily and stashed.

A call to `PetscSectionInvalidateMaxDof_Internal()` invalidates the stashed value.

`PetscSectionInvalidateMaxDof_Internal()` is called in `PetscSectionSetDof()`, `PetscSectionAddDof()` and `PetscSectionReset()`

It should also be called every time atlasDof is modified directly.


## See Also
 [PetscSection](sec_petscsection), `PetscSection`, `PetscSectionGetDof()`, `PetscSectionSetDof()`, `PetscSectionAddDof()`, `PetscSectionCreate()`

## Level
intermediate

## Location
<A HREF="PETSC_DOC_OUT_ROOT_PLACEHOLDER/src/vec/is/section/interface/section.c.html#PetscSectionGetMaxDof">src/vec/is/section/interface/section.c</A>


---
[Edit on GitLab](https://gitlab.com/petsc/petsc/-/edit/release/src/vec/is/section/interface/section.c)


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