|
DOLFIN
DOLFIN C++ interface
|
#include <FunctionSpace.h>


Public Member Functions | |
| FunctionSpace (std::shared_ptr< const Mesh > mesh, std::shared_ptr< const FiniteElement > element, std::shared_ptr< const GenericDofMap > dofmap) | |
| FunctionSpace (const FunctionSpace &V) | |
| virtual | ~FunctionSpace () |
| Destructor. | |
| const FunctionSpace & | operator= (const FunctionSpace &V) |
| bool | operator== (const FunctionSpace &V) const |
| bool | operator!= (const FunctionSpace &V) const |
| std::shared_ptr< const Mesh > | mesh () const |
| std::shared_ptr< const FiniteElement > | element () const |
| std::shared_ptr< const GenericDofMap > | dofmap () const |
| std::size_t | dim () const |
| void | interpolate (GenericVector &expansion_coefficients, const GenericFunction &v) const |
| std::shared_ptr< FunctionSpace > | operator[] (std::size_t i) const |
| std::shared_ptr< FunctionSpace > | sub (std::size_t component) const |
| std::shared_ptr< FunctionSpace > | sub (const std::vector< std::size_t > &component) const |
| std::shared_ptr< FunctionSpace > | extract_sub_space (const std::vector< std::size_t > &component) const |
| bool | contains (const FunctionSpace &V) const |
| std::shared_ptr< FunctionSpace > | collapse () const |
| std::shared_ptr< FunctionSpace > | collapse (std::unordered_map< std::size_t, std::size_t > &collapsed_dofs) const |
| bool | has_cell (const Cell &cell) const |
| bool | has_element (const FiniteElement &element) const |
| std::vector< std::size_t > | component () const |
| std::vector< double > | tabulate_dof_coordinates () const |
| void | set_x (GenericVector &x, double value, std::size_t component) const |
| std::string | str (bool verbose) const |
| void | print_dofmap () const |
| Print dofmap (useful for debugging) | |
Public Member Functions inherited from dolfin::Variable | |
| Variable () | |
| Create unnamed variable. | |
| Variable (const std::string name, const std::string label) | |
| Create variable with given name and label. | |
| Variable (const Variable &variable) | |
| Copy constructor. | |
| virtual | ~Variable () |
| Destructor. | |
| const Variable & | operator= (const Variable &variable) |
| Assignment operator. | |
| void | rename (const std::string name, const std::string label) |
| Rename variable. | |
| std::string | name () const |
| Return name. | |
| std::string | label () const |
| Return label (description) | |
| std::size_t | id () const |
Public Member Functions inherited from dolfin::Hierarchical< FunctionSpace > | |
| Hierarchical (FunctionSpace &self) | |
| Constructor. | |
| virtual | ~Hierarchical () |
| Destructor. | |
| std::size_t | depth () const |
| bool | has_parent () const |
| bool | has_child () const |
| FunctionSpace & | parent () |
| const FunctionSpace & | parent () const |
| Return parent in hierarchy (const version). | |
| std::shared_ptr< FunctionSpace > | parent_shared_ptr () |
| std::shared_ptr< const FunctionSpace > | parent_shared_ptr () const |
| Return shared pointer to parent (const version). | |
| FunctionSpace & | child () |
| const FunctionSpace & | child () const |
| Return child in hierarchy (const version). | |
| std::shared_ptr< FunctionSpace > | child_shared_ptr () |
| std::shared_ptr< const FunctionSpace > | child_shared_ptr () const |
| Return shared pointer to child (const version). | |
| FunctionSpace & | root_node () |
| const FunctionSpace & | root_node () const |
| Return root node object in hierarchy (const version). | |
| std::shared_ptr< FunctionSpace > | root_node_shared_ptr () |
| std::shared_ptr< const FunctionSpace > | root_node_shared_ptr () const |
| Return shared pointer to root node object in hierarchy (const version). | |
| FunctionSpace & | leaf_node () |
| const FunctionSpace & | leaf_node () const |
| Return leaf node object in hierarchy (const version). | |
| std::shared_ptr< FunctionSpace > | leaf_node_shared_ptr () |
| std::shared_ptr< const FunctionSpace > | leaf_node_shared_ptr () const |
| Return shared pointer to leaf node object in hierarchy (const version). | |
| void | set_parent (std::shared_ptr< FunctionSpace > parent) |
| Set parent. | |
| void | clear_child () |
| Clear child. | |
| void | set_child (std::shared_ptr< FunctionSpace > child) |
| Set child. | |
| const Hierarchical & | operator= (const Hierarchical &hierarchical) |
| Assignment operator. | |
| void | _debug () const |
| Function useful for debugging the hierarchy. | |
Protected Member Functions | |
| FunctionSpace (std::shared_ptr< const Mesh > mesh) | |
| void | attach (std::shared_ptr< const FiniteElement > element, std::shared_ptr< const GenericDofMap > dofmap) |
Additional Inherited Members | |
Public Attributes inherited from dolfin::Variable | |
| Parameters | parameters |
| Parameters. | |
This class represents a finite element function space defined by a mesh, a finite element, and a local-to-global mapping of the degrees of freedom (dofmap).
| FunctionSpace::FunctionSpace | ( | std::shared_ptr< const Mesh > | mesh, |
| std::shared_ptr< const FiniteElement > | element, | ||
| std::shared_ptr< const GenericDofMap > | dofmap | ||
| ) |
Create function space for given mesh, element and dofmap (shared data)
Arguments mesh (Mesh) The mesh. element (FiniteElement) The element. dofmap (GenericDofMap) The dofmap.
|
explicitprotected |
Create empty function space for later initialization. This constructor is intended for use by any sub-classes which need to construct objects before the initialisation of the base class. Data can be attached to the base class using FunctionSpace::attach(...).
Arguments mesh (Mesh) The mesh.
| FunctionSpace::FunctionSpace | ( | const FunctionSpace & | V | ) |
Copy constructor
Arguments V (FunctionSpace) The object to be copied.
|
protected |
Attach data to an empty function space
Arguments element (FiniteElement) The element. dofmap (GenericDofMap) The dofmap.
| std::shared_ptr< FunctionSpace > FunctionSpace::collapse | ( | ) | const |
Collapse a subspace and return a new function space
Returns FunctionSpace The new function space.
| std::shared_ptr< FunctionSpace > FunctionSpace::collapse | ( | std::unordered_map< std::size_t, std::size_t > & | collapsed_dofs | ) | const |
Collapse a subspace and return a new function space and a map from new to old dofs
Arguments collapsed_dofs (std::unordered_map<std::size_t, std::size_t>) The map from new to old dofs.
Returns FunctionSpace The new function space.
| std::vector< std::size_t > FunctionSpace::component | ( | ) | const |
Return component w.r.t. to root superspace, i.e. W.sub(1).sub(0) == [1, 0].
Returns std::vector<std::size_t> The component (w.r.t to root superspace).
| bool FunctionSpace::contains | ( | const FunctionSpace & | V | ) | const |
Check whether V is subspace of this, or this itself
Arguments V (FunctionSpace) The space to be tested for inclusion.
Returns bool True if V is contained or equal to this.
| std::size_t FunctionSpace::dim | ( | ) | const |
Return global dimension of the function space. Equivalent to dofmap()->global_dimension()
Returns std::size_t The dimension of the function space.
| std::shared_ptr< const GenericDofMap > FunctionSpace::dofmap | ( | ) | const |
Return dofmap
Returns GenericDofMap The dofmap.
| std::shared_ptr< const FiniteElement > FunctionSpace::element | ( | ) | const |
Return finite element
Returns FiniteElement The finite element.
| std::shared_ptr< FunctionSpace > FunctionSpace::extract_sub_space | ( | const std::vector< std::size_t > & | component | ) | const |
Extract subspace for component
Arguments component (std::vector<std::size_t>) The component.
Returns FunctionSpace The subspace.
|
inline |
Check if function space has given cell
Arguments cell (Cell) The cell.
Returns bool True if the function space has the given cell.
|
inline |
Check if function space has given element
Arguments element (FiniteElement) The finite element.
Returns bool True if the function space has the given element.
| void FunctionSpace::interpolate | ( | GenericVector & | expansion_coefficients, |
| const GenericFunction & | v | ||
| ) | const |
Interpolate function v into function space, returning the vector of expansion coefficients
Arguments expansion_coefficients (GenericVector) The expansion coefficients. v (GenericFunction) The function to be interpolated.
| bool FunctionSpace::operator!= | ( | const FunctionSpace & | V | ) | const |
Inequality operator
Arguments V (FunctionSpace) Another function space.
| const FunctionSpace & FunctionSpace::operator= | ( | const FunctionSpace & | V | ) |
Assignment operator
Arguments V (FunctionSpace) Another function space.
| bool FunctionSpace::operator== | ( | const FunctionSpace & | V | ) | const |
Equality operator
Arguments V (FunctionSpace) Another function space.
| std::shared_ptr< FunctionSpace > FunctionSpace::operator[] | ( | std::size_t | i | ) | const |
Extract subspace for component
Arguments i (std::size_t) Index of the subspace. Returns FunctionSpace The subspace.
| void FunctionSpace::set_x | ( | GenericVector & | x, |
| double | value, | ||
| std::size_t | component | ||
| ) | const |
Set dof entries in vector to value*x[i], where [x][i] is the coordinate of the dof spatial coordinate. Parallel layout of vector must be consistent with dof map range This function is typically used to construct the null space of a matrix operator, e.g. rigid body rotations.
Arguments vector (GenericVector) The vector to set. value (double) The value to multiply to coordinate by. component (std::size_t) The coordinate index. mesh (Mesh) The mesh.
|
virtual |
Return informal string representation (pretty-print)
Arguments verbose (bool) Flag to turn on additional output.
Returns std::string An informal representation of the function space.
Reimplemented from dolfin::Variable.
|
inline |
Extract subspace for component
Arguments component (std::size_t) Index of the subspace. Returns FunctionSpace The subspace.
|
inline |
Extract subspace for component
Arguments component (std::vector<std::size_t>) The component. Returns FunctionSpace The subspace.
| std::vector< double > FunctionSpace::tabulate_dof_coordinates | ( | ) | const |
Tabulate the coordinates of all dofs on this process. This function is typically used by preconditioners that require the spatial coordinates of dofs, for example for re-partitioning or nullspace computations.
Arguments mesh (Mesh) The mesh.
Returns std::vector<double> The dof coordinates (x0, y0, x1, y1, . . .)
1.8.13