... | ... | @@ -280,9 +280,13 @@ void |
|
|
for (auto const& m : retrievedGasMomentum) {
|
|
|
std::string planet = m.first;
|
|
|
Momentum const& momentum = m.second;
|
|
|
if (simulation().disk().grid().master()) {
|
|
|
if (simulation().disk().grid().master()) { // only on one proc
|
|
|
// get the value of ofile_fmt as a string, with "accretion%1%.log" as default value
|
|
|
// and initialize a format with it.
|
|
|
boost::format fmt(parameter("ofile_fmt", "accretion%1%.log"));
|
|
|
// Produce a filname by applying the planet name as index
|
|
|
std::string ofilename = (fmt%planet).str();
|
|
|
// open in append mode and write
|
|
|
std::ofstream output(ofilename, std::ios::out | std::ios::app);
|
|
|
output << simulation().disk().step() << " " << simulation().disk().physicalTime() << " " << momentum << '\n';
|
|
|
}
|
... | ... | @@ -290,4 +294,5 @@ void |
|
|
}
|
|
|
```
|
|
|
|
|
|
|
|
|
[^1]: this class is over simplified, does not allow any user configuration and does not keep any state. Also, all implementation code should be in the [simulationTrackers.cpp](https://gitlab.oca.eu/DISC/fargOCA/blob/master/include/simulationTrackers.hpp). |