Commit b10eebd5 authored by Kilian Weishaupt's avatar Kilian Weishaupt
Browse files

Merge branch 'fix/gnuplot-timeout' into 'master'

Fix gnuplot timeout

Closes #28

See merge request !108
parents 05fc9ae6 f041f214
Pipeline #2308 passed with stage
in 32 seconds
......@@ -119,19 +119,21 @@ public:
evaluateWaterMassStorageTerm(curSol, gridVariables);
evaluateInterfaceFluxes(curSol, gridVariables);
gnuplotStorage_.resetPlot();
gnuplotStorage_.setDatafileSeparator(';');
gnuplotStorage_.setXlabel("time [d]");
gnuplotStorage_.setXRange(0.0, getParam<Scalar>("TimeLoop.TEnd"));
gnuplotStorage_.setYlabel("evaporation rate [mm/d]");
gnuplotStorage_.setOption("set yrange [0.0:]");
gnuplotStorage_.setOption("set y2label 'cumulative mass loss'");
gnuplotStorage_.setOption("set y2range [0.0:0.5]");
gnuplotStorage_.setOption("set y2range [0.0:0.5]");
gnuplotStorage_.addFileToPlot(storageFileName_, "using 1:4 with lines title 'evaporation rate'");
gnuplotStorage_.addFileToPlot(storageFileName_, "using 1:3 axes x1y2 with lines title 'cumulative mass loss'");
if (plotStorage_)
{
gnuplotStorage_.resetPlot();
gnuplotStorage_.setDatafileSeparator(';');
gnuplotStorage_.setXlabel("time [d]");
gnuplotStorage_.setXRange(0.0, getParam<Scalar>("TimeLoop.TEnd"));
gnuplotStorage_.setYlabel("evaporation rate [mm/d]");
gnuplotStorage_.setOption("set yrange [0.0:]");
gnuplotStorage_.setOption("set y2label 'cumulative mass loss'");
gnuplotStorage_.setOption("set y2range [0.0:0.5]");
gnuplotStorage_.setOption("set y2range [0.0:0.5]");
gnuplotStorage_.addFileToPlot(storageFileName_, "using 1:4 with lines title 'evaporation rate'");
gnuplotStorage_.addFileToPlot(storageFileName_, "using 1:3 axes x1y2 with lines title 'cumulative mass loss'");
gnuplotStorage_.plot("temp");
}
}
template<class SolutionVector, class GridVariables>
......@@ -205,17 +207,19 @@ public:
}
}
gnuplotInterfaceFluxes_.resetPlot();
gnuplotInterfaceFluxes_.setXlabel("x-position [m]");
gnuplotInterfaceFluxes_.setXRange(this->gridGeometry().bBoxMin()[0], this->gridGeometry().bBoxMax()[0]);
gnuplotInterfaceFluxes_.setYlabel("flux [kg/(m^2 s)]");
gnuplotInterfaceFluxes_.setYRange(-5e-4, 0.0);
gnuplotInterfaceFluxes_.setOption("set label 'time: " + std::to_string(timeLoop_->time()/86400.) + "d' at graph 0.8,0.8 ");
std::string fluxFileName = "flux_" + std::to_string(timeLoop_->timeStepIndex()) +
"_" + getParam<std::string>("Problem.Name") + "_" + this->name() + ".csv";
gnuplotInterfaceFluxes_.addDataSetToPlot(x, y, fluxFileName, "with lines title 'water mass flux'");
if (plotFluxes_)
{
gnuplotInterfaceFluxes_.resetPlot();
gnuplotInterfaceFluxes_.setXlabel("x-position [m]");
gnuplotInterfaceFluxes_.setXRange(this->gridGeometry().bBoxMin()[0], this->gridGeometry().bBoxMax()[0]);
gnuplotInterfaceFluxes_.setYlabel("flux [kg/(m^2 s)]");
gnuplotInterfaceFluxes_.setYRange(-5e-4, 0.0);
gnuplotInterfaceFluxes_.setOption("set label 'time: " + std::to_string(timeLoop_->time()/86400.) + "d' at graph 0.8,0.8 ");
std::string fluxFileName = "flux_" + std::to_string(timeLoop_->timeStepIndex()) +
"_" + getParam<std::string>("Problem.Name") + "_" + this->name() + ".csv";
gnuplotInterfaceFluxes_.addDataSetToPlot(x, y, fluxFileName, "with lines title 'water mass flux'");
gnuplotInterfaceFluxes_.plot("flux_" + std::to_string(timeLoop_->timeStepIndex()));
}
}
/*!
......
dune_add_test(NAME exercise_models_coupling_ff-pm_original
SOURCES main.cc
COMPILE_DEFINITIONS EXNUMBER=0)
COMPILE_DEFINITIONS EXNUMBER=0
COMMAND ${CMAKE_CURRENT_BINARY_DIR}/exercise_models_coupling_ff-pm_original
CMD_ARGS -Problem.PlotStorage 0 -Problem.PlotFluxes 0)
dune_add_test(NAME exercise_models_coupling_ff-pm_a_solution
SOURCES main.cc
COMPILE_DEFINITIONS EXNUMBER=1)
COMPILE_DEFINITIONS EXNUMBER=1
COMMAND ${CMAKE_CURRENT_BINARY_DIR}/exercise_models_coupling_ff-pm_a_solution
CMD_ARGS -Problem.PlotStorage 0 -Problem.PlotFluxes 0)
dune_add_test(NAME exercise_models_coupling_ff-pm_b_solution
SOURCES main.cc
COMPILE_DEFINITIONS EXNUMBER=2)
COMPILE_DEFINITIONS EXNUMBER=2
COMMAND ${CMAKE_CURRENT_BINARY_DIR}/exercise_models_coupling_ff-pm_b_solution
CMD_ARGS -Problem.PlotStorage 0 -Problem.PlotFluxes 0)
dune_add_test(NAME exercise_models_coupling_ff-pm_c_solution
SOURCES main.cc
COMPILE_DEFINITIONS EXNUMBER=3)
COMPILE_DEFINITIONS EXNUMBER=3
COMMAND ${CMAKE_CURRENT_BINARY_DIR}/exercise_models_coupling_ff-pm_c_solution
CMD_ARGS -Problem.PlotStorage 0 -Problem.PlotFluxes 0)
# add exercise to the common target
add_dependencies(test_exercises exercise_models_coupling_ff-pm_a_solution exercise_models_coupling_ff-pm_b_solution exercise_models_coupling_ff-pm_c_solution)
......
......@@ -128,19 +128,21 @@ public:
evaluateWaterMassStorageTerm(curSol, gridVariables);
evaluateInterfaceFluxes(curSol, gridVariables);
gnuplotStorage_.resetPlot();
gnuplotStorage_.setDatafileSeparator(';');
gnuplotStorage_.setXlabel("time [d]");
gnuplotStorage_.setXRange(0.0, getParam<Scalar>("TimeLoop.TEnd"));
gnuplotStorage_.setYlabel("evaporation rate [mm/d]");
gnuplotStorage_.setOption("set yrange [0.0:]");
gnuplotStorage_.setOption("set y2label 'cumulative mass loss'");
gnuplotStorage_.setOption("set y2range [0.0:0.5]");
gnuplotStorage_.setOption("set y2range [0.0:0.5]");
gnuplotStorage_.addFileToPlot(storageFileName_, "using 1:4 with lines title 'evaporation rate'");
gnuplotStorage_.addFileToPlot(storageFileName_, "using 1:3 axes x1y2 with lines title 'cumulative mass loss'");
if (plotStorage_)
if (plotFluxes_)
{
gnuplotStorage_.resetPlot();
gnuplotStorage_.setDatafileSeparator(';');
gnuplotStorage_.setXlabel("time [d]");
gnuplotStorage_.setXRange(0.0, getParam<Scalar>("TimeLoop.TEnd"));
gnuplotStorage_.setYlabel("evaporation rate [mm/d]");
gnuplotStorage_.setOption("set yrange [0.0:]");
gnuplotStorage_.setOption("set y2label 'cumulative mass loss'");
gnuplotStorage_.setOption("set y2range [0.0:0.5]");
gnuplotStorage_.setOption("set y2range [0.0:0.5]");
gnuplotStorage_.addFileToPlot(storageFileName_, "using 1:4 with lines title 'evaporation rate'");
gnuplotStorage_.addFileToPlot(storageFileName_, "using 1:3 axes x1y2 with lines title 'cumulative mass loss'");
gnuplotStorage_.plot("temp");
}
}
template<class SolutionVector, class GridVariables>
......@@ -226,17 +228,19 @@ public:
}
}
gnuplotInterfaceFluxes_.resetPlot();
gnuplotInterfaceFluxes_.setXlabel("x-position [m]");
gnuplotInterfaceFluxes_.setXRange(this->gridGeometry().bBoxMin()[0], this->gridGeometry().bBoxMax()[0]);
gnuplotInterfaceFluxes_.setYlabel("flux [kg/(m^2 s)]");
gnuplotInterfaceFluxes_.setYRange(-5e-4, 0.0);
gnuplotInterfaceFluxes_.setOption("set label 'time: " + std::to_string(timeLoop_->time()/86400.) + "d' at graph 0.8,0.8 ");
std::string fluxFileName = "flux_" + std::to_string(timeLoop_->timeStepIndex()) +
"_" + getParam<std::string>("Problem.Name") + "_" + this->name() + ".csv";
gnuplotInterfaceFluxes_.addDataSetToPlot(x, y, fluxFileName, "with lines title 'water mass flux'");
if (plotFluxes_)
{
gnuplotInterfaceFluxes_.resetPlot();
gnuplotInterfaceFluxes_.setXlabel("x-position [m]");
gnuplotInterfaceFluxes_.setXRange(this->gridGeometry().bBoxMin()[0], this->gridGeometry().bBoxMax()[0]);
gnuplotInterfaceFluxes_.setYlabel("flux [kg/(m^2 s)]");
gnuplotInterfaceFluxes_.setYRange(-5e-4, 0.0);
gnuplotInterfaceFluxes_.setOption("set label 'time: " + std::to_string(timeLoop_->time()/86400.) + "d' at graph 0.8,0.8 ");
std::string fluxFileName = "flux_" + std::to_string(timeLoop_->timeStepIndex()) +
"_" + getParam<std::string>("Problem.Name") + "_" + this->name() + ".csv";
gnuplotInterfaceFluxes_.addDataSetToPlot(x, y, fluxFileName, "with lines title 'water mass flux'");
gnuplotInterfaceFluxes_.plot("flux_" + std::to_string(timeLoop_->timeStepIndex()));
}
}
/*!
......
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