25#include "neml2/drivers/solid_mechanics/LargeDeformationIncrementalSolidMechanicsDriver.h"
35 options.
doc() =
"Driver for large deformation solid mechanics material model. The material model "
36 "is updated *incrementally*.";
38 options.
set<std::string>(
"control") =
"STRAIN";
39 options.
set(
"control").doc() =
"External control of the material update. Options are STRAIN and "
40 "STRESS, for strain control and stress control, respectively.";
43 options.
set(
"deformation_rate").doc() =
"Deformation rate";
46 options.
set(
"cauchy_stress_rate").doc() =
"Cauchy stress rate";
49 options.
set(
"vorticity").doc() =
"Vorticity";
52 options.
set(
"prescribed_deformation_rate").doc() =
53 "Prescribed deformation rate (when control = STRAIN)";
56 options.
set(
"prescribed_cauchy_stress_rate").doc() =
57 "Prescribed cauchy stress rate (when control = STRESS)";
60 options.
set(
"prescribed_vorticity").doc() =
"Prescribed vorticity";
68 _control(options.get<std::
string>(
"control")),
70 _vorticity_prescribed(
71 !options.get<
CrossRef<torch::Tensor>>(
"prescribed_vorticity").raw().empty()),
72 _vorticity(_vorticity_prescribed
73 ?
WR2(options.get<
CrossRef<torch::Tensor>>(
"prescribed_vorticity"))
74 :
WR2::zeros(_driving_force.batch_sizes()))
103 "Input deformation rate/stress rate should have dimension 3 but instead has dimension",
106 "Input deformation rate/stress rate and time should have the same number of time "
110 " time steps, while the input deformation rate/stress rate has ",
114 "Input vorticity and deformation rate/stress rate should have the same number of "
115 "time steps. The input vorticity "
118 " time steps, while the input deformation rate/stress rate has ",
122 "Input deformation rate/stress rate and time should have the same batch size. The "
126 " while the input strain/stress has a batch size of ",
129 "Input strain/stress should have final dimension 6 but instead has final dimension ",
132 "Input vorticity should have final dimension 3, but instead has final dimension ",
Derived batch_index(TorchSlice indices) const
Get a batch.
Definition BatchTensorBase.cxx:184
Derived to(const torch::TensorOptions &options) const
Send to options.
Definition BatchTensorBase.cxx:331
The wrapper (decorator) for cross-referencing unresolved values at parse time.
Definition CrossRef.h:52
The accessor containing all the information needed to access an item in a LabeledAxis.
Definition LabeledAxisAccessor.h:44
void set(const BatchTensorBase< T > &value, S &&... names)
Set and interpret the input as an object.
Definition LabeledTensor.h:193
A custom map-like data structure. The keys are strings, and the values can be nonhomogeneously typed.
Definition OptionSet.h:59
const std::string & doc() const
A readonly reference to the option set's docstring.
Definition OptionSet.h:91
const T & get(const std::string &) const
Definition OptionSet.h:422
T & set(const std::string &)
Definition OptionSet.h:436
The (logical) symmetric second order tensor.
Definition SR2.h:46
The driver for a transient initial-value problem.
Definition TransientDriver.h:41
const torch::Device _device
The device on which to evaluate the model.
Definition TransientDriver.h:94
virtual void update_forces()
Update the driving forces for the current time step.
Definition TransientDriver.cxx:218
Scalar _time
The current time.
Definition TransientDriver.h:97
virtual void check_integrity() const override
Check the integrity of the set up.
Definition TransientDriver.cxx:135
LabeledVector & _in
The input to the constitutive model.
Definition TransientDriver.h:107
static OptionSet expected_options()
Definition TransientDriver.cxx:34
TorchSize _step_count
The current step count.
Definition TransientDriver.h:99
A skew rank 2, represented as an axial vector.
Definition WR2.h:43
Definition CrossRef.cxx:32
LabeledAxisAccessor VariableName
Definition Variable.h:35
void neml_assert(bool assertion, Args &&... args)
Definition error.h:73