Skip to content
Snippets Groups Projects
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
No related branches found
No related tags found
1 merge request!108Fix gnuplot timeout
Pipeline #2308 passed
...@@ -119,19 +119,21 @@ public: ...@@ -119,19 +119,21 @@ public:
evaluateWaterMassStorageTerm(curSol, gridVariables); evaluateWaterMassStorageTerm(curSol, gridVariables);
evaluateInterfaceFluxes(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 (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"); gnuplotStorage_.plot("temp");
}
} }
template<class SolutionVector, class GridVariables> template<class SolutionVector, class GridVariables>
...@@ -205,17 +207,19 @@ public: ...@@ -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_) 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())); gnuplotInterfaceFluxes_.plot("flux_" + std::to_string(timeLoop_->timeStepIndex()));
}
} }
/*! /*!
......
dune_add_test(NAME exercise_models_coupling_ff-pm_original dune_add_test(NAME exercise_models_coupling_ff-pm_original
SOURCES main.cc 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 dune_add_test(NAME exercise_models_coupling_ff-pm_a_solution
SOURCES main.cc 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 dune_add_test(NAME exercise_models_coupling_ff-pm_b_solution
SOURCES main.cc 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 dune_add_test(NAME exercise_models_coupling_ff-pm_c_solution
SOURCES main.cc 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 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) 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: ...@@ -128,19 +128,21 @@ public:
evaluateWaterMassStorageTerm(curSol, gridVariables); evaluateWaterMassStorageTerm(curSol, gridVariables);
evaluateInterfaceFluxes(curSol, gridVariables); evaluateInterfaceFluxes(curSol, gridVariables);
gnuplotStorage_.resetPlot(); if (plotFluxes_)
gnuplotStorage_.setDatafileSeparator(';'); {
gnuplotStorage_.setXlabel("time [d]"); gnuplotStorage_.resetPlot();
gnuplotStorage_.setXRange(0.0, getParam<Scalar>("TimeLoop.TEnd")); gnuplotStorage_.setDatafileSeparator(';');
gnuplotStorage_.setYlabel("evaporation rate [mm/d]"); gnuplotStorage_.setXlabel("time [d]");
gnuplotStorage_.setOption("set yrange [0.0:]"); gnuplotStorage_.setXRange(0.0, getParam<Scalar>("TimeLoop.TEnd"));
gnuplotStorage_.setOption("set y2label 'cumulative mass loss'"); gnuplotStorage_.setYlabel("evaporation rate [mm/d]");
gnuplotStorage_.setOption("set y2range [0.0:0.5]"); gnuplotStorage_.setOption("set yrange [0.0:]");
gnuplotStorage_.setOption("set y2range [0.0:0.5]"); gnuplotStorage_.setOption("set y2label 'cumulative mass loss'");
gnuplotStorage_.addFileToPlot(storageFileName_, "using 1:4 with lines title 'evaporation rate'"); gnuplotStorage_.setOption("set y2range [0.0:0.5]");
gnuplotStorage_.addFileToPlot(storageFileName_, "using 1:3 axes x1y2 with lines title 'cumulative mass loss'"); gnuplotStorage_.setOption("set y2range [0.0:0.5]");
if (plotStorage_) 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"); gnuplotStorage_.plot("temp");
}
} }
template<class SolutionVector, class GridVariables> template<class SolutionVector, class GridVariables>
...@@ -226,17 +228,19 @@ public: ...@@ -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_) 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())); gnuplotInterfaceFluxes_.plot("flux_" + std::to_string(timeLoop_->timeStepIndex()));
}
} }
/*! /*!
......
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