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, BoundaryRateVector) BoundaryRateVector;
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, Model) Model;
typedef typename GET_PROP_TYPE(TypeTag, HeatConductionLaw) HeatConductionLaw;
@ -225,14 +225,8 @@ public:
/*!
* \copydoc Doxygen::defaultProblemConstructor
*/
Co2InjectionProblem(TimeManager &timeManager)
#if DUNE_VERSION_NEWER(DUNE_COMMON, 2, 3)
: ParentType(timeManager,
GET_PROP_TYPE(TypeTag, GridCreator)::grid().leafGridView())
#else
: ParentType(timeManager,
GET_PROP_TYPE(TypeTag, GridCreator)::grid().leafView())
#endif
Co2InjectionProblem(Simulator &simulator)
: ParentType(simulator)
{
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, MaterialLawParams) MaterialLawParams;
typedef typename GET_PROP_TYPE(TypeTag, HeatConductionLaw) HeatConductionLaw;
typedef typename GET_PROP_TYPE(TypeTag, HeatConductionLawParams)
HeatConductionLawParams;
typedef typename GET_PROP_TYPE(TypeTag, HeatConductionLawParams) 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, TimeManager) TimeManager;
typedef typename GET_PROP_TYPE(TypeTag, Simulator) Simulator;
typedef typename GET_PROP_TYPE(TypeTag, Model) Model;
typedef typename GET_PROP_TYPE(TypeTag, FluidSystem) FluidSystem;
@ -182,15 +181,9 @@ public:
/*!
* \copydoc Doxygen::defaultProblemConstructor
*/
CuvetteProblem(TimeManager &timeManager)
#if DUNE_VERSION_NEWER(DUNE_COMMON, 2, 3)
: ParentType(timeManager,
GET_PROP_TYPE(TypeTag, GridCreator)::grid().leafGridView()),
#else
: ParentType(timeManager,
GET_PROP_TYPE(TypeTag, GridCreator)::grid().leafView()),
#endif
eps_(1e-6)
CuvetteProblem(Simulator &simulator)
: ParentType(simulator)
, eps_(1e-6)
{
if (Valgrind::IsRunning())
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, FluidSystem) FluidSystem;
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;
enum {
@ -167,14 +167,8 @@ public:
/*!
* \copydoc Doxygen::defaultProblemConstructor
*/
DiffusionProblem(TimeManager &timeManager)
#if DUNE_VERSION_NEWER(DUNE_COMMON, 2, 3)
: ParentType(timeManager,
GET_PROP_TYPE(TypeTag, GridCreator)::grid().leafGridView())
#else
: ParentType(timeManager,
GET_PROP_TYPE(TypeTag, GridCreator)::grid().leafView())
#endif
DiffusionProblem(Simulator &simulator)
: ParentType(simulator)
{
FluidSystem::init();

View File

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

View File

@ -53,16 +53,9 @@ class FingerProblem;
namespace Opm {
namespace Properties {
NEW_TYPE_TAG(FingerBaseProblem);
NEW_TYPE_TAG(FingerBaseProblem, INHERITS_FROM(FingerGridCreator));
// set the GridCreator property
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
// declare the properties used by the finger problem
NEW_PROP_TAG(InitialWaterSaturation);
// Set the problem property
@ -95,8 +88,7 @@ SET_PROP(FingerBaseProblem, MaterialLaw)
typedef typename GET_PROP_TYPE(TypeTag, FluidSystem) FluidSystem;
typedef Opm::TwoPhaseMaterialTraits<Scalar,
/*wettingPhaseIdx=*/FluidSystem::wettingPhaseIdx,
/*nonWettingPhaseIdx=*/FluidSystem::nonWettingPhaseIdx>
Traits;
/*nonWettingPhaseIdx=*/FluidSystem::nonWettingPhaseIdx> Traits;
// use the parker-lenhard hysteresis law
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
SET_SCALAR_PROP(FingerBaseProblem, InitialTimeStepSize, 10);
} // namespace Properties
} // namespace Opm
}} // namespace Opm, Properties
namespace Ewoms {
/*!
* \ingroup VcfvTestProblems
* \ingroup TestProblems
*
* \brief Two-phase problem featuring some gravity-driven saturation
* 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, NonwettingPhase) NonwettingPhase;
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, Model) Model;
@ -192,7 +183,6 @@ class FingerProblem : public GET_PROP_TYPE(TypeTag, BaseProblem)
typedef typename GridView::ctype CoordScalar;
typedef Dune::FieldVector<CoordScalar, dimWorld> GlobalPosition;
typedef Dune::FieldMatrix<Scalar, dimWorld, dimWorld> DimMatrix;
//!\endcond
@ -200,14 +190,8 @@ public:
/*!
* \copydoc Doxygen::defaultProblemConstructor
*/
FingerProblem(TimeManager &timeManager)
#if DUNE_VERSION_NEWER(DUNE_COMMON, 2, 3)
: ParentType(timeManager,
GET_PROP_TYPE(TypeTag, GridCreator)::grid().leafGridView())
#else
: ParentType(timeManager,
GET_PROP_TYPE(TypeTag, GridCreator)::grid().leafView())
#endif
FingerProblem(Simulator &simulator)
: ParentType(simulator)
{
eps_ = 3e-6;
FluidSystem::init();
@ -280,7 +264,7 @@ public:
void postTimeStep()
{
// update the history of the hysteresis law
ElementContext elemCtx(*this);
ElementContext elemCtx(this->simulator());
auto elemIt = this->gridView().template begin<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, BoundaryRateVector) BoundaryRateVector;
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, MaterialLaw) MaterialLaw;
typedef typename GET_PROP_TYPE(TypeTag, MaterialLawParams) MaterialLawParams;
@ -210,14 +210,8 @@ public:
/*!
* \copydoc Doxygen::defaultProblemConstructor
*/
FractureProblem(TimeManager &timeManager)
#if DUNE_VERSION_NEWER(DUNE_COMMON, 2, 3)
: ParentType(timeManager,
GET_PROP_TYPE(TypeTag, GridCreator)::grid().leafGridView())
#else
: ParentType(timeManager,
GET_PROP_TYPE(TypeTag, GridCreator)::grid().leafView())
#endif
FractureProblem(Simulator &simulator)
: ParentType(simulator)
{
eps_ = 3e-6;
temperature_ = 273.15 + 20; // -> 20°C

View File

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

View File

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

View File

@ -53,7 +53,7 @@ class LensProblem;
namespace Opm {
namespace Properties {
NEW_TYPE_TAG(LensBaseProblem);
NEW_TYPE_TAG(LensBaseProblem, INHERITS_FROM(LensGridCreator));
// declare the properties specific for the lens problem
NEW_PROP_TAG(LensLowerLeftX);
@ -63,13 +63,6 @@ NEW_PROP_TAG(LensUpperRightX);
NEW_PROP_TAG(LensUpperRightY);
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_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, NonwettingPhase) NonwettingPhase;
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;
enum {
@ -223,14 +216,8 @@ public:
/*!
* \copydoc Doxygen::defaultProblemConstructor
*/
LensProblem(TimeManager &timeManager)
#if DUNE_VERSION_NEWER(DUNE_COMMON, 2, 3)
: ParentType(timeManager,
GET_PROP_TYPE(TypeTag, GridCreator)::grid().leafGridView())
#else
: ParentType(timeManager,
GET_PROP_TYPE(TypeTag, GridCreator)::grid().leafView())
#endif
LensProblem(Simulator &simulator)
: ParentType(simulator)
{
eps_ = 3e-6;
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, 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, RateVector) RateVector;
typedef typename GET_PROP_TYPE(TypeTag, BoundaryRateVector) BoundaryRateVector;
@ -128,14 +128,8 @@ public:
/*!
* \copydoc Doxygen::defaultProblemConstructor
*/
NavierStokesTestProblem(TimeManager &timeManager)
#if DUNE_VERSION_NEWER(DUNE_COMMON, 2, 3)
: ParentType(timeManager,
GET_PROP_TYPE(TypeTag, GridCreator)::grid().leafGridView())
#else
: ParentType(timeManager,
GET_PROP_TYPE(TypeTag, GridCreator)::grid().leafView())
#endif
NavierStokesTestProblem(Simulator &simulator)
: ParentType(simulator)
{ eps_ = 1e-6; }
/*!

View File

@ -162,24 +162,18 @@ class ObstacleProblem : public GET_PROP_TYPE(TypeTag, BaseProblem)
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::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;
public:
/*!
* \copydoc Doxygen::defaultProblemConstructor
*/
ObstacleProblem(TimeManager &timeManager)
#if DUNE_VERSION_NEWER(DUNE_COMMON, 2, 3)
: ParentType(timeManager,
GET_PROP_TYPE(TypeTag, GridCreator)::grid().leafGridView())
#else
: ParentType(timeManager,
GET_PROP_TYPE(TypeTag, GridCreator)::grid().leafView())
#endif
ObstacleProblem(Simulator &simulator)
: ParentType(simulator)
{
eps_ = 1e-6;
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, RateVector) RateVector;
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, MaterialLawParams) MaterialLawParams;
typedef typename GET_PROP_TYPE(TypeTag, Model) Model;
@ -130,15 +130,9 @@ public:
/*!
* \copydoc Doxygen::defaultProblemConstructor
*/
OutflowProblem(TimeManager &timeManager)
#if DUNE_VERSION_NEWER(DUNE_COMMON, 2, 3)
: ParentType(timeManager,
GET_PROP_TYPE(TypeTag, GridCreator)::grid().leafGridView()),
#else
: ParentType(timeManager,
GET_PROP_TYPE(TypeTag, GridCreator)::grid().leafView()),
#endif
eps_(1e-6)
OutflowProblem(Simulator &simulator)
: ParentType(simulator)
, eps_(1e-6)
{
temperature_ = 273.15 + 20;
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, RateVector) RateVector;
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;
enum {
@ -188,14 +188,8 @@ public:
/*!
* \copydoc Doxygen::defaultProblemConstructor
*/
PowerInjectionProblem(TimeManager &timeManager)
#if DUNE_VERSION_NEWER(DUNE_COMMON, 2, 3)
: ParentType(timeManager,
GET_PROP_TYPE(TypeTag, GridCreator)::grid().leafGridView())
#else
: ParentType(timeManager,
GET_PROP_TYPE(TypeTag, GridCreator)::grid().leafView())
#endif
PowerInjectionProblem(Simulator &simulator)
: ParentType(simulator)
{
eps_ = 3e-6;
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, MaterialLaw) MaterialLaw;
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, Model) Model;
@ -169,14 +169,8 @@ public:
/*!
* \copydoc Doxygen::defaultProblemConstructor
*/
ReservoirProblem(TimeManager &timeManager)
#if DUNE_VERSION_NEWER(DUNE_COMMON, 2, 3)
: ParentType(timeManager,
GET_PROP_TYPE(TypeTag, GridCreator)::grid().leafGridView())
#else
: ParentType(timeManager,
GET_PROP_TYPE(TypeTag, GridCreator)::grid().leafView())
#endif
ReservoirProblem(Simulator &simulator)
: ParentType(simulator)
{
eps_ = 1e-6;

View File

@ -52,10 +52,7 @@ NEW_TYPE_TAG(RichardsLensProblem, Richards);
SET_TYPE_PROP(RichardsLensProblem, Grid, Dune::YaspGrid<2>);
// Set the physical problem to be solved
SET_PROP(RichardsLensProblem, Problem)
{
typedef Ewoms::RichardsLensProblem<TypeTag> type;
};
SET_TYPE_PROP(RichardsLensProblem, Problem, Ewoms::RichardsLensProblem<TypeTag>);
// Set the wetting phase
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, BoundaryRateVector) BoundaryRateVector;
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, Scalar) Scalar;
typedef typename GET_PROP_TYPE(TypeTag, Model) Model;
@ -180,15 +177,9 @@ public:
/*!
* \copydoc Doxygen::defaultProblemConstructor
*/
RichardsLensProblem(TimeManager &timeManager)
#if DUNE_VERSION_NEWER(DUNE_COMMON, 2, 3)
: ParentType(timeManager,
GET_PROP_TYPE(TypeTag, GridCreator)::grid().leafGridView()),
#else
: ParentType(timeManager,
GET_PROP_TYPE(TypeTag, GridCreator)::grid().leafView()),
#endif
pnRef_(1e5)
RichardsLensProblem(Simulator &simulator)
: ParentType(simulator)
, pnRef_(1e5)
{
eps_ = 3e-6;
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, 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, FluidSystem) FluidSystem;
typedef typename GET_PROP_TYPE(TypeTag, BoundaryRateVector) BoundaryRateVector;
@ -121,14 +121,8 @@ public:
/*!
* \copydoc Doxygen::defaultProblemConstructor
*/
Stokes2cTestProblem(TimeManager &timeManager)
#if DUNE_VERSION_NEWER(DUNE_COMMON, 2, 3)
: ParentType(timeManager,
GET_PROP_TYPE(TypeTag, GridCreator)::grid().leafGridView())
#else
: ParentType(timeManager,
GET_PROP_TYPE(TypeTag, GridCreator)::grid().leafView())
#endif
Stokes2cTestProblem(Simulator &simulator)
: ParentType(simulator)
{
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, 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, FluidSystem) FluidSystem;
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, Model) Model;
enum { // Number of equations and grid dimension
numEq = GET_PROP_VALUE(TypeTag, NumEq),
dimWorld = GridView::dimensionworld };
enum {
// Number of equations and grid dimension
numEq = GET_PROP_VALUE(TypeTag, NumEq),
dimWorld = GridView::dimensionworld,
// primary variable indices
pressureIdx = Indices::pressureIdx,
moleFrac1Idx = Indices::moleFrac1Idx,
@ -132,14 +134,8 @@ public:
/*!
* \copydoc Doxygen::defaultProblemConstructor
*/
StokesNiTestProblem(TimeManager &timeManager)
#if DUNE_VERSION_NEWER(DUNE_COMMON, 2, 3)
: ParentType(timeManager,
GET_PROP_TYPE(TypeTag, GridCreator)::grid().leafGridView())
#else
: ParentType(timeManager,
GET_PROP_TYPE(TypeTag, GridCreator)::grid().leafView())
#endif
StokesNiTestProblem(Simulator &simulator)
: ParentType(simulator)
{
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, 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, RateVector) RateVector;
typedef typename GET_PROP_TYPE(TypeTag, BoundaryRateVector) BoundaryRateVector;
@ -128,14 +128,8 @@ public:
/*!
* \copydoc Doxygen::defaultProblemConstructor
*/
StokesTestProblem(TimeManager &timeManager)
#if DUNE_VERSION_NEWER(DUNE_COMMON, 2, 3)
: ParentType(timeManager,
GET_PROP_TYPE(TypeTag, GridCreator)::grid().leafGridView())
#else
: ParentType(timeManager,
GET_PROP_TYPE(TypeTag, GridCreator)::grid().leafView())
#endif
StokesTestProblem(Simulator &simulator)
: ParentType(simulator)
{ 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, GridView) GridView;
typedef typename GridView::Grid Grid;
// copy some indices for convenience
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, PrimaryVariables) PrimaryVariables;
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, MaterialLaw) MaterialLaw;
typedef typename GET_PROP_TYPE(TypeTag, MaterialLawParams) MaterialLawParams;
@ -207,12 +206,8 @@ public:
/*!
* \copydoc Doxygen::defaultProblemConstructor
*/
WaterAirProblem(TimeManager &timeManager)
#if DUNE_VERSION_NEWER(DUNE_COMMON, 2,3)
: ParentType(timeManager, GET_PROP_TYPE(TypeTag, GridCreator)::grid().leafGridView())
#else
: ParentType(timeManager, GET_PROP_TYPE(TypeTag, GridCreator)::grid().leafView())
#endif
WaterAirProblem(Simulator &simulator)
: ParentType(simulator)
{
maxDepth_ = 1000.0; // [m]
eps_ = 1e-6;

View File

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

View File

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