Skip to content
Snippets Groups Projects
Commit ab10a64b authored by Lars Bilke's avatar Lars Bilke
Browse files

[insitu] Corrected CoProcess-calls to be indep. of OGS output config.

Note: The last time is always outputted and may be outputted two times
if the config marks it to output. E.g.
- num timesteps: 10
- output every second time step

--> last time step is outputted twice
parent 97cdec41
No related branches found
No related tags found
No related merge requests found
......@@ -71,7 +71,8 @@ void CoProcess(MeshLib::Mesh const& mesh, double const time,
}
if (Processor->RequestDataDescription(dataDescription.GetPointer()) != 0)
{
INFO("Start InSitu process.");
INFO("Start InSitu process: timestep #%d (t=%g, last=%d)", timeStep,
time, lastTimeStep);
vtkNew<MeshLib::VtkMappedMeshSource> vtkSource;
vtkSource->SetMesh(&mesh);
vtkSource->Update();
......
......@@ -125,11 +125,6 @@ void Output::doOutputAlways(Process const& process,
INFO("[time] Output of timestep %d took %g s.", timestep,
time_output.elapsed());
#ifdef USE_INSITU
// TODO: get number of timesteps
InSituLib::CoProcess(process.getMesh(), t, timestep, false);
#endif
}
void Output::doOutput(Process const& process,
......@@ -140,6 +135,11 @@ void Output::doOutput(Process const& process,
{
if (shallDoOutput(timestep, _repeats_each_steps))
doOutputAlways(process, process_output, timestep, t, x);
#ifdef USE_INSITU
// Note: last time step may be output twice: here and in
// doOutputLastTimestep() which throws a warning.
InSituLib::CoProcess(process.getMesh(), t, timestep, false);
#endif
}
void Output::doOutputLastTimestep(Process const& process,
......@@ -150,6 +150,9 @@ void Output::doOutputLastTimestep(Process const& process,
{
if (!shallDoOutput(timestep, _repeats_each_steps))
doOutputAlways(process, process_output, timestep, t, x);
#ifdef USE_INSITU
InSituLib::CoProcess(process.getMesh(), t, timestep, true);
#endif
}
void Output::doOutputNonlinearIteration(Process const& process,
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment