Commit 5857b717 authored by Praetorius, Simon's avatar Praetorius, Simon
Browse files

FileWriter now support output after regular time intervals

parent 7cb51bdd
......@@ -68,8 +68,15 @@ namespace AMDiS {
{
FUNCNAME("FileWriterTemplated<T>::writeFiles()");
if (timeModulo > 0.0) {
if ((adaptInfo->getTime() < lastWriteTime + timeModulo) && !force)
return;
} else {
if ((adaptInfo->getTimestepNumber() % tsModulo != 0) && !force)
return;
}
lastWriteTime = adaptInfo->getTime();
// Containers, which store the data to be written;
std::vector<DataCollector<>*> dataCollectors(solutionVecs.size());
......
......@@ -123,6 +123,11 @@ namespace AMDiS {
Flag traverseFlag = Mesh::CALL_LEAF_EL,
bool (*writeElem)(ElInfo*) = NULL);
vector<pair<double, string> >& getParaviewAnimationFrames()
{
return paraviewAnimationFrames;
}
protected:
/// Initialization of the filewriter.
void initialize();
......@@ -203,6 +208,10 @@ namespace AMDiS {
/// Timestep modulo: write only every tsModulo-th timestep!
int tsModulo;
/// Time modulo: write at first iteration after lastWriteTime + timeModulo
double timeModulo;
double lastWriteTime;
/// Stores a set of pairs of timepoint and filename to write a ParaView
/// animation file.
vector<pair<double, string> > paraviewAnimationFrames;
......
......@@ -120,6 +120,8 @@ namespace AMDiS {
indexLength = 5;
indexDecimals = 3;
tsModulo = 1;
timeModulo = -1.0;
lastWriteTime = 0.0;
nTmpSolutions = 0;
paraviewAnimationFrames.resize(0),
compression = NONE;
......@@ -148,6 +150,7 @@ namespace AMDiS {
Parameters::get(name + "->index length", indexLength);
Parameters::get(name + "->index decimals", indexDecimals);
Parameters::get(name + "->write every i-th timestep", tsModulo);
Parameters::get(name + "->write after timestep", timeModulo);
Parameters::get(name + "->Povray format", writePovrayFormat);
Parameters::get(name + "->Povray template", povrayTemplate);
......@@ -176,8 +179,15 @@ namespace AMDiS {
{
FUNCNAME("FileWriterTemplated<T>::writeFiles()");
if (timeModulo > 0.0) {
if ((adaptInfo->getTime() < lastWriteTime + timeModulo) && !force)
return;
} else {
if ((adaptInfo->getTimestepNumber() % tsModulo != 0) && !force)
return;
}
lastWriteTime = adaptInfo->getTime();
// Containers, which store the data to be written;
std::vector<DataCollector<T>*> dataCollectors(solutionVecs.size());
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment