Smith  0.1
Smith is an implicit thermal structural mechanics simulation code.
state_advancer.hpp
Go to the documentation of this file.
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 
13 #pragma once
14 
15 #include <vector>
16 #include "gretl/double_state.hpp"
18 #include "smith/physics/common.hpp"
19 
20 namespace smith {
21 
24  public:
26  virtual ~StateAdvancer() {}
27 
31  virtual std::vector<FieldState> advanceState(const TimeInfo& time_info, const FieldState& shape_disp,
32  const std::vector<FieldState>& states,
33  const std::vector<FieldState>& params) const = 0;
34 
37  virtual std::vector<ReactionState> computeReactions(const TimeInfo& /*time_info*/, const FieldState& /*shape_disp*/,
38  const std::vector<FieldState>& /*states*/,
39  const std::vector<FieldState>& /*params*/) const
40  {
41  return std::vector<ReactionState>{};
42  }
43 };
44 
50 inline TimeInfo create_time_info(DoubleState t, DoubleState dt, size_t cycle)
51 {
52  return TimeInfo(t.get(), dt.get(), cycle);
53 }
54 
55 } // namespace smith
Base state advancer class, allows specification for quasi-static solve strategies,...
virtual std::vector< ReactionState > computeReactions(const TimeInfo &, const FieldState &, const std::vector< FieldState > &, const std::vector< FieldState > &) const
interface method to compute reactions given previous, current states and parameters.
virtual ~StateAdvancer()
destructor
virtual std::vector< FieldState > advanceState(const TimeInfo &time_info, const FieldState &shape_disp, const std::vector< FieldState > &states, const std::vector< FieldState > &params) const =0
interface method to advance the states from a given cycle and time, to the next cycle (cycle+1) and t...
A file defining some enums and structs that are used by the different physics modules.
Accelerator functionality.
Definition: smith.cpp:36
gretl::State< double, double > DoubleState
typedef
Definition: field_state.hpp:25
gretl::State< FEFieldPtr, FEDualPtr > FieldState
typedef
Definition: field_state.hpp:22
TimeInfo create_time_info(DoubleState t, DoubleState dt, size_t cycle)
creates a time info struct from gretl::State<double>
struct storing time and timestep information
Definition: common.hpp:18