# PetscSpaceGetNumComponents
Return the number of components for this space 
## Synopsis
```
#include "petscfe.h"  
PetscErrorCode PetscSpaceGetNumComponents(PetscSpace sp, PetscInt *Nc)
```

## Input Parameter

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



## Output Parameter

- ***Nc -*** The number of components





## Note
A vector space, for example, will have d components, where d is the spatial dimension


## See Also
 `PetscSpace`, `PetscSpaceSetNumComponents()`, `PetscSpaceGetNumVariables()`, `PetscSpaceGetDimension()`, `PetscSpaceCreate()`, `PetscSpace`

## Level
intermediate

## Location
<A HREF="PETSC_DOC_OUT_ROOT_PLACEHOLDER/src/dm/dt/space/interface/space.c.html#PetscSpaceGetNumComponents">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)  
