forked from rclam/DES_singleEMT_inProgress
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathparameters.hpp
293 lines (240 loc) · 6.46 KB
/
parameters.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
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
#ifndef DYNEARTHSOL3D_PARAMETERS_HPP
#define DYNEARTHSOL3D_PARAMETERS_HPP
#include <map>
#include <string>
#include <utility>
#include <vector>
#include "constants.hpp"
#include "array2d.hpp"
typedef std::pair<double,double> double_pair;
typedef std::vector<double> double_vec;
typedef std::vector<int> int_vec;
typedef std::vector<int_vec> int_vec2D;
typedef std::vector<uint> uint_vec;
typedef Array2D<double,NDIMS> array_t;
typedef Array2D<double,NSTR> tensor_t;
typedef Array2D<double,NODES_PER_ELEM> shapefn;
typedef Array2D<double,1> regattr_t;
typedef Array2D<double,NODES_PER_ELEM*3> elem_cache;
typedef Array2D<int,NODES_PER_ELEM> conn_t;
typedef Array2D<int,NDIMS> segment_t;
typedef Array2D<int,1> segflag_t;
// forward declaration
class PhaseChange;
//
// Structures for input parameters
//
struct Sim {
double max_time_in_yr;
double output_time_interval_in_yr;
int max_steps;
int output_step_interval;
int checkpoint_frame_interval;
int restarting_from_frame;
bool is_outputting_averaged_fields;
bool is_restarting;
bool has_initial_checkpoint;
bool has_output_during_remeshing;
bool has_marker_output;
std::string modelname;
std::string restarting_from_modelname;
};
struct Mesh {
int meshing_option;
int meshing_verbosity;
int tetgen_optlevel;
int quality_check_step_interval;
double xlength, ylength, zlength;
double resolution;
double smallest_size;
double largest_size;
double min_angle; // for 2D only
double min_tet_angle, max_ratio; // for 3D only
double min_quality;
double max_boundary_distortion;
double_pair refined_zonex, refined_zoney, refined_zonez;
std::string poly_filename;
std::string exo_filename;
bool is_discarding_internal_segments;
int remeshing_option;
// Parameters for mesh optimizer MMG
int mmg_debug;
int mmg_verbose;
double mmg_hmax_factor;
double mmg_hmin_factor;
double mmg_hausd_factor;
};
struct Control {
double gravity;
double characteristic_speed;
double inertial_scaling;
double dt_fraction;
double fixed_dt;
double damping_factor;
int damping_option;
int ref_pressure_option;
int surface_process_option;
double surface_diffusivity;
bool is_quasi_static;
bool has_thermal_diffusion;
bool has_hydration_processes;
double hydration_migration_speed;
};
struct BC {
double surface_temperature;
double mantle_temperature;
double winkler_delta_rho;
bool has_winkler_foundation;
double elastic_foundation_constant;
bool has_elastic_foundation;
bool has_water_loading;
int vbc_x0;
int vbc_x1;
int vbc_y0;
int vbc_y1;
int vbc_z0;
int vbc_z1;
int vbc_n0;
int vbc_n1;
int vbc_n2;
int vbc_n3;
double vbc_val_x0;
double vbc_val_x1;
double vbc_val_y0;
double vbc_val_y1;
double vbc_val_z0;
double vbc_val_z1;
double vbc_val_n0;
double vbc_val_n1;
double vbc_val_n2;
double vbc_val_n3;
};
struct IC {
int mattype_option;
int num_mattype_layers;
int_vec layer_mattypes;
double_vec mattype_layer_depths;
int weakzone_option;
double weakzone_plstrain;
double weakzone_azimuth;
double weakzone_inclination;
double weakzone_halfwidth;
double weakzone_y_min;
double weakzone_y_max;
double weakzone_depth_min;
double weakzone_depth_max;
double weakzone_xcenter;
double weakzone_ycenter;
double weakzone_zcenter;
double weakzone_xsemi_axis;
double weakzone_ysemi_axis;
double weakzone_zsemi_axis;
int temperature_option;
std::string Temp_filename;
std::string Nodes_filename;
std::string Connectivity_filename;
double oceanic_plate_age_in_yr;
double isostasy_adjustment_time_in_yr;
};
struct Mat {
int rheol_type;
int phase_change_option;
int nmat;
bool is_plane_strain;
double visc_min;
double visc_max;
double tension_max;
double therm_diff_max;
double_vec rho0;
double_vec alpha;
double_vec bulk_modulus;
double_vec shear_modulus;
// emt (anisotropy-related)
double_vec initial_crack_normal; //angle of vector normal to crack (meas. from horiz. ax. CCW)
double_vec emt_crack_density; // for rh_emt
double_vec emt_pf; // for rh_emt
double_vec visc_exponent;
double_vec visc_coefficient;
double_vec visc_activation_energy;
double_vec heat_capacity;
double_vec therm_cond;
// plastic parameters
double_vec pls0, pls1;
double_vec cohesion0, cohesion1;
double_vec friction_angle0, friction_angle1;
double_vec dilation_angle0, dilation_angle1;
};
struct Time {
int64_t remesh_time;
int64_t output_time;
int64_t start_time;
};
struct Markers {
int init_marker_option;
int markers_per_element;
int min_num_markers_in_element;
int replenishment_option;
uint random_seed;
double init_marker_spacing;
};
struct Debug {
bool dt;
};
struct Param {
Sim sim;
Mesh mesh;
Control control;
BC bc;
IC ic;
Mat mat;
Markers markers;
Debug debug;
};
//
// Structures for model variables
//
class MatProps;
class MarkerSet;
struct Variables {
double time;
double dt;
int steps;
Time func_time;
int nnode;
int nelem;
int nseg;
double max_vbc_val;
double compensation_pressure;
// These 5 arrays are allocated by external library
array_t *coord;
conn_t *connectivity;
segment_t *segment;
segflag_t *segflag;
regattr_t *regattr;
uint_vec *bcflag;
int_vec bnodes[nbdrytypes];
std::vector< std::pair<int,int> > bfacets[nbdrytypes];
double bnormals[nbdrytypes][NDIMS];
int vbc_types[nbdrytypes];
double vbc_values[nbdrytypes];
std::map<std::pair<int,int>, double*> edge_vectors;
int_vec2D *support;
double_vec *volume, *volume_old, *volume_n;
double_vec *mass, *tmass;
double_vec *edvoldt;
double_vec *temperature, *plstrain, *delta_plstrain;
double_vec *stressyy, *dpressure;
double_vec *ntmp;
array_t *vel, *force, *coord0;
tensor_t *strain_rate, *strain, *stress;
shapefn *shpdx, *shpdy, *shpdz;
elem_cache *tmp_result;
double_vec *tmp_result_sg;
MatProps *mat;
std::vector<MarkerSet*> markersets;
int hydrous_marker_index;
int_vec2D *elemmarkers; // for marksersets[0] (mattype markers)
Array2D<int,1> *hydrous_elemmarkers; // for markersets[hydrous_marker_index] (hydrous markers)
PhaseChange *phch;
};
#endif