18 #include "gretl/strumm_walther_checkpoint_strategy.hpp"
36 template <
int dim,
typename ShapeDispSpace,
typename VectorSpace,
typename... ParamSpaces>
38 std::shared_ptr<DifferentiableSolver> d_solid_nonlinear_solver,
40 std::string physics_name,
const std::vector<std::string>& param_names = {})
43 std::make_shared<gretl::DataStore>(std::make_unique<gretl::StrummWaltherCheckpointStrategy>(num_checkpoints));
44 auto [shape_disp, states, params, time, solid_mechanics_weak_form] =
46 mesh, graph, time_rule, physics_name, param_names);
48 auto vector_bcs = std::make_shared<DirichletBoundaryConditions>(
49 mesh->mfemParMesh(),
space(states[SolidMechanicsStateAdvancer::DISPLACEMENT]));
51 auto state_advancer = std::make_shared<SolidMechanicsStateAdvancer>(d_solid_nonlinear_solver, vector_bcs,
52 solid_mechanics_weak_form, time_rule);
54 auto physics = std::make_shared<DifferentiablePhysics>(mesh, graph, shape_disp, states, params, state_advancer,
55 physics_name, std::vector<std::string>{
"reactions"});
static auto buildWeakFormAndStates(const std::shared_ptr< Mesh > &mesh, const std::shared_ptr< gretl::DataStore > &graph, ImplicitNewmarkSecondOrderTimeIntegrationRule time_rule, std::string physics_name, const std::vector< std::string > ¶m_names, double initial_time=0.0)
Utility function to consistently construct all the weak forms and FieldStates for a solid mechanics a...
Implementation of BasePhysics which uses FieldStates and gretl to track the computational graph,...
Accelerator functionality.
auto buildSolidMechanics(std::shared_ptr< smith::Mesh > mesh, std::shared_ptr< DifferentiableSolver > d_solid_nonlinear_solver, smith::ImplicitNewmarkSecondOrderTimeIntegrationRule time_rule, size_t num_checkpoints, std::string physics_name, const std::vector< std::string > ¶m_names={})
Helper function to generate the base-physics for solid mechanics.
SMITH_HOST_DEVICE tuple< T... > make_tuple(const T &... args)
helper function for combining a list of values into a tuple
mfem::ParFiniteElementSpace & space(FieldState field)
Get the space from the primal field of a field states.
Specifies parameterized residuals and various linearized evaluations for arbitrary nonlinear systems ...
encodes rules for time discretizing second order odes (involving first and second time derivatives)....