Smith  0.1
Smith is an implicit thermal structural mechanics simulation code.
common.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 
12 #pragma once
13 #include <utility>
14 
15 namespace smith {
16 
18 struct TimeInfo {
20  TimeInfo(double t, double t_step, size_t c = 0)
21  : time_(std::make_pair(t, 0.0)), dt_(std::make_pair(t_step, 0.0)), cycle_(c)
22  {
23  }
24 
26  double time() const { return time_.first + dt_.first; }
27 
29  double dt() const { return dt_.first; }
30 
32  size_t cycle() const { return cycle_; }
33 
34  private:
35  std::pair<double, double> time_;
36  std::pair<double, double> dt_;
37  size_t cycle_;
38 };
39 
44 template <typename... T>
45 struct Parameters {
46  static constexpr int n = sizeof...(T);
47 };
48 
49 } // namespace smith
Accelerator functionality.
Definition: smith.cpp:36
a struct that is used in the physics modules to clarify which template arguments are user-controlled ...
Definition: common.hpp:45
static constexpr int n
how many parameters were specified
Definition: common.hpp:46
struct storing time and timestep information
Definition: common.hpp:18
double dt() const
accessor for dt
Definition: common.hpp:29
size_t cycle() const
accessor for cycle
Definition: common.hpp:32
double time() const
accessor for the current time
Definition: common.hpp:26
TimeInfo(double t, double t_step, size_t c=0)
constructor
Definition: common.hpp:20