|
Smith
0.1
Smith is an implicit thermal structural mechanics simulation code.
|
The operator-split thermal-structural solver. More...
#include <thermomechanics.hpp>

Classes | |
| struct | MechanicalMaterialInterface |
| This is an adaptor class that makes a thermomechanical material usable by the solid mechanics module, by discarding the thermal-specific information. More... | |
| struct | ThermalMaterialInterface |
| This is an adaptor class that makes a thermomechanical material usable by the thermal module, by discarding the solid-mechanics-specific information. More... | |
Public Member Functions | |
| Thermomechanics (const NonlinearSolverOptions thermal_nonlin_opts, const LinearSolverOptions thermal_lin_opts, TimesteppingOptions thermal_timestepping, const NonlinearSolverOptions solid_nonlin_opts, const LinearSolverOptions solid_lin_opts, TimesteppingOptions solid_timestepping, const std::string &physics_name, std::shared_ptr< smith::Mesh > smith_mesh, int cycle=0, double time=0.0) | |
| Construct a new coupled Thermal-SolidMechanics object. More... | |
| Thermomechanics (std::unique_ptr< EquationSolver > thermal_solver, TimesteppingOptions thermal_timestepping, std::unique_ptr< EquationSolver > solid_solver, TimesteppingOptions solid_timestepping, const std::string &physics_name, std::shared_ptr< smith::Mesh > smith_mesh, int cycle=0, double time=0.0) | |
| Construct a new coupled Thermal-SolidMechanics object. More... | |
| Thermomechanics (const HeatTransferInputOptions &thermal_options, const SolidMechanicsInputOptions &solid_options, const std::string &physics_name, std::string mesh_tag, int cycle=0, double time=0.0) | |
| Construct a new Thermal-SolidMechanics Functional object from input file options. More... | |
| Thermomechanics (const ThermomechanicsInputOptions &options, const std::string &physics_name, std::string mesh_tag, int cycle=0, double time=0.0) | |
| Construct a new Thermal-SolidMechanics Functional object from input file options. More... | |
| void | completeSetup () override |
| Complete the initialization and allocation of the data structures. More... | |
| void | resetStates (int cycle=0, double time=0.0) override |
| Method to reset physics states to zero. This does not reset design parameters or shape. More... | |
| const FiniteElementState & | state (const std::string &state_name) const override |
| Accessor for getting named finite element state primal fields from the physics modules. More... | |
| void | setState (const std::string &state_name, const FiniteElementState &state) override |
| Set the primal solution field (displacement, velocity, temperature) for the underlying thermomechanics solver. More... | |
| virtual std::vector< std::string > | stateNames () const override |
| Get a vector of the finite element state solution variable names. More... | |
| const FiniteElementState & | adjoint (const std::string &state_name) const override |
| Accessor for getting named finite element adjoint fields from the physics modules. More... | |
| void | advanceTimestep (double dt) override |
| Advance the timestep. More... | |
| template<typename T > | |
| std::shared_ptr< QuadratureData< T > > | createQuadratureDataBuffer (T initial_state) |
| Create a shared ptr to a quadrature data buffer for the given material type. More... | |
| template<int... active_parameters, typename MaterialType , typename StateType > | |
| void | setMaterial (DependsOn< active_parameters... >, const MaterialType &material, Domain &domain, std::shared_ptr< QuadratureData< StateType >> qdata) |
| Set the thermomechanical material response. More... | |
| template<typename MaterialType , typename StateType = Empty> | |
| void | setMaterial (const MaterialType &material, Domain &domain, std::shared_ptr< QuadratureData< StateType >> qdata=EmptyQData) |
| This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts. | |
| void | setTemperatureBCs (const std::set< int > &temperature_attributes, std::function< double(const mfem::Vector &x, double t)> prescribed_value) |
| Set essential temperature boundary conditions (strongly enforced) More... | |
| template<typename AppliedDisplacementFunction > | |
| void | setDisplacementBCs (AppliedDisplacementFunction applied_displacement, Domain &domain, Components components=Component::ALL) |
| Set essential displacement boundary conditions on selected components. More... | |
| void | setFixedBCs (Domain &domain, Components components=Component::ALL) |
| Shortcut to set selected components of displacements to zero for all time. More... | |
| template<typename FluxType > | |
| void | setHeatFluxBCs (FluxType flux_function) |
| Set the thermal flux boundary condition. More... | |
| template<typename Callable > | |
| void | setDisplacement (Callable displacement) |
| Set the underlying finite element state to a prescribed displacement. More... | |
| void | setTemperature (std::function< double(const mfem::Vector &x, double t)> temperature) |
| Set the underlying finite element state to a prescribed temperature. More... | |
| template<typename BodyForceType > | |
| void | addBodyForce (BodyForceType body_force_function) |
| Set the body forcefunction. More... | |
| template<typename HeatSourceType > | |
| void | addHeatSource (HeatSourceType source_function) |
| Set the thermal source function. More... | |
| const smith::FiniteElementState & | displacement () const |
| Get the displacement state. More... | |
| const smith::FiniteElementState & | temperature () const |
| Get the temperature state. More... | |
Public Member Functions inherited from smith::BasePhysics | |
| BasePhysics (std::string physics_name, std::shared_ptr< smith::Mesh > mesh, int cycle=0, double time=0.0, bool checkpoint_to_disk=false) | |
| Empty constructor. More... | |
| BasePhysics (BasePhysics &&other)=default | |
| Construct a new Base Physics object (copy constructor) More... | |
| virtual double | time () const |
| Get the current forward-solution time. More... | |
| virtual int | cycle () const |
| Get the current forward-solution cycle iteration number. More... | |
| virtual double | maxTime () const |
| Get the maximum time reached by the forward solver. More... | |
| virtual double | minTime () const |
| Get the initial time used by the forward solver. More... | |
| virtual int | maxCycle () const |
| The maximum cycle (timestep iteration number) reached by the forward solver. More... | |
| virtual int | minCycle () const |
| Get the initial cycle (timestep iteration number) used by the forward solver. More... | |
| bool | isQuasistatic () const |
| Check if the physics is setup as quasistatic. More... | |
| virtual const std::vector< double > & | timesteps () const |
| Get a vector of the timestep sizes (i.e. \(\Delta t\)s) taken by the forward solver. More... | |
| virtual void | resetAdjointStates () |
| Base method to reset physics states back to the end of time to start adjoint calculations again. This does not reset design parameters or shape. | |
| virtual std::vector< std::string > | adjointNames () const |
| Get a vector of the finite element state adjoint solution names. More... | |
| virtual std::vector< std::string > | dualNames () const |
| Get a vector of the finite element state dual (reaction) solution names. More... | |
| virtual const FiniteElementDual & | dual (const std::string &dual_name) const |
| Accessor for getting named finite element state dual (reaction) solution from the physics modules. More... | |
| virtual const FiniteElementState & | dualAdjoint (const std::string &dual_name) const |
| Accessor for getting named finite element state dual adjoint (reaction adjoint load) from the physics modules. More... | |
| virtual const FiniteElementState & | shapeDisplacement () const |
| Accessor for getting the shape displacement field from the physics modules. More... | |
| virtual const FiniteElementState & | parameter (const std::string ¶meter_name) const |
| Accessor for getting named finite element state parameter fields from the physics modules. More... | |
| virtual const FiniteElementState & | parameter (std::size_t parameter_index) const |
| Accessor for getting indexed finite element state parameter fields from the physics modules. More... | |
| virtual std::vector< std::string > | parameterNames () const |
| Get a vector of the finite element state parameter names. More... | |
| virtual void | setParameter (const size_t parameter_index, const FiniteElementState ¶meter_state) |
| Deep copy a parameter field into the internally-owned parameter used for simulations. More... | |
| virtual void | setShapeDisplacement (const FiniteElementState &shape_displacement) |
| Set the current shape displacement for the underlying mesh. More... | |
| virtual FiniteElementDual | computeTimestepSensitivity (size_t parameter_index) |
| Compute the implicit sensitivity of the quantity of interest used in defining the adjoint load with respect to the parameter field (d QOI/d state * d state/d parameter). More... | |
| virtual const FiniteElementDual & | computeTimestepShapeSensitivity () |
| Compute the implicit sensitivity of the quantity of interest used in defining the adjoint load with respect to the shape displacement field (d QOI/d state * d state/d shape displacement). More... | |
| virtual const std::unordered_map< std::string, const smith::FiniteElementDual & > | computeInitialConditionSensitivity () const |
| Compute the implicit sensitivity of the quantity of interest with respect to the initial condition fields. More... | |
| virtual void | setAdjointLoad (std::unordered_map< std::string, const smith::FiniteElementDual & > string_to_dual) |
| Set the loads for the adjoint reverse timestep solve. More... | |
| virtual void | setDualAdjointBcs (std::unordered_map< std::string, const smith::FiniteElementState & > string_to_bc) |
| Set the dual loads (dirichlet values) for the adjoint reverse timestep solve This must be called after setAdjointLoad. More... | |
| virtual void | reverseAdjointTimestep () |
| Solve the adjoint reverse timestep problem. More... | |
| virtual void | outputStateToDisk (std::optional< std::string > paraview_output_dir={}) const |
Output the current state of the PDE fields in Sidre format and optionally in Paraview format if paraview_output_dir is given. More... | |
| void | loadCheckpointedStatesFromDisk (int cycle) |
| load checkpointed states from disk into states array More... | |
| virtual FiniteElementState | loadCheckpointedState (const std::string &state_name, int cycle) |
| Accessor for getting a single named finite element state primal solution from the physics modules at a given checkpointed cycle index. More... | |
| virtual FiniteElementDual | loadCheckpointedDual ([[maybe_unused]] const std::string &state_name, [[maybe_unused]] int cycle) |
| Accessor for getting a single named finite element dual solution from the physics modules at a given checkpointed cycle index. More... | |
| virtual double | getCheckpointedTimestep (int cycle) const |
| Get a timestep increment which has been previously checkpointed at the give cycle. More... | |
| virtual void | initializeSummary (axom::sidre::DataStore &datastore, const double t_final, const double dt) const |
| Initializes the Sidre structure for simulation summary data. More... | |
| virtual void | saveSummary (axom::sidre::DataStore &datastore, const double t) const |
| Saves the summary data to the Sidre Datastore. More... | |
| virtual | ~BasePhysics ()=default |
| Destroy the Base Solver object. | |
| const smith::Mesh & | mesh () const |
| Returns a reference to the mesh object. | |
| const mfem::ParMesh & | mfemParMesh () const |
| Returns a reference to the mfem ParMesh object. | |
| mfem::ParMesh & | mfemParMesh () |
| Returns a reference to the mfem ParMesh object. | |
| std::string | name () const |
| Return the name of the physics. | |
Protected Types | |
| using | displacement_field = H1< order, dim > |
| the function space for the displacement field | |
| using | temperature_field = H1< order > |
| the function space for the temperature field | |
Protected Attributes | |
| HeatTransfer< order, dim, Parameters< displacement_field, parameter_space... > > | thermal_ |
| Submodule to compute the heat transfer physics. | |
| SolidMechanics< order, dim, Parameters< temperature_field, parameter_space... > > | solid_ |
| Submodule to compute the mechanics. | |
Protected Attributes inherited from smith::BasePhysics | |
| std::string | name_ = {} |
| Name of the physics module. | |
| std::shared_ptr< smith::Mesh > | mesh_ |
| The primary mesh. | |
| MPI_Comm | comm_ |
| The MPI communicator. | |
| std::vector< const smith::FiniteElementState * > | states_ |
| List of finite element primal states associated with this physics module. | |
| std::vector< const smith::FiniteElementState * > | adjoints_ |
| List of finite element adjoint states associated with this physics module. | |
| std::vector< const smith::FiniteElementDual * > | duals_ |
| List of finite element duals associated with this physics module. | |
| std::vector< const smith::FiniteElementState * > | dual_adjoints_ |
| List of adjoint finite element duals associated with this physics module. | |
| std::vector< ParameterInfo > | parameters_ |
| A vector of the parameters associated with this physics module. | |
| std::unordered_map< std::string, std::vector< smith::FiniteElementState > > | checkpoint_states_ |
| A map containing optionally in-memory checkpointed primal states for transient adjoint solvers. | |
| std::unordered_map< std::string, smith::FiniteElementState > | cached_checkpoint_states_ |
| A container relating a checkpointed cycle and the associated finite element state fields. More... | |
| std::optional< int > | cached_checkpoint_cycle_ |
| An optional int for disk-based checkpointing containing the cycle number of the last retrieved checkpoint. | |
| bool | is_quasistatic_ = true |
| Whether the simulation is time-independent. | |
| double | time_ |
| Current time for the forward pass. | |
| double | dt_ |
| Current time step. | |
| double | max_time_ |
| The maximum time reached for the forward solver. | |
| double | min_time_ |
| The time the forward solver was initialized to. | |
| std::vector< double > | timesteps_ |
| A vector of the timestep sizes (i.e. \(\Delta t\)) taken by the forward solver. | |
| int | cycle_ |
| Current cycle (forward pass time iteration count) | |
| int | max_cycle_ |
| The maximum cycle (forward pass iteration count) reached by the forward solver. | |
| int | min_cycle_ |
| The cycle the forward solver was initialized to. | |
| double | ode_time_point_ |
| The value of time at which the ODE solver wants to evaluate the residual. | |
| int | mpi_rank_ |
| MPI rank. | |
| int | mpi_size_ |
| MPI size. | |
| std::unique_ptr< mfem::ParaViewDataCollection > | paraview_dc_ |
| DataCollection pointer for optional paraview output. | |
| std::unordered_map< std::string, std::unique_ptr< mfem::ParGridFunction > > | paraview_dual_grid_functions_ |
| A optional map of the dual names and duals in grid function form for paraview output. | |
| std::unique_ptr< mfem::ParGridFunction > | shape_sensitivity_grid_function_ |
| A optional view of the shape sensitivity in grid function form for paraview output. | |
| smith::FiniteElementState | shape_displacement_ |
| The shape displacement field. | |
| smith::FiniteElementDual | shape_displacement_dual_ |
| The shape displacement field sensitivity. | |
| BoundaryConditionManager | bcs_ |
| Boundary condition manager instance. | |
| bool | checkpoint_to_disk_ |
| A flag denoting whether to save the state to disk or memory as needed for dynamic adjoint solves. | |
Additional Inherited Members | |
Protected Member Functions inherited from smith::BasePhysics | |
| const FiniteElementDual & | shapeDisplacementSensitivity () const |
| Internally used accessor for getting the shape displacement sensitivity from the physics modules. More... | |
| void | CreateParaviewDataCollection () const |
| Create a paraview data collection for the physics package if requested. | |
| void | UpdateParaviewDataCollection (const std::string ¶view_output_dir) const |
| Update the paraview states, duals, parameters, and metadata (cycle, time) in preparation for output. More... | |
| void | initializeBasePhysicsStates (int cycle, double time) |
| Protected, non-virtual method to reset physics states to zero. This does not reset design parameters or shape. More... | |
| std::unordered_map< std::string, FiniteElementState > | getCheckpointedStates (int cycle) |
| Accessor for getting all of the primal solutions from the physics modules at a given checkpointed cycle index. More... | |
Static Protected Attributes inherited from smith::BasePhysics | |
| static constexpr int | FLOAT_PRECISION_ = 8 |
| Number of significant figures to output for floating-point. | |
The operator-split thermal-structural solver.
Uses Functional to compute action of operators
Definition at line 33 of file thermomechanics.hpp.
|
inline |
Construct a new coupled Thermal-SolidMechanics object.
| thermal_nonlin_opts | The options for solving the nonlinear heat conduction residual equations |
| thermal_lin_opts | The options for solving the linearized Jacobian heat transfer equations |
| thermal_timestepping | The timestepping options for the heat transfer operator |
| solid_nonlin_opts | The options for solving the nonlinear solid mechanics residual equations |
| solid_lin_opts | The options for solving the linearized Jacobian solid mechanics equations |
| solid_timestepping | The timestepping options for the solid solver |
| physics_name | A name for the physics module instance |
| smith_mesh | Smith mesh for physics |
| cycle | The simulation cycle (i.e. timestep iteration) to intialize the physics module to |
| time | The simulation time to initialize the physics module to |
Definition at line 49 of file thermomechanics.hpp.
|
inline |
Construct a new coupled Thermal-SolidMechanics object.
| thermal_solver | The nonlinear equation solver for the heat conduction equations |
| thermal_timestepping | The timestepping options for the thermal solver |
| solid_solver | The nonlinear equation solver for the solid mechanics equations |
| solid_timestepping | The timestepping options for the solid solver |
| physics_name | A name for the physics module instance |
| smith_mesh | Smith mesh for physics |
| cycle | The simulation cycle (i.e. timestep iteration) to intialize the physics module to |
| time | The simulation time to initialize the physics module to |
Definition at line 73 of file thermomechanics.hpp.
|
inline |
Construct a new Thermal-SolidMechanics Functional object from input file options.
| [in] | thermal_options | The thermal physics module input file option struct |
| [in] | solid_options | The solid physics module input file option struct |
| [in] | physics_name | A name for the physics module instance |
| [in] | mesh_tag | The tag for the mesh in the StateManager to construct the physics module on |
| [in] | cycle | The simulation cycle (i.e. timestep iteration) to intialize the physics module to |
| [in] | time | The simulation time to initialize the physics module to |
Definition at line 101 of file thermomechanics.hpp.
|
inline |
Construct a new Thermal-SolidMechanics Functional object from input file options.
| [in] | options | The thermal solid physics module input file option struct |
| [in] | physics_name | A name for the physics module instance |
| [in] | mesh_tag | The tag for the mesh in the StateManager to construct the physics module on |
| [in] | cycle | The simulation cycle (i.e. timestep iteration) to intialize the physics module to |
| [in] | time | The simulation time to initialize the physics module to |
Definition at line 119 of file thermomechanics.hpp.
|
inline |
Set the body forcefunction.
| BodyForceType | The type of the body force load |
tensor<T,dim> x the spatial coordinates for the quadrature pointdouble t the time (note: time will be handled differently in the future)tuple{value, derivative}, a variadic list of tuples (each with a values and derivative), one tuple for each of the trial spaces specified in the DependsOn<...> argument. double, tensor<double, ... > or tuples thereof when doing direct evaluation. When differentiating with respect to one of the inputs, its stored values will change to dual numbers rather than double. (e.g. tensor<double,3> becomes tensor<dual<...>, 3>) Definition at line 510 of file thermomechanics.hpp.
|
inline |
Set the thermal source function.
| HeatSourceType | The type of the source function |
| source_function | A source function for a prescribed thermal load |
tensor<T,dim> x the spatial coordinates for the quadrature pointdouble t the time (note: time will be handled differently in the future)T temperature the current temperature at the quadrature pointtensor<T,dim> the spatial gradient of the temperature at the quadrature pointtuple{value, derivative}, a variadic list of tuples (each with a values and derivative), one tuple for each of the trial spaces specified in the DependsOn<...> argument.double, tensor<double, ... > or tuples thereof when doing direct evaluation. When differentiating with respect to one of the inputs, its stored values will change to dual numbers rather than double. (e.g. tensor<double,3> becomes tensor<dual<...>, 3>) Definition at line 535 of file thermomechanics.hpp.
|
inlineoverridevirtual |
Accessor for getting named finite element adjoint fields from the physics modules.
| state_name | The name of the Finite Element State adjoint field to retrieve |
Implements smith::BasePhysics.
Definition at line 220 of file thermomechanics.hpp.
|
inlineoverridevirtual |
Advance the timestep.
| dt | The increment of simulation time to advance the underlying thermomechanical problem |
Implements smith::BasePhysics.
Definition at line 238 of file thermomechanics.hpp.
|
inlineoverridevirtual |
Complete the initialization and allocation of the data structures.
Implements smith::BasePhysics.
Definition at line 136 of file thermomechanics.hpp.
|
inline |
Create a shared ptr to a quadrature data buffer for the given material type.
| T | the type to be created at each quadrature point |
| initial_state | the value to be broadcast to each quadrature point |
Definition at line 258 of file thermomechanics.hpp.
|
inline |
Get the displacement state.
Definition at line 545 of file thermomechanics.hpp.
|
inlineoverridevirtual |
Method to reset physics states to zero. This does not reset design parameters or shape.
| [in] | cycle | The simulation cycle (i.e. timestep iteration) to intialize the physics module to |
| [in] | time | The simulation time to initialize the physics module to |
Implements smith::BasePhysics.
Definition at line 148 of file thermomechanics.hpp.
|
inline |
Set the underlying finite element state to a prescribed displacement.
| displacement | The function describing the displacement field |
Definition at line 479 of file thermomechanics.hpp.
|
inline |
Set essential displacement boundary conditions on selected components.
| [in] | applied_displacement | Function specifying the applied displacement vector. |
| [in] | domain | Domain over which to apply the boundary condition. |
| [in] | components | (optional) (optional) Indicator of vector components to be constrained. If argument is omitted, the default is to constrain all components. |
The signature of the applied_displacement callable is: tensor<double, dim> applied_displacement(tensor<double, dim> X, double t) Parameters: X - coordinates of node t - time Returns: u, vector of applied displacements
Definition at line 427 of file thermomechanics.hpp.
|
inline |
Shortcut to set selected components of displacements to zero for all time.
| [in] | domain | Domain to apply the homogeneous boundary condition to |
| [in] | components | (optional) Indicator of vector components to be constrained. If argument is omitted, the default is to constrain all components. |
Definition at line 442 of file thermomechanics.hpp.
|
inline |
Set the thermal flux boundary condition.
| FluxType | The type of the thermal flux object |
| flux_function | A function describing the flux applied to a boundary |
tensor<T,dim> x the spatial coordinates for the quadrature pointtensor<T,dim> n the outward-facing unit normal for the quadrature pointdouble t the time (note: time will be handled differently in the future)T temperature the current temperature at the quadrature pointtuple{value, derivative}, a variadic list of tuples (each with a values and derivative), one tuple for each of the trial spaces specified in the DependsOn<...> argument.double, tensor<double, ... > or tuples thereof when doing direct evaluation. When differentiating with respect to one of the inputs, its stored values will change to dual numbers rather than double. (e.g. tensor<double,3> becomes tensor<dual<...>, 3>)Definition at line 468 of file thermomechanics.hpp.
|
inline |
Set the thermomechanical material response.
| MaterialType | The thermomechanical material type |
| StateType | The type that contains the internal variables for MaterialType |
| material | A material that provides a function to evaluate stress, heat flux, density, and heat capacity |
| domain | which elements in the mesh are described by the specified material |
| qdata | the buffer of material internal variables at each quadrature point |
MaterialType::State & state an mutable reference to the internal variables for this quadrature pointtensor<T,dim,dim> du_dx the displacement gradient at this quadrature pointT temperature the current temperature at the quadrature pointtensor<T,dim> the spatial gradient of the temperature at the quadrature pointtuple{value, derivative}, a tuple of values and derivatives for each parameter field specified in the DependsOn<...> argument.double, tensor<double, ... > or tuples thereof when doing direct evaluation. When differentiating with respect to one of the inputs, its stored values will change to dual numbers rather than double. (e.g. tensor<double,3> becomes tensor<dual<...>, 3>)Definition at line 376 of file thermomechanics.hpp.
|
inlineoverridevirtual |
Set the primal solution field (displacement, velocity, temperature) for the underlying thermomechanics solver.
| state_name | The name of the field to initialize ("displacement", or "velocity") |
| state | The finite element state vector containing the values for either the displacement or velocity fields |
It is expected that state has the same underlying finite element space and mesh as the selected primal solution field.
Implements smith::BasePhysics.
Definition at line 186 of file thermomechanics.hpp.
|
inline |
Set the underlying finite element state to a prescribed temperature.
| temperature | The function describing the temperature field |
Definition at line 489 of file thermomechanics.hpp.
|
inline |
Set essential temperature boundary conditions (strongly enforced)
| [in] | temperature_attributes | The boundary attributes on which to enforce a temperature |
| [in] | prescribed_value | The prescribed boundary temperature function |
Definition at line 402 of file thermomechanics.hpp.
|
inlineoverridevirtual |
Accessor for getting named finite element state primal fields from the physics modules.
| state_name | The name of the Finite Element State to retrieve |
Implements smith::BasePhysics.
Definition at line 161 of file thermomechanics.hpp.
|
inlineoverridevirtual |
Get a vector of the finite element state solution variable names.
Implements smith::BasePhysics.
Definition at line 209 of file thermomechanics.hpp.
|
inline |
Get the temperature state.
Definition at line 552 of file thermomechanics.hpp.