XGCa
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
checkpoint_files.hpp
Go to the documentation of this file.
1 #ifndef CHECKPOINT_FILES_HPP
2 #define CHECKPOINT_FILES_HPP
3 
4 #include "sml.hpp"
5 #include "plasma.hpp"
6 #include "electric_field.hpp"
7 #include "grid.hpp"
9 #include "DM_wrapper.hpp"
10 #include "diagnostics.hpp"
11 #include "sheath.hpp"
12 #include "charge.hpp"
13 #include "perturbed_B_field.hpp"
14 #include "increase_ptl_tor.hpp"
15 
16 enum class RestartOption{
17  Final,
18  NotFinal
19 };
20 
21 // These are initialized in xgc.cpp but accessed via ADIOS2 lookup.
24 
27 
30 
31  public:
32 
34  int run_count;
35 
37  run_count = 1;
38  nlr.use_namelist("sml_param");
39  restart_write_period = nlr.get<int>("sml_restart_write_period",10000000);
40 
41  increase_ptl_tor_on = nlr.get<bool>("sml_increase_ptl_tor", false);
42  if(increase_ptl_tor_on) increase_ptl_tor_settings = IncreasePtlTorSettings(nlr);
43 
44  nlr.use_namelist("adios_param");
45  adios_stage_restart = nlr.get<bool>("adios_stage_restart",false);
46  adios_stage_restart_f0 = nlr.get<bool>("adios_stage_restartf0",false);
47 
48 
49  // Initialize and open streams
50  stream.Init("restart");
51  }
52 
54 
55  bool write_restart_now(int gstep);
56 
57  void write(const Simulation<DeviceType>& sml,
58  const Grid<DeviceType>& grid,
60  ElectricField<DeviceType>& electric_field,
61  Plasma& plasma,
62  const Sheath<DeviceType>& sheath,
63  const Charges& charges,
64  const PerturbedBField<DeviceType>& perturbed_B_field,
65  const VelocityGrid& vgrid,
66  const Neutrals<DeviceType>& neutrals,
68  DMWrapper& pseudo_inv_dm,
69  Diagnostics& diagnostics,
70  RestartOption restart_option=RestartOption::NotFinal);
71 
72  void read(Simulation<DeviceType>& sml,
73  Plasma& plasma,
74  ElectricField<DeviceType>& electric_field,
75  Sheath<DeviceType>& sheath,
76  Charges& charges,
77  PerturbedBField<DeviceType>& perturbed_B_field,
79  const Grid<DeviceType>& grid,
81  const VelocityGrid& vgrid,
82  Neutrals<DeviceType>& neutrals);
83 
84 };
85 
86 #endif
Definition: charge.hpp:66
Definition: perturbed_B_field.hpp:12
void read(Simulation< DeviceType > &sml, Plasma &plasma, ElectricField< DeviceType > &electric_field, Sheath< DeviceType > &sheath, Charges &charges, PerturbedBField< DeviceType > &perturbed_B_field, DomainDecomposition< DeviceType > &pol_decomp, const Grid< DeviceType > &grid, const MagneticField< DeviceType > &magnetic_field, const VelocityGrid &vgrid, Neutrals< DeviceType > &neutrals)
Definition: checkpoint_files.cpp:503
T get(const string &param, const T default_val, int val_ind=0)
Definition: NamelistReader.hpp:373
Definition: velocity_grid.hpp:8
Definition: diagnostics.hpp:18
Definition: sml.hpp:8
subroutine plasma(grid, itr, p, dene_out, deni_out, Te_out, Ti_out, Vparai_out)
Calculate the plasma density, temperature, and parallel velocity for a point in triangle itr using pl...
Definition: neutral_totalf.F90:1224
void write(const Simulation< DeviceType > &sml, const Grid< DeviceType > &grid, const MagneticField< DeviceType > &magnetic_field, ElectricField< DeviceType > &electric_field, Plasma &plasma, const Sheath< DeviceType > &sheath, const Charges &charges, const PerturbedBField< DeviceType > &perturbed_B_field, const VelocityGrid &vgrid, const Neutrals< DeviceType > &neutrals, DomainDecomposition< DeviceType > &pol_decomp, DMWrapper &pseudo_inv_dm, Diagnostics &diagnostics, RestartOption restart_option=RestartOption::NotFinal)
Definition: checkpoint_files.cpp:390
Definition: NamelistReader.hpp:193
Definition: DM_wrapper.hpp:38
Definition: magnetic_field.hpp:12
bool do_restart(NLReader::NamelistReader &nlr)
Definition: checkpoint_files.cpp:662
Definition: electric_field.hpp:42
bool write_restart_now(int gstep)
Definition: checkpoint_files.cpp:679
bool increase_ptl_tor_on
Definition: checkpoint_files.hpp:28
bool adios_stage_restart_f0
Enable/disable Adios stage mode for xgc.restartf0.
Definition: checkpoint_files.hpp:26
void use_namelist(const string &namelist)
Definition: NamelistReader.hpp:355
Definition: neutrals.hpp:9
bool adios_stage_restart
Enable/disable Adios stage mode for xgc.restart.
Definition: checkpoint_files.hpp:25
XGC_IO_Stream stream
Definition: checkpoint_files.hpp:23
IncreasePtlTorSettings increase_ptl_tor_settings
Definition: checkpoint_files.hpp:29
Definition: xgc_io.hpp:24
Definition: magnetic_field.F90:1
int run_count
How many times the simulation has been restarted.
Definition: checkpoint_files.hpp:34
Definition: plasma.hpp:13
Definition: checkpoint_files.hpp:22
Definition: sheath.hpp:49
void Init(const std::string &IOName)
Definition: xgc_io.hpp:29
CheckpointFiles(NLReader::NamelistReader &nlr)
Definition: checkpoint_files.hpp:36
RestartOption
Definition: checkpoint_files.hpp:16
Definition: increase_ptl_tor.hpp:7
int restart_write_period
How many steps between restart writes.
Definition: checkpoint_files.hpp:33