Vlasiator ebf0dd394 on dev (v5.4.0 + 1054 commits)
Loading...
Searching...
No Matches
parameters.cpp
Go to the documentation of this file.
1/*S
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#include "parameters.h"
24#include "common.h"
25#include "mpi.h"
26#include "object_wrapper.h"
27#include "particle_species.h"
28#include "readparameters.h"
29#include <algorithm>
30#include <filesystem>
31#include <cstdlib>
32#include <iostream>
33#include <limits>
34#include <set>
35#include <stdexcept>
36#include <unistd.h>
37
39
40#ifndef NAN
41#define NAN 0
42#endif
43
44using namespace std;
45
46typedef Parameters P;
47
48extern Logger logFile;
49// Using numeric_limits<Real>::max() leads to FP exceptions inside boost programoptions, use a slightly smaller value to
50// avoid...
51
52const Real LARGE_REAL = 1e20;
53// Define static members:
63
64uint P::xcells_ini = numeric_limits<uint>::max();
65uint P::ycells_ini = numeric_limits<uint>::max();
66uint P::zcells_ini = numeric_limits<uint>::max();
67
68Real P::t = 0;
69Real P::t_min = 0;
71Real P::dt_ceil = -1.0;
72Real P::dt = NAN;
80
81
82uint P::tstep = 0;
83uint P::tstep_min = 0;
84uint P::tstep_max = 0;
85uint P::diagnosticInterval = numeric_limits<uint>::max();
86bool P::writeInitialState = true;
87bool P::writeFullBGB = false;
88
89bool P::meshRepartitioned = true;
90bool P::prepareForRebalance = false;
91vector<CellID> P::localCells;
92
93bool P::adaptGPUWID = true;
94uint P::GPUallocations = 128;
95
96vector<string> P::systemWriteName;
97vector<string> P::systemWritePath;
108vector<bool> P::systemWriteFsGrid;
111vector<int> P::systemWrites;
112vector<pair<string, string>> P::systemWriteHints;
113vector<pair<string, string>> P::restartWriteHints;
114vector<pair<string, string>> P::restartReadHints;
115
118uint P::exitAfterRestarts = numeric_limits<uint>::max();
119uint P::recoverMaxFiles = 0;
120uint64_t P::vlsvBufferSize = 0;
123string P::restartWritePath = string("");
124string P::recoverWritePath = string("");
125
126bool P::recalculateStencils = true;
129bool P::propagateField = true;
130
131bool P::dynamicTimestep = true;
132
139uint P::ohmHallTerm = 0;
140uint P::ohmGradPeTerm = 0;
144
145string P::restartFileName = string("");
146bool P::isRestart = false;
147int P::writeAsFloat = false;
148int P::writeRestartAsFloat = false;
149string P::loadBalanceAlgorithm = string("");
150std::map<std::string, std::string> P::loadBalanceOptions;
151uint P::rebalanceInterval = numeric_limits<uint>::max();
152
153vector<string> P::outputVariableList;
154vector<string> P::diagnosticVariableList;
155
156string P::projectName = string("");
157
162
163bool P::bailout_write_restart = false;
165Real P::bailout_max_memory = 1073741824.;
167
168bool P::amrTransShortPencils = false;
171bool P::adaptRefinement = false;
172bool P::refineOnRestart = false;
173bool P::forceRefinement = false;
174bool P::shouldFilter = false;
175bool P::useAlpha1 = true;
178bool P::useAlpha2 = true;
181bool P::useVorticity = false;
184bool P::useAnisotropy = false;
193
194uint P::refineCadence = 5;
195Real P::refineAfter = 0.0;
197int P::refineBoxNumber = 0;
198std::vector<Real> P::refinementMinX;
199std::vector<Real> P::refinementMinY;
200std::vector<Real> P::refinementMinZ;
201std::vector<Real> P::refinementMaxX;
202std::vector<Real> P::refinementMaxY;
203std::vector<Real> P::refinementMaxZ;
205int P::amrBoxNumber = 0;
206std::vector<uint> P::amrBoxHalfWidthX;
207std::vector<uint> P::amrBoxHalfWidthY;
208std::vector<uint> P::amrBoxHalfWidthZ;
209std::vector<Realf> P::amrBoxCenterX;
210std::vector<Realf> P::amrBoxCenterY;
211std::vector<Realf> P::amrBoxCenterZ;
212std::vector<int> P::amrBoxMaxLevel;
213vector<string> P::blurPassString;
214vector<int> P::numPasses;
215
219int P::PADvbins;
220int P::PADmubins;
221string P::PADnu0 = string("");
223
224std::array<fsgrid::Task_t,3> P::manualFsGridDecomposition = {0,0,0};
225std::array<fsgrid::Task_t,3> P::overrideReadFsGridDecomposition = {0,0,0};
226
227std::string tracerString;
229
230//Asterix - VDF Compression
231std::vector<std::size_t> P::mlp_arch;
232std::size_t P::mlp_fourier_order;
233std::size_t P::mlp_max_epochs;
236std::string P::mlpLayer;
238bool P::doCompress=false;
239std::string P::method_str;
241std::size_t P::max_vdfs_per_nn;
242
243
245 typedef Readparameters RP;
246 // the other default parameters we read through the add/get interface
247 RP::add("io.diagnostic_write_interval", "Write diagnostic output every arg time steps", numeric_limits<uint>::max());
248
249 RP::addComposing(
250 "io.system_write_t_interval",
251 "Save the simulation every arg simulated seconds. Negative values disable writes. [Define for all groups.]");
252 RP::addComposing("io.system_write_file_name",
253 "Save the simulation to this file name series. [Define for all groups.]");
254 RP::addComposing("io.system_write_path",
255 "Save this series in this location. Default is ./ [Define for all groups or none.]");
256 RP::addComposing("io.system_write_distribution_stride",
257 "Every this many cells write out their velocity space. 0 is none. [Define for all groups.]");
258 RP::addComposing("io.system_write_distribution_xline_stride",
259 "Every this many lines of cells along the x direction write out their velocity space. 0 is none. "
260 "[Define for all groups.]");
261 RP::addComposing("io.system_write_distribution_yline_stride",
262 "Every this many lines of cells along the y direction write out their velocity space. 0 is none. "
263 "[Define for all groups.]");
264 RP::addComposing("io.system_write_distribution_zline_stride",
265 "Every this many lines of cells along the z direction write out their velocity space. 0 is none. "
266 "[Define for all groups.]");
267 RP::addComposing("io.system_write_distribution_shell_radius",
268 "At cells intersecting spheres with those radii centred at the origin write out their velocity "
269 "space. 0 is none.");
270 RP::addComposing("io.system_write_distribution_shell_stride",
271 "Every this many cells for those on selected shells write out their velocity space. 0 is none.");
272 RP::addComposing("io.system_write_fsgrid_variables", "If 0 don't write fsgrid DROs, if 1 do write them.");
273 RP::addComposing(
274 "io.system_write_mpiio_hint_key",
275 "MPI-IO hint key passed to the non-restart IO. Has to be matched by io.system_write_mpiio_hint_value.");
276 RP::addComposing(
277 "io.system_write_mpiio_hint_value",
278 "MPI-IO hint value passed to the non-restart IO. Has to be matched by io.system_write_mpiio_hint_key.");
279 RP::addComposing(
280 "io.restart_write_mpiio_hint_key",
281 "MPI-IO hint key passed to the restart IO. Has to be matched by io.restart_write_mpiio_hint_value.");
282 RP::addComposing(
283 "io.restart_write_mpiio_hint_value",
284 "MPI-IO hint value passed to the restart IO. Has to be matched by io.restart_write_mpiio_hint_key.");
285 RP::addComposing(
286 "io.restart_read_mpiio_hint_key",
287 "MPI-IO hint key passed to the restart IO. Has to be matched by io.restart_read_mpiio_hint_value.");
288 RP::addComposing(
289 "io.restart_read_mpiio_hint_value",
290 "MPI-IO hint value passed to the restart IO. Has to be matched by io.restart_read_mpiio_hint_key.");
291
292 RP::add("io.write_initial_state",
293 "Write initial state, not even the 0.5 dt propagation is done. Do not use for restarting. ", false);
294
295 RP::add("io.write_full_bgb_data", "Write a dedicated file containing all BGB components and first derivatives, then exit.", false);
296
297 RP::add("io.restart_walltime_interval",
298 "Save the complete simulation in given walltime intervals. Negative values disable writes.", -1.0);
299 RP::add("io.number_of_restarts", "Exit the simulation after certain number of walltime-based restarts.",
300 numeric_limits<uint>::max());
301 RP::add("io.recover_tstep_interval",
302 "Save the complete simulation in given tstep intervals. 0 disables writes.", 0);
303 RP::add("io.number_of_recovers", "Overwrite recovers cyclically after this number of recovers written.", 2);
304 RP::add("io.vlsv_buffer_size",
305 "Buffer size passed to VLSV writer (bytes, up to uint64_t), default 0 as this is sensible on sisu", 0);
306 RP::add("io.write_restart_stripe_factor", "Stripe factor for restart and initial grid writing. Default 0 to inherit.", 0);
307 RP::add("io.write_system_stripe_factor", "Stripe factor for bulk file writing. Default 0 to inherit.", 0);
308 RP::add("io.write_as_float", "If true, write in floats instead of doubles", false);
309 RP::add("io.restart_write_path",
310 "Path to the location where restart files should be written. Defaults to the local directory, also if the "
311 "specified destination is not writeable.",
312 string("./"));
313 RP::add("io.recover_write_path",
314 "Path to the location where recover files should be written. Defaults to the local directory, also if the "
315 "specified destination is not writeable.",
316 string("./"));
317
318 RP::add("propagate_field", "Propagate magnetic field during the simulation", true);
319 RP::add("propagate_vlasov_acceleration",
320 "Propagate distribution functions during the simulation in velocity space. If false, it is propagated with "
321 "zero length timesteps.",
322 true);
323 RP::add("propagate_vlasov_translation",
324 "Propagate distribution functions during the simulation in ordinary space. If false, it is propagated with "
325 "zero length timesteps.",
326 true);
327 RP::add("dynamic_timestep", "If true, timestep is set based on CFL limits (default on)", true);
328 RP::add("hallMinimumRho",
329 "Minimum rho value used for the Hall and electron pressure gradient terms in the Lorentz force and in the "
330 "field solver. Default is very low and has no effect in practice.",
331 1.0);
332 RP::add("project",
333 "Specify the name of the project to use. Supported to date (20150610): Alfven Diffusion Dispersion "
334 "Distributions Firehose Flowthrough Fluctuations Harris KHB Larmor Magnetosphere Multipeak Riemann1 Shock "
335 "Shocktest Template test_fp testHall test_trans verificationLarmor",
336 string(""));
337
338 RP::add("restart.write_as_float", "If true, write restart fields in floats instead of doubles", false);
339 RP::add("restart.filename", "Restart from this vlsv file. No restart if empty file.", string(""));
340
341 RP::add(
342 "restart.overrideReadFsGridDecompositionX",
343 "Manual FsGridDecomposition for field solver grid stored in a restart file.", 0);
344 RP::add(
345 "restart.overrideReadFsGridDecompositionY",
346 "Manual FsGridDecomposition for field solver grid stored in a restart file.", 0);
347 RP::add(
348 "restart.overrideReadFsGridDecompositionZ",
349 "Manual FsGridDecomposition for field solver grid stored in a restart file.", 0);
350
351 RP::add("gridbuilder.x_min", "Minimum value of the x-coordinate.", NAN);
352 RP::add("gridbuilder.x_max", "Maximum value of the x-coordinate.", NAN);
353 RP::add("gridbuilder.y_min", "Minimum value of the y-coordinate.", NAN);
354 RP::add("gridbuilder.y_max", "Maximum value of the y-coordinate.", NAN);
355 RP::add("gridbuilder.z_min", "Minimum value of the z-coordinate.", NAN);
356 RP::add("gridbuilder.z_max", "Maximum value of the z-coordinate.", NAN);
357 RP::add("gridbuilder.x_length", "Number of cells in x-direction in initial grid.", 0);
358 RP::add("gridbuilder.y_length", "Number of cells in y-direction in initial grid.", 0);
359 RP::add("gridbuilder.z_length", "Number of cells in z-direction in initial grid.", 0);
360
361 RP::add("gridbuilder.dt", "Initial timestep in seconds.", 0.0);
362
363 RP::add("gridbuilder.t_max",
364 "Maximum simulation time, in seconds. If timestep_max limit is hit first this time will never be reached",
365 LARGE_REAL);
366 RP::add("gridbuilder.timestep_max",
367 "Max. value for timesteps. If t_max limit is hit first, this step will never be reached",
368 numeric_limits<uint>::max());
369 RP::add("gridbuilder.dt_ceil",
370 "Maximum simulation dt in seconds.",
371 -1.0);
372
373 // Field solver parameters
374 RP::add("fieldsolver.maxWaveVelocity",
375 "Maximum wave velocity allowed in the fastest velocity determination in m/s, default unlimited", LARGE_REAL);
376 RP::add("fieldsolver.maxSubcycles", "Maximum allowed field solver subcycles", 1);
377 RP::add("fieldsolver.resistivity", "Resistivity for the eta*J term in Ohm's law.", 0.0);
378 RP::add("fieldsolver.diffusiveEterms", "Enable diffusive terms in the computation of E", true);
379 RP::add("fieldsolver.finiteDifferencingAtBoundaries", "Enable finite differencing at sysboundaries", false);
380 RP::add(
381 "fieldsolver.ohmHallTerm",
382 "Enable/choose spatial order of the Hall term in Ohm's law. 0: off, 1: 1st spatial order, 2: 2nd spatial order",
383 0);
384 RP::add(
385 "fieldsolver.ohmGradPeTerm",
386 "Enable/choose spatial order of the electron pressure gradient term in Ohm's law. 0: off, 1: 1st spatial order.",
387 0);
388 RP::add("fieldsolver.electronTemperature",
389 "Upstream (anchor point) electron temperature to be used for the electron pressure gradient term (K).", 0.0);
390 RP::add("fieldsolver.electronDensity",
391 "Upstream (anchor point) electron density to be used for the electron pressure gradient term (m^-3).", 0.0);
392 RP::add("fieldsolver.electronPTindex",
393 "Polytropic index for the equation of state to solve the electron pressure gradient term. 0 is isobaric, 1 is isothermal, 1.667 is adiabatic "
394 "electrons, ",
395 0.0);
396 RP::add("fieldsolver.maxCFL",
397 "The maximum CFL limit for field propagation. Used to set timestep if dynamic_timestep is true.", 0.5);
398 RP::add("fieldsolver.minCFL",
399 "The minimum CFL limit for field propagation. Used to set timestep if dynamic_timestep is true.", 0.4);
400
401 RP::add(
402 "fieldsolver.manualFsGridDecompositionX",
403 "Manual FsGridDecomposition for field solver grid.", 0);
404 RP::add(
405 "fieldsolver.manualFsGridDecompositionY",
406 "Manual FsGridDecomposition for field solver grid.", 0);
407 RP::add(
408 "fieldsolver.manualFsGridDecompositionZ",
409 "Manual FsGridDecomposition for field solver grid.", 0);
410
411
412 // Vlasov solver parameters
413 RP::add("vlasovsolver.maxSlAccelerationRotation",
414 "Maximum rotation angle (degrees) allowed by the Semi-Lagrangian solver (Use >25 values with care)", 25.0);
415 RP::add("vlasovsolver.maxSlAccelerationSubcycles", "Maximum number of subcycles for acceleration", 1);
416 RP::add("vlasovsolver.maxCFL",
417 "The maximum CFL limit for vlasov propagation in ordinary space. Used to set timestep if dynamic_timestep "
418 "is true.",
419 0.99);
420 RP::add("vlasovsolver.minCFL",
421 "The minimum CFL limit for vlasov propagation in ordinary space. Used to set timestep if dynamic_timestep "
422 "is true.",
423 0.8);
424 RP::add("vlasovsolver.accelerateMaxwellianBoundaries",
425 "Propagate maxwellian boundary cell contents in velocity space. Default false.",
426 false);
427 RP::add("vlasovsolver.GhostTranslate","Boolean for activating all-local ghost translation",false);
428 RP::add("vlasovsolver.GhostTranslateExtent","Stencil size in all-local ghost translation (default: VLASOV_STENCIL_WIDTH+1",0);
429
430 // Load balancing parameters
431 RP::add("loadBalance.algorithm", "Load balancing algorithm to be used", string("RCB"));
432 RP::add("loadBalance.tolerance", "Load imbalance tolerance", string("1.05"));
433 RP::add("loadBalance.rebalanceInterval", "Load rebalance interval (steps)", 10);
434
435 RP::addComposing("loadBalance.optionKey", "Zoltan option key. Has to be matched by loadBalance.optionValue.");
436 RP::addComposing("loadBalance.optionValue", "Zoltan option value. Has to be matched by loadBalance.optionKey.");
437
438 // Output variable parameters
439 RP::add("io.system_write_all_data_reducers", "If 0 don't write all DROs, if 1 do write them.", false);
440 RP::add("io.system_write_distribution_compressed", string("Apply ASTERIX compressiont to VDFs in bulk files."), false);
441 RP::add("io.system_write_restart_compressed", string("Apply ASTERIX compressiont to VDFs in restart files."), false);
442 RP::add("io.system_write_recovery_compressed", string("Apply ASTERIX compressiont to VDFs in recovery files."), false);
443 // NOTE Do not remove the : before the list of variable names as this is parsed by tools/check_vlasiator_cfg.sh
444 RP::addComposing("variables.output",
445 string() +
446 "List of data reduction operators (DROs) to add to the grid file output. Each variable to be "
447 "added has to be on a new line output = XXX. Names are case insensitive. " +
448 "Available (20250413): " + "fg_b fg_b_background fg_b_perturbed fg_b_background_vol fg_derivs_b_background fg_e " +
449 "vg_rhom vg_rhoq populations_vg_rho " + "fg_rhom fg_rhoq " + "vg_v fg_v populations_vg_v " +
450 "populations_vg_moments_thermal populations_vg_moments_nonthermal " +
451 "populations_vg_effectivesparsitythreshold populations_vg_rho_loss_adjust " +
452 "populations_vg_energydensity populations_vg_precipitationdifferentialflux " +
453 "populations_vg_heatflux " + "populations_vg_1dmuspace " +
454 "populations_vg_nonmaxwellianity " +
455 "vg_maxdt_acceleration vg_maxdt_translation populations_vg_maxdt_acceleration " +
456 "populations_vg_maxdt_translation " +
457 "fg_maxdt_fieldsolver " + "vg_rank fg_rank fg_amr_level vg_loadbalance_weight " +
458 "vg_boundarytype fg_boundarytype vg_boundarylayer fg_boundarylayer " +
459 "populations_vg_blocks vg_f_saved " + "populations_vg_acceleration_subcycles " +
460 "vg_e_vol fg_e_vol " +
461 "fg_e_hall vg_e_gradpe fg_b_vol vg_b_vol vg_b_background_vol vg_b_perturbed_vol " +
462 "vg_pressure fg_pressure populations_vg_ptensor " + "vg_b_vol_derivatives fg_derivs " +
463 "ig_fac ig_latitude ig_chi0 ig_cellarea ig_upmappedarea ig_sigmap ig_sigmah ig_sigmaparallel ig_rhon " +
464 "ig_electrontemp ig_solverinternals ig_upmappednodecoords ig_upmappedb ig_openclosed ig_potential "+
465 "ig_precipitation ig_deltaphi "+
466 "ig_inplanecurrent ig_b ig_e vg_drift vg_ionospherecoupling vg_connection vg_fluxrope fg_curvature "+
467 "vg_amr_drho vg_amr_du vg_amr_dpsq vg_amr_dbsq vg_amr_db vg_amr_alpha1 vg_amr_reflevel vg_amr_alpha2 "+
468 "vg_gridcoordinates fg_gridcoordinates vg_pressure_anisotropy vg_amr_vorticity");
469
470 RP::addComposing(
471 "variables_deprecated.output",
472 string() + "List of deprecated names for data reduction operators (DROs). Names are case insensitive. " +
473 "Available (20250413): " + "B BackgroundB fg_BackgroundB PerturbedB fg_PerturbedB " + "E " +
474 "Rhom Rhoq populations_Rho " + "V populations_V " +
475 "populations_moments_Backstream populations_moments_NonBackstream " +
476 "populations_moments_thermal populations_moments_nonthermal " +
477 "populations_minvalue populations_EffectiveSparsityThreshold populations_RhoLossAdjust "
478 "populations_rho_loss_adjust populations_1dmuspace " +
479 "populations_EnergyDensity populations_PrecipitationFlux populations_precipitationdifferentialflux" +
480 "LBweight vg_lbweight vg_loadbalanceweight MaxVdt MaxRdt populations_MaxVdt populations_MaxRdt " +
481 "populations_maxdt_acceleration populations_maxdt_translation MaxFieldsdt fg_maxfieldsdt" +
482 "MPIrank FsGridRank " + "FsGridBoundaryType BoundaryType FsGridBoundaryLayer BoundaryLayer " +
483 "populations_Blocks fSaved vg_fsaved" + "populations_accSubcycles populations_acceleration_subcycles" +
484 "VolE vg_VolE Evol E_vol fg_VolE fg_Evol " +
485 "HallE fg_HallE GradPeE e_gradpe VolB vg_VolB fg_VolB B_vol Bvol vg_Bvol fg_volB fg_Bvol " +
486 "BackgroundVolB PerturbedVolB " + "Pressure vg_Pressure fg_Pressure populations_PTensor " +
487 "BVOLderivs b_vol_derivs");
488
489 RP::add("io.diagnostic_write_all_data_reducers", "Write all available diagnostic reducers", false);
490 // NOTE Do not remove the : before the list of variable names as this is parsed by tools/check_vlasiator_cfg.sh
491 RP::addComposing("variables.diagnostic",
492 string() +
493 "List of data reduction operators (DROs) to add to the diagnostic runtime output. Each "
494 "variable to be added has to be on a new line diagnostic = XXX. Names are case insensitive. " +
495 "Available (20250130): " + "populations_vg_blocks " +
496 "vg_rhom populations_vg_rho_loss_adjust " + "vg_loadbalance_weight " +
497 "vg_maxdt_acceleration vg_maxdt_translation " + "fg_maxdt_fieldsolver " +
498 "populations_vg_maxdt_acceleration populations_vg_maxdt_translation ");
499
500 RP::addComposing("variables_deprecated.diagnostic",
501 string() +
502 "List of deprecated data reduction operators (DROs) to add to the diagnostic runtime output. "
503 "Names are case insensitive. " +
504 "Available (20250130): " + "rhom populations_rholossadjust populations_rho_loss_adjust " +
505 "populations_blocks lbweight loadbalance_weight " + "vg_lbweight vg_loadbalanceweight " +
506 "maxvdt maxdt_acceleration " + "maxrdt maxdt_translation " +
507 "populations_maxvdt populations_maxrdt " +
508 "populations_maxdt_acceleration populations_maxdt_translation " +
509 "maxfieldsdt maxdt_fieldsolver fg_maxfieldsdt");
510
511 // bailout parameters
512 RP::add("bailout.write_restart",
513 "If 1, write a restart file on bailout. Gets reset when sending a STOP (1) or a KILL (0).", true);
514 RP::add("bailout.min_dt", "Minimum time step below which bailout occurs (s).", 1e-6);
515 RP::add("bailout.max_memory", "Maximum amount of memory used per node (in GiB) over which bailout occurs.",
516 1073741824.);
517 RP::add("bailout.velocity_space_wall_block_margin", "Distance from the velocity space limits in blocks, if the distribution function reaches that distance from the wall we bail out to avoid hitting the wall.", 1);
518
519 // Spatial Refinement parameters
520 RP::add("AMR.max_spatial_level", "Maximum absolute spatial mesh refinement level", (uint)0);
521 RP::add("AMR.max_allowed_spatial_level", "Maximum currently allowed spatial mesh refinement level", -1);
522 RP::add("AMR.should_refine","If false, do not refine Vlasov grid regardless of max spatial level",true);
523 RP::add("AMR.adapt_refinement","If true, re-refine vlasov grid every refine_cadence balance", false);
524 RP::add("AMR.refine_on_restart","If true, re-refine vlasov grid on restart. DEPRECATED, consider using the DOMR command", false);
525 RP::add("AMR.force_refinement","If true, refine/unrefine the vlasov grid to match the config on restart", false);
526 RP::add("AMR.should_filter","If true, filter vlasov grid with boxcar filter on restart",false);
527 RP::add("AMR.use_alpha1","Use the maximum of dimensionless gradients alpha_1 as a refinement index", true);
528 RP::add("AMR.alpha1_refine_threshold","Determines the minimum value of alpha_1 to refine cells", 0.5);
529 RP::add("AMR.alpha1_coarsen_threshold","Determines the maximum value of alpha_1 to unrefine cells, default half of the refine threshold", -1.0);
530 RP::add("AMR.use_alpha2","Use J/B_perp as a refinement index", true);
531 RP::add("AMR.alpha2_refine_threshold","Determines the minimum value of alpha_2 to refine cells", 0.5);
532 RP::add("AMR.alpha2_coarsen_threshold","Determines the maximum value of alpha_2 to unrefine cells, default half of the refine threshold", -1.0);
533 RP::add("AMR.use_vorticity","Use vorticity as a refinement index", false);
534 RP::add("AMR.vorticity_refine_threshold","Determines the minimum value of vorticity to refine cells", 0.5);
535 RP::add("AMR.vorticity_coarsen_threshold","Determines the maximum value of vorticity to unrefine cells, default half of the refine threshold", -1.0);
536 RP::add("AMR.use_anisotropy","Use pressure anisotropy as a refinement index", false);
537 RP::add("AMR.anisotropy_refine_threshold","Determines the maximum value of pressure anisotropy to refine cells", 0.5);
538 RP::add("AMR.anisotropy_coarsen_threshold","Determines the minimum value of pressure anisotropy to unrefine cells, default twice the refine threshold", -1.0);
539 RP::add("AMR.anisotropy_max_reflevel","When anisotropy is below the refine threshold, defines the maximum level to refine to", 2);
540 RP::add("AMR.refine_cadence","Refine every nth load balance", 5);
541 RP::add("AMR.refine_after","Start refinement after this many simulation seconds", 0.0);
542 RP::add("AMR.refine_radius","Maximum distance from origin to allow refinement within. Only induced refinement allowed outside this radius.", LARGE_REAL);
543 RP::add("AMR.number_of_refine_boxes", "How many boxes outside which to suppress refinement, that number of box edges have to then be defined as well. If more than 1 box is defined, refinement is suppressed outside the union of the volumes of all boxes.", 0);
544 RP::addComposing("AMR.refinement_min_x", "Refinement minimum X coordinate, no refinement at x < this value (m) except induced refinement.");
545 RP::addComposing("AMR.refinement_min_y", "Refinement minimum Y coordinate, no refinement at y < this value (m) except induced refinement.");
546 RP::addComposing("AMR.refinement_min_z", "Refinement minimum Z coordinate, no refinement at z < this value (m) except induced refinement.");
547 RP::addComposing("AMR.refinement_max_x", "Refinement maximum X coordinate, no refinement at x > this value (m) except induced refinement.");
548 RP::addComposing("AMR.refinement_max_y", "Refinement maximum Y coordinate, no refinement at y > this value (m) except induced refinement.");
549 RP::addComposing("AMR.refinement_max_z", "Refinement maximum Z coordinate, no refinement at z > this value (m) except induced refinement.");
550 RP::add("AMR.alpha1_drho_weight","Multiplier for delta rho (plasma density) in alpha calculation", 1.0);
551 RP::add("AMR.alpha1_du_weight","Multiplier for delta U (total kinetic + field energy density) in alpha calculation", 1.0);
552 RP::add("AMR.alpha1_dpsq_weight","Multiplier for delta p squared (kinetic energy) in alpha calculation", 1.0);
553 RP::add("AMR.alpha1_dbsq_weight","Multiplier for delta B squared (field energy) in alpha calculation", 1.0);
554 RP::add("AMR.alpha1_db_weight","Multiplier for delta B (magnetic field strength) in alpha calculation", 1.0);
555 RP::add("AMR.number_of_boxes", "How many boxes to be refined, that number of centers and sizes have to then be defined as well.", 0);
556 RP::addComposing("AMR.box_half_width_x", "Half width in x of the box that is refined");
557 RP::addComposing("AMR.box_half_width_y", "Half width in y of the box that is refined");
558 RP::addComposing("AMR.box_half_width_z", "Half width in z of the box that is refined");
559 RP::addComposing("AMR.box_center_x", "x coordinate of the center of the box that is refined");
560 RP::addComposing("AMR.box_center_y", "y coordinate of the center of the box that is refined");
561 RP::addComposing("AMR.box_center_z", "z coordinate of the center of the box that is refined");
562 RP::addComposing("AMR.box_max_level", "max refinement level of the box that is refined");
563 RP::add("AMR.transShortPencils", "if true, use one-cell pencils", false);
564 RP::addComposing("AMR.filterpasses", string("AMR filter passes for each individual refinement level"));
565 RP::add("adaptGPUWID", "if true, will halve velocity block counts if GPU is in use and WID==8", true);
566 RP::add("GPUallocations", "How many parallel GPU vlasov allocations to make? (default 128)", 128);
567
568 // Diffusion parameters
569 RP::add("PAD.enable","Enable Artificial pitch-angle diffusion",0);
570 RP::add("PAD.coefficient","Set artificial pitch-angle diffusion coefficient (overriding .DAT file)",-1);
571 RP::add("PAD.CFL","Set CFL condition",0.1);
572 RP::add("PAD.vbins","number of bins for velocity",200);
573 RP::add("PAD.mubins","number of bins for mu",30);
574 RP::add("PAD.file","Path of txt file for nu0", string("NU0BOX.DAT"));
575 RP::add("PAD.fudge","Divide diffusion coefficient nu0 (read from file) by a fudge factor (see Dubart et al 2023)",4);
576
577 // Fieldtracing
578 RP::add("fieldtracing.fieldLineTracer", "Field line tracing method to use for coupling ionosphere and magnetosphere (options are: Euler, BS)", std::string("Euler"));
579 RP::add("fieldtracing.tracer_max_allowed_error", "Maximum allowed error for the adaptive field line tracers ", 1000);
580 RP::add("fieldtracing.tracer_max_attempts", "Maximum allowed attempts for the adaptive field line tracers", 100);
581 RP::add("fieldtracing.tracer_min_dx", "Minimum allowed field line tracer step length for the adaptive field line tracers (m)", 100e3);
582 RP::add("fieldtracing.fullbox_and_fluxrope_max_absolute_distance_to_trace", "Maximum absolute distance in m to trace along the field line before ending. Defaults to the sum of the simulation box edge lengths LX+LY+LZ if set <= 0.", -1);
583 RP::add("fieldtracing.fullbox_max_incomplete_cells", "Maximum fraction of cells left incomplete when stopping tracing loop for full box tracing. Defaults to zero to process all, will be slow at scale! Both fluxrope_max_incomplete_cells and fullbox_max_incomplete_cells will be achieved.", 0);
584 RP::add("fieldtracing.fluxrope_max_incomplete_cells", "Maximum fraction of cells left incomplete when stopping loop for flux rope tracing. Defaults to zero to process all, will be slow at scale! Both fluxrope_max_incomplete_cells and fullbox_max_incomplete_cells will be achieved.", 0);
585 RP::add("fieldtracing.use_reconstruction_cache", "Use the cache to store reconstruction coefficients. (0: don't, 1: use)", 0);
586 RP::add("fieldtracing.fluxrope_max_curvature_radii_to_trace", "Maximum number of seedpoint curvature radii to trace forward and backward from each DCCRG cell to find flux ropes", 10);
587 RP::add("fieldtracing.fluxrope_max_curvature_radii_extent", "Maximum extent in seedpoint curvature radii from the seed a field line is allowed to extend to be counted as a flux rope", 2);
588 RP::add("fieldtracing.min_allowed_x", "Trace for x coordinates larger than this limit (in m).", -LARGE_REAL);
589 RP::add("fieldtracing.min_allowed_y", "Trace for y coordinates larger than this limit (in m).", -LARGE_REAL);
590 RP::add("fieldtracing.min_allowed_z", "Trace for z coordinates larger than this limit (in m).", -LARGE_REAL);
591 RP::add("fieldtracing.max_allowed_x", "Trace for x coordinates smaller than this limit (in m).", LARGE_REAL);
592 RP::add("fieldtracing.max_allowed_y", "Trace for y coordinates smaller than this limit (in m).", LARGE_REAL);
593 RP::add("fieldtracing.max_allowed_z", "Trace for z coordinates smaller than this limit (in m).", LARGE_REAL);
594
595 //Asterix - VDF Compression
596 RP::add("Asterix.mlp_layers", string("Hidden layer architecture (neuron count per hidden layer) for MLP"),"32,32,32");
597 RP::add("Asterix.tol", string("MLP Compression reconstruction tolerance"),1e-4);
598 RP::add("Asterix.octree_tolerance", string("OCTREE Compression reconstruction tolerance"),1e-3);
599 RP::add("Asterix.max_epochs", string("Max MLP epochs"),50);
600 RP::add("Asterix.fourier_order", string("Fourier Feature Order"),32);
601 RP::add("Asterix.interval", string("Compression interval in seconds [Deprecated]"),1.0);
602 RP::add("Asterix.state", string("Boolean Asterix compression toggle"),false);
603 RP::add("Asterix.method", string("Compression method string"),"ZFP");
604 RP::add("Asterix.max_vdfs_per_nn",string("Max vdfs per MLP in multi regression mode") ,std::numeric_limits<std::size_t>::max());
605 return true;
606}
607
609 typedef Readparameters RP;
610 // get numerical values of the parameters
611 RP::get("io.diagnostic_write_interval", P::diagnosticInterval);
612 RP::get("io.diagnostic_write_all_data_reducers", P::diagnosticWriteAllDROs);
613 RP::get("io.system_write_t_interval", P::systemWriteTimeInterval);
614 RP::get("io.system_write_file_name", P::systemWriteName);
615 RP::get("io.system_write_path", P::systemWritePath);
616 RP::get("io.system_write_distribution_stride", P::systemWriteDistributionWriteStride);
617 RP::get("io.system_write_distribution_xline_stride", P::systemWriteDistributionWriteXlineStride);
618 RP::get("io.system_write_distribution_yline_stride", P::systemWriteDistributionWriteYlineStride);
619 RP::get("io.system_write_distribution_zline_stride", P::systemWriteDistributionWriteZlineStride);
620 RP::get("io.system_write_distribution_shell_radius", P::systemWriteDistributionWriteShellRadius);
621 RP::get("io.system_write_distribution_shell_stride", P::systemWriteDistributionWriteShellStride);
622 RP::get("io.system_write_fsgrid_variables", P::systemWriteFsGrid);
623 RP::get("io.system_write_all_data_reducers", P::systemWriteAllDROs);
624 RP::get("io.system_write_distribution_compressed", P::systemWriteDistributionCompressed);
625 RP::get("io.system_write_restart_compressed", P::systemWriteRestartCompressed);
626 RP::get("io.system_write_recovery_compressed", P::systemWriteRecoveryCompressed);
627 RP::get("io.write_initial_state", P::writeInitialState);
628 RP::get("io.write_full_bgb_data", P::writeFullBGB);
629 RP::get("io.restart_walltime_interval", P::saveRestartWalltimeInterval);
630 RP::get("io.recover_tstep_interval", P::saveRecoverTstepInterval);
631 RP::get("io.number_of_restarts", P::exitAfterRestarts);
632 RP::get("io.number_of_recovers", P::recoverMaxFiles);
633 RP::get("io.vlsv_buffer_size", P::vlsvBufferSize);
634 RP::get("io.write_restart_stripe_factor", P::restartStripeFactor);
635 RP::get("io.write_system_stripe_factor", P::systemStripeFactor);
636 RP::get("io.restart_write_path", P::restartWritePath);
637 RP::get("io.recover_write_path", P::recoverWritePath);
638 RP::get("io.write_as_float", P::writeAsFloat);
639
640 // Checks for validity of io and restart parameters
641 int myRank;
642 MPI_Comm_rank(MPI_COMM_WORLD, &myRank);
643 const string prefix = string("./");
644 if (access(&(P::restartWritePath[0]), W_OK) != 0) {
645 if (myRank == MASTER_RANK) {
646 cerr << "ERROR restart write path " << P::restartWritePath << " not writeable, defaulting to local directory."
647 << endl;
648 }
649 P::restartWritePath = prefix;
650 }
651 if (access(&(P::recoverWritePath[0]), W_OK) != 0) {
652 if (myRank == MASTER_RANK) {
653 cerr << "ERROR recover write path " << P::recoverWritePath << " not writeable, defaulting to local directory."
654 << endl;
655 }
656 P::recoverWritePath = prefix;
657 }
658 if (P::recoverMaxFiles == 0) {
659 P::recoverMaxFiles = 1; // If we leave it at zero a manual DORC will divide by zero when computing the index.
660 }
661 size_t maxSize = 0;
662 maxSize = max(maxSize, P::systemWriteTimeInterval.size());
663 maxSize = max(maxSize, P::systemWriteName.size());
664 maxSize = max(maxSize, P::systemWritePath.size());
665 maxSize = max(maxSize, P::systemWriteDistributionWriteStride.size());
666 maxSize = max(maxSize, P::systemWriteDistributionWriteXlineStride.size());
667 maxSize = max(maxSize, P::systemWriteDistributionWriteYlineStride.size());
668 maxSize = max(maxSize, P::systemWriteDistributionWriteZlineStride.size());
669 if (P::systemWriteTimeInterval.size() != maxSize) {
670 if (myRank == MASTER_RANK) {
671 cerr << "ERROR io.system_write_t_interval should be defined for all file types." << endl;
672 MPI_Abort(MPI_COMM_WORLD, 1);
673 }
674 }
675 if (P::systemWriteName.size() != maxSize) {
676 if (myRank == MASTER_RANK) {
677 cerr << "ERROR io.system_write_file_name should be defined for all file types." << endl;
678 MPI_Abort(MPI_COMM_WORLD, 1);
679 }
680 }
681 if (P::systemWritePath.size() != maxSize && P::systemWritePath.size() != 0) {
682 if (myRank == MASTER_RANK) {
683 cerr << "ERROR io.system_write_path should be defined for all file types or none at all." << endl;
684 MPI_Abort(MPI_COMM_WORLD, 1);
685 }
686 }
687 if (P::systemWriteDistributionWriteStride.size() != maxSize) {
688 if (myRank == MASTER_RANK) {
689 cerr << "ERROR io.system_write_distribution_stride should be defined for all file types." << endl;
690 MPI_Abort(MPI_COMM_WORLD, 1);
691 }
692 }
693 if (P::systemWriteDistributionWriteXlineStride.size() != maxSize) {
694 if (myRank == MASTER_RANK) {
695 cerr << "ERROR io.system_write_distribution_xline_stride should be defined for all file types." << endl;
696 MPI_Abort(MPI_COMM_WORLD, 1);
697 }
698 }
699 if (P::systemWriteDistributionWriteYlineStride.size() != maxSize) {
700 if (myRank == MASTER_RANK) {
701 cerr << "ERROR io.system_write_distribution_yline_stride should be defined for all file types." << endl;
702 MPI_Abort(MPI_COMM_WORLD, 1);
703 }
704 }
705 if (P::systemWriteDistributionWriteZlineStride.size() != maxSize) {
706 if (myRank == MASTER_RANK) {
707 cerr << "ERROR io.system_write_distribution_zline_stride should be defined for all file types." << endl;
708 MPI_Abort(MPI_COMM_WORLD, 1);
709 }
710 }
712 if (myRank == MASTER_RANK) {
713 cerr << "ERROR You should set the same number of io.system_write_distribution_shell_stride "
714 << "and io.system_write_distribution_shell_radius." << endl;
715 MPI_Abort(MPI_COMM_WORLD, 1);
716 }
717 }
718 if (P::systemWriteFsGrid.size() != maxSize) {
719 if (P::systemWriteFsGrid.size() == 0) {
720 for (uint i = 0; i < maxSize; i++) {
721 P::systemWriteFsGrid.push_back(true);
722 }
723 } else {
724 if (myRank == MASTER_RANK) {
725 cerr << "ERROR io.system_write_fsgrid_variables should be defined for all file types (or none at all)." << endl;
726 MPI_Abort(MPI_COMM_WORLD, 1);
727 }
728 }
729 }
730 if (P::systemWritePath.size() == 0) {
731 for (uint i = 0; i < P::systemWriteName.size(); i++) {
732 P::systemWritePath.push_back(string("./"));
733 }
734 }
735 bool includefSaved = false;
736 for(uint i=0; i<maxSize; i++) {
741 includefSaved = true;
742 }
743 }
744 for(uint i=0; i<P::systemWriteDistributionWriteShellRadius.size(); i++) {
746 includefSaved = true;
747 }
748 }
749 for (size_t i=0;i<P::systemWriteName.size();i++) {
750 auto slashIndx=P::systemWriteName.at(i).find("/");
751 if (systemWritePath.at(i).back()!='/') {
752 systemWritePath.at(i)+='/';
753 }
754 while (slashIndx!=string::npos) {
755 P::systemWritePath.at(i)+=P::systemWriteName.at(i).substr(0,slashIndx)+"/";
756 P::systemWriteName.at(i)=P::systemWriteName.at(i).substr(slashIndx+1,P::systemWriteName.at(i).size());
757 slashIndx=P::systemWriteName.at(i).find("/");
758 }
759 }
760
761 for (uint i = 0; i < P::systemWritePath.size(); i++) {
762 if (access(&(P::systemWritePath.at(i)[0]), W_OK) != 0) {
763 if (myRank == MASTER_RANK) {
764 cerr << "ERROR " << P::systemWriteName.at(i) << " write path " << P::systemWritePath.at(i)
765 << " not writeable. Please create them and remember the correct striping if in HPC environment." << endl;
766 }
767 MPI_Abort(MPI_COMM_WORLD, 1);
768 //P::systemWritePath.at(i) = prefix;
769 }
770 }
771
772
773
774 vector<string> mpiioKeys, mpiioValues;
775 RP::get("io.system_write_mpiio_hint_key", mpiioKeys);
776 RP::get("io.system_write_mpiio_hint_value", mpiioValues);
777
778 if (mpiioKeys.size() != mpiioValues.size()) {
779 if (myRank == MASTER_RANK) {
780 cerr << "WARNING the number of io.system_write_mpiio_hint_key and io.system_write_mpiio_hint_value do not "
781 "match. Disregarding these options."
782 << endl;
783 }
784 } else {
785 for (uint i = 0; i < mpiioKeys.size(); i++) {
786 P::systemWriteHints.push_back({mpiioKeys[i], mpiioValues[i]});
787 }
788 }
789
790 mpiioKeys.clear();
791 mpiioValues.clear();
792 RP::get("io.restart_write_mpiio_hint_key", mpiioKeys);
793 RP::get("io.restart_write_mpiio_hint_value", mpiioValues);
794
795 if (mpiioKeys.size() != mpiioValues.size()) {
796 if (myRank == MASTER_RANK) {
797 cerr << "WARNING the number of io.restart_write_mpiio_hint_key and io.restart_write_mpiio_hint_value do not "
798 "match. Disregarding these options."
799 << endl;
800 }
801 } else {
802 for (uint i = 0; i < mpiioKeys.size(); i++) {
803 P::restartWriteHints.push_back({mpiioKeys[i], mpiioValues[i]});
804 }
805 }
806
807 mpiioKeys.clear();
808 mpiioValues.clear();
809 RP::get("io.restart_read_mpiio_hint_key", mpiioKeys);
810 RP::get("io.restart_read_mpiio_hint_value", mpiioValues);
811
812 if (mpiioKeys.size() != mpiioValues.size()) {
813 if (myRank == MASTER_RANK) {
814 cerr << "WARNING the number of io.restart_read_mpiio_hint_key and io.restart_read_mpiio_hint_value do not "
815 "match. Disregarding these options."
816 << endl;
817 }
818 } else {
819 for (uint i = 0; i < mpiioKeys.size(); i++) {
820 P::restartReadHints.push_back({mpiioKeys[i], mpiioValues[i]});
821 }
822 }
823
824 RP::get("propagate_field", P::propagateField);
825 RP::get("propagate_vlasov_acceleration", P::propagateVlasovAcceleration);
826 RP::get("propagate_vlasov_translation", P::propagateVlasovTranslation);
827 RP::get("dynamic_timestep", P::dynamicTimestep);
828 Real hallRho;
829 RP::get("hallMinimumRho", hallRho);
832 RP::get("restart.write_as_float", P::writeRestartAsFloat);
833 RP::get("restart.filename", P::restartFileName);
834 P::isRestart = (P::restartFileName != string(""));
835
836 // manual FsGrid decomposition should be complete with three values. If at least one is set but all are not set, abort
837 if ((RP::isSet("restart.overrideReadFsGridDecompositionX")||RP::isSet("restart.overrideReadFsGridDecompositionY")||RP::isSet("restart.overrideReadFsGridDecompositionZ")) &&
838 !(RP::isSet("restart.overrideReadFsGridDecompositionX")&&RP::isSet("restart.overrideReadFsGridDecompositionY")&&RP::isSet("restart.overrideReadFsGridDecompositionZ")) ) {
839 cerr << "ERROR all of restart.overrideReadFsGridDecompositionX,Y,Z should be defined." << endl;
840 MPI_Abort(MPI_COMM_WORLD, 1);
841 }
842 fsgrid::Task_t temp_task_t;
843 RP::get("restart.overrideReadFsGridDecompositionX", temp_task_t);
844 P::overrideReadFsGridDecomposition[0] = temp_task_t;
845 RP::get("restart.overrideReadFsGridDecompositionY", temp_task_t);
846 P::overrideReadFsGridDecomposition[1] = temp_task_t;
847 RP::get("restart.overrideReadFsGridDecompositionZ", temp_task_t);
848 P::overrideReadFsGridDecomposition[2] = temp_task_t;
849
850 RP::get("project", P::projectName);
851 if (RP::helpRequested) {
852 P::projectName = string("Magnetosphere");
853 }
854
855 /*get numerical values, let Readparameters handle the conversions*/
856 string geometryString;
857
858 RP::get("gridbuilder.x_min", P::xmin);
859 RP::get("gridbuilder.x_max", P::xmax);
860 RP::get("gridbuilder.y_min", P::ymin);
861 RP::get("gridbuilder.y_max", P::ymax);
862 RP::get("gridbuilder.z_min", P::zmin);
863 RP::get("gridbuilder.z_max", P::zmax);
864 RP::get("gridbuilder.x_length", P::xcells_ini);
865 RP::get("gridbuilder.y_length", P::ycells_ini);
866 RP::get("gridbuilder.z_length", P::zcells_ini);
867
868 RP::get("AMR.max_spatial_level", P::amrMaxSpatialRefLevel);
869 RP::get("AMR.max_allowed_spatial_level", P::amrMaxAllowedSpatialRefLevel);
870 if(P::amrMaxAllowedSpatialRefLevel < 0) { // negative (default is -1) just goes to max
871 P::amrMaxAllowedSpatialRefLevel = P::amrMaxSpatialRefLevel; // set max allowed to the same as the absolute max
872 }
874 if(myRank == MASTER_RANK) {
875 cerr << "AMR.max_allowed_spatial_level cannot be greater than AMR.max_spatial_level!\n";
876 }
877 MPI_Abort(MPI_COMM_WORLD, 1);
878 }
879 RP::get("AMR.adapt_refinement",P::adaptRefinement);
880 RP::get("AMR.refine_on_restart",P::refineOnRestart);
881 RP::get("AMR.force_refinement",P::forceRefinement);
882 RP::get("AMR.should_filter",P::shouldFilter);
883 RP::get("AMR.use_alpha1",P::useAlpha1);
884 RP::get("AMR.alpha1_refine_threshold",P::alpha1RefineThreshold);
885 RP::get("AMR.alpha1_coarsen_threshold",P::alpha1CoarsenThreshold);
888 }
890 if (myRank == MASTER_RANK) {
891 cerr << "ERROR invalid alpha_1 refine threshold" << endl;
892 }
893 MPI_Abort(MPI_COMM_WORLD, 1);
894 }
895
896 RP::get("AMR.use_alpha2",P::useAlpha2);
897 RP::get("AMR.alpha2_refine_threshold",P::alpha2RefineThreshold);
898 RP::get("AMR.alpha2_coarsen_threshold",P::alpha2CoarsenThreshold);
901 }
903 if (myRank == MASTER_RANK) {
904 cerr << "ERROR invalid alpha_2 refine threshold" << endl;
905 }
906 MPI_Abort(MPI_COMM_WORLD, 1);
907 }
908
909 RP::get("AMR.use_vorticity",P::useVorticity);
910 RP::get("AMR.vorticity_refine_threshold",P::vorticityRefineThreshold);
911 RP::get("AMR.vorticity_coarsen_threshold",P::vorticityCoarsenThreshold);
914 }
916 if (myRank == MASTER_RANK) {
917 cerr << "ERROR invalid vorticity refine threshold" << endl;
918 }
919 MPI_Abort(MPI_COMM_WORLD, 1);
920 }
921
922 RP::get("AMR.use_anisotropy",P::useAnisotropy);
923 RP::get("AMR.anisotropy_refine_threshold", P::anisotropyRefineThreshold);
924 RP::get("AMR.anisotropy_coarsen_threshold", P::anisotropyCoarsenThreshold);
925 RP::get("AMR.anisotropy_max_reflevel", P::anisotropyMaxReflevel);
928 }
930 if (myRank == MASTER_RANK) {
931 cerr << "ERROR invalid anisotropy refine threshold" << endl;
932 }
933 MPI_Abort(MPI_COMM_WORLD, 1);
934 }
935
936 RP::get("AMR.refine_cadence",P::refineCadence);
937 RP::get("AMR.refine_after",P::refineAfter);
938 RP::get("AMR.refine_radius",P::refineRadius);
939 RP::get("AMR.number_of_refine_boxes", P::refineBoxNumber);
940 RP::get("AMR.refinement_min_x", P::refinementMinX);
941 RP::get("AMR.refinement_min_y", P::refinementMinY);
942 RP::get("AMR.refinement_min_z", P::refinementMinZ);
943 RP::get("AMR.refinement_max_x", P::refinementMaxX);
944 RP::get("AMR.refinement_max_y", P::refinementMaxY);
945 RP::get("AMR.refinement_max_z", P::refinementMaxZ);
946 RP::get("AMR.alpha1_drho_weight", P::alphaDRhoWeight);
947 RP::get("AMR.alpha1_du_weight", P::alphaDUWeight);
948 RP::get("AMR.alpha1_dpsq_weight", P::alphaDPSqWeight);
949 RP::get("AMR.alpha1_dbsq_weight", P::alphaDBSqWeight);
950 RP::get("AMR.alpha1_db_weight", P::alphaDBWeight);
951 RP::get("AMR.number_of_boxes", P::amrBoxNumber);
952 RP::get("AMR.box_max_level", P::amrBoxMaxLevel);
953 RP::get("AMR.box_half_width_x", P::amrBoxHalfWidthX);
954 RP::get("AMR.box_half_width_y", P::amrBoxHalfWidthY);
955 RP::get("AMR.box_half_width_z", P::amrBoxHalfWidthZ);
956 RP::get("AMR.box_center_x", P::amrBoxCenterX);
957 RP::get("AMR.box_center_y", P::amrBoxCenterY);
958 RP::get("AMR.box_center_z", P::amrBoxCenterZ);
959 RP::get("AMR.transShortPencils", P::amrTransShortPencils);
960 RP::get("AMR.filterpasses", P::blurPassString);
961 RP::get("adaptGPUWID", P::adaptGPUWID);
962 RP::get("GPUallocations", P::GPUallocations);
963
964 //Asterix
965 RP::get("Asterix.mlp_layers", P::mlpLayer);
966 RP::get("Asterix.max_epochs",P::mlp_max_epochs );
967 RP::get("Asterix.tol", P::mlp_tollerance);
968 RP::get("Asterix.octree_tolerance", P::octree_tolerance);
969 RP::get("Asterix.fourier_order",P::mlp_fourier_order );
970 RP::get("Asterix.interval",P::compression_interval);
971 RP::get("Asterix.state",P::doCompress);
972 RP::get("Asterix.method",P::method_str);
973 RP::get("Asterix.max_vdfs_per_nn",P::max_vdfs_per_nn);
974
975 if (P::doCompress){
976 #ifdef ASTERIX_MLP
977 if(P::method_str == "MLP") {
979 P::doCompress=true;
980 }
981 if(P::method_str == "MLP_MULTI") {
983 P::doCompress=true;
984 }
985 #endif
986 #ifdef ASTERIX_ZFP
987 if (P::method_str == "ZFP") {
989 P::doCompress=true;
990 }
991 #endif
992 #ifdef ASTERIX_OCTREE
993 if (P::method_str == "OCTREE") {
995 P::doCompress=true;
996 }
997 #endif
998 }else{
1000 P::doCompress=false;
1001 }
1002
1005 if (myRank==MASTER_RANK){
1006 std::cout<<"State= "<<doCompress<<std::endl;
1007 std::cout<<"Method "<<P::vdf_compression_method<<std::endl;
1008 std::cerr << "Your ASTERIX setting do not make sense! You need to either disable compression or select an "
1009 "appropriate comrpession method!"
1010 << std::endl;
1011 }
1012 MPI_Barrier(MPI_COMM_WORLD);
1013 MPI_Abort(MPI_COMM_WORLD,-1);
1014 }
1015
1016 //Parse MLP Layer string
1017 auto parseToSize_T = [](const std::string& str) -> std::vector<size_t> {
1018 std::vector<std::size_t> result;
1019 std::string clean_str;
1020 std::copy_if(str.begin(), str.end(), std::back_inserter(clean_str), [](unsigned char c) {
1021 return !std::isspace(c);
1022 });
1023
1024 std::stringstream ss(clean_str);
1025 std::string token;
1026 while (std::getline(ss, token, ',')) {
1027 result.push_back(std::stoull(token)); // Convert each token to size_t
1028 }
1029 return result;
1030 };
1031 P::mlp_arch=parseToSize_T(P::mlpLayer);
1032
1033 // We need the correct number of parameters for the AMR boxes
1034 if( P::amrBoxNumber != (int)P::amrBoxHalfWidthX.size()
1035 || P::amrBoxNumber != (int)P::amrBoxHalfWidthY.size()
1036 || P::amrBoxNumber != (int)P::amrBoxHalfWidthZ.size()
1037 || P::amrBoxNumber != (int)P::amrBoxCenterX.size()
1038 || P::amrBoxNumber != (int)P::amrBoxCenterY.size()
1039 || P::amrBoxNumber != (int)P::amrBoxCenterZ.size()
1040 || P::amrBoxNumber != (int)P::amrBoxMaxLevel.size()
1041 ) {
1042 cerr << "AMR.number_of_boxes is set to " << P::amrBoxNumber << " so the same number of values is required for AMR.box_half_width_[xyz] and AMR.box_center_[xyz]." << endl;
1043 MPI_Abort(MPI_COMM_WORLD, 1);
1044 }
1045
1046 // We need the correct number of parameters for the allowed refinement boxes
1047 if( P::refineBoxNumber != (int)P::refinementMinX.size()
1048 || P::refineBoxNumber != (int)P::refinementMinY.size()
1049 || P::refineBoxNumber != (int)P::refinementMinZ.size()
1050 || P::refineBoxNumber != (int)P::refinementMaxX.size()
1051 || P::refineBoxNumber != (int)P::refinementMaxY.size()
1052 || P::refineBoxNumber != (int)P::refinementMaxZ.size()
1053 ) {
1054 cerr << "AMR.number_of_refine_boxes is set to " << P::refineBoxNumber << " so the same number of values is required for AMR.refinementMin[XYZ] and AMR.refinementMax[XYZ]." << endl;
1055 MPI_Abort(MPI_COMM_WORLD, 1);
1056 }
1057
1058 // If we are in an AMR run we need to set up the filtering scheme.
1060 bool isEmpty = blurPassString.size() == 0;
1061 if (!isEmpty){
1062 //sanity check=> user should define a pass for every level
1063 if ((int)blurPassString.size() != P::amrMaxSpatialRefLevel + 1) {
1064 cerr << "Filter Passes=" << blurPassString.size() << "\t" << "AMR Levels=" << P::amrMaxSpatialRefLevel + 1 << endl;
1065 cerr << "FilterPasses do not match AMR levels. \t" << " in " << __FILE__ << ":" << __LINE__ << endl;
1066 MPI_Abort(MPI_COMM_WORLD, 1);
1067 }
1068 //sort the filtering passes per refLevel
1069 numPasses.clear();
1070 //Parse to a vector of ints
1071 for (auto pass : blurPassString){
1072 P::numPasses.push_back(stoi(pass));
1073 }
1074 sort(numPasses.begin(),numPasses.end(),greater<int>());
1075 }else{
1076 //here we will default to manually constructing the number of passes
1077 numPasses.clear();
1078 auto g_sequence=[](int size){
1079 int retval=1;
1080 while(size!=0){
1081 retval*=2;
1082 size-=1;
1083 }
1084 return retval;
1085 };
1086 int maxPasses=g_sequence(P::amrMaxSpatialRefLevel-1);
1087 for (int refLevel=0; refLevel<=P::amrMaxSpatialRefLevel; refLevel++){
1088 numPasses.push_back(maxPasses);
1089 maxPasses/=2;
1090 }
1091 //Overwrite passes for the highest refLevel. We do not want to filter there.
1093 }
1095 }
1096
1097 if (P::xmax < P::xmin || (P::ymax < P::ymin || P::zmax < P::zmin)) {
1098 cerr << "Box domain error!" << endl;
1099 MPI_Abort(MPI_COMM_WORLD, 1);
1100 }
1101
1102 // Set some parameter values.
1106
1107 RP::get("gridbuilder.dt", P::dt);
1108
1109 RP::get("gridbuilder.t_max", P::t_max);
1110 RP::get("gridbuilder.timestep_max", P::tstep_max);
1111
1112 RP::get("gridbuilder.dt_ceil", P::dt_ceil);
1113
1115 P::dt = 0.0; // if dynamic timestep then first dt is always 0
1116
1117 // if we are restarting, t,t_min, tstep, tstep_min will be overwritten in readGrid
1118 P::t_min = 0;
1119 P::t = P::t_min;
1120 P::tstep_min = 0;
1122
1123 // Get field solver parameters
1124 RP::get("fieldsolver.maxWaveVelocity", P::maxWaveVelocity);
1125 RP::get("fieldsolver.maxSubcycles", P::maxFieldSolverSubcycles);
1126 RP::get("fieldsolver.resistivity", P::resistivity);
1127 RP::get("fieldsolver.diffusiveEterms", P::fieldSolverDiffusiveEterms);
1128 RP::get("fieldsolver.finiteDifferencingAtBoundaries",P::fieldSolverFiniteDifferencingAtBoundaries);
1129 RP::get("fieldsolver.ohmHallTerm", P::ohmHallTerm);
1130 RP::get("fieldsolver.ohmGradPeTerm", P::ohmGradPeTerm); // Which order solver to use for fieldsolver eGradPe term (supported: 0 for off, 1 for first-order)
1131 RP::get("fieldsolver.electronTemperature", P::electronTemperature); // Electron temperature associated with anchor point, e.g. incoming solar wind
1132 RP::get("fieldsolver.electronDensity", P::electronDensity); // Electron density associated with anchor point, e.g. incoming solar wind
1133 RP::get("fieldsolver.electronPTindex", P::electronPTindex); // Polytropic index for solving electron equation of state to use in eGradPe term
1134 RP::get("fieldsolver.maxCFL", P::fieldSolverMaxCFL);
1135 RP::get("fieldsolver.minCFL", P::fieldSolverMinCFL);
1136
1137 // manual FsGrid decomposition should be complete with three values. If at least one is set but all are not set, abort
1138 if ((RP::isSet("fieldsolver.manualFsGridDecompositionX")||RP::isSet("fieldsolver.manualFsGridDecompositionY")||RP::isSet("fieldsolver.manualFsGridDecompositionZ")) &&
1139 !(RP::isSet("fieldsolver.manualFsGridDecompositionX")&&RP::isSet("fieldsolver.manualFsGridDecompositionY")&&RP::isSet("fieldsolver.manualFsGridDecompositionZ")) ) {
1140 cerr << "ERROR all of fieldsolver.manualFsGridDecompositionX,Y,Z should be defined." << endl;
1141 MPI_Abort(MPI_COMM_WORLD, 1);
1142 }
1143 RP::get("fieldsolver.manualFsGridDecompositionX", temp_task_t);
1144 P::manualFsGridDecomposition[0] = temp_task_t;
1145 RP::get("fieldsolver.manualFsGridDecompositionY", temp_task_t);
1146 P::manualFsGridDecomposition[1] = temp_task_t;
1147 RP::get("fieldsolver.manualFsGridDecompositionZ", temp_task_t);
1148 P::manualFsGridDecomposition[2] = temp_task_t;
1149
1150
1151
1152 // Get Vlasov solver parameters
1153 RP::get("vlasovsolver.maxSlAccelerationRotation", P::maxSlAccelerationRotation);
1154 RP::get("vlasovsolver.maxSlAccelerationSubcycles", P::maxSlAccelerationSubcycles);
1155 RP::get("vlasovsolver.maxCFL", P::vlasovSolverMaxCFL);
1156 RP::get("vlasovsolver.minCFL", P::vlasovSolverMinCFL);
1157 RP::get("vlasovsolver.GhostTranslate",P::vlasovSolverGhostTranslate);
1158 RP::get("vlasovsolver.GhostTranslateExtent",P::vlasovSolverGhostTranslateExtent);
1159 RP::get("vlasovsolver.accelerateMaxwellianBoundaries", P::vlasovAccelerateMaxwellianBoundaries);
1161 if (myRank == MASTER_RANK) {
1162 logFile<<"Performing spatial translation using ghost cell information with coalesced MPI updates."<<endl;
1163 }
1165 P::vlasovSolverGhostTranslateExtent = VLASOV_STENCIL_WIDTH+1;
1166 } else {
1167 if (P::vlasovSolverGhostTranslateExtent == VLASOV_STENCIL_WIDTH+1) {
1168 if (myRank == MASTER_RANK) {
1169 logFile<<"Ghost translating full stencil of size "<<P::vlasovSolverGhostTranslateExtent<<" around local domain."<<endl;
1170 }
1171 } else if (P::vlasovSolverGhostTranslateExtent > VLASOV_STENCIL_WIDTH+1) {
1172 P::vlasovSolverGhostTranslateExtent = VLASOV_STENCIL_WIDTH+1;
1173 if (myRank == MASTER_RANK) {
1174 logFile<<"Capping ghost translation stencil size to VLASOV_STENCIL_WIDTH+1 around local domain."<<endl;
1175 }
1176 } else {
1177 if (myRank == MASTER_RANK) {
1178 logFile<<"Ghost translating reduced stencil of size "<<P::vlasovSolverGhostTranslateExtent<<" around local domain."<<endl;
1179 }
1180 }
1181 }
1182 }
1183 // Get load balance parameters
1184 RP::get("loadBalance.algorithm", P::loadBalanceAlgorithm);
1185 loadBalanceOptions["IMBALANCE_TOL"] = "";
1186 RP::get("loadBalance.tolerance", loadBalanceOptions["IMBALANCE_TOL"]);
1187 RP::get("loadBalance.rebalanceInterval", P::rebalanceInterval);
1188
1189 std::vector<std::string> loadBalanceKeys;
1190 std::vector<std::string> loadBalanceValues;
1191 RP::get("loadBalance.optionKey", loadBalanceKeys);
1192 RP::get("loadBalance.optionValue", loadBalanceValues);
1193 if (loadBalanceKeys.size() != loadBalanceValues.size()) {
1194 if (myRank == MASTER_RANK) {
1195 cerr << "WARNING the number of load balance keys and values do not match. Disregarding these options." << endl;
1196 }
1197 } else {
1198 for (size_t i = 0; i < loadBalanceKeys.size(); ++i) {
1199 loadBalanceOptions[loadBalanceKeys[i]] = loadBalanceValues[i];
1200 }
1201 }
1202
1203 // Get output variable parameters
1204 RP::get("variables.output", P::outputVariableList);
1205 RP::get("variables.diagnostic", P::diagnosticVariableList);
1206
1207 // Insert vg_f_saved to the list if necessary
1208 if(includefSaved) {
1209 P::outputVariableList.push_back("vg_f_saved");
1210 }
1211
1212 //If we need to compress files force the sparsity in the VLSV files
1213 const bool force_sparsity_in_output =
1215 if (force_sparsity_in_output) {
1216 P::outputVariableList.emplace_back("populations_minvalue");
1217 P::outputVariableList.emplace_back("populations_EffectiveSparsityThreshold");
1218 }
1219
1220 // Filter duplicate variable names
1222 P::outputVariableList.clear();
1223 P::outputVariableList.insert(P::outputVariableList.end(), dummy.begin(), dummy.end());
1224 dummy.clear();
1225
1226 dummy.insert(P::diagnosticVariableList.begin(), P::diagnosticVariableList.end());
1228 P::diagnosticVariableList.insert(P::diagnosticVariableList.end(), dummy.begin(), dummy.end());
1229
1230 // Get parameters related to bailout
1231 RP::get("bailout.write_restart", P::bailout_write_restart);
1232 RP::get("bailout.min_dt", P::bailout_min_dt);
1233 RP::get("bailout.max_memory", P::bailout_max_memory);
1234 RP::get("bailout.velocity_space_wall_block_margin", P::bailout_velocity_space_wall_margin);
1236 std::cerr << "bailout.velocity_space_wall_block_margin is larger than 0.5 * MAX_BLOCKS_PER_DIM, aborting." << std::endl;
1237 abort();
1238 }
1239
1240 for (size_t s = 0; s < P::systemWriteName.size(); ++s) {
1241 P::systemWrites.push_back(0);
1242 }
1243
1244 RP::get("PAD.enable", P::artificialPADiff);
1245 RP::get("PAD.coefficient", P::PADcoefficient);
1246 RP::get("PAD.CFL",P::PADCFL);
1247 RP::get("PAD.vbins",P::PADvbins);
1248 RP::get("PAD.mubins",P::PADmubins);
1249 RP::get("PAD.file",P::PADnu0);
1250 RP::get("PAD.fudge",P::PADfudge);
1251
1252 RP::get("fieldtracing.fieldLineTracer", tracerString);
1253 RP::get("fieldtracing.tracer_max_allowed_error", FieldTracing::fieldTracingParameters.max_allowed_error);
1254 RP::get("fieldtracing.tracer_max_attempts", FieldTracing::fieldTracingParameters.max_field_tracer_attempts);
1255 RP::get("fieldtracing.tracer_min_dx", FieldTracing::fieldTracingParameters.min_tracer_dx_full_box);
1256 RP::get("fieldtracing.fullbox_max_incomplete_cells", FieldTracing::fieldTracingParameters.fullbox_max_incomplete_cells);
1257 RP::get("fieldtracing.fluxrope_max_incomplete_cells", FieldTracing::fieldTracingParameters.fluxrope_max_incomplete_cells);
1258 RP::get("fieldtracing.fullbox_and_fluxrope_max_absolute_distance_to_trace", FieldTracing::fieldTracingParameters.fullbox_and_fluxrope_max_distance);
1259 RP::get("fieldtracing.use_reconstruction_cache", FieldTracing::fieldTracingParameters.useCache);
1260 RP::get("fieldtracing.fluxrope_max_curvature_radii_to_trace", FieldTracing::fieldTracingParameters.fluxrope_max_curvature_radii_to_trace);
1261 RP::get("fieldtracing.fluxrope_max_curvature_radii_extent", FieldTracing::fieldTracingParameters.fluxrope_max_curvature_radii_extent);
1262 RP::get("fieldtracing.min_allowed_x", FieldTracing::fieldTracingParameters.x_min);
1263 RP::get("fieldtracing.min_allowed_y", FieldTracing::fieldTracingParameters.y_min);
1264 RP::get("fieldtracing.min_allowed_z", FieldTracing::fieldTracingParameters.z_min);
1265 RP::get("fieldtracing.max_allowed_x", FieldTracing::fieldTracingParameters.x_max);
1266 RP::get("fieldtracing.max_allowed_y", FieldTracing::fieldTracingParameters.y_max);
1267 RP::get("fieldtracing.max_allowed_z", FieldTracing::fieldTracingParameters.z_max);
1274
1275 if(tracerString == "Euler") {
1277 } else if (tracerString == "ADPT_Euler") {
1279 } else if (tracerString == "BS") {
1281 } else if (tracerString == "DP") {
1283 } else {
1284 cerr << __FILE__ << ":" << __LINE__ << " ERROR: Unknown value for fieldtracing.fieldLineTracer: " << tracerString << endl;
1285 abort();
1286 }
1287}
1288
1289
for i
Definition Dispersion.m:24
set(gca, 'YDir', 'normal')
Constants c
Definition Dispersion.m:45
#define MASTER_RANK
Definition common.h:67
#define MAX_BLOCKS_PER_DIM
Definition common.h:73
#define str(s)
Parameters P
float Real
Definition definitions.h:41
float Realf
Definition definitions.h:33
int myRank
Definition gpu_base.cpp:48
Logger logFile
Definition main.cpp:25
FieldTracingParameters fieldTracingParameters
const Real CHARGE
Definition common.h:572
const Real MASS_PROTON
Definition common.h:574
std::string tracerString
#define NAN
const Real LARGE_REAL
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
static ARCH_HOSTDEV VecSimple< T > min(VecSimple< T > const &l, VecSimple< T > const &r)
static ARCH_HOSTDEV VecSimple< T > max(VecSimple< T > const &l, VecSimple< T > const &r)