27#include "neml2/base/NEML2Object.h"
28#include "neml2/base/OptionSet.h"
29#include "neml2/base/Storage.h"
30#include "neml2/tensors/TensorValue.h"
34#include "neml2/base/CrossRef.h"
35#include "neml2/base/EnumSelection.h"
36#include "neml2/tensors/tensors.h"
90 virtual std::map<std::string, const VariableBase *>
94 virtual std::map<std::string, Model *>
118 template <
typename T,
typename =
typename std::enable_if_t<std::is_base_of_v<TensorBase<T>, T>>>
136 template <
typename T,
typename =
typename std::enable_if_t<std::is_base_of_v<TensorBase<T>, T>>>
153 template <
typename T,
typename =
typename std::enable_if_t<std::is_base_of_v<TensorBase<T>, T>>>
The wrapper (decorator) for cross-referencing unresolved values at parse time.
Definition CrossRef.h:54
The base class of all "manufacturable" objects in the NEML2 library.
Definition NEML2Object.h:38
A custom map-like data structure. The keys are strings, and the values can be nonhomogeneously typed.
Definition OptionSet.h:85
Interface for object which can store parameters.
Definition ParameterStore.h:46
std::map< std::string, const VariableBase * > _nl_params
Map from nonlinear parameter names to their corresponding variable views.
Definition ParameterStore.h:159
ParameterStore & operator=(const ParameterStore &)=delete
virtual void send_parameters_to(const torch::TensorOptions &options)
Send parameters to options.
Definition ParameterStore.cxx:38
void set_parameter(const std::string &, const Tensor &)
}@
Definition ParameterStore.cxx:45
std::map< std::string, Model * > _nl_param_models
Map from nonlinear parameter names to models which evaluate them.
Definition ParameterStore.h:162
void set_parameters(const std::map< std::string, Tensor > &)
Set values for parameters.
Definition ParameterStore.cxx:54
ParameterStore(OptionSet options, NEML2Object *object)
Definition ParameterStore.cxx:31
ParameterStore & operator=(ParameterStore &&)=delete
ParameterStore(const ParameterStore &)=delete
bool has_nl_param() const
Whether this parameter store has any nonlinear parameter.
Definition ParameterStore.h:79
virtual ~ParameterStore()=default
TensorValueBase & get_parameter(const std::string &name)
Get a writable reference of a parameter.
Definition ParameterStore.cxx:61
const Storage< std::string, TensorValueBase > & named_parameters() const
Definition ParameterStore.h:58
const T & declare_parameter(const std::string &name, const T &rawval)
Declare a parameter.
Definition ParameterStore.cxx:140
virtual std::map< std::string, Model * > named_nonlinear_parameter_models(bool recursive=false) const
Get all nonlinear parameters' models.
Definition ParameterStore.cxx:116
virtual std::map< std::string, const VariableBase * > named_nonlinear_parameters(bool recursive=false) const
Get all nonlinear parameters.
Definition ParameterStore.cxx:93
ParameterStore(ParameterStore &&)=delete
const VariableBase * nl_param(const std::string &) const
Query the existence of a nonlinear parameter.
Definition ParameterStore.cxx:79
The base class to allow us to set up a polymorphic container of Tensors. The concrete definitions wil...
Definition TensorValue.h:39
Base class of variable.
Definition Variable.h:47
Definition CrossRef.cxx:31
std::string name(ElasticConstant p)
Definition ElasticityConverter.cxx:30