DOLFIN-X
DOLFIN-X C++ interface
Classes | Functions
dolfinx::function Namespace Reference

Functions tools, including FEM functions and pointwise defined functions. More...

Classes

class  Constant
 A constant value which can be attached to a Form. Constants may be scalar (rank 0), vector (rank 1), or tensor valued. More...
 
class  Expression
 Represents a mathematical expression evaluated at a pre-defined set of points on the reference cell. This class closely follows the concept of a UFC Expression. More...
 
class  Function
 This class represents a function \( u_h \) in a finite element function space \( V_h \), given by. More...
 
class  FunctionSpace
 This class represents a finite element function space defined by a mesh, a finite element, and a local-to-global map of the degrees of freedom (dofmap). More...
 

Functions

template<typename T >
void eval (Eigen::Ref< Eigen::Array< T, Eigen::Dynamic, Eigen::Dynamic, Eigen::RowMajor >> values, const function::Expression< T > &e, const std::vector< std::int32_t > &active_cells)
 Evaluate a UFC expression. More...
 
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, trial) space pairs. The test space must be the same for each row and the trial spaces must be the same for each column. Raises an exception if there is an inconsistency. e.g. if each form in row i does not have the same test space then an exception is raised. More...
 
template<typename T >
void interpolate (Function< T > &u, const Function< T > &v)
 Interpolate a Function (on possibly non-matching meshes) More...
 
template<typename T >
void interpolate (Function< T > &u, const std::function< Eigen::Array< T, Eigen::Dynamic, Eigen::Dynamic, Eigen::RowMajor >(const Eigen::Ref< const Eigen::Array< double, 3, Eigen::Dynamic, Eigen::RowMajor >> &)> &f)
 Interpolate an expression. More...
 
template<typename T >
void interpolate_c (Function< T > &u, const std::function< void(Eigen::Ref< Eigen::Array< T, Eigen::Dynamic, Eigen::Dynamic, Eigen::RowMajor >>, const Eigen::Ref< const Eigen::Array< double, Eigen::Dynamic, 3, Eigen::RowMajor >> &)> &f)
 Interpolate an expression f(x). This interface uses an expression function f that has an in/out argument for the expression values. It is primarily to support C code implementations of the expression, e.g. using Numba. Generally the interface where the expression function is a pure function, i.e. the expression values are the return argument, should be preferred. More...
 

Detailed Description

Functions tools, including FEM functions and pointwise defined functions.

This namespace provides classes for representing finite element functions, and coefficient functions that appear in forms.

Function Documentation

◆ common_function_spaces()

std::array< std::vector< std::shared_ptr< const function::FunctionSpace > >, 2 > dolfinx::function::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, trial) space pairs. The test space must be the same for each row and the trial spaces must be the same for each column. Raises an exception if there is an inconsistency. e.g. if each form in row i does not have the same test space then an exception is raised.

Parameters
[in]VVector function spaces for (0) each row block and (1) each column block

◆ eval()

template<typename T >
void dolfinx::function::eval ( Eigen::Ref< Eigen::Array< T, Eigen::Dynamic, Eigen::Dynamic, Eigen::RowMajor >>  values,
const function::Expression< T > &  e,
const std::vector< std::int32_t > &  active_cells 
)

Evaluate a UFC expression.

Parameters
[in,out]valuesAn array to evaluate the expression into
[in]eThe expression to evaluate
[in]active_cellsThe cells on which to evaluate the expression

◆ interpolate() [1/2]

template<typename T >
void dolfinx::function::interpolate ( Function< T > &  u,
const Function< T > &  v 
)

Interpolate a Function (on possibly non-matching meshes)

Parameters
[in,out]uThe function to interpolate into
[in]vThe function to be interpolated

◆ interpolate() [2/2]

template<typename T >
void dolfinx::function::interpolate ( Function< T > &  u,
const std::function< Eigen::Array< T, Eigen::Dynamic, Eigen::Dynamic, Eigen::RowMajor >(const Eigen::Ref< const Eigen::Array< double, 3, Eigen::Dynamic, Eigen::RowMajor >> &)> &  f 
)

Interpolate an expression.

Parameters
[in,out]uThe function to interpolate into
[in]fThe expression to be interpolated

◆ interpolate_c()

template<typename T >
void dolfinx::function::interpolate_c ( Function< T > &  u,
const std::function< void(Eigen::Ref< Eigen::Array< T, Eigen::Dynamic, Eigen::Dynamic, Eigen::RowMajor >>, const Eigen::Ref< const Eigen::Array< double, Eigen::Dynamic, 3, Eigen::RowMajor >> &)> &  f 
)

Interpolate an expression f(x). This interface uses an expression function f that has an in/out argument for the expression values. It is primarily to support C code implementations of the expression, e.g. using Numba. Generally the interface where the expression function is a pure function, i.e. the expression values are the return argument, should be preferred.

Parameters
[in,out]uThe function to interpolate into
[in]fThe expression to be interpolated