29#include "neml2/drivers/ModelDriver.h"
49 void setup()
override;
111 virtual torch::nn::ModuleDict
result()
const;
117 virtual void output()
const;
124 void output_pt(
const std::filesystem::path & out)
const;
128 bool _has_input_state =
false;
Selection of an enum value from a list of choices.
Definition EnumSelection.h:41
The accessor containing all the information needed to access an item in a LabeledAxis.
Definition LabeledAxisAccessor.h:56
A general-purpose driver that does something with a model.
Definition ModelDriver.h:46
A custom map-like data structure. The keys are strings, and the values can be nonhomogeneously typed.
Definition OptionSet.h:51
Scalar.
Definition Scalar.h:38
The driver for a transient initial-value problem.
Definition TransientDriver.h:43
const VariableName _time_name
VariableName for the time.
Definition TransientDriver.h:77
std::vector< ValueMap > _result_in
Inputs from all time steps.
Definition TransientDriver.h:91
virtual bool solve()
Solve the initial value problem.
Definition TransientDriver.cxx:238
std::vector< Tensor > _driving_forces
Definition TransientDriver.h:97
virtual void advance_step()
Advance in time: the state becomes old state, and forces become old forces.
Definition TransientDriver.cxx:273
TransientDriver(const OptionSet &options)
Definition TransientDriver.cxx:147
virtual void update_forces()
Update the driving forces for the current time step.
Definition TransientDriver.cxx:287
bool run() override
Let the driver run, return true upon successful completion, and return false otherwise.
Definition TransientDriver.cxx:227
Scalar _time
The current time.
Definition TransientDriver.h:79
virtual std::string save_as_path() const
The destination file/path to save the results.
Definition TransientDriver.cxx:388
virtual void apply_predictor()
Apply the predictor to calculate the initial guess for the current time step.
Definition TransientDriver.cxx:310
virtual void store_input()
Save the input of the current time step.
Definition TransientDriver.cxx:382
const EnumSelection _predictor
The predictor used to set the initial guess.
Definition TransientDriver.h:88
const Size _nsteps
Total number of steps.
Definition TransientDriver.h:83
std::vector< ValueMap > _result_out
Outputs from all time steps.
Definition TransientDriver.h:93
virtual torch::nn::ModuleDict result() const
The results (input and output) from all time steps.
Definition TransientDriver.cxx:394
ValueMap _in
The input to the constitutive model.
Definition TransientDriver.h:85
Size _step_count
The current step count.
Definition TransientDriver.h:81
std::string _save_as
The destination file name or file path.
Definition TransientDriver.h:120
virtual void postprocess()
Postprocess the output of the current time step.
Definition TransientDriver.cxx:361
void setup() override
Setup this object.
Definition TransientDriver.cxx:170
virtual void output() const
Save the results into the destination file/path.
Definition TransientDriver.cxx:425
void diagnose() const override
Check for common problems.
Definition TransientDriver.cxx:183
static OptionSet expected_options()
Definition TransientDriver.cxx:108
std::vector< VariableName > _driving_force_names
Driving forces (other than time)
Definition TransientDriver.h:96
virtual void apply_ic()
Apply the initial conditions.
Definition TransientDriver.cxx:297
virtual void solve_step()
Perform the constitutive update for the current time step.
Definition TransientDriver.cxx:346
Definition DiagnosticsInterface.cxx:30
std::map< LabeledAxisAccessor, Tensor > ValueMap
Definition map_types_fwd.h:33
int64_t Size
Definition types.h:65
Definition TransientDriver.h:32