# PetscSpaceGetDimension
Return the dimension of this space, i.e. the number of basis vectors 
## Synopsis
```
#include "petscfe.h"  
PetscErrorCode PetscSpaceGetDimension(PetscSpace sp, PetscInt *dim)
```

## Input Parameter

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



## Output Parameter

- ***dim -*** The dimension





## See Also
 `PetscSpace`, `PetscSpaceGetDegree()`, `PetscSpaceCreate()`, `PetscSpace`

## Level
intermediate

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

## Implementations

<A HREF="PETSC_DOC_OUT_ROOT_PLACEHOLDER/src/dm/dt/space/impls/point/spacepoint.c.html#PetscSpaceGetDimension_Point">PetscSpaceGetDimension_Point in src/dm/dt/space/impls/point/spacepoint.c</A><BR>
<A HREF="PETSC_DOC_OUT_ROOT_PLACEHOLDER/src/dm/dt/space/impls/poly/spacepoly.c.html#PetscSpaceGetDimension_Polynomial">PetscSpaceGetDimension_Polynomial in src/dm/dt/space/impls/poly/spacepoly.c</A><BR>
<A HREF="PETSC_DOC_OUT_ROOT_PLACEHOLDER/src/dm/dt/space/impls/ptrimmed/spaceptrimmed.c.html#PetscSpaceGetDimension_Ptrimmed">PetscSpaceGetDimension_Ptrimmed in src/dm/dt/space/impls/ptrimmed/spaceptrimmed.c</A><BR>
<A HREF="PETSC_DOC_OUT_ROOT_PLACEHOLDER/src/dm/dt/space/impls/subspace/spacesubspace.c.html#PetscSpaceGetDimension_Subspace">PetscSpaceGetDimension_Subspace in src/dm/dt/space/impls/subspace/spacesubspace.c</A><BR>
<A HREF="PETSC_DOC_OUT_ROOT_PLACEHOLDER/src/dm/dt/space/impls/sum/spacesum.c.html#PetscSpaceGetDimension_Sum">PetscSpaceGetDimension_Sum in src/dm/dt/space/impls/sum/spacesum.c</A><BR>
<A HREF="PETSC_DOC_OUT_ROOT_PLACEHOLDER/src/dm/dt/space/impls/tensor/spacetensor.c.html#PetscSpaceGetDimension_Tensor">PetscSpaceGetDimension_Tensor in src/dm/dt/space/impls/tensor/spacetensor.c</A><BR>
<A HREF="PETSC_DOC_OUT_ROOT_PLACEHOLDER/src/dm/dt/space/impls/wxy/spacewxy.c.html#PetscSpaceGetDimension_WXY">PetscSpaceGetDimension_WXY in src/dm/dt/space/impls/wxy/spacewxy.c</A><BR>


---
[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)  
