refactoring: extend the TimeManager to become the Simulator

this also comes with moving responsibilities around and some smaller
cleanups for the grid creation. (although grid creation could be
possibly done by the simulator now, the GridCreator concept has not
been abandoned, yet...)
This commit is contained in:
Andreas Lauser
2014-04-14 20:32:30 +02:00
parent 8cdde5de31
commit a76b64bc56
22 changed files with 127 additions and 258 deletions

View File

@@ -211,7 +211,7 @@ class Co2InjectionProblem : public GET_PROP_TYPE(TypeTag, BaseProblem)
typedef typename GET_PROP_TYPE(TypeTag, RateVector) RateVector; 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, MaterialLaw) MaterialLaw;
typedef typename GET_PROP_TYPE(TypeTag, TimeManager) TimeManager; typedef typename GET_PROP_TYPE(TypeTag, Simulator) Simulator;
typedef typename GET_PROP_TYPE(TypeTag, MaterialLawParams) MaterialLawParams; typedef typename GET_PROP_TYPE(TypeTag, MaterialLawParams) MaterialLawParams;
typedef typename GET_PROP_TYPE(TypeTag, Model) Model; typedef typename GET_PROP_TYPE(TypeTag, Model) Model;
typedef typename GET_PROP_TYPE(TypeTag, HeatConductionLaw) HeatConductionLaw; typedef typename GET_PROP_TYPE(TypeTag, HeatConductionLaw) HeatConductionLaw;
@@ -225,14 +225,8 @@ public:
/*! /*!
* \copydoc Doxygen::defaultProblemConstructor * \copydoc Doxygen::defaultProblemConstructor
*/ */
Co2InjectionProblem(TimeManager &timeManager) Co2InjectionProblem(Simulator &simulator)
#if DUNE_VERSION_NEWER(DUNE_COMMON, 2, 3) : ParentType(simulator)
: ParentType(timeManager,
GET_PROP_TYPE(TypeTag, GridCreator)::grid().leafGridView())
#else
: ParentType(timeManager,
GET_PROP_TYPE(TypeTag, GridCreator)::grid().leafView())
#endif
{ {
eps_ = 1e-6; eps_ = 1e-6;

View File

@@ -150,12 +150,11 @@ class CuvetteProblem : public GET_PROP_TYPE(TypeTag, BaseProblem)
typedef typename GET_PROP_TYPE(TypeTag, MaterialLaw) MaterialLaw; typedef typename GET_PROP_TYPE(TypeTag, MaterialLaw) MaterialLaw;
typedef typename GET_PROP_TYPE(TypeTag, MaterialLawParams) MaterialLawParams; typedef typename GET_PROP_TYPE(TypeTag, MaterialLawParams) MaterialLawParams;
typedef typename GET_PROP_TYPE(TypeTag, HeatConductionLaw) HeatConductionLaw; typedef typename GET_PROP_TYPE(TypeTag, HeatConductionLaw) HeatConductionLaw;
typedef typename GET_PROP_TYPE(TypeTag, HeatConductionLawParams) typedef typename GET_PROP_TYPE(TypeTag, HeatConductionLawParams) HeatConductionLawParams;
HeatConductionLawParams;
typedef typename GET_PROP_TYPE(TypeTag, PrimaryVariables) PrimaryVariables; typedef typename GET_PROP_TYPE(TypeTag, PrimaryVariables) PrimaryVariables;
typedef typename GET_PROP_TYPE(TypeTag, RateVector) RateVector; 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, Simulator) Simulator;
typedef typename GET_PROP_TYPE(TypeTag, Model) Model; typedef typename GET_PROP_TYPE(TypeTag, Model) Model;
typedef typename GET_PROP_TYPE(TypeTag, FluidSystem) FluidSystem; typedef typename GET_PROP_TYPE(TypeTag, FluidSystem) FluidSystem;
@@ -182,15 +181,9 @@ public:
/*! /*!
* \copydoc Doxygen::defaultProblemConstructor * \copydoc Doxygen::defaultProblemConstructor
*/ */
CuvetteProblem(TimeManager &timeManager) CuvetteProblem(Simulator &simulator)
#if DUNE_VERSION_NEWER(DUNE_COMMON, 2, 3) : ParentType(simulator)
: ParentType(timeManager, , eps_(1e-6)
GET_PROP_TYPE(TypeTag, GridCreator)::grid().leafGridView()),
#else
: ParentType(timeManager,
GET_PROP_TYPE(TypeTag, GridCreator)::grid().leafView()),
#endif
eps_(1e-6)
{ {
if (Valgrind::IsRunning()) if (Valgrind::IsRunning())
FluidSystem::init(/*minT=*/283.15, /*maxT=*/500.0, /*nT=*/20, FluidSystem::init(/*minT=*/283.15, /*maxT=*/500.0, /*nT=*/20,

View File

@@ -132,7 +132,7 @@ class DiffusionProblem : public GET_PROP_TYPE(TypeTag, BaseProblem)
typedef typename GET_PROP_TYPE(TypeTag, GridView) GridView; typedef typename GET_PROP_TYPE(TypeTag, GridView) GridView;
typedef typename GET_PROP_TYPE(TypeTag, FluidSystem) FluidSystem; typedef typename GET_PROP_TYPE(TypeTag, FluidSystem) FluidSystem;
typedef typename GET_PROP_TYPE(TypeTag, PrimaryVariables) PrimaryVariables; typedef typename GET_PROP_TYPE(TypeTag, PrimaryVariables) PrimaryVariables;
typedef typename GET_PROP_TYPE(TypeTag, TimeManager) TimeManager; typedef typename GET_PROP_TYPE(TypeTag, Simulator) Simulator;
typedef typename GET_PROP_TYPE(TypeTag, Model) Model; typedef typename GET_PROP_TYPE(TypeTag, Model) Model;
enum { enum {
@@ -167,14 +167,8 @@ public:
/*! /*!
* \copydoc Doxygen::defaultProblemConstructor * \copydoc Doxygen::defaultProblemConstructor
*/ */
DiffusionProblem(TimeManager &timeManager) DiffusionProblem(Simulator &simulator)
#if DUNE_VERSION_NEWER(DUNE_COMMON, 2, 3) : ParentType(simulator)
: ParentType(timeManager,
GET_PROP_TYPE(TypeTag, GridCreator)::grid().leafGridView())
#else
: ParentType(timeManager,
GET_PROP_TYPE(TypeTag, GridCreator)::grid().leafView())
#endif
{ {
FluidSystem::init(); FluidSystem::init();

View File

@@ -24,6 +24,7 @@
#define EWOMS_FINGER_GRID_CREATOR_HH #define EWOMS_FINGER_GRID_CREATOR_HH
#include <ewoms/parallel/mpihelper.hh> #include <ewoms/parallel/mpihelper.hh>
#include <ewoms/io/basegridcreator.hh>
#include <opm/core/utility/PropertySystem.hpp> #include <opm/core/utility/PropertySystem.hpp>
#include <ewoms/common/parametersystem.hh> #include <ewoms/common/parametersystem.hh>
@@ -33,21 +34,23 @@
#include <vector> #include <vector>
namespace Ewoms {
// some hacky defines for the grid creator // some hacky defines for the grid creator
#define FINGER_DIM 2 #define FINGER_DIM 2
#define FINGER_CUBES 1 #define FINGER_CUBES 1
namespace Ewoms {
template <class TypeTag>
class FingerGridCreator;
template <class TypeTag> template <class TypeTag>
class FingerProblem; class FingerProblem;
} // namespace Ewoms } // namespace Ewoms
namespace Opm { namespace Opm {
//////////
// Specify the properties for the finger problem
//////////
namespace Properties { namespace Properties {
// declare the properties required by the for the finger grid creator // declare the properties required by the for the finger grid creator
NEW_TYPE_TAG(FingerGridCreator);
NEW_PROP_TAG(Grid); NEW_PROP_TAG(Grid);
NEW_PROP_TAG(Scalar); NEW_PROP_TAG(Scalar);
@@ -60,22 +63,25 @@ NEW_PROP_TAG(CellsY);
NEW_PROP_TAG(CellsZ); NEW_PROP_TAG(CellsZ);
NEW_PROP_TAG(GridGlobalRefinements); NEW_PROP_TAG(GridGlobalRefinements);
} // namespace Properties
} // namespace Opm SET_TYPE_PROP(FingerGridCreator, Grid, Dune::ALUGrid<FINGER_DIM, FINGER_DIM, Dune::cube, Dune::nonconforming>);
SET_TYPE_PROP(FingerGridCreator, GridCreator, Ewoms::FingerGridCreator<TypeTag>);
}} // namespace Opm, Properties
namespace Ewoms { namespace Ewoms {
/*! /*!
* \brief Helper class for grid instantiation of the finger problem. * \brief Helper class for grid instantiation of the finger problem.
*/ */
template <class TypeTag> template <class TypeTag>
class FingerGridCreator class FingerGridCreator : public BaseGridCreator<TypeTag>
{ {
typedef typename GET_PROP_TYPE(TypeTag, Scalar) Scalar; typedef typename GET_PROP_TYPE(TypeTag, Scalar) Scalar;
enum { dim = FINGER_DIM }; enum { dim = FINGER_DIM };
public: public:
typedef Dune::ALUGrid<FINGER_DIM, FINGER_DIM, Dune::cube, Dune::nonconforming> Grid; typedef typename GET_PROP_TYPE(TypeTag, Grid) Grid;
/*! /*!
* \brief Register all run-time parameters for the grid creator. * \brief Register all run-time parameters for the grid creator.
@@ -187,57 +193,44 @@ public:
v[5] = i5; v[5] = i5;
v[6] = i6; v[6] = i6;
v[7] = i7; v[7] = i7;
factory.insertElement( factory.insertElement(Dune::GeometryType(Dune::GeometryType::cube, 3), v);
Dune::GeometryType(Dune::GeometryType::cube, 3), v);
#else #else
v[0] = i0; v[0] = i0;
v[1] = i1; v[1] = i1;
v[2] = i2; v[2] = i2;
v[3] = i4; v[3] = i4;
factory.insertElement( factory.insertElement(Dune::GeometryType(Dune::GeometryType::simplex, 3), v);
Dune::GeometryType(Dune::GeometryType::simplex, 3),
v);
v[0] = i4; v[0] = i4;
v[1] = i5; v[1] = i5;
v[2] = i6; v[2] = i6;
v[3] = i2; v[3] = i2;
factory.insertElement( factory.insertElement(Dune::GeometryType(Dune::GeometryType::simplex, 3), v);
Dune::GeometryType(Dune::GeometryType::simplex, 3),
v);
v[0] = i2; v[0] = i2;
v[1] = i5; v[1] = i5;
v[2] = i4; v[2] = i4;
v[3] = i1; v[3] = i1;
factory.insertElement( factory.insertElement(Dune::GeometryType(Dune::GeometryType::simplex, 3), v);
Dune::GeometryType(Dune::GeometryType::simplex, 3),
v);
v[0] = i2; v[0] = i2;
v[1] = i3; v[1] = i3;
v[2] = i7; v[2] = i7;
v[3] = i5; v[3] = i5;
factory.insertElement( factory.insertElement(Dune::GeometryType(Dune::GeometryType::simplex, 3), v);
Dune::GeometryType(Dune::GeometryType::simplex, 3),
v);
v[0] = i5; v[0] = i5;
v[1] = i7; v[1] = i7;
v[2] = i6; v[2] = i6;
v[3] = i2; v[3] = i2;
factory.insertElement( factory.insertElement(Dune::GeometryType(Dune::GeometryType::simplex, 3), v);
Dune::GeometryType(Dune::GeometryType::simplex, 3),
v);
v[0] = i1; v[0] = i1;
v[1] = i3; v[1] = i3;
v[2] = i5; v[2] = i5;
v[3] = i2; v[3] = i2;
factory.insertElement( factory.insertElement(Dune::GeometryType(Dune::GeometryType::simplex, 3), v);
Dune::GeometryType(Dune::GeometryType::simplex, 3),
v);
#endif #endif
} }
} }
@@ -254,20 +247,17 @@ public:
v[1] = i1; v[1] = i1;
v[2] = i2; v[2] = i2;
v[3] = i3; v[3] = i3;
factory.insertElement( factory.insertElement(Dune::GeometryType(Dune::GeometryType::cube, 2), v);
Dune::GeometryType(Dune::GeometryType::cube, 2), v);
#else #else
v[0] = i0; v[0] = i0;
v[1] = i1; v[1] = i1;
v[2] = i2; v[2] = i2;
factory.insertElement( factory.insertElement(Dune::GeometryType(Dune::GeometryType::simplex, 2), v);
Dune::GeometryType(Dune::GeometryType::simplex, 2), v);
v[0] = i1; v[0] = i1;
v[1] = i3; v[1] = i3;
v[2] = i2; v[2] = i2;
factory.insertElement( factory.insertElement(Dune::GeometryType(Dune::GeometryType::simplex, 2), v);
Dune::GeometryType(Dune::GeometryType::simplex, 2), v);
#endif #endif
} }
} }
@@ -280,8 +270,8 @@ public:
/*! /*!
* \brief Return a reference to the grid. * \brief Return a reference to the grid.
*/ */
static Grid &grid() static Grid* gridPointer()
{ return *grid_; } { return grid_; }
/*! /*!
* \brief Distribute the grid (and attached data) over all * \brief Distribute the grid (and attached data) over all

View File

@@ -53,16 +53,9 @@ class FingerProblem;
namespace Opm { namespace Opm {
namespace Properties { namespace Properties {
NEW_TYPE_TAG(FingerBaseProblem); NEW_TYPE_TAG(FingerBaseProblem, INHERITS_FROM(FingerGridCreator));
// set the GridCreator property // declare the properties used by the finger problem
SET_TYPE_PROP(FingerBaseProblem, GridCreator, Ewoms::FingerGridCreator<TypeTag>);
// Retrieve the grid type from the grid creator
SET_TYPE_PROP(FingerBaseProblem, Grid,
typename GET_PROP_TYPE(TypeTag, GridCreator)::Grid);
// declare the properties specific for the finger problem
NEW_PROP_TAG(InitialWaterSaturation); NEW_PROP_TAG(InitialWaterSaturation);
// Set the problem property // Set the problem property
@@ -95,8 +88,7 @@ SET_PROP(FingerBaseProblem, MaterialLaw)
typedef typename GET_PROP_TYPE(TypeTag, FluidSystem) FluidSystem; typedef typename GET_PROP_TYPE(TypeTag, FluidSystem) FluidSystem;
typedef Opm::TwoPhaseMaterialTraits<Scalar, typedef Opm::TwoPhaseMaterialTraits<Scalar,
/*wettingPhaseIdx=*/FluidSystem::wettingPhaseIdx, /*wettingPhaseIdx=*/FluidSystem::wettingPhaseIdx,
/*nonWettingPhaseIdx=*/FluidSystem::nonWettingPhaseIdx> /*nonWettingPhaseIdx=*/FluidSystem::nonWettingPhaseIdx> Traits;
Traits;
// use the parker-lenhard hysteresis law // use the parker-lenhard hysteresis law
typedef Opm::ParkerLenhard<Traits> ParkerLenhard; typedef Opm::ParkerLenhard<Traits> ParkerLenhard;
@@ -131,12 +123,11 @@ SET_SCALAR_PROP(FingerBaseProblem, EndTime, 1e3);
// The default for the initial time step size of the simulation // The default for the initial time step size of the simulation
SET_SCALAR_PROP(FingerBaseProblem, InitialTimeStepSize, 10); SET_SCALAR_PROP(FingerBaseProblem, InitialTimeStepSize, 10);
} // namespace Properties }} // namespace Opm, Properties
} // namespace Opm
namespace Ewoms { namespace Ewoms {
/*! /*!
* \ingroup VcfvTestProblems * \ingroup TestProblems
* *
* \brief Two-phase problem featuring some gravity-driven saturation * \brief Two-phase problem featuring some gravity-driven saturation
* fingers. * fingers.
@@ -163,7 +154,7 @@ class FingerProblem : public GET_PROP_TYPE(TypeTag, BaseProblem)
typedef typename GET_PROP_TYPE(TypeTag, WettingPhase) WettingPhase; typedef typename GET_PROP_TYPE(TypeTag, WettingPhase) WettingPhase;
typedef typename GET_PROP_TYPE(TypeTag, NonwettingPhase) NonwettingPhase; typedef typename GET_PROP_TYPE(TypeTag, NonwettingPhase) NonwettingPhase;
typedef typename GET_PROP_TYPE(TypeTag, PrimaryVariables) PrimaryVariables; typedef typename GET_PROP_TYPE(TypeTag, PrimaryVariables) PrimaryVariables;
typedef typename GET_PROP_TYPE(TypeTag, TimeManager) TimeManager; typedef typename GET_PROP_TYPE(TypeTag, Simulator) Simulator;
typedef typename GET_PROP_TYPE(TypeTag, Constraints) Constraints; typedef typename GET_PROP_TYPE(TypeTag, Constraints) Constraints;
typedef typename GET_PROP_TYPE(TypeTag, Model) Model; typedef typename GET_PROP_TYPE(TypeTag, Model) Model;
@@ -192,7 +183,6 @@ class FingerProblem : public GET_PROP_TYPE(TypeTag, BaseProblem)
typedef typename GridView::ctype CoordScalar; typedef typename GridView::ctype CoordScalar;
typedef Dune::FieldVector<CoordScalar, dimWorld> GlobalPosition; typedef Dune::FieldVector<CoordScalar, dimWorld> GlobalPosition;
typedef Dune::FieldMatrix<Scalar, dimWorld, dimWorld> DimMatrix; typedef Dune::FieldMatrix<Scalar, dimWorld, dimWorld> DimMatrix;
//!\endcond //!\endcond
@@ -200,14 +190,8 @@ public:
/*! /*!
* \copydoc Doxygen::defaultProblemConstructor * \copydoc Doxygen::defaultProblemConstructor
*/ */
FingerProblem(TimeManager &timeManager) FingerProblem(Simulator &simulator)
#if DUNE_VERSION_NEWER(DUNE_COMMON, 2, 3) : ParentType(simulator)
: ParentType(timeManager,
GET_PROP_TYPE(TypeTag, GridCreator)::grid().leafGridView())
#else
: ParentType(timeManager,
GET_PROP_TYPE(TypeTag, GridCreator)::grid().leafView())
#endif
{ {
eps_ = 3e-6; eps_ = 3e-6;
FluidSystem::init(); FluidSystem::init();
@@ -280,7 +264,7 @@ public:
void postTimeStep() void postTimeStep()
{ {
// update the history of the hysteresis law // update the history of the hysteresis law
ElementContext elemCtx(*this); ElementContext elemCtx(this->simulator());
auto elemIt = this->gridView().template begin<0>(); auto elemIt = this->gridView().template begin<0>();
const auto &elemEndIt = this->gridView().template end<0>(); const auto &elemEndIt = this->gridView().template end<0>();

View File

@@ -171,7 +171,7 @@ class FractureProblem : public GET_PROP_TYPE(TypeTag, BaseProblem)
typedef typename GET_PROP_TYPE(TypeTag, PrimaryVariables) PrimaryVariables; 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, RateVector) RateVector;
typedef typename GET_PROP_TYPE(TypeTag, TimeManager) TimeManager; typedef typename GET_PROP_TYPE(TypeTag, Simulator) Simulator;
typedef typename GET_PROP_TYPE(TypeTag, Scalar) Scalar; typedef typename GET_PROP_TYPE(TypeTag, Scalar) Scalar;
typedef typename GET_PROP_TYPE(TypeTag, MaterialLaw) MaterialLaw; typedef typename GET_PROP_TYPE(TypeTag, MaterialLaw) MaterialLaw;
typedef typename GET_PROP_TYPE(TypeTag, MaterialLawParams) MaterialLawParams; typedef typename GET_PROP_TYPE(TypeTag, MaterialLawParams) MaterialLawParams;
@@ -210,14 +210,8 @@ public:
/*! /*!
* \copydoc Doxygen::defaultProblemConstructor * \copydoc Doxygen::defaultProblemConstructor
*/ */
FractureProblem(TimeManager &timeManager) FractureProblem(Simulator &simulator)
#if DUNE_VERSION_NEWER(DUNE_COMMON, 2, 3) : ParentType(simulator)
: ParentType(timeManager,
GET_PROP_TYPE(TypeTag, GridCreator)::grid().leafGridView())
#else
: ParentType(timeManager,
GET_PROP_TYPE(TypeTag, GridCreator)::grid().leafView())
#endif
{ {
eps_ = 3e-6; eps_ = 3e-6;
temperature_ = 273.15 + 20; // -> 20°C temperature_ = 273.15 + 20; // -> 20°C

View File

@@ -135,7 +135,7 @@ class GroundWaterProblem : public GET_PROP_TYPE(TypeTag, BaseProblem)
pressure0Idx = Indices::pressure0Idx pressure0Idx = Indices::pressure0Idx
}; };
typedef typename GET_PROP_TYPE(TypeTag, TimeManager) TimeManager; typedef typename GET_PROP_TYPE(TypeTag, Simulator) Simulator;
typedef typename GET_PROP_TYPE(TypeTag, FluidSystem) FluidSystem; typedef typename GET_PROP_TYPE(TypeTag, FluidSystem) FluidSystem;
typedef typename GET_PROP_TYPE(TypeTag, RateVector) RateVector; typedef typename GET_PROP_TYPE(TypeTag, RateVector) RateVector;
typedef typename GET_PROP_TYPE(TypeTag, BoundaryRateVector) BoundaryRateVector; typedef typename GET_PROP_TYPE(TypeTag, BoundaryRateVector) BoundaryRateVector;
@@ -151,14 +151,8 @@ public:
/*! /*!
* \copydoc Doxygen::defaultProblemConstructor * \copydoc Doxygen::defaultProblemConstructor
*/ */
GroundWaterProblem(TimeManager &timeManager) GroundWaterProblem(Simulator &simulator)
#if DUNE_VERSION_NEWER(DUNE_COMMON, 2, 3) : ParentType(simulator)
: ParentType(timeManager,
GET_PROP_TYPE(TypeTag, GridCreator)::grid().leafGridView())
#else
: ParentType(timeManager,
GET_PROP_TYPE(TypeTag, GridCreator)::grid().leafView())
#endif
{ {
eps_ = 1.0e-3; eps_ = 1.0e-3;

View File

@@ -150,7 +150,7 @@ class InfiltrationProblem : public GET_PROP_TYPE(TypeTag, BaseProblem)
typedef typename GET_PROP_TYPE(TypeTag, PrimaryVariables) PrimaryVariables; typedef typename GET_PROP_TYPE(TypeTag, PrimaryVariables) PrimaryVariables;
typedef typename GET_PROP_TYPE(TypeTag, RateVector) RateVector; 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, Simulator) Simulator;
typedef typename GET_PROP_TYPE(TypeTag, FluidSystem) FluidSystem; typedef typename GET_PROP_TYPE(TypeTag, FluidSystem) FluidSystem;
typedef typename GET_PROP_TYPE(TypeTag, Model) Model; typedef typename GET_PROP_TYPE(TypeTag, Model) Model;
@@ -186,15 +186,9 @@ public:
/*! /*!
* \copydoc Doxygen::defaultProblemConstructor * \copydoc Doxygen::defaultProblemConstructor
*/ */
InfiltrationProblem(TimeManager &timeManager) InfiltrationProblem(Simulator &simulator)
#if DUNE_VERSION_NEWER(DUNE_COMMON, 2, 3) : ParentType(simulator)
: ParentType(timeManager, , eps_(1e-6)
GET_PROP_TYPE(TypeTag, GridCreator)::grid().leafGridView()),
#else
: ParentType(timeManager,
GET_PROP_TYPE(TypeTag, GridCreator)::grid().leafView()),
#endif
eps_(1e-6)
{ {
temperature_ = 273.15 + 10.0; // -> 10 degrees Celsius temperature_ = 273.15 + 10.0; // -> 10 degrees Celsius
FluidSystem::init(/*tempMin=*/temperature_ - 1, FluidSystem::init(/*tempMin=*/temperature_ - 1,

View File

@@ -24,6 +24,7 @@
#define EWOMS_LENS_GRID_CREATOR_HH #define EWOMS_LENS_GRID_CREATOR_HH
#include <ewoms/parallel/mpihelper.hh> #include <ewoms/parallel/mpihelper.hh>
#include <ewoms/io/basegridcreator.hh>
#include <opm/core/utility/PropertySystem.hpp> #include <opm/core/utility/PropertySystem.hpp>
#include <ewoms/common/parametersystem.hh> #include <ewoms/common/parametersystem.hh>
@@ -36,10 +37,15 @@
namespace Ewoms { namespace Ewoms {
template <class TypeTag> template <class TypeTag>
class LensProblem; class LensProblem;
template <class TypeTag>
class LensGridCreator;
} // namespace Ewoms } // namespace Ewoms
namespace Opm { namespace Opm {
namespace Properties { namespace Properties {
NEW_TYPE_TAG(LensGridCreator);
// declare the properties required by the for the lens grid creator // declare the properties required by the for the lens grid creator
NEW_PROP_TAG(Grid); NEW_PROP_TAG(Grid);
NEW_PROP_TAG(Scalar); NEW_PROP_TAG(Scalar);
@@ -53,6 +59,10 @@ NEW_PROP_TAG(CellsY);
NEW_PROP_TAG(CellsZ); NEW_PROP_TAG(CellsZ);
NEW_PROP_TAG(GridGlobalRefinements); NEW_PROP_TAG(GridGlobalRefinements);
// set the Grid and GridCreator properties
SET_TYPE_PROP(LensGridCreator, Grid, Dune::YaspGrid<2>);
SET_TYPE_PROP(LensGridCreator, GridCreator, Ewoms::LensGridCreator<TypeTag>);
}} // namespace Opm, Properties }} // namespace Opm, Properties
namespace Ewoms { namespace Ewoms {
@@ -62,15 +72,17 @@ namespace Ewoms {
* \brief Helper class for grid instantiation of the lens problem. * \brief Helper class for grid instantiation of the lens problem.
*/ */
template <class TypeTag> template <class TypeTag>
class LensGridCreator class LensGridCreator : public BaseGridCreator<TypeTag>
{ {
typedef typename GET_PROP_TYPE(TypeTag, Scalar) Scalar; typedef typename GET_PROP_TYPE(TypeTag, Scalar) Scalar;
static const int dim = 2; public:
typedef typename GET_PROP_TYPE(TypeTag, Grid) Grid;
private:
static const int dim = Grid::dimension;
public: public:
typedef Dune::YaspGrid<dim> Grid;
/*! /*!
* \brief Register all run-time parameters for the grid creator. * \brief Register all run-time parameters for the grid creator.
*/ */
@@ -142,8 +154,8 @@ public:
/*! /*!
* \brief Return a reference to the grid. * \brief Return a reference to the grid.
*/ */
static Grid &grid() static Grid* gridPointer()
{ return *grid_; } { return grid_; }
/*! /*!
* \brief Distribute the grid (and attached data) over all * \brief Distribute the grid (and attached data) over all

View File

@@ -53,7 +53,7 @@ class LensProblem;
namespace Opm { namespace Opm {
namespace Properties { namespace Properties {
NEW_TYPE_TAG(LensBaseProblem); NEW_TYPE_TAG(LensBaseProblem, INHERITS_FROM(LensGridCreator));
// declare the properties specific for the lens problem // declare the properties specific for the lens problem
NEW_PROP_TAG(LensLowerLeftX); NEW_PROP_TAG(LensLowerLeftX);
@@ -63,13 +63,6 @@ NEW_PROP_TAG(LensUpperRightX);
NEW_PROP_TAG(LensUpperRightY); NEW_PROP_TAG(LensUpperRightY);
NEW_PROP_TAG(LensUpperRightZ); NEW_PROP_TAG(LensUpperRightZ);
// set the GridCreator property
SET_TYPE_PROP(LensBaseProblem, GridCreator, Ewoms::LensGridCreator<TypeTag>);
// Retrieve the grid type from the grid creator
SET_TYPE_PROP(LensBaseProblem, Grid,
typename GET_PROP_TYPE(TypeTag, GridCreator)::Grid);
// Set the problem property // Set the problem property
SET_TYPE_PROP(LensBaseProblem, Problem, Ewoms::LensProblem<TypeTag>); SET_TYPE_PROP(LensBaseProblem, Problem, Ewoms::LensProblem<TypeTag>);
@@ -189,7 +182,7 @@ class LensProblem : public GET_PROP_TYPE(TypeTag, BaseProblem)
typedef typename GET_PROP_TYPE(TypeTag, WettingPhase) WettingPhase; typedef typename GET_PROP_TYPE(TypeTag, WettingPhase) WettingPhase;
typedef typename GET_PROP_TYPE(TypeTag, NonwettingPhase) NonwettingPhase; typedef typename GET_PROP_TYPE(TypeTag, NonwettingPhase) NonwettingPhase;
typedef typename GET_PROP_TYPE(TypeTag, PrimaryVariables) PrimaryVariables; typedef typename GET_PROP_TYPE(TypeTag, PrimaryVariables) PrimaryVariables;
typedef typename GET_PROP_TYPE(TypeTag, TimeManager) TimeManager; typedef typename GET_PROP_TYPE(TypeTag, Simulator) Simulator;
typedef typename GET_PROP_TYPE(TypeTag, Model) Model; typedef typename GET_PROP_TYPE(TypeTag, Model) Model;
enum { enum {
@@ -223,14 +216,8 @@ public:
/*! /*!
* \copydoc Doxygen::defaultProblemConstructor * \copydoc Doxygen::defaultProblemConstructor
*/ */
LensProblem(TimeManager &timeManager) LensProblem(Simulator &simulator)
#if DUNE_VERSION_NEWER(DUNE_COMMON, 2, 3) : ParentType(simulator)
: ParentType(timeManager,
GET_PROP_TYPE(TypeTag, GridCreator)::grid().leafGridView())
#else
: ParentType(timeManager,
GET_PROP_TYPE(TypeTag, GridCreator)::grid().leafView())
#endif
{ {
eps_ = 3e-6; eps_ = 3e-6;
FluidSystem::init(); FluidSystem::init();

View File

@@ -103,7 +103,7 @@ class NavierStokesTestProblem : public StokesProblem<TypeTag>
typedef typename GET_PROP_TYPE(TypeTag, Scalar) Scalar; typedef typename GET_PROP_TYPE(TypeTag, Scalar) Scalar;
typedef typename GET_PROP_TYPE(TypeTag, GridView) GridView; typedef typename GET_PROP_TYPE(TypeTag, GridView) GridView;
typedef typename GET_PROP_TYPE(TypeTag, TimeManager) TimeManager; typedef typename GET_PROP_TYPE(TypeTag, Simulator) Simulator;
typedef typename GET_PROP_TYPE(TypeTag, PrimaryVariables) PrimaryVariables; typedef typename GET_PROP_TYPE(TypeTag, PrimaryVariables) PrimaryVariables;
typedef typename GET_PROP_TYPE(TypeTag, RateVector) RateVector; typedef typename GET_PROP_TYPE(TypeTag, RateVector) RateVector;
typedef typename GET_PROP_TYPE(TypeTag, BoundaryRateVector) BoundaryRateVector; typedef typename GET_PROP_TYPE(TypeTag, BoundaryRateVector) BoundaryRateVector;
@@ -128,14 +128,8 @@ public:
/*! /*!
* \copydoc Doxygen::defaultProblemConstructor * \copydoc Doxygen::defaultProblemConstructor
*/ */
NavierStokesTestProblem(TimeManager &timeManager) NavierStokesTestProblem(Simulator &simulator)
#if DUNE_VERSION_NEWER(DUNE_COMMON, 2, 3) : ParentType(simulator)
: ParentType(timeManager,
GET_PROP_TYPE(TypeTag, GridCreator)::grid().leafGridView())
#else
: ParentType(timeManager,
GET_PROP_TYPE(TypeTag, GridCreator)::grid().leafView())
#endif
{ eps_ = 1e-6; } { eps_ = 1e-6; }
/*! /*!

View File

@@ -162,24 +162,18 @@ class ObstacleProblem : public GET_PROP_TYPE(TypeTag, BaseProblem)
N2Idx = FluidSystem::N2Idx N2Idx = FluidSystem::N2Idx
}; };
typedef Dune::FieldVector<typename GridView::Grid::ctype, dimWorld> GlobalPosition; typedef Dune::FieldVector<typename GridView::ctype, dimWorld> GlobalPosition;
typedef Dune::FieldVector<Scalar, numPhases> PhaseVector; typedef Dune::FieldVector<Scalar, numPhases> PhaseVector;
typedef Dune::FieldMatrix<Scalar, dimWorld, dimWorld> DimMatrix; typedef Dune::FieldMatrix<Scalar, dimWorld, dimWorld> DimMatrix;
typedef typename GET_PROP_TYPE(TypeTag, TimeManager) TimeManager; typedef typename GET_PROP_TYPE(TypeTag, Simulator) Simulator;
typedef typename GET_PROP_TYPE(TypeTag, Model) Model; typedef typename GET_PROP_TYPE(TypeTag, Model) Model;
public: public:
/*! /*!
* \copydoc Doxygen::defaultProblemConstructor * \copydoc Doxygen::defaultProblemConstructor
*/ */
ObstacleProblem(TimeManager &timeManager) ObstacleProblem(Simulator &simulator)
#if DUNE_VERSION_NEWER(DUNE_COMMON, 2, 3) : ParentType(simulator)
: ParentType(timeManager,
GET_PROP_TYPE(TypeTag, GridCreator)::grid().leafGridView())
#else
: ParentType(timeManager,
GET_PROP_TYPE(TypeTag, GridCreator)::grid().leafView())
#endif
{ {
eps_ = 1e-6; eps_ = 1e-6;
temperature_ = 273.15 + 25; // -> 25°C temperature_ = 273.15 + 25; // -> 25°C

View File

@@ -105,7 +105,7 @@ class OutflowProblem : public GET_PROP_TYPE(TypeTag, BaseProblem)
typedef typename GET_PROP_TYPE(TypeTag, PrimaryVariables) PrimaryVariables; typedef typename GET_PROP_TYPE(TypeTag, PrimaryVariables) PrimaryVariables;
typedef typename GET_PROP_TYPE(TypeTag, RateVector) RateVector; 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, Simulator) Simulator;
typedef typename GET_PROP_TYPE(TypeTag, FluidSystem) FluidSystem; typedef typename GET_PROP_TYPE(TypeTag, FluidSystem) FluidSystem;
typedef typename GET_PROP_TYPE(TypeTag, MaterialLawParams) MaterialLawParams; typedef typename GET_PROP_TYPE(TypeTag, MaterialLawParams) MaterialLawParams;
typedef typename GET_PROP_TYPE(TypeTag, Model) Model; typedef typename GET_PROP_TYPE(TypeTag, Model) Model;
@@ -130,15 +130,9 @@ public:
/*! /*!
* \copydoc Doxygen::defaultProblemConstructor * \copydoc Doxygen::defaultProblemConstructor
*/ */
OutflowProblem(TimeManager &timeManager) OutflowProblem(Simulator &simulator)
#if DUNE_VERSION_NEWER(DUNE_COMMON, 2, 3) : ParentType(simulator)
: ParentType(timeManager, , eps_(1e-6)
GET_PROP_TYPE(TypeTag, GridCreator)::grid().leafGridView()),
#else
: ParentType(timeManager,
GET_PROP_TYPE(TypeTag, GridCreator)::grid().leafView()),
#endif
eps_(1e-6)
{ {
temperature_ = 273.15 + 20; temperature_ = 273.15 + 20;
FluidSystem::init(/*minT=*/temperature_ - 1, /*maxT=*/temperature_ + 2, FluidSystem::init(/*minT=*/temperature_ - 1, /*maxT=*/temperature_ + 2,

View File

@@ -158,7 +158,7 @@ class PowerInjectionProblem : public GET_PROP_TYPE(TypeTag, BaseProblem)
typedef typename GET_PROP_TYPE(TypeTag, PrimaryVariables) PrimaryVariables; typedef typename GET_PROP_TYPE(TypeTag, PrimaryVariables) PrimaryVariables;
typedef typename GET_PROP_TYPE(TypeTag, RateVector) RateVector; 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, Simulator) Simulator;
typedef typename GET_PROP_TYPE(TypeTag, Model) Model; typedef typename GET_PROP_TYPE(TypeTag, Model) Model;
enum { enum {
@@ -188,14 +188,8 @@ public:
/*! /*!
* \copydoc Doxygen::defaultProblemConstructor * \copydoc Doxygen::defaultProblemConstructor
*/ */
PowerInjectionProblem(TimeManager &timeManager) PowerInjectionProblem(Simulator &simulator)
#if DUNE_VERSION_NEWER(DUNE_COMMON, 2, 3) : ParentType(simulator)
: ParentType(timeManager,
GET_PROP_TYPE(TypeTag, GridCreator)::grid().leafGridView())
#else
: ParentType(timeManager,
GET_PROP_TYPE(TypeTag, GridCreator)::grid().leafView())
#endif
{ {
eps_ = 3e-6; eps_ = 3e-6;
FluidSystem::init(); FluidSystem::init();

View File

@@ -156,7 +156,7 @@ class ReservoirProblem : public GET_PROP_TYPE(TypeTag, BaseProblem)
typedef typename GET_PROP_TYPE(TypeTag, Constraints) Constraints; typedef typename GET_PROP_TYPE(TypeTag, Constraints) Constraints;
typedef typename GET_PROP_TYPE(TypeTag, MaterialLaw) MaterialLaw; 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, Simulator) Simulator;
typedef typename GET_PROP_TYPE(TypeTag, MaterialLawParams) MaterialLawParams; typedef typename GET_PROP_TYPE(TypeTag, MaterialLawParams) MaterialLawParams;
typedef typename GET_PROP_TYPE(TypeTag, Model) Model; typedef typename GET_PROP_TYPE(TypeTag, Model) Model;
@@ -169,14 +169,8 @@ public:
/*! /*!
* \copydoc Doxygen::defaultProblemConstructor * \copydoc Doxygen::defaultProblemConstructor
*/ */
ReservoirProblem(TimeManager &timeManager) ReservoirProblem(Simulator &simulator)
#if DUNE_VERSION_NEWER(DUNE_COMMON, 2, 3) : ParentType(simulator)
: ParentType(timeManager,
GET_PROP_TYPE(TypeTag, GridCreator)::grid().leafGridView())
#else
: ParentType(timeManager,
GET_PROP_TYPE(TypeTag, GridCreator)::grid().leafView())
#endif
{ {
eps_ = 1e-6; eps_ = 1e-6;

View File

@@ -52,10 +52,7 @@ NEW_TYPE_TAG(RichardsLensProblem, Richards);
SET_TYPE_PROP(RichardsLensProblem, Grid, Dune::YaspGrid<2>); SET_TYPE_PROP(RichardsLensProblem, Grid, Dune::YaspGrid<2>);
// Set the physical problem to be solved // Set the physical problem to be solved
SET_PROP(RichardsLensProblem, Problem) SET_TYPE_PROP(RichardsLensProblem, Problem, Ewoms::RichardsLensProblem<TypeTag>);
{
typedef Ewoms::RichardsLensProblem<TypeTag> type;
};
// Set the wetting phase // Set the wetting phase
SET_PROP(RichardsLensProblem, WettingPhase) SET_PROP(RichardsLensProblem, WettingPhase)
@@ -148,7 +145,7 @@ class RichardsLensProblem : public GET_PROP_TYPE(TypeTag, BaseProblem)
typedef typename GET_PROP_TYPE(TypeTag, RateVector) RateVector; 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, PrimaryVariables) PrimaryVariables;
typedef typename GET_PROP_TYPE(TypeTag, TimeManager) TimeManager; typedef typename GET_PROP_TYPE(TypeTag, Simulator) Simulator;
typedef typename GET_PROP_TYPE(TypeTag, FluidSystem) FluidSystem; typedef typename GET_PROP_TYPE(TypeTag, FluidSystem) FluidSystem;
typedef typename GET_PROP_TYPE(TypeTag, Scalar) Scalar; typedef typename GET_PROP_TYPE(TypeTag, Scalar) Scalar;
typedef typename GET_PROP_TYPE(TypeTag, Model) Model; typedef typename GET_PROP_TYPE(TypeTag, Model) Model;
@@ -180,15 +177,9 @@ public:
/*! /*!
* \copydoc Doxygen::defaultProblemConstructor * \copydoc Doxygen::defaultProblemConstructor
*/ */
RichardsLensProblem(TimeManager &timeManager) RichardsLensProblem(Simulator &simulator)
#if DUNE_VERSION_NEWER(DUNE_COMMON, 2, 3) : ParentType(simulator)
: ParentType(timeManager, , pnRef_(1e5)
GET_PROP_TYPE(TypeTag, GridCreator)::grid().leafGridView()),
#else
: ParentType(timeManager,
GET_PROP_TYPE(TypeTag, GridCreator)::grid().leafView()),
#endif
pnRef_(1e5)
{ {
eps_ = 3e-6; eps_ = 3e-6;
pnRef_ = 1e5; pnRef_ = 1e5;

View File

@@ -91,7 +91,7 @@ class Stokes2cTestProblem : public GET_PROP_TYPE(TypeTag, BaseProblem)
{ {
typedef typename GET_PROP_TYPE(TypeTag, BaseProblem) ParentType; typedef typename GET_PROP_TYPE(TypeTag, BaseProblem) ParentType;
typedef typename GET_PROP_TYPE(TypeTag, GridView) GridView; typedef typename GET_PROP_TYPE(TypeTag, GridView) GridView;
typedef typename GET_PROP_TYPE(TypeTag, TimeManager) TimeManager; typedef typename GET_PROP_TYPE(TypeTag, Simulator) Simulator;
typedef typename GET_PROP_TYPE(TypeTag, Indices) Indices; typedef typename GET_PROP_TYPE(TypeTag, Indices) Indices;
typedef typename GET_PROP_TYPE(TypeTag, FluidSystem) FluidSystem; typedef typename GET_PROP_TYPE(TypeTag, FluidSystem) FluidSystem;
typedef typename GET_PROP_TYPE(TypeTag, BoundaryRateVector) BoundaryRateVector; typedef typename GET_PROP_TYPE(TypeTag, BoundaryRateVector) BoundaryRateVector;
@@ -121,14 +121,8 @@ public:
/*! /*!
* \copydoc Doxygen::defaultProblemConstructor * \copydoc Doxygen::defaultProblemConstructor
*/ */
Stokes2cTestProblem(TimeManager &timeManager) Stokes2cTestProblem(Simulator &simulator)
#if DUNE_VERSION_NEWER(DUNE_COMMON, 2, 3) : ParentType(simulator)
: ParentType(timeManager,
GET_PROP_TYPE(TypeTag, GridCreator)::grid().leafGridView())
#else
: ParentType(timeManager,
GET_PROP_TYPE(TypeTag, GridCreator)::grid().leafView())
#endif
{ {
eps_ = 1e-6; eps_ = 1e-6;

View File

@@ -95,7 +95,7 @@ class StokesNiTestProblem : public GET_PROP_TYPE(TypeTag, BaseProblem)
{ {
typedef typename GET_PROP_TYPE(TypeTag, BaseProblem) ParentType; typedef typename GET_PROP_TYPE(TypeTag, BaseProblem) ParentType;
typedef typename GET_PROP_TYPE(TypeTag, GridView) GridView; typedef typename GET_PROP_TYPE(TypeTag, GridView) GridView;
typedef typename GET_PROP_TYPE(TypeTag, TimeManager) TimeManager; typedef typename GET_PROP_TYPE(TypeTag, Simulator) Simulator;
typedef typename GET_PROP_TYPE(TypeTag, Indices) Indices; typedef typename GET_PROP_TYPE(TypeTag, Indices) Indices;
typedef typename GET_PROP_TYPE(TypeTag, FluidSystem) FluidSystem; typedef typename GET_PROP_TYPE(TypeTag, FluidSystem) FluidSystem;
typedef typename GET_PROP_TYPE(TypeTag, Constraints) Constraints; typedef typename GET_PROP_TYPE(TypeTag, Constraints) Constraints;
@@ -105,10 +105,12 @@ class StokesNiTestProblem : public GET_PROP_TYPE(TypeTag, BaseProblem)
typedef typename GET_PROP_TYPE(TypeTag, Scalar) Scalar; typedef typename GET_PROP_TYPE(TypeTag, Scalar) Scalar;
typedef typename GET_PROP_TYPE(TypeTag, Model) Model; typedef typename GET_PROP_TYPE(TypeTag, Model) Model;
enum { // Number of equations and grid dimension
numEq = GET_PROP_VALUE(TypeTag, NumEq),
dimWorld = GridView::dimensionworld };
enum { enum {
// Number of equations and grid dimension
numEq = GET_PROP_VALUE(TypeTag, NumEq),
dimWorld = GridView::dimensionworld,
// primary variable indices // primary variable indices
pressureIdx = Indices::pressureIdx, pressureIdx = Indices::pressureIdx,
moleFrac1Idx = Indices::moleFrac1Idx, moleFrac1Idx = Indices::moleFrac1Idx,
@@ -132,14 +134,8 @@ public:
/*! /*!
* \copydoc Doxygen::defaultProblemConstructor * \copydoc Doxygen::defaultProblemConstructor
*/ */
StokesNiTestProblem(TimeManager &timeManager) StokesNiTestProblem(Simulator &simulator)
#if DUNE_VERSION_NEWER(DUNE_COMMON, 2, 3) : ParentType(simulator)
: ParentType(timeManager,
GET_PROP_TYPE(TypeTag, GridCreator)::grid().leafGridView())
#else
: ParentType(timeManager,
GET_PROP_TYPE(TypeTag, GridCreator)::grid().leafView())
#endif
{ {
eps_ = 1e-6; eps_ = 1e-6;

View File

@@ -97,7 +97,7 @@ class StokesTestProblem : public GET_PROP_TYPE(TypeTag, BaseProblem)
{ {
typedef typename GET_PROP_TYPE(TypeTag, BaseProblem) ParentType; typedef typename GET_PROP_TYPE(TypeTag, BaseProblem) ParentType;
typedef typename GET_PROP_TYPE(TypeTag, GridView) GridView; typedef typename GET_PROP_TYPE(TypeTag, GridView) GridView;
typedef typename GET_PROP_TYPE(TypeTag, TimeManager) TimeManager; typedef typename GET_PROP_TYPE(TypeTag, Simulator) Simulator;
typedef typename GET_PROP_TYPE(TypeTag, Indices) Indices; typedef typename GET_PROP_TYPE(TypeTag, Indices) Indices;
typedef typename GET_PROP_TYPE(TypeTag, RateVector) RateVector; typedef typename GET_PROP_TYPE(TypeTag, RateVector) RateVector;
typedef typename GET_PROP_TYPE(TypeTag, BoundaryRateVector) BoundaryRateVector; typedef typename GET_PROP_TYPE(TypeTag, BoundaryRateVector) BoundaryRateVector;
@@ -128,14 +128,8 @@ public:
/*! /*!
* \copydoc Doxygen::defaultProblemConstructor * \copydoc Doxygen::defaultProblemConstructor
*/ */
StokesTestProblem(TimeManager &timeManager) StokesTestProblem(Simulator &simulator)
#if DUNE_VERSION_NEWER(DUNE_COMMON, 2, 3) : ParentType(simulator)
: ParentType(timeManager,
GET_PROP_TYPE(TypeTag, GridCreator)::grid().leafGridView())
#else
: ParentType(timeManager,
GET_PROP_TYPE(TypeTag, GridCreator)::grid().leafView())
#endif
{ eps_ = 1e-6; } { eps_ = 1e-6; }
/*! /*!

View File

@@ -157,7 +157,6 @@ class WaterAirProblem
typedef typename GET_PROP_TYPE(TypeTag, Scalar) Scalar; typedef typename GET_PROP_TYPE(TypeTag, Scalar) Scalar;
typedef typename GET_PROP_TYPE(TypeTag, GridView) GridView; typedef typename GET_PROP_TYPE(TypeTag, GridView) GridView;
typedef typename GridView::Grid Grid;
// copy some indices for convenience // copy some indices for convenience
typedef typename GET_PROP_TYPE(TypeTag, FluidSystem) FluidSystem; typedef typename GET_PROP_TYPE(TypeTag, FluidSystem) FluidSystem;
@@ -191,7 +190,7 @@ class WaterAirProblem
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, PrimaryVariables) PrimaryVariables;
typedef typename GET_PROP_TYPE(TypeTag, Constraints) Constraints; typedef typename GET_PROP_TYPE(TypeTag, Constraints) Constraints;
typedef typename GET_PROP_TYPE(TypeTag, TimeManager) TimeManager; typedef typename GET_PROP_TYPE(TypeTag, Simulator) Simulator;
typedef typename GET_PROP_TYPE(TypeTag, Model) Model; typedef typename GET_PROP_TYPE(TypeTag, Model) Model;
typedef typename GET_PROP_TYPE(TypeTag, MaterialLaw) MaterialLaw; typedef typename GET_PROP_TYPE(TypeTag, MaterialLaw) MaterialLaw;
typedef typename GET_PROP_TYPE(TypeTag, MaterialLawParams) MaterialLawParams; typedef typename GET_PROP_TYPE(TypeTag, MaterialLawParams) MaterialLawParams;
@@ -207,12 +206,8 @@ public:
/*! /*!
* \copydoc Doxygen::defaultProblemConstructor * \copydoc Doxygen::defaultProblemConstructor
*/ */
WaterAirProblem(TimeManager &timeManager) WaterAirProblem(Simulator &simulator)
#if DUNE_VERSION_NEWER(DUNE_COMMON, 2,3) : ParentType(simulator)
: ParentType(timeManager, GET_PROP_TYPE(TypeTag, GridCreator)::grid().leafGridView())
#else
: ParentType(timeManager, GET_PROP_TYPE(TypeTag, GridCreator)::grid().leafView())
#endif
{ {
maxDepth_ = 1000.0; // [m] maxDepth_ = 1000.0; // [m]
eps_ = 1e-6; eps_ = 1e-6;

View File

@@ -144,7 +144,7 @@ class Tutorial1Problem
typedef Dune::FieldMatrix<Scalar, dimWorld, dimWorld> DimMatrix; typedef Dune::FieldMatrix<Scalar, dimWorld, dimWorld> DimMatrix;
// eWoms specific types are specified via the property system // eWoms specific types are specified via the property system
typedef typename GET_PROP_TYPE(TypeTag, TimeManager) TimeManager; typedef typename GET_PROP_TYPE(TypeTag, Simulator) Simulator;
typedef typename GET_PROP_TYPE(TypeTag, PrimaryVariables) PrimaryVariables; typedef typename GET_PROP_TYPE(TypeTag, PrimaryVariables) PrimaryVariables;
typedef typename GET_PROP_TYPE(TypeTag, RateVector) RateVector; typedef typename GET_PROP_TYPE(TypeTag, RateVector) RateVector;
typedef typename GET_PROP_TYPE(TypeTag, BoundaryRateVector) BoundaryRateVector; typedef typename GET_PROP_TYPE(TypeTag, BoundaryRateVector) BoundaryRateVector;
@@ -164,15 +164,9 @@ class Tutorial1Problem
public: public:
//! The constructor of the problem //! The constructor of the problem
Tutorial1Problem(TimeManager &timeManager) Tutorial1Problem(Simulator &simulator)
#if DUNE_VERSION_NEWER(DUNE_COMMON, 2, 3) : ParentType(simulator)
: ParentType(timeManager, , eps_(3e-6)
GET_PROP_TYPE(TypeTag, GridCreator)::grid().leafGridView()),
#else
: ParentType(timeManager,
GET_PROP_TYPE(TypeTag, GridCreator)::grid().leafView()),
#endif
eps_(3e-6)
{ {
// Use an isotropic and homogeneous intrinsic permeability // Use an isotropic and homogeneous intrinsic permeability
K_ = this->toDimMatrix_(1e-7); K_ = this->toDimMatrix_(1e-7);

View File

@@ -90,10 +90,10 @@ case "$TEST_TYPE" in
echo "######################" echo "######################"
echo "RND: '$RND'" echo "RND: '$RND'"
SIM_NAME=$(grep "Initializing the problem" "test-$RND.log" | sed "s/.*\"\(.*\)\".*/\1/" | head -n1) SIM_NAME=$(grep "Applying the initial solution of the" "test-$RND.log" | sed "s/.*\"\(.*\)\".*/\1/" | head -n1)
NUM_TIMESTEPS=$(grep "Writing result" "test-$RND.log" | wc -l) NUM_TIMESTEPS=$(grep "Time step [0-9]* done" "test-$RND.log" | wc -l)
TEST_RESULT=$(printf "%s-%05i" "$SIM_NAME" "$NUM_TIMESTEPS") TEST_RESULT=$(printf "%s-%05i" "$SIM_NAME" "$NUM_TIMESTEPS")
TEST_RESULT=$(ls "$TEST_RESULT".*) TEST_RESULT=$(ls -- "$TEST_RESULT".*)
rm "test-$RND.log" rm "test-$RND.log"
if ! test -r "$TEST_RESULT"; then if ! test -r "$TEST_RESULT"; then
echo "File $TEST_RESULT does not exist or is not readable" echo "File $TEST_RESULT does not exist or is not readable"
@@ -119,9 +119,8 @@ case "$TEST_TYPE" in
exit 1 exit 1
fi fi
grep "Initializing the problem" "test-$RND.log" SIM_NAME=$(grep "Applying the initial solution of the" "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 "Time step [0-9]* done" "test-$RND.log" | wc -l)
NUM_TIMESTEPS=$(grep "Writing result" "test-$RND.log" | wc -l)
rm "test-$RND.log" rm "test-$RND.log"
echo "Simulation name: '$SIM_NAME'" echo "Simulation name: '$SIM_NAME'"
@@ -129,7 +128,7 @@ case "$TEST_TYPE" in
for PROC_NUM in 0 1 2 3; do for PROC_NUM in 0 1 2 3; do
REF_FILE=$(printf "s%04d-p%04d-%s" "$NUM_PROCS" "$PROC_NUM" "$SIM_NAME") REF_FILE=$(printf "s%04d-p%04d-%s" "$NUM_PROCS" "$PROC_NUM" "$SIM_NAME")
TEST_RESULT=$(printf "s%04d-p%04d-%s-%05i" "$NUM_PROCS" "$PROC_NUM" "$SIM_NAME" "$NUM_TIMESTEPS") TEST_RESULT=$(printf "s%04d-p%04d-%s-%05i" "$NUM_PROCS" "$PROC_NUM" "$SIM_NAME" "$NUM_TIMESTEPS")
TEST_RESULT=$(ls "$TEST_RESULT".*) TEST_RESULT=$(ls -- "$TEST_RESULT".*)
if ! test -r "$TEST_RESULT"; then if ! test -r "$TEST_RESULT"; then
echo "File $TEST_RESULT does not exist or is not readable" echo "File $TEST_RESULT does not exist or is not readable"
exit 1 exit 1