# PetscSpaceSetFromOptions
sets parameters in a `PetscSpace` from the options database 
## Synopsis
```
#include "petscfe.h"  
PetscErrorCode PetscSpaceSetFromOptions(PetscSpace sp)
```
Collective on sp


## Input Parameter

- ***sp -*** the `PetscSpace` object to set options for



## Options Database Keys

- ***-petscspace_degree <deg> -*** the approximation order of the space
- ***-petscspace_variables <n> -*** the number of different variables, e.g. x and y
- ***-petscspace_components <c> -*** the number of components, say d for a vector field





## See Also
 `PetscSpace`, `PetscSpaceView()`

## Level
intermediate

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

## Implementations

<A HREF="PETSC_DOC_OUT_ROOT_PLACEHOLDER/src/dm/dt/space/impls/poly/spacepoly.c.html#PetscSpaceSetFromOptions_Polynomial">PetscSpaceSetFromOptions_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#PetscSpaceSetFromOptions_Ptrimmed">PetscSpaceSetFromOptions_Ptrimmed in src/dm/dt/space/impls/ptrimmed/spaceptrimmed.c</A><BR>
<A HREF="PETSC_DOC_OUT_ROOT_PLACEHOLDER/src/dm/dt/space/impls/sum/spacesum.c.html#PetscSpaceSetFromOptions_Sum">PetscSpaceSetFromOptions_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#PetscSpaceSetFromOptions_Tensor">PetscSpaceSetFromOptions_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#PetscSpaceSetFromOptions_WXY">PetscSpaceSetFromOptions_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)  
