DOLFINx
0.1.0
DOLFINx C++ interface
|
This class represents a function \( u_h \) in a finite element function space \( V_h \), given by. More...
#include <Function.h>
Public Member Functions | |
Function (std::shared_ptr< const FunctionSpace > V) | |
Create function on given function space. More... | |
Function (std::shared_ptr< const FunctionSpace > V, std::shared_ptr< la::Vector< T >> x) | |
Create function on given function space with a given vector. More... | |
Function (const Function &v)=delete | |
Function (Function &&v) | |
Move constructor. | |
virtual | ~Function () |
Destructor. | |
Function & | operator= (Function &&v) noexcept |
Move assignment. | |
Function & | operator= (const Function &v)=delete |
Function | sub (int i) const |
Extract subfunction (view into the Function) More... | |
Function | collapse () const |
Collapse a subfunction (view into the Function) to a stand-alone Function. More... | |
std::shared_ptr< const FunctionSpace > | function_space () const |
Return shared pointer to function space. More... | |
Vec | vector () const |
Return vector of expansion coefficients as a PETSc Vec. Throws an exception if a PETSc Vec cannot be created due to a type mismatch. More... | |
std::shared_ptr< const la::Vector< T > > | x () const |
Underlying vector. | |
std::shared_ptr< la::Vector< T > > | x () |
Underlying vector. | |
void | interpolate (const Function< T > &v) |
Interpolate a Function (on possibly non-matching meshes) More... | |
void | interpolate (const std::function< xt::xarray< T >(const xt::xtensor< double, 2 > &)> &f) |
Interpolate an expression. More... | |
void | eval (const xt::xtensor< double, 2 > &x, const xtl::span< const std::int32_t > &cells, xt::xtensor< T, 2 > &u) const |
Evaluate the Function at points. More... | |
xt::xtensor< T, 2 > | compute_point_values () const |
Compute values at all mesh 'nodes'. More... | |
std::size_t | id () const |
ID. | |
Public Attributes | |
std::string | name = "u" |
Name. | |
This class represents a function \( u_h \) in a finite element function space \( V_h \), given by.
\[ u_h = \sum_{i=1}^{n} U_i \phi_i \]
where \( \{\phi_i\}_{i=1}^{n} \) is a basis for \( V_h \), and \( U \) is a vector of expansion coefficients for \( u_h \).
|
inlineexplicit |
Create function on given function space.
[in] | V | The function space |
|
inline |
Create function on given function space with a given vector.
Warning: This constructor is intended for internal library use only
[in] | V | The function space |
[in] | x | The vector |
|
inline |
|
inline |
Compute values at all mesh 'nodes'.
|
inline |
Evaluate the Function at points.
[in] | x | The coordinates of the points. It has shape (num_points, 3). |
[in] | cells | An array of cell indices. cells[i] is the index of the cell that contains the point x(i). Negative cell indices can be passed, and the corresponding point will be ignored. |
[in,out] | u | The values at the points. Values are not computed for points with a negative cell index. This argument must be passed with the correct size. |
|
inline |
Return shared pointer to function space.
|
inline |
Interpolate a Function (on possibly non-matching meshes)
[in] | v | The function to be interpolated. |
|
inline |
Interpolate an expression.
[in] | f | The expression to be interpolated |
|
inline |
Extract subfunction (view into the Function)
[in] | i | Index of subfunction |
|
inline |
Return vector of expansion coefficients as a PETSc Vec. Throws an exception if a PETSc Vec cannot be created due to a type mismatch.