milupHPC documentation
  • include
parameter_backup.h
Go to the documentation of this file.
1
19#ifndef MILUPHPC_PARAMETER_H
20#define MILUPHPC_PARAMETER_H
21
22#include <limits>
23#include <iostream>
24
39#ifdef SINGLE_PRECISION
40 typedef float real;
41#else
42 typedef double real;
43#endif
44typedef int integer;
45typedef unsigned long keyType;
46typedef int idInteger;
47
49#define MAX_LEVEL 21
50
52#define UNIT_TESTING 0
53
55#define DEBUGGING 0
56
63#define SAFETY_LEVEL 2
64
66#define DIM 3
68#define power_two(x) (1 << (x))
70#define POW_DIM power_two(DIM)
71
73#define SI_UNITS 1
74
76#define CUBIC_DOMAINS 1
77
79#define GRAVITY_SIM 1
80
82#define SPH_SIM 1
83
85#define INTEGRATE_ENERGY 0
86
88#define INTEGRATE_DENSITY 1
89
91#define INTEGRATE_SML 0
92
94#define DECOUPLE_SML 0
95
97#define VARIABLE_SML 1
98
100#define SML_CORRECTION 0
101
111#define SPH_EQU_VERSION 1
112
114#define ARTIFICIAL_VISCOSITY 1
115
117#define AVERAGE_KERNELS 0
118#define DEAL_WITH_TOO_MANY_INTERACTIONS 0
119#define SHEPARD_CORRECTION 0
120#define SOLID 0
121#define NAVIER_STOKES 0
122#define ARTIFICIAL_STRESS 0
123#define POROSITY 0
124#define ZERO_CONSISTENCY 0
125#define LINEAR_CONSISTENCY 0
126#define FRAGMENTATION 0
127#define PALPHA_POROSITY 0
128#define PLASTICITY 0
129#define KLEY_VISCOSITY 0
130
131#define KEY_MAX ULONG_MAX
132//#define DOMAIN_LIST_SIZE 512 // changed to be a runtime constant
133#define MAX_DEPTH 128
134#define MAX_NUM_INTERACTIONS 180
135#define NUM_THREADS_LIMIT_TIME_STEP 256
136#define NUM_THREADS_CALC_CENTER_OF_MASS 256
137
138// (note that our sml is defined up to the zero of the kernel, not half of it)
140#define COURANT_FACT 0.4
141
142#define FORCES_FACT 0.2
143
144constexpr real dbl_max = std::numeric_limits<real>::max();
145#define DBL_MAX dbl_max;
146
148namespace Constants {
150 constexpr real G = 6.67430e-11;
151}
152
158typedef struct SimulationParameters {
160 std::string directory;
162 std::string logDirectory;
164 int verbosity;
166 bool timeKernels;
168 int numOutputFiles;
170 real timeStep;
172 real maxTimeStep;
174 real timeEnd;
176 bool loadBalancing;
178 int loadBalancingInterval;
180 int loadBalancingBins;
182 std::string inputFile;
184 std::string materialConfigFile;
186 int outputRank;
188 bool performanceLog;
190 bool particlesSent2H5;
192 int sfcSelection;
194 int integratorSelection;
195//#if GRAVITY_SIM
197 real theta;
199 real smoothing;
201 int gravityForceVersion;
202//#endif
203//#if SPH_SIM
205 int smoothingKernelSelection;
207 int sphFixedRadiusNNVersion;
208//#endif
210 bool removeParticles;
212 int removeParticlesCriterion;
214 real removeParticlesDimension;
215 int bins;
217 bool calculateAngularMomentum;
219 bool calculateEnergy;
221 bool calculateCenterOfMass;
223 real particleMemoryContingent;
225 int domainListSize;
226} SimulationParameters;
227
233struct To
234{
235 enum Target
236 {
237 host, device
238 };
239 Target t_;
240 To(Target t) : t_(t) {}
241 operator Target () const {return t_;}
242private:
243 template<typename T>
244 operator T () const;
245};
246
256struct Smoothing
257{
258 enum Kernel
259 {
260 spiky, cubic_spline, wendlandc2, wendlandc4, wendlandc6
261 };
262 Kernel t_;
263 Smoothing(Kernel t) : t_(t) {}
264 operator Smoothing () const {return t_;}
265private:
266 template<typename T>
267 operator T () const;
268};
269
275struct Execution
276{
277 enum Location
278 {
279 host, device
280 };
281 Location t_;
282 Execution(Location t) : t_(t) {}
283 operator Location () const {return t_;}
284private:
285 template<typename T>
286 operator T () const;
287};
288
299struct Curve
300{
301 enum Type
302 {
303 lebesgue, hilbert
304 };
305 Type t_;
306 Curve(Type t) : t_(t) {}
307 operator Type () const {return t_;}
308 //friend std::ostream& operator<<(std::ostream& out, const Curve::Type curveType);
309private:
310 template<typename T>
311 operator T () const;
312};
313
325struct IntegratorSelection
326{
327 enum Type
328 {
329 explicit_euler, predictor_corrector_euler
330 };
331 Type t_;
332 IntegratorSelection(Type t) : t_(t) {}
333 operator Type () const {return t_;}
334private:
335 template<typename T>
336 operator T () const;
337};
338
339
350enum EquationOfStates {
351 //EOS_TYPE_ACCRETED = -2, // special flag for particles that got accreted by a gravitating point mass
352 //EOS_TYPE_IGNORE = -1, // particle is ignored
354 EOS_TYPE_POLYTROPIC_GAS = 0,
355 //EOS_TYPE_MURNAGHAN = 1, // Murnaghan EOS for solid bodies, see Melosh "Impact Cratering", needs in material.cfg: rho_0, bulk_modulus, n
356 //EOS_TYPE_TILLOTSON = 2, // Tillotson EOS for solid bodies, see Melosh "Impact Cratering", needs in material.cfg: till_rho_0, till_A, till_B, till_E_0, till_E_iv, till_E_cv, till_a, till_b, till_alpha, till_beta; bulk_modulus and shear_modulus are needed to calculate the sound speed and crack growth speed for FRAGMENTATION
358 EOS_TYPE_ISOTHERMAL_GAS = 3,
359 //EOS_TYPE_REGOLITH = 4, // The Bui et al. 2008 soil model
360 //EOS_TYPE_JUTZI = 5, // Tillotson EOS with p-alpha model by Jutzi et al.
361 //EOS_TYPE_JUTZI_MURNAGHAN = 6, // Murnaghan EOS with p-alpha model by Jutzi et al.
362 //EOS_TYPE_ANEOS = 7, // ANEOS (or tabulated EOS in ANEOS format)
363 //EOS_TYPE_VISCOUS_REGOLITH = 8, // describe regolith as a viscous material -> EXPERIMENTAL DO NOT USE
365 EOS_TYPE_IDEAL_GAS = 9,
366 //EOS_TYPE_SIRONO = 10, // Sirono EOS modifed by Geretshauser in 2009/10
367 //EOS_TYPE_EPSILON = 11, // Tillotson EOS with epsilon-alpha model by Wuennemann, Collins et al.
369 EOS_TYPE_LOCALLY_ISOTHERMAL_GAS = 12,
370 //EOS_TYPE_JUTZI_ANEOS = 13// ANEOS EOS with p-alpha model by Jutzi et al.
371};
372
373struct Entry
374{
375 enum Name
376 {
377 x,
378#if DIM > 1
379 y,
380#if DIM == 3
381 z,
382#endif
383#endif
384 mass
385 };
386 Name t_;
387 Entry(Name t) : t_(t) {}
388 operator Name () const {return t_;}
389private:
390 template<typename T>
391 operator T () const;
392};
393
394#endif //MILUPHPC_PARAMETER_H
Constants
(Physical) constants
Definition: parameter.h:118
Constants::G
constexpr real G
Gravitational constant.
Definition: parameter.h:119
Kernel
Definition: device_rhs.cuh:7
cuda::math::max
__device__ real max(real a, real b)
Maximum value out of two floating point values.
Definition: cuda_utilities.cu:431
real
double real
Definition: parameter.h:15
EquationOfStates
EquationOfStates
implemented equation of states
Definition: parameter.h:233
dbl_max
constexpr real dbl_max
Definition: parameter_backup.h:144
real
double real
Precision of simulation.
Definition: parameter_backup.h:42
keyType
unsigned long keyType
Definition: parameter_backup.h:45
SimulationParameters
struct SimulationParameters SimulationParameters
integer
int integer
Definition: parameter_backup.h:44
EOS_TYPE_LOCALLY_ISOTHERMAL_GAS
@ EOS_TYPE_LOCALLY_ISOTHERMAL_GAS
Definition: parameter_backup.h:369
EOS_TYPE_IDEAL_GAS
@ EOS_TYPE_IDEAL_GAS
Definition: parameter_backup.h:365
EOS_TYPE_ISOTHERMAL_GAS
@ EOS_TYPE_ISOTHERMAL_GAS
Definition: parameter_backup.h:358
EOS_TYPE_POLYTROPIC_GAS
@ EOS_TYPE_POLYTROPIC_GAS
Definition: parameter_backup.h:354
idInteger
int idInteger
Definition: parameter_backup.h:46
Curve
Available space-filling curves.
Definition: parameter.h:204
Curve::Type
Type
Definition: parameter.h:206
Curve::lebesgue
@ lebesgue
Definition: parameter.h:207
Curve::hilbert
@ hilbert
Definition: parameter.h:207
Curve::t_
Type t_
Definition: parameter.h:209
Curve::Curve
Curve(Type t)
Definition: parameter_backup.h:306
Entry
Definition: parameter.h:253
Entry::Name
Name
Definition: parameter.h:255
Entry::mass
@ mass
Definition: parameter.h:263
Entry::y
@ y
Definition: parameter.h:258
Entry::x
@ x
Definition: parameter.h:256
Entry::z
@ z
Definition: parameter.h:260
Entry::Entry
Entry(Name t)
Definition: parameter_backup.h:387
Entry::t_
Name t_
Definition: parameter.h:265
Execution
Execution location (host/device).
Definition: parameter.h:190
Execution::Execution
Execution(Location t)
Definition: parameter_backup.h:282
Execution::Location
Location
Definition: parameter.h:192
Execution::device
@ device
Definition: parameter.h:193
Execution::host
@ host
Definition: parameter.h:193
Execution::t_
Location t_
Definition: parameter.h:195
IntegratorSelection
Available integrators.
Definition: parameter.h:219
IntegratorSelection::Type
Type
Definition: parameter.h:221
IntegratorSelection::predictor_corrector_euler
@ predictor_corrector_euler
Definition: parameter.h:222
IntegratorSelection::explicit_euler
@ explicit_euler
Definition: parameter.h:222
IntegratorSelection::t_
Type t_
Definition: parameter.h:224
IntegratorSelection::IntegratorSelection
IntegratorSelection(Type t)
Definition: parameter_backup.h:332
SimulationParameters
Definition: parameter.h:122
SimulationParameters::removeParticles
remove particles in dependence of some criterion bool removeParticles
Definition: parameter_backup.h:210
SimulationParameters::loadBalancing
bool loadBalancing
apply load balancing
Definition: parameter.h:131
SimulationParameters::logDirectory
std::string logDirectory
log file(s) directory
Definition: parameter.h:124
SimulationParameters::theta
real theta
clumping parameter/
Definition: parameter.h:142
SimulationParameters::maxTimeStep
real maxTimeStep
max (allowed) time step
Definition: parameter.h:129
SimulationParameters::removeParticlesDimension
real removeParticlesDimension
Definition: parameter.h:152
SimulationParameters::loadBalancingInterval
int loadBalancingInterval
apply load balancing each x interval/simulation step
Definition: parameter.h:132
SimulationParameters::timeEnd
real timeEnd
end time of simulation
Definition: parameter.h:130
SimulationParameters::materialConfigFile
std::string materialConfigFile
input file containing material configurations/parameters
Definition: parameter.h:135
SimulationParameters::directory
std::string directory
output file(s) directory
Definition: parameter.h:123
SimulationParameters::loadBalancingBins
int loadBalancingBins
Definition: parameter.h:133
SimulationParameters::smoothing
gravitational smoothing real smoothing
Definition: parameter_backup.h:199
SimulationParameters::bins
int bins
Definition: parameter.h:153
SimulationParameters::outputRank
int outputRank
specify a (MPI) rank for console logging (default: -1 logging all ranks)
Definition: parameter.h:136
SimulationParameters::calculateAngularMomentum
calculate the angular momentum bool calculateAngularMomentum
Definition: parameter_backup.h:217
SimulationParameters::particlesSent2H5
bool particlesSent2H5
log particles sent to HDF5 file
Definition: parameter.h:138
SimulationParameters::calculateCenterOfMass
bool calculateCenterOfMass
Definition: parameter.h:156
SimulationParameters::timeKernels
bool timeKernels
time the CUDA kernels
Definition: parameter.h:126
SimulationParameters::performanceLog
bool performanceLog
log performance to HDF5 file
Definition: parameter.h:137
SimulationParameters::inputFile
std::string inputFile
input file containing initial particle distribution
Definition: parameter.h:134
SimulationParameters::numOutputFiles
int numOutputFiles
number of output files
Definition: parameter.h:127
SimulationParameters::gravityForceVersion
gravitational force version to be used int gravityForceVersion
Definition: parameter_backup.h:201
SimulationParameters::verbosity
int verbosity
verbosity level
Definition: parameter.h:125
SimulationParameters::sphFixedRadiusNNVersion
int sphFixedRadiusNNVersion
Definition: parameter.h:148
SimulationParameters::integratorSelection
int integratorSelection
integrator selection
Definition: parameter.h:140
SimulationParameters::sfcSelection
int sfcSelection
space-filling curve selection
Definition: parameter.h:139
SimulationParameters::timeStep
real timeStep
time step
Definition: parameter.h:128
SimulationParameters::removeParticlesCriterion
int removeParticlesCriterion
Definition: parameter.h:151
SimulationParameters::particleMemoryContingent
real particleMemoryContingent
Definition: parameter.h:157
SimulationParameters::calculateEnergy
calculate the energy bool calculateEnergy
Definition: parameter_backup.h:219
SimulationParameters::domainListSize
domain list possible number of domain list nodes int domainListSize
Definition: parameter_backup.h:225
SimulationParameters::smoothingKernelSelection
SPH smoothing kernel selection int smoothingKernelSelection
Definition: parameter_backup.h:205
Smoothing
(SPH) available smoothing kernels.
Definition: parameter.h:176
Smoothing::cubic_spline
@ cubic_spline
Definition: parameter.h:179
Smoothing::wendlandc4
@ wendlandc4
Definition: parameter.h:179
Smoothing::spiky
@ spiky
Definition: parameter.h:179
Smoothing::wendlandc6
@ wendlandc6
Definition: parameter.h:179
Smoothing::wendlandc2
@ wendlandc2
Definition: parameter.h:179
Smoothing::Smoothing
Smoothing(Kernel t)
Definition: parameter_backup.h:263
Smoothing::t_
Kernel t_
Definition: parameter.h:181
To
Specify target: device or host.
Definition: parameter.h:162
To::t_
Target t_
Definition: parameter.h:167
To::Target
Target
Definition: parameter.h:164
To::device
@ device
Definition: parameter.h:165
To::host
@ host
Definition: parameter.h:165
To::To
To(Target t)
Definition: parameter_backup.h:240

milupHPC - include/parameter_backup.h Source File
Generated on Wed Aug 31 2022 12:16:52 by Doxygen 1.9.3