Skip to content

Commit 63d7cd4

Browse files
committed
FEAT: restart for both grid types, output velocity
1 parent 2386f1b commit 63d7cd4

File tree

2 files changed

+19
-3
lines changed

2 files changed

+19
-3
lines changed

include/neutrals.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -470,7 +470,7 @@ class Neutrals {
470470
\param dir directory to write restart files
471471
\param DoRead read the restart files if true, write if false
472472
**/
473-
bool restart_file(std::string dir, bool DoRead);
473+
bool restart_file(std::string dir, std::string cGridtype, bool DoRead);
474474

475475
/**********************************************************************
476476
\brief Exchange messages between processors

src/neutrals.cpp

Lines changed: 18 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -422,7 +422,7 @@ int Neutrals::get_species_id(std::string name) {
422422
// Read/Write restart files for the neutrals
423423
//----------------------------------------------------------------------
424424

425-
bool Neutrals::restart_file(std::string dir, bool DoRead) {
425+
bool Neutrals::restart_file(std::string dir, std::string cGridtype, bool DoRead) {
426426

427427
std::string filename;
428428
bool DidWork = true;
@@ -431,7 +431,7 @@ bool Neutrals::restart_file(std::string dir, bool DoRead) {
431431

432432
OutputContainer RestartContainer;
433433
RestartContainer.set_directory(dir);
434-
RestartContainer.set_filename("neutrals_" + cMember + "_" + cGrid);
434+
RestartContainer.set_filename("neutrals_" + cMember + "_" + cGrid + "_" + cGridtype);
435435

436436
try {
437437
if (DoRead)
@@ -451,6 +451,22 @@ bool Neutrals::restart_file(std::string dir, bool DoRead) {
451451
RestartContainer.store_variable(cName,
452452
density_unit,
453453
species[iSpecies].density_scgc);
454+
455+
// ----------------------------
456+
// Velocity (per neutral)
457+
// ----------------------------
458+
for (int iDir = 0; iDir < 3; iDir++) {
459+
cName = velocity_name[iDir] + " (" + species[iSpecies].cName + ")";
460+
461+
if (DoRead)
462+
species[iSpecies].velocity_vcgc[iDir] =
463+
RestartContainer.get_element_value(cName);
464+
else
465+
RestartContainer.store_variable(cName,
466+
velocity_unit,
467+
species[iSpecies].
468+
velocity_vcgc[iDir]);
469+
}
454470
}
455471

456472
cName = temperature_name;

0 commit comments

Comments
 (0)