-
Notifications
You must be signed in to change notification settings - Fork 13
/
lgr_input.hpp
203 lines (189 loc) · 9.45 KB
/
lgr_input.hpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
#pragma once
#include <functional>
#include <hpc_dimensional.hpp>
#include <hpc_range_sum.hpp>
#include <hpc_vector.hpp>
#include <hpc_vector3.hpp>
#include <lgr_domain.hpp>
#include <map>
#include <string>
namespace lgr {
enum element_kind
{
BAR,
TRIANGLE,
TETRAHEDRON,
COMPOSITE_TETRAHEDRON,
};
enum time_integrator_kind
{
MIDPOINT_PREDICTOR_CORRECTOR,
VELOCITY_VERLET,
};
enum h_min_kind
{
MINIMUM_HEIGHT,
INBALL_DIAMETER,
};
class zero_boundary_condition
{
public:
material_index boundary;
hpc::vector3<double> axis;
};
class prescribed_boundary_condition
{
public:
material_index boundary;
hpc::vector3<double> axis;
double value;
};
class input
{
public:
std::string name;
element_kind element{TETRAHEDRON};
time_integrator_kind time_integrator = MIDPOINT_PREDICTOR_CORRECTOR;
h_min_kind h_min = INBALL_DIAMETER;
hpc::counting_range<material_index> materials;
hpc::counting_range<material_index> boundaries;
hpc::time<double> end_time{0.0};
double CFL{0.9};
bool use_constant_dt{false};
bool use_displacement_contact{false};
bool use_penalty_contact{false};
hpc::strain_rate_rate<double> contact_penalty_coeff{1.0e14};
int minimum_support_size{4};
hpc::time<double> constant_dt{0.0};
int num_file_output_periods{0};
int elements_along_x{0};
hpc::length<double> x_domain_size{1.0};
int elements_along_y{0};
hpc::length<double> y_domain_size{1.0};
int elements_along_z{0};
hpc::length<double> z_domain_size{1.0};
int otm_material_points_to_add_per_element{1};
bool do_output{true};
bool output_to_command_line{true};
bool debug_output{false};
hpc::host_vector<hpc::density<double>, material_index> rho0;
hpc::host_vector<hpc::specific_energy<double>, material_index> e0;
hpc::host_vector<bool, material_index> enable_neo_Hookean;
hpc::host_vector<bool, material_index> enable_variational_J2;
hpc::host_vector<bool, material_index> enable_Mie_Gruneisen_eos;
hpc::host_vector<hpc::pressure<double>, material_index> K0;
hpc::host_vector<hpc::pressure<double>, material_index> G0;
hpc::host_vector<bool, material_index> enable_ideal_gas;
hpc::host_vector<hpc::adimensional<double>, material_index> gamma;
hpc::host_vector<hpc::adimensional<double>, material_index> s;
hpc::host_vector<bool, material_index> enable_nodal_pressure;
hpc::host_vector<bool, material_index> enable_nodal_energy;
hpc::host_vector<bool, material_index> enable_p_prime;
hpc::host_vector<double, material_index> c_tau;
hpc::host_vector<double, material_index> c_v;
hpc::host_vector<double, material_index> c_p;
hpc::host_vector<bool, material_index> use_global_tau;
// OTM interpolation shape function locality parameter
hpc::adimensional<double> otm_gamma{1.0};
// Elasticity
hpc::host_vector<hpc::pressure<double>, material_index> E; // Young's modulus
hpc::host_vector<double, material_index> nu; // Poisson's ratio
// Variational J2
hpc::host_vector<hpc::pressure<double>, material_index> Y0;
hpc::host_vector<hpc::adimensional<double>, material_index> n;
hpc::host_vector<hpc::strain<double>, material_index> eps0;
hpc::host_vector<hpc::pressure<double>, material_index> Svis0;
hpc::host_vector<hpc::adimensional<double>, material_index> m;
hpc::host_vector<hpc::strain_rate<double>, material_index> eps_dot0;
// Damage
hpc::host_vector<bool, material_index> allow_no_tension;
hpc::host_vector<bool, material_index> allow_no_shear;
hpc::host_vector<bool, material_index> set_stress_to_zero;
hpc::host_vector<double, material_index> D1;
hpc::host_vector<double, material_index> D2;
hpc::host_vector<double, material_index> D3;
hpc::host_vector<double, material_index> D4;
hpc::host_vector<double, material_index> D5;
hpc::host_vector<double, material_index> D6;
hpc::host_vector<double, material_index> D7;
hpc::host_vector<double, material_index> D8;
hpc::host_vector<double, material_index> DC;
hpc::host_vector<double, material_index> eps_f_min;
bool enable_viscosity = false;
double linear_artificial_viscosity = 0.0;
double quadratic_artificial_viscosity = 0.0;
bool enable_J_averaging = false;
bool enable_rho_averaging = false;
bool enable_e_averaging = false;
bool enable_p_averaging = false;
bool enable_adapt = false;
bool enable_comptet_stabilization = false;
hpc::length<double> max_node_neighbor_distance{1.0};
hpc::length<double> max_point_neighbor_distance{1.0};
std::function<void(
hpc::counting_range<node_index> const,
hpc::device_array_vector<hpc::position<double>, node_index> const&,
hpc::device_array_vector<hpc::velocity<double>, node_index>*)>
initial_v;
std::vector<zero_boundary_condition> zero_displacement_conditions;
std::vector<zero_boundary_condition> zero_velocity_conditions;
std::vector<zero_boundary_condition> zero_acceleration_conditions;
std::vector<prescribed_boundary_condition> prescribed_displacement_conditions;
std::vector<prescribed_boundary_condition> prescribed_velocity_conditions;
std::vector<prescribed_boundary_condition> prescribed_acceleration_conditions;
std::function<void(hpc::device_array_vector<hpc::position<double>, node_index>*)> x_transform;
std::function<void(
hpc::counting_range<point_index> const,
hpc::device_range_sum<point_node_index, point_index> const&,
hpc::device_vector<node_index, point_node_index> const&,
hpc::device_array_vector<hpc::position<double>, node_index> const&,
hpc::device_array_vector<hpc::position<double>, point_index>&)>
xp_transform;
hpc::host_vector<std::unique_ptr<domain>, material_index> domains;
input() = delete;
input(material_index const material_count_in, material_index const boundary_count_in)
: materials(material_count_in),
boundaries(material_count_in, material_count_in + boundary_count_in),
rho0(material_count_in),
e0(material_count_in, double(0.0)),
enable_neo_Hookean(material_count_in, false),
enable_variational_J2(material_count_in, false),
enable_Mie_Gruneisen_eos(material_count_in, false),
K0(material_count_in),
G0(material_count_in, double(0.0)),
enable_ideal_gas(material_count_in, false),
gamma(material_count_in),
s(material_count_in),
enable_nodal_pressure(material_count_in, false),
enable_nodal_energy(material_count_in, false),
enable_p_prime(material_count_in, false),
c_tau(material_count_in, 0.5),
c_v(material_count_in, 1.0),
c_p(material_count_in, 1.0),
use_global_tau(material_count_in, true),
E(material_count_in),
nu(material_count_in),
Y0(material_count_in),
n(material_count_in),
eps0(material_count_in),
Svis0(material_count_in),
m(material_count_in),
eps_dot0(material_count_in),
allow_no_tension(material_count_in, true),
allow_no_shear(material_count_in, false),
set_stress_to_zero(material_count_in, false),
D1(material_count_in),
D2(material_count_in),
D3(material_count_in),
D4(material_count_in),
D5(material_count_in),
D6(material_count_in),
D7(material_count_in),
D8(material_count_in),
DC(material_count_in),
eps_f_min(material_count_in),
domains(material_count_in + boundary_count_in)
{
}
};
} // namespace lgr