27#include "neml2/models/Model.h"
28#include "neml2/base/DependencyResolver.h"
43 virtual std::map<std::string, const VariableBase *>
46 virtual std::map<std::string, Model *>
49 virtual void setup()
override;
52 std::pair<indexing::TensorIndex, Model *>,
69 void set_value(
bool,
bool,
bool)
override;
79 void apply_chain_rule(
Model *
i);
82 void apply_second_order_chain_rule(
Model *
i);
85 void rethrow_exceptions()
const;
88 const std::vector<VariableName> _additional_outputs;
91 const bool _auto_nl_param;
97 std::map<Model *, AssemblyIndices> _assembly_indices;
100 std::map<Model *, std::vector<Tensor>> _dpin_din_views;
103 std::map<Model *, LabeledMatrix> _dpout_din;
106 std::map<Model *, std::vector<Tensor>> _d2pin_din2_views;
109 std::map<Model *, LabeledTensor3D> _d2pout_din2;
112 std::map<Model *, std::future<void>> _async_results;
115 std::map<std::thread::id, std::exception_ptr> _async_exceptions;
Definition ComposedModel.h:35
virtual std::map< std::string, const VariableBase * > named_nonlinear_parameters(bool recursive=false) const override
Get all nonlinear parameters.
Definition ComposedModel.cxx:239
virtual void allocate_variables(bool in, bool out) override
Call VariableStore::allocate_variables recursively on all submodels.
Definition ComposedModel.cxx:251
std::map< indexing::TensorIndex, std::pair< indexing::TensorIndex, Model * >, LabeledAxis::AssemblySliceCmp > AssemblyIndices
Definition ComposedModel.h:51
virtual std::map< std::string, Model * > named_nonlinear_parameter_models(bool recursive=false) const override
Get all nonlinear parameters' models.
Definition ComposedModel.cxx:245
virtual void check_AD_limitation() const override
Definition ComposedModel.cxx:230
virtual void setup_submodel_input_views(VariableStore *host) override
Definition ComposedModel.cxx:303
virtual void setup() override
Setup this model.
Definition ComposedModel.cxx:151
static OptionSet expected_options()
Definition ComposedModel.cxx:34
virtual void setup_output_views() override
Definition ComposedModel.cxx:277
void set_value(bool, bool, bool) override
The map between input -> output, and optionally its derivatives.
Definition ComposedModel.cxx:323
The wrapper (decorator) for cross-referencing unresolved values at parse time.
Definition CrossRef.h:56
The base class for all constitutive models.
Definition Model.h:55
friend class ComposedModel
ComposedModel's set_value need to call submodel's set_value.
Definition Model.h:169
const torch::TensorOptions & options() const
Storage tensor options.
Definition Model.h:111
const T * host() const
Get a readonly pointer to the host.
Definition NEML2Object.h:90
A custom map-like data structure. The keys are strings, and the values can be nonhomogeneously typed.
Definition OptionSet.h:100
Definition VariableStore.h:40
Definition CrossRef.cxx:30
Definition LabeledAxis.h:61