diff --git a/dumux/decoupled/2p/cellData2p_adaptive.hh b/dumux/decoupled/2p/cellData2p_adaptive.hh index f1c342cd402493dfe85ab99b45d7677f121b8a73..bc704a4ac4bf21d66a5cf0984b3c2eaf86d70b4a 100644 --- a/dumux/decoupled/2p/cellData2p_adaptive.hh +++ b/dumux/decoupled/2p/cellData2p_adaptive.hh @@ -47,10 +47,14 @@ private: typedef CellData2P<TypeTag, enableCompressibility> ParentType; typedef typename GET_PROP_TYPE(TypeTag, Scalar) Scalar; typedef typename GET_PROP_TYPE(TypeTag, GridView) GridView; + typedef typename GridView::Grid Grid; typedef typename GET_PROP_TYPE(TypeTag, Problem) Problem; typedef FluxData2P<TypeTag> FluxData; typedef typename GET_PROP_TYPE(TypeTag, FluidState) FluidState; + typedef Dune::FieldVector<Scalar, GridView::dimensionworld> GlobalPosition; + typedef typename GridView::Traits::template Codim<0>::Entity Element; + enum { dim = GridView::dimension, dimWorld = GridView::dimensionworld @@ -146,8 +150,11 @@ public: isFront_ = adaptedValues.front; } - static void setAdaptionValues(AdaptedValues& adaptedValues, AdaptedValues& adaptedValuesFather, const Problem& problem) + static void setAdaptionValues(Dune::PersistentContainer<Grid, AdaptedValues>& adaptionMap_, + const Element& father, const Element& son, const Problem& problem) { + AdaptedValues& adaptedValues = adaptionMap_[son]; + AdaptedValues& adaptedValuesFather = adaptionMap_[father]; adaptedValues.saturationW = adaptedValuesFather.saturationW / adaptedValuesFather.count; adaptedValues.saturationNW = adaptedValuesFather.saturationNW / adaptedValuesFather.count; adaptedValues.pressW = adaptedValuesFather.pressW / adaptedValuesFather.count; diff --git a/dumux/decoupled/common/gridadapt.hh b/dumux/decoupled/common/gridadapt.hh index 278fab0f6a100bb1e82b0302f67902b01260a3ff..9771832542b8d4f1abd58034e0ae3ea6733f2758 100644 --- a/dumux/decoupled/common/gridadapt.hh +++ b/dumux/decoupled/common/gridadapt.hh @@ -27,6 +27,7 @@ #define DUMUX_GIRDADAPT_HH #include "decoupledproperties.hh" +#include "gridadaptproperties.hh" namespace Dumux { diff --git a/dumux/decoupled/common/variableclass_adaptive.hh b/dumux/decoupled/common/variableclass_adaptive.hh index 860dcd22c638844215397bffac1653a3a19bc942..1a39eecae76f2c78f57ee60a0ca66f3b9464a616 100644 --- a/dumux/decoupled/common/variableclass_adaptive.hh +++ b/dumux/decoupled/common/variableclass_adaptive.hh @@ -64,7 +64,7 @@ private: private: const Grid& grid_; - Dune::PersistentContainer<Grid, AdaptedValues> adaptionMap_; + Dune::PersistentContainer<Grid, AdaptedValues> adaptationMap_; public: //! Constructs a VariableClass object @@ -74,7 +74,7 @@ public: * @param initialVel initial value for the velocity (only necessary if only transport part is solved) */ VariableClassAdaptive(const GridView& gridView) : - ParentType(gridView), grid_(gridView.grid()), adaptionMap_(grid_, 0) + ParentType(gridView), grid_(gridView.grid()), adaptationMap_(grid_, 0) {} @@ -96,7 +96,7 @@ public: for (LevelIterator eIt = levelView.template begin<0>(); eIt != levelView.template end<0>(); ++eIt) { //get your map entry - AdaptedValues &adaptedValues = adaptionMap_[*eIt]; + AdaptedValues &adaptedValues = adaptationMap_[*eIt]; // put your value in the map if (eIt->isLeaf()) @@ -114,7 +114,7 @@ public: if (eIt.level() > 0) { ElementPointer epFather = eIt->father(); - AdaptedValues& adaptedValuesFather = adaptionMap_[*epFather]; + AdaptedValues& adaptedValuesFather = adaptationMap_[*epFather]; CellData::getAdaptionValues(adaptedValues, adaptedValuesFather, problem); adaptedValuesFather.count += 1; } @@ -132,7 +132,7 @@ public: */ void reconstructPrimVars(const Problem& problem) { - adaptionMap_.reserve(); + adaptationMap_.reserve(); for (int level = 0; level <= grid_.maxLevel(); level++) { @@ -144,7 +144,7 @@ public: //entry is in map, write in leaf if (eIt->isLeaf()) { - AdaptedValues &adaptedValues = adaptionMap_[*eIt]; + AdaptedValues &adaptedValues = adaptationMap_[*eIt]; int newIdxI = this->index(*eIt); CellData& cellData = this->cellData(newIdxI); @@ -157,8 +157,8 @@ public: // value is not in map, interpolate from father element if (eIt.level() > 0) { - ElementPointer ep = eIt->father(); - AdaptedValues& adaptedValuesFather = adaptionMap_[*ep]; + ElementPointer epFather = eIt->father(); + AdaptedValues& adaptedValuesFather = adaptationMap_[*epFather]; if (eIt->isLeaf()) { int newIdxI = this->index(*eIt); @@ -170,8 +170,8 @@ public: else { //create new entry - AdaptedValues& adaptedValues = adaptionMap_[*eIt]; - CellData::setAdaptionValues(adaptedValues, adaptedValuesFather, problem); + AdaptedValues& adaptedValues = adaptationMap_[*eIt]; + CellData::setAdaptionValues(adaptationMap_, *epFather, *eIt, problem); adaptedValues.count = 1; } } @@ -180,7 +180,7 @@ public: } // reset entries in restrictionmap - adaptionMap_.clear(); + adaptationMap_.clear(); } };