DOLFIN-X
DOLFIN-X C++ interface
|
11 #include <dolfinx/fem/FiniteElement.h>
47 std::shared_ptr<const fem::FiniteElement>
element,
48 std::shared_ptr<const fem::DofMap>
dofmap);
75 std::int64_t
dim()
const;
85 Eigen::Ref<Eigen::Array<PetscScalar, Eigen::Dynamic, 1>> coefficients,
90 Eigen::Ref<Eigen::Array<PetscScalar, Eigen::Dynamic, Eigen::Dynamic,
93 const Eigen::Array<double, Eigen::Dynamic, 3, Eigen::RowMajor>>&)>;
105 Eigen::Ref<Eigen::Array<PetscScalar, Eigen::Dynamic, 1>> coefficients,
106 const std::function<Eigen::Array<PetscScalar, Eigen::Dynamic,
107 Eigen::Dynamic, Eigen::RowMajor>(
108 const Eigen::Ref<
const Eigen::Array<
double, 3, Eigen::Dynamic,
109 Eigen::RowMajor>>&)>& f)
const;
122 Eigen::Ref<Eigen::Array<PetscScalar, Eigen::Dynamic, 1>> coefficients,
128 std::shared_ptr<FunctionSpace>
sub(
const std::vector<int>&
component)
const;
138 std::pair<std::shared_ptr<FunctionSpace>, std::vector<std::int32_t>>
146 return element.hash() == this->_element->hash();
156 Eigen::Array<double, Eigen::Dynamic, 3, Eigen::RowMajor>
168 void set_x(Eigen::Ref<Eigen::Array<PetscScalar, Eigen::Dynamic, 1>> x,
172 std::size_t
id()
const;
175 std::shared_ptr<const mesh::Mesh>
mesh()
const;
178 std::shared_ptr<const fem::FiniteElement>
element()
const;
181 std::shared_ptr<const fem::DofMap>
dofmap()
const;
187 Eigen::Ref<Eigen::Array<PetscScalar, Eigen::Dynamic, 1>> coefficients,
188 const Eigen::Ref<
const Eigen::Array<PetscScalar, Eigen::Dynamic,
189 Eigen::Dynamic, Eigen::RowMajor>>&
193 std::shared_ptr<const mesh::Mesh> _mesh;
196 std::shared_ptr<const fem::FiniteElement> _element;
199 std::shared_ptr<const fem::DofMap> _dofmap;
203 interpolate_from_any(Eigen::Ref<Eigen::Array<PetscScalar, Eigen::Dynamic, 1>>
204 expansion_coefficients,
208 std::vector<int> _component;
214 std::size_t _root_space_id;
217 mutable std::map<std::vector<int>, std::weak_ptr<FunctionSpace>> _subspaces;
void set_x(Eigen::Ref< Eigen::Array< PetscScalar, Eigen::Dynamic, 1 >> x, PetscScalar value, int component) const
Set dof entries in vector to value*x[i], where [x][i] is the coordinate of the dof spatial coordinate...
Definition: FunctionSpace.cpp:353
virtual ~FunctionSpace()=default
Destructor.
std::shared_ptr< FunctionSpace > sub(const std::vector< int > &component) const
Extract subspace for component.
Definition: FunctionSpace.cpp:216
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:255
std::shared_ptr< const mesh::Mesh > mesh() const
The mesh.
Definition: FunctionSpace.cpp:414
bool has_element(const fem::FiniteElement &element) const
Check if function space has given element.
Definition: FunctionSpace.h:144
std::shared_ptr< const fem::DofMap > dofmap() const
The dofmap.
Definition: FunctionSpace.cpp:421
void interpolate(Eigen::Ref< Eigen::Array< PetscScalar, Eigen::Dynamic, 1 >> coefficients, const Function &v) const
Interpolate a finite element Function into this function space, filling the array of expansion coeffi...
Definition: FunctionSpace.cpp:109
std::shared_ptr< const fem::FiniteElement > element() const
The finite element.
Definition: FunctionSpace.cpp:416
Finite Element, containing the dof layout on a reference element, and various methods for evaluating ...
Definition: FiniteElement.h:25
std::int64_t dim() const
Return global dimension of the function space.
Definition: FunctionSpace.cpp:48
std::vector< int > component() const
Get the component with respect to the root superspace.
Definition: FunctionSpace.cpp:273
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:26
void interpolate_c(Eigen::Ref< Eigen::Array< PetscScalar, Eigen::Dynamic, 1 >> coefficients, const interpolation_function &f) const
Interpolate an expression into this function space, filling the array of expansion coefficients assoc...
Definition: FunctionSpace.cpp:193
Eigen::Array< double, Eigen::Dynamic, 3, Eigen::RowMajor > tabulate_dof_coordinates() const
Tabulate the physical coordinates of all dofs on this process.
Definition: FunctionSpace.cpp:276
bool operator==(const FunctionSpace &V) const
Equality operator.
Definition: FunctionSpace.cpp:35
This class represents a function in a finite element function space , given by.
Definition: Function.h:41
std::size_t id() const
Unique identifier.
Definition: FunctionSpace.cpp:412
std::function< void(Eigen::Ref< Eigen::Array< PetscScalar, Eigen::Dynamic, Eigen::Dynamic, Eigen::RowMajor > >, const Eigen::Ref< const Eigen::Array< double, Eigen::Dynamic, 3, Eigen::RowMajor > > &)> interpolation_function
Interpolation function.
Definition: FunctionSpace.h:93
bool contains(const FunctionSpace &V) const
Check whether V is subspace of this, or this itself.
Definition: FunctionSpace.cpp:426
This class represents a finite element function space defined by a mesh, a finite element,...
Definition: FunctionSpace.h:39
bool operator!=(const FunctionSpace &V) const
Inequality operator.
Definition: FunctionSpace.cpp:42