From 55bb38118ce0901239d7c7013ac1a22c057fc821 Mon Sep 17 00:00:00 2001 From: Andreas Lauser Date: Fri, 7 Mar 2014 11:34:55 +0100 Subject: [PATCH] problems: make the name() methods static this allows to retrieve the name of the problem before it is instantiated. this is required to be able to print the "Initializing problem" message at the correct point (i.e., before instantiating the problem). --- examples/problems/co2injectionproblem.hh | 14 ++++++-------- examples/problems/cuvetteproblem.hh | 11 ++++------- examples/problems/diffusionproblem.hh | 12 ++++-------- examples/problems/fingerproblem.hh | 9 ++++----- examples/problems/fractureproblem.hh | 11 +++++------ examples/problems/groundwaterproblem.hh | 8 ++++---- examples/problems/infiltrationproblem.hh | 8 ++++---- examples/problems/lensproblem.hh | 8 ++++---- examples/problems/navierstokestestproblem.hh | 5 ++--- examples/problems/obstacleproblem.hh | 9 ++++----- examples/problems/outflowproblem.hh | 6 +++--- examples/problems/powerinjectionproblem.hh | 9 ++++----- examples/problems/reservoirproblem.hh | 14 +++++--------- examples/problems/richardslensproblem.hh | 6 +++--- examples/problems/stokes2ctestproblem.hh | 6 +++--- examples/problems/stokesnitestproblem.hh | 6 +++--- examples/problems/stokestestproblem.hh | 6 +++--- examples/problems/waterairproblem.hh | 9 +++++---- examples/tutorial1problem.hh | 4 ++-- ...upled-heuristix.vtu => tutorial1-heuristix.vtu} | 0 tests/run-vtu-test.sh | 8 ++++---- 21 files changed, 76 insertions(+), 93 deletions(-) rename tests/referencesolutions/{tutorial_coupled-heuristix.vtu => tutorial1-heuristix.vtu} (100%) diff --git a/examples/problems/co2injectionproblem.hh b/examples/problems/co2injectionproblem.hh index 95cec1e67..24645564d 100644 --- a/examples/problems/co2injectionproblem.hh +++ b/examples/problems/co2injectionproblem.hh @@ -212,11 +212,11 @@ class Co2InjectionProblem : public GET_PROP_TYPE(TypeTag, BaseProblem) typedef typename GET_PROP_TYPE(TypeTag, PrimaryVariables) PrimaryVariables; typedef typename GET_PROP_TYPE(TypeTag, RateVector) RateVector; - typedef typename GET_PROP_TYPE(TypeTag, - BoundaryRateVector) BoundaryRateVector; + typedef typename GET_PROP_TYPE(TypeTag, BoundaryRateVector) BoundaryRateVector; typedef typename GET_PROP_TYPE(TypeTag, MaterialLaw) MaterialLaw; typedef typename GET_PROP_TYPE(TypeTag, TimeManager) TimeManager; typedef typename GET_PROP_TYPE(TypeTag, MaterialLawParams) MaterialLawParams; + typedef typename GET_PROP_TYPE(TypeTag, Model) Model; typedef typename GET_PROP_TYPE(TypeTag, HeatConductionLaw) HeatConductionLaw; typedef typename HeatConductionLaw::Params HeatConductionLawParams; @@ -249,7 +249,6 @@ public: maxDepth_ = EWOMS_GET_PARAM(TypeTag, Scalar, MaxDepth); temperature_ = EWOMS_GET_PARAM(TypeTag, Scalar, Temperature); - name_ = EWOMS_GET_PARAM(TypeTag, std::string, SimulationName); // initialize the tables of the fluid system // FluidSystem::init(); @@ -334,13 +333,14 @@ public: /*! * \copydoc VcfvProblem::name */ - std::string name() const + static std::string name() { std::ostringstream oss; - oss << name_ << "_" << this->model().name(); + oss << EWOMS_GET_PARAM(TypeTag, std::string, SimulationName) + << "_" << Model::name(); if (GET_PROP_VALUE(TypeTag, EnableEnergy)) oss << "_ni"; - oss << "_" << this->model().discretizationName(); + oss << "_" << Model::discretizationName(); return oss.str(); } @@ -617,8 +617,6 @@ private: int nTemperature_; int nPressure_; - std::string name_; - Scalar pressureLow_, pressureHigh_; Scalar temperatureLow_, temperatureHigh_; }; diff --git a/examples/problems/cuvetteproblem.hh b/examples/problems/cuvetteproblem.hh index 806d7a66c..72b9b605d 100644 --- a/examples/problems/cuvetteproblem.hh +++ b/examples/problems/cuvetteproblem.hh @@ -162,9 +162,9 @@ class CuvetteProblem : public GET_PROP_TYPE(TypeTag, BaseProblem) HeatConductionLawParams; typedef typename GET_PROP_TYPE(TypeTag, PrimaryVariables) PrimaryVariables; typedef typename GET_PROP_TYPE(TypeTag, RateVector) RateVector; - typedef typename GET_PROP_TYPE(TypeTag, - BoundaryRateVector) BoundaryRateVector; + typedef typename GET_PROP_TYPE(TypeTag, BoundaryRateVector) BoundaryRateVector; typedef typename GET_PROP_TYPE(TypeTag, TimeManager) TimeManager; + typedef typename GET_PROP_TYPE(TypeTag, Model) Model; typedef typename GET_PROP_TYPE(TypeTag, FluidSystem) FluidSystem; // copy some indices for convenience @@ -288,11 +288,8 @@ public: /*! * \copydoc VcfvProblem::name */ - const char *name() const - { - static std::string tmp = std::string("cuvette_") + this->model().name(); - return tmp.c_str(); - } + static std::string name() + { return std::string("cuvette_") + Model::name(); } //! \} diff --git a/examples/problems/diffusionproblem.hh b/examples/problems/diffusionproblem.hh index 4ff20fd16..3f528b34b 100644 --- a/examples/problems/diffusionproblem.hh +++ b/examples/problems/diffusionproblem.hh @@ -133,6 +133,7 @@ class DiffusionProblem : public GET_PROP_TYPE(TypeTag, BaseProblem) typedef typename GET_PROP_TYPE(TypeTag, FluidSystem) FluidSystem; typedef typename GET_PROP_TYPE(TypeTag, PrimaryVariables) PrimaryVariables; typedef typename GET_PROP_TYPE(TypeTag, TimeManager) TimeManager; + typedef typename GET_PROP_TYPE(TypeTag, Model) Model; enum { // number of phases @@ -152,8 +153,7 @@ class DiffusionProblem : public GET_PROP_TYPE(TypeTag, BaseProblem) }; typedef typename GET_PROP_TYPE(TypeTag, RateVector) RateVector; - typedef typename GET_PROP_TYPE(TypeTag, - BoundaryRateVector) BoundaryRateVector; + typedef typename GET_PROP_TYPE(TypeTag, BoundaryRateVector) BoundaryRateVector; typedef typename GET_PROP_TYPE(TypeTag, MaterialLaw) MaterialLaw; typedef typename GET_PROP_TYPE(TypeTag, MaterialLawParams) MaterialLawParams; @@ -195,12 +195,8 @@ public: /*! * \copydoc VcfvProblem::name */ - const std::string name() const - { - std::ostringstream oss; - oss << "diffusion_" << this->model().name(); - return oss.str(); - } + static std::string name() + { return std::string("diffusion_") + Model::name(); } //! \} diff --git a/examples/problems/fingerproblem.hh b/examples/problems/fingerproblem.hh index 0249087cf..7e35a4659 100644 --- a/examples/problems/fingerproblem.hh +++ b/examples/problems/fingerproblem.hh @@ -174,6 +174,7 @@ class FingerProblem : public GET_PROP_TYPE(TypeTag, BaseProblem) typedef typename GET_PROP_TYPE(TypeTag, PrimaryVariables) PrimaryVariables; typedef typename GET_PROP_TYPE(TypeTag, TimeManager) TimeManager; typedef typename GET_PROP_TYPE(TypeTag, Constraints) Constraints; + typedef typename GET_PROP_TYPE(TypeTag, Model) Model; enum { // number of phases @@ -192,11 +193,9 @@ class FingerProblem : public GET_PROP_TYPE(TypeTag, BaseProblem) typedef typename GET_PROP_TYPE(TypeTag, ElementContext) ElementContext; typedef typename GET_PROP_TYPE(TypeTag, RateVector) RateVector; - typedef typename GET_PROP_TYPE(TypeTag, - BoundaryRateVector) BoundaryRateVector; + typedef typename GET_PROP_TYPE(TypeTag, BoundaryRateVector) BoundaryRateVector; typedef typename GET_PROP(TypeTag, MaterialLaw)::ParkerLenhard ParkerLenhard; - typedef typename GET_PROP_TYPE(TypeTag, MaterialLaw) MaterialLaw; typedef typename GET_PROP_TYPE(TypeTag, MaterialLawParams) MaterialLawParams; @@ -233,8 +232,8 @@ public: /*! * \copydoc VcfvProblem::name */ - std::string name() const - { return std::string("finger_") + this->model().name(); } + static std::string name() + { return std::string("finger_") + Model::name(); } /*! * \copydoc FvBaseMultiPhaseProblem::registerParameters diff --git a/examples/problems/fractureproblem.hh b/examples/problems/fractureproblem.hh index 611ab4a9c..697eb0ea4 100644 --- a/examples/problems/fractureproblem.hh +++ b/examples/problems/fractureproblem.hh @@ -169,15 +169,14 @@ class FractureProblem : public GET_PROP_TYPE(TypeTag, BaseProblem) typedef typename GET_PROP_TYPE(TypeTag, Constraints) Constraints; typedef typename GET_PROP_TYPE(TypeTag, EqVector) EqVector; typedef typename GET_PROP_TYPE(TypeTag, PrimaryVariables) PrimaryVariables; - typedef typename GET_PROP_TYPE(TypeTag, - BoundaryRateVector) BoundaryRateVector; + typedef typename GET_PROP_TYPE(TypeTag, BoundaryRateVector) BoundaryRateVector; typedef typename GET_PROP_TYPE(TypeTag, RateVector) RateVector; typedef typename GET_PROP_TYPE(TypeTag, TimeManager) TimeManager; typedef typename GET_PROP_TYPE(TypeTag, Scalar) Scalar; typedef typename GET_PROP_TYPE(TypeTag, MaterialLaw) MaterialLaw; typedef typename GET_PROP_TYPE(TypeTag, MaterialLawParams) MaterialLawParams; - typedef typename GET_PROP_TYPE(TypeTag, HeatConductionLawParams) - HeatConductionLawParams; + typedef typename GET_PROP_TYPE(TypeTag, HeatConductionLawParams) HeatConductionLawParams; + typedef typename GET_PROP_TYPE(TypeTag, Model) Model; enum { // phase indices @@ -273,10 +272,10 @@ public: /*! * \copydoc VcfvProblem::name */ - std::string name() const + static std::string name() { std::ostringstream oss; - oss << "fracture_" << this->model().name(); + oss << "fracture_" << Model::name(); return oss.str(); } diff --git a/examples/problems/groundwaterproblem.hh b/examples/problems/groundwaterproblem.hh index bc02875ce..427ecf883 100644 --- a/examples/problems/groundwaterproblem.hh +++ b/examples/problems/groundwaterproblem.hh @@ -138,9 +138,9 @@ class GroundWaterProblem : public GET_PROP_TYPE(TypeTag, BaseProblem) typedef typename GET_PROP_TYPE(TypeTag, TimeManager) TimeManager; typedef typename GET_PROP_TYPE(TypeTag, FluidSystem) FluidSystem; typedef typename GET_PROP_TYPE(TypeTag, RateVector) RateVector; - typedef typename GET_PROP_TYPE(TypeTag, - BoundaryRateVector) BoundaryRateVector; + typedef typename GET_PROP_TYPE(TypeTag, BoundaryRateVector) BoundaryRateVector; typedef typename GET_PROP_TYPE(TypeTag, PrimaryVariables) PrimaryVariables; + typedef typename GET_PROP_TYPE(TypeTag, Model) Model; typedef typename GridView::ctype CoordScalar; typedef Dune::FieldVector GlobalPosition; @@ -229,10 +229,10 @@ public: /*! * \copydoc VcfvProblem::name */ - std::string name() const + static std::string name() { std::ostringstream oss; - oss << "groundwater_" << this->model().name(); + oss << "groundwater_" << Model::name(); return oss.str(); } diff --git a/examples/problems/infiltrationproblem.hh b/examples/problems/infiltrationproblem.hh index 144f79475..7c778623c 100644 --- a/examples/problems/infiltrationproblem.hh +++ b/examples/problems/infiltrationproblem.hh @@ -152,10 +152,10 @@ class InfiltrationProblem : public GET_PROP_TYPE(TypeTag, BaseProblem) typedef typename GET_PROP_TYPE(TypeTag, MaterialLawParams) MaterialLawParams; typedef typename GET_PROP_TYPE(TypeTag, PrimaryVariables) PrimaryVariables; typedef typename GET_PROP_TYPE(TypeTag, RateVector) RateVector; - typedef typename GET_PROP_TYPE(TypeTag, - BoundaryRateVector) BoundaryRateVector; + typedef typename GET_PROP_TYPE(TypeTag, BoundaryRateVector) BoundaryRateVector; typedef typename GET_PROP_TYPE(TypeTag, TimeManager) TimeManager; typedef typename GET_PROP_TYPE(TypeTag, FluidSystem) FluidSystem; + typedef typename GET_PROP_TYPE(TypeTag, Model) Model; // copy some indices for convenience typedef typename GET_PROP_TYPE(TypeTag, Indices) Indices; @@ -248,10 +248,10 @@ public: /*! * \copydoc VcfvProblem::name */ - const std::string name() const + static std::string name() { std::ostringstream oss; - oss << "infiltration_" << this->model().name(); + oss << "infiltration_" << Model::name(); return oss.str(); } diff --git a/examples/problems/lensproblem.hh b/examples/problems/lensproblem.hh index f04b1b48e..e5d73652d 100644 --- a/examples/problems/lensproblem.hh +++ b/examples/problems/lensproblem.hh @@ -196,6 +196,7 @@ class LensProblem : public GET_PROP_TYPE(TypeTag, BaseProblem) typedef typename GET_PROP_TYPE(TypeTag, NonwettingPhase) NonwettingPhase; typedef typename GET_PROP_TYPE(TypeTag, PrimaryVariables) PrimaryVariables; typedef typename GET_PROP_TYPE(TypeTag, TimeManager) TimeManager; + typedef typename GET_PROP_TYPE(TypeTag, Model) Model; enum { // number of phases @@ -214,8 +215,7 @@ class LensProblem : public GET_PROP_TYPE(TypeTag, BaseProblem) }; typedef typename GET_PROP_TYPE(TypeTag, RateVector) RateVector; - typedef typename GET_PROP_TYPE(TypeTag, - BoundaryRateVector) BoundaryRateVector; + typedef typename GET_PROP_TYPE(TypeTag, BoundaryRateVector) BoundaryRateVector; typedef typename GET_PROP_TYPE(TypeTag, MaterialLaw) MaterialLaw; typedef typename GET_PROP_TYPE(TypeTag, MaterialLawParams) MaterialLawParams; @@ -359,10 +359,10 @@ public: /*! * \copydoc VcfvProblem::name */ - std::string name() const + static std::string name() { std::ostringstream oss; - oss << "lens_" << this->model().name(); + oss << "lens_" << Model::name(); return oss.str(); } diff --git a/examples/problems/navierstokestestproblem.hh b/examples/problems/navierstokestestproblem.hh index 3570d2576..3316811e1 100644 --- a/examples/problems/navierstokestestproblem.hh +++ b/examples/problems/navierstokestestproblem.hh @@ -106,8 +106,7 @@ class NavierStokesTestProblem : public StokesProblem typedef typename GET_PROP_TYPE(TypeTag, TimeManager) TimeManager; typedef typename GET_PROP_TYPE(TypeTag, PrimaryVariables) PrimaryVariables; typedef typename GET_PROP_TYPE(TypeTag, RateVector) RateVector; - typedef typename GET_PROP_TYPE(TypeTag, - BoundaryRateVector) BoundaryRateVector; + typedef typename GET_PROP_TYPE(TypeTag, BoundaryRateVector) BoundaryRateVector; typedef typename GET_PROP_TYPE(TypeTag, Constraints) Constraints; typedef typename GET_PROP_TYPE(TypeTag, Indices) Indices; @@ -147,7 +146,7 @@ public: /*! * \copydoc VcfvProblem::name */ - const char *name() const + static std::string name() { return "navierstokes"; } /*! diff --git a/examples/problems/obstacleproblem.hh b/examples/problems/obstacleproblem.hh index fef66dd8b..1cc4a10bf 100644 --- a/examples/problems/obstacleproblem.hh +++ b/examples/problems/obstacleproblem.hh @@ -142,11 +142,9 @@ class ObstacleProblem : public GET_PROP_TYPE(TypeTag, BaseProblem) typedef typename GET_PROP_TYPE(TypeTag, GridView) GridView; typedef typename GET_PROP_TYPE(TypeTag, Scalar) Scalar; - typedef typename GET_PROP_TYPE(TypeTag, RateVector) RateVector; typedef typename GET_PROP_TYPE(TypeTag, PrimaryVariables) PrimaryVariables; - typedef typename GET_PROP_TYPE(TypeTag, - BoundaryRateVector) BoundaryRateVector; + typedef typename GET_PROP_TYPE(TypeTag, BoundaryRateVector) BoundaryRateVector; typedef typename GET_PROP_TYPE(TypeTag, FluidSystem) FluidSystem; typedef typename GET_PROP_TYPE(TypeTag, MaterialLaw) MaterialLaw; typedef typename GET_PROP_TYPE(TypeTag, MaterialLawParams) MaterialLawParams; @@ -168,6 +166,7 @@ class ObstacleProblem : public GET_PROP_TYPE(TypeTag, BaseProblem) typedef Dune::FieldVector PhaseVector; typedef Dune::FieldMatrix DimMatrix; typedef typename GET_PROP_TYPE(TypeTag, TimeManager) TimeManager; + typedef typename GET_PROP_TYPE(TypeTag, Model) Model; public: /*! @@ -273,11 +272,11 @@ public: /*! * \copydoc VcfvProblem::name */ - const std::string name() const + static std::string name() { std::ostringstream oss; oss << "obstacle" - << "_" << this->model().name(); + << "_" << Model::name(); return oss.str(); } diff --git a/examples/problems/outflowproblem.hh b/examples/problems/outflowproblem.hh index f9c1e1013..90485177f 100644 --- a/examples/problems/outflowproblem.hh +++ b/examples/problems/outflowproblem.hh @@ -104,11 +104,11 @@ class OutflowProblem : public GET_PROP_TYPE(TypeTag, BaseProblem) typedef typename GET_PROP_TYPE(TypeTag, Scalar) Scalar; typedef typename GET_PROP_TYPE(TypeTag, PrimaryVariables) PrimaryVariables; typedef typename GET_PROP_TYPE(TypeTag, RateVector) RateVector; - typedef typename GET_PROP_TYPE(TypeTag, - BoundaryRateVector) BoundaryRateVector; + typedef typename GET_PROP_TYPE(TypeTag, BoundaryRateVector) BoundaryRateVector; typedef typename GET_PROP_TYPE(TypeTag, TimeManager) TimeManager; typedef typename GET_PROP_TYPE(TypeTag, FluidSystem) FluidSystem; typedef typename GET_PROP_TYPE(TypeTag, MaterialLawParams) MaterialLawParams; + typedef typename GET_PROP_TYPE(TypeTag, Model) Model; // copy some indices for convenience enum { @@ -159,7 +159,7 @@ public: /*! * \copydoc VcfvProblem::name */ - const char *name() const + static std::string name() { return "outflow"; } /*! diff --git a/examples/problems/powerinjectionproblem.hh b/examples/problems/powerinjectionproblem.hh index 5c7885e7e..1bac853e9 100644 --- a/examples/problems/powerinjectionproblem.hh +++ b/examples/problems/powerinjectionproblem.hh @@ -156,7 +156,10 @@ class PowerInjectionProblem : public GET_PROP_TYPE(TypeTag, BaseProblem) typedef typename GET_PROP_TYPE(TypeTag, WettingPhase) WettingPhase; typedef typename GET_PROP_TYPE(TypeTag, NonwettingPhase) NonwettingPhase; typedef typename GET_PROP_TYPE(TypeTag, PrimaryVariables) PrimaryVariables; + typedef typename GET_PROP_TYPE(TypeTag, RateVector) RateVector; + typedef typename GET_PROP_TYPE(TypeTag, BoundaryRateVector) BoundaryRateVector; typedef typename GET_PROP_TYPE(TypeTag, TimeManager) TimeManager; + typedef typename GET_PROP_TYPE(TypeTag, Model) Model; enum { // number of phases @@ -173,10 +176,6 @@ class PowerInjectionProblem : public GET_PROP_TYPE(TypeTag, BaseProblem) dimWorld = GridView::dimensionworld }; - typedef typename GET_PROP_TYPE(TypeTag, RateVector) RateVector; - typedef typename GET_PROP_TYPE(TypeTag, - BoundaryRateVector) BoundaryRateVector; - typedef typename GET_PROP_TYPE(TypeTag, MaterialLaw) MaterialLaw; typedef typename GET_PROP_TYPE(TypeTag, MaterialLawParams) MaterialLawParams; @@ -222,7 +221,7 @@ public: /*! * \copydoc VcfvProblem::name */ - std::string name() const + static std::string name() { std::ostringstream oss; oss << "powerinjection_"; diff --git a/examples/problems/reservoirproblem.hh b/examples/problems/reservoirproblem.hh index a3fc2e888..566e6f035 100644 --- a/examples/problems/reservoirproblem.hh +++ b/examples/problems/reservoirproblem.hh @@ -155,14 +155,13 @@ class ReservoirProblem : public GET_PROP_TYPE(TypeTag, BaseProblem) typedef typename GET_PROP_TYPE(TypeTag, PrimaryVariables) PrimaryVariables; typedef typename GET_PROP_TYPE(TypeTag, RateVector) RateVector; - typedef typename GET_PROP_TYPE(TypeTag, - BoundaryRateVector) BoundaryRateVector; + typedef typename GET_PROP_TYPE(TypeTag, BoundaryRateVector) BoundaryRateVector; typedef typename GET_PROP_TYPE(TypeTag, Constraints) Constraints; typedef typename GET_PROP_TYPE(TypeTag, MaterialLaw) MaterialLaw; - typedef typename GET_PROP_TYPE(TypeTag, - BlackOilFluidState) BlackOilFluidState; + typedef typename GET_PROP_TYPE(TypeTag, BlackOilFluidState) BlackOilFluidState; typedef typename GET_PROP_TYPE(TypeTag, TimeManager) TimeManager; typedef typename GET_PROP_TYPE(TypeTag, MaterialLawParams) MaterialLawParams; + typedef typename GET_PROP_TYPE(TypeTag, Model) Model; typedef typename GridView::ctype CoordScalar; typedef Dune::FieldVector GlobalPosition; @@ -186,7 +185,6 @@ public: temperature_ = EWOMS_GET_PARAM(TypeTag, Scalar, Temperature); maxDepth_ = EWOMS_GET_PARAM(TypeTag, Scalar, MaxDepth); - name_ = EWOMS_GET_PARAM(TypeTag, std::string, SimulationName); FluidSystem::initBegin(); std::vector > Bg @@ -354,8 +352,8 @@ public: /*! * \copydoc VcfvProblem::name */ - const std::string name() const - { return name_; } + static std::string name() + { return EWOMS_GET_PARAM(TypeTag, std::string, SimulationName); } /*! * \copydoc FvBaseMultiPhaseProblem::temperature @@ -588,8 +586,6 @@ private: Scalar temperature_; Scalar maxDepth_; Scalar eps_; - - std::string name_; }; } // namespace Ewoms diff --git a/examples/problems/richardslensproblem.hh b/examples/problems/richardslensproblem.hh index 5f20a9862..d54a7d303 100644 --- a/examples/problems/richardslensproblem.hh +++ b/examples/problems/richardslensproblem.hh @@ -146,12 +146,12 @@ class RichardsLensProblem : public GET_PROP_TYPE(TypeTag, BaseProblem) typedef typename GET_PROP_TYPE(TypeTag, GridView) GridView; typedef typename GET_PROP_TYPE(TypeTag, RateVector) RateVector; - typedef typename GET_PROP_TYPE(TypeTag, - BoundaryRateVector) BoundaryRateVector; + typedef typename GET_PROP_TYPE(TypeTag, BoundaryRateVector) BoundaryRateVector; typedef typename GET_PROP_TYPE(TypeTag, PrimaryVariables) PrimaryVariables; typedef typename GET_PROP_TYPE(TypeTag, TimeManager) TimeManager; typedef typename GET_PROP_TYPE(TypeTag, FluidSystem) FluidSystem; typedef typename GET_PROP_TYPE(TypeTag, Scalar) Scalar; + typedef typename GET_PROP_TYPE(TypeTag, Model) Model; typedef typename GET_PROP_TYPE(TypeTag, Indices) Indices; enum { @@ -228,7 +228,7 @@ public: /*! * \copydoc VcfvProblem::name */ - const char *name() const + static std::string name() { return "lens_richards"; } /*! diff --git a/examples/problems/stokes2ctestproblem.hh b/examples/problems/stokes2ctestproblem.hh index c1a37a2da..c2750e1ee 100644 --- a/examples/problems/stokes2ctestproblem.hh +++ b/examples/problems/stokes2ctestproblem.hh @@ -94,12 +94,12 @@ class Stokes2cTestProblem : public GET_PROP_TYPE(TypeTag, BaseProblem) typedef typename GET_PROP_TYPE(TypeTag, TimeManager) TimeManager; typedef typename GET_PROP_TYPE(TypeTag, Indices) Indices; typedef typename GET_PROP_TYPE(TypeTag, FluidSystem) FluidSystem; - typedef typename GET_PROP_TYPE(TypeTag, - BoundaryRateVector) BoundaryRateVector; + typedef typename GET_PROP_TYPE(TypeTag, BoundaryRateVector) BoundaryRateVector; typedef typename GET_PROP_TYPE(TypeTag, RateVector) RateVector; typedef typename GET_PROP_TYPE(TypeTag, PrimaryVariables) PrimaryVariables; typedef typename GET_PROP_TYPE(TypeTag, Constraints) Constraints; typedef typename GET_PROP_TYPE(TypeTag, Scalar) Scalar; + typedef typename GET_PROP_TYPE(TypeTag, Model) Model; enum { dimWorld = GridView::dimensionworld }; enum { numComponents = FluidSystem::numComponents }; @@ -144,7 +144,7 @@ public: /*! * \copydoc VcfvProblem::name */ - const char *name() const + static std::string name() { return "stokes2ctest"; } /*! diff --git a/examples/problems/stokesnitestproblem.hh b/examples/problems/stokesnitestproblem.hh index 720b1c4a2..bdbd3d25c 100644 --- a/examples/problems/stokesnitestproblem.hh +++ b/examples/problems/stokesnitestproblem.hh @@ -100,10 +100,10 @@ class StokesNiTestProblem : public GET_PROP_TYPE(TypeTag, BaseProblem) typedef typename GET_PROP_TYPE(TypeTag, FluidSystem) FluidSystem; typedef typename GET_PROP_TYPE(TypeTag, Constraints) Constraints; typedef typename GET_PROP_TYPE(TypeTag, RateVector) RateVector; - typedef typename GET_PROP_TYPE(TypeTag, - BoundaryRateVector) BoundaryRateVector; + typedef typename GET_PROP_TYPE(TypeTag, BoundaryRateVector) BoundaryRateVector; typedef typename GET_PROP_TYPE(TypeTag, PrimaryVariables) PrimaryVariables; typedef typename GET_PROP_TYPE(TypeTag, Scalar) Scalar; + typedef typename GET_PROP_TYPE(TypeTag, Model) Model; enum { // Number of equations and grid dimension numEq = GET_PROP_VALUE(TypeTag, NumEq), @@ -156,7 +156,7 @@ public: /*! * \copydoc VcfvProblem::name */ - const char *name() const + static std::string name() { return "stokestest_ni"; } //! \} diff --git a/examples/problems/stokestestproblem.hh b/examples/problems/stokestestproblem.hh index 4e93bf9ac..a14a608c0 100644 --- a/examples/problems/stokestestproblem.hh +++ b/examples/problems/stokestestproblem.hh @@ -100,12 +100,12 @@ class StokesTestProblem : public GET_PROP_TYPE(TypeTag, BaseProblem) typedef typename GET_PROP_TYPE(TypeTag, TimeManager) TimeManager; typedef typename GET_PROP_TYPE(TypeTag, Indices) Indices; typedef typename GET_PROP_TYPE(TypeTag, RateVector) RateVector; - typedef typename GET_PROP_TYPE(TypeTag, - BoundaryRateVector) BoundaryRateVector; + typedef typename GET_PROP_TYPE(TypeTag, BoundaryRateVector) BoundaryRateVector; typedef typename GET_PROP_TYPE(TypeTag, PrimaryVariables) PrimaryVariables; typedef typename GET_PROP_TYPE(TypeTag, Fluid) Fluid; typedef typename GET_PROP_TYPE(TypeTag, Scalar) Scalar; typedef typename GET_PROP_TYPE(TypeTag, Constraints) Constraints; + typedef typename GET_PROP_TYPE(TypeTag, Model) Model; enum { // Number of equations and grid dimension @@ -146,7 +146,7 @@ public: /*! * \copydoc VcfvProblem::name */ - const char *name() const + static std::string name() { return "stokestest"; } /*! diff --git a/examples/problems/waterairproblem.hh b/examples/problems/waterairproblem.hh index c41a33eb2..f886e11fe 100644 --- a/examples/problems/waterairproblem.hh +++ b/examples/problems/waterairproblem.hh @@ -185,15 +185,16 @@ class WaterAirProblem dimWorld = GridView::dimensionworld }; + static const bool enableEnergy = GET_PROP_VALUE(TypeTag, EnableEnergy); + typedef typename GET_PROP_TYPE(TypeTag, RateVector) RateVector; typedef typename GET_PROP_TYPE(TypeTag, BoundaryRateVector) BoundaryRateVector; typedef typename GET_PROP_TYPE(TypeTag, PrimaryVariables) PrimaryVariables; typedef typename GET_PROP_TYPE(TypeTag, Constraints) Constraints; typedef typename GET_PROP_TYPE(TypeTag, TimeManager) TimeManager; - + typedef typename GET_PROP_TYPE(TypeTag, Model) Model; typedef typename GET_PROP_TYPE(TypeTag, MaterialLaw) MaterialLaw; typedef typename GET_PROP_TYPE(TypeTag, MaterialLawParams) MaterialLawParams; - typedef typename GET_PROP_TYPE(TypeTag, HeatConductionLaw) HeatConductionLaw; typedef typename GET_PROP_TYPE(TypeTag, HeatConductionLawParams) HeatConductionLawParams; @@ -257,10 +258,10 @@ public: /*! * \copydoc VcfvProblem::name */ - std::string name() const + static std::string name() { std::ostringstream oss; - oss << "waterair_" << this->model().name(); + oss << "waterair_" << Model::name(); if (GET_PROP_VALUE(TypeTag, EnableEnergy)) oss << "_ni"; diff --git a/examples/tutorial1problem.hh b/examples/tutorial1problem.hh index 38e4cfb46..5820c2a5f 100644 --- a/examples/tutorial1problem.hh +++ b/examples/tutorial1problem.hh @@ -192,8 +192,8 @@ public: } //! Specifies the problem name. This is used for files generated by the simulation. - const char *name() const - { return "tutorial_coupled"; } + static std::string name() + { return "tutorial1"; } //! Returns the temperature at a given position. template diff --git a/tests/referencesolutions/tutorial_coupled-heuristix.vtu b/tests/referencesolutions/tutorial1-heuristix.vtu similarity index 100% rename from tests/referencesolutions/tutorial_coupled-heuristix.vtu rename to tests/referencesolutions/tutorial1-heuristix.vtu diff --git a/tests/run-vtu-test.sh b/tests/run-vtu-test.sh index 2e0c9f6b5..7c69e7e00 100755 --- a/tests/run-vtu-test.sh +++ b/tests/run-vtu-test.sh @@ -12,7 +12,7 @@ usage() { echo "Usage:" echo echo "runTest.sh TEST_TYPE TEST_BINARY [TEST_ARGS]" - echo "where TEST_TYPE can either be --plain or --simulation=\$NUM_CORES (is '$TEST_TYPE')." + echo "where TEST_TYPE can either be --plain, --simulation or --parallel-simulation=\$NUM_CORES (is '$TEST_TYPE')." }; validateResults() { @@ -90,7 +90,7 @@ case "$TEST_TYPE" in echo "######################" echo "RND: '$RND'" - SIM_NAME=$(grep "Initializing problem" "test-$RND.log" | sed "s/.*\"\(.*\)\".*/\1/" | head -n1) + SIM_NAME=$(grep "Initializing the problem" "test-$RND.log" | sed "s/.*\"\(.*\)\".*/\1/" | head -n1) NUM_TIMESTEPS=$(grep "Writing result" "test-$RND.log" | wc -l) TEST_RESULT=$(printf "%s-%05i" "$SIM_NAME" "$NUM_TIMESTEPS") TEST_RESULT=$(ls "$TEST_RESULT".*) @@ -119,8 +119,8 @@ case "$TEST_TYPE" in exit 1 fi - grep "Initializing problem" "test-$RND.log" - SIM_NAME=$(grep "Initializing problem" "test-$RND.log" | sed "s/.*\"\(.*\)\".*/\1/" | head -n1) + grep "Initializing the problem" "test-$RND.log" + SIM_NAME=$(grep "Initializing the problem" "test-$RND.log" | sed "s/.*\"\(.*\)\".*/\1/" | head -n1) NUM_TIMESTEPS=$(grep "Writing result" "test-$RND.log" | wc -l) rm "test-$RND.log"