NEML2 2.0.0
Loading...
Searching...
No Matches
LDISolidMechanicsDriver Class Reference

Large deformation incremental solid mechanics driver. More...

Detailed Description

Large deformation incremental solid mechanics driver.

#include <LDISolidMechanicsDriver.h>

Inheritance diagram for LDISolidMechanicsDriver:

Public Member Functions

 LDISolidMechanicsDriver (const OptionSet &options)
 
void setup () override
 Setup this object.
 
void diagnose (std::vector< Diagnosis > &) const override
 Check for common problems.
 
- Public Member Functions inherited from SolidMechanicsDriver
 SolidMechanicsDriver (const OptionSet &options)
 
void setup () override
 Setup this object.
 
void diagnose (std::vector< Diagnosis > &) const override
 Check for common problems.
 
- Public Member Functions inherited from TransientDriver
 TransientDriver (const OptionSet &options)
 Construct a new TransientDriver object.
 
void diagnose (std::vector< Diagnosis > &) const override
 Check for common problems.
 
bool run () override
 Let the driver run, return true upon successful completion, and return false otherwise.
 
const Modelmodel () const
 
virtual std::string save_as_path () const
 The destination file/path to save the results.
 
virtual torch::nn::ModuleDict result () const
 The results (input and output) from all time steps.
 
- 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
 
NEML2Objectoperator= (const NEML2Object &)=delete
 
NEML2Objectoperator= (NEML2Object &&)=delete
 
virtual ~NEML2Object ()=default
 
 NEML2Object (const OptionSet &options)
 Construct a new NEML2Object object.
 
const OptionSetinput_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.
 
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.
 
- Public Member Functions inherited from DiagnosticsInterface
 DiagnosticsInterface ()=delete
 
 DiagnosticsInterface (NEML2Object *object)
 
 DiagnosticsInterface (DiagnosticsInterface &&)=delete
 
 DiagnosticsInterface (const DiagnosticsInterface &)=delete
 
DiagnosticsInterfaceoperator= (const DiagnosticsInterface &)=delete
 
DiagnosticsInterfaceoperator= (DiagnosticsInterface &&)=delete
 
virtual ~DiagnosticsInterface ()=default
 
template<typename... Args>
void diagnostic_assert (std::vector< Diagnosis > &diagnoses, bool assertion, Args &&... args) const
 
void diagnostic_assert_state (std::vector< Diagnosis > &diagnoses, const VariableBase &v) const
 
void diagnostic_assert_old_state (std::vector< Diagnosis > &diagnoses, const VariableBase &v) const
 
void diagnostic_assert_force (std::vector< Diagnosis > &diagnoses, const VariableBase &v) const
 
void diagnostic_assert_old_force (std::vector< Diagnosis > &diagnoses, const VariableBase &v) const
 
void diagnostic_assert_residual (std::vector< Diagnosis > &diagnoses, const VariableBase &v) const
 
void diagnostic_check_input_variable (std::vector< Diagnosis > &diagnoses, const VariableBase &v) const
 
void diagnostic_check_output_variable (std::vector< Diagnosis > &diagnoses, const VariableBase &v) const
 

Static Public Member Functions

static OptionSet expected_options ()
 
- Static Public Member Functions inherited from SolidMechanicsDriver
static OptionSet expected_options ()
 
- Static Public Member Functions inherited from TransientDriver
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

void init_strain_control (const OptionSet &options) override
 
void init_stress_control (const OptionSet &options) override
 
virtual void init_vorticity_control (const OptionSet &options)
 
void update_forces () override
 Update the driving forces for the current time step.
 
void apply_predictor () override
 Apply the predictor to calculate the initial guess for the current time step.
 
- Protected Member Functions inherited from SolidMechanicsDriver
void update_forces () override
 Update the driving forces for the current time step.
 
virtual void init_mixed_control (const OptionSet &)
 
virtual void init_temperature_control (const OptionSet &)
 
- Protected Member Functions inherited from TransientDriver
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 apply_ic ()
 Apply the initial conditions.
 
virtual void solve_step ()
 Perform the constitutive update for the current time step.
 
virtual void store_input ()
 Save the input of the current time step.
 
virtual void output () const
 Save the results into the destination file/path.
 

Protected Attributes

const bool _vorticity_prescribed
 
VariableName _vorticity_name
 The name of the total vorticity.
 
WR2 _vorticity
 The value of the (total) vorticity.
 
const bool _cp_warmup
 
const Real _cp_warmup_elastic_scale
 Scale value for initial cp warmup.
 
const VariableName _cp_warmup_elastic_strain
 Name of the elastic strain variable for the CP warmup.
 
- Protected Attributes inherited from SolidMechanicsDriver
const EnumSelection _control
 The control method to drive the constitutive update.
 
VariableName _driving_force_name
 
SR2 _driving_force
 The value of the driving force.
 
VariableName _mixed_control_name
 
SR2 _mixed_control
 Actual control signal, when used for control == "MIXED".
 
const bool _temperature_prescribed
 
VariableName _temperature_name
 Name of the temperature variable.
 
Scalar _temperature
 Temperature.
 
- Protected Attributes inherited from TransientDriver
Model_model
 The model which the driver uses to perform constitutive updates.
 
const torch::Device _device
 The device on which to evaluate the model.
 
const VariableName _time_name
 VariableName for the time.
 
Scalar _time
 The current time.
 
Size _step_count
 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::string _save_as
 The destination file name or file path.
 
const bool _show_params
 Set to true to list all the model parameters at the beginning.
 
const bool _show_input
 Set to true to show model's input axis at the beginning.
 
const bool _show_output
 Set to true to show model's output axis at the beginning.
 
std::vector< ValueMap_result_in
 Inputs from all time steps.
 
std::vector< ValueMap_result_out
 Outputs from all time steps.
 
- Protected Attributes inherited from Driver
bool _verbose
 Whether to print out additional (debugging) information during the execution.
 

Constructor & Destructor Documentation

◆ LDISolidMechanicsDriver()

Member Function Documentation

◆ apply_predictor()

void apply_predictor ( )
overrideprotectedvirtual

Apply the predictor to calculate the initial guess for the current time step.

Reimplemented from TransientDriver.

◆ diagnose()

void diagnose ( std::vector< Diagnosis > & diagnoses) const
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.

Parameters
diagnosesA vector of exceptions of type Diagnosis for each of the detected problem.

Reimplemented from Driver.

◆ expected_options()

OptionSet expected_options ( )
static

◆ init_strain_control()

void init_strain_control ( const OptionSet & )
overrideprotectedvirtual

Control-specific initialization

Implements SolidMechanicsDriver.

◆ init_stress_control()

void init_stress_control ( const OptionSet & options)
overrideprotectedvirtual

Implements SolidMechanicsDriver.

◆ init_vorticity_control()

void init_vorticity_control ( const OptionSet & options)
protectedvirtual

◆ setup()

void setup ( )
overridevirtual

Setup this object.

This method is called automatically if you use the Factory method get_object or get_object_ptr, 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 NEML2Object.

◆ update_forces()

void update_forces ( )
overrideprotectedvirtual

Update the driving forces for the current time step.

Reimplemented from TransientDriver.

Member Data Documentation

◆ _cp_warmup

const bool _cp_warmup
protected

Whether to perform the CP warmup

◆ _cp_warmup_elastic_scale

const Real _cp_warmup_elastic_scale
protected

Scale value for initial cp warmup.

◆ _cp_warmup_elastic_strain

const VariableName _cp_warmup_elastic_strain
protected

Name of the elastic strain variable for the CP warmup.

◆ _vorticity

WR2 _vorticity
protected

The value of the (total) vorticity.

◆ _vorticity_name

VariableName _vorticity_name
protected

The name of the total vorticity.

◆ _vorticity_prescribed

const bool _vorticity_prescribed
protected

Whether vorticity is prescribed