# PetscSpaceGetNumVariables
Return the number of variables for this space 
## Synopsis
```
#include "petscfe.h"  
PetscErrorCode PetscSpaceGetNumVariables(PetscSpace sp, PetscInt *n)
```

## Input Parameter

- ***sp -*** The `PetscSpace`



## Output Parameter

- ***Nc -*** The number of variables, e.g. x, y, z...





## See Also
 `PetscSpace`, `PetscSpaceSetNumVariables()`, `PetscSpaceGetNumComponents()`, `PetscSpaceGetDimension()`, `PetscSpaceCreate()`, `PetscSpace`

## Level
intermediate

## Location
<A HREF="PETSC_DOC_OUT_ROOT_PLACEHOLDER/src/dm/dt/space/interface/space.c.html#PetscSpaceGetNumVariables">src/dm/dt/space/interface/space.c</A>


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


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