Serac
0.1
Serac is an implicit thermal strucural mechanics simulation code.
|
The nonlinear solid solver class. More...
#include <solid_mechanics.hpp>
Public Types | |
template<typename T > | |
using | qdata_type = std::shared_ptr< QuadratureData< T > > |
a container holding quadrature point data of the specified type More... | |
Public Member Functions | |
SolidMechanics (const NonlinearSolverOptions nonlinear_opts, const LinearSolverOptions lin_opts, const serac::TimesteppingOptions timestepping_opts, const GeometricNonlinearities geom_nonlin, const std::string &physics_name, std::string mesh_tag, std::vector< std::string > parameter_names={}, int cycle=0, double time=0.0, bool checkpoint_to_disk=false) | |
Construct a new SolidMechanics object. More... | |
SolidMechanics (std::unique_ptr< serac::EquationSolver > solver, const serac::TimesteppingOptions timestepping_opts, const GeometricNonlinearities geom_nonlin, const std::string &physics_name, std::string mesh_tag, std::vector< std::string > parameter_names={}, int cycle=0, double time=0.0, bool checkpoint_to_disk=false) | |
Construct a new SolidMechanics object. More... | |
SolidMechanics (const SolidMechanicsInputOptions &input_options, const std::string &physics_name, std::string mesh_tag, int cycle=0, double time=0.0) | |
Construct a new Nonlinear SolidMechanics Solver object. More... | |
virtual | ~SolidMechanics () |
Destroy the SolidMechanics Functional object. | |
void | initializeSolidMechanicsStates () |
Non virtual method to reset thermal states to zero. This does not reset design parameters or shape. 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... | |
template<typename T > | |
qdata_type< T > | createQuadratureDataBuffer (T initial_state) |
Create a shared ptr to a quadrature data buffer for the given material type. More... | |
void | setDisplacementBCs (const std::set< int > &disp_bdr, std::function< void(const mfem::Vector &, mfem::Vector &)> disp) |
Set essential displacement boundary conditions (strongly enforced) More... | |
void | setDisplacementBCs (const std::set< int > &disp_bdr, std::function< void(const mfem::Vector &, double, mfem::Vector &)> disp) |
Set essential displacement boundary conditions (strongly enforced) More... | |
void | setDisplacementBCs (const std::set< int > &disp_bdr, std::function< double(const mfem::Vector &x)> disp, int component) |
Set the displacement essential boundary conditions on a single component. More... | |
void | setDisplacementBCsByDofList (const mfem::Array< int > true_dofs, std::function< void(const mfem::Vector &, double, mfem::Vector &)> disp) |
Set the displacement essential boundary conditions on a set of true degrees of freedom. More... | |
void | setDisplacementBCsByDofList (const mfem::Array< int > true_dofs, std::function< void(const mfem::Vector &, mfem::Vector &)> disp) |
Set the displacement essential boundary conditions on a set of true degrees of freedom. More... | |
void | setDisplacementBCs (std::function< bool(const mfem::Vector &)> is_node_constrained, std::function< void(const mfem::Vector &, double, mfem::Vector &)> disp) |
Set the displacement boundary conditions on a set of nodes within a spatially-defined area. More... | |
void | setDisplacementBCs (std::function< bool(const mfem::Vector &)> is_node_constrained, std::function< void(const mfem::Vector &, mfem::Vector &)> disp) |
Set the displacement boundary conditions on a set of nodes within a spatially-defined area. More... | |
void | setDisplacementBCs (std::function< bool(const mfem::Vector &)> is_node_constrained, std::function< double(const mfem::Vector &, double)> disp, int component) |
Set the displacement boundary conditions on a set of nodes within a spatially-defined area for a single displacement vector component. More... | |
void | setDisplacementBCs (std::function< bool(const mfem::Vector &x)> is_node_constrained, std::function< double(const mfem::Vector &x)> disp, int component) |
Set the displacement boundary conditions on a set of nodes within a spatially-defined area for a single displacement vector component. More... | |
const FiniteElementState & | state (const std::string &state_name) const override |
Accessor for getting named finite element state fields from the physics modules. More... | |
void | setState (const std::string &state_name, const FiniteElementState &state) override |
Set the primal solution field (displacement, velocity) for the underlying solid mechanics solver. More... | |
std::vector< std::string > | stateNames () const override |
Get a vector of the finite element state solution variable names. More... | |
template<int... active_parameters, typename callable > | |
void | addCustomBoundaryIntegral (DependsOn< active_parameters... >, callable qfunction, const std::optional< Domain > &optional_domain=std::nullopt) |
register a custom boundary integral calculation as part of the residual More... | |
const FiniteElementState & | adjoint (const std::string &state_name) const override |
Accessor for getting named finite element state adjoint solution from the physics modules. More... | |
std::vector< std::string > | adjointNames () const override |
Get a vector of the finite element state solution variable names. More... | |
template<int... active_parameters, typename callable , typename StateType = Nothing> | |
void | addCustomDomainIntegral (DependsOn< active_parameters... >, callable qfunction, qdata_type< StateType > qdata=NoQData) |
register a custom domain integral calculation as part of the residual More... | |
template<int... active_parameters, typename MaterialType , typename StateType = Empty> | |
void | setMaterial (DependsOn< active_parameters... >, MaterialType material, qdata_type< StateType > qdata=EmptyQData) |
Set the material stress response and mass properties for the physics module. More... | |
template<typename MaterialType , typename StateType = Empty> | |
void | setMaterial (MaterialType material, 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 | setDisplacement (std::function< void(const mfem::Vector &x, mfem::Vector &disp)> disp) |
Set the underlying finite element state to a prescribed displacement. More... | |
void | setDisplacement (const FiniteElementState &temp) |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts. | |
void | setVelocity (std::function< void(const mfem::Vector &x, mfem::Vector &vel)> vel) |
Set the underlying finite element state to a prescribed velocity. More... | |
void | setVelocity (const FiniteElementState &temp) |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts. | |
template<int... active_parameters, typename BodyForceType > | |
void | addBodyForce (DependsOn< active_parameters... >, BodyForceType body_force, const std::optional< Domain > &optional_domain=std::nullopt) |
Set the body forcefunction. More... | |
template<typename BodyForceType > | |
void | addBodyForce (BodyForceType body_force, const std::optional< Domain > &optional_domain=std::nullopt) |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts. | |
template<int... active_parameters, typename TractionType > | |
void | setTraction (DependsOn< active_parameters... >, TractionType traction_function, const std::optional< Domain > &optional_domain=std::nullopt) |
Set the traction boundary condition. More... | |
template<typename TractionType > | |
void | setTraction (TractionType traction_function, const std::optional< Domain > &optional_domain=std::nullopt) |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts. | |
template<int... active_parameters, typename PressureType > | |
void | setPressure (DependsOn< active_parameters... >, PressureType pressure_function, const std::optional< Domain > &optional_domain=std::nullopt) |
Set the pressure boundary condition. More... | |
template<typename PressureType > | |
void | setPressure (PressureType pressure_function, const std::optional< Domain > &optional_domain=std::nullopt) |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts. | |
virtual std::unique_ptr< mfem_ext::StdFunctionOperator > | buildQuasistaticOperator () |
Build the quasi-static operator corresponding to the total Lagrangian formulation. | |
std::pair< const mfem::HypreParMatrix &, const mfem::HypreParMatrix & > | stiffnessMatrix () const |
Return the assembled stiffness matrix. More... | |
void | completeSetup () override |
Complete the initialization and allocation of the data structures. More... | |
void | zeroEssentials (FiniteElementVector &field) const |
Set field to zero wherever their are essential boundary conditions applies. | |
virtual void | quasiStaticSolve (double dt) |
Solve the Quasi-static Newton system. | |
void | advanceTimestep (double dt) override |
Advance the solid mechanics physics module in time. More... | |
virtual void | setAdjointLoad (std::unordered_map< std::string, const serac::FiniteElementDual & > loads) override |
Set the loads for the adjoint reverse timestep solve. More... | |
void | reverseAdjointTimestep () override |
Solve the adjoint problem. More... | |
std::unordered_map< std::string, FiniteElementState > | getCheckpointedStates (int cycle_to_load) const override |
Accessor for getting named finite element state primal solution from the physics modules at a given checkpointed cycle index. More... | |
FiniteElementDual & | computeTimestepSensitivity (size_t parameter_field) override |
Compute the implicit sensitivity of the quantity of interest used in defining the load for the adjoint problem with respect to the parameter field. More... | |
FiniteElementDual & | computeTimestepShapeSensitivity () override |
Compute the implicit sensitivity of the quantity of interest used in defining the load for the adjoint problem with respect to the shape displacement field. More... | |
const std::unordered_map< std::string, const serac::FiniteElementDual & > | computeInitialConditionSensitivity () override |
Compute the implicit sensitivity of the quantity of interest with respect to the initial temperature. More... | |
const serac::FiniteElementState & | displacement () const |
Get the displacement state. More... | |
const serac::FiniteElementState & | velocity () const |
Get the velocity state. More... | |
const serac::FiniteElementState & | acceleration () const |
Get the acceleration state. More... | |
const serac::FiniteElementDual & | reactions () |
getter for nodal forces (before zeroing-out essential dofs) | |
Public Member Functions inherited from serac::BasePhysics | |
BasePhysics (std::string physics_name, std::string mesh_tag, 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 std::vector< double > | timesteps () const |
Get a vector of the timestep sizes (i.e. \(\Delta t\)s) taken by the forward solver. More... | |
const FiniteElementState & | shapeDisplacement () const |
Accessor for getting the shape displacement field from the physics modules. More... | |
const FiniteElementState & | parameter (const std::string ¶meter_name) const |
Accessor for getting named finite element state parameter fields from the physics modules. More... | |
const FiniteElementState & | parameter (std::size_t parameter_index) const |
Accessor for getting indexed finite element state parameter fields from the physics modules. More... | |
std::vector< std::string > | parameterNames () |
Get a vector of the finite element state parameter names. More... | |
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... | |
void | setShapeDisplacement (const FiniteElementState &shape_displacement) |
Set the current shape displacement for the underlying mesh. 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... | |
FiniteElementState | loadCheckpointedState (const std::string &state_name, int cycle) const |
Accessor for getting a single named finite element state primal 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 mfem::ParMesh & | mesh () const |
Returns a reference to the mesh object. | |
mfem::ParMesh & | mesh () |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts. | |
Static Public Attributes | |
static constexpr auto | NUM_STATE_VARS = 2 |
The total number of non-parameter state variables (displacement, acceleration) passed to the FEM integrators. | |
Protected Types | |
using | trial = H1< order, dim > |
The compile-time finite element trial space for displacement and velocity (H1 of order p) | |
using | test = H1< order, dim > |
The compile-time finite element test space for displacement and velocity (H1 of order p) | |
using | shape_trial = H1< SHAPE_ORDER, dim > |
Protected Member Functions | |
mfem::Array< int > | calculateConstrainedDofs (std::function< bool(const mfem::Vector &)> is_node_constrained, std::optional< int > component={}) |
Calculate a list of constrained dofs in the true displacement vector from a function that returns true if a physical coordinate is in the constrained set. More... | |
void | warmStartDisplacement () |
Sets the Dirichlet BCs for the current time and computes an initial guess for parameters and displacement. | |
Protected Member Functions inherited from serac::BasePhysics | |
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... | |
Protected Attributes | |
FiniteElementState | displacement_ |
The displacement finite element state. | |
FiniteElementState | velocity_ |
The velocity finite element state. | |
FiniteElementState | acceleration_ |
The acceleration finite element state. | |
FiniteElementState | adjoint_displacement_ |
The displacement finite element adjoint state. | |
FiniteElementDual | displacement_adjoint_load_ |
The adjoint load (RHS) for the displacement adjoint system solve (downstream -dQOI/d displacement) | |
FiniteElementDual | velocity_adjoint_load_ |
The adjoint load (RHS) for the velocity adjoint system solve (downstream -dQOI/d velocity) | |
FiniteElementDual | acceleration_adjoint_load_ |
The adjoint load (RHS) for the adjoint system solve (downstream -dQOI/d acceleration) | |
FiniteElementDual | implicit_sensitivity_displacement_start_of_step_ |
The total/implicit sensitivity of the qoi with respect to the start of the previous timestep's displacement. | |
FiniteElementDual | implicit_sensitivity_velocity_start_of_step_ |
The total/implicit sensitivity of the qoi with respect to the start of the previous timestep's velocity. | |
FiniteElementDual | reactions_ |
nodal forces | |
std::unique_ptr< ShapeAwareFunctional< shape_trial, test(trial, trial, parameter_space...)> > | residual_ |
serac::Functional that is used to calculate the residual and its derivatives | |
std::unique_ptr< mfem_ext::StdFunctionOperator > | residual_with_bcs_ |
mfem::Operator that calculates the residual after applying essential boundary conditions | |
std::unique_ptr< EquationSolver > | nonlin_solver_ |
the specific methods and tolerances specified to solve the nonlinear residual equations | |
mfem_ext::SecondOrderODE | ode2_ |
the ordinary differential equation that describes how to solve for the second time derivative of displacement, given the current displacement, velocity, and source terms | |
std::unique_ptr< mfem::HypreParMatrix > | J_ |
Assembled sparse matrix for the Jacobian df/du (11 block if using Lagrange multiplier contact) | |
std::unique_ptr< mfem::HypreParMatrix > | J_e_ |
mfem::Vector | predicted_displacement_ |
an intermediate variable used to store the predicted end-step displacement | |
mfem::Vector | du_ |
vector used to store the change in essential bcs between timesteps | |
mfem::Vector | dr_ |
vector used to store forces arising from du_ when applying time-dependent bcs | |
mfem::Vector | u_ |
used to communicate the ODE solver's predicted displacement to the residual operator | |
mfem::Vector | v_ |
used to communicate the ODE solver's predicted velocity to the residual operator | |
double | c0_ |
coefficient used to calculate predicted displacement: u_p := u + c0 * d2u_dt2 | |
double | c1_ |
coefficient used to calculate predicted velocity: dudt_p := dudt + c1 * d2u_dt2 | |
GeometricNonlinearities | geom_nonlin_ |
A flag denoting whether to compute geometric nonlinearities in the residual. | |
std::shared_ptr< mfem::VectorCoefficient > | disp_bdr_coef_ |
Coefficient containing the essential boundary values. | |
std::shared_ptr< mfem::Coefficient > | component_disp_bdr_coef_ |
Coefficient containing the essential boundary values. | |
std::array< std::function< decltype((*residual_)(DifferentiateWRT< 1 >{}, 0.0, shape_displacement_, displacement_, acceleration_, *parameters_[parameter_indices].state...))(double)>, sizeof...(parameter_indices)> | d_residual_d_ |
Array functions computing the derivative of the residual with respect to each given parameter. More... | |
Protected Attributes inherited from serac::BasePhysics | |
std::string | name_ = {} |
Name of the physics module. | |
std::string | mesh_tag_ = {} |
ID of the corresponding MFEMSidreDataCollection (denoting a mesh) | |
mfem::ParMesh & | mesh_ |
The primary mesh. | |
MPI_Comm | comm_ |
The MPI communicator. | |
std::vector< const serac::FiniteElementState * > | states_ |
List of finite element primal states associated with this physics module. | |
std::vector< const serac::FiniteElementState * > | adjoints_ |
List of finite element adjoint states associated with this physics module. | |
std::vector< const serac::FiniteElementDual * > | duals_ |
List of finite element duals associated with this physics module. | |
std::vector< ParameterInfo > | parameters_ |
A vector of the parameters associated with this physics module. | |
FiniteElementState & | shape_displacement_ |
The parameter info associated with the shape displacement field. More... | |
std::unique_ptr< FiniteElementDual > | shape_displacement_sensitivity_ |
Sensitivity with respect to the shape displacement field. More... | |
std::unordered_map< std::string, std::vector< serac::FiniteElementState > > | checkpoint_states_ |
A map containing optionally in-memory checkpointed primal states for transient adjoint solvers. | |
std::unordered_map< std::string, serac::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 | 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. | |
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 | |
Static Protected Attributes inherited from serac::BasePhysics | |
static constexpr int | FLOAT_PRECISION_ = 8 |
Number of significant figures to output for floating-point. | |
The nonlinear solid solver class.
The nonlinear total Lagrangian quasi-static and dynamic hyperelastic solver object. This uses Functional to compute the tangent stiffness matrices.
order | The order of the discretization of the displacement and velocity fields |
dim | The spatial dimension of the mesh |
Definition at line 98 of file solid_mechanics.hpp.
using serac::SolidMechanics< order, dim, Parameters< parameter_space... >, std::integer_sequence< int, parameter_indices... > >::qdata_type = std::shared_ptr<QuadratureData<T> > |
a container holding quadrature point data of the specified type
T | the type of data to store at each quadrature point |
Definition at line 114 of file solid_mechanics.hpp.
|
protected |
The compile-time finite element trial space for shape displacement (H1 of order 1, nodal displacements) The choice of polynomial order for the shape sensitivity is determined in the StateManager
Definition at line 1475 of file solid_mechanics.hpp.
|
inline |
Construct a new SolidMechanics object.
nonlinear_opts | The nonlinear solver options for solving the nonlinear residual equations |
lin_opts | The linear solver options for solving the linearized Jacobian equations |
timestepping_opts | The timestepping options for the solid mechanics time evolution operator |
geom_nonlin | Flag to include geometric nonlinearities |
physics_name | A name for the physics module instance |
mesh_tag | The tag for the mesh in the StateManager to construct the physics module on |
parameter_names | A vector of the names of the requested parameter fields |
cycle | The simulation cycle (i.e. timestep iteration) to intialize the physics module to |
time | The simulation time to initialize the physics module to |
checkpoint_to_disk | A flag to save the transient states on disk instead of memory for the transient adjoint solves |
Definition at line 134 of file solid_mechanics.hpp.
|
inline |
Construct a new SolidMechanics object.
solver | The nonlinear equation solver for the implicit solid mechanics equations |
timestepping_opts | The timestepping options for the solid mechanics time evolution operator |
geom_nonlin | Flag to include geometric nonlinearities |
physics_name | A name for the physics module instance |
mesh_tag | The tag for the mesh in the StateManager to construct the physics module on |
parameter_names | A vector of the names of the requested parameter fields |
cycle | The simulation cycle (i.e. timestep iteration) to intialize the physics module to |
time | The simulation time to initialize the physics module to |
checkpoint_to_disk | A flag to save the transient states on disk instead of memory for the transient adjoint solves |
Definition at line 161 of file solid_mechanics.hpp.
|
inline |
Construct a new Nonlinear SolidMechanics Solver object.
[in] | input_options | The solver information parsed from the input file |
[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 271 of file solid_mechanics.hpp.
|
inline |
Get the acceleration state.
Definition at line 1461 of file solid_mechanics.hpp.
|
inline |
Set the body forcefunction.
BodyForceType | The type of the body force load |
body_force | A function describing the body force applied |
optional_domain | The domain over which the body force is applied. If nothing is supplied the entire domain is used. |
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 915 of file solid_mechanics.hpp.
|
inline |
register a custom boundary integral calculation as part of the residual
active_parameters | a list of indices, describing which parameters to pass to the q-function |
qfunction | a callable that returns the traction on a boundary surface |
optional_domain | The domain over which the boundary integral is evaluated. If nothing is supplied the entire boundary is used. solid_mechanics.addCustomBoundaryIntegral(DependsOn<>{}, [](double t, auto position, auto displacement, auto
auto [u, du_dxi] = displacement;
auto f = u * 3.0 (X[0] < 0.01);
return f; // define a displacement-proportional traction at a given support
});
const serac::FiniteElementState & displacement() const Get the displacement state. Definition: solid_mechanics.hpp:1447 const serac::FiniteElementState & acceleration() const Get the acceleration state. Definition: solid_mechanics.hpp:1461 |
Definition at line 734 of file solid_mechanics.hpp.
|
inline |
register a custom domain integral calculation as part of the residual
active_parameters | a list of indices, describing which parameters to pass to the q-function |
StateType | the type that contains the internal variables (if any) for q-function |
qfunction | a callable that returns a tuple of body-force and stress |
qdata | the buffer of material internal variables at each quadrature point |
Definition at line 797 of file solid_mechanics.hpp.
|
inlineoverridevirtual |
Accessor for getting named finite element state adjoint solution from the physics modules.
state_name | The name of the Finite Element State adjoint solution to retrieve |
Implements serac::BasePhysics.
Definition at line 749 of file solid_mechanics.hpp.
|
inlineoverridevirtual |
Get a vector of the finite element state solution variable names.
Reimplemented from serac::BasePhysics.
Definition at line 765 of file solid_mechanics.hpp.
|
inlineoverridevirtual |
Advance the solid mechanics physics module in time.
Advance the underlying ODE with the requested time integration scheme using the previously set timestep.
dt | The increment of simulation time to advance the underlying solid mechanics problem |
Implements serac::BasePhysics.
Definition at line 1194 of file solid_mechanics.hpp.
|
inlineprotected |
Calculate a list of constrained dofs in the true displacement vector from a function that returns true if a physical coordinate is in the constrained set.
is_node_constrained | A function that takes a point in physical space and returns true if the contained degrees of freedom should be constrained |
component | which component is constrained (uninitialized implies all components are constrained) |
Definition at line 1581 of file solid_mechanics.hpp.
|
inlineoverridevirtual |
Complete the initialization and allocation of the data structures.
Implements serac::BasePhysics.
Reimplemented in serac::SolidMechanicsContact< order, dim, Parameters< parameter_space... >, std::integer_sequence< int, parameter_indices... > >.
Definition at line 1099 of file solid_mechanics.hpp.
|
inlineoverridevirtual |
Compute the implicit sensitivity of the quantity of interest with respect to the initial temperature.
reverseAdjointTimestep
must be called as many times as the forward solver was advanced before this is called Reimplemented from serac::BasePhysics.
Definition at line 1436 of file solid_mechanics.hpp.
|
inlineoverridevirtual |
Compute the implicit sensitivity of the quantity of interest used in defining the load for the adjoint problem with respect to the parameter field.
parameter_field | The index of the parameter to take a derivative with respect to |
reverseAdjointTimestep
with an appropriate adjoint load must be called prior to this method. Reimplemented from serac::BasePhysics.
Definition at line 1393 of file solid_mechanics.hpp.
|
inlineoverridevirtual |
Compute the implicit sensitivity of the quantity of interest used in defining the load for the adjoint problem with respect to the shape displacement field.
reverseAdjointTimestep
with an appropriate adjoint load must be called prior to this method. Reimplemented from serac::BasePhysics.
Definition at line 1416 of file solid_mechanics.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 414 of file solid_mechanics.hpp.
|
inline |
Get the displacement state.
Definition at line 1447 of file solid_mechanics.hpp.
|
inlineoverridevirtual |
Accessor for getting named finite element state primal solution from the physics modules at a given checkpointed cycle index.
cycle_to_load | The previous timestep where the state solution is requested |
Reimplemented from serac::BasePhysics.
Definition at line 1361 of file solid_mechanics.hpp.
|
inline |
Non virtual method to reset thermal 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 |
Definition at line 360 of file solid_mechanics.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 serac::BasePhysics.
Definition at line 400 of file solid_mechanics.hpp.
|
inlineoverridevirtual |
Solve the adjoint problem.
Reimplemented from serac::BasePhysics.
Definition at line 1288 of file solid_mechanics.hpp.
|
inlineoverridevirtual |
Set the loads for the adjoint reverse timestep solve.
loads | The loads (e.g. right hand sides) for the adjoint problem |
These loads are typically defined as derivatives of a downstream quantity of intrest with respect to a primal solution field (in this case, displacement). For this physics module, the unordered map is expected to have one entry with the keys "displacement".
Reimplemented from serac::BasePhysics.
Definition at line 1254 of file solid_mechanics.hpp.
|
inline |
Set the underlying finite element state to a prescribed displacement.
disp | The function describing the displacement field |
Definition at line 870 of file solid_mechanics.hpp.
|
inline |
Set the displacement essential boundary conditions on a single component.
[in] | disp_bdr | The set of boundary attributes to set the displacement on |
[in] | disp | The vector function containing the set displacement values |
[in] | component | The component to set the displacment on |
For the displacement function, the argument is the input position and the output is the value of the component of the displacement.
Definition at line 486 of file solid_mechanics.hpp.
|
inline |
Set essential displacement boundary conditions (strongly enforced)
[in] | disp_bdr | The boundary attributes from the mesh on which to enforce a displacement |
[in] | disp | The prescribed boundary displacement function |
For the displacement function, the first argument is the input position, the second argument is the time, and the third argument is the output prescribed displacement.
Definition at line 465 of file solid_mechanics.hpp.
|
inline |
Set essential displacement boundary conditions (strongly enforced)
[in] | disp_bdr | The boundary attributes from the mesh on which to enforce a displacement |
[in] | disp | The prescribed boundary displacement function |
For the displacement function, the first argument is the input position and the second argument is the output prescribed displacement.
Definition at line 446 of file solid_mechanics.hpp.
|
inline |
Set the displacement boundary conditions on a set of nodes within a spatially-defined area for a single displacement vector component.
is_node_constrained | A callback function that returns true if displacement nodes at a certain position should be constrained by this boundary condition |
disp | The scalar function containing the prescribed component displacement values |
component | The component of the displacement vector that should be set by this boundary condition. The other components of displacement are unconstrained. |
The displacement function takes a spatial position as the first argument and current time as the second argument. It computes the desired displacement scalar for the given component and returns that value.
Definition at line 604 of file solid_mechanics.hpp.
|
inline |
Set the displacement boundary conditions on a set of nodes within a spatially-defined area.
is_node_constrained | A callback function that returns true if displacement nodes at a certain position should be constrained by this boundary condition |
disp | The vector function containing the prescribed displacement values |
The displacement function takes a spatial position as the first argument and time as the second argument. It computes the desired displacement and fills the third argument with these displacement values.
Definition at line 557 of file solid_mechanics.hpp.
|
inline |
Set the displacement boundary conditions on a set of nodes within a spatially-defined area.
is_node_constrained | A callback function that returns true if displacement nodes at a certain position should be constrained by this boundary condition |
disp | The vector function containing the prescribed displacement values |
The displacement function takes a spatial position as the first argument. It computes the desired displacement and fills the second argument with these displacement values.
Definition at line 579 of file solid_mechanics.hpp.
|
inline |
Set the displacement boundary conditions on a set of nodes within a spatially-defined area for a single displacement vector component.
is_node_constrained | A callback function that returns true if displacement nodes at a certain position should be constrained by this boundary condition |
disp | The scalar function containing the prescribed component displacement values |
component | The component of the displacement vector that should be set by this boundary condition. The other components of displacement are unconstrained. |
The displacement function takes a spatial position as an argument. It computes the desired displacement scalar for the given component and returns that value.
Definition at line 634 of file solid_mechanics.hpp.
|
inline |
Set the displacement essential boundary conditions on a set of true degrees of freedom.
true_dofs | A set of true degrees of freedom to set the displacement on |
disp | The vector function containing the prescribed displacement values |
The true_dofs list can be determined using functions from the mfem::ParFiniteElementSpace related to the displacement serac::FiniteElementState .
For the displacement function, the first argument is the input position, the second argument is time, and the third argument is the prescribed output displacement vector.
Definition at line 513 of file solid_mechanics.hpp.
|
inline |
Set the displacement essential boundary conditions on a set of true degrees of freedom.
true_dofs | A set of true degrees of freedom to set the displacement on |
disp | The vector function containing the prescribed displacement values |
The true_dofs list can be determined using functions from the mfem::ParFiniteElementSpace class.
Definition at line 535 of file solid_mechanics.hpp.
|
inline |
Set the material stress response and mass properties for the physics module.
MaterialType | The solid material type |
StateType | the type that contains the internal variables for MaterialType |
material | A material that provides a function to evaluate stress |
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 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>
)qdata | the buffer of material internal variables at each quadrature point |
density
Definition at line 829 of file solid_mechanics.hpp.
|
inline |
Set the pressure boundary condition.
PressureType | The type of the pressure load |
pressure_function | A function describing the pressure applied to a boundary |
optional_domain | The domain over which the pressure is applied. If nothing is supplied the entire boundary is used. |
tensor<T,dim> x
the reference configuration 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 1004 of file solid_mechanics.hpp.
|
inlineoverridevirtual |
Set the primal solution field (displacement, velocity) for the underlying solid mechanics 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 serac::BasePhysics.
Definition at line 677 of file solid_mechanics.hpp.
|
inline |
Set the traction boundary condition.
TractionType | The type of the traction load |
traction_function | A function describing the traction applied to a boundary |
optional_domain | The domain over which the traction is applied. If nothing is supplied the entire boundary is used. |
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)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 959 of file solid_mechanics.hpp.
|
inline |
Set the underlying finite element state to a prescribed velocity.
vel | The function describing the velocity field |
Definition at line 885 of file solid_mechanics.hpp.
|
inlineoverridevirtual |
Accessor for getting named finite element state fields from the physics modules.
state_name | The name of the Finite Element State to retrieve |
Implements serac::BasePhysics.
Definition at line 653 of file solid_mechanics.hpp.
|
inlineoverridevirtual |
Get a vector of the finite element state solution variable names.
Implements serac::BasePhysics.
Definition at line 703 of file solid_mechanics.hpp.
|
inline |
Return the assembled stiffness matrix.
This method returns a pair {K, K_e} representing the last computed linearized stiffness matrix. The K matrix has the essential degree of freedom rows and columns zeroed with a 1 on the diagonal and K_e contains the zeroed rows and columns, e.g. K_total = K + K_e.
Definition at line 1087 of file solid_mechanics.hpp.
|
inline |
Get the velocity state.
Definition at line 1454 of file solid_mechanics.hpp.
|
protected |
Array functions computing the derivative of the residual with respect to each given parameter.
Definition at line 1567 of file solid_mechanics.hpp.
|
protected |
rows and columns of J_ that have been separated out because are associated with essential boundary conditions
Definition at line 1529 of file solid_mechanics.hpp.