DOLFIN-X
DOLFIN-X C++ interface
Public Member Functions | List of all members
dolfinx::fem::FormCoefficients Class 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 >>> &coefficients)
 Initialise the FormCoefficients, using tuples of (original_coeff_position, name, shared_ptr<function::Function>). The shared_ptr<Function> 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, std::shared_ptr< const function::Function > coefficient)
 Set coefficient with index i to be a Function.
 
void set (std::string name, std::shared_ptr< const function::Function > coefficient)
 Set coefficient with name to be a Function.
 
std::shared_ptr< const function::Functionget (int i) const
 Get the Function coefficient i.
 
int original_position (int i) const
 Original position of coefficient in UFL form.
 
int get_index (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

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

Member Function Documentation

◆ get_index()

int FormCoefficients::get_index ( std::string  name) const

Get index from name of coefficient.

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

◆ get_name()

std::string FormCoefficients::get_name ( int  index) const

Get name from index of coefficient.

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

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