|
NEML2 2.1.0
|
#include <VariableStore.h>

Public Types | |
| using | VariableStorage = std::map<VariableName, std::unique_ptr<VariableBase>> |
| using | DerivSparsity = std::vector<std::pair<VariableBase *, const VariableBase *>> |
| using | SecDerivSparsity |
Public Member Functions | |
| VariableStore (Model *object) | |
| VariableStore (const VariableStore &)=delete | |
| VariableStore (VariableStore &&)=delete | |
| VariableStore & | operator= (const VariableStore &)=delete |
| VariableStore & | operator= (VariableStore &&)=delete |
| virtual | ~VariableStore ()=default |
| const TensorOptions & | variable_options () const |
| Current tensor options for variables. | |
| virtual void | zero_undefined_input () |
| Fill undefined input variables with zeros. | |
| void | set_output_derivative_filter (const std::vector< std::pair< VariableName, VariableName > > &derivs) |
| const std::optional< std::vector< std::pair< VariableName, VariableName > > > & | requested_output_derivatives () const |
| The currently active output derivative filter, or nullopt if all derivatives are requested. | |
| VariableStorage & | input_variables () |
| const VariableStorage & | input_variables () const |
| VariableStorage & | output_variables () |
| const VariableStorage & | output_variables () const |
| VariableBase & | input_variable (const VariableName &) |
| const VariableBase & | input_variable (const VariableName &) const |
| VariableBase & | output_variable (const VariableName &) |
| const VariableBase & | output_variable (const VariableName &) const |
| virtual void | clear_input () |
| virtual void | clear_output () |
| virtual void | clear_derivatives () |
| void | cache_derivative_sparsity () |
| void | cache_second_derivative_sparsity () |
| Cache sparsity of second derivatives. | |
| const std::optional< DerivSparsity > & | derivative_sparsity () const |
| Derivative sparsity. | |
| const std::optional< SecDerivSparsity > & | second_derivative_sparsity () const |
| Second derivative sparsity. | |
| void | assign_input (const ValueMap &, bool allow_nonexistent=false) |
| void | assign_input (const SparseVector &, bool allow_nonexistent=false) |
| void | assign_output (const SparseVector &) |
| Assign output variable values. | |
| void | assign_output_derivatives (const SparseMatrix &) |
| Assign variable derivatives. | |
| SparseVector | collect_input (const AxisLayout &) const |
| ValueMap | collect_output () const |
| Collect output variable values. | |
| SparseVector | collect_output (const AxisLayout &) const |
| DerivMap | collect_output_derivatives () const |
| Collect variable derivatives. | |
| SparseMatrix | collect_output_derivatives (const AxisLayout &, const AxisLayout &) const |
| SecDerivMap | collect_output_second_derivatives () const |
| Collect variable second derivatives. | |
Protected Member Functions | |
| void | set_output_derivative_filter_nl_sys (const std::vector< std::pair< VariableName, VariableName > > &derivs) |
| virtual void | send_variables_to (const TensorOptions &options) |
| Send padding variables to options. | |
| template<typename T> | |
| const Variable< T > & | declare_input_variable (const char *name, bool allow_duplicate=false) |
| Declare an input variable. | |
| template<typename T> | |
| const Variable< T > & | declare_input_variable (const VariableName &name, bool allow_duplicate=false) |
| Declare an input variable. | |
| template<typename T> | |
| Variable< T > & | declare_output_variable (const char *name) |
| Declare an output variable. | |
| template<typename T> | |
| Variable< T > & | declare_output_variable (const VariableName &name) |
| Declare an output variable. | |
| const VariableBase * | clone_input_variable (const VariableBase &var, std::optional< VariableName > new_name=std::nullopt) |
| Clone a variable and put it on the input axis. | |
| VariableBase * | clone_output_variable (const VariableBase &var, std::optional< VariableName > new_name=std::nullopt) |
| Clone a variable and put it on the output axis. | |
| void | assign_input_stack (jit::Stack &stack) |
| void | assign_output_stack (jit::Stack &stack, bool out, bool dout, bool d2out) |
| Assign stack to output variables and derivatives. | |
| jit::Stack | collect_input_stack () const |
| Collect stack from input variables. | |
| jit::Stack | collect_output_stack (bool out, bool dout, bool d2out) const |
| Collect stack from output variables and derivatives. | |
Friends | |
| template<typename T> | |
| const T & | resolve_tensor_name (const TensorName< T > &, Model *, const std::string &) |
| using DerivSparsity = std::vector<std::pair<VariableBase *, const VariableBase *>> |
| using SecDerivSparsity |
| using VariableStorage = std::map<VariableName, std::unique_ptr<VariableBase>> |
| VariableStore | ( | Model * | object | ) |
|
delete |
|
delete |
|
virtualdefault |
| void assign_input | ( | const SparseVector & | , |
| bool | allow_nonexistent = false ) |
| void assign_input | ( | const ValueMap & | , |
| bool | allow_nonexistent = false ) |
Assign input variable values
|
protected |
JIT-specific methods for stack assignment and collection Assign stack to input variables
| void assign_output | ( | const SparseVector & | ) |
Assign output variable values.
| void assign_output_derivatives | ( | const SparseMatrix & | ) |
Assign variable derivatives.
|
protected |
Assign stack to output variables and derivatives.
| void cache_derivative_sparsity | ( | ) |
Cache sparsity of first derivatives
| void cache_second_derivative_sparsity | ( | ) |
Cache sparsity of second derivatives.
|
virtual |
|
virtual |
Release allocated tensor
Reimplemented in Model.
|
virtual |
Reimplemented in Model.
|
protected |
Clone a variable and put it on the input axis.
|
protected |
Clone a variable and put it on the output axis.
| SparseVector collect_input | ( | const AxisLayout & | ) | const |
Collect input variable values
|
protected |
Collect stack from input variables.
| ValueMap collect_output | ( | ) | const |
Collect output variable values.
| SparseVector collect_output | ( | const AxisLayout & | ) | const |
| DerivMap collect_output_derivatives | ( | ) | const |
Collect variable derivatives.
| SparseMatrix collect_output_derivatives | ( | const AxisLayout & | , |
| const AxisLayout & | ) const |
| SecDerivMap collect_output_second_derivatives | ( | ) | const |
Collect variable second derivatives.
|
protected |
Collect stack from output variables and derivatives.
|
protected |
|
protected |
|
protected |
|
protected |
| const std::optional< DerivSparsity > & derivative_sparsity | ( | ) | const |
Derivative sparsity.
| VariableBase & input_variable | ( | const VariableName & | ) |
Lookup a variable by name
| const VariableBase & input_variable | ( | const VariableName & | ) | const |
|
inline |
Variables
|
inline |
|
delete |
|
delete |
| VariableBase & output_variable | ( | const VariableName & | ) |
| const VariableBase & output_variable | ( | const VariableName & | ) | const |
|
inline |
|
inline |
|
inline |
The currently active output derivative filter, or nullopt if all derivatives are requested.
| const std::optional< SecDerivSparsity > & second_derivative_sparsity | ( | ) | const |
Second derivative sparsity.
|
protectedvirtual |
Send padding variables to options.
| options | The target options |
| void set_output_derivative_filter | ( | const std::vector< std::pair< VariableName, VariableName > > & | derivs | ) |
Set the (output, input) pairs whose derivatives should be computed and returned. Pass an empty vector to clear the filter and compute all derivatives.
|
protected |
Same as set_output_derivative_filter but applies only during nonlinear system assembly. Pass an empty vector to clear the filter. Independent from the regular filter.
|
inline |
Current tensor options for variables.
|
virtual |
Fill undefined input variables with zeros.
Reimplemented in Model.
|
friend |