adamantine
types.hh
Go to the documentation of this file.
1 /* SPDX-FileCopyrightText: Copyright (c) 2016 - 2025, the adamantine authors.
2  * SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
3  */
4 
5 #ifndef TYPES_HH
6 #define TYPES_HH
7 
8 #include <Kokkos_NumericTraits.hpp>
9 
10 #include <array>
11 #include <string>
12 #include <unordered_map>
13 
14 namespace dealii
15 {
16 namespace LinearAlgebra
17 {
18 }
19 
23 namespace LA = LinearAlgebra;
24 } // namespace dealii
25 
26 namespace adamantine
27 {
28 
29 static std::unordered_map<std::string, double> g_unit_scaling_factor{
30  {"millimeter", 1e-3}, {"centimeter", 1e-2},
31  {"inch", 2.54e-2}, {"meter", 1.},
32  {"milliwatt", 1e-3}, {"watt", 1.},
33  {"millimeter/second", 1e-3}, {"centimer/second", 1e-2},
34  {"meter/second", 1.}};
35 
40 enum class StateProperty
41 {
42  density,
47  emissivity,
50  // Mechanical properties only make sense for the solid state. They do not make
51  // sense for the powder and the liquid state
55  // Density is used both by the thermal and the mechanical simulation. We need
56  // to duplicate the property because the mechanical code cannot run on the
57  // GPU.
58  density_s,
62  SIZE,
63  SIZE_MECHANICAL = 7
64 };
65 
69 static unsigned int constexpr g_n_state_properties =
70  static_cast<unsigned int>(StateProperty::SIZE);
71 
75 static unsigned int constexpr g_n_mechanical_state_properties =
76  static_cast<unsigned int>(StateProperty::SIZE_MECHANICAL);
77 
81 static unsigned int constexpr g_n_thermal_state_properties =
83 
88 enum class Property
89 {
90  liquidus,
91  solidus,
95  SIZE
96 };
97 
101 static unsigned int constexpr g_n_properties =
102  static_cast<unsigned int>(Property::SIZE);
103 
107 static std::array<std::string, 3> const material_state_names = {
108  {"solid", "liquid", "powder"}};
109 
114 static std::array<std::string, 5> const property_names = {
115  {"liquidus", "solidus", "latent_heat", "radiation_temperature_infty",
116  "convection_temperature_infty"}};
117 
122 static std::array<std::string, 15> const state_property_names = {
123  {"density", "specific_heat", "thermal_conductivity_x",
124  "thermal_conductivity_y", "thermal_conductivity_z", "emissivity",
125  "radiation_heat_transfer_coef", "convection_heat_transfer_coef",
126  "lame_first_parameter", "lame_second_parameter", "thermal_expansion_coef",
127  "density", "plastic_modulus", "isotropic_hardening", "elastic_limit"}};
128 
132 enum Timing
133 {
147  n_timers
148 };
149 
153 struct Constant
154 {
158  static double constexpr stefan_boltzmann = 5.670374419e-8;
159 };
160 
166 template <int dim>
167 struct axis;
168 
169 // dim == 2 specialization
170 template <>
171 struct axis<2>
172 {
173  static unsigned int constexpr x = 0;
174  static unsigned int constexpr y =
175  Kokkos::Experimental::finite_max_v<unsigned int>;
176  static unsigned int constexpr z = 1;
177 };
178 
179 // dim == 3 specialization
180 template <>
181 struct axis<3>
182 {
183  static unsigned int constexpr x = 0;
184  static unsigned int constexpr y = 1;
185  static unsigned int constexpr z = 2;
186 };
187 
188 } // namespace adamantine
189 
190 #endif
static unsigned constexpr int g_n_mechanical_state_properties
Definition: types.hh:75
static std::array< std::string, 3 > const material_state_names
Definition: types.hh:107
static std::unordered_map< std::string, double > g_unit_scaling_factor
Definition: types.hh:29
@ output
Definition: types.hh:146
@ evol_time_update_bound_mat_prop
Definition: types.hh:145
@ evol_time
Definition: types.hh:143
@ da_obs_covariance
Definition: types.hh:141
@ da_experimental_data
Definition: types.hh:138
@ da_dof_mapping
Definition: types.hh:139
@ add_material_search
Definition: types.hh:136
@ da_covariance_sparsity
Definition: types.hh:140
@ da_update_ensemble
Definition: types.hh:142
@ n_timers
Definition: types.hh:147
@ evol_time_eval_th_ph
Definition: types.hh:144
@ refine
Definition: types.hh:135
@ add_material_activate
Definition: types.hh:137
static std::array< std::string, 5 > const property_names
Definition: types.hh:114
static unsigned constexpr int g_n_properties
Definition: types.hh:101
StateProperty
Definition: types.hh:41
static std::array< std::string, 15 > const state_property_names
Definition: types.hh:122
static unsigned constexpr int g_n_state_properties
Definition: types.hh:69
static unsigned constexpr int g_n_thermal_state_properties
Definition: types.hh:81
Definition: types.hh:15
static constexpr double stefan_boltzmann
Definition: types.hh:158