# PetscFECreateFromSpaces
Create a `PetscFE` from the basis and dual spaces 
## Synopsis
```
#include "petscfe.h" 
PetscErrorCode PetscFECreateFromSpaces(PetscSpace P, PetscDualSpace Q, PetscQuadrature q, PetscQuadrature fq, PetscFE *fem)
```
Collective


## Input Parameters

- ***P  -*** The basis space
- ***Q  -*** The dual space
- ***q  -*** The cell quadrature
- ***fq -*** The face quadrature



## Output Parameter

- ***fem    -*** The PetscFE object





## Note
The `PetscFE` takes ownership of these spaces by calling destroy on each. They should not be used after this call, and for borrowed references from `PetscFEGetSpace()` and the like, the caller must use `PetscObjectReference` before this call.


## See Also
 `PetscFE`, `PetscSpace`, `PetscDualSpace`, `PetscQuadrature`,
`PetscFECreateLagrangeByCell()`, `PetscFECreateDefault()`, `PetscFECreateByCell()`, `PetscFECreate()`, `PetscSpaceCreate()`, `PetscDualSpaceCreate()`

## Level
beginner

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


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


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