9 #include <boost/uuid/uuid.hpp>
15 #include <xtensor/xtensor.hpp>
39 std::shared_ptr<const FiniteElement>
element,
40 std::shared_ptr<const DofMap>
dofmap);
60 std::shared_ptr<FunctionSpace>
sub(
const std::vector<int>&
component)
const;
71 std::pair<FunctionSpace, std::vector<std::int32_t>>
collapse()
const;
90 std::shared_ptr<const mesh::Mesh>
mesh()
const;
93 std::shared_ptr<const FiniteElement>
element()
const;
96 std::shared_ptr<const DofMap>
dofmap()
const;
100 std::shared_ptr<const mesh::Mesh> _mesh;
103 std::shared_ptr<const FiniteElement> _element;
106 std::shared_ptr<const DofMap> _dofmap;
109 std::vector<int> _component;
112 boost::uuids::uuid _id;
113 boost::uuids::uuid _root_space_id;
116 mutable std::map<std::vector<int>, std::weak_ptr<FunctionSpace>> _subspaces;
128 std::array<std::vector<std::shared_ptr<const FunctionSpace>>, 2>
131 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:32
std::vector< int > component() const
Get the component with respect to the root superspace.
Definition: FunctionSpace.cpp:120
xt::xtensor< double, 2 > tabulate_dof_coordinates(bool transpose) const
Tabulate the physical coordinates of all dofs on this process.
Definition: FunctionSpace.cpp:123
std::pair< 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:104
std::shared_ptr< const DofMap > dofmap() const
The dofmap.
Definition: FunctionSpace.cpp:248
FunctionSpace(std::shared_ptr< const mesh::Mesh > mesh, std::shared_ptr< const FiniteElement > element, std::shared_ptr< const DofMap > dofmap)
Create function space for given mesh, element and dofmap.
Definition: FunctionSpace.cpp:26
bool contains(const FunctionSpace &V) const
Check whether V is subspace of this, or this itself.
Definition: FunctionSpace.cpp:72
virtual ~FunctionSpace()=default
Destructor.
std::shared_ptr< const mesh::Mesh > mesh() const
The mesh.
Definition: FunctionSpace.cpp:241
FunctionSpace & operator=(FunctionSpace &&V)=default
Move assignment operator.
std::shared_ptr< FunctionSpace > sub(const std::vector< int > &component) const
Extract subspace for component.
Definition: FunctionSpace.cpp:36
std::shared_ptr< const FiniteElement > element() const
The finite element.
Definition: FunctionSpace.cpp:243
FunctionSpace(FunctionSpace &&V)=default
Move constructor.
Finite element method functionality.
Definition: assemble_matrix_impl.h:24
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:251
Mesh data structures and algorithms on meshes.
Definition: DofMap.h:30