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 "perturbed_B_field.hpp"
13 #include "increase_ptl_tor.hpp"
14 
15 enum class RestartOption{
16  Final,
17  NotFinal
18 };
19 
20 // These are initialized in xgc.cpp but accessed via ADIOS2 lookup.
25 
28 
31 
32  public:
33 
35  int run_count;
36 
37  CheckpointFiles(NLReader::NamelistReader& nlr, bool f0_grid, bool em){
38  run_count = 1;
39  nlr.use_namelist("sml_param");
40  restart_write_period = nlr.get<int>("sml_restart_write_period",10000000);
41 
42  increase_ptl_tor_on = nlr.get<bool>("sml_increase_ptl_tor", false);
43  if(increase_ptl_tor_on) increase_ptl_tor_settings = IncreasePtlTorSettings(nlr);
44 
45  nlr.use_namelist("adios_param");
46  adios_stage_restart = nlr.get<bool>("adios_stage_restart",false);
47  adios_stage_restart_f0 = nlr.get<bool>("adios_stage_restartf0",false);
48 
49 
50  // Initialize and open streams
51  stream.Init("restart");
52  if(f0_grid){
53  f0_stream.Init("restartf0");
54  }
55  if(em){
56  mvr_stream.Init("restart_mvr");
57  }
58  }
59 
61 
62  void write(const Simulation<DeviceType>& sml,
63  const Grid<DeviceType>& grid,
65  ElectricField<DeviceType>& electric_field,
66  Plasma& plasma,
67  const Sheath<DeviceType>& sheath,
68  const PerturbedBField<DeviceType>& perturbed_B_field,
69  const VelocityGrid& vgrid,
71  DMWrapper& pseudo_inv_dm,
72  Diagnostics& diagnostics,
73  RestartOption restart_option=RestartOption::NotFinal);
74 
75  void read(Simulation<DeviceType>& sml,
76  Plasma& plasma,
77  ElectricField<DeviceType>& electric_field,
78  Sheath<DeviceType>& sheath,
79  PerturbedBField<DeviceType>& perturbed_B_field,
81  const Grid<DeviceType>& grid,
83  const VelocityGrid& vgrid);
84 
85 };
86 
87 #endif
Definition: perturbed_B_field.hpp:11
void read(Simulation< DeviceType > &sml, Plasma &plasma, ElectricField< DeviceType > &electric_field, Sheath< DeviceType > &sheath, PerturbedBField< DeviceType > &perturbed_B_field, DomainDecomposition< DeviceType > &pol_decomp, const Grid< DeviceType > &grid, const MagneticField< DeviceType > &magnetic_field, const VelocityGrid &vgrid)
Definition: checkpoint_files.cpp:592
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:13
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:1238
Definition: NamelistReader.hpp:193
Definition: DM_wrapper.hpp:38
Definition: magnetic_field.hpp:12
XGC_IO_Stream f0_stream
Definition: checkpoint_files.hpp:23
bool do_restart(NLReader::NamelistReader &nlr)
Definition: checkpoint_files.cpp:742
Definition: electric_field.hpp:37
bool increase_ptl_tor_on
Definition: checkpoint_files.hpp:29
bool adios_stage_restart_f0
Enable/disable Adios stage mode for xgc.restartf0.
Definition: checkpoint_files.hpp:27
void use_namelist(const string &namelist)
Definition: NamelistReader.hpp:355
XGC_IO_Stream mvr_stream
Definition: checkpoint_files.hpp:24
bool adios_stage_restart
Enable/disable Adios stage mode for xgc.restart.
Definition: checkpoint_files.hpp:26
XGC_IO_Stream stream
Definition: checkpoint_files.hpp:22
IncreasePtlTorSettings increase_ptl_tor_settings
Definition: checkpoint_files.hpp:30
Definition: xgc_io.hpp:19
Definition: magnetic_field.F90:1
int run_count
How many times the simulation has been restarted.
Definition: checkpoint_files.hpp:35
Definition: plasma.hpp:14
Definition: checkpoint_files.hpp:21
Definition: sheath.hpp:42
void Init(const std::string &IOName)
Definition: xgc_io.hpp:24
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 PerturbedBField< DeviceType > &perturbed_B_field, const VelocityGrid &vgrid, DomainDecomposition< DeviceType > &pol_decomp, DMWrapper &pseudo_inv_dm, Diagnostics &diagnostics, RestartOption restart_option=RestartOption::NotFinal)
Definition: checkpoint_files.cpp:481
RestartOption
Definition: checkpoint_files.hpp:15
CheckpointFiles(NLReader::NamelistReader &nlr, bool f0_grid, bool em)
Definition: checkpoint_files.hpp:37
Definition: increase_ptl_tor.hpp:7
int restart_write_period
How many steps between restart writes.
Definition: checkpoint_files.hpp:34