9 #include <boost/uuid/uuid.hpp>
38 std::shared_ptr<const FiniteElement>
element,
39 std::shared_ptr<const DofMap>
dofmap);
59 std::shared_ptr<FunctionSpace>
sub(
const std::vector<int>&
component)
const;
70 std::pair<FunctionSpace, std::vector<std::int32_t>>
collapse()
const;
89 std::shared_ptr<const mesh::Mesh>
mesh()
const;
92 std::shared_ptr<const FiniteElement>
element()
const;
95 std::shared_ptr<const DofMap>
dofmap()
const;
99 std::shared_ptr<const mesh::Mesh> _mesh;
102 std::shared_ptr<const FiniteElement> _element;
105 std::shared_ptr<const DofMap> _dofmap;
108 std::vector<int> _component;
111 boost::uuids::uuid _id;
112 boost::uuids::uuid _root_space_id;
115 mutable std::map<std::vector<int>, std::weak_ptr<FunctionSpace>> _subspaces;
127 std::array<std::vector<std::shared_ptr<const FunctionSpace>>, 2>
130 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:31
std::vector< int > component() const
Get the component with respect to the root superspace.
Definition: FunctionSpace.cpp:117
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:101
std::shared_ptr< const DofMap > dofmap() const
The dofmap.
Definition: FunctionSpace.cpp:253
std::vector< double > tabulate_dof_coordinates(bool transpose) const
Tabulate the physical coordinates of all dofs on this process.
Definition: FunctionSpace.cpp:120
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:23
bool contains(const FunctionSpace &V) const
Check whether V is subspace of this, or this itself.
Definition: FunctionSpace.cpp:69
virtual ~FunctionSpace()=default
Destructor.
std::shared_ptr< const mesh::Mesh > mesh() const
The mesh.
Definition: FunctionSpace.cpp:246
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:33
std::shared_ptr< const FiniteElement > element() const
The finite element.
Definition: FunctionSpace.cpp:248
FunctionSpace(FunctionSpace &&V)=default
Move constructor.
Finite element method functionality.
Definition: assemble_matrix_impl.h:25
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:256
Mesh data structures and algorithms on meshes.
Definition: DofMap.h:30