10 #include <dolfinx/common/span.hpp>
15 #include <xtensor/xtensor.hpp>
42 std::shared_ptr<const fem::FiniteElement>
element,
43 std::shared_ptr<const fem::DofMap>
dofmap);
71 std::shared_ptr<FunctionSpace>
sub(
const std::vector<int>&
component)
const;
81 std::pair<std::shared_ptr<FunctionSpace>, std::vector<std::int32_t>>
100 std::size_t
id()
const;
103 std::shared_ptr<const mesh::Mesh>
mesh()
const;
106 std::shared_ptr<const fem::FiniteElement>
element()
const;
109 std::shared_ptr<const fem::DofMap>
dofmap()
const;
113 std::shared_ptr<const mesh::Mesh> _mesh;
116 std::shared_ptr<const fem::FiniteElement> _element;
119 std::shared_ptr<const fem::DofMap> _dofmap;
122 std::vector<int> _component;
128 std::size_t _root_space_id;
131 mutable std::map<std::vector<int>, std::weak_ptr<FunctionSpace>> _subspaces;
143 std::array<std::vector<std::shared_ptr<const FunctionSpace>>, 2>
146 std::vector<std::array<std::shared_ptr<const FunctionSpace>, 2>>>& V);
This class represents a finite element function space defined by a mesh, a finite element,...
Definition: FunctionSpace.h:35
virtual ~FunctionSpace()=default
Destructor.
std::vector< int > component() const
Get the component with respect to the root superspace.
Definition: FunctionSpace.cpp:100
std::shared_ptr< FunctionSpace > sub(const std::vector< int > &component) const
Extract subspace for component.
Definition: FunctionSpace.cpp:45
xt::xtensor< double, 2 > tabulate_dof_coordinates(bool transpose) const
Definition: FunctionSpace.cpp:103
bool contains(const FunctionSpace &V) const
Check whether V is subspace of this, or this itself.
Definition: FunctionSpace.cpp:222
std::pair< std::shared_ptr< FunctionSpace >, std::vector< std::int32_t > > collapse() const
Collapse a subspace and return a new function space and a map from new to old dofs.
Definition: FunctionSpace.cpp:82
FunctionSpace(std::shared_ptr< const mesh::Mesh > mesh, std::shared_ptr< const fem::FiniteElement > element, std::shared_ptr< const fem::DofMap > dofmap)
Create function space for given mesh, element and dofmap.
Definition: FunctionSpace.cpp:25
std::shared_ptr< const fem::DofMap > dofmap() const
The dofmap.
Definition: FunctionSpace.cpp:217
std::shared_ptr< const fem::FiniteElement > element() const
The finite element.
Definition: FunctionSpace.cpp:212
bool operator!=(const FunctionSpace &V) const
Inequality operator.
Definition: FunctionSpace.cpp:39
FunctionSpace(FunctionSpace &&V)=default
Move constructor.
bool operator==(const FunctionSpace &V) const
Equality operator.
Definition: FunctionSpace.cpp:34
FunctionSpace & operator=(FunctionSpace &&V)=default
Move assignment operator.
std::shared_ptr< const mesh::Mesh > mesh() const
The mesh.
Definition: FunctionSpace.cpp:210
std::size_t id() const
Unique identifier.
Definition: FunctionSpace.cpp:208
std::array< std::vector< std::shared_ptr< const FunctionSpace > >, 2 > common_function_spaces(const std::vector< std::vector< std::array< std::shared_ptr< const FunctionSpace >, 2 >>> &V)
Extract FunctionSpaces for (0) rows blocks and (1) columns blocks from a rectangular array of (test,...
Definition: FunctionSpace.cpp:241