DOLFIN-X
DOLFIN-X C++ interface
Public Member Functions | List of all members
dolfinx::fem::FormCoefficients< T > Class Template Reference

Storage for the coefficients of a Form consisting of Function and the Element objects they are defined on. More...

#include <FormCoefficients.h>

Public Member Functions

 FormCoefficients (const std::vector< std::tuple< int, std::string, std::shared_ptr< function::Function< T >>>> &coefficients)
 Initialise the FormCoefficients, using tuples of (original_coeff_position, name, Function). The Function pointer may be a nullptr and assigned later.
 
int size () const
 Get number of coefficients.
 
std::vector< int > offsets () const
 Offset for each coefficient expansion array on a cell. Used to pack data for multiple coefficients in a flat array. The last entry is the size required to store all coefficients.
 
void set (int i, const std::shared_ptr< const function::Function< T >> &coefficient)
 Set coefficient with index i to be a Function.
 
void set (const std::string &name, const std::shared_ptr< const function::Function< T >> &coefficient)
 Set coefficient with name to be a Function.
 
std::shared_ptr< const function::Function< T > > get (int i) const
 Get the Function coefficient i.
 
int original_position (int i) const
 Original position of coefficient in UFL form. More...
 
int get_index (const std::string &name) const
 Get index from name of coefficient. More...
 
std::string get_name (int index) const
 Get name from index of coefficient. More...
 

Detailed Description

template<typename T>
class dolfinx::fem::FormCoefficients< T >

Storage for the coefficients of a Form consisting of Function and the Element objects they are defined on.

Member Function Documentation

◆ get_index()

template<typename T >
int dolfinx::fem::FormCoefficients< T >::get_index ( const std::string &  name) const
inline

Get index from name of coefficient.

Parameters
[in]nameName of coefficient
Returns
Index of the coefficient

◆ get_name()

template<typename T >
std::string dolfinx::fem::FormCoefficients< T >::get_name ( int  index) const
inline

Get name from index of coefficient.

Parameters
[in]indexIndex of the coefficient
Returns
Name of the coefficient

◆ original_position()

template<typename T >
int dolfinx::fem::FormCoefficients< T >::original_position ( int  i) const
inline

Original position of coefficient in UFL form.

Returns
The position of coefficient i in original ufl form coefficients.

The documentation for this class was generated from the following file: