diff --git a/dumux/common/intersectionmapper.hh b/dumux/common/intersectionmapper.hh index 044b40651b664c747c2e37fc47cb0ca19001e0a4..795a5b8100a40f7976e68d5c73554c86604373c3 100644 --- a/dumux/common/intersectionmapper.hh +++ b/dumux/common/intersectionmapper.hh @@ -18,12 +18,12 @@ #ifndef DUMUX_INTERSECTIONITERATOR_HH #define DUMUX_INTERSECTIONITERATOR_HH -#include<vector> -#include<unordered_map> +#include <vector> +#include <unordered_map> -#include<dune/common/deprecated.hh> -#include<dune/grid/common/mcmgmapper.hh> -#include<dune/grid/common/rangegenerators.hh> +#include <dune/common/deprecated.hh> +#include <dune/grid/common/mcmgmapper.hh> +#include <dune/grid/common/rangegenerators.hh> /*! * \file @@ -165,12 +165,12 @@ public: int maplocal(const Element& element, int fIdx) { - return intersectionMapLocal_[map(element)][fIdx]; + return intersectionMapLocal_[index(element)][fIdx]; } int maplocal(const Element& element, int fIdx) const { - return (intersectionMapLocal_[map(element)].find(fIdx))->second;//use find() for const function! + return (intersectionMapLocal_[index(element)].find(fIdx))->second;//use find() for const function! } // return number intersections diff --git a/dumux/decoupled/2p/impes/gridadaptionindicator2plocalflux.hh b/dumux/decoupled/2p/impes/gridadaptionindicator2plocalflux.hh index 7a6cb4fa438f5a8622ad8edd66f5377eabcf0aa3..2e0f339542bca310b17d45fb940f25e5aa2e28ff 100644 --- a/dumux/decoupled/2p/impes/gridadaptionindicator2plocalflux.hh +++ b/dumux/decoupled/2p/impes/gridadaptionindicator2plocalflux.hh @@ -563,7 +563,7 @@ public: */ bool refine(const Element& element) { - int idx = problem_.elementMapper().map(element); + int idx = problem_.elementMapper().index(element); return (indicatorVector_[idx] > refineBound_); } @@ -575,7 +575,7 @@ public: */ bool coarsen(const Element& element) { - int idx = problem_.elementMapper().map(element); + int idx = problem_.elementMapper().index(element); return (indicatorVector_[idx] < coarsenBound_); } diff --git a/dumux/freeflow/stokes/stokesvolumevariables.hh b/dumux/freeflow/stokes/stokesvolumevariables.hh index 0b0fdd64a2e213c3ab5cccba41edda6b0a8e8ae2..891cb8fd203e827ff0e17f23cf914fce709a83ed 100644 --- a/dumux/freeflow/stokes/stokesvolumevariables.hh +++ b/dumux/freeflow/stokes/stokesvolumevariables.hh @@ -127,8 +127,6 @@ public: // compute and set the enthalpy Scalar h = Implementation::enthalpy_(fluidState, paramCache, phaseIdx); fluidState.setEnthalpy(phaseIdx, h); - -// int vIdxGlobal = problem.model().dofMapper().map(element, scvIdx, dim); } /*! diff --git a/dumux/geomechanics/el2p/el2passembler.hh b/dumux/geomechanics/el2p/el2passembler.hh index 93318a7a84acc8663cdfef25a1aab2cdcf7bdc5b..0b16197c96bfcc26ce8d33f65b059291507a265b 100644 --- a/dumux/geomechanics/el2p/el2passembler.hh +++ b/dumux/geomechanics/el2p/el2passembler.hh @@ -326,7 +326,7 @@ public: bool isRed = false; int numVertices = element.template count<dim>(); for (int i=0; i < numVertices; ++i) { - int globalI = vertexMapper_().map(element, i, dim); + int globalI = vertexMapper_().subIndex(element, i, dim); if (vertexColor_[globalI] == Red) { isRed = true; break; @@ -335,7 +335,7 @@ public: // if yes, the element color is also red, else it is not // red, i.e. green for the mean time - int eIdxGlobal = elementMapper_().map(element); + int eIdxGlobal = elementMapper_().index(element); if (isRed) elementColor_[eIdxGlobal] = Red; else @@ -344,14 +344,14 @@ public: // Mark yellow vertices (as orange for the mean time) for (const auto& element : Dune::elements(gridView_())) { - int eIdx = this->elementMapper_().map(element); + int eIdx = this->elementMapper_().index(element); if (elementColor_[eIdx] != Red) continue; // non-red elements do not tint vertices // yellow! int numVertices = element.template count<dim>(); for (int i=0; i < numVertices; ++i) { - int globalI = vertexMapper_().map(element, i, dim); + int globalI = vertexMapper_().subIndex(element, i, dim); // if a vertex is already red, don't recolor it to // yellow! if (vertexColor_[globalI] != Red) @@ -361,7 +361,7 @@ public: // Mark yellow elements for (const auto& element : Dune::elements(gridView_())) { - int eIdx = this->elementMapper_().map(element); + int eIdx = this->elementMapper_().index(element); if (elementColor_[eIdx] == Red) { continue; // element is red already! } @@ -371,7 +371,7 @@ public: bool isYellow = false; int numVertices = element.template count<dim>(); for (int i=0; i < numVertices; ++i) { - int globalI = vertexMapper_().map(element, i, dim); + int globalI = vertexMapper_().subIndex(element, i, dim); if (vertexColor_[globalI] == Orange) { isYellow = true; break; @@ -385,14 +385,14 @@ public: // Demote orange vertices to yellow ones if it has at least // one green element as a neighbor. for (const auto& element : Dune::elements(gridView_())) { - int eIdx = this->elementMapper_().map(element); + int eIdx = this->elementMapper_().index(element); if (elementColor_[eIdx] != Green) continue; // yellow and red elements do not make // orange vertices yellow! int numVertices = element.template count<dim>(); for (int i=0; i < numVertices; ++i) { - int globalI = vertexMapper_().map(element, i, dim); + int globalI = vertexMapper_().subIndex(element, i, dim); // if a vertex is orange, recolor it to yellow! if (vertexColor_[globalI] == Orange) vertexColor_[globalI] = Yellow; @@ -453,7 +453,7 @@ public: if (!enablePartialReassemble) return Red; // reassemble unconditionally! - int eIdxGlobal = elementMapper_().map(element); + int eIdxGlobal = elementMapper_().index(element); return elementColor_[eIdxGlobal]; } diff --git a/dumux/geomechanics/el2p/el2pbasemodel.hh b/dumux/geomechanics/el2p/el2pbasemodel.hh index 04e92e793c0b752243255503a4371f4828b56ef4..fc034716977007214fc8f5d4416bd4d93ac125c6 100644 --- a/dumux/geomechanics/el2p/el2pbasemodel.hh +++ b/dumux/geomechanics/el2p/el2pbasemodel.hh @@ -510,7 +510,7 @@ public: void serializeEntity(std::ostream &outstream, const Entity &entity) { - int dofIdxGlobal = dofMapper().map(entity); + int dofIdxGlobal = dofMapper().index(entity); // write phase state if (!outstream.good()) { @@ -538,7 +538,7 @@ public: void deserializeEntity(std::istream &instream, const Entity &entity) { - int dofIdxGlobal = dofMapper().map(entity); + int dofIdxGlobal = dofMapper().index(entity); for (int eqIdx = 0; eqIdx < numEq; ++eqIdx) { if (!instream.good()) @@ -765,7 +765,7 @@ public: bool onBoundary(const Element &element) const { if (!isBox) - return onBoundary(elementMapper().map(element)); + return onBoundary(elementMapper().index(element)); else DUNE_THROW(Dune::InvalidStateException, "requested for box model"); @@ -844,7 +844,7 @@ protected: for (int scvIdx = 0; scvIdx < fvGeometry.numScv; scvIdx++) { // get the global index of the degree of freedom - int dofIdxGlobal = dofMapper().map(element, scvIdx, dofCodim); + int dofIdxGlobal = dofMapper().subIndex(element, scvIdx, dofCodim); // let the problem do the dirty work of nailing down // the initial solution. diff --git a/dumux/implicit/co2/co2model.hh b/dumux/implicit/co2/co2model.hh index 5c88e86e2c93a71a6c716dd9a1dfaad5786c3791..c84592435fae77440d3cee4d21fb4d486ce91d44 100644 --- a/dumux/implicit/co2/co2model.hh +++ b/dumux/implicit/co2/co2model.hh @@ -113,7 +113,7 @@ public: fvGeometry.update(this->gridView_(), element); for (int scvIdx = 0; scvIdx < fvGeometry.numScv; ++scvIdx) { - int dofIdxGlobal = this->dofMapper().map(element, scvIdx, dofCodim); + int dofIdxGlobal = this->dofMapper().subIndex(element, scvIdx, dofCodim); if (ParentType::staticDat_[dofIdxGlobal].visited) continue; diff --git a/dumux/implicit/co2/co2volumevariables.hh b/dumux/implicit/co2/co2volumevariables.hh index c50f4489ece29124cdbc1e9f509047fa76f7ec3d..5836b604d7844c6347a1b1d21938a852d9da650f 100644 --- a/dumux/implicit/co2/co2volumevariables.hh +++ b/dumux/implicit/co2/co2volumevariables.hh @@ -119,7 +119,7 @@ public: scvIdx, isOldSol); - int dofIdxGlobal = problem.model().dofMapper().map(element, scvIdx, dofCodim); + int dofIdxGlobal = problem.model().dofMapper().subIndex(element, scvIdx, dofCodim); int phasePresence = problem.model().phasePresence(dofIdxGlobal, isOldSol); diff --git a/dumux/implicit/mpnc/energy/mpncvtkwriterenergy.hh b/dumux/implicit/mpnc/energy/mpncvtkwriterenergy.hh index ff45b7f35b45a85060d68ee6fd001973c8797e09..925560fed8c0460e728905e20755b05242ae31cf 100644 --- a/dumux/implicit/mpnc/energy/mpncvtkwriterenergy.hh +++ b/dumux/implicit/mpnc/energy/mpncvtkwriterenergy.hh @@ -187,7 +187,7 @@ public: const ElementBoundaryTypes &elemBcTypes) { for (int scvIdx = 0; scvIdx < fvGeometry.numScv; ++scvIdx) { - int gobalIdx = this->problem_.model().dofMapper().map(element, scvIdx, dofCodim); + int gobalIdx = this->problem_.model().dofMapper().subIndex(element, scvIdx, dofCodim); const VolumeVariables &volVars = elemVolVars[scvIdx]; if (temperatureOutput_) temperature_[gobalIdx] = volVars.fluidState().temperature(/*phaseIdx=*/0); diff --git a/dumux/implicit/mpnc/mpncmodelkinetic.hh b/dumux/implicit/mpnc/mpncmodelkinetic.hh index 398029e46784c3330d8f9a01d92c03ea263e66bc..b94104a695609e5de0b3e181d998e8e8763aba41 100644 --- a/dumux/implicit/mpnc/mpncmodelkinetic.hh +++ b/dumux/implicit/mpnc/mpncmodelkinetic.hh @@ -271,7 +271,7 @@ public: // } // // // velocity Check -// const unsigned int globalVertexIdx = this->problem_().vertexMapper().map(element, scvIdx, dim); +// const unsigned int globalVertexIdx = this->problem_().vertexMapper().subIndex(element, scvIdx, dim); // for(int phaseIdx=0; phaseIdx<numPhases; phaseIdx++){ // const Scalar eps = 1e-6 ; // const Scalar velocityTest = volumeDarcyMagVelocity(phaseIdx, globalVertexIdx); diff --git a/dumux/implicit/mpnc/mpncvolumevariablesiakinetic.hh b/dumux/implicit/mpnc/mpncvolumevariablesiakinetic.hh index 7032a01e2786ca4e7188d095b02d783c522e3fff..b54f4489a8baf602dcabe3418db1023a8e1e7bd5 100644 --- a/dumux/implicit/mpnc/mpncvolumevariablesiakinetic.hh +++ b/dumux/implicit/mpnc/mpncvolumevariablesiakinetic.hh @@ -539,7 +539,7 @@ public: scvIdx); // setting the dimensionless numbers. // obtaining the respective quantities. - int globalVertexIdx = problem.vertexMapper().map(element, scvIdx, dim); + int globalVertexIdx = problem.vertexMapper().subIndex(element, scvIdx, dim); for (int phaseIdx = 0; phaseIdx < numPhases; ++phaseIdx) { const Scalar darcyMagVelocity = problem.model().volumeDarcyMagVelocity(phaseIdx, globalVertexIdx); const Scalar dynamicViscosity = fluidState.viscosity(phaseIdx); diff --git a/dumux/io/artgridcreator.hh b/dumux/io/artgridcreator.hh index 4998c81012a4117898f41cec9b9c9b57beb3aff3..3ef41f70755d59a0a8b201d2f2341f4af6e39862 100644 --- a/dumux/io/artgridcreator.hh +++ b/dumux/io/artgridcreator.hh @@ -508,7 +508,7 @@ public: vertexMapper_(gridView) {} - /*! + /*! DOC ME!! and RENAME ME if you know what exactly I'm doing! * */ void map() diff --git a/dumux/linear/amgparallelhelpers.hh b/dumux/linear/amgparallelhelpers.hh index ee7b1139397b43cc4e44a8ebeffc00e0141d407e..d78c454247398316d0aa9787ed8ec1d2d00f7b7e 100644 --- a/dumux/linear/amgparallelhelpers.hh +++ b/dumux/linear/amgparallelhelpers.hh @@ -55,7 +55,7 @@ class ParallelISTLHelper {} template<class EntityType> - int map(const EntityType& e) const + int index(const EntityType& e) const { return problem_.model().dofMapper().index(e); } @@ -98,7 +98,7 @@ class ParallelISTLHelper template<class MessageBuffer, class EntityType> void gather (MessageBuffer& buff, const EntityType& e) const { - buff.write(container_[this->map(e)]); + buff.write(container_[this->index(e)]); } template<class MessageBuffer, class EntityType> @@ -106,7 +106,7 @@ class ParallelISTLHelper { typename V::block_type block; buff.read(block); - container_[this->map(e)]+=block; + container_[this->index(e)]+=block; } private: V& container_; @@ -151,7 +151,7 @@ class ParallelISTLHelper template<class MessageBuffer, class EntityType> void gather (MessageBuffer& buff, const EntityType& e) const { - std::size_t& data= ranks_[this->map(e)]; + std::size_t& data= ranks_[this->index(e)]; if (e.partitionType()!=Dune::InteriorEntity && e.partitionType()!=Dune::BorderEntity) data = (1<<24); buff.write(data); @@ -161,7 +161,7 @@ class ParallelISTLHelper void scatter (MessageBuffer& buff, const EntityType& e, size_t n) { std::size_t x; - std::size_t& data = ranks_[this->map(e)]; + std::size_t& data = ranks_[this->index(e)]; buff.read(x); if (e.partitionType()!=Dune::InteriorEntity && e.partitionType()!=Dune::BorderEntity) data= (1<<24); @@ -210,7 +210,7 @@ class ParallelISTLHelper void gather (MessageBuffer& buff, const EntityType& e) const { - std::size_t& data = ranks_[this->map(e)]; + std::size_t& data = ranks_[this->index(e)]; if (e.partitionType()!=Dune::InteriorEntity && e.partitionType()!=Dune::BorderEntity) data = (1<<24); buff.write(data); @@ -220,7 +220,7 @@ class ParallelISTLHelper void scatter (MessageBuffer& buff, const EntityType& e, size_t n) { std::size_t x; - std::size_t& data = ranks_[this->map(e)]; + std::size_t& data = ranks_[this->index(e)]; buff.read(x); if (e.partitionType()!=Dune::InteriorEntity && e.partitionType()!=Dune::BorderEntity) data = x; @@ -324,7 +324,7 @@ class ParallelISTLHelper { int x; buff.read(x); - int& data= shared_[this->map(e)]; + int& data= shared_[this->index(e)]; data = data || x; } private: @@ -366,7 +366,7 @@ class ParallelISTLHelper template<class MessageBuffer, class EntityType> void gather (MessageBuffer& buff, const EntityType& e) const { - buff.write(gindices_[this->map(e)]); + buff.write(gindices_[this->index(e)]); } template<class MessageBuffer, class EntityType> @@ -374,7 +374,7 @@ class ParallelISTLHelper { DataType x; buff.read(x); - gindices_[this->map(e)] = std::min(gindices_[this->map(e)], x); + gindices_[this->index(e)] = std::min(gindices_[this->index(e)], x); } private: std::vector<GI>& gindices_; diff --git a/dumux/linear/elementborderlistfromgrid.hh b/dumux/linear/elementborderlistfromgrid.hh index 0d162632a055128cb6bd549a805d5229f7f67991..317cca2809cadde32fabb42166e0519fd49fd66b 100644 --- a/dumux/linear/elementborderlistfromgrid.hh +++ b/dumux/linear/elementborderlistfromgrid.hh @@ -88,7 +88,7 @@ public: void gather(MessageBufferImp &buff, const EntityType &e) const { buff.write(gridView_.comm().rank()); - buff.write(map_.map(e)); + buff.write(map_.index(e)); } template<class MessageBufferImp, class EntityType> @@ -96,7 +96,7 @@ public: { BorderIndex bIdx; - bIdx.localIdx = map_.map(e); + bIdx.localIdx = map_.index(e); buff.read(bIdx.peerRank); buff.read(bIdx.peerIdx); bIdx.borderDistance = 0; diff --git a/test/porousmediumflow/1p/sequential/resultevaluation3d.hh b/test/porousmediumflow/1p/sequential/resultevaluation3d.hh index 7efbf3ac61d66a4170b7f3176f1ae48e4b8e5267..1eeb304ca3b704ece174cdb0e214e7a60eef8766 100644 --- a/test/porousmediumflow/1p/sequential/resultevaluation3d.hh +++ b/test/porousmediumflow/1p/sequential/resultevaluation3d.hh @@ -86,8 +86,8 @@ public: typedef typename Entity::Geometry Geometry; typedef typename Grid::LevelGridView GV; typedef typename GV::IndexSet IS; - typedef Dune::MultipleCodimMultipleGeomTypeMapper<GV,Dune::MCMGElementLayout> EM; - typedef Dune::MultipleCodimMultipleGeomTypeMapper<GV,FaceLayout> FM; + typedef Dune::MultipleCodimMultipleGeomTypeMapper<GV,Dune::MCMGElementLayout> ElementMapper; + typedef Dune::MultipleCodimMultipleGeomTypeMapper<GV,FaceLayout> FaceMapper; typedef typename Grid::ctype ct; enum{dim = Grid::dimension}; @@ -96,8 +96,8 @@ public: typedef typename Dune::ReferenceElements<ct, dim> ReferenceElements; const GV& gridview(grid.levelGridView(grid.maxLevel())); const IS& indexset(gridview.indexSet()); - EM elementmapper(gridview); - FM facemapper(gridview); + ElementMapper elementMapper(gridview); + FaceMapper faceMapper(gridview); SolutionType& exactSol(grid.levelGridView(grid.maxLevel())); uMean = 0; @@ -108,7 +108,7 @@ public: double volume = element.geometry().volume(); // cell index - int indexi = elementmapper.map(element); + int indexi = elementMapper.index(element); // get approximate solution value uMean += volume*(problem.variables().cellData(indexi).globalPressure()); @@ -174,7 +174,7 @@ public: double exactValue = problem.exact(globalPos); // cell index - int indexi = elementmapper.map(element); + int indexi = elementMapper.index(element); // evaluate exact solution vector exactSol[indexi] = exactValue; @@ -211,7 +211,7 @@ public: i = intersection.indexInInside(); // global number of face - int faceIndex = facemapper.template map<1>(element, i); + int faceIndex = faceMapper.template map<1>(element, i); Dune::FieldVector<double,dim> faceGlobal = intersection.geometry().center(); double faceVol = intersection.geometry().volume(); @@ -472,7 +472,6 @@ public: Scalar volume = geometry.volume(); - //int eIdx = elementMapper.map(element); int eIdx = problem.variables().index(element); Scalar approxPressure = problem.variables().cellData(eIdx).globalPressure(); @@ -727,11 +726,10 @@ public: Scalar volume = geometry.integrationElement(local) *ReferenceElements::general(geomType).volume(); - int eIdx = elementMapper.map(element); + int eIdx = elementMapper.index(element); Scalar approxPressure = solution[eIdx]; Scalar exactPressure = problem.exact(globalPos); - //std::cout << global << ": p =" << exactPressure << ", p_h = " << approxPressure << std::endl; numerator += volume*(approxPressure - exactPressure)*(approxPressure - exactPressure); denominator += volume*exactPressure*exactPressure; diff --git a/test/porousmediumflow/2p/implicit/cc2pcornerpointproblem.hh b/test/porousmediumflow/2p/implicit/cc2pcornerpointproblem.hh index 3b06af54f1bd3ae778030fe51584932c7512938c..e45273762e3054bffb0159c5b8515912c8c15e4f 100644 --- a/test/porousmediumflow/2p/implicit/cc2pcornerpointproblem.hh +++ b/test/porousmediumflow/2p/implicit/cc2pcornerpointproblem.hh @@ -317,7 +317,7 @@ public: { FVElementGeometry fvGeometry; fvGeometry.update(this->gridView(), element); - int eIdx = this->elementMapper().map(element); + int eIdx = this->elementMapper().index(element); const DimWorldMatrix K = this->spatialParams().intrinsicPermeability(element, fvGeometry, /*element data*/ 0); // transfer output to mD = 9.86923e-16 m^2 diff --git a/test/porousmediumflow/co2/implicit/heterogeneousproblem.hh b/test/porousmediumflow/co2/implicit/heterogeneousproblem.hh index 4b512cba09a82e7804988e0c7599c10833ce7a8a..d4e6df8ff8a296567e624b74356497972c503868 100644 --- a/test/porousmediumflow/co2/implicit/heterogeneousproblem.hh +++ b/test/porousmediumflow/co2/implicit/heterogeneousproblem.hh @@ -266,14 +266,14 @@ public: for (const auto& element : Dune::elements(this->gridView())) { - int eIdx = this->elementMapper().map(element); + int eIdx = this->elementMapper().index(element); (*rank)[eIdx] = this->gridView().comm().rank(); fvGeometry.update(this->gridView(), element); for (int scvIdx = 0; scvIdx < fvGeometry.numScv; ++scvIdx) { - int dofIdxGlobal = this->model().dofMapper().map(element, scvIdx, dofCodim); + int dofIdxGlobal = this->model().dofMapper().subIndex(element, scvIdx, dofCodim); volVars.update(this->model().curSol()[dofIdxGlobal], *this, element, diff --git a/test/porousmediumflow/co2/implicit/heterogeneousproblemni.hh b/test/porousmediumflow/co2/implicit/heterogeneousproblemni.hh index 65a8271f8cda676bd70446321d28798a26dc9d1b..52de16ed48bbf0b524a5a477776b68623df7bfb1 100644 --- a/test/porousmediumflow/co2/implicit/heterogeneousproblemni.hh +++ b/test/porousmediumflow/co2/implicit/heterogeneousproblemni.hh @@ -273,14 +273,14 @@ public: for (const auto& element : Dune::elements(this->gridView())) { - int eIdx = this->elementMapper().map(element); + int eIdx = this->elementMapper().index(element); (*rank)[eIdx] = this->gridView().comm().rank(); fvGeometry.update(this->gridView(), element); for (int scvIdx = 0; scvIdx < fvGeometry.numScv; ++scvIdx) { - int dofIdxGlobal = this->model().dofMapper().map(element, scvIdx, dofCodim); + int dofIdxGlobal = this->model().dofMapper().subIndex(element, scvIdx, dofCodim); volVars.update(this->model().curSol()[dofIdxGlobal], *this, element,