Skip to content

Commit 2386f1b

Browse files
committed
FEAT: restart for both grid types
1 parent 9965aad commit 2386f1b

File tree

2 files changed

+4
-6
lines changed

2 files changed

+4
-6
lines changed

include/ions.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -368,7 +368,7 @@ class Ions {
368368
\param dir the directory to read or write from/to
369369
\param DoRead whether to read (true) or write (false)
370370
**/
371-
bool restart_file(std::string dir, bool DoRead);
371+
bool restart_file(std::string dir, std::string cGridtype, bool DoRead);
372372

373373
/**********************************************************************
374374
\brief Exchange messages between processors

src/ions.cpp

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -127,8 +127,6 @@ Ions::Ions(Grid grid, Planets planet) {
127127
heating_sources_total.set_size(nLons, nLats, nAlts);
128128
heating_sources_total.zeros();
129129

130-
131-
132130
for (int iDir = 0; iDir < 3; iDir++) {
133131
velocity_vcgc[iDir].zeros();
134132
cMax_vcgc[iDir].ones();
@@ -167,7 +165,7 @@ Ions::Ions(Grid grid, Planets planet) {
167165

168166
if (input.get_do_restart()) {
169167
report.print(1, "Restarting! Reading ion files!");
170-
bool DidWork = restart_file(input.get_restartin_dir(), DoRead);
168+
bool DidWork = restart_file(input.get_restartin_dir(), grid.get_gridtype(), DoRead);
171169

172170
if (!DidWork)
173171
std::cout << "Reading Restart for Ions Failed!!!\n";
@@ -521,15 +519,15 @@ int Ions::get_species_id(std::string name) {
521519
// Read/Write restart files for the ions
522520
//----------------------------------------------------------------------
523521

524-
bool Ions::restart_file(std::string dir, bool DoRead) {
522+
bool Ions::restart_file(std::string dir, std::string cGridtype, bool DoRead) {
525523

526524
std::string filename;
527525
bool DidWork = true;
528526
int64_t iVar;
529527

530528
OutputContainer RestartContainer;
531529
RestartContainer.set_directory(dir);
532-
RestartContainer.set_filename("ions_" + cMember + "_" + cGrid);
530+
RestartContainer.set_filename("ions_" + cMember + "_" + cGrid + "_" + cGridtype);
533531

534532
try {
535533
if (DoRead)

0 commit comments

Comments
 (0)