Skip to content

Commit 8fa70cc

Browse files
authored
Merge pull request #6774 from bangerth/serialize-viz-pp
Serialize the visualization postprocessors.
2 parents f6d314e + 804584a commit 8fa70cc

File tree

1 file changed

+15
-4
lines changed

1 file changed

+15
-4
lines changed

source/postprocess/visualization.cc

Lines changed: 15 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1468,6 +1468,13 @@ namespace aspect
14681468
void
14691469
Visualization<dim>::save (std::map<std::string, std::string> &status_strings) const
14701470
{
1471+
// First let all the visualization postprocessors save their data in a
1472+
// map that we can then serialize:
1473+
std::map<std::string,std::string> saved_postprocessors;
1474+
for (const auto &p : postprocessors)
1475+
p->save (saved_postprocessors);
1476+
1477+
14711478
// Serialize into a stringstream. Put the following into a code
14721479
// block of its own to ensure the destruction of the 'oa'
14731480
// archive triggers a flush() on the stringstream so we can
@@ -1476,11 +1483,10 @@ namespace aspect
14761483
{
14771484
aspect::oarchive oa (os);
14781485
oa << (*this);
1486+
oa << saved_postprocessors;
14791487
}
14801488

14811489
status_strings["Visualization"] = os.str();
1482-
1483-
//TODO: do something about the visualization postprocessor plugins
14841490
}
14851491

14861492

@@ -1494,9 +1500,14 @@ namespace aspect
14941500
std::istringstream is (status_strings.find("Visualization")->second);
14951501
aspect::iarchive ia (is);
14961502
ia >> (*this);
1497-
}
14981503

1499-
//TODO: do something about the visualization postprocessor plugins
1504+
// Now also retrieve information about visualization postprocessors we
1505+
// may have serialized
1506+
std::map<std::string,std::string> saved_postprocessors;
1507+
ia >> saved_postprocessors;
1508+
for (auto &p : postprocessors)
1509+
p->load (saved_postprocessors);
1510+
}
15001511
}
15011512

15021513

0 commit comments

Comments
 (0)