|
NEML2 2.0.0
|
The driver for a transient initial-value problem. More...
The driver for a transient initial-value problem.
#include <TransientDriver.h>

Public Member Functions | |
| TransientDriver (const OptionSet &options) | |
| void | setup () override |
| Setup this object. | |
| void | diagnose () const override |
| Check for common problems. | |
| bool | run () override |
Let the driver run, return true upon successful completion, and return false otherwise. | |
Public Member Functions inherited from ModelDriver | |
| ModelDriver (const OptionSet &options) | |
| const Model & | model () const |
| const Model & | postprocessor () const |
Public Member Functions inherited from Driver | |
| Driver (const OptionSet &options) | |
| Construct a new Driver object. | |
Public Member Functions inherited from NEML2Object | |
| NEML2Object ()=delete | |
| NEML2Object (NEML2Object &&)=delete | |
| NEML2Object (const NEML2Object &)=delete | |
| NEML2Object & | operator= (NEML2Object &&)=delete |
| NEML2Object & | operator= (const NEML2Object &)=delete |
| virtual | ~NEML2Object ()=default |
| NEML2Object (const OptionSet &options) | |
| Construct a new NEML2Object object. | |
| const OptionSet & | input_options () const |
| const std::string & | name () const |
| A readonly reference to the object's name. | |
| const std::string & | type () const |
| A readonly reference to the object's type. | |
| const std::string & | path () const |
| A readonly reference to the object's path. | |
| const std::string & | doc () const |
| A readonly reference to the object's docstring. | |
| Factory * | factory () const |
| Get the factory that created this object. | |
| const Settings & | settings () const |
| Settings. | |
| template<typename T = NEML2Object> | |
| const T * | host () const |
| Get a readonly pointer to the host. | |
| template<typename T = NEML2Object> | |
| T * | host () |
| Get a writable pointer to the host. | |
| template<typename T > | |
| const T & | resolve_tensor (const std::string &name) |
| Resolve a TensorName to a Tensor. | |
| template<class T > | |
| std::shared_ptr< T > | get_object (const std::string §ion, const std::string &name) |
| template<class T = Solver> | |
| std::shared_ptr< T > | get_solver (const std::string &name) |
| Get a solver from the factory. | |
| template<class T = Data> | |
| std::shared_ptr< T > | get_data (const std::string &name) |
| Get a data from the factory. | |
| template<class T = Model> | |
| std::shared_ptr< T > | get_model (const std::string &name) |
| Get a model from the factory. | |
| template<class T = Driver> | |
| std::shared_ptr< T > | get_driver (const std::string &name) |
| Get a driver from the factory. | |
| template<class T = WorkScheduler> | |
| std::shared_ptr< T > | get_scheduler (const std::string &name) |
| Get a scheduler from the factory. | |
Public Member Functions inherited from DiagnosticsInterface | |
| DiagnosticsInterface ()=delete | |
| DiagnosticsInterface (NEML2Object *object) | |
| DiagnosticsInterface (DiagnosticsInterface &&)=delete | |
| DiagnosticsInterface (const DiagnosticsInterface &)=delete | |
| DiagnosticsInterface & | operator= (const DiagnosticsInterface &)=delete |
| DiagnosticsInterface & | operator= (DiagnosticsInterface &&)=delete |
| virtual | ~DiagnosticsInterface ()=default |
| const NEML2Object & | object () const |
| Get the object. | |
Static Public Member Functions | |
| static OptionSet | expected_options () |
Static Public Member Functions inherited from ModelDriver | |
| static OptionSet | expected_options () |
Static Public Member Functions inherited from Driver | |
| static OptionSet | expected_options () |
Static Public Member Functions inherited from NEML2Object | |
| static OptionSet | expected_options () |
Protected Member Functions | |
| virtual bool | solve () |
| Solve the initial value problem. | |
| virtual void | advance_step () |
| Advance in time: the state becomes old state, and forces become old forces. | |
| virtual void | update_forces () |
| Update the driving forces for the current time step. | |
| virtual void | apply_ic () |
| Apply the initial conditions. | |
| virtual void | apply_predictor () |
| Apply the predictor to calculate the initial guess for the current time step. | |
| virtual void | solve_step () |
| Perform the constitutive update for the current time step. | |
| virtual void | postprocess () |
| Postprocess the output of the current time step. | |
| virtual void | store_input () |
| Save the input of the current time step. | |
Protected Attributes | |
| const VariableName | _time_name |
| VariableName for the time. | |
| Scalar | _time |
| The current time. | |
| Size | _step_count = 0 |
| The current step count. | |
| const Size | _nsteps |
| Total number of steps. | |
| ValueMap | _in |
| The input to the constitutive model. | |
| const EnumSelection | _predictor |
| The predictor used to set the initial guess. | |
| std::vector< ValueMap > | _result_in |
| Inputs from all time steps. | |
| std::vector< ValueMap > | _result_out |
| Outputs from all time steps. | |
| std::vector< VariableName > | _driving_force_names |
| Driving forces (other than time) | |
| std::vector< Tensor > | _driving_forces |
Protected Attributes inherited from ModelDriver | |
| const std::shared_ptr< Model > | _model |
| The model which the driver uses to perform constitutive updates. | |
| const std::vector< VariableName > | _intmd_vars |
| Variable names for which to tag intermediate shapes. | |
| const std::vector< TensorShape > | _intmd_shapes |
| Corresponding tensor shapes for the intermediate variables. | |
| const std::shared_ptr< Model > | _postprocessor |
| Postprocessor model. | |
| const Device | _device |
| The device on which to evaluate the model. | |
| const bool | _show_model_info |
| Set to true to list all the model parameters at the beginning. | |
Protected Attributes inherited from Driver | |
| bool | _verbose |
| Whether to print out additional (debugging) information during the execution. | |
| std::string | _save_as |
| The destination file name or file path. | |
| virtual torch::nn::ModuleDict | result () const |
| The results (input and output) from all time steps. | |
| virtual std::string | save_as_path () const |
| The destination file/path to save the results. | |
| virtual void | output () const |
| Save the results into the destination file/path. | |
| TransientDriver | ( | const OptionSet & | options | ) |
|
protectedvirtual |
Advance in time: the state becomes old state, and forces become old forces.
|
protectedvirtual |
Apply the initial conditions.
|
protectedvirtual |
Apply the predictor to calculate the initial guess for the current time step.
Reimplemented in LDISolidMechanicsDriver.
|
overridevirtual |
Check for common problems.
This method serves as the entry point for diagnosing common problems in object setup. The idea behind this method is that while some errors could be detected at construction time, i.e., when the object's constructor is called, it doesn't hinder other objects' creation. We therefore would like to defer the detection of errors until after all objects have been created, collect all errors at once, and present the user with a complete understanding of all errors encountered.
Note, however, if an error could interfere with other objects' creation, it should be raised right away inside the constructor, instead of inside this method.
Reimplemented from ModelDriver.
|
static |
|
protectedvirtual |
Save the results into the destination file/path.
|
protectedvirtual |
Postprocess the output of the current time step.
|
virtual |
The results (input and output) from all time steps.
Outputting
|
overridevirtual |
Let the driver run, return true upon successful completion, and return false otherwise.
Implements Driver.
|
virtual |
The destination file/path to save the results.
|
overridevirtual |
Setup this object.
This method is called automatically if you use the Factory method get_object or get_object, right after construction. This serves as the entry point for things that are not convenient/possible to do at construction time, but are necessary before this object can be used (by others).
Reimplemented from ModelDriver.
|
protectedvirtual |
Solve the initial value problem.
|
protectedvirtual |
Perform the constitutive update for the current time step.
|
protectedvirtual |
Save the input of the current time step.
|
protectedvirtual |
Update the driving forces for the current time step.
Reimplemented in LDISolidMechanicsDriver, and SolidMechanicsDriver.
|
protected |
Driving forces (other than time)
|
protected |
|
protected |
The input to the constitutive model.
|
protected |
Total number of steps.
|
protected |
The predictor used to set the initial guess.
|
protected |
Inputs from all time steps.
|
protected |
Outputs from all time steps.
|
protected |
The destination file name or file path.
|
protected |
The current step count.
|
protected |
The current time.
|
protected |
VariableName for the time.