|
| Form (const std::vector< std::shared_ptr< const function::FunctionSpace >> &function_spaces, const FormIntegrals< T > &integrals, const FormCoefficients< T > &coefficients, const std::vector< std::pair< std::string, std::shared_ptr< const function::Constant< T >>>> constants) |
| Create form. More...
|
|
| Form (const std::vector< std::shared_ptr< const function::FunctionSpace >> &function_spaces, bool need_mesh_permutation_data) |
|
| Form (const Form &form)=delete |
| Copy constructor.
|
|
| Form (Form &&form)=default |
| Move constructor.
|
|
virtual | ~Form ()=default |
| Destructor.
|
|
int | rank () const |
| Rank of the form (bilinear form = 2, linear form = 1, functional = 0, etc) More...
|
|
void | set_coefficients (const std::map< std::string, std::shared_ptr< const function::Function< T >>> &coefficients) |
| Set coefficient with given name. More...
|
|
void | set_constants (const std::map< std::string, std::shared_ptr< const function::Constant< T >>> &constants) |
| Set constants based on their names. Names of the constants must agree with their names in UFL file.
|
|
bool | all_constants_set () const |
| Check if all constants associated with the form have been set. More...
|
|
std::set< std::string > | get_unset_constants () const |
| Return names of any constants that have not been set. More...
|
|
void | set_mesh (const std::shared_ptr< const mesh::Mesh > &mesh) |
|
std::shared_ptr< const mesh::Mesh > | mesh () const |
| Extract common mesh from form. More...
|
|
std::shared_ptr< const function::FunctionSpace > | function_space (int i) const |
| Return function space for given argument. More...
|
|
std::vector< std::shared_ptr< const function::FunctionSpace > > | function_spaces () const |
| Return function spaces for all arguments. More...
|
|
void | set_tabulate_tensor (IntegralType type, int i, const std::function< void(T *, const T *, const T *, const double *, const int *, const std::uint8_t *, const std::uint32_t)> &fn) |
| Register the function for 'tabulate_tensor' for cell integral i.
|
|
FormCoefficients< T > & | coefficients () |
| Access coefficients.
|
|
const FormCoefficients< T > & | coefficients () const |
| Access coefficients.
|
|
const FormIntegrals< T > & | integrals () const |
| Access form integrals.
|
|
std::vector< std::pair< std::string, std::shared_ptr< const function::Constant< T > > > > & | constants () |
| Access constants. More...
|
|
const std::vector< std::pair< std::string, std::shared_ptr< const function::Constant< T > > > > & | constants () const |
| Access constants. More...
|
|
template<typename T>
class dolfinx::fem::Form< T >
Class for variational forms.
A note on the order of trial and test spaces: FEniCS numbers argument spaces starting with the leading dimension of the corresponding tensor (matrix). In other words, the test space is numbered 0 and the trial space is numbered 1. However, in order to have a notation that agrees with most existing finite element literature, in particular
\[ a = a(u, v) \]
the spaces are numbered from right to left
\[ a: V_1 \times V_0 \rightarrow \mathbb{R} \]
This is reflected in the ordering of the spaces that should be supplied to generated subclasses. In particular, when a bilinear form is initialized, it should be initialized as a(V_1, V_0) = ...
, where V_1
is the trial space and V_0
is the test space. However, when a form is initialized by a list of argument spaces (the variable function_spaces
in the constructors below), the list of spaces should start with space number 0 (the test space) and then space number 1 (the trial space).