Smith  0.1
Smith is an implicit thermal structural mechanics simulation code.
multiphysics_time_integrator.hpp
1 // Copyright (c) Lawrence Livermore National Security, LLC and
2 // other Smith Project Developers. See the top-level LICENSE file for
3 // details.
4 //
5 // SPDX-License-Identifier: (BSD-3-Clause)
6 
7 #pragma once
8 
14 #include "smith/physics/mesh.hpp"
15 #include "smith/differentiable_numerics/field_store.hpp"
18 
19 namespace smith {
20 
21 class SystemSolver;
22 class DirichletBoundaryConditions;
23 class BoundaryConditionManager;
24 
29  public:
36  MultiphysicsTimeIntegrator(std::shared_ptr<SystemBase> system,
37  std::vector<std::shared_ptr<SystemBase>> cycle_zero_systems = {},
38  std::vector<std::shared_ptr<SystemBase>> post_solve_systems = {});
39 
41  void addPostSolveSystem(std::shared_ptr<SystemBase> system);
42 
51  std::pair<std::vector<FieldState>, std::vector<ReactionState>> advanceState(
52  const TimeInfo& time_info, const FieldState& shape_disp, const std::vector<FieldState>& states,
53  const std::vector<FieldState>& params) const override;
54 
55  private:
56  std::shared_ptr<SystemBase> system_;
57  std::vector<std::shared_ptr<SystemBase>> cycle_zero_systems_;
58  std::vector<std::shared_ptr<SystemBase>> post_solve_systems_;
59 
60  std::map<std::string, size_t> main_unknown_name_to_local_idx_;
61 };
62 
64 inline std::shared_ptr<MultiphysicsTimeIntegrator> makeAdvancer(std::shared_ptr<SystemBase> system)
65 {
66  auto cycle_zero_systems = system->cycle_zero_systems;
67  auto post_solve_systems = system->post_solve_systems;
68  return std::make_shared<MultiphysicsTimeIntegrator>(std::move(system), std::move(cycle_zero_systems),
69  std::move(post_solve_systems));
70 }
71 
72 } // namespace smith
Time integrator for multiphysics problems, coordinating multiple weak forms.
MultiphysicsTimeIntegrator(std::shared_ptr< SystemBase > system, std::vector< std::shared_ptr< SystemBase >> cycle_zero_systems={}, std::vector< std::shared_ptr< SystemBase >> post_solve_systems={})
Construct a multiphysics advancer around main and auxiliary systems.
std::pair< std::vector< FieldState >, std::vector< ReactionState > > advanceState(const TimeInfo &time_info, const FieldState &shape_disp, const std::vector< FieldState > &states, const std::vector< FieldState > &params) const override
Advance the multiphysics state by one time step.
void addPostSolveSystem(std::shared_ptr< SystemBase > system)
Register a system to be solved after the main solve and reaction computation.
Base state advancer class, allows specification for quasi-static solve strategies,...
CombinedSystem and combineSystems for composing independent physics into a coupled system.
Smith mesh class which assists in constructing the appropriate parallel mfem meshes and registering a...
Accelerator functionality.
Definition: smith.cpp:36
gretl::State< FEFieldPtr, FEDualPtr > FieldState
typedef
Definition: field_state.hpp:22
std::shared_ptr< MultiphysicsTimeIntegrator > makeAdvancer(std::shared_ptr< SystemBase > system)
Build a MultiphysicsTimeIntegrator using the system's own auxiliary systems.
This file contains nonlinear block solver interfaces and helpers.
This file contains enumerations and record types for physics solver configuration.
Interface and implementations for advancing from one step to the next. Typically these are time integ...
struct storing time and timestep information
Definition: common.hpp:18
Defines the SystemBase struct for common system functionality.
Provides templated implementations for discretizing values, velocities and accelerations from current...