17 std::shared_ptr<smith::DifferentiableSolver> solver, std::shared_ptr<smith::DirichletBoundaryConditions> vector_bcs,
18 std::shared_ptr<SecondOrderTimeDiscretizedWeakForms> solid_dynamic_weak_forms,
21 vector_bcs_(vector_bcs),
22 solid_dynamic_weak_forms_(solid_dynamic_weak_forms),
29 const std::vector<FieldState>& states_old_,
30 const std::vector<FieldState>& params)
const
32 std::vector<FieldState> states_old = states_old_;
33 if (time_info.
cycle() == 0) {
34 states_old[ACCELERATION] =
solve(*solid_dynamic_weak_forms_->final_reaction_weak_form, shape_disp, states_old_,
35 params, time_info, *solver_, *vector_bcs_, ACCELERATION);
38 std::vector<FieldState> solid_inputs{states_old[DISPLACEMENT], states_old[DISPLACEMENT], states_old[VELOCITY],
39 states_old[ACCELERATION]};
41 auto displacement =
solve(*solid_dynamic_weak_forms_->time_discretized_weak_form, shape_disp, solid_inputs, params,
42 time_info, *solver_, *vector_bcs_);
44 std::vector<FieldState> states = states_old;
46 states[DISPLACEMENT] = displacement;
48 time_rule_.
dot(time_info, displacement, states_old[DISPLACEMENT], states_old[VELOCITY], states_old[ACCELERATION]);
49 states[ACCELERATION] = time_rule_.
ddot(time_info, displacement, states_old[DISPLACEMENT], states_old[VELOCITY],
50 states_old[ACCELERATION]);
57 const std::vector<FieldState>& states,
58 const std::vector<FieldState>& params)
const
60 std::vector<FieldState> solid_inputs{states[DISPLACEMENT], states[VELOCITY], states[ACCELERATION]};
61 solid_inputs.insert(solid_inputs.end(), params.begin(), params.end());
62 return {
evaluateWeakForm(solid_dynamic_weak_forms_->final_reaction_weak_form, time_info, shape_disp, solid_inputs,
63 states[DISPLACEMENT])};
SolidMechanicsStateAdvancer(std::shared_ptr< DifferentiableSolver > solid_solver, std::shared_ptr< DirichletBoundaryConditions > vector_bcs, std::shared_ptr< SecondOrderTimeDiscretizedWeakForms > solid_dynamic_weak_forms, ImplicitNewmarkSecondOrderTimeIntegrationRule time_rule)
Constructor.
std::vector< FieldState > advanceState(const TimeInfo &time_info, const FieldState &shape_disp, const std::vector< FieldState > &states_old, const std::vector< FieldState > ¶ms) const override
This is an overloaded member function, provided for convenience. It differs from the above function o...
std::vector< ReactionState > computeReactions(const TimeInfo &time_info, const FieldState &shape_disp, const std::vector< FieldState > &states, const std::vector< FieldState > ¶ms) const override
This is an overloaded member function, provided for convenience. It differs from the above function o...
This file contains the declaration of the DifferentiableSolver interface.
Contains DirichletBoundaryConditions class for interaction with the differentiable solve interfaces.
Accelerator functionality.
auto evaluateWeakForm(const std::shared_ptr< WeakForm > &weak_form, const TimeInfo &time_info, FieldState shape_disp, const std::vector< FieldState > &field_states, FieldState field_for_residual_space)
gretl-function implementation which evaluates the residual force (which is minus the mechanical force...
gretl::State< FEFieldPtr, FEDualPtr > FieldState
typedef
FieldState solve(const WeakForm &weak_form, const FieldState &shape_disp, const std::vector< FieldState > &states, const std::vector< FieldState > ¶ms, const TimeInfo &time_info, const DifferentiableSolver &solver, const DirichletBoundaryConditions &bcs, size_t unknown_state_index)
Solve a nonlinear system of equations as defined by the weak form, assuming that the field indexed by...
Reaction class which is a names combination of a weak form and a set of dirichlet constrained nodes.
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)....
SMITH_HOST_DEVICE auto dot([[maybe_unused]] const TimeInfo &t, [[maybe_unused]] const T1 &field_new, [[maybe_unused]] const T2 &field_old, [[maybe_unused]] const T3 &velo_old, [[maybe_unused]] const T4 &accel_old) const
evaluate time derivative discretization of the ode state as used by the integration rule
SMITH_HOST_DEVICE auto ddot([[maybe_unused]] const TimeInfo &t, [[maybe_unused]] const T1 &field_new, [[maybe_unused]] const T2 &field_old, [[maybe_unused]] const T3 &velo_old, [[maybe_unused]] const T4 &accel_old) const
evaluate time derivative discretization of the ode state as used by the integration rule
struct storing time and timestep information
size_t cycle() const
accessor for cycle