From c0f285f746bde4614a53fc03fd6f61f3efe96765 Mon Sep 17 00:00:00 2001 From: Thomas Fetzer <thomas.fetzer@iws.uni-stuttgart.de> Date: Tue, 14 Jul 2015 12:44:59 +0000 Subject: [PATCH] [gnuplotinterface] better handling of switching on/off of the gnuplot windows deprecated use of the plottingwindownumber unified output names reviewed by bernd git-svn-id: svn://svn.iws.uni-stuttgart.de/DUMUX/dumux/trunk@15069 2fb0f335-1f38-0410-981e-8018bf24f1b0 --- dumux/io/gnuplotinterface.hh | 277 +++++++++++------- dumux/io/ploteffectivediffusivitymodel.hh | 31 +- dumux/io/plotmateriallaw.hh | 176 +++++++---- dumux/io/plotthermalconductivitymodel.hh | 45 +-- test/implicit/2p2c/test_box2p2cni.input | 2 +- test/implicit/2p2c/test_cc2p2cni.input | 2 +- test/implicit/2p2c/waterairspatialparams.hh | 30 +- .../mpnc/evaporationatmosphereproblem.hh | 19 +- .../gnuplotinterface/test_gnuplotinterface.cc | 26 +- .../fluidmatrixinteractions/2p/CMakeLists.txt | 8 +- .../2p/thermalconductivityspatialparams.hh | 4 +- .../fluidmatrixinteractions/CMakeLists.txt | 8 +- .../effectivediffusivityspatialparams.hh | 4 +- .../2cnistokes2p2cni/2p2cnisubproblem.hh | 16 +- 14 files changed, 390 insertions(+), 258 deletions(-) diff --git a/dumux/io/gnuplotinterface.hh b/dumux/io/gnuplotinterface.hh index 0adb15dfaf..fbf36ed41c 100644 --- a/dumux/io/gnuplotinterface.hh +++ b/dumux/io/gnuplotinterface.hh @@ -65,32 +65,22 @@ public: }; //! \brief The constructor - GnuplotInterface() : + GnuplotInterface(bool persist = true) : plotStyle_("lines"), pipe_(0), fileName_(0), plotOptions_(0), plotName_(0), - xRangeMin_(0), xRangeMax_(0), - yRangeMin_(0), yRangeMax_(0), - xLabel_(0), yLabel_(0), - options_(0), - datafileSeparator_(0), + interaction_(true), + xRangeMin_(1e100), xRangeMax_(-1e100), + yRangeMin_(1e100), yRangeMax_(-1e100), + xLabel_(""), yLabel_(""), + options_(""), + datafileSeparator_(' '), gnuplotPath_(GNUPLOT_EXECUTABLE), - terminalType_("wxt"), - numberOfGnuplotWindows_(8+1) + terminalType_("wxt") { - { + if (persist) pipe_ = popen((gnuplotPath_ + " -persist").c_str(), "w"); // "w" - writing - } - fileName_.resize(numberOfGnuplotWindows_); - plotOptions_.resize(numberOfGnuplotWindows_); - plotName_.resize(numberOfGnuplotWindows_); - xRangeMin_.resize(numberOfGnuplotWindows_, 1e100); - xRangeMax_.resize(numberOfGnuplotWindows_, -1e100); - yRangeMin_.resize(numberOfGnuplotWindows_, 1e100); - yRangeMax_.resize(numberOfGnuplotWindows_, -1e100); - xLabel_.resize(numberOfGnuplotWindows_, ""); - yLabel_.resize(numberOfGnuplotWindows_, ""); - options_.resize(numberOfGnuplotWindows_, ""); - datafileSeparator_.resize(numberOfGnuplotWindows_, ' '); + else + pipe_ = popen((gnuplotPath_).c_str(), "w"); } //! \brief The destructor @@ -100,56 +90,59 @@ public: assert("Could not close pipe to Gnuplot!"); } + DUNE_DEPRECATED_MSG("plot() signature has been changed") + void plot(const std::string &title, + const unsigned int plottingWindowNumber, + const bool interaction) + { + plot(title); + } + /*! * \brief Plots the files for a specific window number, writes a gnuplot and png file. * * \param title The name of the output file - * \param plottingWindowNumber The ID of the specific plot - * \param interaction Specifies whether a live output via a gnuplot window is wanted + * \param plottingWindowNumber Change the number of the window in which the plot is shown */ - void plot(const std::string &title, - const unsigned int plottingWindowNumber, - bool interaction) + void plot(const std::string &title, const unsigned int plottingWindowNumber = 0) { // set correct terminal and general options std::string plot = "reset\n"; - plot += "set datafile separator \'" + convertToString(datafileSeparator_[plottingWindowNumber]) + "\'\n"; - plot += "set term wxt " + convertToString(plottingWindowNumber) + "\n"; - if (xRangeMin_[plottingWindowNumber] < 1e100 || xRangeMax_[plottingWindowNumber] > -1e100) + plot += "set datafile separator \'" + convertToString(datafileSeparator_) + "\'\n"; + plot += "set term wxt " + convertToString(plottingWindowNumber) + " \n"; + if (xRangeMin_ < 1e100 || xRangeMax_ > -1e100) { - plot += "set xrange [" + convertToString(xRangeMin_[plottingWindowNumber]) - + ":" + convertToString(xRangeMax_[plottingWindowNumber]) + "]" + "\n"; + plot += "set xrange [" + convertToString(xRangeMin_) + + ":" + convertToString(xRangeMax_) + "]" + "\n"; } - if (yRangeMin_[plottingWindowNumber] < 1e100 || yRangeMax_[plottingWindowNumber] > -1e100) + if (yRangeMin_ < 1e100 || yRangeMax_ > -1e100) { - plot += "set yrange [" + convertToString(yRangeMin_[plottingWindowNumber]) - + ":" + convertToString(yRangeMax_[plottingWindowNumber]) + "]" + "\n"; + plot += "set yrange [" + convertToString(yRangeMin_) + + ":" + convertToString(yRangeMax_) + "]" + "\n"; } - plot += "set xlabel \"" + xLabel_[plottingWindowNumber] + "\"\n"; - plot += "set ylabel \"" + yLabel_[plottingWindowNumber] + "\"\n"; + plot += "set xlabel \"" + xLabel_ + "\"\n"; + plot += "set ylabel \"" + yLabel_ + "\"\n"; // set user defined options - plot += options_[plottingWindowNumber] + "\n"; + plot += options_ + "\n"; // plot curves plot += "plot"; - for (unsigned int i = 0; i < fileName_[plottingWindowNumber].size(); ++i) + for (unsigned int i = 0; i < fileName_.size(); ++i) { - plot += + " " + fileName_[plottingWindowNumber][i] - + " " + plotOptions_[plottingWindowNumber][i] - + " title '" + plotName_[plottingWindowNumber][i] + "'"; - if (i < fileName_[plottingWindowNumber].size()-1) + plot += + " " + fileName_[i] + + " " + plotOptions_[i] + + " title '" + plotName_[i] + "'"; + if (i < fileName_.size()-1) plot += ",\\"; plot += "\n"; } // live plot of the results if gnuplot is installed - if (interaction) - { #ifdef HAVE_GNUPLOT + if (interaction_) executeGnuplot(plot.c_str()); #endif - } // create a gnuplot file for output a png plot += "\n"; @@ -163,17 +156,32 @@ public: file.close(); } + + DUNE_DEPRECATED_MSG("reset() signature has been changed") + void reset(const unsigned int plottingWindowNumber) + { + reset(); + } + /*! * \brief Deletes all plots from a plotting window and resets user-defined options - * - * \param plottingWindowNumber The ID of the specific plot */ - void reset(const unsigned int plottingWindowNumber) + void reset() { - fileName_[plottingWindowNumber].resize(0); - plotOptions_[plottingWindowNumber].resize(0); - plotName_[plottingWindowNumber].resize(0); - options_[plottingWindowNumber].resize(0); + fileName_.resize(0); + plotOptions_.resize(0); + plotName_.resize(0); + options_ = ""; + } + + + DUNE_DEPRECATED_MSG("addFunctionToPlot() signature has been changed") + void addFunctionToPlot(const std::string function, + const std::string plotName, + const unsigned int plottingWindowNumber, + const std::string plotOptions = "with lines") + { + addFunctionToPlot(function, plotName); } /*! @@ -181,17 +189,25 @@ public: * * \param function Function to be plotted * \param plotName The name of the data set - * \param plottingWindowNumber The ID of the specific plot * \param plotOptions Specific gnuplot options passed to this plot */ void addFunctionToPlot(const std::string function, const std::string plotName, - const unsigned int plottingWindowNumber, const std::string plotOptions = "with lines") { - fileName_[plottingWindowNumber].push_back(function); - plotOptions_[plottingWindowNumber].push_back(plotOptions); - plotName_[plottingWindowNumber].push_back(plotName); + fileName_.push_back(function); + plotOptions_.push_back(plotOptions); + plotName_.push_back(plotName); + } + + + DUNE_DEPRECATED_MSG("addFileToPlot() signature has been changed") + void addFileToPlot(const std::string file, + const std::string plotName, + const unsigned int plottingWindowNumber, + const std::string plotOptions = "with lines") + { + addFileToPlot(file, plotName); } /*! @@ -199,17 +215,26 @@ public: * * \param file Function to be plotted * \param plotName The name of the data set - * \param plottingWindowNumber The ID of the specific plot * \param plotOptions Specific gnuplot options passed to this plot */ void addFileToPlot(const std::string file, const std::string plotName, - const unsigned int plottingWindowNumber, const std::string plotOptions = "with lines") { - fileName_[plottingWindowNumber].push_back("'" + file + "'"); - plotOptions_[plottingWindowNumber].push_back(plotOptions); - plotName_[plottingWindowNumber].push_back(plotName); + fileName_.push_back("'" + file + "'"); + plotOptions_.push_back(plotOptions); + plotName_.push_back(plotName); + } + + + DUNE_DEPRECATED_MSG("addDataSetToPlot() signature has been changed") + void addDataSetToPlot(const std::vector<Scalar>& x, + const std::vector<Scalar>& y, + const std::string plotName, + const unsigned int plottingWindowNumber, + const std::string plotOptions = "with lines") + { + addDataSetToPlot(x, y, plotName); } /*! @@ -218,57 +243,86 @@ public: * \param x Vector containing the x-axis data points * \param y Vector containing the y-axis data points * \param plotName The name of the data set - * \param plottingWindowNumber The ID of the specific plot * \param plotOptions Specific gnuplot options passed to this plot */ void addDataSetToPlot(const std::vector<Scalar>& x, const std::vector<Scalar>& y, const std::string plotName, - const unsigned int plottingWindowNumber, const std::string plotOptions = "with lines") { assert(x.size() == y.size()); //write data to file - std::string fileName = convertToString(plottingWindowNumber) + "_" + plotName + ".dat"; + std::string fileName = plotName + ".dat"; std::ofstream file; file.open(fileName); for (unsigned int i = 0; i < x.size(); i++) { checkNumber(x[i], "x[i] i=" + convertToString(i) + " in " + fileName); checkNumber(y[i], "y[i] i=" + convertToString(i) + " in " + fileName); - file << x[i] << datafileSeparator_[plottingWindowNumber] << y[i] << std::endl; + file << x[i] << datafileSeparator_ << y[i] << std::endl; } file.close(); // adding file to list of plotted lines - fileName_[plottingWindowNumber].push_back("'" + fileName + "'"); - plotOptions_[plottingWindowNumber].push_back(plotOptions); - plotName_[plottingWindowNumber].push_back(plotName); + fileName_.push_back("'" + fileName + "'"); + plotOptions_.push_back(plotOptions); + plotName_.push_back(plotName); + } + + /*! + * \brief Set whether a gnuplot window will be opened or not + * + * \param interaction Open window or not + */ + void setInteraction(bool interaction) + { + interaction_ = interaction; + } + + + DUNE_DEPRECATED_MSG("setXlabel() signature has been changed") + void setXlabel(const std::string& label, + const unsigned int plottingWindowNumber) + { + setXlabel(label); } /*! * \brief Sets the label for the x-axis * * \param label The label of the x-axis - * \param plottingWindowNumber The ID of the specific plot */ - void setXlabel(const std::string& label, + void setXlabel(const std::string& label) + { + xLabel_ = label; + } + + + DUNE_DEPRECATED_MSG("setXlabel() signature has been changed") + void setYlabel(const std::string& label, const unsigned int plottingWindowNumber) { - xLabel_[plottingWindowNumber] = label; + setYlabel(label); } /*! * \brief Sets the label for the y-axis * * \param label The label of the y-axis - * \param plottingWindowNumber The ID of the specific plot */ - void setYlabel(const std::string& label, + void setYlabel(const std::string& label) + { + yLabel_ = label; + } + + + DUNE_DEPRECATED_MSG("setXRange() signature has been changed") + void setXRange(Scalar lowerEnd, + Scalar upperEnd, const unsigned int plottingWindowNumber) { - yLabel_[plottingWindowNumber] = label; + setXRange(lowerEnd, upperEnd); } /*! @@ -276,14 +330,20 @@ public: * * \param lowerEnd The lowest plotted value for the x-axis * \param upperEnd The highest plotted value for the x-axis - * \param plottingWindowNumber The ID of the specific plot */ - void setXRange(Scalar lowerEnd, + void setXRange(Scalar lowerEnd, Scalar upperEnd) + { + xRangeMin_ = std::min(xRangeMin_, lowerEnd); + xRangeMax_ = std::max(xRangeMax_, upperEnd); + } + + + DUNE_DEPRECATED_MSG("setYRange() signature has been changed") + void setYRange(Scalar lowerEnd, Scalar upperEnd, const unsigned int plottingWindowNumber) { - xRangeMin_[plottingWindowNumber] = std::min(xRangeMin_[plottingWindowNumber], lowerEnd); - xRangeMax_[plottingWindowNumber] = std::max(xRangeMax_[plottingWindowNumber], upperEnd); + setYRange(lowerEnd, upperEnd); } /*! @@ -291,38 +351,47 @@ public: * * \param lowerEnd The lowest plotted value for the y-axis * \param upperEnd The highest plotted value for the y-axis - * \param plottingWindowNumber The ID of the specific plot */ - void setYRange(Scalar lowerEnd, - Scalar upperEnd, + void setYRange(Scalar lowerEnd, Scalar upperEnd) + { + yRangeMin_ = std::min(yRangeMin_, lowerEnd); + yRangeMax_ = std::max(yRangeMax_, upperEnd); + } + + + DUNE_DEPRECATED_MSG("setOption() signature has been changed") + void setOption(std::string option, const unsigned int plottingWindowNumber) { - yRangeMin_[plottingWindowNumber] = std::min(yRangeMin_[plottingWindowNumber], lowerEnd); - yRangeMax_[plottingWindowNumber] = std::max(yRangeMax_[plottingWindowNumber], upperEnd); + setOption(option); } /*! * \brief Sets additional user-defined options * * \param option Additional line of option in gnuplot language - * \param plottingWindowNumber The ID of the specific plot */ - void setOption(std::string option, - const unsigned int plottingWindowNumber) + void setOption(std::string option) { - options_[plottingWindowNumber] += option + "\n"; + options_ += option + "\n"; + } + + + DUNE_DEPRECATED_MSG("setOption() signature has been changed") + void setDatafileSeparator(char separator, + const unsigned int plottingWindowNumber) + { + setDatafileSeparator(separator); } /*! * \brief Sets the datafile separator * * \param separator The separator sign between two data columns - * \param plottingWindowNumber The ID of the specific plot */ - void setDatafileSeparator(char separator, - const unsigned int plottingWindowNumber) + void setDatafileSeparator(char separator) { - datafileSeparator_[plottingWindowNumber] = separator; + datafileSeparator_ = separator; } /*! @@ -383,20 +452,20 @@ private: std::string plotStyle_; std::FILE * pipe_; - std::vector<StringVector> fileName_; - std::vector<StringVector> plotOptions_; - std::vector<StringVector> plotName_; - std::vector<Scalar> xRangeMin_; - std::vector<Scalar> xRangeMax_; - std::vector<Scalar> yRangeMin_; - std::vector<Scalar> yRangeMax_; - StringVector xLabel_; - StringVector yLabel_; - StringVector options_; - std::vector<char> datafileSeparator_; + StringVector fileName_; + StringVector plotOptions_; + StringVector plotName_; + bool interaction_; + Scalar xRangeMin_; + Scalar xRangeMax_; + Scalar yRangeMin_; + Scalar yRangeMax_; + std::string xLabel_; + std::string yLabel_; + std::string options_; + char datafileSeparator_; std::string gnuplotPath_; std::string terminalType_; - const unsigned int numberOfGnuplotWindows_; }; } // end of namespace #endif // DUMUX_GNUPLOT_INTERFACE_HH diff --git a/dumux/io/ploteffectivediffusivitymodel.hh b/dumux/io/ploteffectivediffusivitymodel.hh index 9afd03c17a..a89162c07a 100644 --- a/dumux/io/ploteffectivediffusivitymodel.hh +++ b/dumux/io/ploteffectivediffusivitymodel.hh @@ -47,8 +47,18 @@ class PlotEffectiveDiffusivityModel public: //! Constructor - PlotEffectiveDiffusivityModel() + PlotEffectiveDiffusivityModel(bool interaction = true) : numIntervals_(1000) + { + gnuplot_.setInteraction(interaction); + } + + DUNE_DEPRECATED_MSG("plotdeff() has changed signature") + void plotdeff(Scalar porosity, + Scalar lowerSat, + Scalar upperSat, + std::string plotName, + bool interaction) { } /*! @@ -58,13 +68,11 @@ public: * \param lowerSat Minimum x-value * \param upperSat Maximum x-value * \param plotName Name of the plotted curve - * \param interaction Specifies whether a live output via a gnuplot window is wanted */ void plotdeff(Scalar porosity, Scalar lowerSat = 0.0, Scalar upperSat = 1.0, - std::string plotName = "D_eff", - bool interaction = true) + std::string plotName = "") { std::vector<Scalar> sw(numIntervals_+1); std::vector<Scalar> deff(numIntervals_+1); @@ -81,18 +89,17 @@ public: deffMax = std::max(deffMax, deff[i]); } - unsigned int windowNumber = 7; - gnuplot_.setXRange(lowerSat, upperSat, windowNumber); - gnuplot_.setYRange(deffMin, deffMax, windowNumber); - gnuplot_.setXlabel("phase saturation [-]", windowNumber); - gnuplot_.setYlabel("effective diffusion/molecular diffusion [-]", windowNumber); - gnuplot_.addDataSetToPlot(sw, deff, plotName, windowNumber); - gnuplot_.plot("deff", windowNumber, interaction); + gnuplot_.setXRange(lowerSat, upperSat); + gnuplot_.setYRange(deffMin, deffMax); + gnuplot_.setXlabel("phase saturation [-]"); + gnuplot_.setYlabel("effective diffusion/molecular diffusion [-]"); + gnuplot_.addDataSetToPlot(sw, deff, plotName + "_d_eff"); + gnuplot_.plot("deff"); } private: - GnuplotInterface<Scalar> gnuplot_; int numIntervals_; + GnuplotInterface<Scalar> gnuplot_; }; } // end of namespace diff --git a/dumux/io/plotmateriallaw.hh b/dumux/io/plotmateriallaw.hh index fba84ea636..a759630bb0 100644 --- a/dumux/io/plotmateriallaw.hh +++ b/dumux/io/plotmateriallaw.hh @@ -51,8 +51,24 @@ class PlotMaterialLaw public: //! Constructor - PlotMaterialLaw() + PlotMaterialLaw(bool interaction = true) : numIntervals_(1000) + { + gnuplotpcsw_.setInteraction(interaction); + gnuplotswpc_.setInteraction(interaction); + gnuplotdpcdsw_.setInteraction(interaction); + gnuplotdswdpc_.setInteraction(interaction); + gnuplotkr_.setInteraction(interaction); + gnuplotkrdsw_.setInteraction(interaction); + } + + + DUNE_DEPRECATED_MSG("plotpcsw() has changed signature") + void plotpcsw(const MaterialLawParams ¶ms, + Scalar lowerSat, + Scalar upperSat, + std::string plotName, + bool interaction) { } /*! @@ -62,13 +78,11 @@ public: * \param lowerSat Minimum x-value * \param upperSat Maximum x-value * \param plotName Name of the plotted curve - * \param interaction Specifies whether a live output via a gnuplot window is wanted */ void plotpcsw(const MaterialLawParams ¶ms, Scalar lowerSat = 0.0, Scalar upperSat = 1.0, - std::string plotName = "pc-Sw", - bool interaction = true) + std::string plotName = "") { std::vector<Scalar> sw(numIntervals_+1); std::vector<Scalar> pc(numIntervals_+1); @@ -85,15 +99,23 @@ public: pcMax = std::max(pcMax, pc[i]); } - unsigned int windowNumber = 1; - gnuplot_.setXRange(lowerSat, upperSat, windowNumber); - gnuplot_.setYRange(pcMin, pcMax, windowNumber); - gnuplot_.setXlabel("wetting phase saturation [-]", windowNumber); - gnuplot_.setYlabel("capillary pressure [Pa]", windowNumber); - gnuplot_.addDataSetToPlot(sw, pc, plotName, windowNumber); - gnuplot_.plot("pc-Sw", windowNumber, interaction); + gnuplotpcsw_.setXRange(lowerSat, upperSat); + gnuplotpcsw_.setYRange(pcMin, pcMax); + gnuplotpcsw_.setXlabel("wetting phase saturation [-]"); + gnuplotpcsw_.setYlabel("capillary pressure [Pa]"); + gnuplotpcsw_.addDataSetToPlot(sw, pc, plotName + "_pc-Sw"); + gnuplotpcsw_.plot("pc-Sw"); } + + DUNE_DEPRECATED_MSG("plotswpc() has changed signature") + void plotswpc(const MaterialLawParams ¶ms, + Scalar lowerSat, + Scalar upperSat, + std::string plotName, + bool interaction) + { } + /*! * \brief Plot the saturation-capillary pressure curve * @@ -101,13 +123,11 @@ public: * \param lowerpc Minimum x-value * \param upperpc Maximum x-value * \param plotName Name of the plotted curve - * \param interaction Specifies whether a live output via a gnuplot window is wanted */ void plotswpc(const MaterialLawParams ¶ms, Scalar lowerpc = 0.0, Scalar upperpc = 5000.0, - std::string plotName = "Sw-pc", - bool interaction = true) + std::string plotName = "") { std::vector<Scalar> sat(numIntervals_+1); std::vector<Scalar> pc(numIntervals_+1); @@ -123,15 +143,23 @@ public: swMax = std::max(swMax, sat[i]); } - unsigned int windowNumber = 2; - gnuplot_.setXRange(lowerpc, upperpc, windowNumber); - gnuplot_.setYRange(swMin, swMax, windowNumber); - gnuplot_.setXlabel("capillary pressure [Pa]", windowNumber); - gnuplot_.setYlabel("wetting phase saturation [-]", windowNumber); - gnuplot_.addDataSetToPlot(pc, sat, plotName, windowNumber); - gnuplot_.plot("sw-pc", windowNumber, interaction); + gnuplotswpc_.setXRange(lowerpc, upperpc); + gnuplotswpc_.setYRange(swMin, swMax); + gnuplotswpc_.setXlabel("capillary pressure [Pa]"); + gnuplotswpc_.setYlabel("wetting phase saturation [-]"); + gnuplotswpc_.addDataSetToPlot(pc, sat, plotName + "_Sw-pc"); + gnuplotswpc_.plot("sw-pc"); } + + DUNE_DEPRECATED_MSG("plotdpcdsw() has changed signature") + void plotdpcdsw(const MaterialLawParams ¶ms, + Scalar lowerSat, + Scalar upperSat, + std::string plotName, + bool interaction) + { } + /*! * \brief Plot the gradient of the capillary pressure-saturation curve * @@ -139,13 +167,11 @@ public: * \param lowerSat Minimum x-value * \param upperSat Maximum x-value * \param plotName Name of the plotted curve - * \param interaction Specifies whether a live output via a gnuplot window is wanted */ void plotdpcdsw(const MaterialLawParams ¶ms, Scalar lowerSat = 0.0, Scalar upperSat = 1.0, - std::string plotName = "dpcdSw-Sw", - bool interaction = true) + std::string plotName = "") { std::vector<Scalar> sat(numIntervals_ + 1); std::vector<Scalar> dpcdsw(numIntervals_ + 1); @@ -162,15 +188,23 @@ public: dpcdswMax = std::max(dpcdswMax, dpcdsw[i]); } - unsigned int windowNumber = 3; - gnuplot_.setXRange(lowerSat, upperSat, windowNumber); - gnuplot_.setYRange(dpcdswMin, dpcdswMax, windowNumber); - gnuplot_.setXlabel("wetting phase saturation [-]", windowNumber); - gnuplot_.setYlabel("gradient of the pc-Sw curve [Pa]", windowNumber); - gnuplot_.addDataSetToPlot(sat, dpcdsw, plotName, windowNumber); - gnuplot_.plot("dpcdsw", windowNumber, interaction); + gnuplotdpcdsw_.setXRange(lowerSat, upperSat); + gnuplotdpcdsw_.setYRange(dpcdswMin, dpcdswMax); + gnuplotdpcdsw_.setXlabel("wetting phase saturation [-]"); + gnuplotdpcdsw_.setYlabel("gradient of the pc-Sw curve [Pa]"); + gnuplotdpcdsw_.addDataSetToPlot(sat, dpcdsw, plotName + "_dpcdSw-Sw"); + gnuplotdpcdsw_.plot("dpcdsw"); } + + DUNE_DEPRECATED_MSG("plotdswdpc() has changed signature") + void plotdswdpc(const MaterialLawParams ¶ms, + Scalar lowerpc, + Scalar upperpc, + std::string plotName, + bool interaction) + { } + /*! * \brief Plot the gradient of the saturation-capillary pressure curve * @@ -178,13 +212,11 @@ public: * \param lowerpc Minimum x-value * \param upperpc Maximum x-value * \param plotName Name of the plotted curve - * \param interaction Specifies whether a live output via a gnuplot window is wanted */ void plotdswdpc(const MaterialLawParams ¶ms, Scalar lowerpc = 0.0, Scalar upperpc = 5000.0, - std::string plotName = "dSwdpc-pc", - bool interaction = true) + std::string plotName = "") { std::vector<Scalar> dswdpc(numIntervals_+1); std::vector<Scalar> pc(numIntervals_+1); @@ -200,15 +232,23 @@ public: dswdpcMax = std::max(dswdpcMax, dswdpc[i]); } - unsigned int windowNumber = 4; - gnuplot_.setXRange(lowerpc, upperpc, windowNumber); - gnuplot_.setYRange(dswdpcMin, dswdpcMax, windowNumber); - gnuplot_.setXlabel("capillary pressure [Pa]", windowNumber); - gnuplot_.setYlabel("gradient of the Sw-pc curve [1/Pa]", windowNumber); - gnuplot_.addDataSetToPlot(pc, dswdpc, plotName, windowNumber); - gnuplot_.plot("dswdpc", windowNumber, interaction); + gnuplotdswdpc_.setXRange(lowerpc, upperpc); + gnuplotdswdpc_.setYRange(dswdpcMin, dswdpcMax); + gnuplotdswdpc_.setXlabel("capillary pressure [Pa]"); + gnuplotdswdpc_.setYlabel("gradient of the Sw-pc curve [1/Pa]"); + gnuplotdswdpc_.addDataSetToPlot(pc, dswdpc, plotName + "_dSwdpc-pc"); + gnuplotdswdpc_.plot("dswdpc"); } + + DUNE_DEPRECATED_MSG("plotkr() has changed signature") + void plotkr(const MaterialLawParams ¶ms, + Scalar lowerSat, + Scalar upperSat, + std::string plotName, + bool interaction) + { } + /*! * \brief Plot the relative permeabilities * @@ -216,13 +256,11 @@ public: * \param lowerSat Minimum x-value * \param upperSat Maximum x-value * \param plotName Name of the plotted curve - * \param interaction Specifies whether a live output via a gnuplot window is wanted */ void plotkr(const MaterialLawParams ¶ms, Scalar lowerSat = 0.0, Scalar upperSat = 1.0, - std::string plotName = "", - bool interaction = true) + std::string plotName = "") { std::vector<Scalar> sw(numIntervals_ + 1); std::vector<Scalar> krw(numIntervals_ + 1); @@ -241,16 +279,24 @@ public: krMax = std::max(krMax, std::max(krw[i], krn[i])); } - unsigned int windowNumber = 5; - gnuplot_.setXRange(lowerSat, upperSat, windowNumber); - gnuplot_.setYRange(krMin, krMax, windowNumber); - gnuplot_.setXlabel("wetting phase saturation [-]", windowNumber); - gnuplot_.setYlabel("relative permeability [-]", windowNumber); - gnuplot_.addDataSetToPlot(sw, krw, plotName + "_krw", windowNumber); - gnuplot_.addDataSetToPlot(sw, krn, plotName + "_krn", windowNumber); - gnuplot_.plot("kr", windowNumber, interaction); + gnuplotkr_.setXRange(lowerSat, upperSat); + gnuplotkr_.setYRange(krMin, krMax); + gnuplotkr_.setXlabel("wetting phase saturation [-]"); + gnuplotkr_.setYlabel("relative permeability [-]"); + gnuplotkr_.addDataSetToPlot(sw, krw, plotName + "_krw"); + gnuplotkr_.addDataSetToPlot(sw, krn, plotName + "_krn"); + gnuplotkr_.plot("kr"); } + + DUNE_DEPRECATED_MSG("plotdkrdsw() has changed signature") + void plotdkrdsw(const MaterialLawParams ¶ms, + Scalar lowerSat, + Scalar upperSat, + std::string plotName, + bool interaction) + { } + /*! * \brief Plot the gradient of the relative permeabilities * @@ -258,13 +304,11 @@ public: * \param lowerSat Minimum x-value * \param upperSat Maximum x-value * \param plotName Name of the plotted curve - * \param interaction Specifies whether a live output via a gnuplot window is wanted */ void plotdkrdsw(const MaterialLawParams ¶ms, Scalar lowerSat = 0.0, Scalar upperSat = 1.0, - std::string plotName = "", - bool interaction = true) + std::string plotName = "") { std::vector<Scalar> sw(numIntervals_+1); std::vector<Scalar> dkrw_dsw(numIntervals_+1); @@ -283,14 +327,13 @@ public: dkrdswMax = std::max(dkrdswMax, std::max(dkrw_dsw[i], dkrn_dsw[i])); } - unsigned int windowNumber = 6; - gnuplot_.setXRange(lowerSat, upperSat, windowNumber); - gnuplot_.setYRange(dkrdswMin, dkrdswMax, windowNumber); - gnuplot_.setXlabel("wetting phase saturation [-]", windowNumber); - gnuplot_.setYlabel("gradient of the kr-Sw function [-]", windowNumber); - gnuplot_.addDataSetToPlot(sw, dkrw_dsw, plotName + "_dkrw_dsw", windowNumber); - gnuplot_.addDataSetToPlot(sw, dkrn_dsw, plotName + "_dkrn_dsw", windowNumber); - gnuplot_.plot("dkrndsw", windowNumber, interaction); + gnuplotkrdsw_.setXRange(lowerSat, upperSat); + gnuplotkrdsw_.setYRange(dkrdswMin, dkrdswMax); + gnuplotkrdsw_.setXlabel("wetting phase saturation [-]"); + gnuplotkrdsw_.setYlabel("gradient of the kr-Sw function [-]"); + gnuplotkrdsw_.addDataSetToPlot(sw, dkrw_dsw, plotName + "_dkrw_dsw"); + gnuplotkrdsw_.addDataSetToPlot(sw, dkrn_dsw, plotName + "_dkrn_dsw"); + gnuplotkrdsw_.plot("dkrndsw"); } /*! @@ -314,8 +357,13 @@ public: } private: - GnuplotInterface<Scalar> gnuplot_; int numIntervals_; + GnuplotInterface<Scalar> gnuplotpcsw_; + GnuplotInterface<Scalar> gnuplotswpc_; + GnuplotInterface<Scalar> gnuplotdpcdsw_; + GnuplotInterface<Scalar> gnuplotdswdpc_; + GnuplotInterface<Scalar> gnuplotkr_; + GnuplotInterface<Scalar> gnuplotkrdsw_; }; } // end of namespace diff --git a/dumux/io/plotthermalconductivitymodel.hh b/dumux/io/plotthermalconductivitymodel.hh index 79ad9a9af4..ae4bd484f6 100644 --- a/dumux/io/plotthermalconductivitymodel.hh +++ b/dumux/io/plotthermalconductivitymodel.hh @@ -61,6 +61,13 @@ class PlotThermalConductivityModel }; public: + DUNE_DEPRECATED_MSG("Constructor() has changed signature") + PlotThermalConductivityModel() + : numIntervals_(1000) + { + PlotThermalConductivityModel(293.15, 1e5); + } + /*! * \brief Constructor * @@ -68,8 +75,9 @@ public: * * \param temperature temperature in \f$\mathrm{[K]}\f$ * \param pressure reference pressure in \f$\mathrm{[Pa]}\f$ + * \param interaction Specifies whether a live output via a gnuplot window is wanted */ - PlotThermalConductivityModel(Scalar temperature, Scalar pressure) + PlotThermalConductivityModel(Scalar temperature, Scalar pressure, bool interaction = true) : numIntervals_(1000) { FluidState fluidstate; @@ -78,14 +86,20 @@ public: fluidstate.setPressure(nPhaseIdx, pressure); lambdaW_ = FluidSystem::template thermalConductivity<FluidState>(fluidstate, wPhaseIdx); lambdaN_ = FluidSystem::template thermalConductivity<FluidState>(fluidstate, nPhaseIdx); + gnuplot_.setInteraction(interaction); } - //! Constructor - DUNE_DEPRECATED_MSG("Constructor() has changed signature") - PlotThermalConductivityModel() - : numIntervals_(1000) + + DUNE_DEPRECATED_MSG("plotlambdaeff() has changed signature") + void plotlambdaeff(Scalar porosity, + Scalar rhoSolid, + Scalar lambdaSolid, + Scalar lowerSat, + Scalar upperSat, + std::string plotName, + bool interaction) { - PlotThermalConductivityModel(293.15, 1e5); + plotlambdaeff(porosity, rhoSolid, lambdaSolid, lowerSat, upperSat, plotName); } /*! @@ -97,15 +111,13 @@ public: * \param lowerSat Minimum x-value * \param upperSat Maximum x-value * \param plotName Name of the plotted curve - * \param interaction Specifies whether a live output via a gnuplot window is wanted */ void plotlambdaeff(Scalar porosity, Scalar rhoSolid, Scalar lambdaSolid, Scalar lowerSat = 0.0, Scalar upperSat = 1.0, - std::string plotName = "lambda_eff", - bool interaction = true) + std::string plotName = "") { std::vector<Scalar> sw(numIntervals_+1); std::vector<Scalar> lambda(numIntervals_+1); @@ -123,18 +135,17 @@ public: lambdaMax = std::max(lambdaMax, lambda[i]); } - unsigned int windowNumber = 8; - gnuplot_.setXRange(lowerSat, upperSat,windowNumber); - gnuplot_.setYRange(lambdaMin, lambdaMax, windowNumber); - gnuplot_.setXlabel("wetting phase saturation [-]", windowNumber); - gnuplot_.setYlabel("effective thermal conductivity [W/(m K)]", windowNumber); - gnuplot_.addDataSetToPlot(sw, lambda, plotName, windowNumber); - gnuplot_.plot("lambdaeff", windowNumber, interaction); + gnuplot_.setXRange(lowerSat, upperSat); + gnuplot_.setYRange(lambdaMin, lambdaMax); + gnuplot_.setXlabel("wetting phase saturation [-]"); + gnuplot_.setYlabel("effective thermal conductivity [W/(m K)]"); + gnuplot_.addDataSetToPlot(sw, lambda, plotName + "_lambda_eff"); + gnuplot_.plot("lambdaeff"); } private: - GnuplotInterface<Scalar> gnuplot_; int numIntervals_; + GnuplotInterface<Scalar> gnuplot_; Scalar lambdaN_; Scalar lambdaW_; }; diff --git a/test/implicit/2p2c/test_box2p2cni.input b/test/implicit/2p2c/test_box2p2cni.input index c391abd004..b166d6eaa2 100644 --- a/test/implicit/2p2c/test_box2p2cni.input +++ b/test/implicit/2p2c/test_box2p2cni.input @@ -9,4 +9,4 @@ File = ./grids/test_2p2cni.dgf Name = waterairbox [Output] -PlotFluidMatrixInteractions = true +PlotFluidMatrixInteractions = false diff --git a/test/implicit/2p2c/test_cc2p2cni.input b/test/implicit/2p2c/test_cc2p2cni.input index 35d29d8ef1..7edffc9ade 100644 --- a/test/implicit/2p2c/test_cc2p2cni.input +++ b/test/implicit/2p2c/test_cc2p2cni.input @@ -9,4 +9,4 @@ File = ./grids/test_2p2cni.dgf Name = wateraircc [Output] -PlotFluidMatrixInteractions = true +PlotFluidMatrixInteractions = false diff --git a/test/implicit/2p2c/waterairspatialparams.hh b/test/implicit/2p2c/waterairspatialparams.hh index 62eb97148e..b3b071d942 100644 --- a/test/implicit/2p2c/waterairspatialparams.hh +++ b/test/implicit/2p2c/waterairspatialparams.hh @@ -126,21 +126,21 @@ public: */ void plotMaterialLaw() { - PlotMaterialLaw<TypeTag> plotMaterialLaw; - PlotEffectiveDiffusivityModel<TypeTag> plotEffectiveDiffusivityModel; - PlotThermalConductivityModel<TypeTag> plotThermalConductivityModel(283.15/*temperature*/, 1e5/*pressure*/); - plotMaterialLaw.plotpcsw(fineMaterialParams_, 0.2, 1.0, "fine", plotFluidMatrixInteractions_); - plotMaterialLaw.plotpcsw(coarseMaterialParams_, 0.2, 1.0, "coarse", plotFluidMatrixInteractions_); - plotMaterialLaw.plotkr(fineMaterialParams_, 0.2, 1.0, "fine", plotFluidMatrixInteractions_); - plotMaterialLaw.plotkr(coarseMaterialParams_, 0.2, 1.0, "coarse", plotFluidMatrixInteractions_); - - plotEffectiveDiffusivityModel.plotdeff(finePorosity_, 0.0, 1.0, "fine", plotFluidMatrixInteractions_); - plotEffectiveDiffusivityModel.plotdeff(coarsePorosity_, 0.0, 1.0, "coarse", plotFluidMatrixInteractions_); - - plotThermalConductivityModel.plotlambdaeff(finePorosity_, 2700.0, lambdaSolid_, - 0.0, 1.0, "fine", plotFluidMatrixInteractions_); - plotThermalConductivityModel.plotlambdaeff(coarsePorosity_, 2700.0, lambdaSolid_, - 0.0, 1.0, "coarse", plotFluidMatrixInteractions_); + PlotMaterialLaw<TypeTag> plotMaterialLaw(plotFluidMatrixInteractions_); + PlotEffectiveDiffusivityModel<TypeTag> plotEffectiveDiffusivityModel(plotFluidMatrixInteractions_); + PlotThermalConductivityModel<TypeTag> plotThermalConductivityModel(283.15/*temperature*/, 1e5/*pressure*/, + plotFluidMatrixInteractions_); + + plotMaterialLaw.plotpcsw(fineMaterialParams_, 0.2, 1.0, "fine"); + plotMaterialLaw.plotpcsw(coarseMaterialParams_, 0.2, 1.0, "coarse"); + plotMaterialLaw.plotkr(fineMaterialParams_, 0.2, 1.0, "fine"); + plotMaterialLaw.plotkr(coarseMaterialParams_, 0.2, 1.0, "coarse"); + + plotEffectiveDiffusivityModel.plotdeff(finePorosity_, 0.0, 1.0, "fine"); + plotEffectiveDiffusivityModel.plotdeff(coarsePorosity_, 0.0, 1.0, "coarse"); + + plotThermalConductivityModel.plotlambdaeff(finePorosity_, 2700.0, lambdaSolid_, 0.0, 1.0, "fine"); + plotThermalConductivityModel.plotlambdaeff(coarsePorosity_, 2700.0, lambdaSolid_, 0.0, 1.0, "coarse"); } /*! diff --git a/test/implicit/mpnc/evaporationatmosphereproblem.hh b/test/implicit/mpnc/evaporationatmosphereproblem.hh index c25810f92a..577b13adcb 100644 --- a/test/implicit/mpnc/evaporationatmosphereproblem.hh +++ b/test/implicit/mpnc/evaporationatmosphereproblem.hh @@ -248,7 +248,7 @@ public: */ EvaporationAtmosphereProblem(TimeManager &timeManager, const GridView &gridView) - : ParentType(timeManager, gridView) + : ParentType(timeManager, gridView), gnuplot_(false) { this->timeManager().startNextEpisode(24.* 3600.); } @@ -362,18 +362,17 @@ public: } // use gnuplot for plotting the line data - unsigned int windowNumber = 0; - gnuplot_.reset(windowNumber); - gnuplot_.setXlabel("xN2w [-]", windowNumber); - gnuplot_.setYlabel("y [m]", windowNumber); + gnuplot_.setInteraction(true); + gnuplot_.reset(); + gnuplot_.setXlabel("xN2w [-]"); + gnuplot_.setYlabel("y [m]"); std::ostringstream stream; stream << this->timeManager().time(); - gnuplot_.setOption("set label 'at time " + stream.str() + "' at screen 0.15,0.90 left", windowNumber); - gnuplot_.setDatafileSeparator(' ', windowNumber); + gnuplot_.setOption("set label 'at time " + stream.str() + "' at screen 0.15,0.90 left"); + gnuplot_.setDatafileSeparator(' '); std::string fileName = outputName_ + "plotOverLineIntoDepth.dat"; - gnuplot_.addFileToPlot(fileName, fileName, - windowNumber, " u 11:4 w l"); - gnuplot_.plot("plot", windowNumber, true); + gnuplot_.addFileToPlot(fileName, fileName, " u 11:4 w l"); + gnuplot_.plot("plot"); } /*! diff --git a/test/io/gnuplotinterface/test_gnuplotinterface.cc b/test/io/gnuplotinterface/test_gnuplotinterface.cc index ca3793e3f1..1a285b96ec 100644 --- a/test/io/gnuplotinterface/test_gnuplotinterface.cc +++ b/test/io/gnuplotinterface/test_gnuplotinterface.cc @@ -30,7 +30,7 @@ //////////////////////// int main() { - Dumux::GnuplotInterface<double> gnuplot; + Dumux::GnuplotInterface<double> gnuplot(false); unsigned int numIntervals = 100; std::vector<double> x(101); @@ -49,18 +49,16 @@ int main() yMax = std::max(yMax, y[i]); } - unsigned int windowNumber = 0; - gnuplot.reset(windowNumber); - gnuplot.setXRange(0, 5, windowNumber); - gnuplot.setYRange(yMin, yMax, windowNumber); - gnuplot.setXlabel("x [-]", windowNumber); - gnuplot.setYlabel("f(x) [-]", windowNumber); - gnuplot.setDatafileSeparator(',', windowNumber); - gnuplot.setOption("set arrow from 0,0 to 2,20 head filled lc rgb 'dark-gray'", windowNumber); - gnuplot.setOption("set label 'arrow' at 1,15 center tc rgb 'dark-gray'", windowNumber); - gnuplot.addDataSetToPlot(x, y, "dataSet_f(x)=x^2", windowNumber, "every 5 w lp ps 2"); - gnuplot.addFunctionToPlot("x**3", "function_f(x)=x^3", windowNumber); - gnuplot.addFileToPlot("0_dataSet_f(x)=x^2.dat", "file_f(x)=x^2.dat", windowNumber); - gnuplot.plot("plot", windowNumber, true); + gnuplot.setXRange(0, 5); + gnuplot.setYRange(yMin, yMax); + gnuplot.setXlabel("x [-]"); + gnuplot.setYlabel("f(x) [-]"); + gnuplot.setDatafileSeparator(','); + gnuplot.setOption("set arrow from 0,0 to 2,20 head filled lc rgb 'dark-gray'"); + gnuplot.setOption("set label 'arrow' at 1,15 center tc rgb 'dark-gray'"); + gnuplot.addDataSetToPlot(x, y, "dataSet_f(x)=x^2", "every 5 w lp ps 2"); + gnuplot.addFunctionToPlot("x**3", "function_f(x)=x^3"); + gnuplot.addFileToPlot("0_dataSet_f(x)=x^2.dat", "file_f(x)=x^2.dat"); + gnuplot.plot("plot"); exit(0); } diff --git a/test/material/fluidmatrixinteractions/2p/CMakeLists.txt b/test/material/fluidmatrixinteractions/2p/CMakeLists.txt index 197a86e9b8..85d920aae1 100644 --- a/test/material/fluidmatrixinteractions/2p/CMakeLists.txt +++ b/test/material/fluidmatrixinteractions/2p/CMakeLists.txt @@ -2,22 +2,22 @@ add_dumux_test(test_thermalconductivityjohansen test_thermalconductivityjohansen ${CMAKE_SOURCE_DIR}/bin/runTest.sh exact ${CMAKE_SOURCE_DIR}/test/references/thermalconductivityjohansen-reference.dat - ${CMAKE_CURRENT_BINARY_DIR}/8_lambda_eff_johansen.dat + ${CMAKE_CURRENT_BINARY_DIR}/johansen_lambda_eff.dat ${CMAKE_CURRENT_BINARY_DIR}/test_thermalconductivityjohansen -TimeManager.DtInitial 1 # [s] -TimeManager.TEnd 2 # [s] -Grid.File ${CMAKE_SOURCE_DIR}/test/implicit/2p/grids/test_2p.dgf - -Conductivity.File lambda_eff_johansen + -Conductivity.File johansen ) add_dumux_test(test_thermalconductivitysomerton test_thermalconductivitysomerton test_thermalconductivitysomerton.cc ${CMAKE_SOURCE_DIR}/bin/runTest.sh exact ${CMAKE_SOURCE_DIR}/test/references/thermalconductivitysomerton-reference.dat - ${CMAKE_CURRENT_BINARY_DIR}/8_lambda_eff_somerton.dat + ${CMAKE_CURRENT_BINARY_DIR}/somerton_lambda_eff.dat ${CMAKE_CURRENT_BINARY_DIR}/test_thermalconductivitysomerton -TimeManager.DtInitial 1 # [s] -TimeManager.TEnd 2 # [s] -Grid.File ${CMAKE_SOURCE_DIR}/test/implicit/2p/grids/test_2p.dgf - -Conductivity.File lambda_eff_somerton + -Conductivity.File somerton ) diff --git a/test/material/fluidmatrixinteractions/2p/thermalconductivityspatialparams.hh b/test/material/fluidmatrixinteractions/2p/thermalconductivityspatialparams.hh index da6a5bf19e..6d193a258e 100644 --- a/test/material/fluidmatrixinteractions/2p/thermalconductivityspatialparams.hh +++ b/test/material/fluidmatrixinteractions/2p/thermalconductivityspatialparams.hh @@ -106,10 +106,10 @@ public: */ void plotMaterialLaw() { - PlotThermalConductivityModel<TypeTag> plotThermalConductivityModel_(293.15, 1e5); + PlotThermalConductivityModel<TypeTag> plotThermalConductivityModel_(293.15, 1e5, false); std::string fileName = GET_RUNTIME_PARAM_FROM_GROUP(TypeTag, std::string, Conductivity, File); plotThermalConductivityModel_.plotlambdaeff(porosity_, rhoSolid_, lambdaSolid_, - 0.0, 1.0, fileName, false); + 0.0, 1.0, fileName); } /*! diff --git a/test/material/fluidmatrixinteractions/CMakeLists.txt b/test/material/fluidmatrixinteractions/CMakeLists.txt index 7748fe7de2..03bc5e7869 100644 --- a/test/material/fluidmatrixinteractions/CMakeLists.txt +++ b/test/material/fluidmatrixinteractions/CMakeLists.txt @@ -4,23 +4,23 @@ add_dumux_test(test_effectivediffusivitymillingtonquirk test_effectivediffusivit ${CMAKE_SOURCE_DIR}/bin/runTest.sh exact ${CMAKE_SOURCE_DIR}/test/references/effectivediffusivitymillingtonquirk-reference.dat - ${CMAKE_CURRENT_BINARY_DIR}/7_deff_millingtonquirk.dat + ${CMAKE_CURRENT_BINARY_DIR}/millingtonquirk_d_eff.dat ${CMAKE_CURRENT_BINARY_DIR}/test_effectivediffusivitymillingtonquirk -TimeManager.DtInitial 1 # [s] -TimeManager.TEnd 2 # [s] -Grid.File ${CMAKE_SOURCE_DIR}/test/implicit/2p/grids/test_2p.dgf - -Diffusivity.File deff_millingtonquirk + -Diffusivity.File millingtonquirk ) add_dumux_test(test_effectivediffusivityconstanttau test_effectivediffusivityconstanttau test_effectivediffusivityconstanttau.cc ${CMAKE_SOURCE_DIR}/bin/runTest.sh exact ${CMAKE_SOURCE_DIR}/test/references/effectivediffusivityconstanttau-reference.dat - ${CMAKE_CURRENT_BINARY_DIR}/7_deff_constanttau.dat + ${CMAKE_CURRENT_BINARY_DIR}/constanttau_d_eff.dat ${CMAKE_CURRENT_BINARY_DIR}/test_effectivediffusivityconstanttau -TimeManager.DtInitial 1 # [s] -TimeManager.TEnd 2 # [s] -Grid.File ${CMAKE_SOURCE_DIR}/test/implicit/2p/grids/test_2p.dgf - -Diffusivity.File deff_constanttau + -Diffusivity.File constanttau -tau 0.3 ) diff --git a/test/material/fluidmatrixinteractions/effectivediffusivityspatialparams.hh b/test/material/fluidmatrixinteractions/effectivediffusivityspatialparams.hh index ce08f4a8bf..e778697e64 100644 --- a/test/material/fluidmatrixinteractions/effectivediffusivityspatialparams.hh +++ b/test/material/fluidmatrixinteractions/effectivediffusivityspatialparams.hh @@ -106,9 +106,9 @@ public: */ void plotMaterialLaw() { - PlotEffectiveDiffusivityModel<TypeTag> plotEffectiveDiffusivityModel; + PlotEffectiveDiffusivityModel<TypeTag> plotEffectiveDiffusivityModel(false); std::string fileName = GET_RUNTIME_PARAM_FROM_GROUP(TypeTag, std::string, Diffusivity, File); - plotEffectiveDiffusivityModel.plotdeff(porosity_, 0.0, 1.0, fileName, false); + plotEffectiveDiffusivityModel.plotdeff(porosity_, 0.0, 1.0, fileName); } /*! diff --git a/test/multidomain/2cnistokes2p2cni/2p2cnisubproblem.hh b/test/multidomain/2cnistokes2p2cni/2p2cnisubproblem.hh index 7c8cb03e32..fa027b7cc0 100644 --- a/test/multidomain/2cnistokes2p2cni/2p2cnisubproblem.hh +++ b/test/multidomain/2cnistokes2p2cni/2p2cnisubproblem.hh @@ -399,14 +399,14 @@ public: << std::endl; evaporationFile << time/86400.0 << " " << storageChange[contiWEqIdx]*86400.0 << std::endl; - unsigned int windowNumber = 1; - gnuplot_.reset(windowNumber); - gnuplot_.setXRange(0.0, time/86400.0, windowNumber); - gnuplot_.setYRange(0.0, 12.0, windowNumber); - gnuplot_.setXlabel("time [d]", windowNumber); - gnuplot_.setYlabel("evaporation rate [mm/d]", windowNumber); - gnuplot_.addFileToPlot("evaporation.out", "evaporation.out", windowNumber); - gnuplot_.plot("evaporation", windowNumber, liveEvaporationRates_); + gnuplot_.reset(); + gnuplot_.setInteraction(liveEvaporationRates_); + gnuplot_.setXRange(0.0, time/86400.0); + gnuplot_.setYRange(0.0, 12.0); + gnuplot_.setXlabel("time [d]"); + gnuplot_.setYlabel("evaporation rate [mm/d]"); + gnuplot_.addFileToPlot("evaporation.out", "evaporation.out"); + gnuplot_.plot("evaporation"); } storageLastTimestep_ = storage; -- GitLab