DOLFINx 0.7.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 Types | |
using | value_type = T |
Field type for the Function, e.g. double , std::complex<float> , etc. | |
using | geometry_type = U |
Geometry type of the Mesh that the Function is defined on. | |
Public Member Functions | |
Function (std::shared_ptr< const FunctionSpace< U > > V) | |
Create function on given function space. | |
Function (std::shared_ptr< const FunctionSpace< U > > V, std::shared_ptr< la::Vector< T > > x) | |
Create function on given function space with a given vector. | |
Function (const Function &v)=delete | |
Function (Function &&v)=default | |
Move constructor. | |
~Function ()=default | |
Destructor. | |
Function & | operator= (Function &&v)=default |
Move assignment. | |
Function & | operator= (const Function &v)=delete |
Function | sub (int i) const |
Extract sub-function (a view into the Function). | |
Function | collapse () const |
Collapse a subfunction (view into a Function) to a stand-alone Function. | |
std::shared_ptr< const FunctionSpace< U > > | function_space () const |
Access the function space. | |
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, U > &v, std::span< const std::int32_t > cells, const std::tuple< std::vector< std::int32_t >, std::vector< std::int32_t >, std::vector< U >, std::vector< std::int32_t > > &nmm_interpolation_data={}) |
Interpolate a provided Function. | |
void | interpolate (const Function< T, U > &v, const std::tuple< std::vector< std::int32_t >, std::vector< std::int32_t >, std::vector< U >, std::vector< std::int32_t > > &nmm_interpolation_data={}) |
Interpolate a provided Function. | |
void | interpolate (const std::function< std::pair< std::vector< T >, std::vector< std::size_t > >(MDSPAN_IMPL_STANDARD_NAMESPACE::mdspan< const U, MDSPAN_IMPL_STANDARD_NAMESPACE::extents< std::size_t, 3, MDSPAN_IMPL_STANDARD_NAMESPACE::dynamic_extent > >)> &f, std::span< const std::int32_t > cells) |
Interpolate an expression function on a list of cells. | |
void | interpolate (const std::function< std::pair< std::vector< T >, std::vector< std::size_t > >(MDSPAN_IMPL_STANDARD_NAMESPACE::mdspan< const U, MDSPAN_IMPL_STANDARD_NAMESPACE::extents< std::size_t, 3, MDSPAN_IMPL_STANDARD_NAMESPACE::dynamic_extent > >)> &f) |
Interpolate an expression function on the whole domain. | |
void | interpolate (const Expression< T, U > &e, std::span< const std::int32_t > cells) |
Interpolate an Expression (based on UFL) | |
void | interpolate (const Expression< T, U > &e) |
Interpolate an Expression (based on UFL) on all cells. | |
void | eval (std::span< const U > x, std::array< std::size_t, 2 > xshape, std::span< const std::int32_t > cells, std::span< T > u, std::array< std::size_t, 2 > ushape) const |
Evaluate the Function at points. | |
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 \).
T | The function scalar type. |
U | The mesh geometry scalar type. |
|
inlineexplicit |
Create function on given function space.
[in] | V | The function space |
|
inline |
Create function on given function space with a given vector.
[in] | V | The function space |
[in] | x | The vector |
|
inline |
|
inline |
Evaluate the Function at points.
[in] | x | The coordinates of the points. It has shape (num_points, 3) and storage is row-major. |
[in] | xshape | The shape of x . |
[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. |
[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. Storage is row-major. |
[in] | ushape | The shape of u . |
|
inline |
Access the function space.
|
inline |
Interpolate an Expression (based on UFL) on all cells.
[in] | e | The function to be interpolated |
|
inline |
Interpolate an Expression (based on UFL)
[in] | e | Expression to be interpolated. The Expression must have been created using the reference coordinates FiniteElement::interpolation_points() for the element associated with u . |
[in] | cells | The cells to interpolate on |
|
inline |
Interpolate a provided Function.
[in] | v | The function to be interpolated |
[in] | nmm_interpolation_data | Auxiliary data to interpolate on nonmatching meshes. This data can be generated with generate_nonmatching_meshes_interpolation_data (optional). |
|
inline |
Interpolate a provided Function.
[in] | v | The function to be interpolated |
[in] | cells | The cells to interpolate on |
[in] | nmm_interpolation_data | Auxiliary data to interpolate on nonmatching meshes. This data can be generated with generate_nonmatching_meshes_interpolation_data (optional). |
|
inline |
Interpolate an expression function on the whole domain.
[in] | f | Expression to be interpolated |
|
inline |
Interpolate an expression function on a list of cells.
[in] | f | The expression function to be interpolated |
[in] | cells | The cells to interpolate on |
|
inline |
Extract sub-function (a view into the Function).
[in] | i | Index of subfunction |