diff --git a/dumux/boxmodels/2p/2pfluxvariables.hh b/dumux/boxmodels/2p/2pfluxvariables.hh index 8b553f0e34cdb3429c929b7c24529f29868d57a3..a7e08a63a2a9c7b3e24328cb80b27f92cc61382e 100644 --- a/dumux/boxmodels/2p/2pfluxvariables.hh +++ b/dumux/boxmodels/2p/2pfluxvariables.hh @@ -53,30 +53,25 @@ namespace Dumux template <class TypeTag> class TwoPFluxVariables { - typedef typename GET_PROP_TYPE(TypeTag, PTAG(Scalar)) Scalar; - typedef typename GET_PROP_TYPE(TypeTag, PTAG(GridView)) GridView; - typedef typename GET_PROP_TYPE(TypeTag, PTAG(Problem)) Problem; - typedef typename GET_PROP(TypeTag, PTAG(ParameterTree)) Params; - - typedef typename GridView::ctype CoordScalar; - typedef typename GridView::template Codim<0>::Entity Element; + typedef typename GET_PROP_TYPE(TypeTag, PTAG(SpatialParameters)) SpatialParameters; typedef typename GET_PROP_TYPE(TypeTag, PTAG(ElementVolumeVariables)) ElementVolumeVariables; + typedef typename GET_PROP_TYPE(TypeTag, PTAG(GridView)) GridView; + typedef typename GridView::template Codim<0>::Entity Element; enum { dim = GridView::dimension, dimWorld = GridView::dimensionworld, numPhases = GET_PROP_VALUE(TypeTag, PTAG(NumPhases)) }; - typedef typename GET_PROP_TYPE(TypeTag, PTAG(FVElementGeometry)) FVElementGeometry; - typedef typename GET_PROP_TYPE(TypeTag, PTAG(SpatialParameters)) SpatialParameters; - typedef typename FVElementGeometry::SubControlVolume SCV; - typedef typename FVElementGeometry::SubControlVolumeFace SCVFace; - + typedef typename GET_PROP_TYPE(TypeTag, PTAG(Scalar)) Scalar; typedef Dune::FieldMatrix<Scalar, dimWorld, dimWorld> Tensor; typedef Dune::FieldVector<Scalar, dimWorld> Vector; + typedef typename GET_PROP_TYPE(TypeTag, PTAG(FVElementGeometry)) FVElementGeometry; + typedef typename FVElementGeometry::SubControlVolumeFace SCVFace; + public: /* * \brief The constructor diff --git a/dumux/boxmodels/2p/2plocalresidual.hh b/dumux/boxmodels/2p/2plocalresidual.hh index 39b3b9c03d7da2bab946f1e38370eb5fbed64f87..773fd115b7bd11861eae7e16a6109ff2b2382394 100644 --- a/dumux/boxmodels/2p/2plocalresidual.hh +++ b/dumux/boxmodels/2p/2plocalresidual.hh @@ -48,42 +48,26 @@ class TwoPLocalResidual : public BoxLocalResidual<TypeTag> { protected: typedef typename GET_PROP_TYPE(TypeTag, PTAG(LocalResidual)) Implementation; - typedef TwoPLocalResidual<TypeTag> ThisType; - typedef BoxLocalResidual<TypeTag> ParentType; + typedef typename GET_PROP_TYPE(TypeTag, PTAG(PrimaryVariables)) PrimaryVariables; + typedef typename GET_PROP_TYPE(TypeTag, PTAG(VolumeVariables)) VolumeVariables; + typedef typename GET_PROP_TYPE(TypeTag, PTAG(FluxVariables)) FluxVariables; + typedef typename GET_PROP_TYPE(TypeTag, PTAG(ElementVolumeVariables)) ElementVolumeVariables; typedef typename GET_PROP_TYPE(TypeTag, PTAG(TwoPIndices)) Indices; - - typedef typename GET_PROP_TYPE(TypeTag, PTAG(Scalar)) Scalar; - typedef typename GET_PROP_TYPE(TypeTag, PTAG(GridView)) GridView; - enum { - dim = GridView::dimension, - dimWorld = GridView::dimensionworld, - - numEq = GET_PROP_VALUE(TypeTag, PTAG(NumEq)), - numPhases = GET_PROP_VALUE(TypeTag, PTAG(NumPhases)), - - pressureIdx = Indices::pressureIdx, - saturationIdx = Indices::saturationIdx, - contiWEqIdx = Indices::contiWEqIdx, contiNEqIdx = Indices::contiNEqIdx, - wPhaseIdx = Indices::wPhaseIdx, - nPhaseIdx = Indices::nPhaseIdx + nPhaseIdx = Indices::nPhaseIdx, + numPhases = GET_PROP_VALUE(TypeTag, PTAG(NumPhases)) }; - typedef typename GridView::template Codim<0>::Entity Element; - typedef typename GridView::template Codim<0>::Iterator ElementIterator; - - typedef typename GET_PROP_TYPE(TypeTag, PTAG(PrimaryVariables)) PrimaryVariables; - typedef typename GET_PROP_TYPE(TypeTag, PTAG(VolumeVariables)) VolumeVariables; - typedef typename GET_PROP_TYPE(TypeTag, PTAG(FluxVariables)) FluxVariables; - typedef typename GET_PROP_TYPE(TypeTag, PTAG(ElementVolumeVariables)) ElementVolumeVariables; + typedef typename GET_PROP_TYPE(TypeTag, PTAG(GridView)) GridView; + enum { dimWorld = GridView::dimensionworld }; + typedef typename GET_PROP_TYPE(TypeTag, PTAG(Scalar)) Scalar; typedef Dune::FieldVector<Scalar, dimWorld> Vector; - typedef Dune::FieldMatrix<Scalar, dim, dim> Tensor; public: /*! diff --git a/dumux/boxmodels/2p/2pmodel.hh b/dumux/boxmodels/2p/2pmodel.hh index 66dddbe2dffa6b26a573cc8bb81d090c9d017fa0..6a12ea164210f5ba7f2c0220451f6029861c7861 100644 --- a/dumux/boxmodels/2p/2pmodel.hh +++ b/dumux/boxmodels/2p/2pmodel.hh @@ -75,42 +75,31 @@ namespace Dumux template<class TypeTag > class TwoPModel : public BoxModel<TypeTag> { - typedef TwoPModel<TypeTag> ThisType; - typedef BoxModel<TypeTag> ParentType; - - typedef typename GET_PROP_TYPE(TypeTag, PTAG(Scalar)) Scalar; - typedef typename GET_PROP_TYPE(TypeTag, PTAG(GridView)) GridView; typedef typename GET_PROP_TYPE(TypeTag, PTAG(FVElementGeometry)) FVElementGeometry; typedef typename GET_PROP_TYPE(TypeTag, PTAG(VolumeVariables)) VolumeVariables; typedef typename GET_PROP_TYPE(TypeTag, PTAG(SolutionVector)) SolutionVector; - typedef typename GET_PROP_TYPE(TypeTag, PTAG(TwoPIndices)) Indices; typedef typename GET_PROP_TYPE(TypeTag, PTAG(FluxVariables)) FluxVariables; typedef typename GET_PROP_TYPE(TypeTag, PTAG(ElementVolumeVariables)) ElementVolumeVariables; - + typedef typename GET_PROP_TYPE(TypeTag, PTAG(TwoPIndices)) Indices; enum { - dim = GridView::dimension, - dimWorld = GridView::dimensionworld, - - numPhases = GET_PROP_VALUE(TypeTag, PTAG(NumPhases)), - nPhaseIdx = Indices::nPhaseIdx, wPhaseIdx = Indices::wPhaseIdx, - - formulation = GET_PROP_VALUE(TypeTag, PTAG(Formulation)), - - pwSn = Indices::pwSn, - pnSw = Indices::pnSw, - pressureIdx = Indices::pressureIdx, - saturationIdx = Indices::saturationIdx + numPhases = GET_PROP_VALUE(TypeTag, PTAG(NumPhases)) }; - typedef Dune::FieldVector<Scalar, numPhases> PhasesVector; - typedef Dune::FieldVector<Scalar, dim> LocalPosition; - typedef Dune::FieldVector<Scalar, dimWorld> GlobalPosition; + typedef typename GET_PROP_TYPE(TypeTag, PTAG(GridView)) GridView; typedef typename GridView::template Codim<0>::Iterator ElementIterator; typedef typename GridView::ctype CoordScalar; + enum { + dim = GridView::dimension, + dimWorld = GridView::dimensionworld + }; + + typedef typename GET_PROP_TYPE(TypeTag, PTAG(Scalar)) Scalar; + typedef Dune::FieldVector<Scalar, numPhases> PhasesVector; + typedef Dune::FieldVector<Scalar, dimWorld> GlobalPosition; public: /*! @@ -122,7 +111,7 @@ public: */ Scalar primaryVarWeight(int globalVertexIdx, int pvIdx) const { - if (Indices::pressureIdx == pvIdx) + if (pressureIdx == pvIdx) return std::min(10.0/this->prevSol()[globalVertexIdx][pvIdx], 1.0); return 1; } diff --git a/dumux/boxmodels/2p/2pproblem.hh b/dumux/boxmodels/2p/2pproblem.hh index d8c13bb3eee1ba30746e0a7fc1c8b49df03ac4e5..dffa7c05ca0f27d7681d095edaaf9c073141e3b9 100644 --- a/dumux/boxmodels/2p/2pproblem.hh +++ b/dumux/boxmodels/2p/2pproblem.hh @@ -41,16 +41,14 @@ template<class TypeTag> class TwoPProblem : public BoxProblem<TypeTag> { typedef BoxProblem<TypeTag> ParentType; - typedef typename GET_PROP_TYPE(TypeTag, PTAG(Problem)) Implementation; + typedef typename GET_PROP_TYPE(TypeTag, PTAG(Problem)) Implementation; typedef typename GET_PROP_TYPE(TypeTag, PTAG(TimeManager)) TimeManager; - typedef typename GET_PROP_TYPE(TypeTag, PTAG(GridView)) GridView; - typedef typename GET_PROP_TYPE(TypeTag, PTAG(Scalar)) Scalar; typedef typename GET_PROP_TYPE(TypeTag, PTAG(FVElementGeometry)) FVElementGeometry; - - // material properties typedef typename GET_PROP_TYPE(TypeTag, PTAG(SpatialParameters)) SpatialParameters; + typedef typename GET_PROP_TYPE(TypeTag, PTAG(GridView)) GridView; + typedef typename GridView::template Codim<0>::Entity Element; enum { dim = GridView::dimension, dimWorld = GridView::dimensionworld @@ -58,7 +56,7 @@ class TwoPProblem : public BoxProblem<TypeTag> typedef typename GridView::ctype CoordScalar; typedef Dune::FieldVector<CoordScalar, dimWorld> GlobalPosition; - typedef typename GridView::template Codim<0>::Entity Element; + typedef typename GET_PROP_TYPE(TypeTag, PTAG(Scalar)) Scalar; typedef Dune::FieldVector<Scalar, dim> Vector; public: diff --git a/dumux/boxmodels/2p/2pvolumevariables.hh b/dumux/boxmodels/2p/2pvolumevariables.hh index 6cc082146226b93d385844cf46fba317e81e1735..ed50c7e6ccec47ff432b408283c4bafd30b80d88 100644 --- a/dumux/boxmodels/2p/2pvolumevariables.hh +++ b/dumux/boxmodels/2p/2pvolumevariables.hh @@ -47,10 +47,9 @@ template <class TypeTag> class TwoPVolumeVariables : public BoxVolumeVariables<TypeTag> { typedef BoxVolumeVariables<TypeTag> ParentType; - typedef typename GET_PROP_TYPE(TypeTag, PTAG(VolumeVariables)) Implementation; + typedef typename GET_PROP_TYPE(TypeTag, PTAG(VolumeVariables)) Implementation; typedef typename GET_PROP_TYPE(TypeTag, PTAG(Scalar)) Scalar; - typedef typename GET_PROP_TYPE(TypeTag, PTAG(GridView)) GridView; typedef typename GET_PROP_TYPE(TypeTag, PTAG(Problem)) Problem; typedef typename GET_PROP_TYPE(TypeTag, PTAG(FluidSystem)) FluidSystem; typedef typename GET_PROP_TYPE(TypeTag, PTAG(FluidState)) FluidState; @@ -58,25 +57,20 @@ class TwoPVolumeVariables : public BoxVolumeVariables<TypeTag> typedef typename GET_PROP_TYPE(TypeTag, PTAG(MaterialLawParams)) MaterialLawParams; typedef typename GET_PROP_TYPE(TypeTag, PTAG(FVElementGeometry)) FVElementGeometry; typedef typename GET_PROP_TYPE(TypeTag, PTAG(PrimaryVariables)) PrimaryVariables; - typedef typename GET_PROP_TYPE(TypeTag, PTAG(TwoPIndices)) Indices; - typedef typename GET_PROP_TYPE(TypeTag, PTAG(Model)) Model; + typedef typename GET_PROP_TYPE(TypeTag, PTAG(TwoPIndices)) Indices; enum { - numEq = GET_PROP_VALUE(TypeTag, PTAG(NumEq)), - numPhases = GET_PROP_VALUE(TypeTag, PTAG(NumPhases)), - - formulation = GET_PROP_VALUE(TypeTag, PTAG(Formulation)), - pwSn = Indices::pwSn, pnSw = Indices::pnSw, - pressureIdx = Indices::pressureIdx, saturationIdx = Indices::saturationIdx, - wPhaseIdx = Indices::wPhaseIdx, - nPhaseIdx = Indices::nPhaseIdx + nPhaseIdx = Indices::nPhaseIdx, + numPhases = GET_PROP_VALUE(TypeTag, PTAG(NumPhases)), + formulation = GET_PROP_VALUE(TypeTag, PTAG(Formulation)) }; + typedef typename GET_PROP_TYPE(TypeTag, PTAG(GridView)) GridView; typedef typename GridView::template Codim<0>::Entity Element; public: