Vlasiator ebf0dd394 on dev (v5.4.0 + 1054 commits)
Loading...
Searching...
No Matches
parameters.h
Go to the documentation of this file.
1/*
2 * This file is part of Vlasiator.
3 * Copyright 2010-2016 Finnish Meteorological Institute
4 *
5 * For details of usage, see the COPYING file and read the "Rules of the Road"
6 * at http://www.physics.helsinki.fi/vlasiator/
7 *
8 * This program is free software; you can redistribute it and/or modify
9 * it under the terms of the GNU General Public License as published by
10 * the Free Software Foundation; either version 2 of the License, or
11 * (at your option) any later version.
12
13 * This program is distributed in the hope that it will be useful,
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 * GNU General Public License for more details.
17
18 * You should have received a copy of the GNU General Public License along
19 * with this program; if not, write to the Free Software Foundation, Inc.,
20 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
21 */
22
23#ifndef PARAMETERS_H
24#define PARAMETERS_H
25#include <limits>
26#include <mpi.h>
27#include <stdint.h>
28#include <string>
29#include <vector>
30#include <map>
31#include "fsgrid.hpp"
32
33#include "definitions.h"
34
35const uint64_t INVALID_CELLID = 0;
36
37struct Parameters {
38 static Real xmin;
39 static Real xmax;
40 static Real ymin;
41 static Real ymax;
42 static Real zmin;
43 static Real zmax;
44 static Real dx_ini;
45 static Real dy_ini;
46 static Real dz_ini;
47
48 static uint xcells_ini;
49 static uint ycells_ini;
50 static uint zcells_ini;
51
52 static Real t;
53 static Real t_min;
54 static Real t_max;
55 static Real dt;
57 static Real dt_ceil;
58
70
71 static uint tstep_min;
72 static uint tstep_max;
73 static uint tstep;
74
75 static bool meshRepartitioned;
76 static std::vector<CellID> localCells;
77
78 static bool adaptGPUWID;
79 static uint GPUallocations;
80
81 static uint diagnosticInterval;
82 static std::vector<std::string> systemWriteName;
83 static std::vector<std::string> systemWritePath;
84 static std::vector<Real> systemWriteTimeInterval;
85 static std::vector<int>
87 static bool systemWriteDistributionCompressed; /*Will apply ASTERIX compression to VDFs in bulk files*/
88 static bool systemWriteRestartCompressed; /*Will apply ASTERIX compression to VDFs in restart files*/
89 static bool systemWriteRecoveryCompressed; /*Will apply ASTERIX compression to VDFs in recovery files*/
90 static std::vector<int>
93 static std::vector<int>
96 static std::vector<int>
99 static std::vector<Real>
102 static std::vector<int>
105 static std::vector<bool> systemWriteFsGrid;
106 static bool systemWriteAllDROs;
108 static std::vector<int> systemWrites;
109 static std::vector<std::pair<std::string, std::string>>
111 static std::vector<std::pair<std::string, std::string>>
113 static std::vector<std::pair<std::string, std::string>>
115
116 static bool writeInitialState;
118 static bool writeFullBGB;
121 static uint exitAfterRestarts;
122 static uint recoverMaxFiles; /*<! Write cyclically this many recover files before overwriting older ones.*/
123 static uint64_t vlsvBufferSize;
126 static std::string restartWritePath;
128 static std::string recoverWritePath;
130
132
133 static bool propagateField;
138
142 static uint ohmHallTerm;
144 static uint ohmGradPeTerm;
148 static Real
152
155
159
163
164 static std::string loadBalanceAlgorithm;
165 static std::map<std::string, std::string> loadBalanceOptions; // Other Load balancing options
166 static uint rebalanceInterval;
169
170 static std::vector<std::string>
172 static std::vector<std::string>
174
175 static std::string restartFileName;
176 static bool isRestart;
177 static int writeAsFloat;
178 static int
180 static bool dynamicTimestep;
181
182 static std::string projectName;
183
189
192 static bool adaptRefinement;
193 static bool refineOnRestart;
194 static bool forceRefinement;
195 static bool shouldFilter;
196 static bool useAlpha1;
199 static bool useAlpha2;
202 // TODO: consider renaming to alpha3 or something to that effect
203 static bool useVorticity;
206 static bool useAnisotropy;
210 static uint refineCadence;
218 static int refineBoxNumber;
219 static std::vector<Real> refinementMinX;
220 static std::vector<Real> refinementMinY;
221 static std::vector<Real> refinementMinZ;
222 static std::vector<Real> refinementMaxX;
223 static std::vector<Real> refinementMaxY;
224 static std::vector<Real> refinementMaxZ;
226 static int amrBoxNumber;
227 static std::vector<uint> amrBoxHalfWidthX;
228 static std::vector<uint> amrBoxHalfWidthY;
229 static std::vector<uint> amrBoxHalfWidthZ;
230 static std::vector<Realf> amrBoxCenterX;
231 static std::vector<Realf> amrBoxCenterY;
232 static std::vector<Realf> amrBoxCenterZ;
233 static std::vector<int> amrBoxMaxLevel;
235 static std::vector<std::string> blurPassString;
236 static std::vector<int> numPasses;
237 static bool artificialPADiff; // Artificial velocity space Diffusion
238 static Realf PADcoefficient; // Artificial pitch-angle diffusion coefficient
239 static Realf PADCFL; // Artificial pitch-angle diffusion CFL
240 static int PADvbins; // Number of bins in velocity for pitch-angle diffusion
241 static int PADmubins; // Number of bins in mu for pitch-angle diffusion
242 static std::string PADnu0; // Path to txt file for nu0
243 static Realf PADfudge; // Fudge factore for diffusion
244
245 static std::array<fsgrid::Task_t,3> manualFsGridDecomposition;
246 static std::array<fsgrid::Task_t,3> overrideReadFsGridDecomposition;
247
248 //Asterix VDF Compression
256 static std::string mlpLayer;
257 static std::vector<std::size_t> mlp_arch; /* Hidden Layers in fMLP*/
258 static std::size_t mlp_fourier_order; /* Maximum fourier order in fMLP */
259 static std::size_t mlp_max_epochs;
262 static std::size_t max_vdfs_per_nn;
264 static bool doCompress;
265 static std::string method_str;
267
268 static bool computeCurvature; /*<! Boolean flag, if true the curvature of magnetic field is computed. */
269
281 static bool addParameters();
282
297 static void getParameters();
298};
299
300#endif
float Real
Definition definitions.h:41
float Realf
Definition definitions.h:33
const uint64_t INVALID_CELLID
Definition parameters.h:35
static std::vector< uint > amrBoxHalfWidthX
Definition parameters.h:227
static Real alphaDRhoWeight
Definition parameters.h:213
static uint ohmGradPeTerm
Definition parameters.h:144
static Real ymax
Definition parameters.h:41
static std::vector< std::pair< std::string, std::string > > restartReadHints
Definition parameters.h:112
static Real alphaDBSqWeight
Definition parameters.h:216
static Real anisotropyRefineThreshold
Definition parameters.h:207
static Real t_min
Definition parameters.h:53
static Real refineRadius
Definition parameters.h:212
static bool systemWriteRestartCompressed
Definition parameters.h:88
static bool fieldSolverDiffusiveEterms
Definition parameters.h:153
static bool amrTransShortPencils
Definition parameters.h:234
static Real dz_ini
Definition parameters.h:46
ASTERIX_COMPRESSION_METHODS
Definition parameters.h:249
static bool writeInitialState
Definition parameters.h:116
static std::size_t max_vdfs_per_nn
Definition parameters.h:262
static uint ohmHallTerm
Definition parameters.h:142
static Real bailout_max_memory
Definition parameters.h:187
static Real vorticityCoarsenThreshold
Definition parameters.h:205
static std::vector< Real > refinementMinZ
Definition parameters.h:221
static Real dx_ini
Definition parameters.h:44
static std::vector< int > systemWriteDistributionWriteZlineStride
Definition parameters.h:97
static Real mlp_tollerance
Definition parameters.h:261
static Real alpha1RefineThreshold
Definition parameters.h:197
static bool shouldFilter
Definition parameters.h:195
static Real t_max
Definition parameters.h:54
static Real xmax
Definition parameters.h:39
static int restartStripeFactor
Definition parameters.h:124
static uint maxFieldSolverSubcycles
Definition parameters.h:140
static int writeRestartAsFloat
Definition parameters.h:179
static int systemStripeFactor
Definition parameters.h:125
static Real maxSlAccelerationRotation
Definition parameters.h:156
static bool writeFullBGB
Definition parameters.h:118
static std::vector< CellID > localCells
Definition parameters.h:76
static bool diagnosticWriteAllDROs
Definition parameters.h:107
static int PADvbins
Definition parameters.h:240
static uint zcells_ini
Definition parameters.h:50
static bool fieldSolverFiniteDifferencingAtBoundaries
Definition parameters.h:154
static bool vlasovSolverGhostTranslate
Definition parameters.h:63
static Real zmax
Definition parameters.h:43
static bool doCompress
Definition parameters.h:264
static Real alpha2RefineThreshold
Definition parameters.h:200
static std::string restartWritePath
Definition parameters.h:126
static int amrMaxSpatialRefLevel
Definition parameters.h:190
static std::vector< Real > refinementMinY
Definition parameters.h:220
static std::vector< int > systemWriteDistributionWriteShellStride
Definition parameters.h:103
static int refineBoxNumber
Definition parameters.h:218
static std::vector< std::string > outputVariableList
Definition parameters.h:171
static std::vector< bool > systemWriteFsGrid
Definition parameters.h:105
static std::vector< uint > amrBoxHalfWidthY
Definition parameters.h:228
static bool refineOnRestart
Definition parameters.h:193
static std::vector< int > systemWriteDistributionWriteYlineStride
Definition parameters.h:94
static Real saveRestartWalltimeInterval
Definition parameters.h:119
static bool useAnisotropy
Definition parameters.h:206
static std::vector< Real > refinementMaxY
Definition parameters.h:223
static std::vector< int > systemWrites
Definition parameters.h:108
static void getParameters()
Get the global parameters.
static Realf PADcoefficient
Definition parameters.h:238
static std::map< std::string, std::string > loadBalanceOptions
Definition parameters.h:165
static bool prepareForRebalance
Definition parameters.h:167
static bool addParameters()
Add the global parameters.
static Real ymin
Definition parameters.h:40
static std::vector< Real > systemWriteDistributionWriteShellRadius
Definition parameters.h:100
static std::vector< std::size_t > mlp_arch
Definition parameters.h:257
static std::vector< std::string > systemWritePath
Definition parameters.h:83
static Real alphaDBWeight
Definition parameters.h:217
static std::string loadBalanceAlgorithm
Definition parameters.h:164
static std::vector< std::pair< std::string, std::string > > restartWriteHints
Definition parameters.h:114
static int maxSlAccelerationSubcycles
Definition parameters.h:157
static int amrBoxNumber
Definition parameters.h:226
static Real hallMinimumRhom
Definition parameters.h:160
static bool useAlpha1
Definition parameters.h:196
static bool meshRepartitioned
Definition parameters.h:75
static std::vector< int > systemWriteDistributionWriteXlineStride
Definition parameters.h:91
static std::string recoverWritePath
Definition parameters.h:128
static bool dynamicTimestep
Definition parameters.h:180
static std::string PADnu0
Definition parameters.h:242
static Real alpha2CoarsenThreshold
Definition parameters.h:201
static bool systemWriteRecoveryCompressed
Definition parameters.h:89
static std::string projectName
Definition parameters.h:182
static std::vector< Realf > amrBoxCenterY
Definition parameters.h:231
static uint bailout_velocity_space_wall_margin
Definition parameters.h:188
static std::vector< Real > refinementMaxX
Definition parameters.h:222
static uint ycells_ini
Definition parameters.h:49
static std::string mlpLayer
Definition parameters.h:256
static int amrMaxAllowedSpatialRefLevel
Definition parameters.h:191
static Real vlasovSolverMinCFL
Definition parameters.h:61
static Real vorticityRefineThreshold
Definition parameters.h:204
static int maxFilteringPasses
Definition parameters.h:225
static Real electronDensity
Definition parameters.h:149
static Real alpha1CoarsenThreshold
Definition parameters.h:198
static uint xcells_ini
Definition parameters.h:48
static uint tstep_min
Definition parameters.h:71
static int writeAsFloat
Definition parameters.h:177
static Real xmin
Definition parameters.h:38
static std::array< fsgrid::Task_t, 3 > overrideReadFsGridDecomposition
Definition parameters.h:246
static uint64_t vlsvBufferSize
Definition parameters.h:123
static std::string restartFileName
Definition parameters.h:175
static uint fieldSolverSubcycles
Definition parameters.h:69
static Real compression_interval
Definition parameters.h:260
static std::size_t mlp_max_epochs
Definition parameters.h:259
static ASTERIX_COMPRESSION_METHODS vdf_compression_method
Definition parameters.h:266
static Real fieldSolverMinCFL
Definition parameters.h:65
static Real t
Definition parameters.h:52
static bool forceRefinement
Definition parameters.h:194
static Realf PADCFL
Definition parameters.h:239
static Real hallMinimumRhoq
Definition parameters.h:161
static Real alphaDUWeight
Definition parameters.h:214
static bool bailout_write_restart
Definition parameters.h:184
static bool computeCurvature
Definition parameters.h:268
static uint tstep
Definition parameters.h:73
static uint GPUallocations
Definition parameters.h:79
static uint recoverMaxFiles
Definition parameters.h:122
static Real octree_tolerance
Definition parameters.h:263
static Real maxWaveVelocity
Definition parameters.h:139
static bool isRestart
Definition parameters.h:176
static std::string method_str
Definition parameters.h:265
static std::vector< Realf > amrBoxCenterX
Definition parameters.h:230
static Real dt_ceil
Definition parameters.h:57
static std::vector< uint > amrBoxHalfWidthZ
Definition parameters.h:229
static bool propagateVlasovAcceleration
Definition parameters.h:134
static uint exitAfterRestarts
Definition parameters.h:121
static bool adaptGPUWID
Definition parameters.h:78
static std::vector< std::string > blurPassString
Definition parameters.h:235
static Real refineAfter
Definition parameters.h:211
static bool artificialPADiff
Definition parameters.h:237
static uint vlasovSolverGhostTranslateExtent
Definition parameters.h:64
static std::vector< std::pair< std::string, std::string > > systemWriteHints
Definition parameters.h:110
static Real zmin
Definition parameters.h:42
static Realf PADfudge
Definition parameters.h:243
static std::vector< Real > refinementMinX
Definition parameters.h:219
static Real bailout_min_dt
Definition parameters.h:186
static std::vector< Real > systemWriteTimeInterval
Definition parameters.h:84
static std::vector< int > amrBoxMaxLevel
Definition parameters.h:233
static Real dy_ini
Definition parameters.h:45
static std::array< fsgrid::Task_t, 3 > manualFsGridDecomposition
Definition parameters.h:245
static Real anisotropyCoarsenThreshold
Definition parameters.h:208
static uint saveRecoverTstepInterval
Definition parameters.h:120
static bool recalculateStencils
Definition parameters.h:131
static std::vector< std::string > diagnosticVariableList
Definition parameters.h:173
static std::vector< int > systemWriteDistributionWriteStride
Definition parameters.h:86
static std::vector< Realf > amrBoxCenterZ
Definition parameters.h:232
static int PADmubins
Definition parameters.h:241
static Real vlasovSolverMaxCFL
Definition parameters.h:59
static uint rebalanceInterval
Definition parameters.h:166
static bool useAlpha2
Definition parameters.h:199
static std::size_t mlp_fourier_order
Definition parameters.h:258
static bool adaptRefinement
Definition parameters.h:192
static bool propagateVlasovTranslation
Definition parameters.h:136
static int anisotropyMaxReflevel
Definition parameters.h:209
static bool systemWriteDistributionCompressed
Definition parameters.h:87
static std::vector< Real > refinementMaxZ
Definition parameters.h:224
static Real resistivity
Definition parameters.h:141
static std::vector< std::string > systemWriteName
Definition parameters.h:82
static bool vlasovAccelerateMaxwellianBoundaries
Definition parameters.h:158
static std::vector< int > numPasses
Definition parameters.h:236
static bool systemWriteAllDROs
Definition parameters.h:106
static Real alphaDPSqWeight
Definition parameters.h:215
static Real electronTemperature
Definition parameters.h:146
static uint refineCadence
Definition parameters.h:210
static uint tstep_max
Definition parameters.h:72
static Real electronPTindex
Definition parameters.h:150
static uint diagnosticInterval
Definition parameters.h:81
static Real fieldSolverMaxCFL
Definition parameters.h:67
static bool useVorticity
Definition parameters.h:203
static Real dt
Definition parameters.h:55
static bool propagateField
Definition parameters.h:133