diff --git a/dumux/common/intersectionmapper.hh b/dumux/common/intersectionmapper.hh index 761f21e1c8d0361da116b4a2df9b3bfa4827c109..d9c5d6ebc619f048aa024b0ba4652f2bf9dbd4d8 100644 --- a/dumux/common/intersectionmapper.hh +++ b/dumux/common/intersectionmapper.hh @@ -153,7 +153,7 @@ public: ElementIterator eEndIt = gridView_.template end<0>(); for (ElementIterator eIt = gridView_.template begin<0>(); eIt != eEndIt; ++eIt) { - int globalIdx = map(*eIt); + int eIdxGlobal = map(*eIt); int fIdx = 0; // run through all intersections with neighbors @@ -161,7 +161,7 @@ public: for (IntersectionIterator isIt = gridView_.ibegin(*eIt); isIt != isEndIt; ++isIt) { int indexInInside = isIt->indexInInside(); - intersectionMapLocal_[globalIdx][fIdx] = indexInInside; + intersectionMapLocal_[eIdxGlobal][fIdx] = indexInInside; fIdx++; } @@ -170,7 +170,7 @@ public: int globalIntersectionIdx = 0; for (ElementIterator eIt = gridView_.template begin<0>(); eIt != eEndIt; ++eIt) { - int globalIdx = map(*eIt); + int eIdxGlobal = map(*eIt); int fIdx = 0; // run through all intersections with neighbors @@ -182,7 +182,7 @@ public: ElementPointer neighbor = isIt->outside(); int globalIdxNeighbor = map(*neighbor); - if (eIt->level() > neighbor->level() || (eIt->level() == neighbor->level() && globalIdx < globalIdxNeighbor)) + if (eIt->level() > neighbor->level() || (eIt->level() == neighbor->level() && eIdxGlobal < globalIdxNeighbor)) { int faceIdxNeighbor = 0; @@ -206,14 +206,14 @@ public: } } - intersectionMapGlobal_[globalIdx][fIdx] = globalIntersectionIdx; + intersectionMapGlobal_[eIdxGlobal][fIdx] = globalIntersectionIdx; intersectionMapGlobal_[globalIdxNeighbor][faceIdxNeighbor] = globalIntersectionIdx; globalIntersectionIdx ++; } } else { - intersectionMapGlobal_[globalIdx][fIdx] = globalIntersectionIdx; + intersectionMapGlobal_[eIdxGlobal][fIdx] = globalIntersectionIdx; globalIntersectionIdx ++; } fIdx++; diff --git a/dumux/decoupled/1p/diffusion/fv/fvpressure1p.hh b/dumux/decoupled/1p/diffusion/fv/fvpressure1p.hh index 8786ec38a0aed89492f6bafe65ba9349e10c5293..c48e1372d846504a209fcc9edfef81ff855c191e 100644 --- a/dumux/decoupled/1p/diffusion/fv/fvpressure1p.hh +++ b/dumux/decoupled/1p/diffusion/fv/fvpressure1p.hh @@ -157,12 +157,12 @@ public: /*! \brief Stores the pressure solution of a cell * - * \param globalIdx Global cell index + * \param eIdxGlobal Global cell index * \param cellData A CellData object */ - void storePressureSolution(int globalIdx, CellData& cellData) + void storePressureSolution(int eIdxGlobal, CellData& cellData) { - Scalar press = this->pressure()[globalIdx]; + Scalar press = this->pressure()[eIdxGlobal]; cellData.setPressure(press); } diff --git a/dumux/decoupled/1p/diffusion/fv/fvvelocity1p.hh b/dumux/decoupled/1p/diffusion/fv/fvvelocity1p.hh index 711c731897b8cc868a497a8097b4d0d3c403160c..53c7640f4f02e6a452832a543775870ca6b48c98 100644 --- a/dumux/decoupled/1p/diffusion/fv/fvvelocity1p.hh +++ b/dumux/decoupled/1p/diffusion/fv/fvvelocity1p.hh @@ -119,9 +119,9 @@ public: for (ElementIterator eIt = problem_.gridView().template begin<0>(); eIt != eEndIt; ++eIt) { // cell index - int globalIdx = problem_.variables().index(*eIt); + int eIdxGlobal = problem_.variables().index(*eIt); - CellData& cellData = problem_.variables().cellData(globalIdx); + CellData& cellData = problem_.variables().cellData(eIdxGlobal); const typename Element::Geometry& geometry = eIt->geometry(); // get corresponding reference element @@ -181,7 +181,7 @@ public: jacobianT.umtv(refVelocity, elementVelocity); elementVelocity /= geometry.integrationElement(localPos); - velocity[globalIdx] = elementVelocity; + velocity[eIdxGlobal] = elementVelocity; } writer.attachCellData(velocity, "velocity", dim); @@ -208,9 +208,9 @@ void FVVelocity1P<TypeTag>::calculateVelocity(const Intersection& intersection, ElementPointer elementI = intersection.inside(); ElementPointer elementJ = intersection.outside(); - int globalIdxJ = problem_.variables().index(*elementJ); + int eIdxGlobalJ = problem_.variables().index(*elementJ); - CellData& cellDataJ = problem_.variables().cellData(globalIdxJ); + CellData& cellDataJ = problem_.variables().cellData(eIdxGlobalJ); // get global coordinates of cell centers const GlobalPosition& globalPosI = elementI->geometry().center(); diff --git a/dumux/decoupled/2p/diffusion/fv/fvpressure2p.hh b/dumux/decoupled/2p/diffusion/fv/fvpressure2p.hh index 1751ced59e95f2c6c482db5e8e17ffea2f68fc82..1646fed9dd874d822e94bb6a27dfd174b385cbf2 100644 --- a/dumux/decoupled/2p/diffusion/fv/fvpressure2p.hh +++ b/dumux/decoupled/2p/diffusion/fv/fvpressure2p.hh @@ -320,8 +320,8 @@ public: */ void storePressureSolution(const Element& element) { - int globalIdx = problem_.variables().index(element); - CellData& cellData = problem_.variables().cellData(globalIdx); + int eIdxGlobal = problem_.variables().index(element); + CellData& cellData = problem_.variables().cellData(eIdxGlobal); if (compressibility_) { @@ -333,7 +333,7 @@ public: { case pw: { - Scalar pressW = this->pressure()[globalIdx]; + Scalar pressW = this->pressure()[eIdxGlobal]; Scalar pc = cellData.capillaryPressure(); cellData.setPressure(wPhaseIdx, pressW); @@ -350,7 +350,7 @@ public: } case pn: { - Scalar pressNw = this->pressure()[globalIdx]; + Scalar pressNw = this->pressure()[eIdxGlobal]; Scalar pc = cellData.capillaryPressure(); cellData.setPressure(nPhaseIdx, pressNw); @@ -367,7 +367,7 @@ public: } case pGlobal: { - Scalar press = this->pressure()[globalIdx]; + Scalar press = this->pressure()[eIdxGlobal]; cellData.setGlobalPressure(press); Scalar pc = cellData.capillaryPressure(); @@ -1057,9 +1057,9 @@ void FVPressure2P<TypeTag>::updateMaterialLaws() ElementIterator eEndIt = problem_.gridView().template end<0>(); for (ElementIterator eIt = problem_.gridView().template begin<0>(); eIt != eEndIt; ++eIt) { - int globalIdx = problem_.variables().index(*eIt); + int eIdxGlobal = problem_.variables().index(*eIt); - CellData& cellData = problem_.variables().cellData(globalIdx); + CellData& cellData = problem_.variables().cellData(eIdxGlobal); Scalar temperature = problem_.temperature(*eIt); diff --git a/dumux/decoupled/2p/diffusion/fv/fvvelocity2p.hh b/dumux/decoupled/2p/diffusion/fv/fvvelocity2p.hh index a8ef06742d986ee595c33104815d7e7f66228921..4da38ca88e6e83b420d45592e4dcae75fa1ae696 100644 --- a/dumux/decoupled/2p/diffusion/fv/fvvelocity2p.hh +++ b/dumux/decoupled/2p/diffusion/fv/fvvelocity2p.hh @@ -194,9 +194,9 @@ public: for (ElementIterator eIt = problem_.gridView().template begin<0>(); eIt != eEndIt; ++eIt) { // cell index - int globalIdx = problem_.variables().index(*eIt); + int eIdxGlobal = problem_.variables().index(*eIt); - CellData& cellData = problem_.variables().cellData(globalIdx); + CellData& cellData = problem_.variables().cellData(eIdxGlobal); const typename Element::Geometry& geometry = eIt->geometry(); // get corresponding reference element @@ -256,7 +256,7 @@ public: jacobianT.umtv(refVelocity, elementVelocity); elementVelocity /= geometry.integrationElement(localPos); - velocity[globalIdx] = elementVelocity; + velocity[eIdxGlobal] = elementVelocity; // calculate velocity on reference element as the Raviart-Thomas-0 // interpolant of the fluxes @@ -286,7 +286,7 @@ public: jacobianT.umtv(refVelocity, elementVelocity); elementVelocity /= geometry.integrationElement(localPos); - velocitySecondPhase[globalIdx] = elementVelocity; + velocitySecondPhase[eIdxGlobal] = elementVelocity; } //switch velocities @@ -334,9 +334,9 @@ void FVVelocity2P<TypeTag>::calculateVelocity(const Intersection& intersection, ElementPointer elementI = intersection.inside(); ElementPointer elementJ = intersection.outside(); - int globalIdxJ = problem_.variables().index(*elementJ); + int eIdxGlobalJ = problem_.variables().index(*elementJ); - CellData& cellDataJ = problem_.variables().cellData(globalIdxJ); + CellData& cellDataJ = problem_.variables().cellData(eIdxGlobalJ); // get global coordinates of cell centers const GlobalPosition& globalPosI = (*elementI).geometry().center(); diff --git a/dumux/decoupled/2p/diffusion/fvmpfa/lmethod/fvmpfal2dpressure2p.hh b/dumux/decoupled/2p/diffusion/fvmpfa/lmethod/fvmpfal2dpressure2p.hh index a9f289c89401589fe8673214225e60faec2635f6..e8df6d471c5c22dd5c939438fb30d392cab8d1cc 100644 --- a/dumux/decoupled/2p/diffusion/fvmpfa/lmethod/fvmpfal2dpressure2p.hh +++ b/dumux/decoupled/2p/diffusion/fvmpfa/lmethod/fvmpfal2dpressure2p.hh @@ -238,14 +238,14 @@ public: */ void storePressureSolution(const Element& element) { - int globalIdx = problem_.variables().index(element); - CellData& cellData = problem_.variables().cellData(globalIdx); + int eIdxGlobal = problem_.variables().index(element); + CellData& cellData = problem_.variables().cellData(eIdxGlobal); switch (pressureType_) { case pw: { - Scalar potW = this->pressure()[globalIdx]; + Scalar potW = this->pressure()[eIdxGlobal]; Scalar gravityDiff = (problem_.bBoxMax() - element.geometry().center()) * gravity_; Scalar potPc = cellData.capillaryPressure() @@ -263,7 +263,7 @@ public: } case pn: { - Scalar potNw = this->pressure()[globalIdx]; + Scalar potNw = this->pressure()[eIdxGlobal]; Scalar gravityDiff = (problem_.bBoxMax() - element.geometry().center()) * gravity_; Scalar potPc = cellData.capillaryPressure() @@ -533,7 +533,7 @@ void FvMpfaL2dPressure2p<TypeTag>::initializeMatrix() for (ElementIterator eIt = eItBegin; eIt != eEndIt; ++eIt) { // cell index - int globalIdxI = problem_.variables().index(*eIt); + int eIdxGlobalI = problem_.variables().index(*eIt); // initialize row size int rowSize = 1; @@ -617,8 +617,8 @@ void FvMpfaL2dPressure2p<TypeTag>::initializeMatrix() } // end of 'for' IntersectionIterator - // set number of indices in row globalIdxI to rowSize - this->A_.setrowsize(globalIdxI, rowSize); + // set number of indices in row eIdxGlobalI to rowSize + this->A_.setrowsize(eIdxGlobalI, rowSize); } // end of 'for' ElementIterator @@ -629,10 +629,10 @@ void FvMpfaL2dPressure2p<TypeTag>::initializeMatrix() for (ElementIterator eIt = eItBegin; eIt != eEndIt; ++eIt) { // cell index - int globalIdxI = problem_.variables().index(*eIt); + int eIdxGlobalI = problem_.variables().index(*eIt); // add diagonal index - this->A_.addindex(globalIdxI, globalIdxI); + this->A_.addindex(eIdxGlobalI, eIdxGlobalI); // run through all intersections with neighbors IntersectionIterator isItBegin = problem_.gridView().ibegin(*eIt); @@ -688,11 +688,11 @@ void FvMpfaL2dPressure2p<TypeTag>::initializeMatrix() { // access neighbor ElementPointer outside = isIt->outside(); - int globalIdxJ = problem_.variables().index(*outside); + int eIdxGlobalJ = problem_.variables().index(*outside); // add off diagonal index // add index (row,col) to the matrix - this->A_.addindex(globalIdxI, globalIdxJ); + this->A_.addindex(eIdxGlobalI, eIdxGlobalJ); } if (isIt->neighbor() && nextIsIt->neighbor()) @@ -716,9 +716,9 @@ void FvMpfaL2dPressure2p<TypeTag>::initializeMatrix() if (innerisItoutside == innernextisItoutside && innerisItoutside != isIt->inside()) { - int globalIdxJ = problem_.variables().index(*innerisItoutside); + int eIdxGlobalJ = problem_.variables().index(*innerisItoutside); - this->A_.addindex(globalIdxI, globalIdxJ); + this->A_.addindex(eIdxGlobalI, eIdxGlobalJ); } } } @@ -764,7 +764,7 @@ void FvMpfaL2dPressure2p<TypeTag>::storeInteractionVolumeInfo() { // get common geometry information for the following computation - int globalIdx1 = problem_.variables().index(*eIt); + int eIdxGlobal1 = problem_.variables().index(*eIt); IntersectionIterator isIt12Begin = problem_.gridView().ibegin(*eIt); IntersectionIterator isIt12End = problem_.gridView().iend(*eIt); @@ -858,7 +858,7 @@ void FvMpfaL2dPressure2p<TypeTag>::storeInteractionVolumeInfo() { corner1234 = eIt->geometry().corner(localVertIdx12corner); // std::cout<<"corner1234 = "<<corner1234<<"\n"; -// std::cout<<"globalIdx = "<<globalIdx1<<"\n"; +// std::cout<<"eIdxGlobal = "<<eIdxGlobal1<<"\n"; globalVertIdx1234 = globalVertIdx12corner; @@ -924,7 +924,7 @@ void FvMpfaL2dPressure2p<TypeTag>::storeInteractionVolumeInfo() // access neighbor cell 2 of 'isIt12' ElementPointer elementPointer2 = isIt12->outside(); - int globalIdx2 = problem_.variables().index(*elementPointer2); + int eIdxGlobal2 = problem_.variables().index(*elementPointer2); //store pointer 2 interactionVolumes_[globalVertIdx1234].setSubVolumeElement(elementPointer2, 1); @@ -1106,8 +1106,8 @@ void FvMpfaL2dPressure2p<TypeTag>::storeInteractionVolumeInfo() interactionVolumes_[globalVertIdx1234].setOutsideFace(2); - innerBoundaryVolumeFaces_[globalIdx1][isIt12->indexInInside()] = true; - innerBoundaryVolumeFaces_[globalIdx2][isIt12->indexInOutside()] = true; + innerBoundaryVolumeFaces_[eIdxGlobal1][isIt12->indexInInside()] = true; + innerBoundaryVolumeFaces_[eIdxGlobal2][isIt12->indexInOutside()] = true; finished = true; @@ -1186,7 +1186,7 @@ void FvMpfaL2dPressure2p<TypeTag>::storeInteractionVolumeInfo() interactionVolumes_[globalVertIdx1234].setFaceArea(faceVol41, 3, 0); interactionVolumes_[globalVertIdx1234].setFacePosition(globalPosFace41, 3, 0); - int globalIdx4 = problem_.variables().index(*elementPointer4); + int eIdxGlobal4 = problem_.variables().index(*elementPointer4); bool finished = false; @@ -1238,8 +1238,8 @@ void FvMpfaL2dPressure2p<TypeTag>::storeInteractionVolumeInfo() interactionVolumes_[globalVertIdx1234].setOutsideFace(1); - innerBoundaryVolumeFaces_[globalIdx1][isIt14->indexInInside()] = true; - innerBoundaryVolumeFaces_[globalIdx4][isIt14->indexInOutside()] = true; + innerBoundaryVolumeFaces_[eIdxGlobal1][isIt14->indexInInside()] = true; + innerBoundaryVolumeFaces_[eIdxGlobal4][isIt14->indexInOutside()] = true; // get absolute permeability of neighbor cell 2 DimMatrix K4( @@ -1308,32 +1308,32 @@ void FvMpfaL2dPressure2p<TypeTag>::assemble() Scalar volume4 = elementPointer4->geometry().volume(); // cell index - int globalIdx1 = problem_.variables().index(*elementPointer1); - int globalIdx2 = problem_.variables().index(*elementPointer2); - int globalIdx3 = problem_.variables().index(*elementPointer3); - int globalIdx4 = problem_.variables().index(*elementPointer4); + int eIdxGlobal1 = problem_.variables().index(*elementPointer1); + int eIdxGlobal2 = problem_.variables().index(*elementPointer2); + int eIdxGlobal3 = problem_.variables().index(*elementPointer3); + int eIdxGlobal4 = problem_.variables().index(*elementPointer4); //get the cell Data - CellData& cellData1 = problem_.variables().cellData(globalIdx1); - CellData& cellData2 = problem_.variables().cellData(globalIdx2); - CellData& cellData3 = problem_.variables().cellData(globalIdx3); - CellData& cellData4 = problem_.variables().cellData(globalIdx4); + CellData& cellData1 = problem_.variables().cellData(eIdxGlobal1); + CellData& cellData2 = problem_.variables().cellData(eIdxGlobal2); + CellData& cellData3 = problem_.variables().cellData(eIdxGlobal3); + CellData& cellData4 = problem_.variables().cellData(eIdxGlobal4); // evaluate right hand side PrimaryVariables source(0.0); problem_.source(source, *elementPointer1); - this->f_[globalIdx1] += volume1 / (4.0) * (source[wPhaseIdx] / density_[wPhaseIdx] + source[nPhaseIdx] / density_[nPhaseIdx]); + this->f_[eIdxGlobal1] += volume1 / (4.0) * (source[wPhaseIdx] / density_[wPhaseIdx] + source[nPhaseIdx] / density_[nPhaseIdx]); problem_.source(source, *elementPointer2); - this->f_[globalIdx2] += volume2 / (4.0) * (source[wPhaseIdx] / density_[wPhaseIdx] + source[nPhaseIdx] / density_[nPhaseIdx]); + this->f_[eIdxGlobal2] += volume2 / (4.0) * (source[wPhaseIdx] / density_[wPhaseIdx] + source[nPhaseIdx] / density_[nPhaseIdx]); problem_.source(source, *elementPointer3); - this->f_[globalIdx3] += volume3 / (4.0) * (source[wPhaseIdx] / density_[wPhaseIdx] + source[nPhaseIdx] / density_[nPhaseIdx]); + this->f_[eIdxGlobal3] += volume3 / (4.0) * (source[wPhaseIdx] / density_[wPhaseIdx] + source[nPhaseIdx] / density_[nPhaseIdx]); problem_.source(source, *elementPointer4); - this->f_[globalIdx4] += volume4 / (4.0) * (source[wPhaseIdx] / density_[wPhaseIdx] + source[nPhaseIdx] / density_[nPhaseIdx]); + this->f_[eIdxGlobal4] += volume4 / (4.0) * (source[wPhaseIdx] / density_[wPhaseIdx] + source[nPhaseIdx] / density_[nPhaseIdx]); - this->f_[globalIdx1] += evaluateErrorTerm_(cellData1) * volume1 / (4.0); - this->f_[globalIdx2] += evaluateErrorTerm_(cellData2) * volume2 / (4.0); - this->f_[globalIdx3] += evaluateErrorTerm_(cellData3) * volume3 / (4.0); - this->f_[globalIdx4] += evaluateErrorTerm_(cellData4) * volume4 / (4.0); + this->f_[eIdxGlobal1] += evaluateErrorTerm_(cellData1) * volume1 / (4.0); + this->f_[eIdxGlobal2] += evaluateErrorTerm_(cellData2) * volume2 / (4.0); + this->f_[eIdxGlobal3] += evaluateErrorTerm_(cellData3) * volume3 / (4.0); + this->f_[eIdxGlobal4] += evaluateErrorTerm_(cellData4) * volume4 / (4.0); //get mobilities of the phases Dune::FieldVector<Scalar, numPhases> lambda1(cellData1.mobility(wPhaseIdx)); @@ -1408,17 +1408,17 @@ void FvMpfaL2dPressure2p<TypeTag>::assemble() if (lType == TransmissibilityCalculator::rightTriangle) { - if (innerBoundaryVolumeFaces_[globalIdx1][interactionVolume.getIndexOnElement(0, 0)]) + if (innerBoundaryVolumeFaces_[eIdxGlobal1][interactionVolume.getIndexOnElement(0, 0)]) { T *= 2; } - this->A_[globalIdx1][globalIdx2] += T[1][0]; - this->A_[globalIdx1][globalIdx3] += T[1][1]; - this->A_[globalIdx1][globalIdx1] += T[1][2]; + this->A_[eIdxGlobal1][eIdxGlobal2] += T[1][0]; + this->A_[eIdxGlobal1][eIdxGlobal3] += T[1][1]; + this->A_[eIdxGlobal1][eIdxGlobal1] += T[1][2]; - this->A_[globalIdx2][globalIdx2] -= T[1][0]; - this->A_[globalIdx2][globalIdx3] -= T[1][1]; - this->A_[globalIdx2][globalIdx1] -= T[1][2]; + this->A_[eIdxGlobal2][eIdxGlobal2] -= T[1][0]; + this->A_[eIdxGlobal2][eIdxGlobal3] -= T[1][1]; + this->A_[eIdxGlobal2][eIdxGlobal1] -= T[1][2]; u[0] = pc[1]; u[1] = pc[2]; @@ -1431,17 +1431,17 @@ void FvMpfaL2dPressure2p<TypeTag>::assemble() } else { - if (innerBoundaryVolumeFaces_[globalIdx1][interactionVolume.getIndexOnElement(0, 0)]) + if (innerBoundaryVolumeFaces_[eIdxGlobal1][interactionVolume.getIndexOnElement(0, 0)]) { T *= 2; } - this->A_[globalIdx1][globalIdx1] += T[1][0]; - this->A_[globalIdx1][globalIdx4] += T[1][1]; - this->A_[globalIdx1][globalIdx2] += T[1][2]; + this->A_[eIdxGlobal1][eIdxGlobal1] += T[1][0]; + this->A_[eIdxGlobal1][eIdxGlobal4] += T[1][1]; + this->A_[eIdxGlobal1][eIdxGlobal2] += T[1][2]; - this->A_[globalIdx2][globalIdx1] -= T[1][0]; - this->A_[globalIdx2][globalIdx4] -= T[1][1]; - this->A_[globalIdx2][globalIdx2] -= T[1][2]; + this->A_[eIdxGlobal2][eIdxGlobal1] -= T[1][0]; + this->A_[eIdxGlobal2][eIdxGlobal4] -= T[1][1]; + this->A_[eIdxGlobal2][eIdxGlobal2] -= T[1][2]; u[0] = pc[0]; u[1] = pc[3]; @@ -1457,17 +1457,17 @@ void FvMpfaL2dPressure2p<TypeTag>::assemble() if (lType == TransmissibilityCalculator::rightTriangle) { - if (innerBoundaryVolumeFaces_[globalIdx2][interactionVolume.getIndexOnElement(1, 0)]) + if (innerBoundaryVolumeFaces_[eIdxGlobal2][interactionVolume.getIndexOnElement(1, 0)]) { T *= 2; } - this->A_[globalIdx2][globalIdx3] += T[1][0]; - this->A_[globalIdx2][globalIdx4] += T[1][1]; - this->A_[globalIdx2][globalIdx2] += T[1][2]; + this->A_[eIdxGlobal2][eIdxGlobal3] += T[1][0]; + this->A_[eIdxGlobal2][eIdxGlobal4] += T[1][1]; + this->A_[eIdxGlobal2][eIdxGlobal2] += T[1][2]; - this->A_[globalIdx3][globalIdx3] -= T[1][0]; - this->A_[globalIdx3][globalIdx4] -= T[1][1]; - this->A_[globalIdx3][globalIdx2] -= T[1][2]; + this->A_[eIdxGlobal3][eIdxGlobal3] -= T[1][0]; + this->A_[eIdxGlobal3][eIdxGlobal4] -= T[1][1]; + this->A_[eIdxGlobal3][eIdxGlobal2] -= T[1][2]; u[0] = pc[2]; u[1] = pc[3]; @@ -1480,17 +1480,17 @@ void FvMpfaL2dPressure2p<TypeTag>::assemble() } else { - if (innerBoundaryVolumeFaces_[globalIdx2][interactionVolume.getIndexOnElement(1, 0)]) + if (innerBoundaryVolumeFaces_[eIdxGlobal2][interactionVolume.getIndexOnElement(1, 0)]) { T *= 2; } - this->A_[globalIdx2][globalIdx2] += T[1][0]; - this->A_[globalIdx2][globalIdx1] += T[1][1]; - this->A_[globalIdx2][globalIdx3] += T[1][2]; + this->A_[eIdxGlobal2][eIdxGlobal2] += T[1][0]; + this->A_[eIdxGlobal2][eIdxGlobal1] += T[1][1]; + this->A_[eIdxGlobal2][eIdxGlobal3] += T[1][2]; - this->A_[globalIdx3][globalIdx2] -= T[1][0]; - this->A_[globalIdx3][globalIdx1] -= T[1][1]; - this->A_[globalIdx3][globalIdx3] -= T[1][2]; + this->A_[eIdxGlobal3][eIdxGlobal2] -= T[1][0]; + this->A_[eIdxGlobal3][eIdxGlobal1] -= T[1][1]; + this->A_[eIdxGlobal3][eIdxGlobal3] -= T[1][2]; u[0] = pc[1]; u[1] = pc[0]; @@ -1506,17 +1506,17 @@ void FvMpfaL2dPressure2p<TypeTag>::assemble() if (lType == TransmissibilityCalculator::rightTriangle) { - if (innerBoundaryVolumeFaces_[globalIdx3][interactionVolume.getIndexOnElement(2, 0)]) + if (innerBoundaryVolumeFaces_[eIdxGlobal3][interactionVolume.getIndexOnElement(2, 0)]) { T *= 2; } - this->A_[globalIdx3][globalIdx4] += T[1][0]; - this->A_[globalIdx3][globalIdx1] += T[1][1]; - this->A_[globalIdx3][globalIdx3] += T[1][2]; + this->A_[eIdxGlobal3][eIdxGlobal4] += T[1][0]; + this->A_[eIdxGlobal3][eIdxGlobal1] += T[1][1]; + this->A_[eIdxGlobal3][eIdxGlobal3] += T[1][2]; - this->A_[globalIdx4][globalIdx4] -= T[1][0]; - this->A_[globalIdx4][globalIdx1] -= T[1][1]; - this->A_[globalIdx4][globalIdx3] -= T[1][2]; + this->A_[eIdxGlobal4][eIdxGlobal4] -= T[1][0]; + this->A_[eIdxGlobal4][eIdxGlobal1] -= T[1][1]; + this->A_[eIdxGlobal4][eIdxGlobal3] -= T[1][2]; u[0] = pc[3]; u[1] = pc[0]; @@ -1529,17 +1529,17 @@ void FvMpfaL2dPressure2p<TypeTag>::assemble() } else { - if (innerBoundaryVolumeFaces_[globalIdx3][interactionVolume.getIndexOnElement(2, 0)]) + if (innerBoundaryVolumeFaces_[eIdxGlobal3][interactionVolume.getIndexOnElement(2, 0)]) { T *= 2; } - this->A_[globalIdx3][globalIdx3] += T[1][0]; - this->A_[globalIdx3][globalIdx2] += T[1][1]; - this->A_[globalIdx3][globalIdx4] += T[1][2]; + this->A_[eIdxGlobal3][eIdxGlobal3] += T[1][0]; + this->A_[eIdxGlobal3][eIdxGlobal2] += T[1][1]; + this->A_[eIdxGlobal3][eIdxGlobal4] += T[1][2]; - this->A_[globalIdx4][globalIdx3] -= T[1][0]; - this->A_[globalIdx4][globalIdx2] -= T[1][1]; - this->A_[globalIdx4][globalIdx4] -= T[1][2]; + this->A_[eIdxGlobal4][eIdxGlobal3] -= T[1][0]; + this->A_[eIdxGlobal4][eIdxGlobal2] -= T[1][1]; + this->A_[eIdxGlobal4][eIdxGlobal4] -= T[1][2]; u[0] = pc[2]; u[1] = pc[1]; @@ -1555,17 +1555,17 @@ void FvMpfaL2dPressure2p<TypeTag>::assemble() if (lType == TransmissibilityCalculator::rightTriangle) { - if (innerBoundaryVolumeFaces_[globalIdx4][interactionVolume.getIndexOnElement(3, 0)]) + if (innerBoundaryVolumeFaces_[eIdxGlobal4][interactionVolume.getIndexOnElement(3, 0)]) { T *= 2; } - this->A_[globalIdx4][globalIdx1] += T[1][0]; - this->A_[globalIdx4][globalIdx2] += T[1][1]; - this->A_[globalIdx4][globalIdx4] += T[1][2]; + this->A_[eIdxGlobal4][eIdxGlobal1] += T[1][0]; + this->A_[eIdxGlobal4][eIdxGlobal2] += T[1][1]; + this->A_[eIdxGlobal4][eIdxGlobal4] += T[1][2]; - this->A_[globalIdx1][globalIdx1] -= T[1][0]; - this->A_[globalIdx1][globalIdx2] -= T[1][1]; - this->A_[globalIdx1][globalIdx4] -= T[1][2]; + this->A_[eIdxGlobal1][eIdxGlobal1] -= T[1][0]; + this->A_[eIdxGlobal1][eIdxGlobal2] -= T[1][1]; + this->A_[eIdxGlobal1][eIdxGlobal4] -= T[1][2]; u[0] = pc[0]; u[1] = pc[1]; @@ -1578,17 +1578,17 @@ void FvMpfaL2dPressure2p<TypeTag>::assemble() } else { - if (innerBoundaryVolumeFaces_[globalIdx4][interactionVolume.getIndexOnElement(3, 0)]) + if (innerBoundaryVolumeFaces_[eIdxGlobal4][interactionVolume.getIndexOnElement(3, 0)]) { T *= 2; } - this->A_[globalIdx4][globalIdx4] += T[1][0]; - this->A_[globalIdx4][globalIdx3] += T[1][1]; - this->A_[globalIdx4][globalIdx1] += T[1][2]; + this->A_[eIdxGlobal4][eIdxGlobal4] += T[1][0]; + this->A_[eIdxGlobal4][eIdxGlobal3] += T[1][1]; + this->A_[eIdxGlobal4][eIdxGlobal1] += T[1][2]; - this->A_[globalIdx1][globalIdx4] -= T[1][0]; - this->A_[globalIdx1][globalIdx3] -= T[1][1]; - this->A_[globalIdx1][globalIdx1] -= T[1][2]; + this->A_[eIdxGlobal1][eIdxGlobal4] -= T[1][0]; + this->A_[eIdxGlobal1][eIdxGlobal3] -= T[1][1]; + this->A_[eIdxGlobal1][eIdxGlobal1] -= T[1][2]; u[0] = pc[3]; u[1] = pc[2]; @@ -1653,10 +1653,10 @@ void FvMpfaL2dPressure2p<TypeTag>::assemble() if (i == nPhaseIdx) { //add capillary pressure term to right hand side - this->f_[globalIdx1] -= (pcFluxReal[0] - pcFluxReal[3]); - this->f_[globalIdx2] -= (pcFluxReal[1] - pcFluxReal[0]); - this->f_[globalIdx3] -= (pcFluxReal[2] - pcFluxReal[1]); - this->f_[globalIdx4] -= (pcFluxReal[3] - pcFluxReal[2]); + this->f_[eIdxGlobal1] -= (pcFluxReal[0] - pcFluxReal[3]); + this->f_[eIdxGlobal2] -= (pcFluxReal[1] - pcFluxReal[0]); + this->f_[eIdxGlobal3] -= (pcFluxReal[2] - pcFluxReal[1]); + this->f_[eIdxGlobal4] -= (pcFluxReal[3] - pcFluxReal[2]); } break; @@ -1666,10 +1666,10 @@ void FvMpfaL2dPressure2p<TypeTag>::assemble() if (i == wPhaseIdx) { //add capillary pressure term to right hand side - this->f_[globalIdx1] += (pcFluxReal[0] - pcFluxReal[3]); - this->f_[globalIdx2] += (pcFluxReal[1] - pcFluxReal[0]); - this->f_[globalIdx3] += (pcFluxReal[2] - pcFluxReal[1]); - this->f_[globalIdx4] += (pcFluxReal[3] - pcFluxReal[2]); + this->f_[eIdxGlobal1] += (pcFluxReal[0] - pcFluxReal[3]); + this->f_[eIdxGlobal2] += (pcFluxReal[1] - pcFluxReal[0]); + this->f_[eIdxGlobal3] += (pcFluxReal[2] - pcFluxReal[1]); + this->f_[eIdxGlobal4] += (pcFluxReal[3] - pcFluxReal[2]); } break; } @@ -1706,10 +1706,10 @@ void FvMpfaL2dPressure2p<TypeTag>::assemble() Scalar volume = elementPointer->geometry().volume(); // cell index - int globalIdx = problem_.variables().index(*elementPointer); + int eIdxGlobal = problem_.variables().index(*elementPointer); //get the cell Data - CellData& cellData = problem_.variables().cellData(globalIdx); + CellData& cellData = problem_.variables().cellData(eIdxGlobal); //permeability vector at boundary DimMatrix permeability(problem_.spatialParams().intrinsicPermeability(*elementPointer)); @@ -1717,9 +1717,9 @@ void FvMpfaL2dPressure2p<TypeTag>::assemble() // evaluate right hand side PrimaryVariables source(0); problem_.source(source, *elementPointer); - this->f_[globalIdx] += volume / (4.0) * (source[wPhaseIdx] / density_[wPhaseIdx] + source[nPhaseIdx] / density_[nPhaseIdx]); + this->f_[eIdxGlobal] += volume / (4.0) * (source[wPhaseIdx] / density_[wPhaseIdx] + source[nPhaseIdx] / density_[nPhaseIdx]); - this->f_[globalIdx] += evaluateErrorTerm_(cellData) * volume / (4.0); + this->f_[eIdxGlobal] += evaluateErrorTerm_(cellData) * volume / (4.0); //get mobilities of the phases Dune::FieldVector<Scalar, numPhases> lambda(cellData.mobility(wPhaseIdx)); @@ -1860,8 +1860,8 @@ void FvMpfaL2dPressure2p<TypeTag>::assemble() } // set diagonal entry and right hand side entry - this->A_[globalIdx][globalIdx] += entry; - this->f_[globalIdx] += entry * potentialBound; + this->A_[eIdxGlobal][eIdxGlobal] += entry; + this->f_[eIdxGlobal] += entry * potentialBound; if (pc == 0 && pcBound == 0) { @@ -1877,7 +1877,7 @@ void FvMpfaL2dPressure2p<TypeTag>::assemble() if (i == nPhaseIdx) { //add capillary pressure term to right hand side - this->f_[globalIdx] -= pcFlux; + this->f_[eIdxGlobal] -= pcFlux; } break; } @@ -1886,7 +1886,7 @@ void FvMpfaL2dPressure2p<TypeTag>::assemble() if (i == wPhaseIdx) { //add capillary pressure term to right hand side - this->f_[globalIdx] += pcFlux; + this->f_[eIdxGlobal] += pcFlux; } break; } @@ -1899,7 +1899,7 @@ void FvMpfaL2dPressure2p<TypeTag>::assemble() Scalar J = interactionVolume.getNeumannValues(intVolFaceIdx)[wPhaseIdx] / density_[wPhaseIdx]; J += interactionVolume.getNeumannValues(intVolFaceIdx)[nPhaseIdx] / density_[nPhaseIdx]; - this->f_[globalIdx] -= J; + this->f_[eIdxGlobal] -= J; } else { @@ -1927,11 +1927,11 @@ void FvMpfaL2dPressure2p<TypeTag>::assemble() continue; // get the global index of the cell - int globalIdxI = problem_.variables().index(*eIt); + int eIdxGlobalI = problem_.variables().index(*eIt); - this->A_[globalIdxI] = 0.0; - this->A_[globalIdxI][globalIdxI] = 1.0; - this->f_[globalIdxI] = this->pressure()[globalIdxI]; + this->A_[eIdxGlobalI] = 0.0; + this->A_[eIdxGlobalI][eIdxGlobalI] = 1.0; + this->f_[eIdxGlobalI] = this->pressure()[eIdxGlobalI]; } } @@ -1949,9 +1949,9 @@ void FvMpfaL2dPressure2p<TypeTag>::updateMaterialLaws() ElementIterator eEndIt = problem_.gridView().template end<0>(); for (ElementIterator eIt = problem_.gridView().template begin<0>(); eIt != eEndIt; ++eIt) { - int globalIdx = problem_.variables().index(*eIt); + int eIdxGlobal = problem_.variables().index(*eIt); - CellData& cellData = problem_.variables().cellData(globalIdx); + CellData& cellData = problem_.variables().cellData(eIdxGlobal); Scalar satW = cellData.saturation(wPhaseIdx); diff --git a/dumux/decoupled/2p/diffusion/fvmpfa/lmethod/fvmpfal2dpressure2padaptive.hh b/dumux/decoupled/2p/diffusion/fvmpfa/lmethod/fvmpfal2dpressure2padaptive.hh index 215bb171cfc2e759a1ee5d7a03632cd7f955a40d..a8c406a456ec9e15a83eb2b0e0724b87470b37bd 100644 --- a/dumux/decoupled/2p/diffusion/fvmpfa/lmethod/fvmpfal2dpressure2padaptive.hh +++ b/dumux/decoupled/2p/diffusion/fvmpfa/lmethod/fvmpfal2dpressure2padaptive.hh @@ -244,14 +244,14 @@ public: */ void storePressureSolution(const Element& element) { - int globalIdx = problem_.variables().index(element); - CellData& cellData = problem_.variables().cellData(globalIdx); + int eIdxGlobal = problem_.variables().index(element); + CellData& cellData = problem_.variables().cellData(eIdxGlobal); switch (pressureType_) { case pw: { - Scalar potW = this->pressure()[globalIdx]; + Scalar potW = this->pressure()[eIdxGlobal]; Scalar gravityDiff = (problem_.bBoxMax() - element.geometry().center()) * gravity_; Scalar potPc = cellData.capillaryPressure() @@ -269,7 +269,7 @@ public: } case pn: { - Scalar potNw = this->pressure()[globalIdx]; + Scalar potNw = this->pressure()[eIdxGlobal]; Scalar gravityDiff = (problem_.bBoxMax() - element.geometry().center()) * gravity_; Scalar potPc = cellData.capillaryPressure() @@ -555,7 +555,7 @@ void FvMpfaL2dPressure2pAdaptive<TypeTag>::initializeMatrix() for (ElementIterator eIt = eItBegin; eIt != eEndIt; ++eIt) { // cell index - int globalIdxI = problem_.variables().index(*eIt); + int eIdxGlobalI = problem_.variables().index(*eIt); // initialize row size int rowSize = 1; @@ -646,8 +646,8 @@ void FvMpfaL2dPressure2pAdaptive<TypeTag>::initializeMatrix() rowSize = std::min(rowSize, 13); //in 2-D - // set number of indices in row globalIdxI to rowSize - this->A_.setrowsize(globalIdxI, rowSize); + // set number of indices in row eIdxGlobalI to rowSize + this->A_.setrowsize(eIdxGlobalI, rowSize); } // end of 'for' ElementIterator @@ -657,10 +657,10 @@ void FvMpfaL2dPressure2pAdaptive<TypeTag>::initializeMatrix() for (ElementIterator eIt = eItBegin; eIt != eEndIt; ++eIt) { // cell index - int globalIdxI = problem_.variables().index(*eIt); + int eIdxGlobalI = problem_.variables().index(*eIt); // add diagonal index - this->A_.addindex(globalIdxI, globalIdxI); + this->A_.addindex(eIdxGlobalI, eIdxGlobalI); // run through all intersections with neighbors IntersectionIterator isItBegin = problem_.gridView().ibegin(*eIt); @@ -671,11 +671,11 @@ void FvMpfaL2dPressure2pAdaptive<TypeTag>::initializeMatrix() { // access neighbor ElementPointer outside = isIt->outside(); - int globalIdxJ = problem_.variables().index(*outside); + int eIdxGlobalJ = problem_.variables().index(*outside); // add off diagonal index // add index (row,col) to the matrix - this->A_.addindex(globalIdxI, globalIdxJ); + this->A_.addindex(eIdxGlobalI, eIdxGlobalJ); if (eIt->level() < outside->level()) { @@ -736,25 +736,25 @@ void FvMpfaL2dPressure2pAdaptive<TypeTag>::initializeMatrix() if (innerisItoutside == innernextisItoutside && innerisItoutside != eIt && innerisItoutside != nextisItoutside) { - int globalIdxCorner = problem_.variables().index(*innerisItoutside); + int eIdxGlobalCorner = problem_.variables().index(*innerisItoutside); - this->A_.addindex(globalIdxI, globalIdxCorner); + this->A_.addindex(eIdxGlobalI, eIdxGlobalCorner); if (eIt->level() > outside->level()) { - int globalIdxJCorner = problem_.variables().index(*nextisItoutside); + int eIdxGlobalJCorner = problem_.variables().index(*nextisItoutside); - this->A_.addindex(globalIdxJ, globalIdxJCorner); + this->A_.addindex(eIdxGlobalJ, eIdxGlobalJCorner); } if (eIt->level() > nextisItoutside->level()) { - int globalIdxJCorner = problem_.variables().index(*nextisItoutside); + int eIdxGlobalJCorner = problem_.variables().index(*nextisItoutside); - this->A_.addindex(globalIdxJCorner, globalIdxJ); + this->A_.addindex(eIdxGlobalJCorner, eIdxGlobalJ); } if (eIt->level() > innerisItoutside->level()) { - this->A_.addindex(globalIdxCorner, globalIdxI); + this->A_.addindex(eIdxGlobalCorner, eIdxGlobalI); } } } @@ -802,7 +802,7 @@ void FvMpfaL2dPressure2pAdaptive<TypeTag>::storeInteractionVolumeInfo() for (ElementIterator eIt = problem_.gridView().template begin<0>(); eIt != eEndIt; ++eIt) { // get index - int globalIdx1 = problem_.variables().index(*eIt); + int eIdxGlobal1 = problem_.variables().index(*eIt); const ReferenceElement& referenceElement = ReferenceElements::general(eIt->geometry().type()); @@ -816,7 +816,7 @@ void FvMpfaL2dPressure2pAdaptive<TypeTag>::storeInteractionVolumeInfo() { // access neighbor cell 2 of 'isIt12' ElementPointer elementPointer2 = isIt12->outside(); - int globalIdx2 = problem_.variables().index(*elementPointer2); + int eIdxGlobal2 = problem_.variables().index(*elementPointer2); if (eIt->level() < elementPointer2->level()) { @@ -1348,16 +1348,16 @@ void FvMpfaL2dPressure2pAdaptive<TypeTag>::storeInteractionVolumeInfo() if (eIt->level() == elementPointer2->level()) { - innerBoundaryVolumeFaces_[globalIdx1][isIt12->indexInInside()] = true; - innerBoundaryVolumeFaces_[globalIdx2][isIt12->indexInOutside()] = true; + innerBoundaryVolumeFaces_[eIdxGlobal1][isIt12->indexInInside()] = true; + innerBoundaryVolumeFaces_[eIdxGlobal2][isIt12->indexInOutside()] = true; } else if (eIt->level() < elementPointer2->level()) { - innerBoundaryVolumeFaces_[globalIdx2][isIt12->indexInOutside()] = true; + innerBoundaryVolumeFaces_[eIdxGlobal2][isIt12->indexInOutside()] = true; } else if (eIt->level() > elementPointer2->level()) { - innerBoundaryVolumeFaces_[globalIdx1][isIt12->indexInInside()] = true; + innerBoundaryVolumeFaces_[eIdxGlobal1][isIt12->indexInInside()] = true; } finished = true; @@ -1537,9 +1537,9 @@ void FvMpfaL2dPressure2pAdaptive<TypeTag>::storeInteractionVolumeInfo() // neighbor cell 3 // access neighbor cell 3 ElementPointer elementPointer4 = isIt14->outside(); - int globalIdx4 = problem_.variables().index(*elementPointer4); + int eIdxGlobal4 = problem_.variables().index(*elementPointer4); - if ((eIt->level() == elementPointer4->level() && globalIdx1 > globalIdx4) + if ((eIt->level() == elementPointer4->level() && eIdxGlobal1 > eIdxGlobal4) || eIt->level() < elementPointer4->level()) { interactionVolumes_[globalVertIdx1234].reset(); @@ -1606,16 +1606,16 @@ void FvMpfaL2dPressure2pAdaptive<TypeTag>::storeInteractionVolumeInfo() if (eIt->level() == elementPointer4->level()) { - innerBoundaryVolumeFaces_[globalIdx1][isIt14->indexInInside()] = true; - innerBoundaryVolumeFaces_[globalIdx4][isIt14->indexInOutside()] = true; + innerBoundaryVolumeFaces_[eIdxGlobal1][isIt14->indexInInside()] = true; + innerBoundaryVolumeFaces_[eIdxGlobal4][isIt14->indexInOutside()] = true; } if (eIt->level() < elementPointer4->level()) { - innerBoundaryVolumeFaces_[globalIdx4][isIt14->indexInOutside()] = true; + innerBoundaryVolumeFaces_[eIdxGlobal4][isIt14->indexInOutside()] = true; } if (eIt->level() > elementPointer4->level()) { - innerBoundaryVolumeFaces_[globalIdx1][isIt14->indexInInside()] = true; + innerBoundaryVolumeFaces_[eIdxGlobal1][isIt14->indexInInside()] = true; } @@ -1669,13 +1669,13 @@ void FvMpfaL2dPressure2pAdaptive<TypeTag>::printInteractionVolumes() ElementPointer& elementPointer2 = interactionVolume.getSubVolumeElement(1); ElementPointer& elementPointer4 = interactionVolume.getSubVolumeElement(3); - int globalIdx1 = problem_.variables().index(*elementPointer1); - int globalIdx2 = problem_.variables().index(*elementPointer2); - int globalIdx4 = problem_.variables().index(*elementPointer4); + int eIdxGlobal1 = problem_.variables().index(*elementPointer1); + int eIdxGlobal2 = problem_.variables().index(*elementPointer2); + int eIdxGlobal4 = problem_.variables().index(*elementPointer4); - std::cout << "global element index 1: " << globalIdx1 << "\n"; - std::cout << "global element index 2: " << globalIdx2 << "\n"; - std::cout << "global element index 4: " << globalIdx4 << "\n"; + std::cout << "global element index 1: " << eIdxGlobal1 << "\n"; + std::cout << "global element index 2: " << eIdxGlobal2 << "\n"; + std::cout << "global element index 4: " << eIdxGlobal4 << "\n"; } if (interactionVolume.getElementNumber() == 4) { @@ -1684,15 +1684,15 @@ void FvMpfaL2dPressure2pAdaptive<TypeTag>::printInteractionVolumes() ElementPointer& elementPointer3 = interactionVolume.getSubVolumeElement(2); ElementPointer& elementPointer4 = interactionVolume.getSubVolumeElement(3); - int globalIdx1 = problem_.variables().index(*elementPointer1); - int globalIdx2 = problem_.variables().index(*elementPointer2); - int globalIdx3 = problem_.variables().index(*elementPointer3); - int globalIdx4 = problem_.variables().index(*elementPointer4); + int eIdxGlobal1 = problem_.variables().index(*elementPointer1); + int eIdxGlobal2 = problem_.variables().index(*elementPointer2); + int eIdxGlobal3 = problem_.variables().index(*elementPointer3); + int eIdxGlobal4 = problem_.variables().index(*elementPointer4); - std::cout << "global element index 1: " << globalIdx1 << "\n"; - std::cout << "global element index 2: " << globalIdx2 << "\n"; - std::cout << "global element index 3: " << globalIdx3 << "\n"; - std::cout << "global element index 4: " << globalIdx4 << "\n"; + std::cout << "global element index 1: " << eIdxGlobal1 << "\n"; + std::cout << "global element index 2: " << eIdxGlobal2 << "\n"; + std::cout << "global element index 3: " << eIdxGlobal3 << "\n"; + std::cout << "global element index 4: " << eIdxGlobal4 << "\n"; } } } @@ -1736,32 +1736,32 @@ void FvMpfaL2dPressure2pAdaptive<TypeTag>::assemble() Scalar volume4 = elementPointer4->geometry().volume(); // cell index - int globalIdx1 = problem_.variables().index(*elementPointer1); - int globalIdx2 = problem_.variables().index(*elementPointer2); - int globalIdx3 = problem_.variables().index(*elementPointer3); - int globalIdx4 = problem_.variables().index(*elementPointer4); + int eIdxGlobal1 = problem_.variables().index(*elementPointer1); + int eIdxGlobal2 = problem_.variables().index(*elementPointer2); + int eIdxGlobal3 = problem_.variables().index(*elementPointer3); + int eIdxGlobal4 = problem_.variables().index(*elementPointer4); //get the cell Data - CellData& cellData1 = problem_.variables().cellData(globalIdx1); - CellData& cellData2 = problem_.variables().cellData(globalIdx2); - CellData& cellData3 = problem_.variables().cellData(globalIdx3); - CellData& cellData4 = problem_.variables().cellData(globalIdx4); + CellData& cellData1 = problem_.variables().cellData(eIdxGlobal1); + CellData& cellData2 = problem_.variables().cellData(eIdxGlobal2); + CellData& cellData3 = problem_.variables().cellData(eIdxGlobal3); + CellData& cellData4 = problem_.variables().cellData(eIdxGlobal4); // evaluate right hand side PrimaryVariables source(0.0); problem_.source(source, *elementPointer1); - this->f_[globalIdx1] += volume1 / (4.0) * (source[wPhaseIdx] / density_[wPhaseIdx] + source[nPhaseIdx] / density_[nPhaseIdx]); + this->f_[eIdxGlobal1] += volume1 / (4.0) * (source[wPhaseIdx] / density_[wPhaseIdx] + source[nPhaseIdx] / density_[nPhaseIdx]); problem_.source(source, *elementPointer2); - this->f_[globalIdx2] += volume2 / (4.0) * (source[wPhaseIdx] / density_[wPhaseIdx] + source[nPhaseIdx] / density_[nPhaseIdx]); + this->f_[eIdxGlobal2] += volume2 / (4.0) * (source[wPhaseIdx] / density_[wPhaseIdx] + source[nPhaseIdx] / density_[nPhaseIdx]); problem_.source(source, *elementPointer3); - this->f_[globalIdx3] += volume3 / (4.0) * (source[wPhaseIdx] / density_[wPhaseIdx] + source[nPhaseIdx] / density_[nPhaseIdx]); + this->f_[eIdxGlobal3] += volume3 / (4.0) * (source[wPhaseIdx] / density_[wPhaseIdx] + source[nPhaseIdx] / density_[nPhaseIdx]); problem_.source(source, *elementPointer4); - this->f_[globalIdx4] += volume4 / (4.0) * (source[wPhaseIdx] / density_[wPhaseIdx] + source[nPhaseIdx] / density_[nPhaseIdx]); + this->f_[eIdxGlobal4] += volume4 / (4.0) * (source[wPhaseIdx] / density_[wPhaseIdx] + source[nPhaseIdx] / density_[nPhaseIdx]); - this->f_[globalIdx1] += evaluateErrorTerm_(cellData1) * volume1 / (4.0); - this->f_[globalIdx2] += evaluateErrorTerm_(cellData2) * volume2 / (4.0); - this->f_[globalIdx3] += evaluateErrorTerm_(cellData3) * volume3 / (4.0); - this->f_[globalIdx4] += evaluateErrorTerm_(cellData4) * volume4 / (4.0); + this->f_[eIdxGlobal1] += evaluateErrorTerm_(cellData1) * volume1 / (4.0); + this->f_[eIdxGlobal2] += evaluateErrorTerm_(cellData2) * volume2 / (4.0); + this->f_[eIdxGlobal3] += evaluateErrorTerm_(cellData3) * volume3 / (4.0); + this->f_[eIdxGlobal4] += evaluateErrorTerm_(cellData4) * volume4 / (4.0); //get mobilities of the phases Dune::FieldVector<Scalar, numPhases> lambda1(cellData1.mobility(wPhaseIdx)); @@ -1834,17 +1834,17 @@ void FvMpfaL2dPressure2pAdaptive<TypeTag>::assemble() if (transmissibilityType == TransmissibilityCalculator::rightTriangle) { - if (innerBoundaryVolumeFaces_[globalIdx1][interactionVolume.getIndexOnElement(0, 0)]) + if (innerBoundaryVolumeFaces_[eIdxGlobal1][interactionVolume.getIndexOnElement(0, 0)]) { T *= 2; } - this->A_[globalIdx1][globalIdx2] += T[1][0]; - this->A_[globalIdx1][globalIdx3] += T[1][1]; - this->A_[globalIdx1][globalIdx1] += T[1][2]; + this->A_[eIdxGlobal1][eIdxGlobal2] += T[1][0]; + this->A_[eIdxGlobal1][eIdxGlobal3] += T[1][1]; + this->A_[eIdxGlobal1][eIdxGlobal1] += T[1][2]; - this->A_[globalIdx2][globalIdx2] -= T[1][0]; - this->A_[globalIdx2][globalIdx3] -= T[1][1]; - this->A_[globalIdx2][globalIdx1] -= T[1][2]; + this->A_[eIdxGlobal2][eIdxGlobal2] -= T[1][0]; + this->A_[eIdxGlobal2][eIdxGlobal3] -= T[1][1]; + this->A_[eIdxGlobal2][eIdxGlobal1] -= T[1][2]; u[0] = pc[1]; u[1] = pc[2]; @@ -1857,17 +1857,17 @@ void FvMpfaL2dPressure2pAdaptive<TypeTag>::assemble() } else if (transmissibilityType == TransmissibilityCalculator::leftTriangle) { - if (innerBoundaryVolumeFaces_[globalIdx1][interactionVolume.getIndexOnElement(0, 0)]) + if (innerBoundaryVolumeFaces_[eIdxGlobal1][interactionVolume.getIndexOnElement(0, 0)]) { T *= 2; } - this->A_[globalIdx1][globalIdx1] += T[1][0]; - this->A_[globalIdx1][globalIdx4] += T[1][1]; - this->A_[globalIdx1][globalIdx2] += T[1][2]; + this->A_[eIdxGlobal1][eIdxGlobal1] += T[1][0]; + this->A_[eIdxGlobal1][eIdxGlobal4] += T[1][1]; + this->A_[eIdxGlobal1][eIdxGlobal2] += T[1][2]; - this->A_[globalIdx2][globalIdx1] -= T[1][0]; - this->A_[globalIdx2][globalIdx4] -= T[1][1]; - this->A_[globalIdx2][globalIdx2] -= T[1][2]; + this->A_[eIdxGlobal2][eIdxGlobal1] -= T[1][0]; + this->A_[eIdxGlobal2][eIdxGlobal4] -= T[1][1]; + this->A_[eIdxGlobal2][eIdxGlobal2] -= T[1][2]; u[0] = pc[0]; u[1] = pc[3]; @@ -1883,17 +1883,17 @@ void FvMpfaL2dPressure2pAdaptive<TypeTag>::assemble() if (transmissibilityType == TransmissibilityCalculator::rightTriangle) { - if (innerBoundaryVolumeFaces_[globalIdx2][interactionVolume.getIndexOnElement(1, 0)]) + if (innerBoundaryVolumeFaces_[eIdxGlobal2][interactionVolume.getIndexOnElement(1, 0)]) { T *= 2; } - this->A_[globalIdx2][globalIdx3] += T[1][0]; - this->A_[globalIdx2][globalIdx4] += T[1][1]; - this->A_[globalIdx2][globalIdx2] += T[1][2]; + this->A_[eIdxGlobal2][eIdxGlobal3] += T[1][0]; + this->A_[eIdxGlobal2][eIdxGlobal4] += T[1][1]; + this->A_[eIdxGlobal2][eIdxGlobal2] += T[1][2]; - this->A_[globalIdx3][globalIdx3] -= T[1][0]; - this->A_[globalIdx3][globalIdx4] -= T[1][1]; - this->A_[globalIdx3][globalIdx2] -= T[1][2]; + this->A_[eIdxGlobal3][eIdxGlobal3] -= T[1][0]; + this->A_[eIdxGlobal3][eIdxGlobal4] -= T[1][1]; + this->A_[eIdxGlobal3][eIdxGlobal2] -= T[1][2]; u[0] = pc[2]; u[1] = pc[3]; @@ -1906,17 +1906,17 @@ void FvMpfaL2dPressure2pAdaptive<TypeTag>::assemble() } else if (transmissibilityType == TransmissibilityCalculator::leftTriangle) { - if (innerBoundaryVolumeFaces_[globalIdx2][interactionVolume.getIndexOnElement(1, 0)]) + if (innerBoundaryVolumeFaces_[eIdxGlobal2][interactionVolume.getIndexOnElement(1, 0)]) { T *= 2; } - this->A_[globalIdx2][globalIdx2] += T[1][0]; - this->A_[globalIdx2][globalIdx1] += T[1][1]; - this->A_[globalIdx2][globalIdx3] += T[1][2]; + this->A_[eIdxGlobal2][eIdxGlobal2] += T[1][0]; + this->A_[eIdxGlobal2][eIdxGlobal1] += T[1][1]; + this->A_[eIdxGlobal2][eIdxGlobal3] += T[1][2]; - this->A_[globalIdx3][globalIdx2] -= T[1][0]; - this->A_[globalIdx3][globalIdx1] -= T[1][1]; - this->A_[globalIdx3][globalIdx3] -= T[1][2]; + this->A_[eIdxGlobal3][eIdxGlobal2] -= T[1][0]; + this->A_[eIdxGlobal3][eIdxGlobal1] -= T[1][1]; + this->A_[eIdxGlobal3][eIdxGlobal3] -= T[1][2]; u[0] = pc[1]; u[1] = pc[0]; @@ -1932,17 +1932,17 @@ void FvMpfaL2dPressure2pAdaptive<TypeTag>::assemble() if (transmissibilityType == TransmissibilityCalculator::rightTriangle) { - if (innerBoundaryVolumeFaces_[globalIdx3][interactionVolume.getIndexOnElement(2, 0)]) + if (innerBoundaryVolumeFaces_[eIdxGlobal3][interactionVolume.getIndexOnElement(2, 0)]) { T *= 2; } - this->A_[globalIdx3][globalIdx4] += T[1][0]; - this->A_[globalIdx3][globalIdx1] += T[1][1]; - this->A_[globalIdx3][globalIdx3] += T[1][2]; + this->A_[eIdxGlobal3][eIdxGlobal4] += T[1][0]; + this->A_[eIdxGlobal3][eIdxGlobal1] += T[1][1]; + this->A_[eIdxGlobal3][eIdxGlobal3] += T[1][2]; - this->A_[globalIdx4][globalIdx4] -= T[1][0]; - this->A_[globalIdx4][globalIdx1] -= T[1][1]; - this->A_[globalIdx4][globalIdx3] -= T[1][2]; + this->A_[eIdxGlobal4][eIdxGlobal4] -= T[1][0]; + this->A_[eIdxGlobal4][eIdxGlobal1] -= T[1][1]; + this->A_[eIdxGlobal4][eIdxGlobal3] -= T[1][2]; u[0] = pc[3]; u[1] = pc[0]; @@ -1955,17 +1955,17 @@ void FvMpfaL2dPressure2pAdaptive<TypeTag>::assemble() } else if (transmissibilityType == TransmissibilityCalculator::leftTriangle) { - if (innerBoundaryVolumeFaces_[globalIdx3][interactionVolume.getIndexOnElement(2, 0)]) + if (innerBoundaryVolumeFaces_[eIdxGlobal3][interactionVolume.getIndexOnElement(2, 0)]) { T *= 2; } - this->A_[globalIdx3][globalIdx3] += T[1][0]; - this->A_[globalIdx3][globalIdx2] += T[1][1]; - this->A_[globalIdx3][globalIdx4] += T[1][2]; + this->A_[eIdxGlobal3][eIdxGlobal3] += T[1][0]; + this->A_[eIdxGlobal3][eIdxGlobal2] += T[1][1]; + this->A_[eIdxGlobal3][eIdxGlobal4] += T[1][2]; - this->A_[globalIdx4][globalIdx3] -= T[1][0]; - this->A_[globalIdx4][globalIdx2] -= T[1][1]; - this->A_[globalIdx4][globalIdx4] -= T[1][2]; + this->A_[eIdxGlobal4][eIdxGlobal3] -= T[1][0]; + this->A_[eIdxGlobal4][eIdxGlobal2] -= T[1][1]; + this->A_[eIdxGlobal4][eIdxGlobal4] -= T[1][2]; u[0] = pc[2]; u[1] = pc[1]; @@ -1981,17 +1981,17 @@ void FvMpfaL2dPressure2pAdaptive<TypeTag>::assemble() if (transmissibilityType == TransmissibilityCalculator::rightTriangle) { - if (innerBoundaryVolumeFaces_[globalIdx4][interactionVolume.getIndexOnElement(3, 0)]) + if (innerBoundaryVolumeFaces_[eIdxGlobal4][interactionVolume.getIndexOnElement(3, 0)]) { T *= 2; } - this->A_[globalIdx4][globalIdx1] += T[1][0]; - this->A_[globalIdx4][globalIdx2] += T[1][1]; - this->A_[globalIdx4][globalIdx4] += T[1][2]; + this->A_[eIdxGlobal4][eIdxGlobal1] += T[1][0]; + this->A_[eIdxGlobal4][eIdxGlobal2] += T[1][1]; + this->A_[eIdxGlobal4][eIdxGlobal4] += T[1][2]; - this->A_[globalIdx1][globalIdx1] -= T[1][0]; - this->A_[globalIdx1][globalIdx2] -= T[1][1]; - this->A_[globalIdx1][globalIdx4] -= T[1][2]; + this->A_[eIdxGlobal1][eIdxGlobal1] -= T[1][0]; + this->A_[eIdxGlobal1][eIdxGlobal2] -= T[1][1]; + this->A_[eIdxGlobal1][eIdxGlobal4] -= T[1][2]; u[0] = pc[0]; u[1] = pc[1]; @@ -2004,17 +2004,17 @@ void FvMpfaL2dPressure2pAdaptive<TypeTag>::assemble() } else if (transmissibilityType == TransmissibilityCalculator::leftTriangle) { - if (innerBoundaryVolumeFaces_[globalIdx4][interactionVolume.getIndexOnElement(3, 0)]) + if (innerBoundaryVolumeFaces_[eIdxGlobal4][interactionVolume.getIndexOnElement(3, 0)]) { T *= 2; } - this->A_[globalIdx4][globalIdx4] += T[1][0]; - this->A_[globalIdx4][globalIdx3] += T[1][1]; - this->A_[globalIdx4][globalIdx1] += T[1][2]; + this->A_[eIdxGlobal4][eIdxGlobal4] += T[1][0]; + this->A_[eIdxGlobal4][eIdxGlobal3] += T[1][1]; + this->A_[eIdxGlobal4][eIdxGlobal1] += T[1][2]; - this->A_[globalIdx1][globalIdx4] -= T[1][0]; - this->A_[globalIdx1][globalIdx3] -= T[1][1]; - this->A_[globalIdx1][globalIdx1] -= T[1][2]; + this->A_[eIdxGlobal1][eIdxGlobal4] -= T[1][0]; + this->A_[eIdxGlobal1][eIdxGlobal3] -= T[1][1]; + this->A_[eIdxGlobal1][eIdxGlobal1] -= T[1][2]; u[0] = pc[3]; u[1] = pc[2]; @@ -2076,10 +2076,10 @@ void FvMpfaL2dPressure2pAdaptive<TypeTag>::assemble() if (i == nPhaseIdx) { //add capillary pressure term to right hand side - this->f_[globalIdx1] -= (pcFluxReal[0] - pcFluxReal[3]); - this->f_[globalIdx2] -= (pcFluxReal[1] - pcFluxReal[0]); - this->f_[globalIdx3] -= (pcFluxReal[2] - pcFluxReal[1]); - this->f_[globalIdx4] -= (pcFluxReal[3] - pcFluxReal[2]); + this->f_[eIdxGlobal1] -= (pcFluxReal[0] - pcFluxReal[3]); + this->f_[eIdxGlobal2] -= (pcFluxReal[1] - pcFluxReal[0]); + this->f_[eIdxGlobal3] -= (pcFluxReal[2] - pcFluxReal[1]); + this->f_[eIdxGlobal4] -= (pcFluxReal[3] - pcFluxReal[2]); } break; @@ -2089,10 +2089,10 @@ void FvMpfaL2dPressure2pAdaptive<TypeTag>::assemble() if (i == wPhaseIdx) { //add capillary pressure term to right hand side - this->f_[globalIdx1] += (pcFluxReal[0] - pcFluxReal[3]); - this->f_[globalIdx2] += (pcFluxReal[1] - pcFluxReal[0]); - this->f_[globalIdx3] += (pcFluxReal[2] - pcFluxReal[1]); - this->f_[globalIdx4] += (pcFluxReal[3] - pcFluxReal[2]); + this->f_[eIdxGlobal1] += (pcFluxReal[0] - pcFluxReal[3]); + this->f_[eIdxGlobal2] += (pcFluxReal[1] - pcFluxReal[0]); + this->f_[eIdxGlobal3] += (pcFluxReal[2] - pcFluxReal[1]); + this->f_[eIdxGlobal4] += (pcFluxReal[3] - pcFluxReal[2]); } break; } @@ -2115,25 +2115,25 @@ void FvMpfaL2dPressure2pAdaptive<TypeTag>::assemble() Scalar volume2 = elementPointer2->geometry().volume(); // cell index - int globalIdx1 = problem_.variables().index(*elementPointer1); - int globalIdx2 = problem_.variables().index(*elementPointer2); - int globalIdx4 = problem_.variables().index(*elementPointer4); + int eIdxGlobal1 = problem_.variables().index(*elementPointer1); + int eIdxGlobal2 = problem_.variables().index(*elementPointer2); + int eIdxGlobal4 = problem_.variables().index(*elementPointer4); //get the cell Data - CellData& cellData1 = problem_.variables().cellData(globalIdx1); - CellData& cellData2 = problem_.variables().cellData(globalIdx2); - CellData& cellData4 = problem_.variables().cellData(globalIdx4); + CellData& cellData1 = problem_.variables().cellData(eIdxGlobal1); + CellData& cellData2 = problem_.variables().cellData(eIdxGlobal2); + CellData& cellData4 = problem_.variables().cellData(eIdxGlobal4); // evaluate right hand side -> only add source for the cells without hanging node! // In doing so every cell gets the source from 4 vertices and the division by 4 is correct! PrimaryVariables source(0.0); problem_.source(source, *elementPointer1); - this->f_[globalIdx1] += volume1 / (4.0) * (source[wPhaseIdx] / density_[wPhaseIdx] + source[nPhaseIdx] / density_[nPhaseIdx]); + this->f_[eIdxGlobal1] += volume1 / (4.0) * (source[wPhaseIdx] / density_[wPhaseIdx] + source[nPhaseIdx] / density_[nPhaseIdx]); problem_.source(source, *elementPointer2); - this->f_[globalIdx2] += volume2 / (4.0) * (source[wPhaseIdx] / density_[wPhaseIdx] + source[nPhaseIdx] / density_[nPhaseIdx]); + this->f_[eIdxGlobal2] += volume2 / (4.0) * (source[wPhaseIdx] / density_[wPhaseIdx] + source[nPhaseIdx] / density_[nPhaseIdx]); - this->f_[globalIdx1] += evaluateErrorTerm_(cellData1) * volume1 / (4.0); - this->f_[globalIdx2] += evaluateErrorTerm_(cellData2) * volume2 / (4.0); + this->f_[eIdxGlobal1] += evaluateErrorTerm_(cellData1) * volume1 / (4.0); + this->f_[eIdxGlobal2] += evaluateErrorTerm_(cellData2) * volume2 / (4.0); //get mobilities of the phases Dune::FieldVector<Scalar, numPhases> lambda1(cellData1.mobility(wPhaseIdx)); @@ -2194,17 +2194,17 @@ void FvMpfaL2dPressure2pAdaptive<TypeTag>::assemble() if (transmissibilityType == TransmissibilityCalculator::rightTriangle) { - if (innerBoundaryVolumeFaces_[globalIdx1][interactionVolume.getIndexOnElement(0, 0)]) + if (innerBoundaryVolumeFaces_[eIdxGlobal1][interactionVolume.getIndexOnElement(0, 0)]) { T *= 2; } - this->A_[globalIdx1][globalIdx2] += T[1][0]; - this->A_[globalIdx1][globalIdx4] += T[1][1]; - this->A_[globalIdx1][globalIdx1] += T[1][2]; + this->A_[eIdxGlobal1][eIdxGlobal2] += T[1][0]; + this->A_[eIdxGlobal1][eIdxGlobal4] += T[1][1]; + this->A_[eIdxGlobal1][eIdxGlobal1] += T[1][2]; - this->A_[globalIdx2][globalIdx2] -= T[1][0]; - this->A_[globalIdx2][globalIdx4] -= T[1][1]; - this->A_[globalIdx2][globalIdx1] -= T[1][2]; + this->A_[eIdxGlobal2][eIdxGlobal2] -= T[1][0]; + this->A_[eIdxGlobal2][eIdxGlobal4] -= T[1][1]; + this->A_[eIdxGlobal2][eIdxGlobal1] -= T[1][2]; u[0] = pc[1]; u[1] = pc[2]; @@ -2217,17 +2217,17 @@ void FvMpfaL2dPressure2pAdaptive<TypeTag>::assemble() } else if (transmissibilityType == TransmissibilityCalculator::leftTriangle) { - if (innerBoundaryVolumeFaces_[globalIdx1][interactionVolume.getIndexOnElement(0, 0)]) + if (innerBoundaryVolumeFaces_[eIdxGlobal1][interactionVolume.getIndexOnElement(0, 0)]) { T *= 2; } - this->A_[globalIdx1][globalIdx1] += T[1][0]; - this->A_[globalIdx1][globalIdx4] += T[1][1]; - this->A_[globalIdx1][globalIdx2] += T[1][2]; + this->A_[eIdxGlobal1][eIdxGlobal1] += T[1][0]; + this->A_[eIdxGlobal1][eIdxGlobal4] += T[1][1]; + this->A_[eIdxGlobal1][eIdxGlobal2] += T[1][2]; - this->A_[globalIdx2][globalIdx1] -= T[1][0]; - this->A_[globalIdx2][globalIdx4] -= T[1][1]; - this->A_[globalIdx2][globalIdx2] -= T[1][2]; + this->A_[eIdxGlobal2][eIdxGlobal1] -= T[1][0]; + this->A_[eIdxGlobal2][eIdxGlobal4] -= T[1][1]; + this->A_[eIdxGlobal2][eIdxGlobal2] -= T[1][2]; u[0] = pc[0]; u[1] = pc[2]; @@ -2247,17 +2247,17 @@ void FvMpfaL2dPressure2pAdaptive<TypeTag>::assemble() if (transmissibilityType == TransmissibilityCalculator::leftTriangle) { - if (innerBoundaryVolumeFaces_[globalIdx2][interactionVolume.getIndexOnElement(1, 0)]) + if (innerBoundaryVolumeFaces_[eIdxGlobal2][interactionVolume.getIndexOnElement(1, 0)]) { T *= 2; } - this->A_[globalIdx2][globalIdx2] += T[1][0]; - this->A_[globalIdx2][globalIdx1] += T[1][1]; - this->A_[globalIdx2][globalIdx4] += T[1][2]; + this->A_[eIdxGlobal2][eIdxGlobal2] += T[1][0]; + this->A_[eIdxGlobal2][eIdxGlobal1] += T[1][1]; + this->A_[eIdxGlobal2][eIdxGlobal4] += T[1][2]; - this->A_[globalIdx4][globalIdx2] -= T[1][0]; - this->A_[globalIdx4][globalIdx1] -= T[1][1]; - this->A_[globalIdx4][globalIdx4] -= T[1][2]; + this->A_[eIdxGlobal4][eIdxGlobal2] -= T[1][0]; + this->A_[eIdxGlobal4][eIdxGlobal1] -= T[1][1]; + this->A_[eIdxGlobal4][eIdxGlobal4] -= T[1][2]; u[0] = pc[1]; u[1] = pc[0]; @@ -2277,18 +2277,18 @@ void FvMpfaL2dPressure2pAdaptive<TypeTag>::assemble() if (transmissibilityType == TransmissibilityCalculator::rightTriangle) { - if (innerBoundaryVolumeFaces_[globalIdx1][interactionVolume.getIndexOnElement(0, 1)]) + if (innerBoundaryVolumeFaces_[eIdxGlobal1][interactionVolume.getIndexOnElement(0, 1)]) { T *= 2; } - this->A_[globalIdx4][globalIdx1] += T[1][0]; - this->A_[globalIdx4][globalIdx2] += T[1][1]; - this->A_[globalIdx4][globalIdx4] += T[1][2]; + this->A_[eIdxGlobal4][eIdxGlobal1] += T[1][0]; + this->A_[eIdxGlobal4][eIdxGlobal2] += T[1][1]; + this->A_[eIdxGlobal4][eIdxGlobal4] += T[1][2]; - this->A_[globalIdx1][globalIdx1] -= T[1][0]; - this->A_[globalIdx1][globalIdx2] -= T[1][1]; - this->A_[globalIdx1][globalIdx4] -= T[1][2]; + this->A_[eIdxGlobal1][eIdxGlobal1] -= T[1][0]; + this->A_[eIdxGlobal1][eIdxGlobal2] -= T[1][1]; + this->A_[eIdxGlobal1][eIdxGlobal4] -= T[1][2]; u[0] = pc[0]; u[1] = pc[1]; @@ -2346,9 +2346,9 @@ void FvMpfaL2dPressure2pAdaptive<TypeTag>::assemble() if (i == nPhaseIdx) { //add capillary pressure term to right hand side - this->f_[globalIdx1] -= (pcFluxReal[0] - pcFluxReal[2]); - this->f_[globalIdx2] -= (pcFluxReal[1] - pcFluxReal[0]); - this->f_[globalIdx4] -= (pcFluxReal[2] - pcFluxReal[1]); + this->f_[eIdxGlobal1] -= (pcFluxReal[0] - pcFluxReal[2]); + this->f_[eIdxGlobal2] -= (pcFluxReal[1] - pcFluxReal[0]); + this->f_[eIdxGlobal4] -= (pcFluxReal[2] - pcFluxReal[1]); } break; @@ -2358,9 +2358,9 @@ void FvMpfaL2dPressure2pAdaptive<TypeTag>::assemble() if (i == wPhaseIdx) { //add capillary pressure term to right hand side - this->f_[globalIdx1] += (pcFluxReal[0] - pcFluxReal[2]); - this->f_[globalIdx2] += (pcFluxReal[1] - pcFluxReal[0]); - this->f_[globalIdx4] += (pcFluxReal[2] - pcFluxReal[1]); + this->f_[eIdxGlobal1] += (pcFluxReal[0] - pcFluxReal[2]); + this->f_[eIdxGlobal2] += (pcFluxReal[1] - pcFluxReal[0]); + this->f_[eIdxGlobal4] += (pcFluxReal[2] - pcFluxReal[1]); } break; } @@ -2402,10 +2402,10 @@ void FvMpfaL2dPressure2pAdaptive<TypeTag>::assemble() Scalar volume = elementPointer->geometry().volume(); // cell index - int globalIdx = problem_.variables().index(*elementPointer); + int eIdxGlobal = problem_.variables().index(*elementPointer); //get the cell Data - CellData& cellData = problem_.variables().cellData(globalIdx); + CellData& cellData = problem_.variables().cellData(eIdxGlobal); //permeability vector at boundary DimMatrix permeability(problem_.spatialParams().intrinsicPermeability(*elementPointer)); @@ -2413,9 +2413,9 @@ void FvMpfaL2dPressure2pAdaptive<TypeTag>::assemble() // evaluate right hand side PrimaryVariables source(0); problem_.source(source, *elementPointer); - this->f_[globalIdx] += volume / (4.0) * (source[wPhaseIdx] / density_[wPhaseIdx] + source[nPhaseIdx] / density_[nPhaseIdx]); + this->f_[eIdxGlobal] += volume / (4.0) * (source[wPhaseIdx] / density_[wPhaseIdx] + source[nPhaseIdx] / density_[nPhaseIdx]); - this->f_[globalIdx] += evaluateErrorTerm_(cellData) * volume / (4.0); + this->f_[eIdxGlobal] += evaluateErrorTerm_(cellData) * volume / (4.0); //get mobilities of the phases Dune::FieldVector<Scalar, numPhases> lambda(cellData.mobility(wPhaseIdx)); @@ -2556,8 +2556,8 @@ void FvMpfaL2dPressure2pAdaptive<TypeTag>::assemble() } // set diagonal entry and right hand side entry - this->A_[globalIdx][globalIdx] += entry; - this->f_[globalIdx] += entry * potentialBound; + this->A_[eIdxGlobal][eIdxGlobal] += entry; + this->f_[eIdxGlobal] += entry * potentialBound; if (pc == 0 && pcBound == 0) { @@ -2573,7 +2573,7 @@ void FvMpfaL2dPressure2pAdaptive<TypeTag>::assemble() if (i == nPhaseIdx) { //add capillary pressure term to right hand side - this->f_[globalIdx] -= pcFlux; + this->f_[eIdxGlobal] -= pcFlux; } break; } @@ -2582,7 +2582,7 @@ void FvMpfaL2dPressure2pAdaptive<TypeTag>::assemble() if (i == wPhaseIdx) { //add capillary pressure term to right hand side - this->f_[globalIdx] += pcFlux; + this->f_[eIdxGlobal] += pcFlux; } break; } @@ -2595,7 +2595,7 @@ void FvMpfaL2dPressure2pAdaptive<TypeTag>::assemble() Scalar J = interactionVolume.getNeumannValues(intVolFaceIdx)[wPhaseIdx] / density_[wPhaseIdx]; J += interactionVolume.getNeumannValues(intVolFaceIdx)[nPhaseIdx] / density_[nPhaseIdx]; - this->f_[globalIdx] -= J; + this->f_[eIdxGlobal] -= J; } else { @@ -2622,11 +2622,11 @@ void FvMpfaL2dPressure2pAdaptive<TypeTag>::assemble() continue; // get the global index of the cell - int globalIdxI = problem_.variables().index(*eIt); + int eIdxGlobalI = problem_.variables().index(*eIt); - this->A_[globalIdxI] = 0.0; - this->A_[globalIdxI][globalIdxI] = 1.0; - this->f_[globalIdxI] = this->pressure()[globalIdxI]; + this->A_[eIdxGlobalI] = 0.0; + this->A_[eIdxGlobalI][eIdxGlobalI] = 1.0; + this->f_[eIdxGlobalI] = this->pressure()[eIdxGlobalI]; } } @@ -2644,9 +2644,9 @@ void FvMpfaL2dPressure2pAdaptive<TypeTag>::updateMaterialLaws() ElementIterator eEndIt = problem_.gridView().template end<0>(); for (ElementIterator eIt = problem_.gridView().template begin<0>(); eIt != eEndIt; ++eIt) { - int globalIdx = problem_.variables().index(*eIt); + int eIdxGlobal = problem_.variables().index(*eIt); - CellData& cellData = problem_.variables().cellData(globalIdx); + CellData& cellData = problem_.variables().cellData(eIdxGlobal); Scalar satW = cellData.saturation(wPhaseIdx); diff --git a/dumux/decoupled/2p/diffusion/fvmpfa/lmethod/fvmpfal2dpressurevelocity2p.hh b/dumux/decoupled/2p/diffusion/fvmpfa/lmethod/fvmpfal2dpressurevelocity2p.hh index 11df7ec82bef0eddf858ab6b374f3c9326c7e1ac..c89587200c9a7c76ea3aafd090f3f80f693c0442 100644 --- a/dumux/decoupled/2p/diffusion/fvmpfa/lmethod/fvmpfal2dpressurevelocity2p.hh +++ b/dumux/decoupled/2p/diffusion/fvmpfa/lmethod/fvmpfal2dpressurevelocity2p.hh @@ -235,16 +235,16 @@ void FvMpfaL2dPressureVelocity2p<TypeTag>::calculateVelocity() ElementPointer & elementPointer4 = interactionVolume.getSubVolumeElement(3); // cell index - int globalIdx1 = problem_.variables().index(*elementPointer1); - int globalIdx2 = problem_.variables().index(*elementPointer2); - int globalIdx3 = problem_.variables().index(*elementPointer3); - int globalIdx4 = problem_.variables().index(*elementPointer4); + int eIdxGlobal1 = problem_.variables().index(*elementPointer1); + int eIdxGlobal2 = problem_.variables().index(*elementPointer2); + int eIdxGlobal3 = problem_.variables().index(*elementPointer3); + int eIdxGlobal4 = problem_.variables().index(*elementPointer4); //get the cell Data - CellData& cellData1 = problem_.variables().cellData(globalIdx1); - CellData& cellData2 = problem_.variables().cellData(globalIdx2); - CellData& cellData3 = problem_.variables().cellData(globalIdx3); - CellData& cellData4 = problem_.variables().cellData(globalIdx4); + CellData& cellData1 = problem_.variables().cellData(eIdxGlobal1); + CellData& cellData2 = problem_.variables().cellData(eIdxGlobal2); + CellData& cellData3 = problem_.variables().cellData(eIdxGlobal3); + CellData& cellData4 = problem_.variables().cellData(eIdxGlobal4); velocity_.calculateInnerInteractionVolumeVelocity(interactionVolume, cellData1, cellData2, cellData3, cellData4, this->innerBoundaryVolumeFaces_); @@ -272,9 +272,9 @@ void FvMpfaL2dPressureVelocity2p<TypeTag>::calculateVelocity() ElementPointer & elementPointer = interactionVolume.getSubVolumeElement(elemIdx); // cell index - int globalIdx = problem_.variables().index(*elementPointer); + int eIdxGlobal = problem_.variables().index(*elementPointer); //get the cell Data - CellData& cellData = problem_.variables().cellData(globalIdx); + CellData& cellData = problem_.variables().cellData(eIdxGlobal); velocity_.calculateBoundaryInteractionVolumeVelocity(interactionVolume, cellData, elemIdx); } @@ -302,10 +302,10 @@ void FvMpfaL2dPressureVelocity2p<TypeTag>::calculateVelocity(const Intersection& ElementPointer elementPtrI = intersection.inside(); ElementPointer elementPtrJ = intersection.outside(); - int globalIdxI = problem_.variables().index(*elementPtrI); - int globalIdxJ = problem_.variables().index(*elementPtrJ); + int eIdxGlobalI = problem_.variables().index(*elementPtrI); + int eIdxGlobalJ = problem_.variables().index(*elementPtrJ); - CellData& cellDataJ = problem_.variables().cellData(globalIdxJ); + CellData& cellDataJ = problem_.variables().cellData(eIdxGlobalJ); const ReferenceElement& referenceElement = ReferenceElements::general(elementPtrI->geometry().type()); @@ -332,24 +332,24 @@ void FvMpfaL2dPressureVelocity2p<TypeTag>::calculateVelocity(const Intersection& ElementPointer & elementPointer4 = interactionVolume.getSubVolumeElement(3); // cell index - int globalIdx[4]; - globalIdx[0] = problem_.variables().index(*elementPointer1); - globalIdx[1] = problem_.variables().index(*elementPointer2); - globalIdx[2] = problem_.variables().index(*elementPointer3); - globalIdx[3] = problem_.variables().index(*elementPointer4); + int eIdxGlobal[4]; + eIdxGlobal[0] = problem_.variables().index(*elementPointer1); + eIdxGlobal[1] = problem_.variables().index(*elementPointer2); + eIdxGlobal[2] = problem_.variables().index(*elementPointer3); + eIdxGlobal[3] = problem_.variables().index(*elementPointer4); //get the cell Data - cellDataTemp[0] = problem_.variables().cellData(globalIdx[0]); - cellDataTemp[1] = problem_.variables().cellData(globalIdx[1]); - cellDataTemp[2] = problem_.variables().cellData(globalIdx[2]); - cellDataTemp[3] = problem_.variables().cellData(globalIdx[3]); + cellDataTemp[0] = problem_.variables().cellData(eIdxGlobal[0]); + cellDataTemp[1] = problem_.variables().cellData(eIdxGlobal[1]); + cellDataTemp[2] = problem_.variables().cellData(eIdxGlobal[2]); + cellDataTemp[3] = problem_.variables().cellData(eIdxGlobal[3]); velocity_.calculateInnerInteractionVolumeVelocity(interactionVolume, cellDataTemp[0], cellDataTemp[1], cellDataTemp[2], cellDataTemp[3], this->innerBoundaryVolumeFaces_); for (int i = 0; i < 4; i++) { - if (globalIdx[i] == globalIdxI) + if (eIdxGlobal[i] == eIdxGlobalI) { cellData.fluxData().setVelocity(wPhaseIdx, indexInInside, cellDataTemp[i].fluxData().velocity(wPhaseIdx, indexInInside)); @@ -360,7 +360,7 @@ void FvMpfaL2dPressureVelocity2p<TypeTag>::calculateVelocity(const Intersection& cellData.fluxData().setUpwindPotential(nPhaseIdx, indexInInside, cellDataTemp[i].fluxData().upwindPotential(nPhaseIdx, indexInInside)); } - else if (globalIdx[i] == globalIdxJ) + else if (eIdxGlobal[i] == eIdxGlobalJ) { cellDataJ.fluxData().setVelocity(wPhaseIdx, indexInOutside, cellDataTemp[i].fluxData().velocity(wPhaseIdx, indexInOutside)); diff --git a/dumux/decoupled/2p/diffusion/fvmpfa/lmethod/fvmpfal2dpressurevelocity2padaptive.hh b/dumux/decoupled/2p/diffusion/fvmpfa/lmethod/fvmpfal2dpressurevelocity2padaptive.hh index 434b247b3328067c7d3cd436caf78f0e4beb5d92..a82e278b652b15d91b831dd0f102af3ce1e1b3db 100644 --- a/dumux/decoupled/2p/diffusion/fvmpfa/lmethod/fvmpfal2dpressurevelocity2padaptive.hh +++ b/dumux/decoupled/2p/diffusion/fvmpfa/lmethod/fvmpfal2dpressurevelocity2padaptive.hh @@ -246,16 +246,16 @@ void FvMpfaL2dPressureVelocity2pAdaptive<TypeTag>::calculateVelocity() ElementPointer & elementPointer4 = interactionVolume.getSubVolumeElement(3); // cell index - int globalIdx1 = problem_.variables().index(*elementPointer1); - int globalIdx2 = problem_.variables().index(*elementPointer2); - int globalIdx3 = problem_.variables().index(*elementPointer3); - int globalIdx4 = problem_.variables().index(*elementPointer4); + int eIdxGlobal1 = problem_.variables().index(*elementPointer1); + int eIdxGlobal2 = problem_.variables().index(*elementPointer2); + int eIdxGlobal3 = problem_.variables().index(*elementPointer3); + int eIdxGlobal4 = problem_.variables().index(*elementPointer4); //get the cell Data - CellData& cellData1 = problem_.variables().cellData(globalIdx1); - CellData& cellData2 = problem_.variables().cellData(globalIdx2); - CellData& cellData3 = problem_.variables().cellData(globalIdx3); - CellData& cellData4 = problem_.variables().cellData(globalIdx4); + CellData& cellData1 = problem_.variables().cellData(eIdxGlobal1); + CellData& cellData2 = problem_.variables().cellData(eIdxGlobal2); + CellData& cellData3 = problem_.variables().cellData(eIdxGlobal3); + CellData& cellData4 = problem_.variables().cellData(eIdxGlobal4); velocity_.calculateInnerInteractionVolumeVelocity(interactionVolume, cellData1, cellData2, cellData3, cellData4, this->innerBoundaryVolumeFaces_); @@ -268,14 +268,14 @@ void FvMpfaL2dPressureVelocity2pAdaptive<TypeTag>::calculateVelocity() ElementPointer & elementPointer4 = interactionVolume.getSubVolumeElement(3); // cell index - int globalIdx1 = problem_.variables().index(*elementPointer1); - int globalIdx2 = problem_.variables().index(*elementPointer2); - int globalIdx4 = problem_.variables().index(*elementPointer4); + int eIdxGlobal1 = problem_.variables().index(*elementPointer1); + int eIdxGlobal2 = problem_.variables().index(*elementPointer2); + int eIdxGlobal4 = problem_.variables().index(*elementPointer4); //get the cell Data - CellData& cellData1 = problem_.variables().cellData(globalIdx1); - CellData& cellData2 = problem_.variables().cellData(globalIdx2); - CellData& cellData4 = problem_.variables().cellData(globalIdx4); + CellData& cellData1 = problem_.variables().cellData(eIdxGlobal1); + CellData& cellData2 = problem_.variables().cellData(eIdxGlobal2); + CellData& cellData4 = problem_.variables().cellData(eIdxGlobal4); velocity_.calculateHangingNodeInteractionVolumeVelocity(interactionVolume, cellData1, cellData2, cellData4, this->innerBoundaryVolumeFaces_); @@ -309,9 +309,9 @@ void FvMpfaL2dPressureVelocity2pAdaptive<TypeTag>::calculateVelocity() ElementPointer & elementPointer = interactionVolume.getSubVolumeElement(elemIdx); // cell index - int globalIdx = problem_.variables().index(*elementPointer); + int eIdxGlobal = problem_.variables().index(*elementPointer); //get the cell Data - CellData& cellData = problem_.variables().cellData(globalIdx); + CellData& cellData = problem_.variables().cellData(eIdxGlobal); velocity_.calculateBoundaryInteractionVolumeVelocity(interactionVolume, cellData, elemIdx); } @@ -340,10 +340,10 @@ void FvMpfaL2dPressureVelocity2pAdaptive<TypeTag>::calculateVelocity(const Inter int levelI = elementPtrI->level(); int levelJ = elementPtrJ->level(); - int globalIdxI = problem_.variables().index(*elementPtrI); - int globalIdxJ = problem_.variables().index(*elementPtrJ); + int eIdxGlobalI = problem_.variables().index(*elementPtrI); + int eIdxGlobalJ = problem_.variables().index(*elementPtrJ); - CellData& cellDataJ = problem_.variables().cellData(globalIdxJ); + CellData& cellDataJ = problem_.variables().cellData(eIdxGlobalJ); const ReferenceElement& referenceElement = ReferenceElements::general(elementPtrI->geometry().type()); @@ -392,7 +392,7 @@ void FvMpfaL2dPressureVelocity2pAdaptive<TypeTag>::calculateVelocity(const Inter if (interactionVolume.isInnerVolume()) { // cell index vector - std::vector<int> globalIdx(0); + std::vector<int> eIdxGlobal(0); if (interactionVolume.getElementNumber() == 4) { @@ -401,20 +401,20 @@ void FvMpfaL2dPressureVelocity2pAdaptive<TypeTag>::calculateVelocity(const Inter ElementPointer & elementPointer3 = interactionVolume.getSubVolumeElement(2); ElementPointer & elementPointer4 = interactionVolume.getSubVolumeElement(3); - globalIdx.resize(4); + eIdxGlobal.resize(4); - globalIdx[0] = problem_.variables().index(*elementPointer1); - globalIdx[1] = problem_.variables().index(*elementPointer2); - globalIdx[2] = problem_.variables().index(*elementPointer3); - globalIdx[3] = problem_.variables().index(*elementPointer4); + eIdxGlobal[0] = problem_.variables().index(*elementPointer1); + eIdxGlobal[1] = problem_.variables().index(*elementPointer2); + eIdxGlobal[2] = problem_.variables().index(*elementPointer3); + eIdxGlobal[3] = problem_.variables().index(*elementPointer4); //cell Data vector cellDataTemp.resize(4); - cellDataTemp[0] = problem_.variables().cellData(globalIdx[0]); - cellDataTemp[1] = problem_.variables().cellData(globalIdx[1]); - cellDataTemp[2] = problem_.variables().cellData(globalIdx[2]); - cellDataTemp[3] = problem_.variables().cellData(globalIdx[3]); + cellDataTemp[0] = problem_.variables().cellData(eIdxGlobal[0]); + cellDataTemp[1] = problem_.variables().cellData(eIdxGlobal[1]); + cellDataTemp[2] = problem_.variables().cellData(eIdxGlobal[2]); + cellDataTemp[3] = problem_.variables().cellData(eIdxGlobal[3]); velocity_.calculateInnerInteractionVolumeVelocity(interactionVolume, cellDataTemp[0], cellDataTemp[1], cellDataTemp[2], cellDataTemp[3], this->innerBoundaryVolumeFaces_); @@ -425,18 +425,18 @@ void FvMpfaL2dPressureVelocity2pAdaptive<TypeTag>::calculateVelocity(const Inter ElementPointer & elementPointer2 = interactionVolume.getSubVolumeElement(1); ElementPointer & elementPointer4 = interactionVolume.getSubVolumeElement(3); - globalIdx.resize(3); + eIdxGlobal.resize(3); - globalIdx[0] = problem_.variables().index(*elementPointer1); - globalIdx[1] = problem_.variables().index(*elementPointer2); - globalIdx[2] = problem_.variables().index(*elementPointer4); + eIdxGlobal[0] = problem_.variables().index(*elementPointer1); + eIdxGlobal[1] = problem_.variables().index(*elementPointer2); + eIdxGlobal[2] = problem_.variables().index(*elementPointer4); //cell Data vector cellDataTemp.resize(3); - cellDataTemp[0] = problem_.variables().cellData(globalIdx[0]); - cellDataTemp[1] = problem_.variables().cellData(globalIdx[1]); - cellDataTemp[2] = problem_.variables().cellData(globalIdx[2]); + cellDataTemp[0] = problem_.variables().cellData(eIdxGlobal[0]); + cellDataTemp[1] = problem_.variables().cellData(eIdxGlobal[1]); + cellDataTemp[2] = problem_.variables().cellData(eIdxGlobal[2]); velocity_.calculateHangingNodeInteractionVolumeVelocity(interactionVolume, cellDataTemp[0], cellDataTemp[1], @@ -450,7 +450,7 @@ void FvMpfaL2dPressureVelocity2pAdaptive<TypeTag>::calculateVelocity(const Inter int size = cellDataTemp.size(); for (int i = 0; i < size; i++) { - if (globalIdx[i] == globalIdxI) + if (eIdxGlobal[i] == eIdxGlobalI) { if (levelI >= levelJ) { @@ -478,7 +478,7 @@ void FvMpfaL2dPressureVelocity2pAdaptive<TypeTag>::calculateVelocity(const Inter } } - else if (globalIdx[i] == globalIdxJ) + else if (eIdxGlobal[i] == eIdxGlobalJ) { if (levelJ >= levelI) { diff --git a/dumux/decoupled/2p/diffusion/fvmpfa/lmethod/fvmpfal2dvelocity2p.hh b/dumux/decoupled/2p/diffusion/fvmpfa/lmethod/fvmpfal2dvelocity2p.hh index 051376a32c2c3a5bac82d53cc573dbfbc67bc1b2..738935664a45cb3c8c3792f8c82bfb4732619edb 100644 --- a/dumux/decoupled/2p/diffusion/fvmpfa/lmethod/fvmpfal2dvelocity2p.hh +++ b/dumux/decoupled/2p/diffusion/fvmpfa/lmethod/fvmpfal2dvelocity2p.hh @@ -190,9 +190,9 @@ public: for (ElementIterator eIt = problem_.gridView().template begin<0>(); eIt != eEndIt; ++eIt) { // cell index - int globalIdx = problem_.variables().index(*eIt); + int eIdxGlobal = problem_.variables().index(*eIt); - CellData & cellData = problem_.variables().cellData(globalIdx); + CellData & cellData = problem_.variables().cellData(eIdxGlobal); Dune::FieldVector < Scalar, 2 * dim > fluxW(0); Dune::FieldVector < Scalar, 2 * dim > fluxNw(0); @@ -223,7 +223,7 @@ public: jacobianT.umtv(refVelocity, elementVelocity); elementVelocity /= eIt->geometry().integrationElement(localPos); - velocityWetting[globalIdx] = elementVelocity; + velocityWetting[eIdxGlobal] = elementVelocity; refVelocity = 0; refVelocity[0] = 0.5 * (fluxNw[1] - fluxNw[0]); @@ -234,7 +234,7 @@ public: jacobianT.umtv(refVelocity, elementVelocity); elementVelocity /= eIt->geometry().integrationElement(localPos); - velocityNonwetting[globalIdx] = elementVelocity; + velocityNonwetting[eIdxGlobal] = elementVelocity; } writer.attachCellData(velocityWetting, "wetting-velocity", dim); @@ -295,10 +295,10 @@ void FvMpfaL2dVelocity2p<TypeTag>::calculateInnerInteractionVolumeVelocity(Inter int level4 = elementPointer4->level(); // cell index - int globalIdx1 = problem_.variables().index(*elementPointer1); - int globalIdx2 = problem_.variables().index(*elementPointer2); - int globalIdx3 = problem_.variables().index(*elementPointer3); - int globalIdx4 = problem_.variables().index(*elementPointer4); + int eIdxGlobal1 = problem_.variables().index(*elementPointer1); + int eIdxGlobal2 = problem_.variables().index(*elementPointer2); + int eIdxGlobal3 = problem_.variables().index(*elementPointer3); + int eIdxGlobal4 = problem_.variables().index(*elementPointer4); // get pressure values Dune::FieldVector < Scalar, 2 * dim > potW(0); @@ -669,35 +669,35 @@ void FvMpfaL2dVelocity2p<TypeTag>::calculateInnerInteractionVolumeVelocity(Inter vel41 *= fracFlow14; vel43 *= fracFlow34; - if (innerBoundaryVolumeFaces[globalIdx1][interactionVolume.getIndexOnElement(0, 0)]) + if (innerBoundaryVolumeFaces[eIdxGlobal1][interactionVolume.getIndexOnElement(0, 0)]) { vel12 *= 2; } - if (innerBoundaryVolumeFaces[globalIdx1][interactionVolume.getIndexOnElement(0, 1)]) + if (innerBoundaryVolumeFaces[eIdxGlobal1][interactionVolume.getIndexOnElement(0, 1)]) { vel14 *= 2; } - if (innerBoundaryVolumeFaces[globalIdx2][interactionVolume.getIndexOnElement(1, 0)]) + if (innerBoundaryVolumeFaces[eIdxGlobal2][interactionVolume.getIndexOnElement(1, 0)]) { vel23 *= 2; } - if (innerBoundaryVolumeFaces[globalIdx2][interactionVolume.getIndexOnElement(1, 1)]) + if (innerBoundaryVolumeFaces[eIdxGlobal2][interactionVolume.getIndexOnElement(1, 1)]) { vel21 *= 2; } - if (innerBoundaryVolumeFaces[globalIdx3][interactionVolume.getIndexOnElement(2, 0)]) + if (innerBoundaryVolumeFaces[eIdxGlobal3][interactionVolume.getIndexOnElement(2, 0)]) { vel34 *= 2; } - if (innerBoundaryVolumeFaces[globalIdx3][interactionVolume.getIndexOnElement(2, 1)]) + if (innerBoundaryVolumeFaces[eIdxGlobal3][interactionVolume.getIndexOnElement(2, 1)]) { vel32 *= 2; } - if (innerBoundaryVolumeFaces[globalIdx4][interactionVolume.getIndexOnElement(3, 0)]) + if (innerBoundaryVolumeFaces[eIdxGlobal4][interactionVolume.getIndexOnElement(3, 0)]) { vel41 *= 2; } - if (innerBoundaryVolumeFaces[globalIdx4][interactionVolume.getIndexOnElement(3, 1)]) + if (innerBoundaryVolumeFaces[eIdxGlobal4][interactionVolume.getIndexOnElement(3, 1)]) { vel43 *= 2; } diff --git a/dumux/decoupled/2p/diffusion/fvmpfa/lmethod/fvmpfal3dinteractionvolumecontainer.hh b/dumux/decoupled/2p/diffusion/fvmpfa/lmethod/fvmpfal3dinteractionvolumecontainer.hh index cf282c11d0e4666019db6914ded84f346ba311b7..2dc3b727cf5023669c9674bb3b4b5f7686249d39 100644 --- a/dumux/decoupled/2p/diffusion/fvmpfa/lmethod/fvmpfal3dinteractionvolumecontainer.hh +++ b/dumux/decoupled/2p/diffusion/fvmpfa/lmethod/fvmpfal3dinteractionvolumecontainer.hh @@ -281,13 +281,13 @@ public: } protected: - void addRealFluxFaceArea_(Scalar faceArea, int globalIdx, int fIdx) + void addRealFluxFaceArea_(Scalar faceArea, int eIdxGlobal, int fIdx) { - realFluxFaceArea_[globalIdx][fIdx][fluxFaceArea] += faceArea; + realFluxFaceArea_[eIdxGlobal][fIdx][fluxFaceArea] += faceArea; } - void addRealFaceArea_(Scalar faceArea, int globalIdx, int fIdx) + void addRealFaceArea_(Scalar faceArea, int eIdxGlobal, int fIdx) { - realFluxFaceArea_[globalIdx][fIdx][realFaceArea] += faceArea; + realFluxFaceArea_[eIdxGlobal][fIdx][realFaceArea] += faceArea; } Problem& problem_; @@ -318,39 +318,39 @@ template<class TypeTag> void FvMpfaL3dInteractionVolumeContainer<TypeTag>::storeSubVolumeElements(const Element& element, std::vector < std::vector<int> >& elemVertMap) { - int globalIdx = problem_.variables().index(element); + int eIdxGlobal = problem_.variables().index(element); int vIdxGlobal = problem_.variables().vertexMapper().map(element, 0, dim); interactionVolumes_[vIdxGlobal].setSubVolumeElement(element, 7); - elemVertMap[vIdxGlobal][7] = globalIdx; + elemVertMap[vIdxGlobal][7] = eIdxGlobal; vIdxGlobal = problem_.variables().vertexMapper().map(element, 1, dim); interactionVolumes_[vIdxGlobal].setSubVolumeElement(element, 6); - elemVertMap[vIdxGlobal][6] = globalIdx; + elemVertMap[vIdxGlobal][6] = eIdxGlobal; vIdxGlobal = problem_.variables().vertexMapper().map(element, 2, dim); interactionVolumes_[vIdxGlobal].setSubVolumeElement(element, 5); - elemVertMap[vIdxGlobal][5] = globalIdx; + elemVertMap[vIdxGlobal][5] = eIdxGlobal; vIdxGlobal = problem_.variables().vertexMapper().map(element, 3, dim); interactionVolumes_[vIdxGlobal].setSubVolumeElement(element, 4); - elemVertMap[vIdxGlobal][4] = globalIdx; + elemVertMap[vIdxGlobal][4] = eIdxGlobal; vIdxGlobal = problem_.variables().vertexMapper().map(element, 4, dim); interactionVolumes_[vIdxGlobal].setSubVolumeElement(element, 3); - elemVertMap[vIdxGlobal][3] = globalIdx; + elemVertMap[vIdxGlobal][3] = eIdxGlobal; vIdxGlobal = problem_.variables().vertexMapper().map(element, 5, dim); interactionVolumes_[vIdxGlobal].setSubVolumeElement(element, 2); - elemVertMap[vIdxGlobal][2] = globalIdx; + elemVertMap[vIdxGlobal][2] = eIdxGlobal; vIdxGlobal = problem_.variables().vertexMapper().map(element, 6, dim); interactionVolumes_[vIdxGlobal].setSubVolumeElement(element, 1); - elemVertMap[vIdxGlobal][1] = globalIdx; + elemVertMap[vIdxGlobal][1] = eIdxGlobal; vIdxGlobal = problem_.variables().vertexMapper().map(element, 7, dim); interactionVolumes_[vIdxGlobal].setSubVolumeElement(element, 0); - elemVertMap[vIdxGlobal][0] = globalIdx; + elemVertMap[vIdxGlobal][0] = eIdxGlobal; } /*! \brief Stores information with respect to DUNE intersections in the interaction volumes @@ -370,7 +370,7 @@ void FvMpfaL3dInteractionVolumeContainer<TypeTag>::storeIntersectionInfo(const E { BoundaryTypes bcType; - int globalIdx = problem_.variables().index(element); + int eIdxGlobal = problem_.variables().index(element); const ElementGeometry& geometry = element.geometry(); @@ -397,9 +397,9 @@ void FvMpfaL3dInteractionVolumeContainer<TypeTag>::storeIntersectionInfo(const E if (isIt->neighbor()) { ElementPointer outside = isIt->outside(); - int globalIdxJ = problem_.variables().index(*outside); + int eIdxGlobalJ = problem_.variables().index(*outside); - if (levelI == outside->level() && globalIdx > globalIdxJ) + if (levelI == outside->level() && eIdxGlobal > eIdxGlobalJ) takeIntersection = false; if (levelI < outside->level()) takeIntersection = false; @@ -407,11 +407,11 @@ void FvMpfaL3dInteractionVolumeContainer<TypeTag>::storeIntersectionInfo(const E if (takeIntersection) { - addRealFaceArea_(faceVol, globalIdx, indexInInside); + addRealFaceArea_(faceVol, eIdxGlobal, indexInInside); if (isIt->neighbor()) { - int globalIdxJ = problem_.variables().index(*(isIt->outside())); - addRealFaceArea_(faceVol, globalIdxJ, isIt->indexInOutside()); + int eIdxGlobalJ = problem_.variables().index(*(isIt->outside())); + addRealFaceArea_(faceVol, eIdxGlobalJ, isIt->indexInOutside()); } for (int i = 0; i < isGeometry.corners(); i++) @@ -422,7 +422,7 @@ void FvMpfaL3dInteractionVolumeContainer<TypeTag>::storeIntersectionInfo(const E InteractionVolume& interactionVolume = interactionVolumes_[vIdxGlobal]; - if (elemVertMap[vIdxGlobal][0] == globalIdx) + if (elemVertMap[vIdxGlobal][0] == eIdxGlobal) { if (indexInInside == 1) { @@ -476,7 +476,7 @@ void FvMpfaL3dInteractionVolumeContainer<TypeTag>::storeIntersectionInfo(const E } } } - if (elemVertMap[vIdxGlobal][1] == globalIdx) + if (elemVertMap[vIdxGlobal][1] == eIdxGlobal) { if (indexInInside == 3) { @@ -530,7 +530,7 @@ void FvMpfaL3dInteractionVolumeContainer<TypeTag>::storeIntersectionInfo(const E } } } - if (elemVertMap[vIdxGlobal][2] == globalIdx) + if (elemVertMap[vIdxGlobal][2] == eIdxGlobal) { if (indexInInside == 2) { @@ -584,7 +584,7 @@ void FvMpfaL3dInteractionVolumeContainer<TypeTag>::storeIntersectionInfo(const E } } } - if (elemVertMap[vIdxGlobal][3] == globalIdx) + if (elemVertMap[vIdxGlobal][3] == eIdxGlobal) { if (indexInInside == 0) { @@ -638,7 +638,7 @@ void FvMpfaL3dInteractionVolumeContainer<TypeTag>::storeIntersectionInfo(const E } } } - if (elemVertMap[vIdxGlobal][4] == globalIdx) + if (elemVertMap[vIdxGlobal][4] == eIdxGlobal) { if (indexInInside == 4) { @@ -692,7 +692,7 @@ void FvMpfaL3dInteractionVolumeContainer<TypeTag>::storeIntersectionInfo(const E } } } - if (elemVertMap[vIdxGlobal][5] == globalIdx) + if (elemVertMap[vIdxGlobal][5] == eIdxGlobal) { if (indexInInside == 4) { @@ -747,7 +747,7 @@ void FvMpfaL3dInteractionVolumeContainer<TypeTag>::storeIntersectionInfo(const E } } } - if (elemVertMap[vIdxGlobal][6] == globalIdx) + if (elemVertMap[vIdxGlobal][6] == eIdxGlobal) { if (indexInInside == 4) { @@ -801,7 +801,7 @@ void FvMpfaL3dInteractionVolumeContainer<TypeTag>::storeIntersectionInfo(const E } } } - if (elemVertMap[vIdxGlobal][7] == globalIdx) + if (elemVertMap[vIdxGlobal][7] == eIdxGlobal) { if (indexInInside == 4) { @@ -857,7 +857,7 @@ void FvMpfaL3dInteractionVolumeContainer<TypeTag>::storeIntersectionInfo(const E } if (isIt->boundary()) { - if (elemVertMap[vIdxGlobal][0] == globalIdx) + if (elemVertMap[vIdxGlobal][0] == eIdxGlobal) { if (indexInInside == 1) { @@ -914,7 +914,7 @@ void FvMpfaL3dInteractionVolumeContainer<TypeTag>::storeIntersectionInfo(const E } } } - if (elemVertMap[vIdxGlobal][1] == globalIdx) + if (elemVertMap[vIdxGlobal][1] == eIdxGlobal) { if (indexInInside == 3) { @@ -971,7 +971,7 @@ void FvMpfaL3dInteractionVolumeContainer<TypeTag>::storeIntersectionInfo(const E } } } - if (elemVertMap[vIdxGlobal][2] == globalIdx) + if (elemVertMap[vIdxGlobal][2] == eIdxGlobal) { if (indexInInside == 2) { @@ -1028,7 +1028,7 @@ void FvMpfaL3dInteractionVolumeContainer<TypeTag>::storeIntersectionInfo(const E } } } - if (elemVertMap[vIdxGlobal][3] == globalIdx) + if (elemVertMap[vIdxGlobal][3] == eIdxGlobal) { if (indexInInside == 0) { @@ -1085,7 +1085,7 @@ void FvMpfaL3dInteractionVolumeContainer<TypeTag>::storeIntersectionInfo(const E } } } - if (elemVertMap[vIdxGlobal][4] == globalIdx) + if (elemVertMap[vIdxGlobal][4] == eIdxGlobal) { if (indexInInside == 4) { @@ -1142,7 +1142,7 @@ void FvMpfaL3dInteractionVolumeContainer<TypeTag>::storeIntersectionInfo(const E } } } - if (elemVertMap[vIdxGlobal][5] == globalIdx) + if (elemVertMap[vIdxGlobal][5] == eIdxGlobal) { if (indexInInside == 4) { @@ -1199,7 +1199,7 @@ void FvMpfaL3dInteractionVolumeContainer<TypeTag>::storeIntersectionInfo(const E } } } - if (elemVertMap[vIdxGlobal][6] == globalIdx) + if (elemVertMap[vIdxGlobal][6] == eIdxGlobal) { if (indexInInside == 4) { @@ -1256,7 +1256,7 @@ void FvMpfaL3dInteractionVolumeContainer<TypeTag>::storeIntersectionInfo(const E } } } - if (elemVertMap[vIdxGlobal][7] == globalIdx) + if (elemVertMap[vIdxGlobal][7] == eIdxGlobal) { if (indexInInside == 4) { @@ -1497,10 +1497,10 @@ void FvMpfaL3dInteractionVolumeContainer<TypeTag>::storeBoundaryInteractionVolum interactionVolume.setOutsideFace(11); ElementPointer& element = interactionVolume.getSubVolumeElement(0); - int globalIdx = problem_.variables().index(*element); - interactionVolume.setFaceArea(getRealFaceArea(interactionVolume, globalIdx, 0, 0)/4.0,0); - interactionVolume.setFaceArea(getRealFaceArea(interactionVolume, globalIdx, 0, 1)/4.0,3); - interactionVolume.setFaceArea(getRealFaceArea(interactionVolume, globalIdx, 0, 2)/4.0,8); + int eIdxGlobal = problem_.variables().index(*element); + interactionVolume.setFaceArea(getRealFaceArea(interactionVolume, eIdxGlobal, 0, 0)/4.0,0); + interactionVolume.setFaceArea(getRealFaceArea(interactionVolume, eIdxGlobal, 0, 1)/4.0,3); + interactionVolume.setFaceArea(getRealFaceArea(interactionVolume, eIdxGlobal, 0, 2)/4.0,8); } if (interactionVolume.hasSubVolumeElement(1)) { @@ -1515,10 +1515,10 @@ void FvMpfaL3dInteractionVolumeContainer<TypeTag>::storeBoundaryInteractionVolum interactionVolume.setOutsideFace(11); ElementPointer& element = interactionVolume.getSubVolumeElement(1); - int globalIdx = problem_.variables().index(*element); - interactionVolume.setFaceArea(getRealFaceArea(interactionVolume, globalIdx, 1, 0)/4.0,1); - interactionVolume.setFaceArea(getRealFaceArea(interactionVolume, globalIdx, 1, 1)/4.0,0); - interactionVolume.setFaceArea(getRealFaceArea(interactionVolume, globalIdx, 1, 2)/4.0,9); + int eIdxGlobal = problem_.variables().index(*element); + interactionVolume.setFaceArea(getRealFaceArea(interactionVolume, eIdxGlobal, 1, 0)/4.0,1); + interactionVolume.setFaceArea(getRealFaceArea(interactionVolume, eIdxGlobal, 1, 1)/4.0,0); + interactionVolume.setFaceArea(getRealFaceArea(interactionVolume, eIdxGlobal, 1, 2)/4.0,9); } if (interactionVolume.hasSubVolumeElement(2)) { @@ -1533,10 +1533,10 @@ void FvMpfaL3dInteractionVolumeContainer<TypeTag>::storeBoundaryInteractionVolum interactionVolume.setOutsideFace(10); ElementPointer& element = interactionVolume.getSubVolumeElement(2); - int globalIdx = problem_.variables().index(*element); - interactionVolume.setFaceArea(getRealFaceArea(interactionVolume, globalIdx, 2, 0)/4.0,3); - interactionVolume.setFaceArea(getRealFaceArea(interactionVolume, globalIdx, 2, 1)/4.0,2); - interactionVolume.setFaceArea(getRealFaceArea(interactionVolume, globalIdx, 2, 2)/4.0,11); + int eIdxGlobal = problem_.variables().index(*element); + interactionVolume.setFaceArea(getRealFaceArea(interactionVolume, eIdxGlobal, 2, 0)/4.0,3); + interactionVolume.setFaceArea(getRealFaceArea(interactionVolume, eIdxGlobal, 2, 1)/4.0,2); + interactionVolume.setFaceArea(getRealFaceArea(interactionVolume, eIdxGlobal, 2, 2)/4.0,11); } if (interactionVolume.hasSubVolumeElement(3)) { @@ -1551,10 +1551,10 @@ void FvMpfaL3dInteractionVolumeContainer<TypeTag>::storeBoundaryInteractionVolum interactionVolume.setOutsideFace(11); ElementPointer& element = interactionVolume.getSubVolumeElement(3); - int globalIdx = problem_.variables().index(*element); - interactionVolume.setFaceArea(getRealFaceArea(interactionVolume, globalIdx, 3, 0)/4.0,2); - interactionVolume.setFaceArea(getRealFaceArea(interactionVolume, globalIdx, 3, 1)/4.0,1); - interactionVolume.setFaceArea(getRealFaceArea(interactionVolume, globalIdx, 3, 2)/4.0,10); + int eIdxGlobal = problem_.variables().index(*element); + interactionVolume.setFaceArea(getRealFaceArea(interactionVolume, eIdxGlobal, 3, 0)/4.0,2); + interactionVolume.setFaceArea(getRealFaceArea(interactionVolume, eIdxGlobal, 3, 1)/4.0,1); + interactionVolume.setFaceArea(getRealFaceArea(interactionVolume, eIdxGlobal, 3, 2)/4.0,10); } if (interactionVolume.hasSubVolumeElement(4)) { @@ -1569,10 +1569,10 @@ void FvMpfaL3dInteractionVolumeContainer<TypeTag>::storeBoundaryInteractionVolum interactionVolume.setOutsideFace(11); ElementPointer& element = interactionVolume.getSubVolumeElement(4); - int globalIdx = problem_.variables().index(*element); - interactionVolume.setFaceArea(getRealFaceArea(interactionVolume, globalIdx, 4, 0)/4.0,8); - interactionVolume.setFaceArea(getRealFaceArea(interactionVolume, globalIdx, 4, 1)/4.0,4); - interactionVolume.setFaceArea(getRealFaceArea(interactionVolume, globalIdx, 4, 2)/4.0,7); + int eIdxGlobal = problem_.variables().index(*element); + interactionVolume.setFaceArea(getRealFaceArea(interactionVolume, eIdxGlobal, 4, 0)/4.0,8); + interactionVolume.setFaceArea(getRealFaceArea(interactionVolume, eIdxGlobal, 4, 1)/4.0,4); + interactionVolume.setFaceArea(getRealFaceArea(interactionVolume, eIdxGlobal, 4, 2)/4.0,7); } if (interactionVolume.hasSubVolumeElement(5)) { @@ -1587,10 +1587,10 @@ void FvMpfaL3dInteractionVolumeContainer<TypeTag>::storeBoundaryInteractionVolum interactionVolume.setOutsideFace(11); ElementPointer& element = interactionVolume.getSubVolumeElement(5); - int globalIdx = problem_.variables().index(*element); - interactionVolume.setFaceArea(getRealFaceArea(interactionVolume, globalIdx, 5, 0)/4.0,9); - interactionVolume.setFaceArea(getRealFaceArea(interactionVolume, globalIdx, 5, 1)/4.0,5); - interactionVolume.setFaceArea(getRealFaceArea(interactionVolume, globalIdx, 5, 2)/4.0,4); + int eIdxGlobal = problem_.variables().index(*element); + interactionVolume.setFaceArea(getRealFaceArea(interactionVolume, eIdxGlobal, 5, 0)/4.0,9); + interactionVolume.setFaceArea(getRealFaceArea(interactionVolume, eIdxGlobal, 5, 1)/4.0,5); + interactionVolume.setFaceArea(getRealFaceArea(interactionVolume, eIdxGlobal, 5, 2)/4.0,4); } if (interactionVolume.hasSubVolumeElement(6)) { @@ -1605,10 +1605,10 @@ void FvMpfaL3dInteractionVolumeContainer<TypeTag>::storeBoundaryInteractionVolum interactionVolume.setOutsideFace(10); ElementPointer& element = interactionVolume.getSubVolumeElement(6); - int globalIdx = problem_.variables().index(*element); - interactionVolume.setFaceArea(getRealFaceArea(interactionVolume, globalIdx, 6, 0)/4.0,11); - interactionVolume.setFaceArea(getRealFaceArea(interactionVolume, globalIdx, 6, 1)/4.0,7); - interactionVolume.setFaceArea(getRealFaceArea(interactionVolume, globalIdx, 6, 2)/4.0,6); + int eIdxGlobal = problem_.variables().index(*element); + interactionVolume.setFaceArea(getRealFaceArea(interactionVolume, eIdxGlobal, 6, 0)/4.0,11); + interactionVolume.setFaceArea(getRealFaceArea(interactionVolume, eIdxGlobal, 6, 1)/4.0,7); + interactionVolume.setFaceArea(getRealFaceArea(interactionVolume, eIdxGlobal, 6, 2)/4.0,6); } if (interactionVolume.hasSubVolumeElement(7)) { @@ -1623,10 +1623,10 @@ void FvMpfaL3dInteractionVolumeContainer<TypeTag>::storeBoundaryInteractionVolum interactionVolume.setOutsideFace(11); ElementPointer& element = interactionVolume.getSubVolumeElement(7); - int globalIdx = problem_.variables().index(*element); - interactionVolume.setFaceArea(getRealFaceArea(interactionVolume, globalIdx, 7, 0)/4.0,10); - interactionVolume.setFaceArea(getRealFaceArea(interactionVolume, globalIdx, 7, 1)/4.0,6); - interactionVolume.setFaceArea(getRealFaceArea(interactionVolume, globalIdx, 7, 2)/4.0,5); + int eIdxGlobal = problem_.variables().index(*element); + interactionVolume.setFaceArea(getRealFaceArea(interactionVolume, eIdxGlobal, 7, 0)/4.0,10); + interactionVolume.setFaceArea(getRealFaceArea(interactionVolume, eIdxGlobal, 7, 1)/4.0,6); + interactionVolume.setFaceArea(getRealFaceArea(interactionVolume, eIdxGlobal, 7, 2)/4.0,5); } break; } @@ -1636,7 +1636,7 @@ void FvMpfaL3dInteractionVolumeContainer<TypeTag>::storeBoundaryInteractionVolum if (interactionVolume.hasSubVolumeElement(0)) { ElementPointer& element1 = interactionVolume.getSubVolumeElement(0); - int globalIdx1 = problem_.variables().index(*element1); + int eIdxGlobal1 = problem_.variables().index(*element1); if (interactionVolume.hasSubVolumeElement(1)) { interactionVolume.setOutsideFace(4); @@ -1648,11 +1648,11 @@ void FvMpfaL3dInteractionVolumeContainer<TypeTag>::storeBoundaryInteractionVolum interactionVolume.setOutsideFace(11); ElementPointer& element2 = interactionVolume.getSubVolumeElement(1); - int globalIdx2 = problem_.variables().index(*element2); - interactionVolume.setFaceArea(getRealFaceArea(interactionVolume, globalIdx1, 0, 1)/4.0,3); - interactionVolume.setFaceArea(getRealFaceArea(interactionVolume, globalIdx1, 0, 2)/4.0,8); - interactionVolume.setFaceArea(getRealFaceArea(interactionVolume, globalIdx2, 1, 0)/4.0,1); - interactionVolume.setFaceArea(getRealFaceArea(interactionVolume, globalIdx2, 1, 2)/4.0,9); + int eIdxGlobal2 = problem_.variables().index(*element2); + interactionVolume.setFaceArea(getRealFaceArea(interactionVolume, eIdxGlobal1, 0, 1)/4.0,3); + interactionVolume.setFaceArea(getRealFaceArea(interactionVolume, eIdxGlobal1, 0, 2)/4.0,8); + interactionVolume.setFaceArea(getRealFaceArea(interactionVolume, eIdxGlobal2, 1, 0)/4.0,1); + interactionVolume.setFaceArea(getRealFaceArea(interactionVolume, eIdxGlobal2, 1, 2)/4.0,9); return; } @@ -1667,11 +1667,11 @@ void FvMpfaL3dInteractionVolumeContainer<TypeTag>::storeBoundaryInteractionVolum interactionVolume.setOutsideFace(10); ElementPointer& element2 = interactionVolume.getSubVolumeElement(2); - int globalIdx2 = problem_.variables().index(*element2); - interactionVolume.setFaceArea(getRealFaceArea(interactionVolume, globalIdx1, 0, 0)/4.0,0); - interactionVolume.setFaceArea(getRealFaceArea(interactionVolume, globalIdx1, 0, 2)/4.0,8); - interactionVolume.setFaceArea(getRealFaceArea(interactionVolume, globalIdx2, 2, 1)/4.0,2); - interactionVolume.setFaceArea(getRealFaceArea(interactionVolume, globalIdx2, 2, 2)/4.0,11); + int eIdxGlobal2 = problem_.variables().index(*element2); + interactionVolume.setFaceArea(getRealFaceArea(interactionVolume, eIdxGlobal1, 0, 0)/4.0,0); + interactionVolume.setFaceArea(getRealFaceArea(interactionVolume, eIdxGlobal1, 0, 2)/4.0,8); + interactionVolume.setFaceArea(getRealFaceArea(interactionVolume, eIdxGlobal2, 2, 1)/4.0,2); + interactionVolume.setFaceArea(getRealFaceArea(interactionVolume, eIdxGlobal2, 2, 2)/4.0,11); return; } @@ -1686,11 +1686,11 @@ void FvMpfaL3dInteractionVolumeContainer<TypeTag>::storeBoundaryInteractionVolum interactionVolume.setOutsideFace(11); ElementPointer& element2 = interactionVolume.getSubVolumeElement(4); - int globalIdx2 = problem_.variables().index(*element2); - interactionVolume.setFaceArea(getRealFaceArea(interactionVolume, globalIdx1, 0, 0)/4.0,0); - interactionVolume.setFaceArea(getRealFaceArea(interactionVolume, globalIdx1, 0, 1)/4.0,3); - interactionVolume.setFaceArea(getRealFaceArea(interactionVolume, globalIdx2, 4, 1)/4.0,4); - interactionVolume.setFaceArea(getRealFaceArea(interactionVolume, globalIdx2, 4, 2)/4.0,7); + int eIdxGlobal2 = problem_.variables().index(*element2); + interactionVolume.setFaceArea(getRealFaceArea(interactionVolume, eIdxGlobal1, 0, 0)/4.0,0); + interactionVolume.setFaceArea(getRealFaceArea(interactionVolume, eIdxGlobal1, 0, 1)/4.0,3); + interactionVolume.setFaceArea(getRealFaceArea(interactionVolume, eIdxGlobal2, 4, 1)/4.0,4); + interactionVolume.setFaceArea(getRealFaceArea(interactionVolume, eIdxGlobal2, 4, 2)/4.0,7); return; } @@ -1698,7 +1698,7 @@ void FvMpfaL3dInteractionVolumeContainer<TypeTag>::storeBoundaryInteractionVolum if (interactionVolume.hasSubVolumeElement(7)) { ElementPointer& element1 = interactionVolume.getSubVolumeElement(7); - int globalIdx1 = problem_.variables().index(*element1); + int eIdxGlobal1 = problem_.variables().index(*element1); if (interactionVolume.hasSubVolumeElement(5)) { interactionVolume.setOutsideFace(0); @@ -1710,11 +1710,11 @@ void FvMpfaL3dInteractionVolumeContainer<TypeTag>::storeBoundaryInteractionVolum interactionVolume.setOutsideFace(11); ElementPointer& element2 = interactionVolume.getSubVolumeElement(5); - int globalIdx2 = problem_.variables().index(*element2); - interactionVolume.setFaceArea(getRealFaceArea(interactionVolume, globalIdx1, 7, 0)/4.0,10); - interactionVolume.setFaceArea(getRealFaceArea(interactionVolume, globalIdx1, 7, 1)/4.0,6); - interactionVolume.setFaceArea(getRealFaceArea(interactionVolume, globalIdx2, 5, 0)/4.0,9); - interactionVolume.setFaceArea(getRealFaceArea(interactionVolume, globalIdx2, 5, 2)/4.0,4); + int eIdxGlobal2 = problem_.variables().index(*element2); + interactionVolume.setFaceArea(getRealFaceArea(interactionVolume, eIdxGlobal1, 7, 0)/4.0,10); + interactionVolume.setFaceArea(getRealFaceArea(interactionVolume, eIdxGlobal1, 7, 1)/4.0,6); + interactionVolume.setFaceArea(getRealFaceArea(interactionVolume, eIdxGlobal2, 5, 0)/4.0,9); + interactionVolume.setFaceArea(getRealFaceArea(interactionVolume, eIdxGlobal2, 5, 2)/4.0,4); return; } @@ -1729,11 +1729,11 @@ void FvMpfaL3dInteractionVolumeContainer<TypeTag>::storeBoundaryInteractionVolum interactionVolume.setOutsideFace(9); ElementPointer& element2 = interactionVolume.getSubVolumeElement(6); - int globalIdx2 = problem_.variables().index(*element2); - interactionVolume.setFaceArea(getRealFaceArea(interactionVolume, globalIdx1, 7, 0)/4.0,10); - interactionVolume.setFaceArea(getRealFaceArea(interactionVolume, globalIdx1, 7, 2)/4.0,5); - interactionVolume.setFaceArea(getRealFaceArea(interactionVolume, globalIdx2, 6, 0)/4.0,11); - interactionVolume.setFaceArea(getRealFaceArea(interactionVolume, globalIdx2, 6, 1)/4.0,7); + int eIdxGlobal2 = problem_.variables().index(*element2); + interactionVolume.setFaceArea(getRealFaceArea(interactionVolume, eIdxGlobal1, 7, 0)/4.0,10); + interactionVolume.setFaceArea(getRealFaceArea(interactionVolume, eIdxGlobal1, 7, 2)/4.0,5); + interactionVolume.setFaceArea(getRealFaceArea(interactionVolume, eIdxGlobal2, 6, 0)/4.0,11); + interactionVolume.setFaceArea(getRealFaceArea(interactionVolume, eIdxGlobal2, 6, 1)/4.0,7); return; } @@ -1748,11 +1748,11 @@ void FvMpfaL3dInteractionVolumeContainer<TypeTag>::storeBoundaryInteractionVolum interactionVolume.setOutsideFace(11); ElementPointer& element2 = interactionVolume.getSubVolumeElement(3); - int globalIdx2 = problem_.variables().index(*element2); - interactionVolume.setFaceArea(getRealFaceArea(interactionVolume, globalIdx1, 7, 1)/4.0,6); - interactionVolume.setFaceArea(getRealFaceArea(interactionVolume, globalIdx1, 7, 2)/4.0,5); - interactionVolume.setFaceArea(getRealFaceArea(interactionVolume, globalIdx2, 3, 0)/4.0,2); - interactionVolume.setFaceArea(getRealFaceArea(interactionVolume, globalIdx2, 3, 1)/4.0,1); + int eIdxGlobal2 = problem_.variables().index(*element2); + interactionVolume.setFaceArea(getRealFaceArea(interactionVolume, eIdxGlobal1, 7, 1)/4.0,6); + interactionVolume.setFaceArea(getRealFaceArea(interactionVolume, eIdxGlobal1, 7, 2)/4.0,5); + interactionVolume.setFaceArea(getRealFaceArea(interactionVolume, eIdxGlobal2, 3, 0)/4.0,2); + interactionVolume.setFaceArea(getRealFaceArea(interactionVolume, eIdxGlobal2, 3, 1)/4.0,1); return; } @@ -1760,7 +1760,7 @@ void FvMpfaL3dInteractionVolumeContainer<TypeTag>::storeBoundaryInteractionVolum if (interactionVolume.hasSubVolumeElement(5)) { ElementPointer& element1 = interactionVolume.getSubVolumeElement(5); - int globalIdx1 = problem_.variables().index(*element1); + int eIdxGlobal1 = problem_.variables().index(*element1); if (interactionVolume.hasSubVolumeElement(1)) { interactionVolume.setOutsideFace(3); @@ -1772,11 +1772,11 @@ void FvMpfaL3dInteractionVolumeContainer<TypeTag>::storeBoundaryInteractionVolum interactionVolume.setOutsideFace(10); ElementPointer& element2 = interactionVolume.getSubVolumeElement(1); - int globalIdx2 = problem_.variables().index(*element2); - interactionVolume.setFaceArea(getRealFaceArea(interactionVolume, globalIdx1, 5, 1)/4.0,5); - interactionVolume.setFaceArea(getRealFaceArea(interactionVolume, globalIdx1, 5, 2)/4.0,4); - interactionVolume.setFaceArea(getRealFaceArea(interactionVolume, globalIdx2, 1, 0)/4.0,1); - interactionVolume.setFaceArea(getRealFaceArea(interactionVolume, globalIdx2, 1, 1)/4.0,0); + int eIdxGlobal2 = problem_.variables().index(*element2); + interactionVolume.setFaceArea(getRealFaceArea(interactionVolume, eIdxGlobal1, 5, 1)/4.0,5); + interactionVolume.setFaceArea(getRealFaceArea(interactionVolume, eIdxGlobal1, 5, 2)/4.0,4); + interactionVolume.setFaceArea(getRealFaceArea(interactionVolume, eIdxGlobal2, 1, 0)/4.0,1); + interactionVolume.setFaceArea(getRealFaceArea(interactionVolume, eIdxGlobal2, 1, 1)/4.0,0); return; } @@ -1791,11 +1791,11 @@ void FvMpfaL3dInteractionVolumeContainer<TypeTag>::storeBoundaryInteractionVolum interactionVolume.setOutsideFace(11); ElementPointer& element2 = interactionVolume.getSubVolumeElement(4); - int globalIdx2 = problem_.variables().index(*element2); - interactionVolume.setFaceArea(getRealFaceArea(interactionVolume, globalIdx1, 5, 0)/4.0,9); - interactionVolume.setFaceArea(getRealFaceArea(interactionVolume, globalIdx1, 5, 1)/4.0,5); - interactionVolume.setFaceArea(getRealFaceArea(interactionVolume, globalIdx2, 4, 0)/4.0,8); - interactionVolume.setFaceArea(getRealFaceArea(interactionVolume, globalIdx2, 4, 2)/4.0,7); + int eIdxGlobal2 = problem_.variables().index(*element2); + interactionVolume.setFaceArea(getRealFaceArea(interactionVolume, eIdxGlobal1, 5, 0)/4.0,9); + interactionVolume.setFaceArea(getRealFaceArea(interactionVolume, eIdxGlobal1, 5, 1)/4.0,5); + interactionVolume.setFaceArea(getRealFaceArea(interactionVolume, eIdxGlobal2, 4, 0)/4.0,8); + interactionVolume.setFaceArea(getRealFaceArea(interactionVolume, eIdxGlobal2, 4, 2)/4.0,7); return; } @@ -1803,7 +1803,7 @@ void FvMpfaL3dInteractionVolumeContainer<TypeTag>::storeBoundaryInteractionVolum if (interactionVolume.hasSubVolumeElement(6)) { ElementPointer& element1 = interactionVolume.getSubVolumeElement(6); - int globalIdx1 = problem_.variables().index(*element1); + int eIdxGlobal1 = problem_.variables().index(*element1); if (interactionVolume.hasSubVolumeElement(4)) { interactionVolume.setOutsideFace(1); @@ -1815,11 +1815,11 @@ void FvMpfaL3dInteractionVolumeContainer<TypeTag>::storeBoundaryInteractionVolum interactionVolume.setOutsideFace(3); ElementPointer& element2 = interactionVolume.getSubVolumeElement(4); - int globalIdx2 = problem_.variables().index(*element2); - interactionVolume.setFaceArea(getRealFaceArea(interactionVolume, globalIdx1, 6, 0)/4.0,11); - interactionVolume.setFaceArea(getRealFaceArea(interactionVolume, globalIdx1, 6, 2)/4.0,6); - interactionVolume.setFaceArea(getRealFaceArea(interactionVolume, globalIdx2, 4, 0)/4.0,8); - interactionVolume.setFaceArea(getRealFaceArea(interactionVolume, globalIdx2, 4, 1)/4.0,4); + int eIdxGlobal2 = problem_.variables().index(*element2); + interactionVolume.setFaceArea(getRealFaceArea(interactionVolume, eIdxGlobal1, 6, 0)/4.0,11); + interactionVolume.setFaceArea(getRealFaceArea(interactionVolume, eIdxGlobal1, 6, 2)/4.0,6); + interactionVolume.setFaceArea(getRealFaceArea(interactionVolume, eIdxGlobal2, 4, 0)/4.0,8); + interactionVolume.setFaceArea(getRealFaceArea(interactionVolume, eIdxGlobal2, 4, 1)/4.0,4); return; } @@ -1834,11 +1834,11 @@ void FvMpfaL3dInteractionVolumeContainer<TypeTag>::storeBoundaryInteractionVolum interactionVolume.setOutsideFace(8); ElementPointer& element2 = interactionVolume.getSubVolumeElement(2); - int globalIdx2 = problem_.variables().index(*element2); - interactionVolume.setFaceArea(getRealFaceArea(interactionVolume, globalIdx1, 6, 1)/4.0,7); - interactionVolume.setFaceArea(getRealFaceArea(interactionVolume, globalIdx1, 6, 2)/4.0,6); - interactionVolume.setFaceArea(getRealFaceArea(interactionVolume, globalIdx2, 2, 0)/4.0,3); - interactionVolume.setFaceArea(getRealFaceArea(interactionVolume, globalIdx2, 2, 1)/4.0,2); + int eIdxGlobal2 = problem_.variables().index(*element2); + interactionVolume.setFaceArea(getRealFaceArea(interactionVolume, eIdxGlobal1, 6, 1)/4.0,7); + interactionVolume.setFaceArea(getRealFaceArea(interactionVolume, eIdxGlobal1, 6, 2)/4.0,6); + interactionVolume.setFaceArea(getRealFaceArea(interactionVolume, eIdxGlobal2, 2, 0)/4.0,3); + interactionVolume.setFaceArea(getRealFaceArea(interactionVolume, eIdxGlobal2, 2, 1)/4.0,2); return; } @@ -1846,7 +1846,7 @@ void FvMpfaL3dInteractionVolumeContainer<TypeTag>::storeBoundaryInteractionVolum if (interactionVolume.hasSubVolumeElement(3)) { ElementPointer& element1 = interactionVolume.getSubVolumeElement(3); - int globalIdx1 = problem_.variables().index(*element1); + int eIdxGlobal1 = problem_.variables().index(*element1); if (interactionVolume.hasSubVolumeElement(1)) { interactionVolume.setOutsideFace(4); @@ -1858,11 +1858,11 @@ void FvMpfaL3dInteractionVolumeContainer<TypeTag>::storeBoundaryInteractionVolum interactionVolume.setOutsideFace(11); ElementPointer& element2 = interactionVolume.getSubVolumeElement(1); - int globalIdx2 = problem_.variables().index(*element2); - interactionVolume.setFaceArea(getRealFaceArea(interactionVolume, globalIdx1, 3, 0)/4.0,2); - interactionVolume.setFaceArea(getRealFaceArea(interactionVolume, globalIdx1, 3, 2)/4.0,10); - interactionVolume.setFaceArea(getRealFaceArea(interactionVolume, globalIdx2, 1, 1)/4.0,0); - interactionVolume.setFaceArea(getRealFaceArea(interactionVolume, globalIdx2, 1, 2)/4.0,9); + int eIdxGlobal2 = problem_.variables().index(*element2); + interactionVolume.setFaceArea(getRealFaceArea(interactionVolume, eIdxGlobal1, 3, 0)/4.0,2); + interactionVolume.setFaceArea(getRealFaceArea(interactionVolume, eIdxGlobal1, 3, 2)/4.0,10); + interactionVolume.setFaceArea(getRealFaceArea(interactionVolume, eIdxGlobal2, 1, 1)/4.0,0); + interactionVolume.setFaceArea(getRealFaceArea(interactionVolume, eIdxGlobal2, 1, 2)/4.0,9); return; } @@ -1877,11 +1877,11 @@ void FvMpfaL3dInteractionVolumeContainer<TypeTag>::storeBoundaryInteractionVolum interactionVolume.setOutsideFace(9); ElementPointer& element2 = interactionVolume.getSubVolumeElement(2); - int globalIdx2 = problem_.variables().index(*element2); - interactionVolume.setFaceArea(getRealFaceArea(interactionVolume, globalIdx1, 3, 1)/4.0,1); - interactionVolume.setFaceArea(getRealFaceArea(interactionVolume, globalIdx1, 3, 2)/4.0,10); - interactionVolume.setFaceArea(getRealFaceArea(interactionVolume, globalIdx2, 2, 0)/4.0,3); - interactionVolume.setFaceArea(getRealFaceArea(interactionVolume, globalIdx2, 2, 2)/4.0,11); + int eIdxGlobal2 = problem_.variables().index(*element2); + interactionVolume.setFaceArea(getRealFaceArea(interactionVolume, eIdxGlobal1, 3, 1)/4.0,1); + interactionVolume.setFaceArea(getRealFaceArea(interactionVolume, eIdxGlobal1, 3, 2)/4.0,10); + interactionVolume.setFaceArea(getRealFaceArea(interactionVolume, eIdxGlobal2, 2, 0)/4.0,3); + interactionVolume.setFaceArea(getRealFaceArea(interactionVolume, eIdxGlobal2, 2, 2)/4.0,11); return; } @@ -1894,11 +1894,11 @@ void FvMpfaL3dInteractionVolumeContainer<TypeTag>::storeBoundaryInteractionVolum if (interactionVolume.hasSubVolumeElement(0)) { ElementPointer& element1 = interactionVolume.getSubVolumeElement(0); - int globalIdx1 = problem_.variables().index(*element1); + int eIdxGlobal1 = problem_.variables().index(*element1); if (interactionVolume.hasSubVolumeElement(1)) { ElementPointer& element2 = interactionVolume.getSubVolumeElement(1); - int globalIdx2 = problem_.variables().index(*element2); + int eIdxGlobal2 = problem_.variables().index(*element2); if (interactionVolume.hasSubVolumeElement(2) && interactionVolume.hasSubVolumeElement(3)) { interactionVolume.setOutsideFace(4); @@ -1907,13 +1907,13 @@ void FvMpfaL3dInteractionVolumeContainer<TypeTag>::storeBoundaryInteractionVolum interactionVolume.setOutsideFace(7); ElementPointer& element3 = interactionVolume.getSubVolumeElement(2); - int globalIdx3 = problem_.variables().index(*element3); + int eIdxGlobal3 = problem_.variables().index(*element3); ElementPointer& element4 = interactionVolume.getSubVolumeElement(3); - int globalIdx4 = problem_.variables().index(*element4); - interactionVolume.setFaceArea(getRealFaceArea(interactionVolume, globalIdx1, 0, 2)/4.0, 8); - interactionVolume.setFaceArea(getRealFaceArea(interactionVolume, globalIdx2, 1, 2)/4.0, 9); - interactionVolume.setFaceArea(getRealFaceArea(interactionVolume, globalIdx3, 2, 2)/4.0, 10); - interactionVolume.setFaceArea(getRealFaceArea(interactionVolume, globalIdx4, 3, 2)/4.0, 11); + int eIdxGlobal4 = problem_.variables().index(*element4); + interactionVolume.setFaceArea(getRealFaceArea(interactionVolume, eIdxGlobal1, 0, 2)/4.0, 8); + interactionVolume.setFaceArea(getRealFaceArea(interactionVolume, eIdxGlobal2, 1, 2)/4.0, 9); + interactionVolume.setFaceArea(getRealFaceArea(interactionVolume, eIdxGlobal3, 2, 2)/4.0, 10); + interactionVolume.setFaceArea(getRealFaceArea(interactionVolume, eIdxGlobal4, 3, 2)/4.0, 11); return; } @@ -1925,13 +1925,13 @@ void FvMpfaL3dInteractionVolumeContainer<TypeTag>::storeBoundaryInteractionVolum interactionVolume.setOutsideFace(11); ElementPointer& element3 = interactionVolume.getSubVolumeElement(4); - int globalIdx3 = problem_.variables().index(*element3); + int eIdxGlobal3 = problem_.variables().index(*element3); ElementPointer& element4 = interactionVolume.getSubVolumeElement(5); - int globalIdx4 = problem_.variables().index(*element4); - interactionVolume.setFaceArea(getRealFaceArea(interactionVolume, globalIdx1, 0, 1)/4.0, 3); - interactionVolume.setFaceArea(getRealFaceArea(interactionVolume, globalIdx2, 1, 0)/4.0, 1); - interactionVolume.setFaceArea(getRealFaceArea(interactionVolume, globalIdx3, 4, 2)/4.0, 7); - interactionVolume.setFaceArea(getRealFaceArea(interactionVolume, globalIdx4, 5, 1)/4.0, 5); + int eIdxGlobal4 = problem_.variables().index(*element4); + interactionVolume.setFaceArea(getRealFaceArea(interactionVolume, eIdxGlobal1, 0, 1)/4.0, 3); + interactionVolume.setFaceArea(getRealFaceArea(interactionVolume, eIdxGlobal2, 1, 0)/4.0, 1); + interactionVolume.setFaceArea(getRealFaceArea(interactionVolume, eIdxGlobal3, 4, 2)/4.0, 7); + interactionVolume.setFaceArea(getRealFaceArea(interactionVolume, eIdxGlobal4, 5, 1)/4.0, 5); return; } @@ -1945,15 +1945,15 @@ void FvMpfaL3dInteractionVolumeContainer<TypeTag>::storeBoundaryInteractionVolum interactionVolume.setOutsideFace(10); ElementPointer& element2 = interactionVolume.getSubVolumeElement(2); - int globalIdx2 = problem_.variables().index(*element2); + int eIdxGlobal2 = problem_.variables().index(*element2); ElementPointer& element3 = interactionVolume.getSubVolumeElement(4); - int globalIdx3 = problem_.variables().index(*element3); + int eIdxGlobal3 = problem_.variables().index(*element3); ElementPointer& element4 = interactionVolume.getSubVolumeElement(6); - int globalIdx4 = problem_.variables().index(*element4); - interactionVolume.setFaceArea(getRealFaceArea(interactionVolume, globalIdx1, 0, 0)/4.0, 0); - interactionVolume.setFaceArea(getRealFaceArea(interactionVolume, globalIdx2, 2, 1)/4.0, 2); - interactionVolume.setFaceArea(getRealFaceArea(interactionVolume, globalIdx3, 4, 1)/4.0, 4); - interactionVolume.setFaceArea(getRealFaceArea(interactionVolume, globalIdx4, 6, 2)/4.0, 6); + int eIdxGlobal4 = problem_.variables().index(*element4); + interactionVolume.setFaceArea(getRealFaceArea(interactionVolume, eIdxGlobal1, 0, 0)/4.0, 0); + interactionVolume.setFaceArea(getRealFaceArea(interactionVolume, eIdxGlobal2, 2, 1)/4.0, 2); + interactionVolume.setFaceArea(getRealFaceArea(interactionVolume, eIdxGlobal3, 4, 1)/4.0, 4); + interactionVolume.setFaceArea(getRealFaceArea(interactionVolume, eIdxGlobal4, 6, 2)/4.0, 6); return; } @@ -1961,11 +1961,11 @@ void FvMpfaL3dInteractionVolumeContainer<TypeTag>::storeBoundaryInteractionVolum if (interactionVolume.hasSubVolumeElement(7)) { ElementPointer& element1 = interactionVolume.getSubVolumeElement(7); - int globalIdx1 = problem_.variables().index(*element1); + int eIdxGlobal1 = problem_.variables().index(*element1); if (interactionVolume.hasSubVolumeElement(5)) { ElementPointer& element2 = interactionVolume.getSubVolumeElement(5); - int globalIdx2 = problem_.variables().index(*element2); + int eIdxGlobal2 = problem_.variables().index(*element2); if (interactionVolume.hasSubVolumeElement(1) && interactionVolume.hasSubVolumeElement(3)) { interactionVolume.setOutsideFace(3); @@ -1974,13 +1974,13 @@ void FvMpfaL3dInteractionVolumeContainer<TypeTag>::storeBoundaryInteractionVolum interactionVolume.setOutsideFace(11); ElementPointer& element3 = interactionVolume.getSubVolumeElement(1); - int globalIdx3 = problem_.variables().index(*element3); + int eIdxGlobal3 = problem_.variables().index(*element3); ElementPointer& element4 = interactionVolume.getSubVolumeElement(3); - int globalIdx4 = problem_.variables().index(*element4); - interactionVolume.setFaceArea(getRealFaceArea(interactionVolume, globalIdx1, 7, 1)/4.0, 6); - interactionVolume.setFaceArea(getRealFaceArea(interactionVolume, globalIdx2, 5, 2)/4.0, 4); - interactionVolume.setFaceArea(getRealFaceArea(interactionVolume, globalIdx3, 1, 1)/4.0, 0); - interactionVolume.setFaceArea(getRealFaceArea(interactionVolume, globalIdx4, 3, 0)/4.0, 2); + int eIdxGlobal4 = problem_.variables().index(*element4); + interactionVolume.setFaceArea(getRealFaceArea(interactionVolume, eIdxGlobal1, 7, 1)/4.0, 6); + interactionVolume.setFaceArea(getRealFaceArea(interactionVolume, eIdxGlobal2, 5, 2)/4.0, 4); + interactionVolume.setFaceArea(getRealFaceArea(interactionVolume, eIdxGlobal3, 1, 1)/4.0, 0); + interactionVolume.setFaceArea(getRealFaceArea(interactionVolume, eIdxGlobal4, 3, 0)/4.0, 2); return; } @@ -1992,13 +1992,13 @@ void FvMpfaL3dInteractionVolumeContainer<TypeTag>::storeBoundaryInteractionVolum interactionVolume.setOutsideFace(3); ElementPointer& element3 = interactionVolume.getSubVolumeElement(4); - int globalIdx3 = problem_.variables().index(*element3); + int eIdxGlobal3 = problem_.variables().index(*element3); ElementPointer& element4 = interactionVolume.getSubVolumeElement(6); - int globalIdx4 = problem_.variables().index(*element4); - interactionVolume.setFaceArea(getRealFaceArea(interactionVolume, globalIdx1, 7, 0)/4.0, 10); - interactionVolume.setFaceArea(getRealFaceArea(interactionVolume, globalIdx2, 5, 0)/4.0, 9); - interactionVolume.setFaceArea(getRealFaceArea(interactionVolume, globalIdx3, 4, 0)/4.0, 8); - interactionVolume.setFaceArea(getRealFaceArea(interactionVolume, globalIdx4, 6, 0)/4.0, 11); + int eIdxGlobal4 = problem_.variables().index(*element4); + interactionVolume.setFaceArea(getRealFaceArea(interactionVolume, eIdxGlobal1, 7, 0)/4.0, 10); + interactionVolume.setFaceArea(getRealFaceArea(interactionVolume, eIdxGlobal2, 5, 0)/4.0, 9); + interactionVolume.setFaceArea(getRealFaceArea(interactionVolume, eIdxGlobal3, 4, 0)/4.0, 8); + interactionVolume.setFaceArea(getRealFaceArea(interactionVolume, eIdxGlobal4, 6, 0)/4.0, 11); return; } @@ -2012,15 +2012,15 @@ void FvMpfaL3dInteractionVolumeContainer<TypeTag>::storeBoundaryInteractionVolum interactionVolume.setOutsideFace(9); ElementPointer& element2 = interactionVolume.getSubVolumeElement(6); - int globalIdx2 = problem_.variables().index(*element2); + int eIdxGlobal2 = problem_.variables().index(*element2); ElementPointer& element3 = interactionVolume.getSubVolumeElement(2); - int globalIdx3 = problem_.variables().index(*element3); + int eIdxGlobal3 = problem_.variables().index(*element3); ElementPointer& element4 = interactionVolume.getSubVolumeElement(3); - int globalIdx4 = problem_.variables().index(*element4); - interactionVolume.setFaceArea(getRealFaceArea(interactionVolume, globalIdx1, 7, 2)/4.0, 5); - interactionVolume.setFaceArea(getRealFaceArea(interactionVolume, globalIdx2, 6, 1)/4.0, 7); - interactionVolume.setFaceArea(getRealFaceArea(interactionVolume, globalIdx3, 2, 0)/4.0, 3); - interactionVolume.setFaceArea(getRealFaceArea(interactionVolume, globalIdx4, 3, 1)/4.0, 1); + int eIdxGlobal4 = problem_.variables().index(*element4); + interactionVolume.setFaceArea(getRealFaceArea(interactionVolume, eIdxGlobal1, 7, 2)/4.0, 5); + interactionVolume.setFaceArea(getRealFaceArea(interactionVolume, eIdxGlobal2, 6, 1)/4.0, 7); + interactionVolume.setFaceArea(getRealFaceArea(interactionVolume, eIdxGlobal3, 2, 0)/4.0, 3); + interactionVolume.setFaceArea(getRealFaceArea(interactionVolume, eIdxGlobal4, 3, 1)/4.0, 1); return; } @@ -2098,39 +2098,39 @@ void FvMpfaL3dInteractionVolumeContainer<TypeTag>::storeInteractionVolumeInfo() ElementPointer& elementPointer7 = interactionVolume.getSubVolumeElement(6); ElementPointer& elementPointer8 = interactionVolume.getSubVolumeElement(7); - int globalIdx1 = problem_.variables().index(*elementPointer1); - int globalIdx2 = problem_.variables().index(*elementPointer2); - int globalIdx3 = problem_.variables().index(*elementPointer3); - int globalIdx4 = problem_.variables().index(*elementPointer4); - int globalIdx5 = problem_.variables().index(*elementPointer5); - int globalIdx6 = problem_.variables().index(*elementPointer6); - int globalIdx7 = problem_.variables().index(*elementPointer7); - int globalIdx8 = problem_.variables().index(*elementPointer8); - - addRealFluxFaceArea_(interactionVolume.getFaceArea(0, 0), globalIdx1, interactionVolume.getIndexOnElement(0, 0)); - addRealFluxFaceArea_(interactionVolume.getFaceArea(0, 1), globalIdx1, interactionVolume.getIndexOnElement(0, 1)); - addRealFluxFaceArea_(interactionVolume.getFaceArea(0, 2), globalIdx1, interactionVolume.getIndexOnElement(0, 2)); - addRealFluxFaceArea_(interactionVolume.getFaceArea(1, 0), globalIdx2, interactionVolume.getIndexOnElement(1, 0)); - addRealFluxFaceArea_(interactionVolume.getFaceArea(1, 1), globalIdx2, interactionVolume.getIndexOnElement(1, 1)); - addRealFluxFaceArea_(interactionVolume.getFaceArea(1, 2), globalIdx2, interactionVolume.getIndexOnElement(1, 2)); - addRealFluxFaceArea_(interactionVolume.getFaceArea(2, 0), globalIdx3, interactionVolume.getIndexOnElement(2, 0)); - addRealFluxFaceArea_(interactionVolume.getFaceArea(2, 1), globalIdx3, interactionVolume.getIndexOnElement(2, 1)); - addRealFluxFaceArea_(interactionVolume.getFaceArea(2, 2), globalIdx3, interactionVolume.getIndexOnElement(2, 2)); - addRealFluxFaceArea_(interactionVolume.getFaceArea(3, 0), globalIdx4, interactionVolume.getIndexOnElement(3, 0)); - addRealFluxFaceArea_(interactionVolume.getFaceArea(3, 1), globalIdx4, interactionVolume.getIndexOnElement(3, 1)); - addRealFluxFaceArea_(interactionVolume.getFaceArea(3, 2), globalIdx4, interactionVolume.getIndexOnElement(3, 2)); - addRealFluxFaceArea_(interactionVolume.getFaceArea(4, 0), globalIdx5, interactionVolume.getIndexOnElement(4, 0)); - addRealFluxFaceArea_(interactionVolume.getFaceArea(4, 1), globalIdx5, interactionVolume.getIndexOnElement(4, 1)); - addRealFluxFaceArea_(interactionVolume.getFaceArea(4, 2), globalIdx5, interactionVolume.getIndexOnElement(4, 2)); - addRealFluxFaceArea_(interactionVolume.getFaceArea(5, 0), globalIdx6, interactionVolume.getIndexOnElement(5, 0)); - addRealFluxFaceArea_(interactionVolume.getFaceArea(5, 1), globalIdx6, interactionVolume.getIndexOnElement(5, 1)); - addRealFluxFaceArea_(interactionVolume.getFaceArea(5, 2), globalIdx6, interactionVolume.getIndexOnElement(5, 2)); - addRealFluxFaceArea_(interactionVolume.getFaceArea(6, 0), globalIdx7, interactionVolume.getIndexOnElement(6, 0)); - addRealFluxFaceArea_(interactionVolume.getFaceArea(6, 1), globalIdx7, interactionVolume.getIndexOnElement(6, 1)); - addRealFluxFaceArea_(interactionVolume.getFaceArea(6, 2), globalIdx7, interactionVolume.getIndexOnElement(6, 2)); - addRealFluxFaceArea_(interactionVolume.getFaceArea(7, 0), globalIdx8, interactionVolume.getIndexOnElement(7, 0)); - addRealFluxFaceArea_(interactionVolume.getFaceArea(7, 1), globalIdx8, interactionVolume.getIndexOnElement(7, 1)); - addRealFluxFaceArea_(interactionVolume.getFaceArea(7, 2), globalIdx8, interactionVolume.getIndexOnElement(7, 2)); + int eIdxGlobal1 = problem_.variables().index(*elementPointer1); + int eIdxGlobal2 = problem_.variables().index(*elementPointer2); + int eIdxGlobal3 = problem_.variables().index(*elementPointer3); + int eIdxGlobal4 = problem_.variables().index(*elementPointer4); + int eIdxGlobal5 = problem_.variables().index(*elementPointer5); + int eIdxGlobal6 = problem_.variables().index(*elementPointer6); + int eIdxGlobal7 = problem_.variables().index(*elementPointer7); + int eIdxGlobal8 = problem_.variables().index(*elementPointer8); + + addRealFluxFaceArea_(interactionVolume.getFaceArea(0, 0), eIdxGlobal1, interactionVolume.getIndexOnElement(0, 0)); + addRealFluxFaceArea_(interactionVolume.getFaceArea(0, 1), eIdxGlobal1, interactionVolume.getIndexOnElement(0, 1)); + addRealFluxFaceArea_(interactionVolume.getFaceArea(0, 2), eIdxGlobal1, interactionVolume.getIndexOnElement(0, 2)); + addRealFluxFaceArea_(interactionVolume.getFaceArea(1, 0), eIdxGlobal2, interactionVolume.getIndexOnElement(1, 0)); + addRealFluxFaceArea_(interactionVolume.getFaceArea(1, 1), eIdxGlobal2, interactionVolume.getIndexOnElement(1, 1)); + addRealFluxFaceArea_(interactionVolume.getFaceArea(1, 2), eIdxGlobal2, interactionVolume.getIndexOnElement(1, 2)); + addRealFluxFaceArea_(interactionVolume.getFaceArea(2, 0), eIdxGlobal3, interactionVolume.getIndexOnElement(2, 0)); + addRealFluxFaceArea_(interactionVolume.getFaceArea(2, 1), eIdxGlobal3, interactionVolume.getIndexOnElement(2, 1)); + addRealFluxFaceArea_(interactionVolume.getFaceArea(2, 2), eIdxGlobal3, interactionVolume.getIndexOnElement(2, 2)); + addRealFluxFaceArea_(interactionVolume.getFaceArea(3, 0), eIdxGlobal4, interactionVolume.getIndexOnElement(3, 0)); + addRealFluxFaceArea_(interactionVolume.getFaceArea(3, 1), eIdxGlobal4, interactionVolume.getIndexOnElement(3, 1)); + addRealFluxFaceArea_(interactionVolume.getFaceArea(3, 2), eIdxGlobal4, interactionVolume.getIndexOnElement(3, 2)); + addRealFluxFaceArea_(interactionVolume.getFaceArea(4, 0), eIdxGlobal5, interactionVolume.getIndexOnElement(4, 0)); + addRealFluxFaceArea_(interactionVolume.getFaceArea(4, 1), eIdxGlobal5, interactionVolume.getIndexOnElement(4, 1)); + addRealFluxFaceArea_(interactionVolume.getFaceArea(4, 2), eIdxGlobal5, interactionVolume.getIndexOnElement(4, 2)); + addRealFluxFaceArea_(interactionVolume.getFaceArea(5, 0), eIdxGlobal6, interactionVolume.getIndexOnElement(5, 0)); + addRealFluxFaceArea_(interactionVolume.getFaceArea(5, 1), eIdxGlobal6, interactionVolume.getIndexOnElement(5, 1)); + addRealFluxFaceArea_(interactionVolume.getFaceArea(5, 2), eIdxGlobal6, interactionVolume.getIndexOnElement(5, 2)); + addRealFluxFaceArea_(interactionVolume.getFaceArea(6, 0), eIdxGlobal7, interactionVolume.getIndexOnElement(6, 0)); + addRealFluxFaceArea_(interactionVolume.getFaceArea(6, 1), eIdxGlobal7, interactionVolume.getIndexOnElement(6, 1)); + addRealFluxFaceArea_(interactionVolume.getFaceArea(6, 2), eIdxGlobal7, interactionVolume.getIndexOnElement(6, 2)); + addRealFluxFaceArea_(interactionVolume.getFaceArea(7, 0), eIdxGlobal8, interactionVolume.getIndexOnElement(7, 0)); + addRealFluxFaceArea_(interactionVolume.getFaceArea(7, 1), eIdxGlobal8, interactionVolume.getIndexOnElement(7, 1)); + addRealFluxFaceArea_(interactionVolume.getFaceArea(7, 2), eIdxGlobal8, interactionVolume.getIndexOnElement(7, 2)); } } diff --git a/dumux/decoupled/2p/diffusion/fvmpfa/lmethod/fvmpfal3dpressure2p.hh b/dumux/decoupled/2p/diffusion/fvmpfa/lmethod/fvmpfal3dpressure2p.hh index 2e54fa7605711c7fafe06a36478fbe4f6f70bc5f..a9d27196e1231663bf4797c0a82083e04544009e 100644 --- a/dumux/decoupled/2p/diffusion/fvmpfa/lmethod/fvmpfal3dpressure2p.hh +++ b/dumux/decoupled/2p/diffusion/fvmpfa/lmethod/fvmpfal3dpressure2p.hh @@ -222,14 +222,14 @@ public: */ void storePressureSolution(const Element& element) { - int globalIdx = problem_.variables().index(element); - CellData& cellData = problem_.variables().cellData(globalIdx); + int eIdxGlobal = problem_.variables().index(element); + CellData& cellData = problem_.variables().cellData(eIdxGlobal); switch (pressureType_) { case pw: { - Scalar potW = this->pressure()[globalIdx]; + Scalar potW = this->pressure()[eIdxGlobal]; Scalar gravityDiff = (problem_.bBoxMax() - element.geometry().center()) * gravity_; Scalar potPc = cellData.capillaryPressure() @@ -247,7 +247,7 @@ public: } case pn: { - Scalar potNw = this->pressure()[globalIdx]; + Scalar potNw = this->pressure()[eIdxGlobal]; Scalar gravityDiff = (problem_.bBoxMax() - element.geometry().center()) * gravity_; Scalar potPc = cellData.capillaryPressure() @@ -560,7 +560,7 @@ void FvMpfaL3dPressure2p<TypeTag>::initializeMatrixRowSize() for (ElementIterator eIt = problem_.gridView().template begin<0>(); eIt != eEndIt; ++eIt) { // cell index - int globalIdxI = problem_.variables().index(*eIt); + int eIdxGlobalI = problem_.variables().index(*eIt); std::set<int> neighborIndices; @@ -577,14 +577,14 @@ void FvMpfaL3dPressure2p<TypeTag>::initializeMatrixRowSize() if (interactionVolume.hasSubVolumeElement(subVolumeIdx)) { const ElementPointer& neighbor = interactionVolume.getSubVolumeElement(subVolumeIdx); - int globalIdxJ = problem_.variables().index(*neighbor); + int eIdxGlobalJ = problem_.variables().index(*neighbor); - neighborIndices.insert(globalIdxJ); + neighborIndices.insert(eIdxGlobalJ); } } } - this->A_.setrowsize(globalIdxI, neighborIndices.size()); + this->A_.setrowsize(eIdxGlobalI, neighborIndices.size()); } // end of 'for' ElementIterator return; @@ -600,10 +600,10 @@ void FvMpfaL3dPressure2p<TypeTag>::initializeMatrixIndices() for (ElementIterator eIt = problem_.gridView().template begin<0>(); eIt != eEndIt; ++eIt) { // cell index - int globalIdxI = problem_.variables().index(*eIt); + int eIdxGlobalI = problem_.variables().index(*eIt); // add diagonal index - this->A_.addindex(globalIdxI, globalIdxI); + this->A_.addindex(eIdxGlobalI, eIdxGlobalI); int numVertices = eIt->geometry().corners(); @@ -617,9 +617,9 @@ void FvMpfaL3dPressure2p<TypeTag>::initializeMatrixIndices() if (interactionVolume.hasSubVolumeElement(subVolumeIdx)) { ElementPointer neighbor = interactionVolume.getSubVolumeElement(subVolumeIdx); - int globalIdxJ = problem_.variables().index(*neighbor); + int eIdxGlobalJ = problem_.variables().index(*neighbor); - this->A_.addindex(globalIdxI, globalIdxJ); + this->A_.addindex(eIdxGlobalI, eIdxGlobalJ); } } } @@ -694,24 +694,24 @@ void FvMpfaL3dPressure2p<TypeTag>::assembleInnerInteractionVolume(InteractionVol Scalar volume8 = elementPointer8->geometry().volume(); // cell index - int globalIdx1 = problem_.variables().index(*elementPointer1); - int globalIdx2 = problem_.variables().index(*elementPointer2); - int globalIdx3 = problem_.variables().index(*elementPointer3); - int globalIdx4 = problem_.variables().index(*elementPointer4); - int globalIdx5 = problem_.variables().index(*elementPointer5); - int globalIdx6 = problem_.variables().index(*elementPointer6); - int globalIdx7 = problem_.variables().index(*elementPointer7); - int globalIdx8 = problem_.variables().index(*elementPointer8); + int eIdxGlobal1 = problem_.variables().index(*elementPointer1); + int eIdxGlobal2 = problem_.variables().index(*elementPointer2); + int eIdxGlobal3 = problem_.variables().index(*elementPointer3); + int eIdxGlobal4 = problem_.variables().index(*elementPointer4); + int eIdxGlobal5 = problem_.variables().index(*elementPointer5); + int eIdxGlobal6 = problem_.variables().index(*elementPointer6); + int eIdxGlobal7 = problem_.variables().index(*elementPointer7); + int eIdxGlobal8 = problem_.variables().index(*elementPointer8); //get the cell Data - CellData& cellData1 = problem_.variables().cellData(globalIdx1); - CellData& cellData2 = problem_.variables().cellData(globalIdx2); - CellData& cellData3 = problem_.variables().cellData(globalIdx3); - CellData& cellData4 = problem_.variables().cellData(globalIdx4); - CellData& cellData5 = problem_.variables().cellData(globalIdx5); - CellData& cellData6 = problem_.variables().cellData(globalIdx6); - CellData& cellData7 = problem_.variables().cellData(globalIdx7); - CellData& cellData8 = problem_.variables().cellData(globalIdx8); + CellData& cellData1 = problem_.variables().cellData(eIdxGlobal1); + CellData& cellData2 = problem_.variables().cellData(eIdxGlobal2); + CellData& cellData3 = problem_.variables().cellData(eIdxGlobal3); + CellData& cellData4 = problem_.variables().cellData(eIdxGlobal4); + CellData& cellData5 = problem_.variables().cellData(eIdxGlobal5); + CellData& cellData6 = problem_.variables().cellData(eIdxGlobal6); + CellData& cellData7 = problem_.variables().cellData(eIdxGlobal7); + CellData& cellData8 = problem_.variables().cellData(eIdxGlobal8); // get mobilities of the phases Dune::FieldVector<Scalar, numPhases> lambda1(cellData1.mobility(wPhaseIdx)); @@ -839,38 +839,38 @@ void FvMpfaL3dPressure2p<TypeTag>::assembleInnerInteractionVolume(InteractionVol // evaluate right hand side PrimaryVariables source(0.0); problem_.source(source, *elementPointer1); - this->f_[globalIdx1] += volume1 / (8.0) + this->f_[eIdxGlobal1] += volume1 / (8.0) * (source[wPhaseIdx] / density_[wPhaseIdx] + source[nPhaseIdx] / density_[nPhaseIdx]); problem_.source(source, *elementPointer2); - this->f_[globalIdx2] += volume2 / (8.0) + this->f_[eIdxGlobal2] += volume2 / (8.0) * (source[wPhaseIdx] / density_[wPhaseIdx] + source[nPhaseIdx] / density_[nPhaseIdx]); problem_.source(source, *elementPointer3); - this->f_[globalIdx3] += volume3 / (8.0) + this->f_[eIdxGlobal3] += volume3 / (8.0) * (source[wPhaseIdx] / density_[wPhaseIdx] + source[nPhaseIdx] / density_[nPhaseIdx]); problem_.source(source, *elementPointer4); - this->f_[globalIdx4] += volume4 / (8.0) + this->f_[eIdxGlobal4] += volume4 / (8.0) * (source[wPhaseIdx] / density_[wPhaseIdx] + source[nPhaseIdx] / density_[nPhaseIdx]); problem_.source(source, *elementPointer5); - this->f_[globalIdx5] += volume5 / (8.0) + this->f_[eIdxGlobal5] += volume5 / (8.0) * (source[wPhaseIdx] / density_[wPhaseIdx] + source[nPhaseIdx] / density_[nPhaseIdx]); problem_.source(source, *elementPointer6); - this->f_[globalIdx6] += volume6 / (8.0) + this->f_[eIdxGlobal6] += volume6 / (8.0) * (source[wPhaseIdx] / density_[wPhaseIdx] + source[nPhaseIdx] / density_[nPhaseIdx]); problem_.source(source, *elementPointer7); - this->f_[globalIdx7] += volume7 / (8.0) + this->f_[eIdxGlobal7] += volume7 / (8.0) * (source[wPhaseIdx] / density_[wPhaseIdx] + source[nPhaseIdx] / density_[nPhaseIdx]); problem_.source(source, *elementPointer8); - this->f_[globalIdx8] += volume8 / (8.0) + this->f_[eIdxGlobal8] += volume8 / (8.0) * (source[wPhaseIdx] / density_[wPhaseIdx] + source[nPhaseIdx] / density_[nPhaseIdx]); - this->f_[globalIdx1] += evaluateErrorTerm(cellData1) * volume1 / (8.0); - this->f_[globalIdx2] += evaluateErrorTerm(cellData2) * volume2 / (8.0); - this->f_[globalIdx3] += evaluateErrorTerm(cellData3) * volume3 / (8.0); - this->f_[globalIdx4] += evaluateErrorTerm(cellData4) * volume4 / (8.0); - this->f_[globalIdx5] += evaluateErrorTerm(cellData5) * volume5 / (8.0); - this->f_[globalIdx6] += evaluateErrorTerm(cellData6) * volume6 / (8.0); - this->f_[globalIdx7] += evaluateErrorTerm(cellData7) * volume7 / (8.0); - this->f_[globalIdx8] += evaluateErrorTerm(cellData8) * volume8 / (8.0); + this->f_[eIdxGlobal1] += evaluateErrorTerm(cellData1) * volume1 / (8.0); + this->f_[eIdxGlobal2] += evaluateErrorTerm(cellData2) * volume2 / (8.0); + this->f_[eIdxGlobal3] += evaluateErrorTerm(cellData3) * volume3 / (8.0); + this->f_[eIdxGlobal4] += evaluateErrorTerm(cellData4) * volume4 / (8.0); + this->f_[eIdxGlobal5] += evaluateErrorTerm(cellData5) * volume5 / (8.0); + this->f_[eIdxGlobal6] += evaluateErrorTerm(cellData6) * volume6 / (8.0); + this->f_[eIdxGlobal7] += evaluateErrorTerm(cellData7) * volume7 / (8.0); + this->f_[eIdxGlobal8] += evaluateErrorTerm(cellData8) * volume8 / (8.0); DimVector Tu(0); Dune::FieldVector<Scalar, 2 * dim - dim + 1> u(0); @@ -882,20 +882,20 @@ void FvMpfaL3dPressure2p<TypeTag>::assembleInnerInteractionVolume(InteractionVol 5); TSecond = T; - T *= interactionVolumes_.faceAreaFactor(interactionVolume, globalIdx1, 0, 0); - TSecond *= interactionVolumes_.faceAreaFactor(interactionVolume, globalIdx2, 1, 1); + T *= interactionVolumes_.faceAreaFactor(interactionVolume, eIdxGlobal1, 0, 0); + TSecond *= interactionVolumes_.faceAreaFactor(interactionVolume, eIdxGlobal2, 1, 1); if (caseL == 1) { - this->A_[globalIdx1][globalIdx1] += T[0][0]; - this->A_[globalIdx1][globalIdx2] += T[0][1]; - this->A_[globalIdx1][globalIdx3] += T[0][2]; - this->A_[globalIdx1][globalIdx5] += T[0][3]; + this->A_[eIdxGlobal1][eIdxGlobal1] += T[0][0]; + this->A_[eIdxGlobal1][eIdxGlobal2] += T[0][1]; + this->A_[eIdxGlobal1][eIdxGlobal3] += T[0][2]; + this->A_[eIdxGlobal1][eIdxGlobal5] += T[0][3]; - this->A_[globalIdx2][globalIdx1] -= TSecond[0][0]; - this->A_[globalIdx2][globalIdx2] -= TSecond[0][1]; - this->A_[globalIdx2][globalIdx3] -= TSecond[0][2]; - this->A_[globalIdx2][globalIdx5] -= TSecond[0][3]; + this->A_[eIdxGlobal2][eIdxGlobal1] -= TSecond[0][0]; + this->A_[eIdxGlobal2][eIdxGlobal2] -= TSecond[0][1]; + this->A_[eIdxGlobal2][eIdxGlobal3] -= TSecond[0][2]; + this->A_[eIdxGlobal2][eIdxGlobal5] -= TSecond[0][3]; u[0] = pc[0]; u[1] = pc[1]; @@ -912,15 +912,15 @@ void FvMpfaL3dPressure2p<TypeTag>::assembleInnerInteractionVolume(InteractionVol } else if (caseL == 2) { - this->A_[globalIdx1][globalIdx1] += T[0][0]; - this->A_[globalIdx1][globalIdx2] += T[0][1]; - this->A_[globalIdx1][globalIdx4] += T[0][2]; - this->A_[globalIdx1][globalIdx6] += T[0][3]; + this->A_[eIdxGlobal1][eIdxGlobal1] += T[0][0]; + this->A_[eIdxGlobal1][eIdxGlobal2] += T[0][1]; + this->A_[eIdxGlobal1][eIdxGlobal4] += T[0][2]; + this->A_[eIdxGlobal1][eIdxGlobal6] += T[0][3]; - this->A_[globalIdx2][globalIdx1] -= TSecond[0][0]; - this->A_[globalIdx2][globalIdx2] -= TSecond[0][1]; - this->A_[globalIdx2][globalIdx4] -= TSecond[0][2]; - this->A_[globalIdx2][globalIdx6] -= TSecond[0][3]; + this->A_[eIdxGlobal2][eIdxGlobal1] -= TSecond[0][0]; + this->A_[eIdxGlobal2][eIdxGlobal2] -= TSecond[0][1]; + this->A_[eIdxGlobal2][eIdxGlobal4] -= TSecond[0][2]; + this->A_[eIdxGlobal2][eIdxGlobal6] -= TSecond[0][3]; u[0] = pc[0]; u[1] = pc[1]; @@ -936,15 +936,15 @@ void FvMpfaL3dPressure2p<TypeTag>::assembleInnerInteractionVolume(InteractionVol } else if (caseL == 3) { - this->A_[globalIdx1][globalIdx1] += T[0][0]; - this->A_[globalIdx1][globalIdx2] += T[0][1]; - this->A_[globalIdx1][globalIdx4] += T[0][2]; - this->A_[globalIdx1][globalIdx5] += T[0][3]; + this->A_[eIdxGlobal1][eIdxGlobal1] += T[0][0]; + this->A_[eIdxGlobal1][eIdxGlobal2] += T[0][1]; + this->A_[eIdxGlobal1][eIdxGlobal4] += T[0][2]; + this->A_[eIdxGlobal1][eIdxGlobal5] += T[0][3]; - this->A_[globalIdx2][globalIdx1] -= TSecond[0][0]; - this->A_[globalIdx2][globalIdx2] -= TSecond[0][1]; - this->A_[globalIdx2][globalIdx4] -= TSecond[0][2]; - this->A_[globalIdx2][globalIdx5] -= TSecond[0][3]; + this->A_[eIdxGlobal2][eIdxGlobal1] -= TSecond[0][0]; + this->A_[eIdxGlobal2][eIdxGlobal2] -= TSecond[0][1]; + this->A_[eIdxGlobal2][eIdxGlobal4] -= TSecond[0][2]; + this->A_[eIdxGlobal2][eIdxGlobal5] -= TSecond[0][3]; u[0] = pc[0]; u[1] = pc[1]; @@ -960,15 +960,15 @@ void FvMpfaL3dPressure2p<TypeTag>::assembleInnerInteractionVolume(InteractionVol } else { - this->A_[globalIdx1][globalIdx1] += T[0][0]; - this->A_[globalIdx1][globalIdx2] += T[0][1]; - this->A_[globalIdx1][globalIdx3] += T[0][2]; - this->A_[globalIdx1][globalIdx6] += T[0][3]; + this->A_[eIdxGlobal1][eIdxGlobal1] += T[0][0]; + this->A_[eIdxGlobal1][eIdxGlobal2] += T[0][1]; + this->A_[eIdxGlobal1][eIdxGlobal3] += T[0][2]; + this->A_[eIdxGlobal1][eIdxGlobal6] += T[0][3]; - this->A_[globalIdx2][globalIdx1] -= TSecond[0][0]; - this->A_[globalIdx2][globalIdx2] -= TSecond[0][1]; - this->A_[globalIdx2][globalIdx3] -= TSecond[0][2]; - this->A_[globalIdx2][globalIdx6] -= TSecond[0][3]; + this->A_[eIdxGlobal2][eIdxGlobal1] -= TSecond[0][0]; + this->A_[eIdxGlobal2][eIdxGlobal2] -= TSecond[0][1]; + this->A_[eIdxGlobal2][eIdxGlobal3] -= TSecond[0][2]; + this->A_[eIdxGlobal2][eIdxGlobal6] -= TSecond[0][3]; u[0] = pc[0]; u[1] = pc[1]; @@ -987,20 +987,20 @@ void FvMpfaL3dPressure2p<TypeTag>::assembleInnerInteractionVolume(InteractionVol caseL = transmissibilityCalculator_.transmissibility(T, interactionVolume, lambda, 1, 3, 0, 2, 5, 7); TSecond = T; - T *= interactionVolumes_.faceAreaFactor(interactionVolume, globalIdx2, 1, 0); - TSecond *= interactionVolumes_.faceAreaFactor(interactionVolume, globalIdx4, 3, 1); + T *= interactionVolumes_.faceAreaFactor(interactionVolume, eIdxGlobal2, 1, 0); + TSecond *= interactionVolumes_.faceAreaFactor(interactionVolume, eIdxGlobal4, 3, 1); if (caseL == 1) { - this->A_[globalIdx2][globalIdx2] += T[0][0]; - this->A_[globalIdx2][globalIdx4] += T[0][1]; - this->A_[globalIdx2][globalIdx1] += T[0][2]; - this->A_[globalIdx2][globalIdx6] += T[0][3]; + this->A_[eIdxGlobal2][eIdxGlobal2] += T[0][0]; + this->A_[eIdxGlobal2][eIdxGlobal4] += T[0][1]; + this->A_[eIdxGlobal2][eIdxGlobal1] += T[0][2]; + this->A_[eIdxGlobal2][eIdxGlobal6] += T[0][3]; - this->A_[globalIdx4][globalIdx2] -= TSecond[0][0]; - this->A_[globalIdx4][globalIdx4] -= TSecond[0][1]; - this->A_[globalIdx4][globalIdx1] -= TSecond[0][2]; - this->A_[globalIdx4][globalIdx6] -= TSecond[0][3]; + this->A_[eIdxGlobal4][eIdxGlobal2] -= TSecond[0][0]; + this->A_[eIdxGlobal4][eIdxGlobal4] -= TSecond[0][1]; + this->A_[eIdxGlobal4][eIdxGlobal1] -= TSecond[0][2]; + this->A_[eIdxGlobal4][eIdxGlobal6] -= TSecond[0][3]; u[0] = pc[1]; u[1] = pc[3]; @@ -1016,15 +1016,15 @@ void FvMpfaL3dPressure2p<TypeTag>::assembleInnerInteractionVolume(InteractionVol } else if (caseL == 2) { - this->A_[globalIdx2][globalIdx2] += T[0][0]; - this->A_[globalIdx2][globalIdx4] += T[0][1]; - this->A_[globalIdx2][globalIdx3] += T[0][2]; - this->A_[globalIdx2][globalIdx8] += T[0][3]; + this->A_[eIdxGlobal2][eIdxGlobal2] += T[0][0]; + this->A_[eIdxGlobal2][eIdxGlobal4] += T[0][1]; + this->A_[eIdxGlobal2][eIdxGlobal3] += T[0][2]; + this->A_[eIdxGlobal2][eIdxGlobal8] += T[0][3]; - this->A_[globalIdx4][globalIdx2] -= TSecond[0][0]; - this->A_[globalIdx4][globalIdx4] -= TSecond[0][1]; - this->A_[globalIdx4][globalIdx3] -= TSecond[0][2]; - this->A_[globalIdx4][globalIdx8] -= TSecond[0][3]; + this->A_[eIdxGlobal4][eIdxGlobal2] -= TSecond[0][0]; + this->A_[eIdxGlobal4][eIdxGlobal4] -= TSecond[0][1]; + this->A_[eIdxGlobal4][eIdxGlobal3] -= TSecond[0][2]; + this->A_[eIdxGlobal4][eIdxGlobal8] -= TSecond[0][3]; u[0] = pc[1]; u[1] = pc[3]; @@ -1040,15 +1040,15 @@ void FvMpfaL3dPressure2p<TypeTag>::assembleInnerInteractionVolume(InteractionVol } else if (caseL == 3) { - this->A_[globalIdx2][globalIdx2] += T[0][0]; - this->A_[globalIdx2][globalIdx4] += T[0][1]; - this->A_[globalIdx2][globalIdx3] += T[0][2]; - this->A_[globalIdx2][globalIdx6] += T[0][3]; + this->A_[eIdxGlobal2][eIdxGlobal2] += T[0][0]; + this->A_[eIdxGlobal2][eIdxGlobal4] += T[0][1]; + this->A_[eIdxGlobal2][eIdxGlobal3] += T[0][2]; + this->A_[eIdxGlobal2][eIdxGlobal6] += T[0][3]; - this->A_[globalIdx4][globalIdx2] -= TSecond[0][0]; - this->A_[globalIdx4][globalIdx4] -= TSecond[0][1]; - this->A_[globalIdx4][globalIdx3] -= TSecond[0][2]; - this->A_[globalIdx4][globalIdx6] -= TSecond[0][3]; + this->A_[eIdxGlobal4][eIdxGlobal2] -= TSecond[0][0]; + this->A_[eIdxGlobal4][eIdxGlobal4] -= TSecond[0][1]; + this->A_[eIdxGlobal4][eIdxGlobal3] -= TSecond[0][2]; + this->A_[eIdxGlobal4][eIdxGlobal6] -= TSecond[0][3]; u[0] = pc[1]; u[1] = pc[3]; @@ -1064,15 +1064,15 @@ void FvMpfaL3dPressure2p<TypeTag>::assembleInnerInteractionVolume(InteractionVol } else { - this->A_[globalIdx2][globalIdx2] += T[0][0]; - this->A_[globalIdx2][globalIdx4] += T[0][1]; - this->A_[globalIdx2][globalIdx1] += T[0][2]; - this->A_[globalIdx2][globalIdx8] += T[0][3]; + this->A_[eIdxGlobal2][eIdxGlobal2] += T[0][0]; + this->A_[eIdxGlobal2][eIdxGlobal4] += T[0][1]; + this->A_[eIdxGlobal2][eIdxGlobal1] += T[0][2]; + this->A_[eIdxGlobal2][eIdxGlobal8] += T[0][3]; - this->A_[globalIdx4][globalIdx2] -= TSecond[0][0]; - this->A_[globalIdx4][globalIdx4] -= TSecond[0][1]; - this->A_[globalIdx4][globalIdx1] -= TSecond[0][2]; - this->A_[globalIdx4][globalIdx8] -= TSecond[0][3]; + this->A_[eIdxGlobal4][eIdxGlobal2] -= TSecond[0][0]; + this->A_[eIdxGlobal4][eIdxGlobal4] -= TSecond[0][1]; + this->A_[eIdxGlobal4][eIdxGlobal1] -= TSecond[0][2]; + this->A_[eIdxGlobal4][eIdxGlobal8] -= TSecond[0][3]; u[0] = pc[1]; u[1] = pc[3]; @@ -1091,20 +1091,20 @@ void FvMpfaL3dPressure2p<TypeTag>::assembleInnerInteractionVolume(InteractionVol caseL = transmissibilityCalculator_.transmissibility(T, interactionVolume, lambda, 3, 2, 1, 0, 7, 6); TSecond = T; - T *= interactionVolumes_.faceAreaFactor(interactionVolume, globalIdx4, 3, 0); - TSecond *= interactionVolumes_.faceAreaFactor(interactionVolume, globalIdx3, 2, 1); + T *= interactionVolumes_.faceAreaFactor(interactionVolume, eIdxGlobal4, 3, 0); + TSecond *= interactionVolumes_.faceAreaFactor(interactionVolume, eIdxGlobal3, 2, 1); if (caseL == 1) { - this->A_[globalIdx4][globalIdx4] += T[0][0]; - this->A_[globalIdx4][globalIdx3] += T[0][1]; - this->A_[globalIdx4][globalIdx2] += T[0][2]; - this->A_[globalIdx4][globalIdx8] += T[0][3]; + this->A_[eIdxGlobal4][eIdxGlobal4] += T[0][0]; + this->A_[eIdxGlobal4][eIdxGlobal3] += T[0][1]; + this->A_[eIdxGlobal4][eIdxGlobal2] += T[0][2]; + this->A_[eIdxGlobal4][eIdxGlobal8] += T[0][3]; - this->A_[globalIdx3][globalIdx4] -= TSecond[0][0]; - this->A_[globalIdx3][globalIdx3] -= TSecond[0][1]; - this->A_[globalIdx3][globalIdx2] -= TSecond[0][2]; - this->A_[globalIdx3][globalIdx8] -= TSecond[0][3]; + this->A_[eIdxGlobal3][eIdxGlobal4] -= TSecond[0][0]; + this->A_[eIdxGlobal3][eIdxGlobal3] -= TSecond[0][1]; + this->A_[eIdxGlobal3][eIdxGlobal2] -= TSecond[0][2]; + this->A_[eIdxGlobal3][eIdxGlobal8] -= TSecond[0][3]; u[0] = pc[3]; u[1] = pc[2]; @@ -1120,15 +1120,15 @@ void FvMpfaL3dPressure2p<TypeTag>::assembleInnerInteractionVolume(InteractionVol } else if (caseL == 2) { - this->A_[globalIdx4][globalIdx4] += T[0][0]; - this->A_[globalIdx4][globalIdx3] += T[0][1]; - this->A_[globalIdx4][globalIdx1] += T[0][2]; - this->A_[globalIdx4][globalIdx7] += T[0][3]; + this->A_[eIdxGlobal4][eIdxGlobal4] += T[0][0]; + this->A_[eIdxGlobal4][eIdxGlobal3] += T[0][1]; + this->A_[eIdxGlobal4][eIdxGlobal1] += T[0][2]; + this->A_[eIdxGlobal4][eIdxGlobal7] += T[0][3]; - this->A_[globalIdx3][globalIdx4] -= TSecond[0][0]; - this->A_[globalIdx3][globalIdx3] -= TSecond[0][1]; - this->A_[globalIdx3][globalIdx1] -= TSecond[0][2]; - this->A_[globalIdx3][globalIdx7] -= TSecond[0][3]; + this->A_[eIdxGlobal3][eIdxGlobal4] -= TSecond[0][0]; + this->A_[eIdxGlobal3][eIdxGlobal3] -= TSecond[0][1]; + this->A_[eIdxGlobal3][eIdxGlobal1] -= TSecond[0][2]; + this->A_[eIdxGlobal3][eIdxGlobal7] -= TSecond[0][3]; u[0] = pc[3]; u[1] = pc[2]; @@ -1144,15 +1144,15 @@ void FvMpfaL3dPressure2p<TypeTag>::assembleInnerInteractionVolume(InteractionVol } else if (caseL == 3) { - this->A_[globalIdx4][globalIdx4] += T[0][0]; - this->A_[globalIdx4][globalIdx3] += T[0][1]; - this->A_[globalIdx4][globalIdx1] += T[0][2]; - this->A_[globalIdx4][globalIdx8] += T[0][3]; + this->A_[eIdxGlobal4][eIdxGlobal4] += T[0][0]; + this->A_[eIdxGlobal4][eIdxGlobal3] += T[0][1]; + this->A_[eIdxGlobal4][eIdxGlobal1] += T[0][2]; + this->A_[eIdxGlobal4][eIdxGlobal8] += T[0][3]; - this->A_[globalIdx3][globalIdx4] -= TSecond[0][0]; - this->A_[globalIdx3][globalIdx3] -= TSecond[0][1]; - this->A_[globalIdx3][globalIdx1] -= TSecond[0][2]; - this->A_[globalIdx3][globalIdx8] -= TSecond[0][3]; + this->A_[eIdxGlobal3][eIdxGlobal4] -= TSecond[0][0]; + this->A_[eIdxGlobal3][eIdxGlobal3] -= TSecond[0][1]; + this->A_[eIdxGlobal3][eIdxGlobal1] -= TSecond[0][2]; + this->A_[eIdxGlobal3][eIdxGlobal8] -= TSecond[0][3]; u[0] = pc[3]; u[1] = pc[2]; @@ -1168,15 +1168,15 @@ void FvMpfaL3dPressure2p<TypeTag>::assembleInnerInteractionVolume(InteractionVol } else { - this->A_[globalIdx4][globalIdx4] += T[0][0]; - this->A_[globalIdx4][globalIdx3] += T[0][1]; - this->A_[globalIdx4][globalIdx2] += T[0][2]; - this->A_[globalIdx4][globalIdx7] += T[0][3]; + this->A_[eIdxGlobal4][eIdxGlobal4] += T[0][0]; + this->A_[eIdxGlobal4][eIdxGlobal3] += T[0][1]; + this->A_[eIdxGlobal4][eIdxGlobal2] += T[0][2]; + this->A_[eIdxGlobal4][eIdxGlobal7] += T[0][3]; - this->A_[globalIdx3][globalIdx4] -= TSecond[0][0]; - this->A_[globalIdx3][globalIdx3] -= TSecond[0][1]; - this->A_[globalIdx3][globalIdx2] -= TSecond[0][2]; - this->A_[globalIdx3][globalIdx7] -= TSecond[0][3]; + this->A_[eIdxGlobal3][eIdxGlobal4] -= TSecond[0][0]; + this->A_[eIdxGlobal3][eIdxGlobal3] -= TSecond[0][1]; + this->A_[eIdxGlobal3][eIdxGlobal2] -= TSecond[0][2]; + this->A_[eIdxGlobal3][eIdxGlobal7] -= TSecond[0][3]; u[0] = pc[3]; u[1] = pc[2]; @@ -1195,20 +1195,20 @@ void FvMpfaL3dPressure2p<TypeTag>::assembleInnerInteractionVolume(InteractionVol caseL = transmissibilityCalculator_.transmissibility(T, interactionVolume, lambda, 2, 0, 3, 1, 6, 4); TSecond = T; - T *= interactionVolumes_.faceAreaFactor(interactionVolume, globalIdx3, 2, 0); - TSecond *= interactionVolumes_.faceAreaFactor(interactionVolume, globalIdx1, 0, 1); + T *= interactionVolumes_.faceAreaFactor(interactionVolume, eIdxGlobal3, 2, 0); + TSecond *= interactionVolumes_.faceAreaFactor(interactionVolume, eIdxGlobal1, 0, 1); if (caseL == 1) { - this->A_[globalIdx3][globalIdx3] += T[0][0]; - this->A_[globalIdx3][globalIdx1] += T[0][1]; - this->A_[globalIdx3][globalIdx4] += T[0][2]; - this->A_[globalIdx3][globalIdx7] += T[0][3]; + this->A_[eIdxGlobal3][eIdxGlobal3] += T[0][0]; + this->A_[eIdxGlobal3][eIdxGlobal1] += T[0][1]; + this->A_[eIdxGlobal3][eIdxGlobal4] += T[0][2]; + this->A_[eIdxGlobal3][eIdxGlobal7] += T[0][3]; - this->A_[globalIdx1][globalIdx3] -= TSecond[0][0]; - this->A_[globalIdx1][globalIdx1] -= TSecond[0][1]; - this->A_[globalIdx1][globalIdx4] -= TSecond[0][2]; - this->A_[globalIdx1][globalIdx7] -= TSecond[0][3]; + this->A_[eIdxGlobal1][eIdxGlobal3] -= TSecond[0][0]; + this->A_[eIdxGlobal1][eIdxGlobal1] -= TSecond[0][1]; + this->A_[eIdxGlobal1][eIdxGlobal4] -= TSecond[0][2]; + this->A_[eIdxGlobal1][eIdxGlobal7] -= TSecond[0][3]; u[0] = pc[2]; u[1] = pc[0]; @@ -1224,15 +1224,15 @@ void FvMpfaL3dPressure2p<TypeTag>::assembleInnerInteractionVolume(InteractionVol } else if (caseL == 2) { - this->A_[globalIdx3][globalIdx3] += T[0][0]; - this->A_[globalIdx3][globalIdx1] += T[0][1]; - this->A_[globalIdx3][globalIdx2] += T[0][2]; - this->A_[globalIdx3][globalIdx5] += T[0][3]; + this->A_[eIdxGlobal3][eIdxGlobal3] += T[0][0]; + this->A_[eIdxGlobal3][eIdxGlobal1] += T[0][1]; + this->A_[eIdxGlobal3][eIdxGlobal2] += T[0][2]; + this->A_[eIdxGlobal3][eIdxGlobal5] += T[0][3]; - this->A_[globalIdx1][globalIdx3] -= TSecond[0][0]; - this->A_[globalIdx1][globalIdx1] -= TSecond[0][1]; - this->A_[globalIdx1][globalIdx2] -= TSecond[0][2]; - this->A_[globalIdx1][globalIdx5] -= TSecond[0][3]; + this->A_[eIdxGlobal1][eIdxGlobal3] -= TSecond[0][0]; + this->A_[eIdxGlobal1][eIdxGlobal1] -= TSecond[0][1]; + this->A_[eIdxGlobal1][eIdxGlobal2] -= TSecond[0][2]; + this->A_[eIdxGlobal1][eIdxGlobal5] -= TSecond[0][3]; u[0] = pc[2]; u[1] = pc[0]; @@ -1248,15 +1248,15 @@ void FvMpfaL3dPressure2p<TypeTag>::assembleInnerInteractionVolume(InteractionVol } else if (caseL == 3) { - this->A_[globalIdx3][globalIdx3] += T[0][0]; - this->A_[globalIdx3][globalIdx1] += T[0][1]; - this->A_[globalIdx3][globalIdx2] += T[0][2]; - this->A_[globalIdx3][globalIdx7] += T[0][3]; + this->A_[eIdxGlobal3][eIdxGlobal3] += T[0][0]; + this->A_[eIdxGlobal3][eIdxGlobal1] += T[0][1]; + this->A_[eIdxGlobal3][eIdxGlobal2] += T[0][2]; + this->A_[eIdxGlobal3][eIdxGlobal7] += T[0][3]; - this->A_[globalIdx1][globalIdx3] -= TSecond[0][0]; - this->A_[globalIdx1][globalIdx1] -= TSecond[0][1]; - this->A_[globalIdx1][globalIdx2] -= TSecond[0][2]; - this->A_[globalIdx1][globalIdx7] -= TSecond[0][3]; + this->A_[eIdxGlobal1][eIdxGlobal3] -= TSecond[0][0]; + this->A_[eIdxGlobal1][eIdxGlobal1] -= TSecond[0][1]; + this->A_[eIdxGlobal1][eIdxGlobal2] -= TSecond[0][2]; + this->A_[eIdxGlobal1][eIdxGlobal7] -= TSecond[0][3]; u[0] = pc[2]; u[1] = pc[0]; @@ -1272,15 +1272,15 @@ void FvMpfaL3dPressure2p<TypeTag>::assembleInnerInteractionVolume(InteractionVol } else { - this->A_[globalIdx3][globalIdx3] += T[0][0]; - this->A_[globalIdx3][globalIdx1] += T[0][1]; - this->A_[globalIdx3][globalIdx4] += T[0][2]; - this->A_[globalIdx3][globalIdx5] += T[0][3]; + this->A_[eIdxGlobal3][eIdxGlobal3] += T[0][0]; + this->A_[eIdxGlobal3][eIdxGlobal1] += T[0][1]; + this->A_[eIdxGlobal3][eIdxGlobal4] += T[0][2]; + this->A_[eIdxGlobal3][eIdxGlobal5] += T[0][3]; - this->A_[globalIdx1][globalIdx3] -= TSecond[0][0]; - this->A_[globalIdx1][globalIdx1] -= TSecond[0][1]; - this->A_[globalIdx1][globalIdx4] -= TSecond[0][2]; - this->A_[globalIdx1][globalIdx5] -= TSecond[0][3]; + this->A_[eIdxGlobal1][eIdxGlobal3] -= TSecond[0][0]; + this->A_[eIdxGlobal1][eIdxGlobal1] -= TSecond[0][1]; + this->A_[eIdxGlobal1][eIdxGlobal4] -= TSecond[0][2]; + this->A_[eIdxGlobal1][eIdxGlobal5] -= TSecond[0][3]; u[0] = pc[2]; u[1] = pc[0]; @@ -1299,20 +1299,20 @@ void FvMpfaL3dPressure2p<TypeTag>::assembleInnerInteractionVolume(InteractionVol caseL = transmissibilityCalculator_.transmissibility(T, interactionVolume, lambda, 5, 4, 7, 6, 1, 0); TSecond = T; - T *= interactionVolumes_.faceAreaFactor(interactionVolume, globalIdx6, 5, 2); - TSecond *= interactionVolumes_.faceAreaFactor(interactionVolume, globalIdx5, 4, 1); + T *= interactionVolumes_.faceAreaFactor(interactionVolume, eIdxGlobal6, 5, 2); + TSecond *= interactionVolumes_.faceAreaFactor(interactionVolume, eIdxGlobal5, 4, 1); if (caseL == 1) { - this->A_[globalIdx6][globalIdx6] += T[0][0]; - this->A_[globalIdx6][globalIdx5] += T[0][1]; - this->A_[globalIdx6][globalIdx8] += T[0][2]; - this->A_[globalIdx6][globalIdx2] += T[0][3]; + this->A_[eIdxGlobal6][eIdxGlobal6] += T[0][0]; + this->A_[eIdxGlobal6][eIdxGlobal5] += T[0][1]; + this->A_[eIdxGlobal6][eIdxGlobal8] += T[0][2]; + this->A_[eIdxGlobal6][eIdxGlobal2] += T[0][3]; - this->A_[globalIdx5][globalIdx6] -= TSecond[0][0]; - this->A_[globalIdx5][globalIdx5] -= TSecond[0][1]; - this->A_[globalIdx5][globalIdx8] -= TSecond[0][2]; - this->A_[globalIdx5][globalIdx2] -= TSecond[0][3]; + this->A_[eIdxGlobal5][eIdxGlobal6] -= TSecond[0][0]; + this->A_[eIdxGlobal5][eIdxGlobal5] -= TSecond[0][1]; + this->A_[eIdxGlobal5][eIdxGlobal8] -= TSecond[0][2]; + this->A_[eIdxGlobal5][eIdxGlobal2] -= TSecond[0][3]; u[0] = pc[5]; u[1] = pc[4]; @@ -1328,15 +1328,15 @@ void FvMpfaL3dPressure2p<TypeTag>::assembleInnerInteractionVolume(InteractionVol } else if (caseL == 2) { - this->A_[globalIdx6][globalIdx6] += T[0][0]; - this->A_[globalIdx6][globalIdx5] += T[0][1]; - this->A_[globalIdx6][globalIdx7] += T[0][2]; - this->A_[globalIdx6][globalIdx1] += T[0][3]; + this->A_[eIdxGlobal6][eIdxGlobal6] += T[0][0]; + this->A_[eIdxGlobal6][eIdxGlobal5] += T[0][1]; + this->A_[eIdxGlobal6][eIdxGlobal7] += T[0][2]; + this->A_[eIdxGlobal6][eIdxGlobal1] += T[0][3]; - this->A_[globalIdx5][globalIdx6] -= TSecond[0][0]; - this->A_[globalIdx5][globalIdx5] -= TSecond[0][1]; - this->A_[globalIdx5][globalIdx7] -= TSecond[0][2]; - this->A_[globalIdx5][globalIdx1] -= TSecond[0][3]; + this->A_[eIdxGlobal5][eIdxGlobal6] -= TSecond[0][0]; + this->A_[eIdxGlobal5][eIdxGlobal5] -= TSecond[0][1]; + this->A_[eIdxGlobal5][eIdxGlobal7] -= TSecond[0][2]; + this->A_[eIdxGlobal5][eIdxGlobal1] -= TSecond[0][3]; u[0] = pc[5]; u[1] = pc[4]; @@ -1352,15 +1352,15 @@ void FvMpfaL3dPressure2p<TypeTag>::assembleInnerInteractionVolume(InteractionVol } else if (caseL == 3) { - this->A_[globalIdx6][globalIdx6] += T[0][0]; - this->A_[globalIdx6][globalIdx5] += T[0][1]; - this->A_[globalIdx6][globalIdx7] += T[0][2]; - this->A_[globalIdx6][globalIdx2] += T[0][3]; + this->A_[eIdxGlobal6][eIdxGlobal6] += T[0][0]; + this->A_[eIdxGlobal6][eIdxGlobal5] += T[0][1]; + this->A_[eIdxGlobal6][eIdxGlobal7] += T[0][2]; + this->A_[eIdxGlobal6][eIdxGlobal2] += T[0][3]; - this->A_[globalIdx5][globalIdx6] -= TSecond[0][0]; - this->A_[globalIdx5][globalIdx5] -= TSecond[0][1]; - this->A_[globalIdx5][globalIdx7] -= TSecond[0][2]; - this->A_[globalIdx5][globalIdx2] -= TSecond[0][3]; + this->A_[eIdxGlobal5][eIdxGlobal6] -= TSecond[0][0]; + this->A_[eIdxGlobal5][eIdxGlobal5] -= TSecond[0][1]; + this->A_[eIdxGlobal5][eIdxGlobal7] -= TSecond[0][2]; + this->A_[eIdxGlobal5][eIdxGlobal2] -= TSecond[0][3]; u[0] = pc[5]; u[1] = pc[4]; @@ -1376,15 +1376,15 @@ void FvMpfaL3dPressure2p<TypeTag>::assembleInnerInteractionVolume(InteractionVol } else { - this->A_[globalIdx6][globalIdx6] += T[0][0]; - this->A_[globalIdx6][globalIdx5] += T[0][1]; - this->A_[globalIdx6][globalIdx8] += T[0][2]; - this->A_[globalIdx6][globalIdx1] += T[0][3]; + this->A_[eIdxGlobal6][eIdxGlobal6] += T[0][0]; + this->A_[eIdxGlobal6][eIdxGlobal5] += T[0][1]; + this->A_[eIdxGlobal6][eIdxGlobal8] += T[0][2]; + this->A_[eIdxGlobal6][eIdxGlobal1] += T[0][3]; - this->A_[globalIdx5][globalIdx6] -= TSecond[0][0]; - this->A_[globalIdx5][globalIdx5] -= TSecond[0][1]; - this->A_[globalIdx5][globalIdx8] -= TSecond[0][2]; - this->A_[globalIdx5][globalIdx1] -= TSecond[0][3]; + this->A_[eIdxGlobal5][eIdxGlobal6] -= TSecond[0][0]; + this->A_[eIdxGlobal5][eIdxGlobal5] -= TSecond[0][1]; + this->A_[eIdxGlobal5][eIdxGlobal8] -= TSecond[0][2]; + this->A_[eIdxGlobal5][eIdxGlobal1] -= TSecond[0][3]; u[0] = pc[5]; u[1] = pc[4]; @@ -1403,21 +1403,21 @@ void FvMpfaL3dPressure2p<TypeTag>::assembleInnerInteractionVolume(InteractionVol caseL = transmissibilityCalculator_.transmissibility(T, interactionVolume, lambda, 7, 5, 6, 4, 3, 1); TSecond = T; - T *= interactionVolumes_.faceAreaFactor(interactionVolume, globalIdx8, 7, 2); - TSecond *= interactionVolumes_.faceAreaFactor(interactionVolume, globalIdx6, 5, 1); + T *= interactionVolumes_.faceAreaFactor(interactionVolume, eIdxGlobal8, 7, 2); + TSecond *= interactionVolumes_.faceAreaFactor(interactionVolume, eIdxGlobal6, 5, 1); if (caseL == 1) { - this->A_[globalIdx8][globalIdx8] += T[0][0]; - this->A_[globalIdx8][globalIdx6] += T[0][1]; - this->A_[globalIdx8][globalIdx7] += T[0][2]; - this->A_[globalIdx8][globalIdx4] += T[0][3]; + this->A_[eIdxGlobal8][eIdxGlobal8] += T[0][0]; + this->A_[eIdxGlobal8][eIdxGlobal6] += T[0][1]; + this->A_[eIdxGlobal8][eIdxGlobal7] += T[0][2]; + this->A_[eIdxGlobal8][eIdxGlobal4] += T[0][3]; - this->A_[globalIdx6][globalIdx8] -= TSecond[0][0]; - this->A_[globalIdx6][globalIdx6] -= TSecond[0][1]; - this->A_[globalIdx6][globalIdx7] -= TSecond[0][2]; - this->A_[globalIdx6][globalIdx4] -= TSecond[0][3]; + this->A_[eIdxGlobal6][eIdxGlobal8] -= TSecond[0][0]; + this->A_[eIdxGlobal6][eIdxGlobal6] -= TSecond[0][1]; + this->A_[eIdxGlobal6][eIdxGlobal7] -= TSecond[0][2]; + this->A_[eIdxGlobal6][eIdxGlobal4] -= TSecond[0][3]; u[0] = pc[7]; u[1] = pc[5]; @@ -1433,15 +1433,15 @@ void FvMpfaL3dPressure2p<TypeTag>::assembleInnerInteractionVolume(InteractionVol } else if (caseL == 2) { - this->A_[globalIdx8][globalIdx8] += T[0][0]; - this->A_[globalIdx8][globalIdx6] += T[0][1]; - this->A_[globalIdx8][globalIdx5] += T[0][2]; - this->A_[globalIdx8][globalIdx2] += T[0][3]; + this->A_[eIdxGlobal8][eIdxGlobal8] += T[0][0]; + this->A_[eIdxGlobal8][eIdxGlobal6] += T[0][1]; + this->A_[eIdxGlobal8][eIdxGlobal5] += T[0][2]; + this->A_[eIdxGlobal8][eIdxGlobal2] += T[0][3]; - this->A_[globalIdx6][globalIdx8] -= TSecond[0][0]; - this->A_[globalIdx6][globalIdx6] -= TSecond[0][1]; - this->A_[globalIdx6][globalIdx5] -= TSecond[0][2]; - this->A_[globalIdx6][globalIdx2] -= TSecond[0][3]; + this->A_[eIdxGlobal6][eIdxGlobal8] -= TSecond[0][0]; + this->A_[eIdxGlobal6][eIdxGlobal6] -= TSecond[0][1]; + this->A_[eIdxGlobal6][eIdxGlobal5] -= TSecond[0][2]; + this->A_[eIdxGlobal6][eIdxGlobal2] -= TSecond[0][3]; u[0] = pc[7]; u[1] = pc[5]; @@ -1457,15 +1457,15 @@ void FvMpfaL3dPressure2p<TypeTag>::assembleInnerInteractionVolume(InteractionVol } else if (caseL == 3) { - this->A_[globalIdx8][globalIdx8] += T[0][0]; - this->A_[globalIdx8][globalIdx6] += T[0][1]; - this->A_[globalIdx8][globalIdx5] += T[0][2]; - this->A_[globalIdx8][globalIdx4] += T[0][3]; + this->A_[eIdxGlobal8][eIdxGlobal8] += T[0][0]; + this->A_[eIdxGlobal8][eIdxGlobal6] += T[0][1]; + this->A_[eIdxGlobal8][eIdxGlobal5] += T[0][2]; + this->A_[eIdxGlobal8][eIdxGlobal4] += T[0][3]; - this->A_[globalIdx6][globalIdx8] -= TSecond[0][0]; - this->A_[globalIdx6][globalIdx6] -= TSecond[0][1]; - this->A_[globalIdx6][globalIdx5] -= TSecond[0][2]; - this->A_[globalIdx6][globalIdx4] -= TSecond[0][3]; + this->A_[eIdxGlobal6][eIdxGlobal8] -= TSecond[0][0]; + this->A_[eIdxGlobal6][eIdxGlobal6] -= TSecond[0][1]; + this->A_[eIdxGlobal6][eIdxGlobal5] -= TSecond[0][2]; + this->A_[eIdxGlobal6][eIdxGlobal4] -= TSecond[0][3]; u[0] = pc[7]; u[1] = pc[5]; @@ -1481,15 +1481,15 @@ void FvMpfaL3dPressure2p<TypeTag>::assembleInnerInteractionVolume(InteractionVol } else { - this->A_[globalIdx8][globalIdx8] += T[0][0]; - this->A_[globalIdx8][globalIdx6] += T[0][1]; - this->A_[globalIdx8][globalIdx7] += T[0][2]; - this->A_[globalIdx8][globalIdx2] += T[0][3]; + this->A_[eIdxGlobal8][eIdxGlobal8] += T[0][0]; + this->A_[eIdxGlobal8][eIdxGlobal6] += T[0][1]; + this->A_[eIdxGlobal8][eIdxGlobal7] += T[0][2]; + this->A_[eIdxGlobal8][eIdxGlobal2] += T[0][3]; - this->A_[globalIdx6][globalIdx8] -= TSecond[0][0]; - this->A_[globalIdx6][globalIdx6] -= TSecond[0][1]; - this->A_[globalIdx6][globalIdx7] -= TSecond[0][2]; - this->A_[globalIdx6][globalIdx2] -= TSecond[0][3]; + this->A_[eIdxGlobal6][eIdxGlobal8] -= TSecond[0][0]; + this->A_[eIdxGlobal6][eIdxGlobal6] -= TSecond[0][1]; + this->A_[eIdxGlobal6][eIdxGlobal7] -= TSecond[0][2]; + this->A_[eIdxGlobal6][eIdxGlobal2] -= TSecond[0][3]; u[0] = pc[7]; u[1] = pc[5]; @@ -1508,20 +1508,20 @@ void FvMpfaL3dPressure2p<TypeTag>::assembleInnerInteractionVolume(InteractionVol caseL = transmissibilityCalculator_.transmissibility(T, interactionVolume, lambda, 6, 7, 4, 5, 2, 3); TSecond = T; - T *= interactionVolumes_.faceAreaFactor(interactionVolume, globalIdx7, 6, 2); - TSecond *= interactionVolumes_.faceAreaFactor(interactionVolume, globalIdx8, 7, 1); + T *= interactionVolumes_.faceAreaFactor(interactionVolume, eIdxGlobal7, 6, 2); + TSecond *= interactionVolumes_.faceAreaFactor(interactionVolume, eIdxGlobal8, 7, 1); if (caseL == 1) { - this->A_[globalIdx7][globalIdx7] += T[0][0]; - this->A_[globalIdx7][globalIdx8] += T[0][1]; - this->A_[globalIdx7][globalIdx5] += T[0][2]; - this->A_[globalIdx7][globalIdx3] += T[0][3]; + this->A_[eIdxGlobal7][eIdxGlobal7] += T[0][0]; + this->A_[eIdxGlobal7][eIdxGlobal8] += T[0][1]; + this->A_[eIdxGlobal7][eIdxGlobal5] += T[0][2]; + this->A_[eIdxGlobal7][eIdxGlobal3] += T[0][3]; - this->A_[globalIdx8][globalIdx7] -= TSecond[0][0]; - this->A_[globalIdx8][globalIdx8] -= TSecond[0][1]; - this->A_[globalIdx8][globalIdx5] -= TSecond[0][2]; - this->A_[globalIdx8][globalIdx3] -= TSecond[0][3]; + this->A_[eIdxGlobal8][eIdxGlobal7] -= TSecond[0][0]; + this->A_[eIdxGlobal8][eIdxGlobal8] -= TSecond[0][1]; + this->A_[eIdxGlobal8][eIdxGlobal5] -= TSecond[0][2]; + this->A_[eIdxGlobal8][eIdxGlobal3] -= TSecond[0][3]; u[0] = pc[6]; u[1] = pc[7]; @@ -1537,15 +1537,15 @@ void FvMpfaL3dPressure2p<TypeTag>::assembleInnerInteractionVolume(InteractionVol } else if (caseL == 2) { - this->A_[globalIdx7][globalIdx7] += T[0][0]; - this->A_[globalIdx7][globalIdx8] += T[0][1]; - this->A_[globalIdx7][globalIdx6] += T[0][2]; - this->A_[globalIdx7][globalIdx4] += T[0][3]; + this->A_[eIdxGlobal7][eIdxGlobal7] += T[0][0]; + this->A_[eIdxGlobal7][eIdxGlobal8] += T[0][1]; + this->A_[eIdxGlobal7][eIdxGlobal6] += T[0][2]; + this->A_[eIdxGlobal7][eIdxGlobal4] += T[0][3]; - this->A_[globalIdx8][globalIdx7] -= TSecond[0][0]; - this->A_[globalIdx8][globalIdx8] -= TSecond[0][1]; - this->A_[globalIdx8][globalIdx6] -= TSecond[0][2]; - this->A_[globalIdx8][globalIdx4] -= TSecond[0][3]; + this->A_[eIdxGlobal8][eIdxGlobal7] -= TSecond[0][0]; + this->A_[eIdxGlobal8][eIdxGlobal8] -= TSecond[0][1]; + this->A_[eIdxGlobal8][eIdxGlobal6] -= TSecond[0][2]; + this->A_[eIdxGlobal8][eIdxGlobal4] -= TSecond[0][3]; u[0] = pc[6]; u[1] = pc[7]; @@ -1561,15 +1561,15 @@ void FvMpfaL3dPressure2p<TypeTag>::assembleInnerInteractionVolume(InteractionVol } else if (caseL == 3) { - this->A_[globalIdx7][globalIdx7] += T[0][0]; - this->A_[globalIdx7][globalIdx8] += T[0][1]; - this->A_[globalIdx7][globalIdx6] += T[0][2]; - this->A_[globalIdx7][globalIdx3] += T[0][3]; + this->A_[eIdxGlobal7][eIdxGlobal7] += T[0][0]; + this->A_[eIdxGlobal7][eIdxGlobal8] += T[0][1]; + this->A_[eIdxGlobal7][eIdxGlobal6] += T[0][2]; + this->A_[eIdxGlobal7][eIdxGlobal3] += T[0][3]; - this->A_[globalIdx8][globalIdx7] -= TSecond[0][0]; - this->A_[globalIdx8][globalIdx8] -= TSecond[0][1]; - this->A_[globalIdx8][globalIdx6] -= TSecond[0][2]; - this->A_[globalIdx8][globalIdx3] -= TSecond[0][3]; + this->A_[eIdxGlobal8][eIdxGlobal7] -= TSecond[0][0]; + this->A_[eIdxGlobal8][eIdxGlobal8] -= TSecond[0][1]; + this->A_[eIdxGlobal8][eIdxGlobal6] -= TSecond[0][2]; + this->A_[eIdxGlobal8][eIdxGlobal3] -= TSecond[0][3]; u[0] = pc[6]; u[1] = pc[7]; @@ -1585,15 +1585,15 @@ void FvMpfaL3dPressure2p<TypeTag>::assembleInnerInteractionVolume(InteractionVol } else { - this->A_[globalIdx7][globalIdx7] += T[0][0]; - this->A_[globalIdx7][globalIdx8] += T[0][1]; - this->A_[globalIdx7][globalIdx5] += T[0][2]; - this->A_[globalIdx7][globalIdx4] += T[0][3]; + this->A_[eIdxGlobal7][eIdxGlobal7] += T[0][0]; + this->A_[eIdxGlobal7][eIdxGlobal8] += T[0][1]; + this->A_[eIdxGlobal7][eIdxGlobal5] += T[0][2]; + this->A_[eIdxGlobal7][eIdxGlobal4] += T[0][3]; - this->A_[globalIdx8][globalIdx7] -= TSecond[0][0]; - this->A_[globalIdx8][globalIdx8] -= TSecond[0][1]; - this->A_[globalIdx8][globalIdx5] -= TSecond[0][2]; - this->A_[globalIdx8][globalIdx4] -= TSecond[0][3]; + this->A_[eIdxGlobal8][eIdxGlobal7] -= TSecond[0][0]; + this->A_[eIdxGlobal8][eIdxGlobal8] -= TSecond[0][1]; + this->A_[eIdxGlobal8][eIdxGlobal5] -= TSecond[0][2]; + this->A_[eIdxGlobal8][eIdxGlobal4] -= TSecond[0][3]; u[0] = pc[6]; u[1] = pc[7]; @@ -1612,20 +1612,20 @@ void FvMpfaL3dPressure2p<TypeTag>::assembleInnerInteractionVolume(InteractionVol caseL = transmissibilityCalculator_.transmissibility(T, interactionVolume, lambda, 4, 6, 5, 7, 0, 2); TSecond = T; - T *= interactionVolumes_.faceAreaFactor(interactionVolume, globalIdx5, 4, 2); - TSecond *= interactionVolumes_.faceAreaFactor(interactionVolume, globalIdx7, 6, 1); + T *= interactionVolumes_.faceAreaFactor(interactionVolume, eIdxGlobal5, 4, 2); + TSecond *= interactionVolumes_.faceAreaFactor(interactionVolume, eIdxGlobal7, 6, 1); if (caseL == 1) { - this->A_[globalIdx5][globalIdx5] += T[0][0]; - this->A_[globalIdx5][globalIdx7] += T[0][1]; - this->A_[globalIdx5][globalIdx6] += T[0][2]; - this->A_[globalIdx5][globalIdx1] += T[0][3]; + this->A_[eIdxGlobal5][eIdxGlobal5] += T[0][0]; + this->A_[eIdxGlobal5][eIdxGlobal7] += T[0][1]; + this->A_[eIdxGlobal5][eIdxGlobal6] += T[0][2]; + this->A_[eIdxGlobal5][eIdxGlobal1] += T[0][3]; - this->A_[globalIdx7][globalIdx5] -= TSecond[0][0]; - this->A_[globalIdx7][globalIdx7] -= TSecond[0][1]; - this->A_[globalIdx7][globalIdx6] -= TSecond[0][2]; - this->A_[globalIdx7][globalIdx1] -= TSecond[0][3]; + this->A_[eIdxGlobal7][eIdxGlobal5] -= TSecond[0][0]; + this->A_[eIdxGlobal7][eIdxGlobal7] -= TSecond[0][1]; + this->A_[eIdxGlobal7][eIdxGlobal6] -= TSecond[0][2]; + this->A_[eIdxGlobal7][eIdxGlobal1] -= TSecond[0][3]; u[0] = pc[4]; u[1] = pc[6]; @@ -1641,15 +1641,15 @@ void FvMpfaL3dPressure2p<TypeTag>::assembleInnerInteractionVolume(InteractionVol } else if (caseL == 2) { - this->A_[globalIdx5][globalIdx5] += T[0][0]; - this->A_[globalIdx5][globalIdx7] += T[0][1]; - this->A_[globalIdx5][globalIdx8] += T[0][2]; - this->A_[globalIdx5][globalIdx3] += T[0][3]; + this->A_[eIdxGlobal5][eIdxGlobal5] += T[0][0]; + this->A_[eIdxGlobal5][eIdxGlobal7] += T[0][1]; + this->A_[eIdxGlobal5][eIdxGlobal8] += T[0][2]; + this->A_[eIdxGlobal5][eIdxGlobal3] += T[0][3]; - this->A_[globalIdx7][globalIdx5] -= TSecond[0][0]; - this->A_[globalIdx7][globalIdx7] -= TSecond[0][1]; - this->A_[globalIdx7][globalIdx8] -= TSecond[0][2]; - this->A_[globalIdx7][globalIdx3] -= TSecond[0][3]; + this->A_[eIdxGlobal7][eIdxGlobal5] -= TSecond[0][0]; + this->A_[eIdxGlobal7][eIdxGlobal7] -= TSecond[0][1]; + this->A_[eIdxGlobal7][eIdxGlobal8] -= TSecond[0][2]; + this->A_[eIdxGlobal7][eIdxGlobal3] -= TSecond[0][3]; u[0] = pc[4]; u[1] = pc[6]; @@ -1665,15 +1665,15 @@ void FvMpfaL3dPressure2p<TypeTag>::assembleInnerInteractionVolume(InteractionVol } else if (caseL == 3) { - this->A_[globalIdx5][globalIdx5] += T[0][0]; - this->A_[globalIdx5][globalIdx7] += T[0][1]; - this->A_[globalIdx5][globalIdx8] += T[0][2]; - this->A_[globalIdx5][globalIdx1] += T[0][3]; + this->A_[eIdxGlobal5][eIdxGlobal5] += T[0][0]; + this->A_[eIdxGlobal5][eIdxGlobal7] += T[0][1]; + this->A_[eIdxGlobal5][eIdxGlobal8] += T[0][2]; + this->A_[eIdxGlobal5][eIdxGlobal1] += T[0][3]; - this->A_[globalIdx7][globalIdx5] -= TSecond[0][0]; - this->A_[globalIdx7][globalIdx7] -= TSecond[0][1]; - this->A_[globalIdx7][globalIdx8] -= TSecond[0][2]; - this->A_[globalIdx7][globalIdx1] -= TSecond[0][3]; + this->A_[eIdxGlobal7][eIdxGlobal5] -= TSecond[0][0]; + this->A_[eIdxGlobal7][eIdxGlobal7] -= TSecond[0][1]; + this->A_[eIdxGlobal7][eIdxGlobal8] -= TSecond[0][2]; + this->A_[eIdxGlobal7][eIdxGlobal1] -= TSecond[0][3]; u[0] = pc[4]; u[1] = pc[6]; @@ -1689,15 +1689,15 @@ void FvMpfaL3dPressure2p<TypeTag>::assembleInnerInteractionVolume(InteractionVol } else { - this->A_[globalIdx5][globalIdx5] += T[0][0]; - this->A_[globalIdx5][globalIdx7] += T[0][1]; - this->A_[globalIdx5][globalIdx6] += T[0][2]; - this->A_[globalIdx5][globalIdx3] += T[0][3]; + this->A_[eIdxGlobal5][eIdxGlobal5] += T[0][0]; + this->A_[eIdxGlobal5][eIdxGlobal7] += T[0][1]; + this->A_[eIdxGlobal5][eIdxGlobal6] += T[0][2]; + this->A_[eIdxGlobal5][eIdxGlobal3] += T[0][3]; - this->A_[globalIdx7][globalIdx5] -= TSecond[0][0]; - this->A_[globalIdx7][globalIdx7] -= TSecond[0][1]; - this->A_[globalIdx7][globalIdx6] -= TSecond[0][2]; - this->A_[globalIdx7][globalIdx3] -= TSecond[0][3]; + this->A_[eIdxGlobal7][eIdxGlobal5] -= TSecond[0][0]; + this->A_[eIdxGlobal7][eIdxGlobal7] -= TSecond[0][1]; + this->A_[eIdxGlobal7][eIdxGlobal6] -= TSecond[0][2]; + this->A_[eIdxGlobal7][eIdxGlobal3] -= TSecond[0][3]; u[0] = pc[4]; u[1] = pc[6]; @@ -1716,20 +1716,20 @@ void FvMpfaL3dPressure2p<TypeTag>::assembleInnerInteractionVolume(InteractionVol caseL = transmissibilityCalculator_.transmissibility(T, interactionVolume, lambda, 4, 0, 6, 2, 5, 1); TSecond = T; - T *= interactionVolumes_.faceAreaFactor(interactionVolume, globalIdx5, 4, 0); - TSecond *= interactionVolumes_.faceAreaFactor(interactionVolume, globalIdx1, 0, 2); + T *= interactionVolumes_.faceAreaFactor(interactionVolume, eIdxGlobal5, 4, 0); + TSecond *= interactionVolumes_.faceAreaFactor(interactionVolume, eIdxGlobal1, 0, 2); if (caseL == 1) { - this->A_[globalIdx5][globalIdx5] += T[0][0]; - this->A_[globalIdx5][globalIdx1] += T[0][1]; - this->A_[globalIdx5][globalIdx7] += T[0][2]; - this->A_[globalIdx5][globalIdx6] += T[0][3]; + this->A_[eIdxGlobal5][eIdxGlobal5] += T[0][0]; + this->A_[eIdxGlobal5][eIdxGlobal1] += T[0][1]; + this->A_[eIdxGlobal5][eIdxGlobal7] += T[0][2]; + this->A_[eIdxGlobal5][eIdxGlobal6] += T[0][3]; - this->A_[globalIdx1][globalIdx5] -= TSecond[0][0]; - this->A_[globalIdx1][globalIdx1] -= TSecond[0][1]; - this->A_[globalIdx1][globalIdx7] -= TSecond[0][2]; - this->A_[globalIdx1][globalIdx6] -= TSecond[0][3]; + this->A_[eIdxGlobal1][eIdxGlobal5] -= TSecond[0][0]; + this->A_[eIdxGlobal1][eIdxGlobal1] -= TSecond[0][1]; + this->A_[eIdxGlobal1][eIdxGlobal7] -= TSecond[0][2]; + this->A_[eIdxGlobal1][eIdxGlobal6] -= TSecond[0][3]; u[0] = pc[4]; u[1] = pc[0]; @@ -1745,15 +1745,15 @@ void FvMpfaL3dPressure2p<TypeTag>::assembleInnerInteractionVolume(InteractionVol } else if (caseL == 2) { - this->A_[globalIdx5][globalIdx5] += T[0][0]; - this->A_[globalIdx5][globalIdx1] += T[0][1]; - this->A_[globalIdx5][globalIdx3] += T[0][2]; - this->A_[globalIdx5][globalIdx2] += T[0][3]; + this->A_[eIdxGlobal5][eIdxGlobal5] += T[0][0]; + this->A_[eIdxGlobal5][eIdxGlobal1] += T[0][1]; + this->A_[eIdxGlobal5][eIdxGlobal3] += T[0][2]; + this->A_[eIdxGlobal5][eIdxGlobal2] += T[0][3]; - this->A_[globalIdx1][globalIdx5] -= TSecond[0][0]; - this->A_[globalIdx1][globalIdx1] -= TSecond[0][1]; - this->A_[globalIdx1][globalIdx3] -= TSecond[0][2]; - this->A_[globalIdx1][globalIdx2] -= TSecond[0][3]; + this->A_[eIdxGlobal1][eIdxGlobal5] -= TSecond[0][0]; + this->A_[eIdxGlobal1][eIdxGlobal1] -= TSecond[0][1]; + this->A_[eIdxGlobal1][eIdxGlobal3] -= TSecond[0][2]; + this->A_[eIdxGlobal1][eIdxGlobal2] -= TSecond[0][3]; u[0] = pc[4]; u[1] = pc[0]; @@ -1769,15 +1769,15 @@ void FvMpfaL3dPressure2p<TypeTag>::assembleInnerInteractionVolume(InteractionVol } else if (caseL == 3) { - this->A_[globalIdx5][globalIdx5] += T[0][0]; - this->A_[globalIdx5][globalIdx1] += T[0][1]; - this->A_[globalIdx5][globalIdx3] += T[0][2]; - this->A_[globalIdx5][globalIdx6] += T[0][3]; + this->A_[eIdxGlobal5][eIdxGlobal5] += T[0][0]; + this->A_[eIdxGlobal5][eIdxGlobal1] += T[0][1]; + this->A_[eIdxGlobal5][eIdxGlobal3] += T[0][2]; + this->A_[eIdxGlobal5][eIdxGlobal6] += T[0][3]; - this->A_[globalIdx1][globalIdx5] -= TSecond[0][0]; - this->A_[globalIdx1][globalIdx1] -= TSecond[0][1]; - this->A_[globalIdx1][globalIdx3] -= TSecond[0][2]; - this->A_[globalIdx1][globalIdx6] -= TSecond[0][3]; + this->A_[eIdxGlobal1][eIdxGlobal5] -= TSecond[0][0]; + this->A_[eIdxGlobal1][eIdxGlobal1] -= TSecond[0][1]; + this->A_[eIdxGlobal1][eIdxGlobal3] -= TSecond[0][2]; + this->A_[eIdxGlobal1][eIdxGlobal6] -= TSecond[0][3]; u[0] = pc[4]; u[1] = pc[0]; @@ -1793,15 +1793,15 @@ void FvMpfaL3dPressure2p<TypeTag>::assembleInnerInteractionVolume(InteractionVol } else { - this->A_[globalIdx5][globalIdx5] += T[0][0]; - this->A_[globalIdx5][globalIdx1] += T[0][1]; - this->A_[globalIdx5][globalIdx7] += T[0][2]; - this->A_[globalIdx5][globalIdx2] += T[0][3]; + this->A_[eIdxGlobal5][eIdxGlobal5] += T[0][0]; + this->A_[eIdxGlobal5][eIdxGlobal1] += T[0][1]; + this->A_[eIdxGlobal5][eIdxGlobal7] += T[0][2]; + this->A_[eIdxGlobal5][eIdxGlobal2] += T[0][3]; - this->A_[globalIdx1][globalIdx5] -= TSecond[0][0]; - this->A_[globalIdx1][globalIdx1] -= TSecond[0][1]; - this->A_[globalIdx1][globalIdx7] -= TSecond[0][2]; - this->A_[globalIdx1][globalIdx2] -= TSecond[0][3]; + this->A_[eIdxGlobal1][eIdxGlobal5] -= TSecond[0][0]; + this->A_[eIdxGlobal1][eIdxGlobal1] -= TSecond[0][1]; + this->A_[eIdxGlobal1][eIdxGlobal7] -= TSecond[0][2]; + this->A_[eIdxGlobal1][eIdxGlobal2] -= TSecond[0][3]; u[0] = pc[4]; u[1] = pc[0]; @@ -1820,20 +1820,20 @@ void FvMpfaL3dPressure2p<TypeTag>::assembleInnerInteractionVolume(InteractionVol caseL = transmissibilityCalculator_.transmissibility(T, interactionVolume, lambda, 1, 5, 3, 7, 0, 4); TSecond = T; - T *= interactionVolumes_.faceAreaFactor(interactionVolume, globalIdx2, 1, 2); - TSecond *= interactionVolumes_.faceAreaFactor(interactionVolume, globalIdx6, 5, 0); + T *= interactionVolumes_.faceAreaFactor(interactionVolume, eIdxGlobal2, 1, 2); + TSecond *= interactionVolumes_.faceAreaFactor(interactionVolume, eIdxGlobal6, 5, 0); if (caseL == 1) { - this->A_[globalIdx2][globalIdx2] += T[0][0]; - this->A_[globalIdx2][globalIdx6] += T[0][1]; - this->A_[globalIdx2][globalIdx4] += T[0][2]; - this->A_[globalIdx2][globalIdx1] += T[0][3]; + this->A_[eIdxGlobal2][eIdxGlobal2] += T[0][0]; + this->A_[eIdxGlobal2][eIdxGlobal6] += T[0][1]; + this->A_[eIdxGlobal2][eIdxGlobal4] += T[0][2]; + this->A_[eIdxGlobal2][eIdxGlobal1] += T[0][3]; - this->A_[globalIdx6][globalIdx2] -= TSecond[0][0]; - this->A_[globalIdx6][globalIdx6] -= TSecond[0][1]; - this->A_[globalIdx6][globalIdx4] -= TSecond[0][2]; - this->A_[globalIdx6][globalIdx1] -= TSecond[0][3]; + this->A_[eIdxGlobal6][eIdxGlobal2] -= TSecond[0][0]; + this->A_[eIdxGlobal6][eIdxGlobal6] -= TSecond[0][1]; + this->A_[eIdxGlobal6][eIdxGlobal4] -= TSecond[0][2]; + this->A_[eIdxGlobal6][eIdxGlobal1] -= TSecond[0][3]; u[0] = pc[1]; u[1] = pc[5]; @@ -1849,15 +1849,15 @@ void FvMpfaL3dPressure2p<TypeTag>::assembleInnerInteractionVolume(InteractionVol } else if (caseL == 2) { - this->A_[globalIdx2][globalIdx2] += T[0][0]; - this->A_[globalIdx2][globalIdx6] += T[0][1]; - this->A_[globalIdx2][globalIdx8] += T[0][2]; - this->A_[globalIdx2][globalIdx5] += T[0][3]; + this->A_[eIdxGlobal2][eIdxGlobal2] += T[0][0]; + this->A_[eIdxGlobal2][eIdxGlobal6] += T[0][1]; + this->A_[eIdxGlobal2][eIdxGlobal8] += T[0][2]; + this->A_[eIdxGlobal2][eIdxGlobal5] += T[0][3]; - this->A_[globalIdx6][globalIdx2] -= TSecond[0][0]; - this->A_[globalIdx6][globalIdx6] -= TSecond[0][1]; - this->A_[globalIdx6][globalIdx8] -= TSecond[0][2]; - this->A_[globalIdx6][globalIdx5] -= TSecond[0][3]; + this->A_[eIdxGlobal6][eIdxGlobal2] -= TSecond[0][0]; + this->A_[eIdxGlobal6][eIdxGlobal6] -= TSecond[0][1]; + this->A_[eIdxGlobal6][eIdxGlobal8] -= TSecond[0][2]; + this->A_[eIdxGlobal6][eIdxGlobal5] -= TSecond[0][3]; u[0] = pc[1]; u[1] = pc[5]; @@ -1873,15 +1873,15 @@ void FvMpfaL3dPressure2p<TypeTag>::assembleInnerInteractionVolume(InteractionVol } else if (caseL == 3) { - this->A_[globalIdx2][globalIdx2] += T[0][0]; - this->A_[globalIdx2][globalIdx6] += T[0][1]; - this->A_[globalIdx2][globalIdx8] += T[0][2]; - this->A_[globalIdx2][globalIdx1] += T[0][3]; + this->A_[eIdxGlobal2][eIdxGlobal2] += T[0][0]; + this->A_[eIdxGlobal2][eIdxGlobal6] += T[0][1]; + this->A_[eIdxGlobal2][eIdxGlobal8] += T[0][2]; + this->A_[eIdxGlobal2][eIdxGlobal1] += T[0][3]; - this->A_[globalIdx6][globalIdx2] -= TSecond[0][0]; - this->A_[globalIdx6][globalIdx6] -= TSecond[0][1]; - this->A_[globalIdx6][globalIdx8] -= TSecond[0][2]; - this->A_[globalIdx6][globalIdx1] -= TSecond[0][3]; + this->A_[eIdxGlobal6][eIdxGlobal2] -= TSecond[0][0]; + this->A_[eIdxGlobal6][eIdxGlobal6] -= TSecond[0][1]; + this->A_[eIdxGlobal6][eIdxGlobal8] -= TSecond[0][2]; + this->A_[eIdxGlobal6][eIdxGlobal1] -= TSecond[0][3]; u[0] = pc[1]; u[1] = pc[5]; @@ -1897,15 +1897,15 @@ void FvMpfaL3dPressure2p<TypeTag>::assembleInnerInteractionVolume(InteractionVol } else { - this->A_[globalIdx2][globalIdx2] += T[0][0]; - this->A_[globalIdx2][globalIdx6] += T[0][1]; - this->A_[globalIdx2][globalIdx4] += T[0][2]; - this->A_[globalIdx2][globalIdx5] += T[0][3]; + this->A_[eIdxGlobal2][eIdxGlobal2] += T[0][0]; + this->A_[eIdxGlobal2][eIdxGlobal6] += T[0][1]; + this->A_[eIdxGlobal2][eIdxGlobal4] += T[0][2]; + this->A_[eIdxGlobal2][eIdxGlobal5] += T[0][3]; - this->A_[globalIdx6][globalIdx2] -= TSecond[0][0]; - this->A_[globalIdx6][globalIdx6] -= TSecond[0][1]; - this->A_[globalIdx6][globalIdx4] -= TSecond[0][2]; - this->A_[globalIdx6][globalIdx5] -= TSecond[0][3]; + this->A_[eIdxGlobal6][eIdxGlobal2] -= TSecond[0][0]; + this->A_[eIdxGlobal6][eIdxGlobal6] -= TSecond[0][1]; + this->A_[eIdxGlobal6][eIdxGlobal4] -= TSecond[0][2]; + this->A_[eIdxGlobal6][eIdxGlobal5] -= TSecond[0][3]; u[0] = pc[1]; u[1] = pc[5]; @@ -1924,20 +1924,20 @@ void FvMpfaL3dPressure2p<TypeTag>::assembleInnerInteractionVolume(InteractionVol caseL = transmissibilityCalculator_.transmissibility(T, interactionVolume, lambda, 7, 3, 5, 1, 6, 2); TSecond = T; - T *= interactionVolumes_.faceAreaFactor(interactionVolume, globalIdx8, 7, 0); - TSecond *= interactionVolumes_.faceAreaFactor(interactionVolume, globalIdx4, 3, 2); + T *= interactionVolumes_.faceAreaFactor(interactionVolume, eIdxGlobal8, 7, 0); + TSecond *= interactionVolumes_.faceAreaFactor(interactionVolume, eIdxGlobal4, 3, 2); if (caseL == 1) { - this->A_[globalIdx8][globalIdx8] += T[0][0]; - this->A_[globalIdx8][globalIdx4] += T[0][1]; - this->A_[globalIdx8][globalIdx6] += T[0][2]; - this->A_[globalIdx8][globalIdx7] += T[0][3]; + this->A_[eIdxGlobal8][eIdxGlobal8] += T[0][0]; + this->A_[eIdxGlobal8][eIdxGlobal4] += T[0][1]; + this->A_[eIdxGlobal8][eIdxGlobal6] += T[0][2]; + this->A_[eIdxGlobal8][eIdxGlobal7] += T[0][3]; - this->A_[globalIdx4][globalIdx8] -= TSecond[0][0]; - this->A_[globalIdx4][globalIdx4] -= TSecond[0][1]; - this->A_[globalIdx4][globalIdx6] -= TSecond[0][2]; - this->A_[globalIdx4][globalIdx7] -= TSecond[0][3]; + this->A_[eIdxGlobal4][eIdxGlobal8] -= TSecond[0][0]; + this->A_[eIdxGlobal4][eIdxGlobal4] -= TSecond[0][1]; + this->A_[eIdxGlobal4][eIdxGlobal6] -= TSecond[0][2]; + this->A_[eIdxGlobal4][eIdxGlobal7] -= TSecond[0][3]; u[0] = pc[7]; u[1] = pc[3]; @@ -1953,15 +1953,15 @@ void FvMpfaL3dPressure2p<TypeTag>::assembleInnerInteractionVolume(InteractionVol } else if (caseL == 2) { - this->A_[globalIdx8][globalIdx8] += T[0][0]; - this->A_[globalIdx8][globalIdx4] += T[0][1]; - this->A_[globalIdx8][globalIdx2] += T[0][2]; - this->A_[globalIdx8][globalIdx3] += T[0][3]; + this->A_[eIdxGlobal8][eIdxGlobal8] += T[0][0]; + this->A_[eIdxGlobal8][eIdxGlobal4] += T[0][1]; + this->A_[eIdxGlobal8][eIdxGlobal2] += T[0][2]; + this->A_[eIdxGlobal8][eIdxGlobal3] += T[0][3]; - this->A_[globalIdx4][globalIdx8] -= TSecond[0][0]; - this->A_[globalIdx4][globalIdx4] -= TSecond[0][1]; - this->A_[globalIdx4][globalIdx2] -= TSecond[0][2]; - this->A_[globalIdx4][globalIdx3] -= TSecond[0][3]; + this->A_[eIdxGlobal4][eIdxGlobal8] -= TSecond[0][0]; + this->A_[eIdxGlobal4][eIdxGlobal4] -= TSecond[0][1]; + this->A_[eIdxGlobal4][eIdxGlobal2] -= TSecond[0][2]; + this->A_[eIdxGlobal4][eIdxGlobal3] -= TSecond[0][3]; u[0] = pc[7]; u[1] = pc[3]; @@ -1977,15 +1977,15 @@ void FvMpfaL3dPressure2p<TypeTag>::assembleInnerInteractionVolume(InteractionVol } else if (caseL == 3) { - this->A_[globalIdx8][globalIdx8] += T[0][0]; - this->A_[globalIdx8][globalIdx4] += T[0][1]; - this->A_[globalIdx8][globalIdx2] += T[0][2]; - this->A_[globalIdx8][globalIdx7] += T[0][3]; + this->A_[eIdxGlobal8][eIdxGlobal8] += T[0][0]; + this->A_[eIdxGlobal8][eIdxGlobal4] += T[0][1]; + this->A_[eIdxGlobal8][eIdxGlobal2] += T[0][2]; + this->A_[eIdxGlobal8][eIdxGlobal7] += T[0][3]; - this->A_[globalIdx4][globalIdx8] -= TSecond[0][0]; - this->A_[globalIdx4][globalIdx4] -= TSecond[0][1]; - this->A_[globalIdx4][globalIdx2] -= TSecond[0][2]; - this->A_[globalIdx4][globalIdx7] -= TSecond[0][3]; + this->A_[eIdxGlobal4][eIdxGlobal8] -= TSecond[0][0]; + this->A_[eIdxGlobal4][eIdxGlobal4] -= TSecond[0][1]; + this->A_[eIdxGlobal4][eIdxGlobal2] -= TSecond[0][2]; + this->A_[eIdxGlobal4][eIdxGlobal7] -= TSecond[0][3]; u[0] = pc[7]; u[1] = pc[3]; @@ -2001,15 +2001,15 @@ void FvMpfaL3dPressure2p<TypeTag>::assembleInnerInteractionVolume(InteractionVol } else { - this->A_[globalIdx8][globalIdx8] += T[0][0]; - this->A_[globalIdx8][globalIdx4] += T[0][1]; - this->A_[globalIdx8][globalIdx6] += T[0][2]; - this->A_[globalIdx8][globalIdx3] += T[0][3]; + this->A_[eIdxGlobal8][eIdxGlobal8] += T[0][0]; + this->A_[eIdxGlobal8][eIdxGlobal4] += T[0][1]; + this->A_[eIdxGlobal8][eIdxGlobal6] += T[0][2]; + this->A_[eIdxGlobal8][eIdxGlobal3] += T[0][3]; - this->A_[globalIdx4][globalIdx8] -= TSecond[0][0]; - this->A_[globalIdx4][globalIdx4] -= TSecond[0][1]; - this->A_[globalIdx4][globalIdx6] -= TSecond[0][2]; - this->A_[globalIdx4][globalIdx3] -= TSecond[0][3]; + this->A_[eIdxGlobal4][eIdxGlobal8] -= TSecond[0][0]; + this->A_[eIdxGlobal4][eIdxGlobal4] -= TSecond[0][1]; + this->A_[eIdxGlobal4][eIdxGlobal6] -= TSecond[0][2]; + this->A_[eIdxGlobal4][eIdxGlobal3] -= TSecond[0][3]; u[0] = pc[7]; u[1] = pc[3]; @@ -2028,20 +2028,20 @@ void FvMpfaL3dPressure2p<TypeTag>::assembleInnerInteractionVolume(InteractionVol caseL = transmissibilityCalculator_.transmissibility(T, interactionVolume, lambda, 2, 6, 0, 4, 3, 7); TSecond = T; - T *= interactionVolumes_.faceAreaFactor(interactionVolume, globalIdx3, 2, 2); - TSecond *= interactionVolumes_.faceAreaFactor(interactionVolume, globalIdx7, 6, 0); + T *= interactionVolumes_.faceAreaFactor(interactionVolume, eIdxGlobal3, 2, 2); + TSecond *= interactionVolumes_.faceAreaFactor(interactionVolume, eIdxGlobal7, 6, 0); if (caseL == 1) { - this->A_[globalIdx3][globalIdx3] += T[0][0]; - this->A_[globalIdx3][globalIdx7] += T[0][1]; - this->A_[globalIdx3][globalIdx1] += T[0][2]; - this->A_[globalIdx3][globalIdx4] += T[0][3]; + this->A_[eIdxGlobal3][eIdxGlobal3] += T[0][0]; + this->A_[eIdxGlobal3][eIdxGlobal7] += T[0][1]; + this->A_[eIdxGlobal3][eIdxGlobal1] += T[0][2]; + this->A_[eIdxGlobal3][eIdxGlobal4] += T[0][3]; - this->A_[globalIdx7][globalIdx3] -= TSecond[0][0]; - this->A_[globalIdx7][globalIdx7] -= TSecond[0][1]; - this->A_[globalIdx7][globalIdx1] -= TSecond[0][2]; - this->A_[globalIdx7][globalIdx4] -= TSecond[0][3]; + this->A_[eIdxGlobal7][eIdxGlobal3] -= TSecond[0][0]; + this->A_[eIdxGlobal7][eIdxGlobal7] -= TSecond[0][1]; + this->A_[eIdxGlobal7][eIdxGlobal1] -= TSecond[0][2]; + this->A_[eIdxGlobal7][eIdxGlobal4] -= TSecond[0][3]; u[0] = pc[2]; u[1] = pc[6]; @@ -2057,15 +2057,15 @@ void FvMpfaL3dPressure2p<TypeTag>::assembleInnerInteractionVolume(InteractionVol } else if (caseL == 2) { - this->A_[globalIdx3][globalIdx3] += T[0][0]; - this->A_[globalIdx3][globalIdx7] += T[0][1]; - this->A_[globalIdx3][globalIdx5] += T[0][2]; - this->A_[globalIdx3][globalIdx8] += T[0][3]; + this->A_[eIdxGlobal3][eIdxGlobal3] += T[0][0]; + this->A_[eIdxGlobal3][eIdxGlobal7] += T[0][1]; + this->A_[eIdxGlobal3][eIdxGlobal5] += T[0][2]; + this->A_[eIdxGlobal3][eIdxGlobal8] += T[0][3]; - this->A_[globalIdx7][globalIdx3] -= TSecond[0][0]; - this->A_[globalIdx7][globalIdx7] -= TSecond[0][1]; - this->A_[globalIdx7][globalIdx5] -= TSecond[0][2]; - this->A_[globalIdx7][globalIdx8] -= TSecond[0][3]; + this->A_[eIdxGlobal7][eIdxGlobal3] -= TSecond[0][0]; + this->A_[eIdxGlobal7][eIdxGlobal7] -= TSecond[0][1]; + this->A_[eIdxGlobal7][eIdxGlobal5] -= TSecond[0][2]; + this->A_[eIdxGlobal7][eIdxGlobal8] -= TSecond[0][3]; u[0] = pc[2]; u[1] = pc[6]; @@ -2081,15 +2081,15 @@ void FvMpfaL3dPressure2p<TypeTag>::assembleInnerInteractionVolume(InteractionVol } else if (caseL == 3) { - this->A_[globalIdx3][globalIdx3] += T[0][0]; - this->A_[globalIdx3][globalIdx7] += T[0][1]; - this->A_[globalIdx3][globalIdx5] += T[0][2]; - this->A_[globalIdx3][globalIdx4] += T[0][3]; + this->A_[eIdxGlobal3][eIdxGlobal3] += T[0][0]; + this->A_[eIdxGlobal3][eIdxGlobal7] += T[0][1]; + this->A_[eIdxGlobal3][eIdxGlobal5] += T[0][2]; + this->A_[eIdxGlobal3][eIdxGlobal4] += T[0][3]; - this->A_[globalIdx7][globalIdx3] -= TSecond[0][0]; - this->A_[globalIdx7][globalIdx7] -= TSecond[0][1]; - this->A_[globalIdx7][globalIdx5] -= TSecond[0][2]; - this->A_[globalIdx7][globalIdx4] -= TSecond[0][3]; + this->A_[eIdxGlobal7][eIdxGlobal3] -= TSecond[0][0]; + this->A_[eIdxGlobal7][eIdxGlobal7] -= TSecond[0][1]; + this->A_[eIdxGlobal7][eIdxGlobal5] -= TSecond[0][2]; + this->A_[eIdxGlobal7][eIdxGlobal4] -= TSecond[0][3]; u[0] = pc[2]; u[1] = pc[6]; @@ -2105,15 +2105,15 @@ void FvMpfaL3dPressure2p<TypeTag>::assembleInnerInteractionVolume(InteractionVol } else { - this->A_[globalIdx3][globalIdx3] += T[0][0]; - this->A_[globalIdx3][globalIdx7] += T[0][1]; - this->A_[globalIdx3][globalIdx1] += T[0][2]; - this->A_[globalIdx3][globalIdx8] += T[0][3]; + this->A_[eIdxGlobal3][eIdxGlobal3] += T[0][0]; + this->A_[eIdxGlobal3][eIdxGlobal7] += T[0][1]; + this->A_[eIdxGlobal3][eIdxGlobal1] += T[0][2]; + this->A_[eIdxGlobal3][eIdxGlobal8] += T[0][3]; - this->A_[globalIdx7][globalIdx3] -= TSecond[0][0]; - this->A_[globalIdx7][globalIdx7] -= TSecond[0][1]; - this->A_[globalIdx7][globalIdx1] -= TSecond[0][2]; - this->A_[globalIdx7][globalIdx8] -= TSecond[0][3]; + this->A_[eIdxGlobal7][eIdxGlobal3] -= TSecond[0][0]; + this->A_[eIdxGlobal7][eIdxGlobal7] -= TSecond[0][1]; + this->A_[eIdxGlobal7][eIdxGlobal1] -= TSecond[0][2]; + this->A_[eIdxGlobal7][eIdxGlobal8] -= TSecond[0][3]; u[0] = pc[2]; u[1] = pc[6]; @@ -2228,14 +2228,14 @@ void FvMpfaL3dPressure2p<TypeTag>::assembleInnerInteractionVolume(InteractionVol if (i == nPhaseIdx) { // add capillary pressure term to right hand side - this->f_[globalIdx1] -= (fracFlow0 * pcFlux[0][0] - fracFlow3 * pcFlux[0][1] - fracFlow8 * pcFlux[0][2]); - this->f_[globalIdx2] -= (fracFlow1 * pcFlux[1][0] - fracFlow0 * pcFlux[1][1] + fracFlow9 * pcFlux[1][2]); - this->f_[globalIdx3] -= (fracFlow3 * pcFlux[2][0] - fracFlow2 * pcFlux[2][1] + fracFlow11 * pcFlux[2][2]); - this->f_[globalIdx4] -= (fracFlow2 * pcFlux[3][0] - fracFlow1 * pcFlux[3][1] - fracFlow10 * pcFlux[3][2]); - this->f_[globalIdx5] -= (fracFlow8 * pcFlux[4][0] - fracFlow4 * pcFlux[4][1] + fracFlow7 * pcFlux[4][2]); - this->f_[globalIdx6] -= (-fracFlow9 * pcFlux[5][0] - fracFlow5 * pcFlux[5][1] + fracFlow4 * pcFlux[5][2]); - this->f_[globalIdx7] -= (-fracFlow11 * pcFlux[6][0] - fracFlow7 * pcFlux[6][1] + fracFlow6 * pcFlux[6][2]); - this->f_[globalIdx8] -= (fracFlow10 * pcFlux[7][0] - fracFlow6 * pcFlux[7][1] + fracFlow5 * pcFlux[7][2]); + this->f_[eIdxGlobal1] -= (fracFlow0 * pcFlux[0][0] - fracFlow3 * pcFlux[0][1] - fracFlow8 * pcFlux[0][2]); + this->f_[eIdxGlobal2] -= (fracFlow1 * pcFlux[1][0] - fracFlow0 * pcFlux[1][1] + fracFlow9 * pcFlux[1][2]); + this->f_[eIdxGlobal3] -= (fracFlow3 * pcFlux[2][0] - fracFlow2 * pcFlux[2][1] + fracFlow11 * pcFlux[2][2]); + this->f_[eIdxGlobal4] -= (fracFlow2 * pcFlux[3][0] - fracFlow1 * pcFlux[3][1] - fracFlow10 * pcFlux[3][2]); + this->f_[eIdxGlobal5] -= (fracFlow8 * pcFlux[4][0] - fracFlow4 * pcFlux[4][1] + fracFlow7 * pcFlux[4][2]); + this->f_[eIdxGlobal6] -= (-fracFlow9 * pcFlux[5][0] - fracFlow5 * pcFlux[5][1] + fracFlow4 * pcFlux[5][2]); + this->f_[eIdxGlobal7] -= (-fracFlow11 * pcFlux[6][0] - fracFlow7 * pcFlux[6][1] + fracFlow6 * pcFlux[6][2]); + this->f_[eIdxGlobal8] -= (fracFlow10 * pcFlux[7][0] - fracFlow6 * pcFlux[7][1] + fracFlow5 * pcFlux[7][2]); } break; } @@ -2244,14 +2244,14 @@ void FvMpfaL3dPressure2p<TypeTag>::assembleInnerInteractionVolume(InteractionVol if (i == wPhaseIdx) { // add capillary pressure term to right hand side - this->f_[globalIdx1] += (fracFlow0 * pcFlux[0][0] - fracFlow3 * pcFlux[0][1] - fracFlow8 * pcFlux[0][2]); - this->f_[globalIdx2] += (fracFlow1 * pcFlux[1][0] - fracFlow0 * pcFlux[1][1] + fracFlow9 * pcFlux[1][2]); - this->f_[globalIdx3] += (fracFlow3 * pcFlux[2][0] - fracFlow2 * pcFlux[2][1] + fracFlow11 * pcFlux[2][2]); - this->f_[globalIdx4] += (fracFlow2 * pcFlux[3][0] - fracFlow1 * pcFlux[3][1] - fracFlow10 * pcFlux[3][2]); - this->f_[globalIdx5] += (fracFlow8 * pcFlux[4][0] - fracFlow4 * pcFlux[4][1] + fracFlow7 * pcFlux[4][2]); - this->f_[globalIdx6] += (-fracFlow9 * pcFlux[5][0] - fracFlow5 * pcFlux[5][1] + fracFlow4 * pcFlux[5][2]); - this->f_[globalIdx7] += (-fracFlow11 * pcFlux[6][0] - fracFlow7 * pcFlux[6][1] + fracFlow6 * pcFlux[6][2]); - this->f_[globalIdx8] += (fracFlow10 * pcFlux[7][0] - fracFlow6 * pcFlux[7][1] + fracFlow5 * pcFlux[7][2]); + this->f_[eIdxGlobal1] += (fracFlow0 * pcFlux[0][0] - fracFlow3 * pcFlux[0][1] - fracFlow8 * pcFlux[0][2]); + this->f_[eIdxGlobal2] += (fracFlow1 * pcFlux[1][0] - fracFlow0 * pcFlux[1][1] + fracFlow9 * pcFlux[1][2]); + this->f_[eIdxGlobal3] += (fracFlow3 * pcFlux[2][0] - fracFlow2 * pcFlux[2][1] + fracFlow11 * pcFlux[2][2]); + this->f_[eIdxGlobal4] += (fracFlow2 * pcFlux[3][0] - fracFlow1 * pcFlux[3][1] - fracFlow10 * pcFlux[3][2]); + this->f_[eIdxGlobal5] += (fracFlow8 * pcFlux[4][0] - fracFlow4 * pcFlux[4][1] + fracFlow7 * pcFlux[4][2]); + this->f_[eIdxGlobal6] += (-fracFlow9 * pcFlux[5][0] - fracFlow5 * pcFlux[5][1] + fracFlow4 * pcFlux[5][2]); + this->f_[eIdxGlobal7] += (-fracFlow11 * pcFlux[6][0] - fracFlow7 * pcFlux[6][1] + fracFlow6 * pcFlux[6][2]); + this->f_[eIdxGlobal8] += (fracFlow10 * pcFlux[7][0] - fracFlow6 * pcFlux[7][1] + fracFlow5 * pcFlux[7][2]); } break; } @@ -2292,10 +2292,10 @@ void FvMpfaL3dPressure2p<TypeTag>::assembleBoundaryInteractionVolume(Interaction Scalar volume = elementPointer->geometry().volume(); // cell index - int globalIdx = problem_.variables().index(*elementPointer); + int eIdxGlobal = problem_.variables().index(*elementPointer); //get the cell Data - CellData& cellData = problem_.variables().cellData(globalIdx); + CellData& cellData = problem_.variables().cellData(eIdxGlobal); // permeability vector at boundary DimMatrix permeability(problem_.spatialParams().intrinsicPermeability(*elementPointer)); @@ -2303,10 +2303,10 @@ void FvMpfaL3dPressure2p<TypeTag>::assembleBoundaryInteractionVolume(Interaction // evaluate right hand side PrimaryVariables source(0); problem_.source(source, *elementPointer); - this->f_[globalIdx] += volume / (8.0) + this->f_[eIdxGlobal] += volume / (8.0) * (source[wPhaseIdx] / density_[wPhaseIdx] + source[nPhaseIdx] / density_[nPhaseIdx]); - this->f_[globalIdx] += evaluateErrorTerm(cellData) * volume / (8.0); + this->f_[eIdxGlobal] += evaluateErrorTerm(cellData) * volume / (8.0); //get mobilities of the phases Dune::FieldVector<Scalar, numPhases> lambda(cellData.mobility(wPhaseIdx)); @@ -2407,8 +2407,8 @@ void FvMpfaL3dPressure2p<TypeTag>::assembleBoundaryInteractionVolume(Interaction Scalar entry = lambdaTotal * scalarPerm / dist * faceArea; // set diagonal entry and right hand side entry - this->A_[globalIdx][globalIdx] += entry; - this->f_[globalIdx] += entry * potentialBound; + this->A_[eIdxGlobal][eIdxGlobal] += entry; + this->f_[eIdxGlobal] += entry * potentialBound; if (pc == 0 && pcBound == 0) { @@ -2447,7 +2447,7 @@ void FvMpfaL3dPressure2p<TypeTag>::assembleBoundaryInteractionVolume(Interaction if (i == nPhaseIdx) { //add capillary pressure term to right hand side - this->f_[globalIdx] -= pcFlux; + this->f_[eIdxGlobal] -= pcFlux; } break; } @@ -2456,7 +2456,7 @@ void FvMpfaL3dPressure2p<TypeTag>::assembleBoundaryInteractionVolume(Interaction if (i == wPhaseIdx) { //add capillary pressure term to right hand side - this->f_[globalIdx] += pcFlux; + this->f_[eIdxGlobal] += pcFlux; } break; } @@ -2468,7 +2468,7 @@ void FvMpfaL3dPressure2p<TypeTag>::assembleBoundaryInteractionVolume(Interaction Scalar J = interactionVolume.getNeumannValues(intVolFaceIdx)[wPhaseIdx] / density_[wPhaseIdx]; J += interactionVolume.getNeumannValues(intVolFaceIdx)[nPhaseIdx] / density_[nPhaseIdx]; - this->f_[globalIdx] -= J; + this->f_[eIdxGlobal] -= J; } else { @@ -2490,9 +2490,9 @@ void FvMpfaL3dPressure2p<TypeTag>::updateMaterialLaws() ElementIterator eEndIt = problem_.gridView().template end<0>(); for (ElementIterator eIt = problem_.gridView().template begin<0>(); eIt != eEndIt; ++eIt) { - int globalIdx = problem_.variables().index(*eIt); + int eIdxGlobal = problem_.variables().index(*eIt); - CellData& cellData = problem_.variables().cellData(globalIdx); + CellData& cellData = problem_.variables().cellData(eIdxGlobal); Scalar satW = cellData.saturation(wPhaseIdx); diff --git a/dumux/decoupled/2p/diffusion/fvmpfa/lmethod/fvmpfal3dpressurevelocity2p.hh b/dumux/decoupled/2p/diffusion/fvmpfa/lmethod/fvmpfal3dpressurevelocity2p.hh index 99f56c519b23f148de73b15d1a552ac3ccfff2a2..ab3ff1fb2b2d8c55351f01cc9955a8e564ca7194 100644 --- a/dumux/decoupled/2p/diffusion/fvmpfa/lmethod/fvmpfal3dpressurevelocity2p.hh +++ b/dumux/decoupled/2p/diffusion/fvmpfa/lmethod/fvmpfal3dpressurevelocity2p.hh @@ -226,21 +226,21 @@ void FvMpfaL3dPressureVelocity2p<TypeTag>::calculateVelocity() if (interactionVolume.isInnerVolume()) { // cell index - int globalIdx[8]; + int eIdxGlobal[8]; for (int i = 0; i < 8; i++) { - globalIdx[i] = problem_.variables().index(*(interactionVolume.getSubVolumeElement(i))); + eIdxGlobal[i] = problem_.variables().index(*(interactionVolume.getSubVolumeElement(i))); } //get the cell Data - CellData & cellData1 = problem_.variables().cellData(globalIdx[0]); - CellData & cellData2 = problem_.variables().cellData(globalIdx[1]); - CellData & cellData3 = problem_.variables().cellData(globalIdx[2]); - CellData & cellData4 = problem_.variables().cellData(globalIdx[3]); - CellData & cellData5 = problem_.variables().cellData(globalIdx[4]); - CellData & cellData6 = problem_.variables().cellData(globalIdx[5]); - CellData & cellData7 = problem_.variables().cellData(globalIdx[6]); - CellData & cellData8 = problem_.variables().cellData(globalIdx[7]); + CellData & cellData1 = problem_.variables().cellData(eIdxGlobal[0]); + CellData & cellData2 = problem_.variables().cellData(eIdxGlobal[1]); + CellData & cellData3 = problem_.variables().cellData(eIdxGlobal[2]); + CellData & cellData4 = problem_.variables().cellData(eIdxGlobal[3]); + CellData & cellData5 = problem_.variables().cellData(eIdxGlobal[4]); + CellData & cellData6 = problem_.variables().cellData(eIdxGlobal[5]); + CellData & cellData7 = problem_.variables().cellData(eIdxGlobal[6]); + CellData & cellData8 = problem_.variables().cellData(eIdxGlobal[7]); velocity_.calculateInnerInteractionVolumeVelocity(interactionVolume, cellData1, cellData2, cellData3, cellData4, @@ -274,9 +274,9 @@ void FvMpfaL3dPressureVelocity2p<TypeTag>::calculateVelocity() ElementPointer & elementPointer = interactionVolume.getSubVolumeElement(elemIdx); // cell index - int globalIdx = problem_.variables().index(*elementPointer); + int eIdxGlobal = problem_.variables().index(*elementPointer); //get the cell Data - CellData& cellData = problem_.variables().cellData(globalIdx); + CellData& cellData = problem_.variables().cellData(eIdxGlobal); velocity_.calculateBoundaryInteractionVolumeVelocity(interactionVolume, cellData, elemIdx); } @@ -302,10 +302,10 @@ void FvMpfaL3dPressureVelocity2p<TypeTag>::calculateVelocity(const Intersection& ElementPointer elementPtrI = intersection.inside(); ElementPointer elementPtrJ = intersection.outside(); - int globalIdxI DUNE_UNUSED = problem_.variables().index(*elementPtrI); - int globalIdxJ = problem_.variables().index(*elementPtrJ); + int eIdxGlobalI DUNE_UNUSED = problem_.variables().index(*elementPtrI); + int eIdxGlobalJ = problem_.variables().index(*elementPtrJ); - CellData& cellDataJ = problem_.variables().cellData(globalIdxJ); + CellData& cellDataJ = problem_.variables().cellData(eIdxGlobalJ); const ReferenceElement& referenceElement = ReferenceElements::general(elementPtrI->geometry().type()); @@ -329,7 +329,7 @@ void FvMpfaL3dPressureVelocity2p<TypeTag>::calculateVelocity(const Intersection& int localMpfaElemIdxI = 0; int localMpfaElemIdxJ = 0; - int globalIdx[8]; + int eIdxGlobal[8]; for (int i = 0; i < 8; i++) { ElementPointer elem = *(interactionVolume.getSubVolumeElement(i)); @@ -339,8 +339,8 @@ void FvMpfaL3dPressureVelocity2p<TypeTag>::calculateVelocity(const Intersection& else if (elem == elementPtrJ) localMpfaElemIdxJ = i; - globalIdx[i] = problem_.variables().index(*elem); - cellDataTemp[i] = problem_.variables().cellData(globalIdx[i]); + eIdxGlobal[i] = problem_.variables().index(*elem); + cellDataTemp[i] = problem_.variables().cellData(eIdxGlobal[i]); } int mpfaFaceIdx = IndexTranslator::getFaceIndexFromElements(localMpfaElemIdxI, localMpfaElemIdxJ); diff --git a/dumux/decoupled/2p/diffusion/fvmpfa/lmethod/fvmpfal3dpressurevelocity2padaptive.hh b/dumux/decoupled/2p/diffusion/fvmpfa/lmethod/fvmpfal3dpressurevelocity2padaptive.hh index fddfca68c9812e71e4fa60f3fafd5914e9bb2eca..60029247dcd6db0164227ff16c3f93ee45203563 100644 --- a/dumux/decoupled/2p/diffusion/fvmpfa/lmethod/fvmpfal3dpressurevelocity2padaptive.hh +++ b/dumux/decoupled/2p/diffusion/fvmpfa/lmethod/fvmpfal3dpressurevelocity2padaptive.hh @@ -227,21 +227,21 @@ void FvMpfaL3dPressureVelocity2pAdaptive<TypeTag>::calculateVelocity() if (interactionVolume.isInnerVolume()) { // cell index - int globalIdx[8]; + int eIdxGlobal[8]; for (int i = 0; i < 8; i++) { - globalIdx[i] = problem_.variables().index(*(interactionVolume.getSubVolumeElement(i))); + eIdxGlobal[i] = problem_.variables().index(*(interactionVolume.getSubVolumeElement(i))); } //get the cell Data - CellData & cellData1 = problem_.variables().cellData(globalIdx[0]); - CellData & cellData2 = problem_.variables().cellData(globalIdx[1]); - CellData & cellData3 = problem_.variables().cellData(globalIdx[2]); - CellData & cellData4 = problem_.variables().cellData(globalIdx[3]); - CellData & cellData5 = problem_.variables().cellData(globalIdx[4]); - CellData & cellData6 = problem_.variables().cellData(globalIdx[5]); - CellData & cellData7 = problem_.variables().cellData(globalIdx[6]); - CellData & cellData8 = problem_.variables().cellData(globalIdx[7]); + CellData & cellData1 = problem_.variables().cellData(eIdxGlobal[0]); + CellData & cellData2 = problem_.variables().cellData(eIdxGlobal[1]); + CellData & cellData3 = problem_.variables().cellData(eIdxGlobal[2]); + CellData & cellData4 = problem_.variables().cellData(eIdxGlobal[3]); + CellData & cellData5 = problem_.variables().cellData(eIdxGlobal[4]); + CellData & cellData6 = problem_.variables().cellData(eIdxGlobal[5]); + CellData & cellData7 = problem_.variables().cellData(eIdxGlobal[6]); + CellData & cellData8 = problem_.variables().cellData(eIdxGlobal[7]); if (!interactionVolume.isHangingNodeVolume()) { @@ -284,9 +284,9 @@ void FvMpfaL3dPressureVelocity2pAdaptive<TypeTag>::calculateVelocity() ElementPointer & elementPointer = interactionVolume.getSubVolumeElement(elemIdx); // cell index - int globalIdx = problem_.variables().index(*elementPointer); + int eIdxGlobal = problem_.variables().index(*elementPointer); //get the cell Data - CellData& cellData = problem_.variables().cellData(globalIdx); + CellData& cellData = problem_.variables().cellData(eIdxGlobal); velocity_.calculateBoundaryInteractionVolumeVelocity(interactionVolume, cellData, elemIdx); } @@ -313,10 +313,10 @@ void FvMpfaL3dPressureVelocity2pAdaptive<TypeTag>::calculateVelocity(const Inter int levelI = elementPtrI->level(); int levelJ = elementPtrJ->level(); - int globalIdxI = problem_.variables().index(*elementPtrI); - int globalIdxJ = problem_.variables().index(*elementPtrJ); + int eIdxGlobalI = problem_.variables().index(*elementPtrI); + int eIdxGlobalJ = problem_.variables().index(*elementPtrJ); - CellData& cellDataJ = problem_.variables().cellData(globalIdxJ); + CellData& cellDataJ = problem_.variables().cellData(eIdxGlobalJ); int indexInInside = intersection.indexInInside(); int indexInOutside = intersection.indexInOutside(); @@ -341,11 +341,11 @@ void FvMpfaL3dPressureVelocity2pAdaptive<TypeTag>::calculateVelocity(const Inter if (levelI >= levelJ) { - vIdxGlobal = this->interactionVolumes_.faceVerticeIndices(globalIdxI, indexInInside); + vIdxGlobal = this->interactionVolumes_.faceVerticeIndices(eIdxGlobalI, indexInInside); } else { - vIdxGlobal = this->interactionVolumes_.faceVerticeIndices(globalIdxJ, indexInOutside); + vIdxGlobal = this->interactionVolumes_.faceVerticeIndices(eIdxGlobalJ, indexInOutside); } std::set<int>::iterator itEnd = vIdxGlobal.end(); @@ -359,7 +359,7 @@ void FvMpfaL3dPressureVelocity2pAdaptive<TypeTag>::calculateVelocity(const Inter // cell index std::vector<std::pair<int,int> > localMpfaElemIdx(0); - int globalIdx[8]; + int eIdxGlobal[8]; for (int i = 0; i < 8; i++) { ElementPointer elem = *(interactionVolume.getSubVolumeElement(i)); @@ -396,8 +396,8 @@ void FvMpfaL3dPressureVelocity2pAdaptive<TypeTag>::calculateVelocity(const Inter localMpfaElemIdx[0].second = i; } - globalIdx[i] = problem_.variables().index(*elem); - cellDataTemp[i] = problem_.variables().cellData(globalIdx[i]); + eIdxGlobal[i] = problem_.variables().index(*elem); + cellDataTemp[i] = problem_.variables().cellData(eIdxGlobal[i]); } int size = localMpfaElemIdx.size(); @@ -450,7 +450,7 @@ void FvMpfaL3dPressureVelocity2pAdaptive<TypeTag>::calculateVelocity(const Inter { for (int i = 0; i < 8; i++) { - cellDataTemp[i] = problem_.variables().cellData(globalIdx[i]); + cellDataTemp[i] = problem_.variables().cellData(eIdxGlobal[i]); } } } diff --git a/dumux/decoupled/2p/diffusion/fvmpfa/lmethod/fvmpfal3dvelocity2p.hh b/dumux/decoupled/2p/diffusion/fvmpfa/lmethod/fvmpfal3dvelocity2p.hh index 3fea23e7cfaa7262747c86854aa2a99383be9751..521e74943b09f2624206b9df7dacde4aa84ff8e0 100644 --- a/dumux/decoupled/2p/diffusion/fvmpfa/lmethod/fvmpfal3dvelocity2p.hh +++ b/dumux/decoupled/2p/diffusion/fvmpfa/lmethod/fvmpfal3dvelocity2p.hh @@ -205,9 +205,9 @@ public: for (ElementIterator eIt = problem_.gridView().template begin<0>(); eIt != eEndIt; ++eIt) { // cell index - int globalIdx = problem_.variables().index(*eIt); + int eIdxGlobal = problem_.variables().index(*eIt); - CellData & cellData = problem_.variables().cellData(globalIdx); + CellData & cellData = problem_.variables().cellData(eIdxGlobal); Dune::FieldVector < Scalar, 2 * dim > fluxW(0); Dune::FieldVector < Scalar, 2 * dim > fluxNw(0); @@ -239,7 +239,7 @@ public: jacobianT.umtv(refVelocity, elementVelocity); elementVelocity /= eIt->geometry().integrationElement(localPos); - velocityWetting[globalIdx] = elementVelocity; + velocityWetting[eIdxGlobal] = elementVelocity; refVelocity = 0; refVelocity[0] = 0.5 * (fluxNw[1] - fluxNw[0]); @@ -251,7 +251,7 @@ public: jacobianT.umtv(refVelocity, elementVelocity); elementVelocity /= eIt->geometry().integrationElement(localPos); - velocityNonwetting[globalIdx] = elementVelocity; + velocityNonwetting[eIdxGlobal] = elementVelocity; } writer.attachCellData(velocityWetting, "wetting-velocity", dim); @@ -315,14 +315,14 @@ void FvMpfaL3dVelocity2p<TypeTag>::calculateInnerInteractionVolumeVelocity(Inter ElementPointer& elementPointer8 = interactionVolume.getSubVolumeElement(7); // cell index - int globalIdx1 = problem_.variables().index(*elementPointer1); - int globalIdx2 = problem_.variables().index(*elementPointer2); - int globalIdx3 = problem_.variables().index(*elementPointer3); - int globalIdx4 = problem_.variables().index(*elementPointer4); - int globalIdx5 = problem_.variables().index(*elementPointer5); - int globalIdx6 = problem_.variables().index(*elementPointer6); - int globalIdx7 = problem_.variables().index(*elementPointer7); - int globalIdx8 = problem_.variables().index(*elementPointer8); + int eIdxGlobal1 = problem_.variables().index(*elementPointer1); + int eIdxGlobal2 = problem_.variables().index(*elementPointer2); + int eIdxGlobal3 = problem_.variables().index(*elementPointer3); + int eIdxGlobal4 = problem_.variables().index(*elementPointer4); + int eIdxGlobal5 = problem_.variables().index(*elementPointer5); + int eIdxGlobal6 = problem_.variables().index(*elementPointer6); + int eIdxGlobal7 = problem_.variables().index(*elementPointer7); + int eIdxGlobal8 = problem_.variables().index(*elementPointer8); // pressures flux calculation Dune::FieldVector<Scalar, 8> potW(0); @@ -1786,30 +1786,30 @@ void FvMpfaL3dVelocity2p<TypeTag>::calculateInnerInteractionVolumeVelocity(Inter } } - vel12 *= flux[0] / (interactionVolumes.getRealFluxFaceArea(interactionVolume, globalIdx1, 0, 0)); - vel21 *= flux[0] / (interactionVolumes.getRealFluxFaceArea(interactionVolume, globalIdx2, 1, 1)); - vel24 *= flux[1] / (interactionVolumes.getRealFluxFaceArea(interactionVolume, globalIdx2, 1, 0)); - vel42 *= flux[1] / (interactionVolumes.getRealFluxFaceArea(interactionVolume, globalIdx4, 3, 1)); - vel43 *= flux[2] / (interactionVolumes.getRealFluxFaceArea(interactionVolume, globalIdx4, 3, 0)); - vel34 *= flux[2] / (interactionVolumes.getRealFluxFaceArea(interactionVolume, globalIdx3, 2, 1)); - vel31 *= flux[3] / (interactionVolumes.getRealFluxFaceArea(interactionVolume, globalIdx3, 2, 0)); - vel13 *= flux[3] / (interactionVolumes.getRealFluxFaceArea(interactionVolume, globalIdx1, 0, 1)); - vel65 *= flux[4] / (interactionVolumes.getRealFluxFaceArea(interactionVolume, globalIdx6, 5, 2)); - vel56 *= flux[4] / (interactionVolumes.getRealFluxFaceArea(interactionVolume, globalIdx5, 4, 1)); - vel86 *= flux[5] / (interactionVolumes.getRealFluxFaceArea(interactionVolume, globalIdx8, 7, 2)); - vel68 *= flux[5] / (interactionVolumes.getRealFluxFaceArea(interactionVolume, globalIdx6, 5, 1)); - vel78 *= flux[6] / (interactionVolumes.getRealFluxFaceArea(interactionVolume, globalIdx7, 6, 2)); - vel87 *= flux[6] / (interactionVolumes.getRealFluxFaceArea(interactionVolume, globalIdx8, 7, 1)); - vel57 *= flux[7] / (interactionVolumes.getRealFluxFaceArea(interactionVolume, globalIdx5, 4, 2)); - vel75 *= flux[7] / (interactionVolumes.getRealFluxFaceArea(interactionVolume, globalIdx7, 6, 1)); - vel51 *= flux[8] / (interactionVolumes.getRealFluxFaceArea(interactionVolume, globalIdx5, 4, 0)); - vel15 *= flux[8] / (interactionVolumes.getRealFluxFaceArea(interactionVolume, globalIdx1, 0, 2)); - vel26 *= flux[9] / (interactionVolumes.getRealFluxFaceArea(interactionVolume, globalIdx2, 1, 2)); - vel62 *= flux[9] / (interactionVolumes.getRealFluxFaceArea(interactionVolume, globalIdx6, 5, 0)); - vel84 *= flux[10] / (interactionVolumes.getRealFluxFaceArea(interactionVolume, globalIdx8, 7, 0)); - vel48 *= flux[10] / (interactionVolumes.getRealFluxFaceArea(interactionVolume, globalIdx4, 3, 2)); - vel37 *= flux[11] / (interactionVolumes.getRealFluxFaceArea(interactionVolume, globalIdx3, 2, 2)); - vel73 *= flux[11] / (interactionVolumes.getRealFluxFaceArea(interactionVolume, globalIdx7, 6, 0)); + vel12 *= flux[0] / (interactionVolumes.getRealFluxFaceArea(interactionVolume, eIdxGlobal1, 0, 0)); + vel21 *= flux[0] / (interactionVolumes.getRealFluxFaceArea(interactionVolume, eIdxGlobal2, 1, 1)); + vel24 *= flux[1] / (interactionVolumes.getRealFluxFaceArea(interactionVolume, eIdxGlobal2, 1, 0)); + vel42 *= flux[1] / (interactionVolumes.getRealFluxFaceArea(interactionVolume, eIdxGlobal4, 3, 1)); + vel43 *= flux[2] / (interactionVolumes.getRealFluxFaceArea(interactionVolume, eIdxGlobal4, 3, 0)); + vel34 *= flux[2] / (interactionVolumes.getRealFluxFaceArea(interactionVolume, eIdxGlobal3, 2, 1)); + vel31 *= flux[3] / (interactionVolumes.getRealFluxFaceArea(interactionVolume, eIdxGlobal3, 2, 0)); + vel13 *= flux[3] / (interactionVolumes.getRealFluxFaceArea(interactionVolume, eIdxGlobal1, 0, 1)); + vel65 *= flux[4] / (interactionVolumes.getRealFluxFaceArea(interactionVolume, eIdxGlobal6, 5, 2)); + vel56 *= flux[4] / (interactionVolumes.getRealFluxFaceArea(interactionVolume, eIdxGlobal5, 4, 1)); + vel86 *= flux[5] / (interactionVolumes.getRealFluxFaceArea(interactionVolume, eIdxGlobal8, 7, 2)); + vel68 *= flux[5] / (interactionVolumes.getRealFluxFaceArea(interactionVolume, eIdxGlobal6, 5, 1)); + vel78 *= flux[6] / (interactionVolumes.getRealFluxFaceArea(interactionVolume, eIdxGlobal7, 6, 2)); + vel87 *= flux[6] / (interactionVolumes.getRealFluxFaceArea(interactionVolume, eIdxGlobal8, 7, 1)); + vel57 *= flux[7] / (interactionVolumes.getRealFluxFaceArea(interactionVolume, eIdxGlobal5, 4, 2)); + vel75 *= flux[7] / (interactionVolumes.getRealFluxFaceArea(interactionVolume, eIdxGlobal7, 6, 1)); + vel51 *= flux[8] / (interactionVolumes.getRealFluxFaceArea(interactionVolume, eIdxGlobal5, 4, 0)); + vel15 *= flux[8] / (interactionVolumes.getRealFluxFaceArea(interactionVolume, eIdxGlobal1, 0, 2)); + vel26 *= flux[9] / (interactionVolumes.getRealFluxFaceArea(interactionVolume, eIdxGlobal2, 1, 2)); + vel62 *= flux[9] / (interactionVolumes.getRealFluxFaceArea(interactionVolume, eIdxGlobal6, 5, 0)); + vel84 *= flux[10] / (interactionVolumes.getRealFluxFaceArea(interactionVolume, eIdxGlobal8, 7, 0)); + vel48 *= flux[10] / (interactionVolumes.getRealFluxFaceArea(interactionVolume, eIdxGlobal4, 3, 2)); + vel37 *= flux[11] / (interactionVolumes.getRealFluxFaceArea(interactionVolume, eIdxGlobal3, 2, 2)); + vel73 *= flux[11] / (interactionVolumes.getRealFluxFaceArea(interactionVolume, eIdxGlobal7, 6, 0)); Scalar lambdaT0 = lambda0Upw[wPhaseIdx] + lambda0Upw[nPhaseIdx]; diff --git a/dumux/decoupled/2p/diffusion/fvmpfa/omethod/fvmpfao2dpressure2p.hh b/dumux/decoupled/2p/diffusion/fvmpfa/omethod/fvmpfao2dpressure2p.hh index 14cdc0a4c37c2e14a76c8a6766e58c47fc54525b..31c38924080cf8126a9f706e34326dc6b61fcd24 100644 --- a/dumux/decoupled/2p/diffusion/fvmpfa/omethod/fvmpfao2dpressure2p.hh +++ b/dumux/decoupled/2p/diffusion/fvmpfa/omethod/fvmpfao2dpressure2p.hh @@ -263,14 +263,14 @@ public: */ void storePressureSolution(const Element& element) { - int globalIdx = problem_.variables().index(element); - CellData& cellData = problem_.variables().cellData(globalIdx); + int eIdxGlobal = problem_.variables().index(element); + CellData& cellData = problem_.variables().cellData(eIdxGlobal); switch (pressureType_) { case pw: { - Scalar potW = this->pressure()[globalIdx]; + Scalar potW = this->pressure()[eIdxGlobal]; Scalar gravityDiff = (problem_.bBoxMax() - element.geometry().center()) * gravity_; Scalar potPc = cellData.capillaryPressure() @@ -288,7 +288,7 @@ public: } case pn: { - Scalar potNw = this->pressure()[globalIdx]; + Scalar potNw = this->pressure()[eIdxGlobal]; Scalar gravityDiff = (problem_.bBoxMax() - element.geometry().center()) * gravity_; Scalar potPc = cellData.capillaryPressure() @@ -509,7 +509,7 @@ void FvMpfaO2dPressure2p<TypeTag>::initializeMatrix() for (ElementIterator eIt = eItBegin; eIt != eEndIt; ++eIt) { // cell index - int globalIdxI = problem_.variables().index(*eIt); + int eIdxGlobalI = problem_.variables().index(*eIt); // initialize row size int rowSize = 1; @@ -596,8 +596,8 @@ void FvMpfaO2dPressure2p<TypeTag>::initializeMatrix() } // end of 'for' IntersectionIterator - // set number of indices in row globalIdxI to rowSize - this->A_.setrowsize(globalIdxI, rowSize); + // set number of indices in row eIdxGlobalI to rowSize + this->A_.setrowsize(eIdxGlobalI, rowSize); } // end of 'for' ElementIterator @@ -608,10 +608,10 @@ void FvMpfaO2dPressure2p<TypeTag>::initializeMatrix() for (ElementIterator eIt = eItBegin; eIt != eEndIt; ++eIt) { // cell index - int globalIdxI = problem_.variables().index(*eIt); + int eIdxGlobalI = problem_.variables().index(*eIt); // add diagonal index - this->A_.addindex(globalIdxI, globalIdxI); + this->A_.addindex(eIdxGlobalI, eIdxGlobalI); // run through all intersections with neighbors IntersectionIterator isItBegin = problem_.gridView().ibegin(*eIt); @@ -668,11 +668,11 @@ void FvMpfaO2dPressure2p<TypeTag>::initializeMatrix() { // access neighbor ElementPointer outside = isIt->outside(); - int globalIdxJ = problem_.variables().index(*outside); + int eIdxGlobalJ = problem_.variables().index(*outside); // add off diagonal index // add index (row,col) to the matrix - this->A_.addindex(globalIdxI, globalIdxJ); + this->A_.addindex(eIdxGlobalI, eIdxGlobalJ); } if (isIt->neighbor() && nextIsIt->neighbor()) @@ -696,9 +696,9 @@ void FvMpfaO2dPressure2p<TypeTag>::initializeMatrix() if (innerisItoutside == innernextisItoutside && innerisItoutside != isIt->inside()) { - int globalIdxJ = problem_.variables().index(*innerisItoutside); + int eIdxGlobalJ = problem_.variables().index(*innerisItoutside); - this->A_.addindex(globalIdxI, globalIdxJ); + this->A_.addindex(eIdxGlobalI, eIdxGlobalJ); } } } @@ -754,7 +754,7 @@ void FvMpfaO2dPressure2p<TypeTag>::storeInteractionVolumeInfo() { // get common geometry information for the following computation - int globalIdx1 = problem_.variables().index(*eIt); + int eIdxGlobal1 = problem_.variables().index(*eIt); // get global coordinate of cell 1 center const GlobalPosition& globalPos1 = eIt->geometry().center(); @@ -916,7 +916,7 @@ void FvMpfaO2dPressure2p<TypeTag>::storeInteractionVolumeInfo() // access neighbor cell 2 of 'isIt12' ElementPointer elementPointer2 = isIt12->outside(); - int globalIdx2 = problem_.variables().index(*elementPointer2); + int eIdxGlobal2 = problem_.variables().index(*elementPointer2); //store pointer 2 interactionVolumes_[globalVertIdx1234].setSubVolumeElement(elementPointer2, 1); @@ -1147,8 +1147,8 @@ void FvMpfaO2dPressure2p<TypeTag>::storeInteractionVolumeInfo() interactionVolumes_[globalVertIdx1234].setOutsideFace(2); - innerBoundaryVolumeFaces_[globalIdx1][isIt12->indexInInside()] = true; - innerBoundaryVolumeFaces_[globalIdx2][isIt12->indexInOutside()] = true; + innerBoundaryVolumeFaces_[eIdxGlobal1][isIt12->indexInInside()] = true; + innerBoundaryVolumeFaces_[eIdxGlobal2][isIt12->indexInOutside()] = true; // compute normal vectors nu23, nu21; DimVector nu23(0); @@ -1244,7 +1244,7 @@ void FvMpfaO2dPressure2p<TypeTag>::storeInteractionVolumeInfo() // get global coordinate of neighbor cell 3 center const GlobalPosition& globalPos4 = elementPointer4->geometry().center(); - int globalIdx4 = problem_.variables().index(*elementPointer4); + int eIdxGlobal4 = problem_.variables().index(*elementPointer4); bool finished = false; @@ -1295,8 +1295,8 @@ void FvMpfaO2dPressure2p<TypeTag>::storeInteractionVolumeInfo() interactionVolumes_[globalVertIdx1234].setOutsideFace(1); - innerBoundaryVolumeFaces_[globalIdx1][isIt14->indexInInside()] = true; - innerBoundaryVolumeFaces_[globalIdx4][isIt14->indexInOutside()] = true; + innerBoundaryVolumeFaces_[eIdxGlobal1][isIt14->indexInInside()] = true; + innerBoundaryVolumeFaces_[eIdxGlobal4][isIt14->indexInOutside()] = true; // get absolute permeability of neighbor cell 2 DimMatrix K4( @@ -1380,36 +1380,36 @@ void FvMpfaO2dPressure2p<TypeTag>::assemble() Scalar volume4 = elementPointer4->geometry().volume(); // cell index - int globalIdx1 = problem_.variables().index(*elementPointer1); - int globalIdx2 = problem_.variables().index(*elementPointer2); - int globalIdx3 = problem_.variables().index(*elementPointer3); - int globalIdx4 = problem_.variables().index(*elementPointer4); + int eIdxGlobal1 = problem_.variables().index(*elementPointer1); + int eIdxGlobal2 = problem_.variables().index(*elementPointer2); + int eIdxGlobal3 = problem_.variables().index(*elementPointer3); + int eIdxGlobal4 = problem_.variables().index(*elementPointer4); //get the cell Data - CellData& cellData1 = problem_.variables().cellData(globalIdx1); - CellData& cellData2 = problem_.variables().cellData(globalIdx2); - CellData& cellData3 = problem_.variables().cellData(globalIdx3); - CellData& cellData4 = problem_.variables().cellData(globalIdx4); + CellData& cellData1 = problem_.variables().cellData(eIdxGlobal1); + CellData& cellData2 = problem_.variables().cellData(eIdxGlobal2); + CellData& cellData3 = problem_.variables().cellData(eIdxGlobal3); + CellData& cellData4 = problem_.variables().cellData(eIdxGlobal4); // evaluate right hand side PrimaryVariables source(0.0); problem_.source(source, *elementPointer1); - this->f_[globalIdx1] += volume1 / (4.0) + this->f_[eIdxGlobal1] += volume1 / (4.0) * (source[wPhaseIdx] / density_[wPhaseIdx] + source[nPhaseIdx] / density_[nPhaseIdx]); problem_.source(source, *elementPointer2); - this->f_[globalIdx2] += volume2 / (4.0) + this->f_[eIdxGlobal2] += volume2 / (4.0) * (source[wPhaseIdx] / density_[wPhaseIdx] + source[nPhaseIdx] / density_[nPhaseIdx]); problem_.source(source, *elementPointer3); - this->f_[globalIdx3] += volume3 / (4.0) + this->f_[eIdxGlobal3] += volume3 / (4.0) * (source[wPhaseIdx] / density_[wPhaseIdx] + source[nPhaseIdx] / density_[nPhaseIdx]); problem_.source(source, *elementPointer4); - this->f_[globalIdx4] += volume4 / (4.0) + this->f_[eIdxGlobal4] += volume4 / (4.0) * (source[wPhaseIdx] / density_[wPhaseIdx] + source[nPhaseIdx] / density_[nPhaseIdx]); - this->f_[globalIdx1] += evaluateErrorTerm_(cellData1) * volume1 / (4.0); - this->f_[globalIdx2] += evaluateErrorTerm_(cellData2) * volume2 / (4.0); - this->f_[globalIdx3] += evaluateErrorTerm_(cellData3) * volume3 / (4.0); - this->f_[globalIdx4] += evaluateErrorTerm_(cellData4) * volume4 / (4.0); + this->f_[eIdxGlobal1] += evaluateErrorTerm_(cellData1) * volume1 / (4.0); + this->f_[eIdxGlobal2] += evaluateErrorTerm_(cellData2) * volume2 / (4.0); + this->f_[eIdxGlobal3] += evaluateErrorTerm_(cellData3) * volume3 / (4.0); + this->f_[eIdxGlobal4] += evaluateErrorTerm_(cellData4) * volume4 / (4.0); //get mobilities of the phases Dune::FieldVector<Scalar, numPhases> lambda1(cellData1.mobility(wPhaseIdx)); @@ -1504,82 +1504,82 @@ void FvMpfaO2dPressure2p<TypeTag>::assemble() // std::cout<<"Tpress = "<<T<<"\n"; // assemble the global matrix this->A_ and right hand side f - this->A_[globalIdx1][globalIdx1] += T[0][0] + T[3][0]; - this->A_[globalIdx1][globalIdx2] += T[0][1] + T[3][1]; - this->A_[globalIdx1][globalIdx3] += T[0][2] + T[3][2]; - this->A_[globalIdx1][globalIdx4] += T[0][3] + T[3][3]; - - this->A_[globalIdx2][globalIdx1] += -T[0][0] + T[1][0]; - this->A_[globalIdx2][globalIdx2] += -T[0][1] + T[1][1]; - this->A_[globalIdx2][globalIdx3] += -T[0][2] + T[1][2]; - this->A_[globalIdx2][globalIdx4] += -T[0][3] + T[1][3]; - - this->A_[globalIdx3][globalIdx1] -= T[1][0] + T[2][0]; - this->A_[globalIdx3][globalIdx2] -= T[1][1] + T[2][1]; - this->A_[globalIdx3][globalIdx3] -= T[1][2] + T[2][2]; - this->A_[globalIdx3][globalIdx4] -= T[1][3] + T[2][3]; - - this->A_[globalIdx4][globalIdx1] += T[2][0] - T[3][0]; - this->A_[globalIdx4][globalIdx2] += T[2][1] - T[3][1]; - this->A_[globalIdx4][globalIdx3] += T[2][2] - T[3][2]; - this->A_[globalIdx4][globalIdx4] += T[2][3] - T[3][3]; - - if (innerBoundaryVolumeFaces_[globalIdx1][interactionVolume.getIndexOnElement(0, 0)]) + this->A_[eIdxGlobal1][eIdxGlobal1] += T[0][0] + T[3][0]; + this->A_[eIdxGlobal1][eIdxGlobal2] += T[0][1] + T[3][1]; + this->A_[eIdxGlobal1][eIdxGlobal3] += T[0][2] + T[3][2]; + this->A_[eIdxGlobal1][eIdxGlobal4] += T[0][3] + T[3][3]; + + this->A_[eIdxGlobal2][eIdxGlobal1] += -T[0][0] + T[1][0]; + this->A_[eIdxGlobal2][eIdxGlobal2] += -T[0][1] + T[1][1]; + this->A_[eIdxGlobal2][eIdxGlobal3] += -T[0][2] + T[1][2]; + this->A_[eIdxGlobal2][eIdxGlobal4] += -T[0][3] + T[1][3]; + + this->A_[eIdxGlobal3][eIdxGlobal1] -= T[1][0] + T[2][0]; + this->A_[eIdxGlobal3][eIdxGlobal2] -= T[1][1] + T[2][1]; + this->A_[eIdxGlobal3][eIdxGlobal3] -= T[1][2] + T[2][2]; + this->A_[eIdxGlobal3][eIdxGlobal4] -= T[1][3] + T[2][3]; + + this->A_[eIdxGlobal4][eIdxGlobal1] += T[2][0] - T[3][0]; + this->A_[eIdxGlobal4][eIdxGlobal2] += T[2][1] - T[3][1]; + this->A_[eIdxGlobal4][eIdxGlobal3] += T[2][2] - T[3][2]; + this->A_[eIdxGlobal4][eIdxGlobal4] += T[2][3] - T[3][3]; + + if (innerBoundaryVolumeFaces_[eIdxGlobal1][interactionVolume.getIndexOnElement(0, 0)]) { - this->A_[globalIdx1][globalIdx1] += T[0][0]; - this->A_[globalIdx1][globalIdx2] += T[0][1]; - this->A_[globalIdx1][globalIdx3] += T[0][2]; - this->A_[globalIdx1][globalIdx4] += T[0][3]; + this->A_[eIdxGlobal1][eIdxGlobal1] += T[0][0]; + this->A_[eIdxGlobal1][eIdxGlobal2] += T[0][1]; + this->A_[eIdxGlobal1][eIdxGlobal3] += T[0][2]; + this->A_[eIdxGlobal1][eIdxGlobal4] += T[0][3]; } - if (innerBoundaryVolumeFaces_[globalIdx1][interactionVolume.getIndexOnElement(0, 1)]) + if (innerBoundaryVolumeFaces_[eIdxGlobal1][interactionVolume.getIndexOnElement(0, 1)]) { - this->A_[globalIdx1][globalIdx1] += T[3][0]; - this->A_[globalIdx1][globalIdx2] += T[3][1]; - this->A_[globalIdx1][globalIdx3] += T[3][2]; - this->A_[globalIdx1][globalIdx4] += T[3][3]; + this->A_[eIdxGlobal1][eIdxGlobal1] += T[3][0]; + this->A_[eIdxGlobal1][eIdxGlobal2] += T[3][1]; + this->A_[eIdxGlobal1][eIdxGlobal3] += T[3][2]; + this->A_[eIdxGlobal1][eIdxGlobal4] += T[3][3]; } - if (innerBoundaryVolumeFaces_[globalIdx2][interactionVolume.getIndexOnElement(1, 0)]) + if (innerBoundaryVolumeFaces_[eIdxGlobal2][interactionVolume.getIndexOnElement(1, 0)]) { - this->A_[globalIdx2][globalIdx1] += T[1][0]; - this->A_[globalIdx2][globalIdx2] += T[1][1]; - this->A_[globalIdx2][globalIdx3] += T[1][2]; - this->A_[globalIdx2][globalIdx4] += T[1][3]; + this->A_[eIdxGlobal2][eIdxGlobal1] += T[1][0]; + this->A_[eIdxGlobal2][eIdxGlobal2] += T[1][1]; + this->A_[eIdxGlobal2][eIdxGlobal3] += T[1][2]; + this->A_[eIdxGlobal2][eIdxGlobal4] += T[1][3]; } - if (innerBoundaryVolumeFaces_[globalIdx2][interactionVolume.getIndexOnElement(1, 1)]) + if (innerBoundaryVolumeFaces_[eIdxGlobal2][interactionVolume.getIndexOnElement(1, 1)]) { - this->A_[globalIdx2][globalIdx1] += -T[0][0]; - this->A_[globalIdx2][globalIdx2] += -T[0][1]; - this->A_[globalIdx2][globalIdx3] += -T[0][2]; - this->A_[globalIdx2][globalIdx4] += -T[0][3]; + this->A_[eIdxGlobal2][eIdxGlobal1] += -T[0][0]; + this->A_[eIdxGlobal2][eIdxGlobal2] += -T[0][1]; + this->A_[eIdxGlobal2][eIdxGlobal3] += -T[0][2]; + this->A_[eIdxGlobal2][eIdxGlobal4] += -T[0][3]; } - if (innerBoundaryVolumeFaces_[globalIdx3][interactionVolume.getIndexOnElement(2, 0)]) + if (innerBoundaryVolumeFaces_[eIdxGlobal3][interactionVolume.getIndexOnElement(2, 0)]) { - this->A_[globalIdx3][globalIdx1] -= T[2][0]; - this->A_[globalIdx3][globalIdx2] -= T[2][1]; - this->A_[globalIdx3][globalIdx3] -= T[2][2]; - this->A_[globalIdx3][globalIdx4] -= T[2][3]; + this->A_[eIdxGlobal3][eIdxGlobal1] -= T[2][0]; + this->A_[eIdxGlobal3][eIdxGlobal2] -= T[2][1]; + this->A_[eIdxGlobal3][eIdxGlobal3] -= T[2][2]; + this->A_[eIdxGlobal3][eIdxGlobal4] -= T[2][3]; } - if (innerBoundaryVolumeFaces_[globalIdx3][interactionVolume.getIndexOnElement(2, 1)]) + if (innerBoundaryVolumeFaces_[eIdxGlobal3][interactionVolume.getIndexOnElement(2, 1)]) { - this->A_[globalIdx3][globalIdx1] -= T[1][0]; - this->A_[globalIdx3][globalIdx2] -= T[1][1]; - this->A_[globalIdx3][globalIdx3] -= T[1][2]; - this->A_[globalIdx3][globalIdx4] -= T[1][3]; + this->A_[eIdxGlobal3][eIdxGlobal1] -= T[1][0]; + this->A_[eIdxGlobal3][eIdxGlobal2] -= T[1][1]; + this->A_[eIdxGlobal3][eIdxGlobal3] -= T[1][2]; + this->A_[eIdxGlobal3][eIdxGlobal4] -= T[1][3]; } - if (innerBoundaryVolumeFaces_[globalIdx4][interactionVolume.getIndexOnElement(3, 0)]) + if (innerBoundaryVolumeFaces_[eIdxGlobal4][interactionVolume.getIndexOnElement(3, 0)]) { - this->A_[globalIdx4][globalIdx1] += -T[3][0]; - this->A_[globalIdx4][globalIdx2] += -T[3][1]; - this->A_[globalIdx4][globalIdx3] += -T[3][2]; - this->A_[globalIdx4][globalIdx4] += -T[3][3]; + this->A_[eIdxGlobal4][eIdxGlobal1] += -T[3][0]; + this->A_[eIdxGlobal4][eIdxGlobal2] += -T[3][1]; + this->A_[eIdxGlobal4][eIdxGlobal3] += -T[3][2]; + this->A_[eIdxGlobal4][eIdxGlobal4] += -T[3][3]; } - if (innerBoundaryVolumeFaces_[globalIdx4][interactionVolume.getIndexOnElement(3, 1)]) + if (innerBoundaryVolumeFaces_[eIdxGlobal4][interactionVolume.getIndexOnElement(3, 1)]) { - this->A_[globalIdx4][globalIdx1] += T[2][0]; - this->A_[globalIdx4][globalIdx2] += T[2][1]; - this->A_[globalIdx4][globalIdx3] += T[2][2]; - this->A_[globalIdx4][globalIdx4] += T[2][3]; + this->A_[eIdxGlobal4][eIdxGlobal1] += T[2][0]; + this->A_[eIdxGlobal4][eIdxGlobal2] += T[2][1]; + this->A_[eIdxGlobal4][eIdxGlobal3] += T[2][2]; + this->A_[eIdxGlobal4][eIdxGlobal4] += T[2][3]; } //add capillary pressure and gravity terms to right-hand-side @@ -1667,42 +1667,42 @@ void FvMpfaO2dPressure2p<TypeTag>::assemble() if (i == nPhaseIdx) { //add capillary pressure term to right hand side - this->f_[globalIdx1] -= (pcFluxReal[0] + pcFluxReal[3]); - this->f_[globalIdx2] -= (pcFluxReal[1] - pcFluxReal[0]); - this->f_[globalIdx3] -= (-pcFluxReal[2] - pcFluxReal[1]); - this->f_[globalIdx4] -= (-pcFluxReal[3] + pcFluxReal[2]); + this->f_[eIdxGlobal1] -= (pcFluxReal[0] + pcFluxReal[3]); + this->f_[eIdxGlobal2] -= (pcFluxReal[1] - pcFluxReal[0]); + this->f_[eIdxGlobal3] -= (-pcFluxReal[2] - pcFluxReal[1]); + this->f_[eIdxGlobal4] -= (-pcFluxReal[3] + pcFluxReal[2]); - if (innerBoundaryVolumeFaces_[globalIdx1][interactionVolume.getIndexOnElement(0, 0)]) + if (innerBoundaryVolumeFaces_[eIdxGlobal1][interactionVolume.getIndexOnElement(0, 0)]) { - this->f_[globalIdx1] -= pcFluxReal[0]; + this->f_[eIdxGlobal1] -= pcFluxReal[0]; } - if (innerBoundaryVolumeFaces_[globalIdx1][interactionVolume.getIndexOnElement(0, 1)]) + if (innerBoundaryVolumeFaces_[eIdxGlobal1][interactionVolume.getIndexOnElement(0, 1)]) { - this->f_[globalIdx1] -= pcFluxReal[3]; + this->f_[eIdxGlobal1] -= pcFluxReal[3]; } - if (innerBoundaryVolumeFaces_[globalIdx2][interactionVolume.getIndexOnElement(1, 0)]) + if (innerBoundaryVolumeFaces_[eIdxGlobal2][interactionVolume.getIndexOnElement(1, 0)]) { - this->f_[globalIdx2] -= pcFluxReal[1]; + this->f_[eIdxGlobal2] -= pcFluxReal[1]; } - if (innerBoundaryVolumeFaces_[globalIdx2][interactionVolume.getIndexOnElement(1, 1)]) + if (innerBoundaryVolumeFaces_[eIdxGlobal2][interactionVolume.getIndexOnElement(1, 1)]) { - this->f_[globalIdx2] += pcFluxReal[0]; + this->f_[eIdxGlobal2] += pcFluxReal[0]; } - if (innerBoundaryVolumeFaces_[globalIdx3][interactionVolume.getIndexOnElement(2, 0)]) + if (innerBoundaryVolumeFaces_[eIdxGlobal3][interactionVolume.getIndexOnElement(2, 0)]) { - this->f_[globalIdx3] += pcFluxReal[2]; + this->f_[eIdxGlobal3] += pcFluxReal[2]; } - if (innerBoundaryVolumeFaces_[globalIdx3][interactionVolume.getIndexOnElement(2, 1)]) + if (innerBoundaryVolumeFaces_[eIdxGlobal3][interactionVolume.getIndexOnElement(2, 1)]) { - this->f_[globalIdx3] += pcFluxReal[1]; + this->f_[eIdxGlobal3] += pcFluxReal[1]; } - if (innerBoundaryVolumeFaces_[globalIdx4][interactionVolume.getIndexOnElement(3, 0)]) + if (innerBoundaryVolumeFaces_[eIdxGlobal4][interactionVolume.getIndexOnElement(3, 0)]) { - this->f_[globalIdx4] += pcFluxReal[3]; + this->f_[eIdxGlobal4] += pcFluxReal[3]; } - if (innerBoundaryVolumeFaces_[globalIdx4][interactionVolume.getIndexOnElement(3, 1)]) + if (innerBoundaryVolumeFaces_[eIdxGlobal4][interactionVolume.getIndexOnElement(3, 1)]) { - this->f_[globalIdx4] -= pcFluxReal[2]; + this->f_[eIdxGlobal4] -= pcFluxReal[2]; } } break; @@ -1712,42 +1712,42 @@ void FvMpfaO2dPressure2p<TypeTag>::assemble() if (i == wPhaseIdx) { //add capillary pressure term to right hand side - this->f_[globalIdx1] += (pcFluxReal[0] + pcFluxReal[1]); - this->f_[globalIdx2] += (pcFluxReal[1] - pcFluxReal[0]); - this->f_[globalIdx3] += (-pcFluxReal[2] - pcFluxReal[1]); - this->f_[globalIdx4] += (-pcFluxReal[3] + pcFluxReal[2]); + this->f_[eIdxGlobal1] += (pcFluxReal[0] + pcFluxReal[1]); + this->f_[eIdxGlobal2] += (pcFluxReal[1] - pcFluxReal[0]); + this->f_[eIdxGlobal3] += (-pcFluxReal[2] - pcFluxReal[1]); + this->f_[eIdxGlobal4] += (-pcFluxReal[3] + pcFluxReal[2]); - if (innerBoundaryVolumeFaces_[globalIdx1][interactionVolume.getIndexOnElement(0, 0)]) + if (innerBoundaryVolumeFaces_[eIdxGlobal1][interactionVolume.getIndexOnElement(0, 0)]) { - this->f_[globalIdx1] += pcFluxReal[0]; + this->f_[eIdxGlobal1] += pcFluxReal[0]; } - if (innerBoundaryVolumeFaces_[globalIdx1][interactionVolume.getIndexOnElement(0, 1)]) + if (innerBoundaryVolumeFaces_[eIdxGlobal1][interactionVolume.getIndexOnElement(0, 1)]) { - this->f_[globalIdx1] += pcFluxReal[3]; + this->f_[eIdxGlobal1] += pcFluxReal[3]; } - if (innerBoundaryVolumeFaces_[globalIdx2][interactionVolume.getIndexOnElement(1, 0)]) + if (innerBoundaryVolumeFaces_[eIdxGlobal2][interactionVolume.getIndexOnElement(1, 0)]) { - this->f_[globalIdx2] += pcFluxReal[1]; + this->f_[eIdxGlobal2] += pcFluxReal[1]; } - if (innerBoundaryVolumeFaces_[globalIdx2][interactionVolume.getIndexOnElement(1, 1)]) + if (innerBoundaryVolumeFaces_[eIdxGlobal2][interactionVolume.getIndexOnElement(1, 1)]) { - this->f_[globalIdx2] -= pcFluxReal[0]; + this->f_[eIdxGlobal2] -= pcFluxReal[0]; } - if (innerBoundaryVolumeFaces_[globalIdx3][interactionVolume.getIndexOnElement(2, 0)]) + if (innerBoundaryVolumeFaces_[eIdxGlobal3][interactionVolume.getIndexOnElement(2, 0)]) { - this->f_[globalIdx3] -= pcFluxReal[2]; + this->f_[eIdxGlobal3] -= pcFluxReal[2]; } - if (innerBoundaryVolumeFaces_[globalIdx3][interactionVolume.getIndexOnElement(2, 1)]) + if (innerBoundaryVolumeFaces_[eIdxGlobal3][interactionVolume.getIndexOnElement(2, 1)]) { - this->f_[globalIdx3] -= pcFluxReal[1]; + this->f_[eIdxGlobal3] -= pcFluxReal[1]; } - if (innerBoundaryVolumeFaces_[globalIdx4][interactionVolume.getIndexOnElement(3, 0)]) + if (innerBoundaryVolumeFaces_[eIdxGlobal4][interactionVolume.getIndexOnElement(3, 0)]) { - this->f_[globalIdx4] -= pcFluxReal[3]; + this->f_[eIdxGlobal4] -= pcFluxReal[3]; } - if (innerBoundaryVolumeFaces_[globalIdx4][interactionVolume.getIndexOnElement(3, 1)]) + if (innerBoundaryVolumeFaces_[eIdxGlobal4][interactionVolume.getIndexOnElement(3, 1)]) { - this->f_[globalIdx4] += pcFluxReal[2]; + this->f_[eIdxGlobal4] += pcFluxReal[2]; } } break; @@ -1785,10 +1785,10 @@ void FvMpfaO2dPressure2p<TypeTag>::assemble() Scalar volume = elementPointer->geometry().volume(); // cell index - int globalIdx = problem_.variables().index(*elementPointer); + int eIdxGlobal = problem_.variables().index(*elementPointer); //get the cell Data - CellData& cellData = problem_.variables().cellData(globalIdx); + CellData& cellData = problem_.variables().cellData(eIdxGlobal); //permeability vector at boundary DimMatrix permeability(problem_.spatialParams().intrinsicPermeability(*elementPointer)); @@ -1796,10 +1796,10 @@ void FvMpfaO2dPressure2p<TypeTag>::assemble() // evaluate right hand side PrimaryVariables source(0); problem_.source(source, *elementPointer); - this->f_[globalIdx] += volume / (4.0) + this->f_[eIdxGlobal] += volume / (4.0) * (source[wPhaseIdx] / density_[wPhaseIdx] + source[nPhaseIdx] / density_[nPhaseIdx]); - this->f_[globalIdx] += evaluateErrorTerm_(cellData) * volume / (4.0); + this->f_[eIdxGlobal] += evaluateErrorTerm_(cellData) * volume / (4.0); //get mobilities of the phases Dune::FieldVector<Scalar, numPhases> lambda(cellData.mobility(wPhaseIdx)); @@ -1941,8 +1941,8 @@ void FvMpfaO2dPressure2p<TypeTag>::assemble() } // set diagonal entry and right hand side entry - this->A_[globalIdx][globalIdx] += entry; - this->f_[globalIdx] += entry * potentialBound; + this->A_[eIdxGlobal][eIdxGlobal] += entry; + this->f_[eIdxGlobal] += entry * potentialBound; if (pc == 0 && pcBound == 0) { @@ -1958,7 +1958,7 @@ void FvMpfaO2dPressure2p<TypeTag>::assemble() if (i == nPhaseIdx) { //add capillary pressure term to right hand side - this->f_[globalIdx] -= pcFlux; + this->f_[eIdxGlobal] -= pcFlux; } break; } @@ -1967,7 +1967,7 @@ void FvMpfaO2dPressure2p<TypeTag>::assemble() if (i == wPhaseIdx) { //add capillary pressure term to right hand side - this->f_[globalIdx] += pcFlux; + this->f_[eIdxGlobal] += pcFlux; } break; } @@ -1980,7 +1980,7 @@ void FvMpfaO2dPressure2p<TypeTag>::assemble() Scalar J = interactionVolume.getNeumannValues(intVolFaceIdx)[wPhaseIdx] / density_[wPhaseIdx]; J += interactionVolume.getNeumannValues(intVolFaceIdx)[nPhaseIdx] / density_[nPhaseIdx]; - this->f_[globalIdx] -= J; + this->f_[eIdxGlobal] -= J; } else { @@ -2008,11 +2008,11 @@ void FvMpfaO2dPressure2p<TypeTag>::assemble() continue; // get the global index of the cell - int globalIdxI = problem_.variables().index(*eIt); + int eIdxGlobalI = problem_.variables().index(*eIt); - this->A_[globalIdxI] = 0.0; - this->A_[globalIdxI][globalIdxI] = 1.0; - this->f_[globalIdxI] = this->pressure()[globalIdxI]; + this->A_[eIdxGlobalI] = 0.0; + this->A_[eIdxGlobalI][eIdxGlobalI] = 1.0; + this->f_[eIdxGlobalI] = this->pressure()[eIdxGlobalI]; } } @@ -2031,9 +2031,9 @@ void FvMpfaO2dPressure2p<TypeTag>::updateMaterialLaws() ElementIterator eEndIt = problem_.gridView().template end<0>(); for (ElementIterator eIt = problem_.gridView().template begin<0>(); eIt != eEndIt; ++eIt) { - int globalIdx = problem_.variables().index(*eIt); + int eIdxGlobal = problem_.variables().index(*eIt); - CellData& cellData = problem_.variables().cellData(globalIdx); + CellData& cellData = problem_.variables().cellData(eIdxGlobal); Scalar satW = cellData.saturation(wPhaseIdx); diff --git a/dumux/decoupled/2p/diffusion/fvmpfa/omethod/fvmpfao2dpressurevelocity2p.hh b/dumux/decoupled/2p/diffusion/fvmpfa/omethod/fvmpfao2dpressurevelocity2p.hh index 00e7630dbbbba216f30b6a2f69f58ddfad9528b4..7642da0776c2ee093ddb73f34c9be18819ec5ccd 100644 --- a/dumux/decoupled/2p/diffusion/fvmpfa/omethod/fvmpfao2dpressurevelocity2p.hh +++ b/dumux/decoupled/2p/diffusion/fvmpfa/omethod/fvmpfao2dpressurevelocity2p.hh @@ -237,16 +237,16 @@ void FvMpfaO2dPressureVelocity2p<TypeTag>::calculateVelocity() ElementPointer & elementPointer4 = interactionVolume.getSubVolumeElement(3); // cell index - int globalIdx1 = problem_.variables().index(*elementPointer1); - int globalIdx2 = problem_.variables().index(*elementPointer2); - int globalIdx3 = problem_.variables().index(*elementPointer3); - int globalIdx4 = problem_.variables().index(*elementPointer4); + int eIdxGlobal1 = problem_.variables().index(*elementPointer1); + int eIdxGlobal2 = problem_.variables().index(*elementPointer2); + int eIdxGlobal3 = problem_.variables().index(*elementPointer3); + int eIdxGlobal4 = problem_.variables().index(*elementPointer4); //get the cell Data - CellData& cellData1 = problem_.variables().cellData(globalIdx1); - CellData& cellData2 = problem_.variables().cellData(globalIdx2); - CellData& cellData3 = problem_.variables().cellData(globalIdx3); - CellData& cellData4 = problem_.variables().cellData(globalIdx4); + CellData& cellData1 = problem_.variables().cellData(eIdxGlobal1); + CellData& cellData2 = problem_.variables().cellData(eIdxGlobal2); + CellData& cellData3 = problem_.variables().cellData(eIdxGlobal3); + CellData& cellData4 = problem_.variables().cellData(eIdxGlobal4); velocity_.calculateInnerInteractionVolumeVelocity(interactionVolume, cellData1, cellData2, cellData3, cellData4, this->innerBoundaryVolumeFaces_); @@ -273,9 +273,9 @@ void FvMpfaO2dPressureVelocity2p<TypeTag>::calculateVelocity() ElementPointer & elementPointer = interactionVolume.getSubVolumeElement(elemIdx); // cell index - int globalIdx = problem_.variables().index(*elementPointer); + int eIdxGlobal = problem_.variables().index(*elementPointer); //get the cell Data - CellData& cellData = problem_.variables().cellData(globalIdx); + CellData& cellData = problem_.variables().cellData(eIdxGlobal); velocity_.calculateBoundaryInteractionVolumeVelocity(interactionVolume, cellData, elemIdx); } @@ -301,10 +301,10 @@ void FvMpfaO2dPressureVelocity2p<TypeTag>::calculateVelocity(const Intersection& ElementPointer elementPtrI = intersection.inside(); ElementPointer elementPtrJ = intersection.outside(); - int globalIdxI = problem_.variables().index(*elementPtrI); - int globalIdxJ = problem_.variables().index(*elementPtrJ); + int eIdxGlobalI = problem_.variables().index(*elementPtrI); + int eIdxGlobalJ = problem_.variables().index(*elementPtrJ); - CellData& cellDataJ = problem_.variables().cellData(globalIdxJ); + CellData& cellDataJ = problem_.variables().cellData(eIdxGlobalJ); const ReferenceElement& referenceElement = ReferenceElements::general(elementPtrI->geometry().type()); @@ -331,24 +331,24 @@ void FvMpfaO2dPressureVelocity2p<TypeTag>::calculateVelocity(const Intersection& ElementPointer & elementPointer4 = interactionVolume.getSubVolumeElement(3); // cell index - int globalIdx[4]; - globalIdx[0] = problem_.variables().index(*elementPointer1); - globalIdx[1] = problem_.variables().index(*elementPointer2); - globalIdx[2] = problem_.variables().index(*elementPointer3); - globalIdx[3] = problem_.variables().index(*elementPointer4); + int eIdxGlobal[4]; + eIdxGlobal[0] = problem_.variables().index(*elementPointer1); + eIdxGlobal[1] = problem_.variables().index(*elementPointer2); + eIdxGlobal[2] = problem_.variables().index(*elementPointer3); + eIdxGlobal[3] = problem_.variables().index(*elementPointer4); //get the cell Data - cellDataTemp[0] = problem_.variables().cellData(globalIdx[0]); - cellDataTemp[1] = problem_.variables().cellData(globalIdx[1]); - cellDataTemp[2] = problem_.variables().cellData(globalIdx[2]); - cellDataTemp[3] = problem_.variables().cellData(globalIdx[3]); + cellDataTemp[0] = problem_.variables().cellData(eIdxGlobal[0]); + cellDataTemp[1] = problem_.variables().cellData(eIdxGlobal[1]); + cellDataTemp[2] = problem_.variables().cellData(eIdxGlobal[2]); + cellDataTemp[3] = problem_.variables().cellData(eIdxGlobal[3]); velocity_.calculateInnerInteractionVolumeVelocity(interactionVolume, cellDataTemp[0], cellDataTemp[1], cellDataTemp[2], cellDataTemp[3], this->innerBoundaryVolumeFaces_); for (int i = 0; i < 4; i++) { - if (globalIdx[i] == globalIdxI) + if (eIdxGlobal[i] == eIdxGlobalI) { cellData.fluxData().setVelocity(wPhaseIdx, indexInInside, cellDataTemp[i].fluxData().velocity(wPhaseIdx, indexInInside)); @@ -359,7 +359,7 @@ void FvMpfaO2dPressureVelocity2p<TypeTag>::calculateVelocity(const Intersection& cellData.fluxData().setUpwindPotential(nPhaseIdx, indexInInside, cellDataTemp[i].fluxData().upwindPotential(nPhaseIdx, indexInInside)); } - else if (globalIdx[i] == globalIdxJ) + else if (eIdxGlobal[i] == eIdxGlobalJ) { cellDataJ.fluxData().setVelocity(wPhaseIdx, indexInOutside, cellDataTemp[i].fluxData().velocity(wPhaseIdx, indexInOutside)); diff --git a/dumux/decoupled/2p/diffusion/fvmpfa/omethod/fvmpfao2dvelocity2p.hh b/dumux/decoupled/2p/diffusion/fvmpfa/omethod/fvmpfao2dvelocity2p.hh index 8168e3fe6f40b34da9e4f8264219786aaf0e70a0..bd4305f22ee107a843c4ecae011bb24611c91c06 100644 --- a/dumux/decoupled/2p/diffusion/fvmpfa/omethod/fvmpfao2dvelocity2p.hh +++ b/dumux/decoupled/2p/diffusion/fvmpfa/omethod/fvmpfao2dvelocity2p.hh @@ -188,9 +188,9 @@ public: for (ElementIterator eIt = problem_.gridView().template begin<0>(); eIt != eEndIt; ++eIt) { // cell index - int globalIdx = problem_.variables().index(*eIt); + int eIdxGlobal = problem_.variables().index(*eIt); - CellData & cellData = problem_.variables().cellData(globalIdx); + CellData & cellData = problem_.variables().cellData(eIdxGlobal); Dune::FieldVector < Scalar, 2 * dim > fluxW(0); Dune::FieldVector < Scalar, 2 * dim > fluxNw(0); @@ -221,7 +221,7 @@ public: jacobianT.umtv(refVelocity, elementVelocity); elementVelocity /= eIt->geometry().integrationElement(localPos); - velocityWetting[globalIdx] = elementVelocity; + velocityWetting[eIdxGlobal] = elementVelocity; refVelocity = 0; refVelocity[0] = 0.5 * (fluxNw[1] - fluxNw[0]); @@ -232,7 +232,7 @@ public: jacobianT.umtv(refVelocity, elementVelocity); elementVelocity /= eIt->geometry().integrationElement(localPos); - velocityNonwetting[globalIdx] = elementVelocity; + velocityNonwetting[eIdxGlobal] = elementVelocity; } writer.attachCellData(velocityWetting, "wetting-velocity", dim); @@ -287,10 +287,10 @@ void FvMpfaO2dVelocity2P<TypeTag>::calculateInnerInteractionVolumeVelocity(Inter ElementPointer & elementPointer4 = interactionVolume.getSubVolumeElement(3); // cell index - int globalIdx1 = problem_.variables().index(*elementPointer1); - int globalIdx2 = problem_.variables().index(*elementPointer2); - int globalIdx3 = problem_.variables().index(*elementPointer3); - int globalIdx4 = problem_.variables().index(*elementPointer4); + int eIdxGlobal1 = problem_.variables().index(*elementPointer1); + int eIdxGlobal2 = problem_.variables().index(*elementPointer2); + int eIdxGlobal3 = problem_.variables().index(*elementPointer3); + int eIdxGlobal4 = problem_.variables().index(*elementPointer4); // get pressure values Dune::FieldVector < Scalar, 2 * dim > potW(0); @@ -507,35 +507,35 @@ void FvMpfaO2dVelocity2P<TypeTag>::calculateInnerInteractionVolumeVelocity(Inter vel41 *= fracFlow14; vel43 *= fracFlow34; - if (innerBoundaryVolumeFaces[globalIdx1][interactionVolume.getIndexOnElement(0, 0)]) + if (innerBoundaryVolumeFaces[eIdxGlobal1][interactionVolume.getIndexOnElement(0, 0)]) { vel12 *= 2; } - if (innerBoundaryVolumeFaces[globalIdx1][interactionVolume.getIndexOnElement(0, 1)]) + if (innerBoundaryVolumeFaces[eIdxGlobal1][interactionVolume.getIndexOnElement(0, 1)]) { vel14 *= 2; } - if (innerBoundaryVolumeFaces[globalIdx2][interactionVolume.getIndexOnElement(1, 0)]) + if (innerBoundaryVolumeFaces[eIdxGlobal2][interactionVolume.getIndexOnElement(1, 0)]) { vel23 *= 2; } - if (innerBoundaryVolumeFaces[globalIdx2][interactionVolume.getIndexOnElement(1, 1)]) + if (innerBoundaryVolumeFaces[eIdxGlobal2][interactionVolume.getIndexOnElement(1, 1)]) { vel21 *= 2; } - if (innerBoundaryVolumeFaces[globalIdx3][interactionVolume.getIndexOnElement(2, 0)]) + if (innerBoundaryVolumeFaces[eIdxGlobal3][interactionVolume.getIndexOnElement(2, 0)]) { vel34 *= 2; } - if (innerBoundaryVolumeFaces[globalIdx3][interactionVolume.getIndexOnElement(2, 1)]) + if (innerBoundaryVolumeFaces[eIdxGlobal3][interactionVolume.getIndexOnElement(2, 1)]) { vel32 *= 2; } - if (innerBoundaryVolumeFaces[globalIdx4][interactionVolume.getIndexOnElement(3, 0)]) + if (innerBoundaryVolumeFaces[eIdxGlobal4][interactionVolume.getIndexOnElement(3, 0)]) { vel41 *= 2; } - if (innerBoundaryVolumeFaces[globalIdx4][interactionVolume.getIndexOnElement(3, 1)]) + if (innerBoundaryVolumeFaces[eIdxGlobal4][interactionVolume.getIndexOnElement(3, 1)]) { vel43 *= 2; } diff --git a/dumux/decoupled/2p/diffusion/mimetic/croperator2padaptive.hh b/dumux/decoupled/2p/diffusion/mimetic/croperator2padaptive.hh index 3ae028adc0364fe353fa444033078f9b4d534b0e..6f14920971bd9b40c1e9917b311c6cb6c187cd45 100644 --- a/dumux/decoupled/2p/diffusion/mimetic/croperator2padaptive.hh +++ b/dumux/decoupled/2p/diffusion/mimetic/croperator2padaptive.hh @@ -273,9 +273,9 @@ void CROperatorAssemblerTwoPAdaptive<TypeTag>::assemble(LocalStiffness& loc, Vec // inludes rhs and boundary condition information loc.assemble(*eIt, 1); // assemble local stiffness matrix - int globalIdx = intersectionMapper_.map(*eIt); + int eIdxGlobal = intersectionMapper_.map(*eIt); - unsigned int numFaces = intersectionMapper_.size(globalIdx); + unsigned int numFaces = intersectionMapper_.size(eIdxGlobal); local2Global.resize(numFaces); for (unsigned int i = 0; i < numFaces; i++) @@ -308,9 +308,9 @@ void CROperatorAssemblerTwoPAdaptive<TypeTag>::assemble(LocalStiffness& loc, Vec // run over all leaf elements for (ElementIterator eIt = gridView_.template begin<0>(); eIt!=eendit; ++eIt) { - int globalIdx = intersectionMapper_.map(*eIt); + int eIdxGlobal = intersectionMapper_.map(*eIt); - unsigned int numFaces = intersectionMapper_.size(globalIdx); + unsigned int numFaces = intersectionMapper_.size(eIdxGlobal); local2Global.resize(numFaces); for (unsigned int i = 0; i < numFaces; i++) diff --git a/dumux/decoupled/2p/diffusion/mimetic/mimetic2p.hh b/dumux/decoupled/2p/diffusion/mimetic/mimetic2p.hh index 75af5ae4c79bed875cf074e4a6fb1064822e7eef..352bf4f11a55fed6973ada5c95f645f3cc1cd9e8 100644 --- a/dumux/decoupled/2p/diffusion/mimetic/mimetic2p.hh +++ b/dumux/decoupled/2p/diffusion/mimetic/mimetic2p.hh @@ -242,7 +242,7 @@ public: template<class Vector> void completeRHS(const Element& element, Dune::FieldVector<int, 2*dim>& local2Global, Vector& f) { - int globalIdx = problem_.variables().index(element); + int eIdxGlobal = problem_.variables().index(element); #if DUNE_VERSION_NEWER(DUNE_COMMON, 2, 4) unsigned int numFaces = element.subEntities(1); #else @@ -251,28 +251,28 @@ public: Dune::FieldVector<Scalar, 2 * dim> F(0.); Scalar dInv = 0.; - computeReconstructionMatrices(element, W_[globalIdx], F, dInv); + computeReconstructionMatrices(element, W_[eIdxGlobal], F, dInv); for (unsigned int i = 0; i < numFaces; i++) { if (!this->bc(i).isDirichlet(pressureEqIdx)) - f[local2Global[i]][0] += (dInv * F[i] * rhs_[globalIdx]); + f[local2Global[i]][0] += (dInv * F[i] * rhs_[eIdxGlobal]); } } Scalar constructPressure(const Element& element, Dune::FieldVector<Scalar,2*dim>& pressTrace) { - int globalIdx = problem_.variables().index(element); + int eIdxGlobal = problem_.variables().index(element); Scalar volume = element.geometry().volume(); PrimaryVariables sourceVec(0.0); problem_.source(sourceVec, element); Scalar qmean = volume * (sourceVec[wPhaseIdx]/density_[wPhaseIdx] + sourceVec[nPhaseIdx]/density_[nPhaseIdx]); - qmean += rhs_[globalIdx]; + qmean += rhs_[eIdxGlobal]; Dune::FieldVector<Scalar, 2 * dim> F(0.); Scalar dInv = 0.; - computeReconstructionMatrices(element, W_[globalIdx], F, dInv); + computeReconstructionMatrices(element, W_[eIdxGlobal], F, dInv); return (dInv*(qmean + (F*pressTrace))); } @@ -280,7 +280,7 @@ public: void constructVelocity(const Element& element, Dune::FieldVector<Scalar,2*dim>& vel, Dune::FieldVector<Scalar,2*dim>& pressTrace, Scalar press) { - int globalIdx = problem_.variables().index(element); + int eIdxGlobal = problem_.variables().index(element); Dune::FieldVector<Scalar, 2 * dim> faceVol(0); IntersectionIterator isEndIt = gridView_.iend(element); @@ -292,13 +292,13 @@ public: vel = 0; for (int i = 0; i < 2*dim; i++) for (int j = 0; j < 2*dim; j++) - vel[i] += W_[globalIdx][i][j]*faceVol[j]*(press - pressTrace[j]); + vel[i] += W_[eIdxGlobal][i][j]*faceVol[j]*(press - pressTrace[j]); } void constructVelocity(const Element& element, int fIdx, Scalar& vel, Dune::FieldVector<Scalar,2*dim>& pressTrace, Scalar press) { - int globalIdx = problem_.variables().index(element); + int eIdxGlobal = problem_.variables().index(element); Dune::FieldVector<Scalar, 2 * dim> faceVol(0); IntersectionIterator isEndIt = gridView_.iend(element); @@ -309,7 +309,7 @@ public: vel = 0; for (int j = 0; j < 2*dim; j++) - vel += W_[globalIdx][fIdx][j]*faceVol[j]*(press - pressTrace[j]); + vel += W_[eIdxGlobal][fIdx][j]*faceVol[j]*(press - pressTrace[j]); } void computeReconstructionMatrices(const Element& element, @@ -421,7 +421,7 @@ void MimeticTwoPLocalStiffness<TypeTag>::assembleV(const Element& element, int) #endif this->setcurrentsize(numFaces); - int globalIdx = problem_.variables().index(element); + int eIdxGlobal = problem_.variables().index(element); // The notation is borrowed from Aarnes/Krogstadt/Lie 2006, Section 3.4. // The matrix W developed here corresponds to one element-associated @@ -434,7 +434,7 @@ void MimeticTwoPLocalStiffness<TypeTag>::assembleV(const Element& element, int) this->assembleElementMatrices(element, faceVol, F, Pi, dInv, qmean); // Calculate the element part of the matrix Pi W Pi^T. - Dune::FieldMatrix<Scalar, 2 * dim, 2 * dim> PiWPiT(W_[globalIdx]); + Dune::FieldMatrix<Scalar, 2 * dim, 2 * dim> PiWPiT(W_[eIdxGlobal]); PiWPiT.rightmultiply(Pi); PiWPiT.leftmultiply(Pi); @@ -480,9 +480,9 @@ void MimeticTwoPLocalStiffness<TypeTag>::assembleElementMatrices(const Element& // get global coordinate of cell center Dune::FieldVector<Scalar, dim> centerGlobal = element.geometry().center(); - int globalIdx = problem_.variables().index(element); + int eIdxGlobal = problem_.variables().index(element); - CellData& cellData = problem_.variables().cellData(globalIdx); + CellData& cellData = problem_.variables().cellData(eIdxGlobal); // cell volume Scalar volume = element.geometry().volume(); @@ -595,14 +595,14 @@ void MimeticTwoPLocalStiffness<TypeTag>::assembleElementMatrices(const Element& { for (unsigned int j = 0; j < numFaces; j++) { - W_[globalIdx][i][j] = NK[i][0] * N[j][0]; + W_[eIdxGlobal][i][j] = NK[i][0] * N[j][0]; for (unsigned int k = 1; k < dim; k++) - W_[globalIdx][i][j] += NK[i][k] * N[j][k]; + W_[eIdxGlobal][i][j] += NK[i][k] * N[j][k]; } } - W_[globalIdx] /= volume; - W_[globalIdx] += D; + W_[eIdxGlobal] /= volume; + W_[eIdxGlobal] += D; // std::cout << "W = \dim" << W; @@ -625,7 +625,7 @@ void MimeticTwoPLocalStiffness<TypeTag>::assembleElementMatrices(const Element& // Calculate the element part of the matrix D^{-1} = (c W c^T)^{-1} which is just a scalar value. Dune::FieldVector<Scalar, 2 * dim> Wc(0); - W_[globalIdx].umv(c, Wc); + W_[eIdxGlobal].umv(c, Wc); dInv = 1.0 / (c * Wc); // Calculate the element part of the matrix F = Pi W c^T which is a column vector. @@ -642,13 +642,13 @@ void MimeticTwoPLocalStiffness<TypeTag>::assembleElementMatrices(const Element& Scalar flux = 0; for (int j = 0; j < 2 * dim; j++) - flux += W_[globalIdx][idx][j] * faceVol[j] * (gravPot - gravPotFace[j]); + flux += W_[eIdxGlobal][idx][j] * faceVol[j] * (gravPot - gravPotFace[j]); //it is enough to evaluate the capillary/gravity flux for neighbors -> not needed anyway at the boundaries! if (isIt->neighbor()) { ElementPointer neighbor = isIt->outside(); - int globalIdxNeighbor = problem_.variables().index(*neighbor); + int eIdxGlobalNeighbor = problem_.variables().index(*neighbor); if (flux >= 0.) { switch (pressureType) @@ -666,8 +666,8 @@ void MimeticTwoPLocalStiffness<TypeTag>::assembleElementMatrices(const Element& } - rhs_[globalIdx] -= (faceVol[idx] * fracFlow * flux); - rhs_[globalIdxNeighbor] += (faceVol[idx] * fracFlow * flux); + rhs_[eIdxGlobal] -= (faceVol[idx] * fracFlow * flux); + rhs_[eIdxGlobalNeighbor] += (faceVol[idx] * fracFlow * flux); } } else if (isIt->boundary()) @@ -720,7 +720,7 @@ void MimeticTwoPLocalStiffness<TypeTag>::assembleElementMatrices(const Element& } } - rhs_[globalIdx] -= (faceVol[idx] * fracFlow * flux); + rhs_[eIdxGlobal] -= (faceVol[idx] * fracFlow * flux); } } } diff --git a/dumux/decoupled/2p/diffusion/mimetic/mimetic2padaptive.hh b/dumux/decoupled/2p/diffusion/mimetic/mimetic2padaptive.hh index 5677a90e788f7ea7ac633f1f10a1d8db539e0fab..d5e348f382e2e6fb3ed09769a93963667bc0a2c2 100644 --- a/dumux/decoupled/2p/diffusion/mimetic/mimetic2padaptive.hh +++ b/dumux/decoupled/2p/diffusion/mimetic/mimetic2padaptive.hh @@ -181,9 +181,9 @@ public: timeStep_ = dt; } - int numberOfFaces(int globalIdx) + int numberOfFaces(int eIdxGlobal) { - return W_[globalIdx].N(); + return W_[eIdxGlobal].N(); } //! assemble local stiffness matrix for given element and order @@ -250,37 +250,37 @@ public: template<class Vector> void completeRHS(const Element& element, std::vector<int>& local2Global, Vector& f) { - int globalIdx = problem_.variables().index(element); + int eIdxGlobal = problem_.variables().index(element); - int numFaces = numberOfFaces(globalIdx); + int numFaces = numberOfFaces(eIdxGlobal); Dune::DynamicVector<Scalar> F(numFaces); Scalar dInv = 0.; - computeReconstructionMatrices(element, W_[globalIdx], F, dInv); + computeReconstructionMatrices(element, W_[eIdxGlobal], F, dInv); for (int i = 0; i < numFaces; i++) { // if (!this->bctype[i].isSet()) - f[local2Global[i]][0] += (dInv * F[i] * rhs_[globalIdx]); + f[local2Global[i]][0] += (dInv * F[i] * rhs_[eIdxGlobal]); } } Scalar constructPressure(const Element& element, Dune::DynamicVector<Scalar>& pressTrace) { - int globalIdx = problem_.variables().index(element); + int eIdxGlobal = problem_.variables().index(element); - int numFaces = numberOfFaces(globalIdx); + int numFaces = numberOfFaces(eIdxGlobal); Scalar volume = element.geometry().volume(); PrimaryVariables sourceVec(0.0); problem_.source(sourceVec, element); Scalar qmean = volume * (sourceVec[wPhaseIdx]/density_[wPhaseIdx] + sourceVec[nPhaseIdx]/density_[nPhaseIdx]); - qmean += rhs_[globalIdx]; + qmean += rhs_[eIdxGlobal]; Dune::DynamicVector<Scalar> F(numFaces, 0.); Scalar dInv = 0.; - computeReconstructionMatrices(element, W_[globalIdx], F, dInv); + computeReconstructionMatrices(element, W_[eIdxGlobal], F, dInv); return (dInv*(qmean + (F*pressTrace))); } @@ -288,9 +288,9 @@ public: void constructVelocity(const Element& element, Dune::DynamicVector<Scalar>& vel, Dune::DynamicVector<Scalar>& pressTrace, Scalar press) { - int globalIdx = problem_.variables().index(element); + int eIdxGlobal = problem_.variables().index(element); - int numFaces = numberOfFaces(globalIdx); + int numFaces = numberOfFaces(eIdxGlobal); Dune::DynamicVector<Scalar> faceVol(numFaces); @@ -310,11 +310,11 @@ public: vel = 0; for (int i = 0; i < numFaces; i++) for (int j = 0; j < numFaces; j++) - vel[i] += W_[globalIdx][i][j]*faceVol[j]*(press - pressTrace[j]); + vel[i] += W_[eIdxGlobal][i][j]*faceVol[j]*(press - pressTrace[j]); for (int i = 0; i < numFaces; i++) { - vel[i] *= faceVol[i]/faceVolumeReal[intersectionMapper_.maplocal(globalIdx, i)]; + vel[i] *= faceVol[i]/faceVolumeReal[intersectionMapper_.maplocal(eIdxGlobal, i)]; } } @@ -322,9 +322,9 @@ public: void computeReconstructionMatrices(const Element& element, const Dune::DynamicMatrix<Scalar>& W, Dune::DynamicVector<Scalar>& F, Scalar& dInv) { - int globalIdx = problem_.variables().index(element); + int eIdxGlobal = problem_.variables().index(element); - int numFaces = numberOfFaces(globalIdx); + int numFaces = numberOfFaces(eIdxGlobal); Dune::DynamicVector<Scalar> c(numFaces); Dune::DynamicMatrix<Scalar> Pi(numFaces, numFaces); @@ -425,12 +425,12 @@ private: template<class TypeTag> void MimeticTwoPLocalStiffnessAdaptive<TypeTag>::assembleV(const Element& element, int numFaces, int k) { - int globalIdx = problem_.variables().index(element); + int eIdxGlobal = problem_.variables().index(element); // The notation is borrowed from Aarnes/Krogstadt/Lie 2006, Section 3.4. // The matrix W developed here corresponds to one element-associated // block of the matrix B^{-1} there. - W_[globalIdx].resize(numFaces, numFaces); + W_[eIdxGlobal].resize(numFaces, numFaces); Dune::DynamicVector<Scalar> faceVol(numFaces); Dune::DynamicMatrix<Scalar> Pi(numFaces, numFaces); Dune::DynamicVector<Scalar> F(numFaces); @@ -439,7 +439,7 @@ void MimeticTwoPLocalStiffnessAdaptive<TypeTag>::assembleV(const Element& elemen this->assembleElementMatrices(element, faceVol, F, Pi, dInv, qmean); // Calculate the element part of the matrix Pi W Pi^T. - Dune::DynamicMatrix<Scalar> PiWPiT(W_[globalIdx]); + Dune::DynamicMatrix<Scalar> PiWPiT(W_[eIdxGlobal]); PiWPiT.rightmultiply(Pi); PiWPiT.leftmultiply(Pi); @@ -478,11 +478,11 @@ void MimeticTwoPLocalStiffnessAdaptive<TypeTag>::assembleElementMatrices(const E // get global coordinate of cell center const Dune::FieldVector<Scalar, dim>& centerGlobal = element.geometry().center(); - int globalIdx = problem_.variables().index(element); + int eIdxGlobal = problem_.variables().index(element); - CellData& cellData = problem_.variables().cellData(globalIdx); + CellData& cellData = problem_.variables().cellData(eIdxGlobal); - int numFaces = intersectionMapper_.size(globalIdx); + int numFaces = intersectionMapper_.size(eIdxGlobal); // cell volume Scalar volume = element.geometry().volume(); @@ -601,14 +601,14 @@ void MimeticTwoPLocalStiffnessAdaptive<TypeTag>::assembleElementMatrices(const E { for (int j = 0; j < numFaces; j++) { - W_[globalIdx][i][j] = NK[i][0] * N[j][0]; + W_[eIdxGlobal][i][j] = NK[i][0] * N[j][0]; for (int k = 1; k < dim; k++) - W_[globalIdx][i][j] += NK[i][k] * N[j][k]; + W_[eIdxGlobal][i][j] += NK[i][k] * N[j][k]; } } - W_[globalIdx] /= volume; - W_[globalIdx] += D; + W_[eIdxGlobal] /= volume; + W_[eIdxGlobal] += D; // std::cout << "W = \dim" << W; @@ -631,7 +631,7 @@ void MimeticTwoPLocalStiffnessAdaptive<TypeTag>::assembleElementMatrices(const E // Calculate the element part of the matrix D^{-1} = (c W c^T)^{-1} which is just a scalar value. Dune::DynamicVector<Scalar> Wc(numFaces); - W_[globalIdx].umv(c, Wc); + W_[eIdxGlobal].umv(c, Wc); dInv = 1.0 / (c * Wc); // Calculate the element part of the matrix F = Pi W c^T which is a column vector. @@ -647,13 +647,13 @@ void MimeticTwoPLocalStiffnessAdaptive<TypeTag>::assembleElementMatrices(const E Scalar flux = 0; for (int j = 0; j < numFaces; j++) - flux += W_[globalIdx][idx][j] * faceVol[j] * (pcPot - pcPotFace[j]); + flux += W_[eIdxGlobal][idx][j] * faceVol[j] * (pcPot - pcPotFace[j]); if (isIt->neighbor()) { ElementPointer neighbor = isIt->outside(); - int globalIdxNeighbor = problem_.variables().index(*neighbor); + int eIdxGlobalNeighbor = problem_.variables().index(*neighbor); if (flux > 0.) { switch (pressureType) @@ -670,8 +670,8 @@ void MimeticTwoPLocalStiffnessAdaptive<TypeTag>::assembleElementMatrices(const E } } - rhs_[globalIdx] -= (faceVol[idx] * fracFlow * flux); - rhs_[globalIdxNeighbor] += (faceVol[idx] * fracFlow * flux); + rhs_[eIdxGlobal] -= (faceVol[idx] * fracFlow * flux); + rhs_[eIdxGlobalNeighbor] += (faceVol[idx] * fracFlow * flux); } } else if (isIt->boundary()) @@ -724,7 +724,7 @@ void MimeticTwoPLocalStiffnessAdaptive<TypeTag>::assembleElementMatrices(const E } } - rhs_[globalIdx] -= (faceVol[idx] * fracFlow * flux); + rhs_[eIdxGlobal] -= (faceVol[idx] * fracFlow * flux); } } idx++; diff --git a/dumux/decoupled/2p/diffusion/mimetic/mimeticoperator2p.hh b/dumux/decoupled/2p/diffusion/mimetic/mimeticoperator2p.hh index a27e957fded9f548da7639dad54236f8f722f509..453b370f2adce80eda5088aee5596ceddfcbb004 100644 --- a/dumux/decoupled/2p/diffusion/mimetic/mimeticoperator2p.hh +++ b/dumux/decoupled/2p/diffusion/mimetic/mimeticoperator2p.hh @@ -124,9 +124,9 @@ public: for (; eIt != eEndIt; ++eIt) { - int globalIdx = problem.variables().index(*eIt); + int eIdxGlobal = problem.variables().index(*eIt); - CellData& cellData = problem.variables().cellData(globalIdx); + CellData& cellData = problem.variables().cellData(eIdxGlobal); FieldVector globalPos = eIt->geometry().center(); // get local to global id map and pressure traces @@ -136,9 +136,9 @@ public: { int indexInInside = isIt->indexInInside(); - int globalIdxFace = this->faceMapper_.map(*eIt, indexInInside, 1); + int fIdxGlobal = this->faceMapper_.map(*eIt, indexInInside, 1); - pressTrace[indexInInside] = u[globalIdxFace]; + pressTrace[indexInInside] = u[fIdxGlobal]; gravPotTrace[indexInInside] = (problem.bBoxMax() - isIt->geometry().center()) * problem.gravity() * densityDiff; } diff --git a/dumux/decoupled/2p/diffusion/mimetic/mimeticoperator2padaptive.hh b/dumux/decoupled/2p/diffusion/mimetic/mimeticoperator2padaptive.hh index 4710cdefb138bcd77184e44de0a0efa5c4a32583..23e419b93898072822999e91d83052d4bb171416 100644 --- a/dumux/decoupled/2p/diffusion/mimetic/mimeticoperator2padaptive.hh +++ b/dumux/decoupled/2p/diffusion/mimetic/mimeticoperator2padaptive.hh @@ -123,9 +123,9 @@ public: for (; eIt != eEndIt; ++eIt) { - int globalIdx = problem.variables().index(*eIt); + int eIdxGlobal = problem.variables().index(*eIt); - unsigned int numFaces = this->intersectionMapper_.size(globalIdx); + unsigned int numFaces = this->intersectionMapper_.size(eIdxGlobal); // get local to global id map and pressure traces velocityW.resize(numFaces); @@ -133,7 +133,7 @@ public: pressTraceW.resize(numFaces); pressTraceNw.resize(numFaces); - CellData& cellData = problem.variables().cellData(globalIdx); + CellData& cellData = problem.variables().cellData(eIdxGlobal); FieldVector globalPos = eIt->geometry().center(); int intersectionIdx = -1; @@ -144,7 +144,7 @@ public: { ++intersectionIdx; - int globalIdxFace = this->intersectionMapper_.map(*eIt, intersectionIdx); + int fIdxGlobal = this->intersectionMapper_.map(*eIt, intersectionIdx); Scalar pcPotFace = (problem.bBoxMax() - isIt->geometry().center()) * problem.gravity() * densityDiff; @@ -152,14 +152,14 @@ public: { case pw: { - pressTraceW[intersectionIdx] = u[globalIdxFace]; - pressTraceNw[intersectionIdx] = u[globalIdxFace] + pcPotFace; + pressTraceW[intersectionIdx] = u[fIdxGlobal]; + pressTraceNw[intersectionIdx] = u[fIdxGlobal] + pcPotFace; break; } case pn: { - pressTraceNw[intersectionIdx] = u[globalIdxFace]; - pressTraceW[intersectionIdx] = u[globalIdxFace] - pcPotFace; + pressTraceNw[intersectionIdx] = u[fIdxGlobal]; + pressTraceW[intersectionIdx] = u[fIdxGlobal] - pcPotFace; break; } diff --git a/dumux/decoupled/2p/diffusion/mimetic/mimeticpressure2p.hh b/dumux/decoupled/2p/diffusion/mimetic/mimeticpressure2p.hh index 99a91f9a7f208be00934fe9bf277c96d6cc618ed..9125bed270ce64b8857ca60408009ddab8275c8a 100644 --- a/dumux/decoupled/2p/diffusion/mimetic/mimeticpressure2p.hh +++ b/dumux/decoupled/2p/diffusion/mimetic/mimeticpressure2p.hh @@ -250,17 +250,17 @@ public: ElementIterator eEndIt = problem_.gridView().template end<0>(); for (ElementIterator eIt = eItBegin; eIt != eEndIt; ++eIt) { - int globalIdx = problem_.variables().index(*eIt); - CellData& cellData = problem_.variables().cellData(globalIdx); + int eIdxGlobal = problem_.variables().index(*eIt); + CellData& cellData = problem_.variables().cellData(eIdxGlobal); if (pressureType == pw) { - (*potential)[globalIdx] = cellData.potential(wPhaseIdx); + (*potential)[eIdxGlobal] = cellData.potential(wPhaseIdx); } if (pressureType == pn) { - (*potential)[globalIdx] = cellData.potential(nPhaseIdx); + (*potential)[eIdxGlobal] = cellData.potential(nPhaseIdx); } if (vtkOutputLevel_ > 0) @@ -268,16 +268,16 @@ public: if (pressureType == pw) { - (*pressure)[globalIdx] = cellData.pressure(wPhaseIdx); - (*potentialSecond)[globalIdx] = cellData.potential(nPhaseIdx); - (*pressureSecond)[globalIdx] = cellData.pressure(nPhaseIdx); + (*pressure)[eIdxGlobal] = cellData.pressure(wPhaseIdx); + (*potentialSecond)[eIdxGlobal] = cellData.potential(nPhaseIdx); + (*pressureSecond)[eIdxGlobal] = cellData.pressure(nPhaseIdx); } if (pressureType == pn) { - (*pressure)[globalIdx] = cellData.pressure(nPhaseIdx); - (*potentialSecond)[globalIdx] = cellData.potential(wPhaseIdx); - (*pressureSecond)[globalIdx] = cellData.pressure(wPhaseIdx); + (*pressure)[eIdxGlobal] = cellData.pressure(nPhaseIdx); + (*potentialSecond)[eIdxGlobal] = cellData.potential(wPhaseIdx); + (*pressureSecond)[eIdxGlobal] = cellData.pressure(wPhaseIdx); } const typename Element::Geometry& geometry = eIt->geometry(); @@ -336,7 +336,7 @@ public: jacobianT.umtv(refVelocity, elementVelocity); elementVelocity /= geometry.integrationElement(localPos); - (*velocityWetting)[globalIdx] = elementVelocity; + (*velocityWetting)[eIdxGlobal] = elementVelocity; // calculate velocity on reference element as the Raviart-Thomas-0 // interpolant of the fluxes @@ -366,7 +366,7 @@ public: jacobianT.umtv(refVelocity, elementVelocity); elementVelocity /= geometry.integrationElement(localPos); - (*velocityNonwetting)[globalIdx] = elementVelocity; + (*velocityNonwetting)[eIdxGlobal] = elementVelocity; } } @@ -414,8 +414,8 @@ public: #endif for (int i=0; i < numFaces; i++) { - int globalIdx = A_.faceMapper().map(element, i, 1); - outstream << pressTrace_[globalIdx][0]; + int fIdxGlobal = A_.faceMapper().map(element, i, 1); + outstream << pressTrace_[fIdxGlobal][0]; } } @@ -428,8 +428,8 @@ public: #endif for (int i=0; i < numFaces; i++) { - int globalIdx = A_.faceMapper().map(element, i, 1); - instream >> pressTrace_[globalIdx][0]; + int fIdxGlobal = A_.faceMapper().map(element, i, 1); + instream >> pressTrace_[fIdxGlobal][0]; } } //@} @@ -504,9 +504,9 @@ void MimeticPressure2P<TypeTag>::updateMaterialLaws() ElementIterator eEndIt = problem_.gridView().template end<0>(); for (ElementIterator eIt = problem_.gridView().template begin<0>(); eIt != eEndIt; ++eIt) { - int globalIdx = problem_.variables().index(*eIt); + int eIdxGlobal = problem_.variables().index(*eIt); - CellData& cellData = problem_.variables().cellData(globalIdx); + CellData& cellData = problem_.variables().cellData(eIdxGlobal); Scalar satW = cellData.saturation(wPhaseIdx); diff --git a/dumux/decoupled/2p/diffusion/mimetic/mimeticpressure2padaptive.hh b/dumux/decoupled/2p/diffusion/mimetic/mimeticpressure2padaptive.hh index 2489545daebf1802e297ad2b3eb3c2b4881b6734..c0154152d9fea39e6a66fa6f502644f4e081f930 100644 --- a/dumux/decoupled/2p/diffusion/mimetic/mimeticpressure2padaptive.hh +++ b/dumux/decoupled/2p/diffusion/mimetic/mimeticpressure2padaptive.hh @@ -262,17 +262,17 @@ public: ElementIterator eEndIt = problem_.gridView().template end<0>(); for (ElementIterator eIt = eItBegin; eIt != eEndIt; ++eIt) { - int globalIdx = problem_.variables().index(*eIt); - CellData& cellData = problem_.variables().cellData(globalIdx); + int eIdxGlobal = problem_.variables().index(*eIt); + CellData& cellData = problem_.variables().cellData(eIdxGlobal); if (pressureType == pw) { - (*potential)[globalIdx] = cellData.potential(wPhaseIdx); + (*potential)[eIdxGlobal] = cellData.potential(wPhaseIdx); } if (pressureType == pn) { - (*potential)[globalIdx] = cellData.potential(nPhaseIdx); + (*potential)[eIdxGlobal] = cellData.potential(nPhaseIdx); } if (vtkOutputLevel_ > 0) @@ -280,16 +280,16 @@ public: if (pressureType == pw) { - (*pressure)[globalIdx] = cellData.pressure(wPhaseIdx); - (*potentialSecond)[globalIdx] = cellData.potential(nPhaseIdx); - (*pressureSecond)[globalIdx] = cellData.pressure(nPhaseIdx); + (*pressure)[eIdxGlobal] = cellData.pressure(wPhaseIdx); + (*potentialSecond)[eIdxGlobal] = cellData.potential(nPhaseIdx); + (*pressureSecond)[eIdxGlobal] = cellData.pressure(nPhaseIdx); } if (pressureType == pn) { - (*pressure)[globalIdx] = cellData.pressure(nPhaseIdx); - (*potentialSecond)[globalIdx] = cellData.potential(wPhaseIdx); - (*pressureSecond)[globalIdx] = cellData.pressure(wPhaseIdx); + (*pressure)[eIdxGlobal] = cellData.pressure(nPhaseIdx); + (*potentialSecond)[eIdxGlobal] = cellData.potential(wPhaseIdx); + (*pressureSecond)[eIdxGlobal] = cellData.pressure(wPhaseIdx); } const typename Element::Geometry& geometry = eIt->geometry(); @@ -348,7 +348,7 @@ public: jacobianT.umtv(refVelocity, elementVelocity); elementVelocity /= geometry.integrationElement(localPos); - (*velocityWetting)[globalIdx] = elementVelocity; + (*velocityWetting)[eIdxGlobal] = elementVelocity; // calculate velocity on reference element as the Raviart-Thomas-0 // interpolant of the fluxes @@ -378,7 +378,7 @@ public: jacobianT.umtv(refVelocity, elementVelocity); elementVelocity /= geometry.integrationElement(localPos); - (*velocityNonwetting)[globalIdx] = elementVelocity; + (*velocityNonwetting)[eIdxGlobal] = elementVelocity; } } @@ -426,8 +426,8 @@ public: #endif for (int i=0; i < numFaces; i++) { - int globalIdx = A_.intersectionMapper().map(element, i); - outstream << pressTrace_[globalIdx][0]; + int isIdxGlobal = A_.intersectionMapper().map(element, i); + outstream << pressTrace_[isIdxGlobal][0]; } } @@ -440,8 +440,8 @@ public: #endif for (int i=0; i < numFaces; i++) { - int globalIdx = A_.intersectionMapper().map(element, i); - instream >> pressTrace_[globalIdx][0]; + int isIdxGlobal = A_.intersectionMapper().map(element, i); + instream >> pressTrace_[isIdxGlobal][0]; } } //@} @@ -516,9 +516,9 @@ void MimeticPressure2PAdaptive<TypeTag>::updateMaterialLaws() ElementIterator eEndIt = problem_.gridView().template end<0>(); for (ElementIterator eIt = problem_.gridView().template begin<0>(); eIt != eEndIt; ++eIt) { - int globalIdx = problem_.variables().index(*eIt); + int eIdxGlobal = problem_.variables().index(*eIt); - CellData& cellData = problem_.variables().cellData(globalIdx); + CellData& cellData = problem_.variables().cellData(eIdxGlobal); Scalar satW = cellData.saturation(wPhaseIdx); diff --git a/dumux/decoupled/2p/transport/fv/fvsaturation2p.hh b/dumux/decoupled/2p/transport/fv/fvsaturation2p.hh index e6593922af680096fdff33cb3e5bf3c4086ff8ae..1efca5fc54d42451d151a882219293d37c7cfc8e 100644 --- a/dumux/decoupled/2p/transport/fv/fvsaturation2p.hh +++ b/dumux/decoupled/2p/transport/fv/fvsaturation2p.hh @@ -309,13 +309,13 @@ public: * * Calculates secondary saturation variables and stores saturations. * - * \param globalIdx Global cell index + * \param eIdxGlobal Global cell index * \param update Cell saturation update * \param dt Current time step */ - void updateSaturationSolution(int globalIdx, Scalar update, Scalar dt) + void updateSaturationSolution(int eIdxGlobal, Scalar update, Scalar dt) { - CellData& cellData = problem_.variables().cellData(globalIdx); + CellData& cellData = problem_.variables().cellData(eIdxGlobal); switch (saturationType_) { @@ -414,16 +414,16 @@ public: */ void serializeEntity(std::ostream &outstream, const Element &element) { - int globalIdx = problem_.variables().index(element); + int eIdxGlobal = problem_.variables().index(element); Scalar sat = 0.0; switch (saturationType_) { case sw: - sat = problem_.variables().cellData(globalIdx).saturation(wPhaseIdx); + sat = problem_.variables().cellData(eIdxGlobal).saturation(wPhaseIdx); break; case sn: - sat = problem_.variables().cellData(globalIdx).saturation(nPhaseIdx); + sat = problem_.variables().cellData(eIdxGlobal).saturation(nPhaseIdx); break; } @@ -437,7 +437,7 @@ public: */ void deserializeEntity(std::istream &instream, const Element &element) { - int globalIdx = problem_.variables().index(element); + int eIdxGlobal = problem_.variables().index(element); Scalar sat = 0.; instream >> sat; @@ -445,12 +445,12 @@ public: switch (saturationType_) { case sw: - problem_.variables().cellData(globalIdx).setSaturation(wPhaseIdx, sat); - problem_.variables().cellData(globalIdx).setSaturation(nPhaseIdx, 1-sat); + problem_.variables().cellData(eIdxGlobal).setSaturation(wPhaseIdx, sat); + problem_.variables().cellData(eIdxGlobal).setSaturation(nPhaseIdx, 1-sat); break; case sn: - problem_.variables().cellData(globalIdx).setSaturation(nPhaseIdx, sat); - problem_.variables().cellData(globalIdx).setSaturation(wPhaseIdx, 1-sat); + problem_.variables().cellData(eIdxGlobal).setSaturation(nPhaseIdx, sat); + problem_.variables().cellData(eIdxGlobal).setSaturation(wPhaseIdx, 1-sat); break; } } @@ -1137,9 +1137,9 @@ void FVSaturation2P<TypeTag>::initialize() PrimaryVariables initSol(0.0); problem_.initial(initSol, *eIt); - int globalIdx = problem_.variables().index(*eIt); + int eIdxGlobal = problem_.variables().index(*eIt); - CellData& cellData = problem_.variables().cellData(globalIdx); + CellData& cellData = problem_.variables().cellData(eIdxGlobal); switch (saturationType_) { @@ -1179,9 +1179,9 @@ void FVSaturation2P<TypeTag>::updateMaterialLaws() ElementIterator eEndIt = problem_.gridView().template end<0>(); for (ElementIterator eIt = eItBegin; eIt != eEndIt; ++eIt) { - int globalIdx = problem_.variables().index(*eIt); + int eIdxGlobal = problem_.variables().index(*eIt); - CellData& cellData = problem_.variables().cellData(globalIdx); + CellData& cellData = problem_.variables().cellData(eIdxGlobal); //determine phase saturations from primary saturation variable Scalar satW = cellData.saturation(wPhaseIdx); diff --git a/dumux/decoupled/2p2c/fv3dpressure2p2cadaptive.hh b/dumux/decoupled/2p2c/fv3dpressure2p2cadaptive.hh index 70cc55d9132e5b58eee403668641a916f0b33097..6158360a5e97b94d5d353554029eeae9bdf4e3a8 100644 --- a/dumux/decoupled/2p2c/fv3dpressure2p2cadaptive.hh +++ b/dumux/decoupled/2p2c/fv3dpressure2p2cadaptive.hh @@ -225,13 +225,13 @@ public: for (ElementIterator eIt = problem().gridView().template begin<0>(); eIt != eItEnd; ++eIt) { // get the global index of the cell - int globalIdxI = problem().variables().index(*eIt); + int eIdxGlobalI = problem().variables().index(*eIt); // assemble interior element contributions if (eIt->partitionType() == Dune::InteriorEntity) { - this->pressure()[globalIdxI] - = problem().variables().cellData(globalIdxI).pressure(this->pressureType); + this->pressure()[eIdxGlobalI] + = problem().variables().cellData(eIdxGlobalI).pressure(this->pressureType); } } #if HAVE_MPI @@ -348,8 +348,8 @@ void FV3dPressure2P2CAdaptive<TypeTag>::initializeMatrixRowSize() for (ElementIterator eIt = problem().gridView().template begin<0> (); eIt != eItEnd; ++eIt) { // cell index - int globalIdxI = problem().variables().index(*eIt); - CellData& cellDataI = problem().variables().cellData(globalIdxI); + int eIdxGlobalI = problem().variables().index(*eIt); + CellData& cellDataI = problem().variables().cellData(eIdxGlobalI); // initialize row size int rowSize = 1; @@ -380,15 +380,15 @@ void FV3dPressure2P2CAdaptive<TypeTag>::initializeMatrixRowSize() int intersectionID = problem().grid().localIdSet().subId(*eIt, isIt->indexInInside(), 1); //index outside - int globalIdxJ = problem().variables().index(*isIt->outside()); + int eIdxGlobalJ = problem().variables().index(*isIt->outside()); // add Entry of current neighbor cell to the IS seen from large cell - irregularCellMap_[intersectionID].push_back(globalIdxJ); + irregularCellMap_[intersectionID].push_back(eIdxGlobalJ); } } } cellDataI.fluxData().resize(numberOfIntersections); - this->A_.incrementrowsize(globalIdxI, rowSize); + this->A_.incrementrowsize(eIdxGlobalI, rowSize); } //end first loop (that already reserved enough space for the MPFA connections on hanging nodes) // second loop to determine which matrix entries will be occupied @@ -405,7 +405,7 @@ void FV3dPressure2P2CAdaptive<TypeTag>::initializeMatrixRowSize() for (ElementIterator eIt = problem().gridView().template begin<0> (); eIt != eItEnd; ++eIt) { // cell index - int globalIdxI = problem().variables().index(*eIt); + int eIdxGlobalI = problem().variables().index(*eIt); // run through all intersections with neighbors IntersectionIterator isItEnd = problem().gridView().iend(*eIt); for (IntersectionIterator isIt = problem().gridView().ibegin(*eIt); isIt != isItEnd; ++isIt) @@ -413,7 +413,7 @@ void FV3dPressure2P2CAdaptive<TypeTag>::initializeMatrixRowSize() if (isIt->neighbor()) { //index outside - int globalIdxJ = problem().variables().index(*isIt->outside()); + int eIdxGlobalJ = problem().variables().index(*isIt->outside()); // if mpfa is used, more entries might be needed if all interactionRegions are regarded if (isIt->outside()->level() > eIt->level()) //look from larger cell @@ -426,19 +426,19 @@ void FV3dPressure2P2CAdaptive<TypeTag>::initializeMatrixRowSize() // Prepare MPFA /** get geometric Info, transmissibility matrix */ GlobalPosition globalPos3(0.); - int globalIdx3=-1; + int eIdxGlobal3=-1; GlobalPosition globalPos4(0.); - int globalIdx4=-1; + int eIdxGlobal4=-1; TransmissivityMatrix T(0.); int interactionRegions = problem().variables().getMpfaData3D(*isIt, T, - globalPos3, globalIdx3, globalPos4, globalIdx4 ); + globalPos3, eIdxGlobal3, globalPos4, eIdxGlobal4 ); if (interactionRegions == 0) interactionRegions = problem().pressureModel().computeTransmissibilities(isIt,T, - globalPos3, globalIdx3, globalPos4, globalIdx4 ); + globalPos3, eIdxGlobal3, globalPos4, eIdxGlobal4 ); if(!interactionRegions) - Dune::dgrave << "something went wrong getting mpfa data on cell " << globalIdxI << std::endl; + Dune::dgrave << "something went wrong getting mpfa data on cell " << eIdxGlobalI << std::endl; if (interactionRegions == 1) // no second subface continue; @@ -446,10 +446,10 @@ void FV3dPressure2P2CAdaptive<TypeTag>::initializeMatrixRowSize() for (int cocumber=1; cocumber<interactionRegions; cocumber++ ) { problem().variables().getMpfaData3D(*isIt, T, - globalPos3, globalIdx3, globalPos4, globalIdx4, cocumber); + globalPos3, eIdxGlobal3, globalPos4, eIdxGlobal4, cocumber); // indices - int additionalIdx2 = globalIdx3; - int additionalIdx3 = globalIdx4; + int additionalIdx2 = eIdxGlobal3; + int additionalIdx3 = eIdxGlobal4; bool addIndex = true; @@ -472,8 +472,8 @@ void FV3dPressure2P2CAdaptive<TypeTag>::initializeMatrixRowSize() if(!additional2isNeighbor) { // check if relation not already added - IntPair intPair(globalIdxI,additionalIdx2); - if(globalIdxI > additionalIdx2) + IntPair intPair(eIdxGlobalI,additionalIdx2); + if(eIdxGlobalI > additionalIdx2) std::swap(intPair.first, intPair.second); range = addionalRelations.equal_range(intPair.first); for (rangeIt=range.first; range.first!=range.second @@ -482,7 +482,7 @@ void FV3dPressure2P2CAdaptive<TypeTag>::initializeMatrixRowSize() addIndex = false; if(addIndex) { - this->A_.incrementrowsize(globalIdxI); + this->A_.incrementrowsize(eIdxGlobalI); // add space for additional itsself this->A_.incrementrowsize(additionalIdx2); // mark relation as added @@ -495,8 +495,8 @@ void FV3dPressure2P2CAdaptive<TypeTag>::initializeMatrixRowSize() { addIndex = true; // check if relation not already added - IntPair intPair(globalIdxI,additionalIdx3); - if(globalIdxI > additionalIdx3) + IntPair intPair(eIdxGlobalI,additionalIdx3); + if(eIdxGlobalI > additionalIdx3) std::swap(intPair.first, intPair.second); range = addionalRelations.equal_range(intPair.first); for (rangeIt=range.first; range.first!=range.second @@ -505,7 +505,7 @@ void FV3dPressure2P2CAdaptive<TypeTag>::initializeMatrixRowSize() addIndex = false; if(addIndex) { - this->A_.incrementrowsize(globalIdxI); + this->A_.incrementrowsize(eIdxGlobalI); // add space for additional itsself this->A_.incrementrowsize(additionalIdx3); // mark relation as added @@ -533,8 +533,8 @@ void FV3dPressure2P2CAdaptive<TypeTag>::initializeMatrixRowSize() { addIndex = true; // check if relation not already added - IntPair intPair(globalIdxJ,additionalIdx2); - if(globalIdxJ > additionalIdx2) + IntPair intPair(eIdxGlobalJ,additionalIdx2); + if(eIdxGlobalJ > additionalIdx2) std::swap(intPair.first, intPair.second); range = addionalRelations.equal_range(intPair.first); for (rangeIt=range.first; range.first!=range.second @@ -543,7 +543,7 @@ void FV3dPressure2P2CAdaptive<TypeTag>::initializeMatrixRowSize() addIndex = false; if(addIndex) { - this->A_.incrementrowsize(globalIdxJ); + this->A_.incrementrowsize(eIdxGlobalJ); // add space for additional itsself this->A_.incrementrowsize(additionalIdx2); // mark relation as added @@ -556,8 +556,8 @@ void FV3dPressure2P2CAdaptive<TypeTag>::initializeMatrixRowSize() { addIndex = true; // check if relation not already added - IntPair intPair(globalIdxJ,additionalIdx3); - if(globalIdxJ > additionalIdx3) + IntPair intPair(eIdxGlobalJ,additionalIdx3); + if(eIdxGlobalJ > additionalIdx3) std::swap(intPair.first, intPair.second); range = addionalRelations.equal_range(intPair.first); for (rangeIt=range.first; range.first!=range.second @@ -566,7 +566,7 @@ void FV3dPressure2P2CAdaptive<TypeTag>::initializeMatrixRowSize() addIndex = false; if(addIndex) { - this->A_.incrementrowsize(globalIdxJ); + this->A_.incrementrowsize(eIdxGlobalJ); // add space for additional itsself this->A_.incrementrowsize(additionalIdx3); // mark relation as added @@ -593,10 +593,10 @@ void FV3dPressure2P2CAdaptive<TypeTag>::initializeMatrixIndices() for (ElementIterator eIt = problem().gridView().template begin<0> (); eIt != eItEnd; ++eIt) { // cell index - int globalIdxI = problem().variables().index(*eIt); + int eIdxGlobalI = problem().variables().index(*eIt); // add diagonal index - this->A_.addindex(globalIdxI, globalIdxI); + this->A_.addindex(eIdxGlobalI, eIdxGlobalI); // run through all intersections with neighbors IntersectionIterator isItEnd = problem().gridView().template iend(*eIt); @@ -605,42 +605,42 @@ void FV3dPressure2P2CAdaptive<TypeTag>::initializeMatrixIndices() { // access neighbor ElementPointer outside = isIt->outside(); - int globalIdxJ = problem().variables().index(*outside); + int eIdxGlobalJ = problem().variables().index(*outside); // add off diagonal index - this->A_.addindex(globalIdxI, globalIdxJ); + this->A_.addindex(eIdxGlobalI, eIdxGlobalJ); // special treatment for hanging nodes in the mpfa case if (enableMPFA && (eIt->level() < isIt->outside()->level())) { // prepare stuff to enter transmissibility calculation GlobalPosition globalPos3(0.); - int globalIdx3=-1; + int eIdxGlobal3=-1; GlobalPosition globalPos4(0.); - int globalIdx4=-1; + int eIdxGlobal4=-1; TransmissivityMatrix T(0.); TransmissivityMatrix additionalT(0.); int interactionRegions - = problem().variables().getMpfaData3D(*isIt, T, globalPos3, globalIdx3, globalPos4, globalIdx4 ); + = problem().variables().getMpfaData3D(*isIt, T, globalPos3, eIdxGlobal3, globalPos4, eIdxGlobal4 ); if (interactionRegions == 0) interactionRegions = problem().pressureModel().computeTransmissibilities(isIt,T, - globalPos3, globalIdx3, globalPos4, globalIdx4 ); + globalPos3, eIdxGlobal3, globalPos4, eIdxGlobal4 ); for (int cocumber=1; cocumber<interactionRegions; cocumber++ ) { problem().variables().getMpfaData3D(*isIt, T, - globalPos3, globalIdx3, globalPos4, globalIdx4, cocumber); + globalPos3, eIdxGlobal3, globalPos4, eIdxGlobal4, cocumber); // add off diagonal index in both directions!! - this->A_.addindex(globalIdxI, globalIdx3); - this->A_.addindex(globalIdx3, globalIdxI); - this->A_.addindex(globalIdxI, globalIdx4); - this->A_.addindex(globalIdx4, globalIdxI); - this->A_.addindex(globalIdxJ, globalIdx3); - this->A_.addindex(globalIdx3, globalIdxJ); - this->A_.addindex(globalIdxJ, globalIdx4); - this->A_.addindex(globalIdx4, globalIdxJ); + this->A_.addindex(eIdxGlobalI, eIdxGlobal3); + this->A_.addindex(eIdxGlobal3, eIdxGlobalI); + this->A_.addindex(eIdxGlobalI, eIdxGlobal4); + this->A_.addindex(eIdxGlobal4, eIdxGlobalI); + this->A_.addindex(eIdxGlobalJ, eIdxGlobal3); + this->A_.addindex(eIdxGlobal3, eIdxGlobalJ); + this->A_.addindex(eIdxGlobalJ, eIdxGlobal4); + this->A_.addindex(eIdxGlobal4, eIdxGlobalJ); } } } @@ -666,13 +666,13 @@ void FV3dPressure2P2CAdaptive<TypeTag>::assemble(bool first) for (ElementIterator eIt = problem().gridView().template begin<0>(); eIt != eItEnd; ++eIt) { // get the global index of the cell - int globalIdxI = problem().variables().index(*eIt); + int eIdxGlobalI = problem().variables().index(*eIt); // assemble interior element contributions if (eIt->partitionType() == Dune::InteriorEntity) { // get the cell data - CellData& cellDataI = problem().variables().cellData(globalIdxI); + CellData& cellDataI = problem().variables().cellData(eIdxGlobalI); Dune::FieldVector<Scalar, 2> entries(0.); @@ -684,7 +684,7 @@ void FV3dPressure2P2CAdaptive<TypeTag>::assemble(bool first) #endif problem().pressureModel().getSource(entries,*eIt, cellDataI, first); - this->f_[globalIdxI] += entries[rhs]; + this->f_[eIdxGlobalI] += entries[rhs]; /***** flux term ***********/ // iterate over all faces of the cell @@ -696,7 +696,7 @@ void FV3dPressure2P2CAdaptive<TypeTag>::assemble(bool first) { ElementPointer elementNeighbor = isIt->outside(); - int globalIdxJ = problem().variables().index(*elementNeighbor); + int eIdxGlobalJ = problem().variables().index(*elementNeighbor); //check for hanging nodes //take a hanging node never from the element with smaller level! bool haveSameLevel = (eIt->level() == elementNeighbor->level()); @@ -704,7 +704,7 @@ void FV3dPressure2P2CAdaptive<TypeTag>::assemble(bool first) // the last condition is needed to properly assemble in the presence // of ghost elements if (GET_PROP_VALUE(TypeTag, VisitFacesOnlyOnce) - && (globalIdxI > globalIdxJ) && haveSameLevel + && (eIdxGlobalI > eIdxGlobalJ) && haveSameLevel && elementNeighbor->partitionType() == Dune::InteriorEntity) continue; @@ -713,37 +713,37 @@ void FV3dPressure2P2CAdaptive<TypeTag>::assemble(bool first) if(!haveSameLevel && enableMPFA) { if (cellDataI.subdomain() != 2 - or problem().variables().cellData(globalIdxJ).subdomain() != 2) // cell in the 1p domain + or problem().variables().cellData(eIdxGlobalJ).subdomain() != 2) // cell in the 1p domain asImp_().get1pMpfaFlux(isIt, cellDataI); else asImp_().getMpfaFlux(isIt, cellDataI); } else { - CellData cellDataJ = problem().variables().cellData(globalIdxJ); + CellData cellDataJ = problem().variables().cellData(eIdxGlobalJ); if (cellDataI.subdomain() != 2 - or problem().variables().cellData(globalIdxJ).subdomain() != 2) // cell in the 1p domain + or problem().variables().cellData(eIdxGlobalJ).subdomain() != 2) // cell in the 1p domain asImp_().get1pFlux(entries, *isIt, cellDataI); else asImp_().getFlux(entries, *isIt, cellDataI, first); //set right hand side - this->f_[globalIdxI] -= entries[rhs]; + this->f_[eIdxGlobalI] -= entries[rhs]; // set diagonal entry - this->A_[globalIdxI][globalIdxI] += entries[matrix]; + this->A_[eIdxGlobalI][eIdxGlobalI] += entries[matrix]; // set off-diagonal entry - this->A_[globalIdxI][globalIdxJ] -= entries[matrix]; + this->A_[eIdxGlobalI][eIdxGlobalJ] -= entries[matrix]; // The second condition is needed to not spoil the ghost element entries if (GET_PROP_VALUE(TypeTag, VisitFacesOnlyOnce) && elementNeighbor->partitionType() == Dune::InteriorEntity) { - this->f_[globalIdxJ] += entries[rhs]; - this->A_[globalIdxJ][globalIdxJ] += entries[matrix]; - this->A_[globalIdxJ][globalIdxI] -= entries[matrix]; + this->f_[eIdxGlobalJ] += entries[rhs]; + this->A_[eIdxGlobalJ][eIdxGlobalJ] += entries[matrix]; + this->A_[eIdxGlobalJ][eIdxGlobalI] -= entries[matrix]; } } } // end neighbor @@ -758,9 +758,9 @@ void FV3dPressure2P2CAdaptive<TypeTag>::assemble(bool first) asImp_().getFluxOnBoundary(entries, *isIt, cellDataI, first); //set right hand side - this->f_[globalIdxI] += entries[rhs]; + this->f_[eIdxGlobalI] += entries[rhs]; // set diagonal entry - this->A_[globalIdxI][globalIdxI] += entries[matrix]; + this->A_[eIdxGlobalI][eIdxGlobalI] += entries[matrix]; } } //end interfaces loop @@ -770,16 +770,16 @@ void FV3dPressure2P2CAdaptive<TypeTag>::assemble(bool first) else asImp_().getStorage(entries, *eIt, cellDataI, first); - this->f_[globalIdxI] += entries[rhs]; + this->f_[eIdxGlobalI] += entries[rhs]; // set diagonal entry - this->A_[globalIdxI][globalIdxI] += entries[matrix]; + this->A_[eIdxGlobalI][eIdxGlobalI] += entries[matrix]; } // assemble overlap and ghost element contributions else { - this->A_[globalIdxI] = 0.0; - this->A_[globalIdxI][globalIdxI] = 1.0; - this->f_[globalIdxI] = this->pressure()[globalIdxI]; + this->A_[eIdxGlobalI] = 0.0; + this->A_[eIdxGlobalI][eIdxGlobalI] = 1.0; + this->f_[eIdxGlobalI] = this->pressure()[eIdxGlobalI]; } } // end grid traversal @@ -811,7 +811,7 @@ void FV3dPressure2P2CAdaptive<TypeTag>::getMpfaFlux(const IntersectionIterator& { // acess Cell I ElementPointer elementPointerI = isIt->inside(); - int globalIdxI = problem().variables().index(*elementPointerI); + int eIdxGlobalI = problem().variables().index(*elementPointerI); // get global coordinate of cell center const GlobalPosition& globalPos = elementPointerI->geometry().center(); @@ -825,8 +825,8 @@ void FV3dPressure2P2CAdaptive<TypeTag>::getMpfaFlux(const IntersectionIterator& // access neighbor ElementPointer neighborPointer = isIt->outside(); - int globalIdxJ = problem().variables().index(*neighborPointer); - CellData& cellDataJ = problem().variables().cellData(globalIdxJ); + int eIdxGlobalJ = problem().variables().index(*neighborPointer); + CellData& cellDataJ = problem().variables().cellData(eIdxGlobalJ); // gemotry info of neighbor const GlobalPosition& globalPosNeighbor = neighborPointer->geometry().center(); @@ -870,8 +870,8 @@ void FV3dPressure2P2CAdaptive<TypeTag>::getMpfaFlux(const IntersectionIterator& graddv_dC[compIdx] = (cellDataJ.dv(compIdx) - cellDataI.dv(compIdx)) / dist; } -// potentialW = problem().variables().potentialWetting(globalIdxI, isIndex); -// potentialNW = problem().variables().potentialNonwetting(globalIdxI, isIndex); +// potentialW = problem().variables().potentialWetting(eIdxGlobalI, isIndex); +// potentialNW = problem().variables().potentialNonwetting(eIdxGlobalI, isIndex); // // densityW = (potentialW > 0.) ? densityWI : densityWJ; // densityNW = (potentialNW > 0.) ? densityNWI : densityNWJ; @@ -883,31 +883,31 @@ void FV3dPressure2P2CAdaptive<TypeTag>::getMpfaFlux(const IntersectionIterator& // Prepare MPFA /* get geometrical Info, transmissibility matrix */ GlobalPosition globalPos3(0.); - int globalIdx3=-1; + int eIdxGlobal3=-1; GlobalPosition globalPos4(0.); - int globalIdx4=-1; + int eIdxGlobal4=-1; TransmissivityMatrix T(0.); // prepare second interaction region GlobalPosition globalPosAdditional3(0.); - int globalIdxAdditional3=-1; + int eIdxGlobalAdditional3=-1; GlobalPosition globalPosAdditional4(0.); - int globalIdxAdditional4=-1; + int eIdxGlobalAdditional4=-1; TransmissivityMatrix additionalT(0.); int interactionRegions = problem().variables().getMpfaData3D(*isIt, T, - globalPos3, globalIdx3, globalPos4, globalIdx4 ); + globalPos3, eIdxGlobal3, globalPos4, eIdxGlobal4 ); if (interactionRegions == 0) interactionRegions = problem().pressureModel().computeTransmissibilities(isIt,T, - globalPos3, globalIdx3, globalPos4, globalIdx4 ); + globalPos3, eIdxGlobal3, globalPos4, eIdxGlobal4 ); if(!interactionRegions) - Dune::dgrave << "something went wrong getting mpfa data on cell " << globalIdxI << std::endl; + Dune::dgrave << "something went wrong getting mpfa data on cell " << eIdxGlobalI << std::endl; // shortcurts mpfa case - CellData& cellData3 = problem().variables().cellData(globalIdx3); - CellData& cellData4 = problem().variables().cellData(globalIdx4); + CellData& cellData3 = problem().variables().cellData(eIdxGlobal3); + CellData& cellData4 = problem().variables().cellData(eIdxGlobal4); Scalar temp1 = globalPos * this->gravity_; Scalar temp2 = globalPosNeighbor * this->gravity_; Scalar temp3 = globalPos3 * this->gravity_; @@ -928,16 +928,16 @@ void FV3dPressure2P2CAdaptive<TypeTag>::getMpfaFlux(const IntersectionIterator& { // get data for second interaction region problem().variables().getMpfaData3D(*isIt, additionalT, - globalPosAdditional3, globalIdxAdditional3, - globalPosAdditional4, globalIdxAdditional4 , + globalPosAdditional3, eIdxGlobalAdditional3, + globalPosAdditional4, eIdxGlobalAdditional4 , banana); // offset for second interaction region Scalar gravityContributionAdditonal = temp1 * additionalT[0] + temp2 * additionalT[1] + globalPosAdditional3*this->gravity_ * additionalT[2] + globalPosAdditional4*this->gravity_ * additionalT[3]; - CellData& cellDataA3 = problem().variables().cellData(globalIdxAdditional3); - CellData& cellDataA4 = problem().variables().cellData(globalIdxAdditional4); + CellData& cellDataA3 = problem().variables().cellData(eIdxGlobalAdditional3); + CellData& cellDataA4 = problem().variables().cellData(eIdxGlobalAdditional4); for (int phaseIdx = 0; phaseIdx < NumPhases; ++phaseIdx) { @@ -1006,15 +1006,15 @@ void FV3dPressure2P2CAdaptive<TypeTag>::getMpfaFlux(const IntersectionIterator& /* compute matrix entry: advective fluxes */ /* extend T with other matrix entries and assemble to A_ */ - this->A_[globalIdxI][globalIdxI] += (lambda[wPhaseIdx] * dV[wPhaseIdx] + lambda[nPhaseIdx] * dV[nPhaseIdx]) * T[0]; - this->A_[globalIdxI][globalIdxJ] += (lambda[wPhaseIdx] * dV[wPhaseIdx] + lambda[nPhaseIdx] * dV[nPhaseIdx]) * T[1]; - this->A_[globalIdxI][globalIdx3] += (lambda[wPhaseIdx] * dV[wPhaseIdx] + lambda[nPhaseIdx] * dV[nPhaseIdx]) * T[2]; - this->A_[globalIdxI][globalIdx4] += (lambda[wPhaseIdx] * dV[wPhaseIdx] + lambda[nPhaseIdx] * dV[nPhaseIdx]) * T[3]; + this->A_[eIdxGlobalI][eIdxGlobalI] += (lambda[wPhaseIdx] * dV[wPhaseIdx] + lambda[nPhaseIdx] * dV[nPhaseIdx]) * T[0]; + this->A_[eIdxGlobalI][eIdxGlobalJ] += (lambda[wPhaseIdx] * dV[wPhaseIdx] + lambda[nPhaseIdx] * dV[nPhaseIdx]) * T[1]; + this->A_[eIdxGlobalI][eIdxGlobal3] += (lambda[wPhaseIdx] * dV[wPhaseIdx] + lambda[nPhaseIdx] * dV[nPhaseIdx]) * T[2]; + this->A_[eIdxGlobalI][eIdxGlobal4] += (lambda[wPhaseIdx] * dV[wPhaseIdx] + lambda[nPhaseIdx] * dV[nPhaseIdx]) * T[3]; // add gravity to RHS vector Scalar gravityContribution = temp1 * T[0] + temp2 * T[1] + temp3 * T[2] + temp4 * T[3]; - this->f_[globalIdxI] += (rhoMean[wPhaseIdx] * lambda[wPhaseIdx] * dV[wPhaseIdx] + this->f_[eIdxGlobalI] += (rhoMean[wPhaseIdx] * lambda[wPhaseIdx] * dV[wPhaseIdx] + rhoMean[nPhaseIdx] * lambda[nPhaseIdx] * dV[nPhaseIdx]) * gravityContribution; // weithing accounts for the fraction of the subcontrol volume @@ -1022,17 +1022,17 @@ void FV3dPressure2P2CAdaptive<TypeTag>::getMpfaFlux(const IntersectionIterator& if(enableVolumeIntegral_) // switch off volume integral for mpfa case { // correct for area integral - this->A_[globalIdxI][globalIdxI] -= + this->A_[eIdxGlobalI][eIdxGlobalI] -= weightingFactor * (lambda[wPhaseIdx] * gV[wPhaseIdx] + lambda[nPhaseIdx] * gV[nPhaseIdx]) * T[0]; - this->A_[globalIdxI][globalIdxJ] -= + this->A_[eIdxGlobalI][eIdxGlobalJ] -= weightingFactor * (lambda[wPhaseIdx] * gV[wPhaseIdx] + lambda[nPhaseIdx] * gV[nPhaseIdx]) * T[1]; - this->A_[globalIdxI][globalIdx3] -= + this->A_[eIdxGlobalI][eIdxGlobal3] -= weightingFactor * (lambda[wPhaseIdx] * gV[wPhaseIdx] + lambda[nPhaseIdx] * gV[nPhaseIdx]) * T[2]; - this->A_[globalIdxI][globalIdx4] -= + this->A_[eIdxGlobalI][eIdxGlobal4] -= weightingFactor * (lambda[wPhaseIdx] * gV[wPhaseIdx] + lambda[nPhaseIdx] * gV[nPhaseIdx]) * T[3]; // add gravity to RHS vector - this->f_[globalIdxI] -= weightingFactor * gravityContribution * + this->f_[eIdxGlobalI] -= weightingFactor * gravityContribution * (rhoMean[wPhaseIdx] * lambda[wPhaseIdx] * gV[wPhaseIdx] + rhoMean[nPhaseIdx] * lambda[nPhaseIdx] * gV[nPhaseIdx]); } @@ -1049,7 +1049,7 @@ void FV3dPressure2P2CAdaptive<TypeTag>::getMpfaFlux(const IntersectionIterator& pcGradient *= - lambda[wPhaseIdx] * dV[wPhaseIdx] + enableVolumeIntegral_ * weightingFactor * lambda[wPhaseIdx] * gV[wPhaseIdx]; - this->f_[globalIdxI] += pcGradient; + this->f_[eIdxGlobalI] += pcGradient; // regard more interaction regions, if there are more if(interactionRegions != 1) @@ -1058,31 +1058,31 @@ void FV3dPressure2P2CAdaptive<TypeTag>::getMpfaFlux(const IntersectionIterator& { // get data for second interaction region problem().variables().getMpfaData3D(*isIt, additionalT, - globalPosAdditional3, globalIdxAdditional3, - globalPosAdditional4, globalIdxAdditional4 , + globalPosAdditional3, eIdxGlobalAdditional3, + globalPosAdditional4, eIdxGlobalAdditional4 , banana); // offset for second interaction region Scalar gravityContributionAdditonal = temp1 * additionalT[0] + temp2 * additionalT[1] + globalPosAdditional3*this->gravity_ * additionalT[2] + globalPosAdditional4*this->gravity_ * additionalT[3]; - CellData& cellDataA3 = problem().variables().cellData(globalIdxAdditional3); - CellData& cellDataA4 = problem().variables().cellData(globalIdxAdditional4); + CellData& cellDataA3 = problem().variables().cellData(eIdxGlobalAdditional3); + CellData& cellDataA4 = problem().variables().cellData(eIdxGlobalAdditional4); /* compute matrix entry: advective fluxes */ /* extend T with other matrix entries and assemble to A_ */ - this->A_[globalIdxI][globalIdxI] += + this->A_[eIdxGlobalI][eIdxGlobalI] += (lambda[wPhaseIdx] * dV[wPhaseIdx] + lambda[nPhaseIdx] * dV[nPhaseIdx]) * additionalT[0]; - this->A_[globalIdxI][globalIdxJ] += + this->A_[eIdxGlobalI][eIdxGlobalJ] += (lambda[wPhaseIdx] * dV[wPhaseIdx] + lambda[nPhaseIdx] * dV[nPhaseIdx]) * additionalT[1]; - this->A_[globalIdxI][globalIdxAdditional3] += + this->A_[eIdxGlobalI][eIdxGlobalAdditional3] += (lambda[wPhaseIdx] * dV[wPhaseIdx] + lambda[nPhaseIdx] * dV[nPhaseIdx]) * additionalT[2]; - this->A_[globalIdxI][globalIdxAdditional4] += + this->A_[eIdxGlobalI][eIdxGlobalAdditional4] += (lambda[wPhaseIdx] * dV[wPhaseIdx] + lambda[nPhaseIdx] * dV[nPhaseIdx]) * additionalT[3]; // add gravity to RHS vector - this->f_[globalIdxI] += (rhoMean[wPhaseIdx] * lambda[wPhaseIdx] * dV[wPhaseIdx] + this->f_[eIdxGlobalI] += (rhoMean[wPhaseIdx] * lambda[wPhaseIdx] * dV[wPhaseIdx] + rhoMean[nPhaseIdx] * lambda[nPhaseIdx] * dV[nPhaseIdx]) * gravityContributionAdditonal; // weithing accounts for the fraction of the subcontrol volume @@ -1090,17 +1090,17 @@ void FV3dPressure2P2CAdaptive<TypeTag>::getMpfaFlux(const IntersectionIterator& if(enableVolumeIntegral_) // switch off volume integral for mpfa case { // correct for area integral - this->A_[globalIdxI][globalIdxI] -= + this->A_[eIdxGlobalI][eIdxGlobalI] -= weightingFactor * (lambda[wPhaseIdx] * gV[wPhaseIdx] + lambda[nPhaseIdx] * gV[nPhaseIdx]) * additionalT[0]; - this->A_[globalIdxI][globalIdxJ] -= + this->A_[eIdxGlobalI][eIdxGlobalJ] -= weightingFactor * (lambda[wPhaseIdx] * gV[wPhaseIdx] + lambda[nPhaseIdx] * gV[nPhaseIdx]) * additionalT[1]; - this->A_[globalIdxI][globalIdxAdditional3] -= + this->A_[eIdxGlobalI][eIdxGlobalAdditional3] -= weightingFactor * (lambda[wPhaseIdx] * gV[wPhaseIdx] + lambda[nPhaseIdx] * gV[nPhaseIdx]) * additionalT[2]; - this->A_[globalIdxI][globalIdxAdditional4] -= + this->A_[eIdxGlobalI][eIdxGlobalAdditional4] -= weightingFactor * (lambda[wPhaseIdx] * gV[wPhaseIdx] + lambda[nPhaseIdx] * gV[nPhaseIdx]) * additionalT[3]; // add gravity to RHS vector - this->f_[globalIdxI] -= weightingFactor * gravityContribution * + this->f_[eIdxGlobalI] -= weightingFactor * gravityContribution * (rhoMean[wPhaseIdx] * lambda[wPhaseIdx] * gV[wPhaseIdx] + rhoMean[nPhaseIdx] * lambda[nPhaseIdx] * gV[nPhaseIdx]); } @@ -1117,7 +1117,7 @@ void FV3dPressure2P2CAdaptive<TypeTag>::getMpfaFlux(const IntersectionIterator& pcGradient *= - lambda[wPhaseIdx] * dV[wPhaseIdx] + enableVolumeIntegral_ * weightingFactor * lambda[wPhaseIdx] * gV[wPhaseIdx]; - this->f_[globalIdxI] += pcGradient; + this->f_[eIdxGlobalI] += pcGradient; } } } @@ -1144,15 +1144,15 @@ void FV3dPressure2P2CAdaptive<TypeTag>::get1pMpfaFlux(const IntersectionIterator { // acess Cell I ElementPointer elementPointerI = isIt->inside(); - int globalIdxI = problem().variables().index(*elementPointerI); + int eIdxGlobalI = problem().variables().index(*elementPointerI); // get global coordinate of cell center const GlobalPosition& globalPos = elementPointerI->geometry().center(); // access neighbor ElementPointer neighborPointer = isIt->outside(); - int globalIdxJ = problem().variables().index(*neighborPointer); - CellData& cellDataJ = problem().variables().cellData(globalIdxJ); + int eIdxGlobalJ = problem().variables().index(*neighborPointer); + CellData& cellDataJ = problem().variables().cellData(eIdxGlobalJ); // gemotry info of neighbor const GlobalPosition& globalPosNeighbor = neighborPointer->geometry().center(); @@ -1170,31 +1170,31 @@ void FV3dPressure2P2CAdaptive<TypeTag>::get1pMpfaFlux(const IntersectionIterator // Prepare MPFA /** get geometrical Info, transmissibility matrix */ GlobalPosition globalPos3(0.); - int globalIdx3=-1; + int eIdxGlobal3=-1; GlobalPosition globalPos4(0.); - int globalIdx4=-1; + int eIdxGlobal4=-1; TransmissivityMatrix T(0.); // prepare second interaction region GlobalPosition globalPosAdditional3(0.); - int globalIdxAdditional3=-1; + int eIdxGlobalAdditional3=-1; GlobalPosition globalPosAdditional4(0.); - int globalIdxAdditional4=-1; + int eIdxGlobalAdditional4=-1; TransmissivityMatrix additionalT(0.); int interactionRegions = problem().variables().getMpfaData3D(*isIt, T, - globalPos3, globalIdx3, globalPos4, globalIdx4 ); + globalPos3, eIdxGlobal3, globalPos4, eIdxGlobal4 ); if (interactionRegions == 0) interactionRegions = problem().pressureModel().computeTransmissibilities(isIt,T, - globalPos3, globalIdx3, globalPos4, globalIdx4 ); + globalPos3, eIdxGlobal3, globalPos4, eIdxGlobal4 ); if(!interactionRegions) - Dune::dgrave << "something went wrong getting mpfa data on cell " << globalIdxI << std::endl; + Dune::dgrave << "something went wrong getting mpfa data on cell " << eIdxGlobalI << std::endl; // shortcurts mpfa case - CellData& cellData3 = problem().variables().cellData(globalIdx3); - CellData& cellData4 = problem().variables().cellData(globalIdx4); + CellData& cellData3 = problem().variables().cellData(eIdxGlobal3); + CellData& cellData4 = problem().variables().cellData(eIdxGlobal4); Scalar temp1 = globalPos * this->gravity_; Scalar temp2 = globalPosNeighbor * this->gravity_; Scalar temp3 = globalPos3 * this->gravity_; @@ -1212,16 +1212,16 @@ void FV3dPressure2P2CAdaptive<TypeTag>::get1pMpfaFlux(const IntersectionIterator { // get data for second interaction region problem().variables().getMpfaData3D(*isIt, additionalT, - globalPosAdditional3, globalIdxAdditional3, - globalPosAdditional4, globalIdxAdditional4 , + globalPosAdditional3, eIdxGlobalAdditional3, + globalPosAdditional4, eIdxGlobalAdditional4 , banana); // offset for second interaction region Scalar gravityContributionAdditonal = temp1 * additionalT[0] + temp2 * additionalT[1] + globalPosAdditional3*this->gravity_ * additionalT[2] + globalPosAdditional4*this->gravity_ * additionalT[3]; - CellData& cellDataA3 = problem().variables().cellData(globalIdxAdditional3); - CellData& cellDataA4 = problem().variables().cellData(globalIdxAdditional4); + CellData& cellDataA3 = problem().variables().cellData(eIdxGlobalAdditional3); + CellData& cellDataA4 = problem().variables().cellData(eIdxGlobalAdditional4); potential += cellDataI.pressure(phaseIdx) * additionalT[0] + cellDataJ.pressure(phaseIdx) * additionalT[1] @@ -1242,14 +1242,14 @@ void FV3dPressure2P2CAdaptive<TypeTag>::get1pMpfaFlux(const IntersectionIterator /** compute matrix entry: advective fluxes */ /* extend T with other matrix entries and assemble to A_ */ - this->A_[globalIdxI][globalIdxI] += lambda * T[0]; - this->A_[globalIdxI][globalIdxJ] += lambda * T[1]; - this->A_[globalIdxI][globalIdx3] += lambda * T[2]; - this->A_[globalIdxI][globalIdx4] += lambda * T[3]; + this->A_[eIdxGlobalI][eIdxGlobalI] += lambda * T[0]; + this->A_[eIdxGlobalI][eIdxGlobalJ] += lambda * T[1]; + this->A_[eIdxGlobalI][eIdxGlobal3] += lambda * T[2]; + this->A_[eIdxGlobalI][eIdxGlobal4] += lambda * T[3]; // add gravity to RHS vector Scalar gravityContribution = temp1 * T[0] + temp2 * T[1] + temp3 * T[2] + temp4 * T[3]; - this->f_[globalIdxI] += lambda * rhoMean * gravityContribution; + this->f_[eIdxGlobalI] += lambda * rhoMean * gravityContribution; // regard more interaction regions, if there are more if(interactionRegions != 1) @@ -1258,8 +1258,8 @@ void FV3dPressure2P2CAdaptive<TypeTag>::get1pMpfaFlux(const IntersectionIterator { // get data for second interaction region problem().variables().getMpfaData3D(*isIt, additionalT, - globalPosAdditional3, globalIdxAdditional3, - globalPosAdditional4, globalIdxAdditional4 , + globalPosAdditional3, eIdxGlobalAdditional3, + globalPosAdditional4, eIdxGlobalAdditional4 , banana); // offset for second interaction region Scalar gravityContributionAdditonal @@ -1269,13 +1269,13 @@ void FV3dPressure2P2CAdaptive<TypeTag>::get1pMpfaFlux(const IntersectionIterator /** compute matrix entry: advective fluxes */ /* extend T with other matrix entries and assemble to A_ */ - this->A_[globalIdxI][globalIdxI] += lambda * additionalT[0]; - this->A_[globalIdxI][globalIdxJ] += lambda * additionalT[1]; - this->A_[globalIdxI][globalIdxAdditional3] += lambda * additionalT[2]; - this->A_[globalIdxI][globalIdxAdditional4] += lambda * additionalT[3]; + this->A_[eIdxGlobalI][eIdxGlobalI] += lambda * additionalT[0]; + this->A_[eIdxGlobalI][eIdxGlobalJ] += lambda * additionalT[1]; + this->A_[eIdxGlobalI][eIdxGlobalAdditional3] += lambda * additionalT[2]; + this->A_[eIdxGlobalI][eIdxGlobalAdditional4] += lambda * additionalT[3]; // add gravity to RHS vector - this->f_[globalIdxI] += lambda * rhoMean* gravityContributionAdditonal; + this->f_[eIdxGlobalI] += lambda * rhoMean* gravityContributionAdditonal; } } } @@ -1304,8 +1304,8 @@ void FV3dPressure2P2CAdaptive<TypeTag>::updateMaterialLaws(bool fromPostTimestep ElementIterator eItEnd = problem().gridView().template end<0> (); for (ElementIterator eIt = problem().gridView().template begin<0> (); eIt != eItEnd; ++eIt) { - int globalIdx = problem().variables().index(*eIt); - CellData& cellData = problem().variables().cellData(globalIdx); + int eIdxGlobal = problem().variables().index(*eIt); + CellData& cellData = problem().variables().cellData(eIdxGlobal); if(cellData.fluidStateType() == 0) // i.e. it is complex problem().pressureModel().updateMaterialLawsInElement(*eIt, fromPostTimestep); @@ -1338,27 +1338,27 @@ void FV3dPressure2P2CAdaptive<TypeTag>::updateMaterialLaws(bool fromPostTimestep * \param isIt Iterator to the current intersection * \param T Transmissitivity matrix of the first unique interaction volume * \param globalPos4 Position of the 3rd cell (with local Idx 4) of the unique interaction volume -* \param globalIdx4 Index of the 3rd cell (with local Idx 4) of the unique interaction volume +* \param eIdxGlobal4 Index of the 3rd cell (with local Idx 4) of the unique interaction volume * \param globalPos6 Position of the 4th cell (with local Idx 6) of the unique interaction volume -* \param globalIdx6 Index of the 4th cell (with local Idx 6) of the unique interaction volume +* \param eIdxGlobal6 Index of the 4th cell (with local Idx 6) of the unique interaction volume */ template <class TypeTag> int FV3dPressure2P2CAdaptive<TypeTag>::computeTransmissibilities(const IntersectionIterator& isIt, TransmissivityMatrix& T, GlobalPosition& globalPos4, - int& globalIdx4, + int& eIdxGlobal4, GlobalPosition& globalPos6, - int& globalIdx6) + int& eIdxGlobal6) { // get geometry information of cellI = cell1, cellJ = cell2 ElementPointer eIt = isIt->inside(); -// int globalIdxI = problem().variables().index(*eIt); +// int eIdxGlobalI = problem().variables().index(*eIt); ElementPointer neighborPointer = isIt->outside(); GlobalPosition globalPos1 = eIt->geometry().center(); GlobalPosition globalPos2 = neighborPointer->geometry().center(); DimMatrix K1(problem().spatialParams().intrinsicPermeability(*eIt)); DimMatrix K2(problem().spatialParams().intrinsicPermeability(*neighborPointer)); -// int globalIdxJ = problem().variables().index(*isIt->outside()); +// int eIdxGlobalJ = problem().variables().index(*isIt->outside()); // determine ID of intersection seen from larger cell int intersectionID = 0; @@ -1413,14 +1413,14 @@ int FV3dPressure2P2CAdaptive<TypeTag>::computeTransmissibilities(const Intersect // get information of cell4 globalPos4 = face24->outside()->geometry().center(); - globalIdx4 = problem().variables().index(*(face24->outside())); + eIdxGlobal4 = problem().variables().index(*(face24->outside())); GlobalPosition outerNormaln24 = face24->centerUnitOuterNormal(); // get absolute permeability of neighbor cell 3 DimMatrix K4(problem().spatialParams().intrinsicPermeability(*(face24->outside()))); // get information of cell6 globalPos6 = face26->outside()->geometry().center(); - globalIdx6 = problem().variables().index(*(face26->outside())); + eIdxGlobal6 = problem().variables().index(*(face26->outside())); GlobalPosition outerNormaln26 = face26->centerUnitOuterNormal(); // get absolute permeability of neighbor cell 3 DimMatrix K6(problem().spatialParams().intrinsicPermeability(*(face26->outside()))); @@ -1657,7 +1657,7 @@ int FV3dPressure2P2CAdaptive<TypeTag>::computeTransmissibilities(const Intersect T *= isIt->geometry().volume()/subFaceArea12 ; // set your map entry - problem().variables().storeMpfaData3D(*isIt, T, globalPos4, globalIdx4, globalPos6, globalIdx6); + problem().variables().storeMpfaData3D(*isIt, T, globalPos4, eIdxGlobal4, globalPos6, eIdxGlobal6); return 1; // indicates that only 1 interaction region was regarded } else @@ -1782,7 +1782,7 @@ int FV3dPressure2P2CAdaptive<TypeTag>::computeTransmissibilities(const Intersect subVolumeFaceIdx = interactionVolumesContainer_->getMpfaCase2or4cells(isIt, interactionVolume, properFluxDirection); - // b) calculate T, globalIdx3+4 + // b) calculate T, eIdxGlobal3+4 caseL = this->transmissibilityAdapter_(isIt, interactionVolume, subVolumeFaceIdx, properFluxDirection, additional2, additional3, additionalT); @@ -1804,7 +1804,7 @@ int FV3dPressure2P2CAdaptive<TypeTag>::computeTransmissibilities(const Intersect } // set your map entry - problem().variables().storeMpfaData3D(*isIt, T, globalPos4, globalIdx4, globalPos6, globalIdx6); + problem().variables().storeMpfaData3D(*isIt, T, globalPos4, eIdxGlobal4, globalPos6, eIdxGlobal6); // determine weights Scalar weight = isIt->geometry().volume()/subFaceArea12; // =4 for 1 interaction region diff --git a/dumux/decoupled/2p2c/fvpressure2p2c.hh b/dumux/decoupled/2p2c/fvpressure2p2c.hh index bf72dc83fb527b86758b50c323838156ec7a37db..124eb18f22936111e0af0145e6799e4219df6311 100644 --- a/dumux/decoupled/2p2c/fvpressure2p2c.hh +++ b/dumux/decoupled/2p2c/fvpressure2p2c.hh @@ -261,7 +261,7 @@ void FVPressure2P2C<TypeTag>::getStorage(Dune::FieldVector<Scalar, 2>& storageEn { storageEntry = 0.; // cell index - int globalIdxI = problem().variables().index(elementI); + int eIdxGlobalI = problem().variables().index(elementI); Scalar volume = elementI.geometry().volume(); // determine maximum error to scale error-term @@ -278,7 +278,7 @@ void FVPressure2P2C<TypeTag>::getStorage(Dune::FieldVector<Scalar, 2>& storageEn storageEntry[rhs] -= cellDataI.pressure(pressureType) * compress_term * volume; if (std::isnan(compress_term) || std::isinf(compress_term)) - DUNE_THROW(Dune::MathError, "Compressibility term leads to NAN matrix entry at index " << globalIdxI); + DUNE_THROW(Dune::MathError, "Compressibility term leads to NAN matrix entry at index " << eIdxGlobalI); if(!GET_PROP_VALUE(TypeTag, EnableCompressibility)) DUNE_THROW(Dune::NotImplemented, "Compressibility is switched off???"); @@ -289,13 +289,13 @@ void FVPressure2P2C<TypeTag>::getStorage(Dune::FieldVector<Scalar, 2>& storageEn if( problem().timeManager().episodeWillBeOver() || problem().timeManager().willBeFinished()) { - problem().variables().cellData(globalIdxI).errorCorrection() = 0.; + problem().variables().cellData(eIdxGlobalI).errorCorrection() = 0.; return; } // error reduction routine: volumetric error is damped and inserted to right hand side // if damping is not done, the solution method gets unstable! - problem().variables().cellData(globalIdxI).volumeError() /= timestep_; + problem().variables().cellData(eIdxGlobalI).volumeError() /= timestep_; Scalar erri = fabs(cellDataI.volumeError()); Scalar x_lo = ErrorTermLowerBound_; Scalar x_mi = ErrorTermUpperBound_; @@ -307,17 +307,17 @@ void FVPressure2P2C<TypeTag>::getStorage(Dune::FieldVector<Scalar, 2>& storageEn { if (erri <= x_mi * this->maxError_) storageEntry[rhs] += - problem().variables().cellData(globalIdxI).errorCorrection() = + problem().variables().cellData(eIdxGlobalI).errorCorrection() = fac* (1-x_mi*(lofac-1)/(x_lo-x_mi) + (lofac-1)/(x_lo-x_mi)*erri/this->maxError_) * cellDataI.volumeError() * volume; else storageEntry[rhs] += - problem().variables().cellData(globalIdxI).errorCorrection() = + problem().variables().cellData(eIdxGlobalI).errorCorrection() = fac * (1 + x_mi - hifac*x_mi/(1-x_mi) + (hifac/(1-x_mi)-1)*erri/this->maxError_) * cellDataI.volumeError() * volume; } else - problem().variables().cellData(globalIdxI).errorCorrection() = 0.; + problem().variables().cellData(eIdxGlobalI).errorCorrection() = 0.; return; } @@ -348,7 +348,7 @@ void FVPressure2P2C<TypeTag>::getFlux(Dune::FieldVector<Scalar, 2>& entries, { entries = 0.; ElementPtr elementPtrI = intersection.inside(); - int globalIdxI = problem().variables().index(*elementPtrI); + int eIdxGlobalI = problem().variables().index(*elementPtrI); // get global coordinate of cell center const GlobalPosition& globalPos = elementPtrI->geometry().center(); @@ -382,8 +382,8 @@ void FVPressure2P2C<TypeTag>::getFlux(Dune::FieldVector<Scalar, 2>& entries, // access neighbor ElementPtr neighborPtr = intersection.outside(); - int globalIdxJ = problem().variables().index(*neighborPtr); - CellData& cellDataJ = problem().variables().cellData(globalIdxJ); + int eIdxGlobalJ = problem().variables().index(*neighborPtr); + CellData& cellDataJ = problem().variables().cellData(eIdxGlobalJ); // gemotry info of neighbor const GlobalPosition& globalPosNeighbor = neighborPtr->geometry().center(); @@ -450,8 +450,8 @@ void FVPressure2P2C<TypeTag>::getFlux(Dune::FieldVector<Scalar, 2>& entries, Scalar graddv_dC2 = (cellDataJ.dv(nPhaseIdx) - cellDataI.dv(nPhaseIdx)) / dist; -// potentialW = problem().variables().potentialWetting(globalIdxI, isIndex); -// potentialNW = problem().variables().potentialNonwetting(globalIdxI, isIndex); +// potentialW = problem().variables().potentialWetting(eIdxGlobalI, isIndex); +// potentialNW = problem().variables().potentialNonwetting(eIdxGlobalI, isIndex); // // densityW = (potentialW > 0.) ? densityWI : densityWJ; // densityNW = (potentialNW > 0.) ? densityNWI : densityNWJ; @@ -510,7 +510,7 @@ void FVPressure2P2C<TypeTag>::getFlux(Dune::FieldVector<Scalar, 2>& entries, { if (cellDataI.wasRefined() && cellDataJ.wasRefined()) { - problem().variables().cellData(globalIdxI).setUpwindCell(intersection.indexInInside(), contiWEqIdx, false); + problem().variables().cellData(eIdxGlobalI).setUpwindCell(intersection.indexInInside(), contiWEqIdx, false); cellDataJ.setUpwindCell(intersection.indexInOutside(), contiWEqIdx, false); } @@ -543,7 +543,7 @@ void FVPressure2P2C<TypeTag>::getFlux(Dune::FieldVector<Scalar, 2>& entries, { if (cellDataI.wasRefined() && cellDataJ.wasRefined()) { - problem().variables().cellData(globalIdxI).setUpwindCell(intersection.indexInInside(), contiNEqIdx, false); + problem().variables().cellData(eIdxGlobalI).setUpwindCell(intersection.indexInInside(), contiNEqIdx, false); cellDataJ.setUpwindCell(intersection.indexInOutside(), contiNEqIdx, false); } Scalar averagedMassFraction[2]; @@ -755,8 +755,8 @@ void FVPressure2P2C<TypeTag>::getFluxOnBoundary(Dune::FieldVector<Scalar, 2>& en Scalar potentialNW = 0; if (!first) { -// potentialW = problem().variables().potentialWetting(globalIdxI, isIndex); -// potentialNW = problem().variables().potentialNonwetting(globalIdxI, isIndex); +// potentialW = problem().variables().potentialWetting(eIdxGlobalI, isIndex); +// potentialNW = problem().variables().potentialNonwetting(eIdxGlobalI, isIndex); // // // do potential upwinding according to last potGradient vs Jochen: central weighting // densityW = (potentialW > 0.) ? cellDataI.density(wPhaseIdx) : densityWBound; @@ -892,8 +892,8 @@ void FVPressure2P2C<TypeTag>::updateMaterialLawsInElement(const Element& element GlobalPosition globalPos = elementI.geometry().center(); // cell Index and cell data - int globalIdx = problem().variables().index(elementI); - CellData& cellData = problem().variables().cellData(globalIdx); + int eIdxGlobal = problem().variables().index(elementI); + CellData& cellData = problem().variables().cellData(eIdxGlobal); // acess the fluid state and prepare for manipulation FluidState& fluidState = cellData.manipulateFluidState(); @@ -913,7 +913,7 @@ void FVPressure2P2C<TypeTag>::updateMaterialLawsInElement(const Element& element if(Z1<0. || Z1 > 1.) { Dune::dgrave << "Feed mass fraction unphysical: Z1 = " << Z1 - << " at global Idx " << globalIdx + << " at global Idx " << eIdxGlobal << " , because totalConcentration(wCompIdx) = " << cellData.totalConcentration(wCompIdx) << " and totalConcentration(nCompIdx) = " @@ -922,7 +922,7 @@ void FVPressure2P2C<TypeTag>::updateMaterialLawsInElement(const Element& element { Z1 = 0.; cellData.setTotalConcentration(wCompIdx, 0.); - problem().transportModel().totalConcentration(wCompIdx, globalIdx) = 0.; + problem().transportModel().totalConcentration(wCompIdx, eIdxGlobal) = 0.; Dune::dgrave << "Regularize totalConcentration(wCompIdx) = " << cellData.totalConcentration(wCompIdx)<< std::endl; } @@ -930,8 +930,8 @@ void FVPressure2P2C<TypeTag>::updateMaterialLawsInElement(const Element& element { Z1 = 1.; cellData.setTotalConcentration(nCompIdx, 0.); - problem().transportModel().totalConcentration(nCompIdx,globalIdx) = 0.; - Dune::dgrave << "Regularize totalConcentration(globalIdx, nCompIdx) = " + problem().transportModel().totalConcentration(nCompIdx,eIdxGlobal) = 0.; + Dune::dgrave << "Regularize totalConcentration(eIdxGlobal, nCompIdx) = " << cellData.totalConcentration(nCompIdx)<< std::endl; } } @@ -942,16 +942,16 @@ void FVPressure2P2C<TypeTag>::updateMaterialLawsInElement(const Element& element { case pw: { - pressure[wPhaseIdx] = asImp_().pressure(globalIdx); - pressure[nPhaseIdx] = asImp_().pressure(globalIdx) + pressure[wPhaseIdx] = asImp_().pressure(eIdxGlobal); + pressure[nPhaseIdx] = asImp_().pressure(eIdxGlobal) + cellData.capillaryPressure(); break; } case pn: { - pressure[wPhaseIdx] = asImp_().pressure(globalIdx) + pressure[wPhaseIdx] = asImp_().pressure(eIdxGlobal) - cellData.capillaryPressure(); - pressure[nPhaseIdx] = asImp_().pressure(globalIdx); + pressure[nPhaseIdx] = asImp_().pressure(eIdxGlobal); break; } } @@ -1002,7 +1002,7 @@ void FVPressure2P2C<TypeTag>::updateMaterialLawsInElement(const Element& element iterout = iter; } if (iterout != 0) - Dune::dinfo << iterout << "times iteration of pc was applied at Idx " << globalIdx + Dune::dinfo << iterout << "times iteration of pc was applied at Idx " << eIdxGlobal << ", pc delta still " << fabs(oldPc-pc) << std::endl; } // initialize phase properties not stored in fluidstate @@ -1033,7 +1033,7 @@ void FVPressure2P2C<TypeTag>::updateMaterialLawsInElement(const Element& element if (std::isnan(cellData.volumeError())) { DUNE_THROW(Dune::MathError, "Decoupled2p2c::postProcessUpdate:\n" - << "volErr[" << globalIdx << "] isnan: vol = " << vol + << "volErr[" << eIdxGlobal << "] isnan: vol = " << vol << ", massw = " << massw << ", rho_l = " << cellData.density(wPhaseIdx) << ", massn = " << massn << ", rho_g = " << cellData.density(nPhaseIdx) << ", poro = " << problem().spatialParams().porosity(elementI) diff --git a/dumux/decoupled/2p2c/fvpressure2p2cmultiphysics.hh b/dumux/decoupled/2p2c/fvpressure2p2cmultiphysics.hh index d16ec39cbdb1269f002b4ab0e52c0d5fb56d9e43..5b3793b274e1e7b19916bfd8720aae3eb428c469 100644 --- a/dumux/decoupled/2p2c/fvpressure2p2cmultiphysics.hh +++ b/dumux/decoupled/2p2c/fvpressure2p2cmultiphysics.hh @@ -154,8 +154,8 @@ public: void serializeEntity(std::ostream &outstream, const Element &element) { ParentType::serializeEntity(outstream,element); - int globalIdx = problem().variables().index(element); - CellData& cellData = problem().variables().cellData(globalIdx); + int eIdxGlobal = problem().variables().index(element); + CellData& cellData = problem().variables().cellData(eIdxGlobal); outstream <<" "<< cellData.subdomain(); } @@ -170,8 +170,8 @@ public: { ParentType::deserializeEntity(instream,element); - int globalIdx = problem().variables().index(element); - CellData& cellData = problem().variables().cellData(globalIdx); + int eIdxGlobal = problem().variables().index(element); + CellData& cellData = problem().variables().cellData(eIdxGlobal); int subdomainIdx; instream >> subdomainIdx; cellData.setSubdomainAndFluidStateType(subdomainIdx); @@ -267,13 +267,13 @@ void FVPressure2P2CMultiPhysics<TypeTag>::assemble(bool first) for (ElementIterator eIt = problem().gridView().template begin<0> (); eIt != eEndIt; ++eIt) { // get the global index of the cell - int globalIdxI = problem().variables().index(*eIt); + int eIdxGlobalI = problem().variables().index(*eIt); // assemble interior element contributions if (eIt->partitionType() == Dune::InteriorEntity) { // get the cell data - CellData& cellDataI = problem().variables().cellData(globalIdxI); + CellData& cellDataI = problem().variables().cellData(eIdxGlobalI); Dune::FieldVector<Scalar, 2> entries(0.); @@ -283,7 +283,7 @@ void FVPressure2P2CMultiPhysics<TypeTag>::assemble(bool first) else problem().pressureModel().getSource(entries,*eIt, cellDataI, first); - this->f_[globalIdxI] = entries[rhs]; + this->f_[eIdxGlobalI] = entries[rhs]; /***** flux term ***********/ // iterate over all faces of the cell @@ -293,20 +293,20 @@ void FVPressure2P2CMultiPhysics<TypeTag>::assemble(bool first) /************* handle interior face *****************/ if (isIt->neighbor()) { - int globalIdxJ = problem().variables().index(*(isIt->outside())); + int eIdxGlobalJ = problem().variables().index(*(isIt->outside())); if (cellDataI.subdomain() != 2 - or problem().variables().cellData(globalIdxJ).subdomain() != 2) // cell in the 1p domain + or problem().variables().cellData(eIdxGlobalJ).subdomain() != 2) // cell in the 1p domain get1pFlux(entries, *isIt, cellDataI); else problem().pressureModel().getFlux(entries, *isIt, cellDataI, first); //set right hand side - this->f_[globalIdxI] -= entries[rhs]; + this->f_[eIdxGlobalI] -= entries[rhs]; // set diagonal entry - this->A_[globalIdxI][globalIdxI] += entries[matrix]; + this->A_[eIdxGlobalI][eIdxGlobalI] += entries[matrix]; // set off-diagonal entry - this->A_[globalIdxI][globalIdxJ] = -entries[matrix]; + this->A_[eIdxGlobalI][eIdxGlobalJ] = -entries[matrix]; } // end neighbor @@ -319,9 +319,9 @@ void FVPressure2P2CMultiPhysics<TypeTag>::assemble(bool first) problem().pressureModel().getFluxOnBoundary(entries, *isIt, cellDataI, first); //set right hand side - this->f_[globalIdxI] += entries[rhs]; + this->f_[eIdxGlobalI] += entries[rhs]; // set diagonal entry - this->A_[globalIdxI][globalIdxI] += entries[matrix]; + this->A_[eIdxGlobalI][eIdxGlobalI] += entries[matrix]; } } //end interfaces loop // printmatrix(std::cout, this->A_, "global stiffness matrix", "row", 11, 3); @@ -332,16 +332,16 @@ void FVPressure2P2CMultiPhysics<TypeTag>::assemble(bool first) else problem().pressureModel().getStorage(entries, *eIt, cellDataI, first); - this->f_[globalIdxI] += entries[rhs]; + this->f_[eIdxGlobalI] += entries[rhs]; // set diagonal entry - this->A_[globalIdxI][globalIdxI] += entries[matrix]; + this->A_[eIdxGlobalI][eIdxGlobalI] += entries[matrix]; } // assemble overlap and ghost element contributions else { - this->A_[globalIdxI] = 0.0; - this->A_[globalIdxI][globalIdxI] = 1.0; - this->f_[globalIdxI] = this->pressure()[globalIdxI]; + this->A_[eIdxGlobalI] = 0.0; + this->A_[eIdxGlobalI][eIdxGlobalI] = 1.0; + this->f_[eIdxGlobalI] = this->pressure()[eIdxGlobalI]; } } // end grid traversal // printmatrix(std::cout, this->A_, "global stiffness matrix after assempling", "row", 11,3); @@ -396,7 +396,7 @@ void FVPressure2P2CMultiPhysics<TypeTag>::get1pStorage(Dune::FieldVector<Scalar, { storageEntry = 0.; // cell index - int globalIdxI = problem().variables().index(elementI); + int eIdxGlobalI = problem().variables().index(elementI); int presentPhaseIdx = cellDataI.subdomain(); Scalar volume = elementI.geometry().volume(); @@ -427,7 +427,7 @@ void FVPressure2P2CMultiPhysics<TypeTag>::get1pStorage(Dune::FieldVector<Scalar, if (cellDataI.dv_dp()>0) { // dV_dp > 0 is unphysical: Try inverse increment for secant - Dune::dinfo << "dv_dp larger 0 at Idx " << globalIdxI << " , try and invert secant"<< std::endl; + Dune::dinfo << "dv_dp larger 0 at Idx " << eIdxGlobalI << " , try and invert secant"<< std::endl; p_ -= 2*incp; flashSolver.concentrationFlash1p2c(pseudoFluidState, Z1, p_, cellDataI.subdomain(), @@ -449,7 +449,7 @@ void FVPressure2P2CMultiPhysics<TypeTag>::get1pStorage(Dune::FieldVector<Scalar, storageEntry[rhs] -= cellDataI.pressure(pressureType) * compress_term * volume; if (std::isnan(compress_term) || std::isinf(compress_term)) - DUNE_THROW(Dune::MathError, "Compressibility term leads to NAN matrix entry at index " << globalIdxI); + DUNE_THROW(Dune::MathError, "Compressibility term leads to NAN matrix entry at index " << eIdxGlobalI); if(!GET_PROP_VALUE(TypeTag, EnableCompressibility)) DUNE_THROW(Dune::NotImplemented, "Compressibility is switched off???"); @@ -460,13 +460,13 @@ void FVPressure2P2CMultiPhysics<TypeTag>::get1pStorage(Dune::FieldVector<Scalar, if( problem().timeManager().episodeWillBeOver() || problem().timeManager().willBeFinished()) { - problem().variables().cellData(globalIdxI).errorCorrection() = 0.; + problem().variables().cellData(eIdxGlobalI).errorCorrection() = 0.; return; } // error reduction routine: volumetric error is damped and inserted to right hand side // if damping is not done, the solution method gets unstable! - problem().variables().cellData(globalIdxI).volumeError() /= timestep_; + problem().variables().cellData(eIdxGlobalI).volumeError() /= timestep_; Scalar maxError = this->maxError_; Scalar erri = fabs(cellDataI.volumeError()); Scalar x_lo = this->ErrorTermLowerBound_; @@ -481,17 +481,17 @@ void FVPressure2P2CMultiPhysics<TypeTag>::get1pStorage(Dune::FieldVector<Scalar, { if (erri <= x_mi * maxError) storageEntry[rhs] += - problem().variables().cellData(globalIdxI).errorCorrection() = + problem().variables().cellData(eIdxGlobalI).errorCorrection() = fac* (1-x_mi*(lofac-1)/(x_lo-x_mi) + (lofac-1)/(x_lo-x_mi)*erri/maxError) * cellDataI.volumeError() * volume; else storageEntry[rhs] += - problem().variables().cellData(globalIdxI).errorCorrection() = + problem().variables().cellData(eIdxGlobalI).errorCorrection() = fac * (1 + x_mi - hifac*x_mi/(1-x_mi) + (hifac/(1-x_mi)-1)*erri/maxError) * cellDataI.volumeError() * volume; } else - problem().variables().cellData(globalIdxI).errorCorrection()=0 ; + problem().variables().cellData(eIdxGlobalI).errorCorrection()=0 ; return; } @@ -520,7 +520,7 @@ void FVPressure2P2CMultiPhysics<TypeTag>::get1pFlux(Dune::FieldVector<Scalar, 2> const GlobalPosition& globalPos = elementPointerI->geometry().center(); // cell index -// int globalIdxI = problem().variables().index(*elementPointerI); +// int eIdxGlobalI = problem().variables().index(*elementPointerI); // get absolute permeability DimMatrix permeabilityI(problem().spatialParams().intrinsicPermeability(*elementPointerI)); @@ -533,8 +533,8 @@ void FVPressure2P2CMultiPhysics<TypeTag>::get1pFlux(Dune::FieldVector<Scalar, 2> // access neighbor ElementPointer neighborPointer = intersection.outside(); - int globalIdxJ = problem().variables().index(*neighborPointer); - CellData& cellDataJ = problem().variables().cellData(globalIdxJ); + int eIdxGlobalJ = problem().variables().index(*neighborPointer); + CellData& cellDataJ = problem().variables().cellData(eIdxGlobalJ); // gemotry info of neighbor const GlobalPosition& globalPosNeighbor = neighborPointer->geometry().center(); @@ -625,7 +625,7 @@ void FVPressure2P2CMultiPhysics<TypeTag>::get1pFluxOnBoundary(Dune::FieldVector< // get global coordinate of cell center ElementPointer elementPointerI = intersection.inside(); const GlobalPosition& globalPos = elementPointerI->geometry().center(); -// int globalIdxI = problem().variables().index(*elementPointerI); +// int eIdxGlobalI = problem().variables().index(*elementPointerI); int phaseIdx = cellDataI.subdomain(); // get normal vector @@ -794,8 +794,8 @@ void FVPressure2P2CMultiPhysics<TypeTag>::updateMaterialLaws(bool postTimeStep) for (ElementIterator eIt = problem().gridView().template begin<0> (); eIt != eEndIt; ++eIt) { // get global coordinate of cell center - int globalIdx = problem().variables().index(*eIt); - CellData& cellData = problem().variables().cellData(globalIdx); + int eIdxGlobal = problem().variables().index(*eIt); + CellData& cellData = problem().variables().cellData(eIdxGlobal); if(cellData.subdomain() == 2) // complex { @@ -811,7 +811,7 @@ void FVPressure2P2CMultiPhysics<TypeTag>::updateMaterialLaws(bool postTimeStep) if (cellData.saturation(wPhaseIdx) != (1. || 0.) or source.one_norm()!= 0.) // cell still 2p { // mark this element - nextSubdomain[globalIdx] = 2; + nextSubdomain[eIdxGlobal] = 2; // mark neighbors IntersectionIterator isEndIt = problem().gridView().iend(*eIt); @@ -819,24 +819,24 @@ void FVPressure2P2CMultiPhysics<TypeTag>::updateMaterialLaws(bool postTimeStep) { if (isIt->neighbor()) { - int globalIdxJ = problem().variables().index(*(isIt->outside())); + int eIdxGlobalJ = problem().variables().index(*(isIt->outside())); // mark neighbor Element - nextSubdomain[globalIdxJ] = 2; + nextSubdomain[eIdxGlobalJ] = 2; } } } - else if(nextSubdomain[globalIdx] != 2)// update next subdomain if possible + else if(nextSubdomain[eIdxGlobal] != 2)// update next subdomain if possible { if(cellData.saturation(wPhaseIdx) != 0.) - nextSubdomain[globalIdx] = wPhaseIdx; + nextSubdomain[eIdxGlobal] = wPhaseIdx; else if (cellData.saturation(nPhaseIdx) != 0.) - nextSubdomain[globalIdx] = nPhaseIdx; + nextSubdomain[eIdxGlobal] = nPhaseIdx; } timer_.stop(); // end subdomain check }// end complex domain - else if (nextSubdomain[globalIdx] != 2) //check if cell remains in simple subdomain - nextSubdomain[globalIdx] = cellData.subdomain(); + else if (nextSubdomain[eIdxGlobal] != 2) //check if cell remains in simple subdomain + nextSubdomain[eIdxGlobal] = cellData.subdomain(); } //end define complex area of next subdomain @@ -854,16 +854,16 @@ void FVPressure2P2CMultiPhysics<TypeTag>::updateMaterialLaws(bool postTimeStep) // investigate cells that were "simple" in current TS for (ElementIterator eIt = problem().gridView().template begin<0> (); eIt != eEndIt; ++eIt) { - int globalIdx = problem().variables().index(*eIt); - CellData& cellData = problem().variables().cellData(globalIdx); + int eIdxGlobal = problem().variables().index(*eIt); + CellData& cellData = problem().variables().cellData(eIdxGlobal); // store old subdomain information and assign new info int oldSubdomainI = cellData.subdomain(); - cellData.subdomain() = nextSubdomain[globalIdx]; + cellData.subdomain() = nextSubdomain[eIdxGlobal]; //first check if simple will become complicated if(oldSubdomainI != 2 - && nextSubdomain[globalIdx] == 2) + && nextSubdomain[eIdxGlobal] == 2) { // use complex update of the fluidstate timer_.stop(); @@ -871,7 +871,7 @@ void FVPressure2P2CMultiPhysics<TypeTag>::updateMaterialLaws(bool postTimeStep) timer_.start(); } else if(oldSubdomainI != 2 - && nextSubdomain[globalIdx] != 2) // will be simple and was simple + && nextSubdomain[eIdxGlobal] != 2) // will be simple and was simple { // perform simple update this->update1pMaterialLawsInElement(*eIt, cellData, postTimeStep); @@ -906,7 +906,7 @@ void FVPressure2P2CMultiPhysics<TypeTag>::update1pMaterialLawsInElement(const El { // get global coordinate of cell center GlobalPosition globalPos = elementI.geometry().center(); - int globalIdx = problem().variables().index(elementI); + int eIdxGlobal = problem().variables().index(elementI); // determine which phase should be present int presentPhaseIdx = cellData.subdomain(); // this is already =nextSubomainIdx @@ -929,13 +929,13 @@ void FVPressure2P2CMultiPhysics<TypeTag>::update1pMaterialLawsInElement(const El ((presentPhaseIdx == wPhaseIdx) ? 1. : 0.)); // assign sw = 1 if wPhase present, else 0 if(pressureType == wPhaseIdx) { - pressure[wPhaseIdx] = this->pressure(globalIdx); - pressure[nPhaseIdx] = this->pressure(globalIdx)+pc; + pressure[wPhaseIdx] = this->pressure(eIdxGlobal); + pressure[nPhaseIdx] = this->pressure(eIdxGlobal)+pc; } else { - pressure[wPhaseIdx] = this->pressure(globalIdx)-pc; - pressure[nPhaseIdx] = this->pressure(globalIdx); + pressure[wPhaseIdx] = this->pressure(eIdxGlobal)-pc; + pressure[nPhaseIdx] = this->pressure(eIdxGlobal); } // get the overall mass of component 1: Z1 = C^k / (C^1+C^2) [-] diff --git a/dumux/decoupled/2p2c/fvpressurecompositional.hh b/dumux/decoupled/2p2c/fvpressurecompositional.hh index 43acc95cb30fa160aa34efff1d9ff0be35e05c55..9105dee35c181b01fc9a7114c9a56caa91463e55 100644 --- a/dumux/decoupled/2p2c/fvpressurecompositional.hh +++ b/dumux/decoupled/2p2c/fvpressurecompositional.hh @@ -321,9 +321,9 @@ public: eIt != problem_.gridView().template end<0>(); ++eIt) { // get index - int globalIdx = problem_.variables().index(*eIt); - poro_[globalIdx] = problem_.spatialParams().porosity(*eIt); - perm_[globalIdx] = problem_.spatialParams().intrinsicPermeability(*eIt)[0][0]; + int eIdxGlobal = problem_.variables().index(*eIt); + poro_[eIdxGlobal] = problem_.spatialParams().porosity(*eIt); + perm_[eIdxGlobal] = problem_.spatialParams().intrinsicPermeability(*eIt)[0][0]; } *poroPtr = poro_; *permPtr = perm_; @@ -341,11 +341,11 @@ public: eIt != problem_.gridView().template end<0>(); ++eIt) { // get index - int globalIdx = problem_.variables().index(*eIt); + int eIdxGlobal = problem_.variables().index(*eIt); if(dim >=2) - permY_[globalIdx] = problem_.spatialParams().intrinsicPermeability(*eIt)[1][1]; + permY_[eIdxGlobal] = problem_.spatialParams().intrinsicPermeability(*eIt)[1][1]; if(dim >=3) - permZ_[globalIdx] = problem_.spatialParams().intrinsicPermeability(*eIt)[2][2]; + permZ_[eIdxGlobal] = problem_.spatialParams().intrinsicPermeability(*eIt)[2][2]; } if(dim >=2) { @@ -539,11 +539,11 @@ void FVPressureCompositional<TypeTag>::initialMaterialLaws(bool compositional) GlobalPosition globalPos = eIt->geometry().center(); // assign an Index for convenience - int globalIdx = problem_.variables().index(*eIt); + int eIdxGlobal = problem_.variables().index(*eIt); // get the temperature Scalar temperature_ = problem_.temperatureAtPos(globalPos); - CellData& cellData = problem_.variables().cellData(globalIdx); + CellData& cellData = problem_.variables().cellData(eIdxGlobal); // acess the fluid state and prepare for manipulation FluidState& fluidState = cellData.manipulateFluidState(); CompositionalFlash<TypeTag> flashSolver; @@ -559,7 +559,7 @@ void FVPressureCompositional<TypeTag>::initialMaterialLaws(bool compositional) { // phase pressures are unknown, so start with an exemplary Scalar exemplaryPressure = problem_.referencePressure(*eIt); - pressure[wPhaseIdx] = pressure[nPhaseIdx] = this->pressure()[globalIdx] = exemplaryPressure; + pressure[wPhaseIdx] = pressure[nPhaseIdx] = this->pressure()[eIdxGlobal] = exemplaryPressure; if (icFormulation == Indices::saturation) // saturation initial condition { sat_0 = problem_.initSat(*eIt); @@ -592,14 +592,14 @@ void FVPressureCompositional<TypeTag>::initialMaterialLaws(bool compositional) { case pw: { - pressure[wPhaseIdx] = this->pressure()[globalIdx]; - pressure[nPhaseIdx] = this->pressure()[globalIdx] +pc; + pressure[wPhaseIdx] = this->pressure()[eIdxGlobal]; + pressure[nPhaseIdx] = this->pressure()[eIdxGlobal] +pc; break; } case pn: { - pressure[wPhaseIdx] = this->pressure()[globalIdx]-pc; - pressure[nPhaseIdx] = this->pressure()[globalIdx]; + pressure[wPhaseIdx] = this->pressure()[eIdxGlobal]-pc; + pressure[nPhaseIdx] = this->pressure()[eIdxGlobal]; break; } } @@ -627,14 +627,14 @@ void FVPressureCompositional<TypeTag>::initialMaterialLaws(bool compositional) { case pw: { - pressure[wPhaseIdx] = this->pressure()[globalIdx]; - pressure[nPhaseIdx] = this->pressure()[globalIdx] + pc; + pressure[wPhaseIdx] = this->pressure()[eIdxGlobal]; + pressure[nPhaseIdx] = this->pressure()[eIdxGlobal] + pc; break; } case pn: { - pressure[wPhaseIdx] = this->pressure()[globalIdx] - pc; - pressure[nPhaseIdx] = this->pressure()[globalIdx]; + pressure[wPhaseIdx] = this->pressure()[eIdxGlobal] - pc; + pressure[nPhaseIdx] = this->pressure()[eIdxGlobal]; break; } } @@ -658,7 +658,7 @@ void FVPressureCompositional<TypeTag>::initialMaterialLaws(bool compositional) else // capillary pressure neglected { pressure[wPhaseIdx] = pressure[nPhaseIdx] - = this->pressure()[globalIdx]; + = this->pressure()[eIdxGlobal]; flashSolver.concentrationFlash2p2c(fluidState, Z1_0, pressure, problem_.spatialParams().porosity(*eIt), temperature_); } @@ -667,8 +667,8 @@ void FVPressureCompositional<TypeTag>::initialMaterialLaws(bool compositional) cellData.calculateMassConcentration(problem_.spatialParams().porosity(*eIt)); - problem_.transportModel().totalConcentration(wCompIdx,globalIdx) = cellData.massConcentration(wCompIdx); - problem_.transportModel().totalConcentration(nCompIdx,globalIdx) = cellData.massConcentration(nCompIdx); + problem_.transportModel().totalConcentration(wCompIdx,eIdxGlobal) = cellData.massConcentration(wCompIdx); + problem_.transportModel().totalConcentration(nCompIdx,eIdxGlobal) = cellData.massConcentration(nCompIdx); // initialize phase properties not stored in fluidstate cellData.setViscosity(wPhaseIdx, FluidSystem::viscosity(fluidState, wPhaseIdx)); @@ -692,7 +692,7 @@ void FVPressureCompositional<TypeTag>::initialMaterialLaws(bool compositional) cellData.perimeter() += isIt->geometry().volume(); } - cellData.globalIdx() = globalIdx; + cellData.globalIdx() = eIdxGlobal; // set dv to zero to prevent output errors cellData.dv_dp() = 0.; @@ -719,9 +719,9 @@ void FVPressureCompositional<TypeTag>::updateMaterialLaws(bool postTimeStep) ElementIterator eEndIt = problem().gridView().template end<0> (); for (ElementIterator eIt = problem().gridView().template begin<0> (); eIt != eEndIt; ++eIt) { - int globalIdx = problem().variables().index(*eIt); + int eIdxGlobal = problem().variables().index(*eIt); - CellData& cellData = problem().variables().cellData(globalIdx); + CellData& cellData = problem().variables().cellData(eIdxGlobal); asImp_().updateMaterialLawsInElement(*eIt, postTimeStep); @@ -749,9 +749,9 @@ template<class TypeTag> void FVPressureCompositional<TypeTag>::volumeDerivatives(const GlobalPosition& globalPos, const Element& element) { // cell index - int globalIdx = problem_.variables().index(element); + int eIdxGlobal = problem_.variables().index(element); - CellData& cellData = problem_.variables().cellData(globalIdx); + CellData& cellData = problem_.variables().cellData(eIdxGlobal); // get cell temperature Scalar temperature_ = cellData.temperature(wPhaseIdx); @@ -789,7 +789,7 @@ void FVPressureCompositional<TypeTag>::volumeDerivatives(const GlobalPosition& g ComponentVector massIncrement(0.); for(int compIdx = 0; compIdx< numComponents; compIdx++) { - massIncrement[compIdx] = updateEstimate_[compIdx][globalIdx]; + massIncrement[compIdx] = updateEstimate_[compIdx][eIdxGlobal]; if(fabs(massIncrement[compIdx]) < 1e-8 * cellData.density(compIdx)) massIncrement[compIdx] = 1e-8* cellData.density(compIdx); // as phaseIdx = compIdx } @@ -814,7 +814,7 @@ void FVPressureCompositional<TypeTag>::volumeDerivatives(const GlobalPosition& g if (dv_dp>0) { // dV_dp > 0 is unphysical: Try inverse increment for secant - Dune::dinfo << "dv_dp larger 0 at Idx " << globalIdx << " , try and invert secant"<< std::endl; + Dune::dinfo << "dv_dp larger 0 at Idx " << eIdxGlobal << " , try and invert secant"<< std::endl; p_ -= 2*incp; flashSolver.concentrationFlash2p2c(updFluidState, Z1, @@ -828,7 +828,7 @@ void FVPressureCompositional<TypeTag>::volumeDerivatives(const GlobalPosition& g // dV_dp > 0 is unphysical: Try inverse increment for secant if (dv_dp>0) { - Dune::dwarn << "dv_dp still larger 0 after inverting secant at idx"<< globalIdx<< std::endl; + Dune::dwarn << "dv_dp still larger 0 after inverting secant at idx"<< eIdxGlobal<< std::endl; p_ += 2*incp; flashSolver.concentrationFlash2p2c(updFluidState, Z1, p_, problem_.spatialParams().porosity(element), temperature_); @@ -839,7 +839,7 @@ void FVPressureCompositional<TypeTag>::volumeDerivatives(const GlobalPosition& g dv_dp = ((mass.one_norm() * specificVolume) - volalt) /incp; if (dv_dp>0) { - std::cout << "dv_dp still larger 0 after both inverts at idx " << globalIdx << std::endl; + std::cout << "dv_dp still larger 0 after both inverts at idx " << eIdxGlobal << std::endl; dv_dp = cellData.dv_dp(); } } diff --git a/dumux/decoupled/2p2c/fvtransport2p2c.hh b/dumux/decoupled/2p2c/fvtransport2p2c.hh index 6486c0168959978c4d398f447dd6ee434a00aca3..343442da835ce89c11b3a2933299d62a22520c8f 100644 --- a/dumux/decoupled/2p2c/fvtransport2p2c.hh +++ b/dumux/decoupled/2p2c/fvtransport2p2c.hh @@ -188,19 +188,19 @@ public: //! Function needed for restart option of the transport model: Write out void serializeEntity(std::ostream &outstream, const Element &element) { - int globalIdx = problem().variables().index(element); - outstream << totalConcentration_[wCompIdx][globalIdx] - << " " << totalConcentration_[nCompIdx][globalIdx]; + int eIdxGlobal = problem().variables().index(element); + outstream << totalConcentration_[wCompIdx][eIdxGlobal] + << " " << totalConcentration_[nCompIdx][eIdxGlobal]; } //! Function needed for restart option of the transport model: Read in void deserializeEntity(std::istream &instream, const Element &element) { - int globalIdx = problem().variables().index(element); - CellData& cellData = problem().variables().cellData(globalIdx); - instream >> totalConcentration_[wCompIdx][globalIdx] - >> totalConcentration_[nCompIdx][globalIdx]; - cellData.setMassConcentration(wCompIdx, totalConcentration_[wCompIdx][globalIdx]); - cellData.setMassConcentration(nCompIdx, totalConcentration_[nCompIdx][globalIdx]); + int eIdxGlobal = problem().variables().index(element); + CellData& cellData = problem().variables().cellData(eIdxGlobal); + instream >> totalConcentration_[wCompIdx][eIdxGlobal] + >> totalConcentration_[nCompIdx][eIdxGlobal]; + cellData.setMassConcentration(wCompIdx, totalConcentration_[wCompIdx][eIdxGlobal]); + cellData.setMassConcentration(nCompIdx, totalConcentration_[nCompIdx][eIdxGlobal]); } /*! \name Access functions for protected variables */ @@ -226,11 +226,11 @@ public: /*! To get real cell values, do not acess this method, but rather * call the respective function in the cell data object. * @param compIdx The index of the component - * @param globalIdx The global index of the current cell. + * @param eIdxGlobal The global index of the current cell. */ - Scalar& totalConcentration(int compIdx, int globalIdx) + Scalar& totalConcentration(int compIdx, int eIdxGlobal) { - return totalConcentration_[compIdx][globalIdx][0]; + return totalConcentration_[compIdx][eIdxGlobal][0]; } void getSource(Scalar& update, const Element& element, CellData& cellDataI) @@ -390,8 +390,8 @@ void FVTransport2P2C<TypeTag>::update(const Scalar t, Scalar& dt, for (ElementIterator eIt = problem().gridView().template begin<0> (); eIt != eEndIt; ++eIt) { // get cell infos - int globalIdxI = problem().variables().index(*eIt); - CellData& cellDataI = problem().variables().cellData(globalIdxI); + int eIdxGlobalI = problem().variables().index(*eIt); + CellData& cellDataI = problem().variables().cellData(eIdxGlobalI); // some variables for time step calculation double sumfactorin = 0; @@ -414,7 +414,7 @@ void FVTransport2P2C<TypeTag>::update(const Scalar t, Scalar& dt, if (localTimeStepping_) { - LocalTimesteppingData& localData = timeStepData_[globalIdxI]; + LocalTimesteppingData& localData = timeStepData_[eIdxGlobalI]; if (localData.faceTargetDt[indexInInside] < accumulatedDt_ + dtThreshold_) { localData.faceFluxes[indexInInside] = entries; @@ -423,8 +423,8 @@ void FVTransport2P2C<TypeTag>::update(const Scalar t, Scalar& dt, else { // add to update vector - updateVec[wCompIdx][globalIdxI] += entries[wCompIdx]; - updateVec[nCompIdx][globalIdxI] += entries[nCompIdx]; + updateVec[wCompIdx][eIdxGlobalI] += entries[wCompIdx]; + updateVec[nCompIdx][eIdxGlobalI] += entries[nCompIdx]; } // for time step calculation @@ -435,19 +435,19 @@ void FVTransport2P2C<TypeTag>::update(const Scalar t, Scalar& dt, if (localTimeStepping_) { - LocalTimesteppingData& localData = timeStepData_[globalIdxI]; + LocalTimesteppingData& localData = timeStepData_[eIdxGlobalI]; for (int i=0; i < 2*dim; i++) { - updateVec[wCompIdx][globalIdxI] += localData.faceFluxes[i][wCompIdx]; - updateVec[nCompIdx][globalIdxI] += localData.faceFluxes[i][nCompIdx]; + updateVec[wCompIdx][eIdxGlobalI] += localData.faceFluxes[i][wCompIdx]; + updateVec[nCompIdx][eIdxGlobalI] += localData.faceFluxes[i][nCompIdx]; } } /*********** Handle source term ***************/ PrimaryVariables q(NAN); problem().source(q, *eIt); - updateVec[wCompIdx][globalIdxI] += q[contiWEqIdx]; - updateVec[nCompIdx][globalIdxI] += q[contiNEqIdx]; + updateVec[wCompIdx][eIdxGlobalI] += q[contiWEqIdx]; + updateVec[nCompIdx][eIdxGlobalI] += q[contiNEqIdx]; // account for porosity in fluxes for time-step sumfactorin = std::max(sumfactorin,sumfactorout) @@ -456,11 +456,11 @@ void FVTransport2P2C<TypeTag>::update(const Scalar t, Scalar& dt, //calculate time step if (localTimeStepping_) { - timeStepData_[globalIdxI].dt = 1./sumfactorin; + timeStepData_[eIdxGlobalI].dt = 1./sumfactorin; if ( 1./sumfactorin < dt) { dt = 1./sumfactorin; - restrictingCell= globalIdxI; + restrictingCell= eIdxGlobalI; } } else @@ -468,7 +468,7 @@ void FVTransport2P2C<TypeTag>::update(const Scalar t, Scalar& dt, if ( 1./sumfactorin < dt) { dt = 1./sumfactorin; - restrictingCell= globalIdxI; + restrictingCell= eIdxGlobalI; } } } // end grid traversal @@ -578,7 +578,7 @@ void FVTransport2P2C<TypeTag>::getFlux(ComponentVector& fluxEntries, timestepFlux = 0.; // cell information ElementPointer elementPtrI= intersection.inside(); - int globalIdxI = problem().variables().index(*elementPtrI); + int eIdxGlobalI = problem().variables().index(*elementPtrI); // get position const GlobalPosition globalPos = elementPtrI->geometry().center(); @@ -587,7 +587,7 @@ void FVTransport2P2C<TypeTag>::getFlux(ComponentVector& fluxEntries, Scalar volume = elementPtrI->geometry().volume(); // get values of cell I - Scalar pressI = problem().pressureModel().pressure(globalIdxI); + Scalar pressI = problem().pressureModel().pressure(eIdxGlobalI); Scalar pcI = cellDataI.capillaryPressure(); DimMatrix K_I(problem().spatialParams().intrinsicPermeability(*elementPtrI)); @@ -621,8 +621,8 @@ void FVTransport2P2C<TypeTag>::getFlux(ComponentVector& fluxEntries, // access neighbor ElementPointer neighborPtr = intersection.outside(); - int globalIdxJ = problem().variables().index(*neighborPtr); - CellData& cellDataJ = problem().variables().cellData(globalIdxJ); + int eIdxGlobalJ = problem().variables().index(*neighborPtr); + CellData& cellDataJ = problem().variables().cellData(eIdxGlobalJ); // neighbor cell center in global coordinates const GlobalPosition& globalPosNeighbor = neighborPtr->geometry().center(); @@ -644,7 +644,7 @@ void FVTransport2P2C<TypeTag>::getFlux(ComponentVector& fluxEntries, double densityW_mean = (densityWI + densityWJ) * 0.5; double densityNW_mean = (densityNWI + densityNWJ) * 0.5; - double pressJ = problem().pressureModel().pressure(globalIdxJ); + double pressJ = problem().pressureModel().pressure(eIdxGlobalJ); Scalar pcJ = cellDataJ.capillaryPressure(); // compute mean permeability @@ -764,13 +764,13 @@ void FVTransport2P2C<TypeTag>::getFlux(ComponentVector& fluxEntries, //d) output if(!(cellDataI.wasRefined() && cellDataJ.wasRefined() && elementPtrI->father() == neighborPtr->father()) - && globalIdxI > globalIdxJ) //(only for one side) + && eIdxGlobalI > eIdxGlobalJ) //(only for one side) { averagedFaces_++; #if DUNE_MINIMAL_DEBUG_LEVEL < 3 // verbose (only for one side) - if(globalIdxI > globalIdxJ) - Dune::dinfo << "harmonicMean flux of phase" << phaseIdx <<" used from cell" << globalIdxI<< " into " << globalIdxJ + if(eIdxGlobalI > eIdxGlobalJ) + Dune::dinfo << "harmonicMean flux of phase" << phaseIdx <<" used from cell" << eIdxGlobalI<< " into " << eIdxGlobalJ << " ; TE upwind I = "<< cellDataI.isUpwindCell(intersection.indexInInside(), contiEqIdx) << " but pot = "<< potential[phaseIdx] << std::endl; #endif @@ -873,7 +873,7 @@ void FVTransport2P2C<TypeTag>::getFluxOnBoundary(ComponentVector& fluxEntries, { // cell information ElementPointer elementPtrI= intersection.inside(); - int globalIdxI = problem().variables().index(*elementPtrI); + int eIdxGlobalI = problem().variables().index(*elementPtrI); // get position const GlobalPosition globalPos = elementPtrI->geometry().center(); @@ -882,7 +882,7 @@ void FVTransport2P2C<TypeTag>::getFluxOnBoundary(ComponentVector& fluxEntries, Scalar volume = elementPtrI->geometry().volume(); const GlobalPosition& gravity_ = problem().gravity(); // get values of cell I - Scalar pressI = problem().pressureModel().pressure(globalIdxI); + Scalar pressI = problem().pressureModel().pressure(eIdxGlobalI); Scalar pcI = cellDataI.capillaryPressure(); DimMatrix K_I(problem().spatialParams().intrinsicPermeability(*elementPtrI)); @@ -1198,9 +1198,9 @@ void FVTransport2P2C<TypeTag>::updatedTargetDt_(Scalar &dt) #endif // cell index - int globalIdxI = problem_.variables().index(*eIt); + int eIdxGlobalI = problem_.variables().index(*eIt); - LocalTimesteppingData& localDataI = timeStepData_[globalIdxI]; + LocalTimesteppingData& localDataI = timeStepData_[eIdxGlobalI]; typedef std::unordered_map<int, Scalar > FaceDt; @@ -1215,14 +1215,14 @@ void FVTransport2P2C<TypeTag>::updatedTargetDt_(Scalar &dt) if (isIt->neighbor()) { ElementPointer neighbor = isIt->outside(); - int globalIdxJ = problem_.variables().index(*neighbor); + int eIdxGlobalJ = problem_.variables().index(*neighbor); int levelI = eIt->level(); int levelJ = neighbor->level(); - if (globalIdxI < globalIdxJ && levelI <= levelJ) + if (eIdxGlobalI < eIdxGlobalJ && levelI <= levelJ) { - LocalTimesteppingData& localDataJ = timeStepData_[globalIdxJ]; + LocalTimesteppingData& localDataJ = timeStepData_[eIdxGlobalJ]; int indexInOutside = isIt->indexInOutside(); @@ -1281,9 +1281,9 @@ void FVTransport2P2C<TypeTag>::updatedTargetDt_(Scalar &dt) if (it != faceDt.end()) { ElementPointer neighbor = isIt->outside(); - int globalIdxJ = problem_.variables().index(*neighbor); + int eIdxGlobalJ = problem_.variables().index(*neighbor); - LocalTimesteppingData& localDataJ = timeStepData_[globalIdxJ]; + LocalTimesteppingData& localDataJ = timeStepData_[eIdxGlobalJ]; int indexInOutside = isIt->indexInOutside(); diff --git a/dumux/decoupled/common/fv/fvpressure.hh b/dumux/decoupled/common/fv/fvpressure.hh index 31924ffa1ff515613daede71a6ce11f0b0525fe1..3173f13fcd7b8c894737452df1c69e6208615cd7 100644 --- a/dumux/decoupled/common/fv/fvpressure.hh +++ b/dumux/decoupled/common/fv/fvpressure.hh @@ -135,9 +135,9 @@ protected: PrimaryVariables initValues; problem_.initial(initValues, *eIt); - int globalIdx = problem_.variables().index(*eIt); + int eIdxGlobal = problem_.variables().index(*eIt); - pressure_[globalIdx] = initValues[pressEqIdx]; + pressure_[eIdxGlobal] = initValues[pressEqIdx]; } } @@ -189,12 +189,12 @@ public: /*! \brief Public access function for the primary pressure variable * - * Function returns the cell pressure value at index <tt>globalIdx</tt> + * Function returns the cell pressure value at index <tt>eIdxGlobal</tt> * - * \param globalIdx Global index of a grid cell + * \param eIdxGlobal Global index of a grid cell */ - const Scalar pressure(const int globalIdx) const - { return pressure_[globalIdx];} + const Scalar pressure(const int eIdxGlobal) const + { return pressure_[eIdxGlobal];} //!Returns the global matrix of the last pressure solution step. const Matrix& globalMatrix() @@ -252,8 +252,8 @@ public: */ void serializeEntity(std::ostream &outstream, const Element &element) { - int globalIdx = problem_.variables().index(element); - outstream << pressure_[globalIdx][0]; + int eIdxGlobal = problem_.variables().index(element); + outstream << pressure_[eIdxGlobal][0]; } /*! \brief Function for deserialization of the pressure field. @@ -265,8 +265,8 @@ public: */ void deserializeEntity(std::istream &instream, const Element &element) { - int globalIdx = problem_.variables().index(element); - instream >> pressure_[globalIdx][0]; + int eIdxGlobal = problem_.variables().index(element); + instream >> pressure_[eIdxGlobal][0]; } /*! \brief Set a pressure to be fixed at a certain cell. @@ -275,23 +275,23 @@ public: *This can be necessary e.g. if only Neumann boundary conditions are defined. *The pressure is fixed until the <tt>unsetFixPressureAtIndex()</tt> function is called * - * \param pressure Pressure value at globalIdx - * \param globalIdx Global index of a grid cell + * \param pressure Pressure value at eIdxGlobal + * \param eIdxGlobal Global index of a grid cell */ - void setFixPressureAtIndex(Scalar pressure, int globalIdx) + void setFixPressureAtIndex(Scalar pressure, int eIdxGlobal) { - fixPressure_.insert(std::make_pair(globalIdx, pressure)); + fixPressure_.insert(std::make_pair(eIdxGlobal, pressure)); } /*! \brief Reset the fixed pressure state * * No pressure is fixed inside the domain until <tt>setFixPressureAtIndex()</tt> function is called again. * - * \param globalIdx Global index of a grid cell + * \param eIdxGlobal Global index of a grid cell */ - void unsetFixPressureAtIndex(int globalIdx) + void unsetFixPressureAtIndex(int eIdxGlobal) { - fixPressure_.erase(globalIdx); + fixPressure_.erase(eIdxGlobal); } void resetFixPressureAtIndex() @@ -348,7 +348,7 @@ void FVPressure<TypeTag>::initializeMatrixRowSize() for (ElementIterator eIt = problem_.gridView().template begin<0>(); eIt != eEndIt; ++eIt) { // cell index - int globalIdxI = problem_.variables().index(*eIt); + int eIdxGlobalI = problem_.variables().index(*eIt); // initialize row size int rowSize = 1; @@ -360,7 +360,7 @@ void FVPressure<TypeTag>::initializeMatrixRowSize() if (isIt->neighbor()) rowSize++; } - A_.setrowsize(globalIdxI, rowSize); + A_.setrowsize(eIdxGlobalI, rowSize); } return; @@ -375,10 +375,10 @@ void FVPressure<TypeTag>::initializeMatrixIndices() for (ElementIterator eIt = problem_.gridView().template begin<0>(); eIt != eEndIt; ++eIt) { // cell index - int globalIdxI = problem_.variables().index(*eIt); + int eIdxGlobalI = problem_.variables().index(*eIt); // add diagonal index - A_.addindex(globalIdxI, globalIdxI); + A_.addindex(eIdxGlobalI, eIdxGlobalI); // run through all intersections with neighbors IntersectionIterator isEndIt = problem_.gridView().iend(*eIt); @@ -387,10 +387,10 @@ void FVPressure<TypeTag>::initializeMatrixIndices() { // access neighbor ElementPointer outside = isIt->outside(); - int globalIdxJ = problem_.variables().index(*outside); + int eIdxGlobalJ = problem_.variables().index(*outside); // add off diagonal index - A_.addindex(globalIdxI, globalIdxJ); + A_.addindex(eIdxGlobalI, eIdxGlobalJ); } } @@ -419,19 +419,19 @@ void FVPressure<TypeTag>::assemble(bool first) for (ElementIterator eIt = problem_.gridView().template begin<0>(); eIt != eEndIt; ++eIt) { // get the global index of the cell - int globalIdxI = problem_.variables().index(*eIt); + int eIdxGlobalI = problem_.variables().index(*eIt); // assemble interior element contributions if (eIt->partitionType() == Dune::InteriorEntity) { // get the cell data - CellData& cellDataI = problem_.variables().cellData(globalIdxI); + CellData& cellDataI = problem_.variables().cellData(eIdxGlobalI); EntryType entries(0.); /***** source term ***********/ asImp_().getSource(entries, *eIt, cellDataI, first); - f_[globalIdxI] += entries[rhs]; + f_[eIdxGlobalI] += entries[rhs]; /***** flux term ***********/ // iterate over all faces of the cell @@ -443,7 +443,7 @@ void FVPressure<TypeTag>::assemble(bool first) { ElementPointer elementNeighbor = isIt->outside(); - int globalIdxJ = problem_.variables().index(*elementNeighbor); + int eIdxGlobalJ = problem_.variables().index(*elementNeighbor); // check for hanging nodes // take a hanging node never from the element with smaller level! @@ -452,7 +452,7 @@ void FVPressure<TypeTag>::assemble(bool first) // the last condition is needed to properly assemble in the presence // of ghost elements if (GET_PROP_VALUE(TypeTag, VisitFacesOnlyOnce) - && (globalIdxI > globalIdxJ) && haveSameLevel + && (eIdxGlobalI > eIdxGlobalJ) && haveSameLevel && elementNeighbor->partitionType() == Dune::InteriorEntity) continue; @@ -461,21 +461,21 @@ void FVPressure<TypeTag>::assemble(bool first) asImp_().getFlux(entries, *isIt, cellDataI, first); //set right hand side - f_[globalIdxI] -= entries[rhs]; + f_[eIdxGlobalI] -= entries[rhs]; // set diagonal entry - A_[globalIdxI][globalIdxI] += entries[matrix]; + A_[eIdxGlobalI][eIdxGlobalI] += entries[matrix]; // set off-diagonal entry - A_[globalIdxI][globalIdxJ] -= entries[matrix]; + A_[eIdxGlobalI][eIdxGlobalJ] -= entries[matrix]; // The second condition is needed to not spoil the ghost element entries if (GET_PROP_VALUE(TypeTag, VisitFacesOnlyOnce) && elementNeighbor->partitionType() == Dune::InteriorEntity) { - f_[globalIdxJ] += entries[rhs]; - A_[globalIdxJ][globalIdxJ] += entries[matrix]; - A_[globalIdxJ][globalIdxI] -= entries[matrix]; + f_[eIdxGlobalJ] += entries[rhs]; + A_[eIdxGlobalJ][eIdxGlobalJ] += entries[matrix]; + A_[eIdxGlobalJ][eIdxGlobalI] -= entries[matrix]; } } // end neighbor @@ -487,9 +487,9 @@ void FVPressure<TypeTag>::assemble(bool first) asImp_().getFluxOnBoundary(entries, *isIt, cellDataI, first); //set right hand side - f_[globalIdxI] += entries[rhs]; + f_[eIdxGlobalI] += entries[rhs]; // set diagonal entry - A_[globalIdxI][globalIdxI] += entries[matrix]; + A_[eIdxGlobalI][eIdxGlobalI] += entries[matrix]; } } //end interfaces loop // printmatrix(std::cout, A_, "global stiffness matrix", "row", 11, 3); @@ -497,16 +497,16 @@ void FVPressure<TypeTag>::assemble(bool first) /***** storage term ***********/ entries = 0; asImp_().getStorage(entries, *eIt, cellDataI, first); - f_[globalIdxI] += entries[rhs]; + f_[eIdxGlobalI] += entries[rhs]; // set diagonal entry - A_[globalIdxI][globalIdxI] += entries[matrix]; + A_[eIdxGlobalI][eIdxGlobalI] += entries[matrix]; } // assemble overlap and ghost element contributions else { - A_[globalIdxI] = 0.0; - A_[globalIdxI][globalIdxI] = 1.0; - f_[globalIdxI] = pressure_[globalIdxI]; + A_[eIdxGlobalI] = 0.0; + A_[eIdxGlobalI][eIdxGlobalI] = 1.0; + f_[eIdxGlobalI] = pressure_[eIdxGlobalI]; } } // end grid traversal // printmatrix(std::cout, A_, "global stiffness matrix after assempling", "row", 11,3); diff --git a/dumux/freeflow/stokes/stokesmodel.hh b/dumux/freeflow/stokes/stokesmodel.hh index 2af0796c6d6587a53e7693c13718ef8c14eb19f3..6c736d18fe158baa0d3934f8ec9b548f2a0ad208 100644 --- a/dumux/freeflow/stokes/stokesmodel.hh +++ b/dumux/freeflow/stokes/stokesmodel.hh @@ -180,19 +180,19 @@ public: #endif for (int i = 0; i < numLocalVerts; ++i) { - int globalIdx = this->vertexMapper().map(*eIt, i, dim); - volVars.update(sol[globalIdx], + int vIdxGlobal = this->vertexMapper().map(*eIt, i, dim); + volVars.update(sol[vIdxGlobal], this->problem_(), *eIt, fvGeometry, i, false); - pn[globalIdx] = volVars.pressure(); - delP[globalIdx] = volVars.pressure() - 1e5; - rho[globalIdx] = volVars.density(); - mu[globalIdx] = volVars.dynamicViscosity(); - velocity[globalIdx] = volVars.velocity(); + pn[vIdxGlobal] = volVars.pressure(); + delP[vIdxGlobal] = volVars.pressure() - 1e5; + rho[vIdxGlobal] = volVars.density(); + mu[vIdxGlobal] = volVars.dynamicViscosity(); + velocity[vIdxGlobal] = volVars.velocity(); } } writer.attachVertexData(pn, "P"); diff --git a/dumux/freeflow/stokesnc/stokesncmodel.hh b/dumux/freeflow/stokesnc/stokesncmodel.hh index af7f1c7eb724fd7c1687b50f04727bbdd4b9621f..f7c7ae6bddab069db866d819bd4f70187cd75e32 100644 --- a/dumux/freeflow/stokesnc/stokesncmodel.hh +++ b/dumux/freeflow/stokesnc/stokesncmodel.hh @@ -145,30 +145,30 @@ public: #endif for (int i = 0; i < numLocalVerts; ++i) { - int globalIdx = this->vertexMapper().map(*elemIt, i, dim); - volVars.update(sol[globalIdx], + int vIdxGlobal = this->vertexMapper().map(*elemIt, i, dim); + volVars.update(sol[vIdxGlobal], this->problem_(), *elemIt, fvGeometry, i, false); - pN[globalIdx] = volVars.pressure()*scale_; - delP[globalIdx] = volVars.pressure()*scale_ - 1e5; + pN[vIdxGlobal] = volVars.pressure()*scale_; + delP[vIdxGlobal] = volVars.pressure()*scale_ - 1e5; for (int compIdx = 0; compIdx < numComponents; ++compIdx) { - (*moleFraction[compIdx])[globalIdx]= volVars.moleFraction(compIdx); - (*massFraction[compIdx])[globalIdx]= volVars.massFraction(compIdx); - Valgrind::CheckDefined((*moleFraction[compIdx])[globalIdx]); - Valgrind::CheckDefined((*massFraction[compIdx])[globalIdx]); + (*moleFraction[compIdx])[vIdxGlobal]= volVars.moleFraction(compIdx); + (*massFraction[compIdx])[vIdxGlobal]= volVars.massFraction(compIdx); + Valgrind::CheckDefined((*moleFraction[compIdx])[vIdxGlobal]); + Valgrind::CheckDefined((*massFraction[compIdx])[vIdxGlobal]); } - T [globalIdx] = volVars.temperature(); + T [vIdxGlobal] = volVars.temperature(); - rho[globalIdx] = volVars.density()*scale_*scale_*scale_; - mu[globalIdx] = volVars.dynamicViscosity()*scale_; - velocity[globalIdx] = volVars.velocity(); - velocity[globalIdx] *= 1/scale_; + rho[vIdxGlobal] = volVars.density()*scale_*scale_*scale_; + mu[vIdxGlobal] = volVars.dynamicViscosity()*scale_; + velocity[vIdxGlobal] = volVars.velocity(); + velocity[vIdxGlobal] *= 1/scale_; } } writer.attachVertexData(T, "temperature"); diff --git a/dumux/freeflow/stokesncni/stokesncnimodel.hh b/dumux/freeflow/stokesncni/stokesncnimodel.hh index ec8a14d43f58040041f62c76e0d3d1c0938ac3df..894ca546ed87c1b1297c140d86c5f679be5cb5b0 100644 --- a/dumux/freeflow/stokesncni/stokesncnimodel.hh +++ b/dumux/freeflow/stokesncni/stokesncnimodel.hh @@ -151,31 +151,31 @@ public: #endif for (int i = 0; i < numLocalVerts; ++i) { - int globalIdx = this->vertexMapper().map(*elemIt, i, dim); - volVars.update(sol[globalIdx], + int vIdxGlobal = this->vertexMapper().map(*elemIt, i, dim); + volVars.update(sol[vIdxGlobal], this->problem_(), *elemIt, fvGeometry, i, false); - pn[globalIdx] = volVars.pressure()*scale_; - delP[globalIdx] = volVars.pressure()*scale_ - 1e5; + pn[vIdxGlobal] = volVars.pressure()*scale_; + delP[vIdxGlobal] = volVars.pressure()*scale_ - 1e5; for (int compIdx = 0; compIdx < numComponents; ++compIdx) { - (*moleFraction[compIdx])[globalIdx]= volVars.moleFraction(compIdx); - (*massFraction[compIdx])[globalIdx]= volVars.massFraction(compIdx); - Valgrind::CheckDefined((*moleFraction[compIdx])[globalIdx]); - Valgrind::CheckDefined((*massFraction[compIdx])[globalIdx]); + (*moleFraction[compIdx])[vIdxGlobal]= volVars.moleFraction(compIdx); + (*massFraction[compIdx])[vIdxGlobal]= volVars.massFraction(compIdx); + Valgrind::CheckDefined((*moleFraction[compIdx])[vIdxGlobal]); + Valgrind::CheckDefined((*massFraction[compIdx])[vIdxGlobal]); } - T [globalIdx] = volVars.temperature(); + T [vIdxGlobal] = volVars.temperature(); - rho[globalIdx] = volVars.density()*scale_*scale_*scale_; - mu[globalIdx] = volVars.dynamicViscosity()*scale_; - h[globalIdx] = volVars.enthalpy(); - velocity[globalIdx] = volVars.velocity(); - velocity[globalIdx] *= 1/scale_; + rho[vIdxGlobal] = volVars.density()*scale_*scale_*scale_; + mu[vIdxGlobal] = volVars.dynamicViscosity()*scale_; + h[vIdxGlobal] = volVars.enthalpy(); + velocity[vIdxGlobal] = volVars.velocity(); + velocity[vIdxGlobal] *= 1/scale_; } } writer.attachVertexData(T, "temperature"); diff --git a/dumux/geomechanics/el1p2c/el1p2clocaljacobian.hh b/dumux/geomechanics/el1p2c/el1p2clocaljacobian.hh index 501463588890c1377c8731b8a6350dbb8ce818fc..ceedece171dfa2c6c194d5eb0643dfc64c8a31a4 100644 --- a/dumux/geomechanics/el1p2c/el1p2clocaljacobian.hh +++ b/dumux/geomechanics/el1p2c/el1p2clocaljacobian.hh @@ -107,21 +107,21 @@ public: const int col, const int pvIdx) { - int globalIdx; + int dofIdxGlobal; FVElementGeometry neighborFVGeom; ElementPointer neighbor(this->element_()); if (isBox) { - globalIdx = this->vertexMapper_().map(this->element_(), col, dim); + dofIdxGlobal = this->vertexMapper_().map(this->element_(), col, dim); } else { neighbor = this->fvElemGeom_.neighbors[col]; neighborFVGeom.updateInner(*neighbor); - globalIdx = this->problemPtr_->elementMapper().map(*neighbor); + dofIdxGlobal = this->problemPtr_->elementMapper().map(*neighbor); } - PrimaryVariables priVars(this->model_().curSol()[globalIdx]); + PrimaryVariables priVars(this->model_().curSol()[dofIdxGlobal]); VolumeVariables origVolVars(this->curVolVars_[col]); this->curVolVars_[col].setEvalPoint(&origVolVars); diff --git a/dumux/geomechanics/el1p2c/el1p2cmodel.hh b/dumux/geomechanics/el1p2c/el1p2cmodel.hh index aaa10897cd569c0b962dd64638459e757f088504..dcfac291a549f93519fae805f25ef757f062dd55 100644 --- a/dumux/geomechanics/el1p2c/el1p2cmodel.hh +++ b/dumux/geomechanics/el1p2c/el1p2cmodel.hh @@ -271,29 +271,29 @@ public: for (int scvIdx = 0; scvIdx < numScv; ++scvIdx) { - unsigned int globalIdx = this->dofMapper().map(*eIt, scvIdx, dim); + unsigned int vIdxGlobal = this->dofMapper().map(*eIt, scvIdx, dim); - pressure[globalIdx] = elemVolVars[scvIdx].pressure(); - moleFraction0[globalIdx] = elemVolVars[scvIdx].moleFraction(0); - moleFraction1[globalIdx] = elemVolVars[scvIdx].moleFraction(1); - massFraction0[globalIdx] = elemVolVars[scvIdx].massFraction(0); - massFraction1[globalIdx] = elemVolVars[scvIdx].massFraction(1); + pressure[vIdxGlobal] = elemVolVars[scvIdx].pressure(); + moleFraction0[vIdxGlobal] = elemVolVars[scvIdx].moleFraction(0); + moleFraction1[vIdxGlobal] = elemVolVars[scvIdx].moleFraction(1); + massFraction0[vIdxGlobal] = elemVolVars[scvIdx].massFraction(0); + massFraction1[vIdxGlobal] = elemVolVars[scvIdx].massFraction(1); // in case of rock mechanics sign convention solid displacement is // defined to be negative if it points in positive coordinate direction if(rockMechanicsSignConvention_){ DimVector tmpDispl; tmpDispl = Scalar(0); tmpDispl -= elemVolVars[scvIdx].displacement(); - displacement[globalIdx] = tmpDispl; + displacement[vIdxGlobal] = tmpDispl; } else - displacement[globalIdx] = elemVolVars[scvIdx].displacement(); + displacement[vIdxGlobal] = elemVolVars[scvIdx].displacement(); - density[globalIdx] = elemVolVars[scvIdx].density(); - viscosity[globalIdx] = elemVolVars[scvIdx].viscosity(); - porosity[globalIdx] = elemVolVars[scvIdx].porosity(); - Kx[globalIdx] = this->problem_().spatialParams().intrinsicPermeability( + density[vIdxGlobal] = elemVolVars[scvIdx].density(); + viscosity[vIdxGlobal] = elemVolVars[scvIdx].viscosity(); + porosity[vIdxGlobal] = elemVolVars[scvIdx].porosity(); + Kx[vIdxGlobal] = this->problem_().spatialParams().intrinsicPermeability( *eIt, fvGeometry, scvIdx)[0][0]; // calculate cell quantities by adding up scv quantities and dividing through numScv cellPorosity[eIdx] += elemVolVars[scvIdx].porosity() / numScv; diff --git a/dumux/geomechanics/el1p2c/el1p2cvolumevariables.hh b/dumux/geomechanics/el1p2c/el1p2cvolumevariables.hh index c948cc218f306b6ae3bb2c29affccd33860e8901..781074370b04964a3c2c0834c4eea37bc6e741e4 100644 --- a/dumux/geomechanics/el1p2c/el1p2cvolumevariables.hh +++ b/dumux/geomechanics/el1p2c/el1p2cvolumevariables.hh @@ -73,13 +73,13 @@ public: { ParentType::update(priVars, problem, element, fvGeometry, scvIdx, isOldSol); - int globalIdx = problem.vertexMapper().map(element, scvIdx, dim); + int vIdxGlobal = problem.vertexMapper().map(element, scvIdx, dim); primaryVars_ = priVars; - prevPrimaryVars_ = problem.model().prevSol()[globalIdx]; + prevPrimaryVars_ = problem.model().prevSol()[vIdxGlobal]; ParentType prev1p2cVolVars; - prev1p2cVolVars.update(problem.model().prevSol()[globalIdx], + prev1p2cVolVars.update(problem.model().prevSol()[vIdxGlobal], problem, element, fvGeometry, diff --git a/dumux/geomechanics/el2p/el2passembler.hh b/dumux/geomechanics/el2p/el2passembler.hh index 6fd017151f37fdf5e8769dc03d7b1c4a0dd6c7b8..db63c8761e0de4f33ac65c93ef8ee6d6726bbc7c 100644 --- a/dumux/geomechanics/el2p/el2passembler.hh +++ b/dumux/geomechanics/el2p/el2passembler.hh @@ -435,8 +435,8 @@ public: if (!enablePartialReassemble) return Red; // reassemble unconditionally! - int globalIdx = vertexMapper_().map(element, vIdx, dim); - return vertexColor_[globalIdx]; + int vIdxGlobal = vertexMapper_().map(element, vIdx, dim); + return vertexColor_[vIdxGlobal]; } /*! @@ -461,8 +461,8 @@ public: if (!enablePartialReassemble) return Red; // reassemble unconditionally! - int globalIdx = elementMapper_().map(element); - return elementColor_[globalIdx]; + int eIdxGlobal = elementMapper_().map(element); + return elementColor_[eIdxGlobal]; } /*! diff --git a/dumux/geomechanics/el2p/el2pbasemodel.hh b/dumux/geomechanics/el2p/el2pbasemodel.hh index e9804f486fded3a7ca6fc830d8c3f1932d3cd28e..7caa8df1c9d793234962686308f100e4cca3c500 100644 --- a/dumux/geomechanics/el2p/el2pbasemodel.hh +++ b/dumux/geomechanics/el2p/el2pbasemodel.hh @@ -144,15 +144,15 @@ public: prevVolVars.resize(n); curVolVars.resize(n); for (int i = 0; i < n; ++i) { - int globalIdx = vertexMapper().map(element, i, dim); + int vIdxGlobal = vertexMapper().map(element, i, dim); - if (!hintsUsable_[globalIdx]) { + if (!hintsUsable_[vIdxGlobal]) { curVolVars[i].setHint(NULL); prevVolVars[i].setHint(NULL); } else { - curVolVars[i].setHint(&curHints_[globalIdx]); - prevVolVars[i].setHint(&prevHints_[globalIdx]); + curVolVars[i].setHint(&curHints_[vIdxGlobal]); + prevVolVars[i].setHint(&prevHints_[vIdxGlobal]); } } } @@ -170,12 +170,12 @@ public: #endif curVolVars.resize(n); for (int i = 0; i < n; ++i) { - int globalIdx = vertexMapper().map(element, i, dim); + int vIdxGlobal = vertexMapper().map(element, i, dim); - if (!hintsUsable_[globalIdx]) + if (!hintsUsable_[vIdxGlobal]) curVolVars[i].setHint(NULL); else - curVolVars[i].setHint(&curHints_[globalIdx]); + curVolVars[i].setHint(&curHints_[vIdxGlobal]); } } @@ -194,11 +194,11 @@ public: return; for (unsigned int i = 0; i < elemVolVars.size(); ++i) { - int globalIdx = vertexMapper().map(element, i, dim); - curHints_[globalIdx] = elemVolVars[i]; - if (!hintsUsable_[globalIdx]) - prevHints_[globalIdx] = elemVolVars[i]; - hintsUsable_[globalIdx] = true; + int vIdxGlobal = vertexMapper().map(element, i, dim); + curHints_[vIdxGlobal] = elemVolVars[i]; + if (!hintsUsable_[vIdxGlobal]) + prevHints_[vIdxGlobal] = elemVolVars[i]; + hintsUsable_[vIdxGlobal] = true; } } @@ -312,14 +312,14 @@ public: /*! * \brief Returns the volume \f$\mathrm{[m^3]}\f$ of a given control volume. * - * \param globalIdx The global index of the control volume's + * \param vIdxGlobal The global index of the control volume's * associated vertex */ - Scalar boxVolume(const int globalIdx) const + Scalar boxVolume(const int vIdxGlobal) const { if (isBox) { - return boxVolume_[globalIdx][0]; + return boxVolume_[vIdxGlobal][0]; } else { @@ -694,13 +694,13 @@ public: def[eqIdx] = writer.allocateManagedBuffer(numDofs); } - for (unsigned int globalIdx = 0; globalIdx < u.size(); globalIdx++) + for (unsigned int vIdxGlobal = 0; vIdxGlobal < u.size(); vIdxGlobal++) { for (int eqIdx = 0; eqIdx < numEq; ++eqIdx) { - (*x[eqIdx])[globalIdx] = u[globalIdx][eqIdx]; - (*delta[eqIdx])[globalIdx] = - deltaU[globalIdx][eqIdx]; - (*def[eqIdx])[globalIdx] = residual[globalIdx][eqIdx]; + (*x[eqIdx])[vIdxGlobal] = u[vIdxGlobal][eqIdx]; + (*delta[eqIdx])[vIdxGlobal] = - deltaU[vIdxGlobal][eqIdx]; + (*def[eqIdx])[vIdxGlobal] = residual[vIdxGlobal][eqIdx]; } } @@ -753,10 +753,10 @@ public: x[eqIdx] = writer.allocateManagedBuffer(numDofs); } - for (int globalIdx = 0; globalIdx < sol.size(); globalIdx++) + for (int vIdxGlobal = 0; vIdxGlobal < sol.size(); vIdxGlobal++) { for (int eqIdx = 0; eqIdx < numEq; ++eqIdx) { - (*x[eqIdx])[globalIdx] = sol[globalIdx][eqIdx]; + (*x[eqIdx])[vIdxGlobal] = sol[vIdxGlobal][eqIdx]; } } @@ -777,13 +777,13 @@ public: { return problem_().gridView(); } /*! - * \brief Returns true if the entity indicated by 'globalIdx' + * \brief Returns true if the entity indicated by 'dofIdxGlobal' * is located on / touches the grid's boundary. * - * \param globalIdx The global index of the entity + * \param dofIdxGlobal The global index of the entity */ - bool onBoundary(const int globalIdx) const - { return boundaryIndices_[globalIdx]; } + bool onBoundary(const int dofIdxGlobal) const + { return boundaryIndices_[dofIdxGlobal]; } /*! * \brief Returns true if a vertex is located on the grid's @@ -894,7 +894,7 @@ protected: for (int scvIdx = 0; scvIdx < fvGeometry.numScv; scvIdx++) { // get the global index of the degree of freedom - int globalIdx = dofMapper().map(*eIt, scvIdx, dofCodim); + int dofIdxGlobal = dofMapper().map(*eIt, scvIdx, dofCodim); // let the problem do the dirty work of nailing down // the initial solution. @@ -913,11 +913,11 @@ protected: // different sub control volumes, the initial value // will be the arithmetic mean. initPriVars *= fvGeometry.subContVol[scvIdx].volume; - boxVolume_[globalIdx] += fvGeometry.subContVol[scvIdx].volume; + boxVolume_[dofIdxGlobal] += fvGeometry.subContVol[scvIdx].volume; } - uCur_->base()[globalIdx] += initPriVars; - Valgrind::CheckDefined(uCur_->base()[globalIdx]); + uCur_->base()[dofIdxGlobal] += initPriVars; + Valgrind::CheckDefined(uCur_->base()[dofIdxGlobal]); } } @@ -985,8 +985,8 @@ protected: } else { - int globalIdx = elementMapper().map(*eIt); - boundaryIndices_[globalIdx] = true; + int eIdxGlobal = elementMapper().map(*eIt); + boundaryIndices_[eIdxGlobal] = true; } } } diff --git a/dumux/geomechanics/el2p/el2plocaloperator.hh b/dumux/geomechanics/el2p/el2plocaloperator.hh index d9d2d148d6cc42d06b53646001dfca7bcf8cdae4..0eea86dadf2a31d1871a2b5d01dbecd8a62bb17a 100644 --- a/dumux/geomechanics/el2p/el2plocaloperator.hh +++ b/dumux/geomechanics/el2p/el2plocaloperator.hh @@ -550,7 +550,7 @@ public: // assemble entries for mass balance equations for (size_type i = 0; i < (numEq-dim)*numScv; i++) { - // local jacobian value of location globalIdx=i%numScv, globalIdx=j%numScv for equation i/numScv and unknown j/numScv + // local jacobian value of location idxI=i%numScv, idxJ=j%numScv for equation i/numScv and unknown j/numScv Scalar tmp = (model_.localJacobian().mat(i%numScv,j%numScv))[i/numScv][j/numScv]; // mass balance entries for pressure if (j < numScv){ diff --git a/dumux/geomechanics/el2p/el2pmodel.hh b/dumux/geomechanics/el2p/el2pmodel.hh index a89c99e33a9c44e8b235e25322c56d1112a8b422..b50ddccc2bd5a9b9f622f9900926f68b9c4518b6 100644 --- a/dumux/geomechanics/el2p/el2pmodel.hh +++ b/dumux/geomechanics/el2p/el2pmodel.hh @@ -371,17 +371,17 @@ public: for (int scvIdx = 0; scvIdx < numScv; ++scvIdx) { - unsigned int globalIdx = this->dofMapper().map(*eIt, scvIdx, dim); + unsigned int vIdxGlobal = this->dofMapper().map(*eIt, scvIdx, dim); - Te[globalIdx] = elemVolVars[scvIdx].temperature(); - pw[globalIdx] = elemVolVars[scvIdx].pressure(wPhaseIdx); - pn[globalIdx] = elemVolVars[scvIdx].pressure(nPhaseIdx); - pc[globalIdx] = elemVolVars[scvIdx].capillaryPressure(); - sw[globalIdx] = elemVolVars[scvIdx].saturation(wPhaseIdx); - sn[globalIdx] = elemVolVars[scvIdx].saturation(nPhaseIdx); - rhoW[globalIdx] = elemVolVars[scvIdx].density(wPhaseIdx); - rhoN[globalIdx] = elemVolVars[scvIdx].density(nPhaseIdx); + Te[vIdxGlobal] = elemVolVars[scvIdx].temperature(); + pw[vIdxGlobal] = elemVolVars[scvIdx].pressure(wPhaseIdx); + pn[vIdxGlobal] = elemVolVars[scvIdx].pressure(nPhaseIdx); + pc[vIdxGlobal] = elemVolVars[scvIdx].capillaryPressure(); + sw[vIdxGlobal] = elemVolVars[scvIdx].saturation(wPhaseIdx); + sn[vIdxGlobal] = elemVolVars[scvIdx].saturation(nPhaseIdx); + rhoW[vIdxGlobal] = elemVolVars[scvIdx].density(wPhaseIdx); + rhoN[vIdxGlobal] = elemVolVars[scvIdx].density(nPhaseIdx); // the following lines are correct for rock mechanics sign convention // but lead to a very counter-intuitive output therefore, they are commented. // in case of rock mechanics sign convention solid displacement is @@ -390,11 +390,11 @@ public: // DimVector tmpDispl; // tmpDispl = Scalar(0); // tmpDispl -= elemVolVars[scvIdx].displacement(); -// displacement[globalIdx] = tmpDispl; +// displacement[vIdxGlobal] = tmpDispl; // } // // else - displacement[globalIdx] = elemVolVars[scvIdx].displacement(); + displacement[vIdxGlobal] = elemVolVars[scvIdx].displacement(); double Keff; double exponent; @@ -403,8 +403,8 @@ public: Keff = this->problem_().spatialParams().intrinsicPermeability( *eIt, fvGeometry, scvIdx)[0][0]; Keff *= exp(exponent); effKx[eIdx] += Keff/ numScv; - effectivePressure[eIdx] += (pn[globalIdx] * sn[globalIdx] - + pw[globalIdx] * sw[globalIdx]) + effectivePressure[eIdx] += (pn[vIdxGlobal] * sn[vIdxGlobal] + + pw[vIdxGlobal] * sw[vIdxGlobal]) / numScv; effPorosity[eIdx] +=elemVolVars[scvIdx].effPorosity / numScv; }; diff --git a/dumux/geomechanics/elastic/elasticmodel.hh b/dumux/geomechanics/elastic/elasticmodel.hh index 362a6ef3bcd5459179f825e14dc4816b8c7377bc..0d0a2b11a6564188ee7558e0c4054e3fc43cd6cb 100644 --- a/dumux/geomechanics/elastic/elasticmodel.hh +++ b/dumux/geomechanics/elastic/elasticmodel.hh @@ -134,20 +134,20 @@ public: for (int scvIdx = 0; scvIdx < fvGeometry.numScv; ++scvIdx) { - int globalIdx = this->dofMapper().map(*eIt, scvIdx, dim); + int vIdxGlobal = this->dofMapper().map(*eIt, scvIdx, dim); - volVars.update(sol[globalIdx], + volVars.update(sol[vIdxGlobal], this->problem_(), *eIt, fvGeometry, scvIdx, false); - ux[globalIdx] = volVars.displacement(0); + ux[vIdxGlobal] = volVars.displacement(0); if (dim >= 2) - uy[globalIdx] = volVars.displacement(1); + uy[vIdxGlobal] = volVars.displacement(1); if (dim >= 3) - uz[globalIdx] = volVars.displacement(2); + uz[vIdxGlobal] = volVars.displacement(2); }; // In the box method, the stress is evaluated on the FE-Grid. However, to get an diff --git a/dumux/implicit/2p2c/2p2cmodel.hh b/dumux/implicit/2p2c/2p2cmodel.hh index 5c488079324aba06c208105a796607f9bca82d1a..436188f67735830d779214c87f57b7ff43bad442 100644 --- a/dumux/implicit/2p2c/2p2cmodel.hh +++ b/dumux/implicit/2p2c/2p2cmodel.hh @@ -162,17 +162,17 @@ public: { if (!isBox) // i.e. cell-centered discretization { - int globalIdx = this->dofMapper().map(*eIt); + int eIdxGlobal = this->dofMapper().map(*eIt); const GlobalPosition &globalPos = eIt->geometry().center(); // initialize phase presence - staticDat_[globalIdx].phasePresence + staticDat_[eIdxGlobal].phasePresence = this->problem_().initialPhasePresence(*(this->gridView_().template begin<dim>()), - globalIdx, globalPos); - staticDat_[globalIdx].wasSwitched = false; + eIdxGlobal, globalPos); + staticDat_[eIdxGlobal].wasSwitched = false; - staticDat_[globalIdx].oldPhasePresence - = staticDat_[globalIdx].phasePresence; + staticDat_[eIdxGlobal].oldPhasePresence + = staticDat_[eIdxGlobal].phasePresence; } } @@ -182,17 +182,17 @@ public: const VertexIterator &vEndIt = this->gridView_().template end<dim> (); for (; vIt != vEndIt; ++vIt) { - int globalIdx = this->dofMapper().map(*vIt); + int vIdxGlobal = this->dofMapper().map(*vIt); const GlobalPosition &globalPos = vIt->geometry().corner(0); // initialize phase presence - staticDat_[globalIdx].phasePresence - = this->problem_().initialPhasePresence(*vIt, globalIdx, + staticDat_[vIdxGlobal].phasePresence + = this->problem_().initialPhasePresence(*vIt, vIdxGlobal, globalPos); - staticDat_[globalIdx].wasSwitched = false; + staticDat_[vIdxGlobal].wasSwitched = false; - staticDat_[globalIdx].oldPhasePresence - = staticDat_[globalIdx].phasePresence; + staticDat_[vIdxGlobal].oldPhasePresence + = staticDat_[vIdxGlobal].phasePresence; } } } @@ -264,13 +264,13 @@ public: /*! * \brief Returns the phase presence of the current or the old solution of a degree of freedom. * - * \param globalIdx The global index of the degree of freedom + * \param dofIdxGlobal The global index of the degree of freedom * \param oldSol Based on oldSol current or previous time step is used */ - int phasePresence(int globalIdx, bool oldSol) const + int phasePresence(int dofIdxGlobal, bool oldSol) const { - return oldSol ? staticDat_[globalIdx].oldPhasePresence - : staticDat_[globalIdx].phasePresence; + return oldSol ? staticDat_[dofIdxGlobal].oldPhasePresence + : staticDat_[dofIdxGlobal].phasePresence; } /*! @@ -349,37 +349,37 @@ public: for (int scvIdx = 0; scvIdx < fvGeometry.numScv; ++scvIdx) { - int globalIdx = this->dofMapper().map(*eIt, scvIdx, dofCodim); - - (*sN)[globalIdx] = elemVolVars[scvIdx].saturation(nPhaseIdx); - (*sW)[globalIdx] = elemVolVars[scvIdx].saturation(wPhaseIdx); - (*pn)[globalIdx] = elemVolVars[scvIdx].pressure(nPhaseIdx); - (*pw)[globalIdx] = elemVolVars[scvIdx].pressure(wPhaseIdx); - (*pc)[globalIdx] = elemVolVars[scvIdx].capillaryPressure(); - (*rhoW)[globalIdx] = elemVolVars[scvIdx].density(wPhaseIdx); - (*rhoN)[globalIdx] = elemVolVars[scvIdx].density(nPhaseIdx); - (*mobW)[globalIdx] = elemVolVars[scvIdx].mobility(wPhaseIdx); - (*mobN)[globalIdx] = elemVolVars[scvIdx].mobility(nPhaseIdx); + int dofIdxGlobal = this->dofMapper().map(*eIt, scvIdx, dofCodim); + + (*sN)[dofIdxGlobal] = elemVolVars[scvIdx].saturation(nPhaseIdx); + (*sW)[dofIdxGlobal] = elemVolVars[scvIdx].saturation(wPhaseIdx); + (*pn)[dofIdxGlobal] = elemVolVars[scvIdx].pressure(nPhaseIdx); + (*pw)[dofIdxGlobal] = elemVolVars[scvIdx].pressure(wPhaseIdx); + (*pc)[dofIdxGlobal] = elemVolVars[scvIdx].capillaryPressure(); + (*rhoW)[dofIdxGlobal] = elemVolVars[scvIdx].density(wPhaseIdx); + (*rhoN)[dofIdxGlobal] = elemVolVars[scvIdx].density(nPhaseIdx); + (*mobW)[dofIdxGlobal] = elemVolVars[scvIdx].mobility(wPhaseIdx); + (*mobN)[dofIdxGlobal] = elemVolVars[scvIdx].mobility(nPhaseIdx); for (int phaseIdx = 0; phaseIdx < numPhases; ++phaseIdx) for (int compIdx = 0; compIdx < numComponents; ++compIdx) { - (*massFrac[phaseIdx][compIdx])[globalIdx] + (*massFrac[phaseIdx][compIdx])[dofIdxGlobal] = elemVolVars[scvIdx].massFraction(phaseIdx, compIdx); - Valgrind::CheckDefined((*massFrac[phaseIdx][compIdx])[globalIdx][0]); + Valgrind::CheckDefined((*massFrac[phaseIdx][compIdx])[dofIdxGlobal][0]); } for (int phaseIdx = 0; phaseIdx < numPhases; ++phaseIdx) for (int compIdx = 0; compIdx < numComponents; ++compIdx) { - (*moleFrac[phaseIdx][compIdx])[globalIdx] + (*moleFrac[phaseIdx][compIdx])[dofIdxGlobal] = elemVolVars[scvIdx].moleFraction(phaseIdx, compIdx); - Valgrind::CheckDefined((*moleFrac[phaseIdx][compIdx])[globalIdx][0]); + Valgrind::CheckDefined((*moleFrac[phaseIdx][compIdx])[dofIdxGlobal][0]); } - (*poro)[globalIdx] = elemVolVars[scvIdx].porosity(); - (*temperature)[globalIdx] = elemVolVars[scvIdx].temperature(); - (*phasePresence)[globalIdx] - = staticDat_[globalIdx].phasePresence; + (*poro)[dofIdxGlobal] = elemVolVars[scvIdx].porosity(); + (*temperature)[dofIdxGlobal] = elemVolVars[scvIdx].temperature(); + (*phasePresence)[dofIdxGlobal] + = staticDat_[dofIdxGlobal].phasePresence; } // velocity output @@ -441,11 +441,11 @@ public: // write primary variables ParentType::serializeEntity(outStream, entity); - int globalIdx = this->dofMapper().map(entity); + int dofIdxGlobal = this->dofMapper().map(entity); if (!outStream.good()) - DUNE_THROW(Dune::IOError, "Could not serialize entity " << globalIdx); + DUNE_THROW(Dune::IOError, "Could not serialize entity " << dofIdxGlobal); - outStream << staticDat_[globalIdx].phasePresence << " "; + outStream << staticDat_[dofIdxGlobal].phasePresence << " "; } /*! @@ -461,14 +461,14 @@ public: ParentType::deserializeEntity(inStream, entity); // read phase presence - int globalIdx = this->dofMapper().map(entity); + int dofIdxGlobal = this->dofMapper().map(entity); if (!inStream.good()) DUNE_THROW(Dune::IOError, - "Could not deserialize entity " << globalIdx); + "Could not deserialize entity " << dofIdxGlobal); - inStream >> staticDat_[globalIdx].phasePresence; - staticDat_[globalIdx].oldPhasePresence - = staticDat_[globalIdx].phasePresence; + inStream >> staticDat_[dofIdxGlobal].phasePresence; + staticDat_[dofIdxGlobal].oldPhasePresence + = staticDat_[dofIdxGlobal].phasePresence; } @@ -495,13 +495,13 @@ public: fvGeometry.update(this->gridView_(), *eIt); for (int scvIdx = 0; scvIdx < fvGeometry.numScv; ++scvIdx) { - int globalIdx = this->dofMapper().map(*eIt, scvIdx, dofCodim); + int dofIdxGlobal = this->dofMapper().map(*eIt, scvIdx, dofCodim); - if (staticDat_[globalIdx].visited) + if (staticDat_[dofIdxGlobal].visited) continue; - staticDat_[globalIdx].visited = true; - volVars.update(curGlobalSol[globalIdx], + staticDat_[dofIdxGlobal].visited = true; + volVars.update(curGlobalSol[dofIdxGlobal], this->problem_(), *eIt, fvGeometry, @@ -510,10 +510,10 @@ public: const GlobalPosition &globalPos = fvGeometry.subContVol[scvIdx].global; if (primaryVarSwitch_(curGlobalSol, volVars, - globalIdx, + dofIdxGlobal, globalPos)) { - this->jacobianAssembler().markDofRed(globalIdx); + this->jacobianAssembler().markDofRed(dofIdxGlobal); wasSwitched = true; } } @@ -585,12 +585,12 @@ public: */ bool primaryVarSwitch_(SolutionVector &globalSol, const VolumeVariables &volVars, - int globalIdx, + int dofIdxGlobal, const GlobalPosition &globalPos) { // evaluate primary variable switch bool wouldSwitch = false; - int phasePresence = staticDat_[globalIdx].phasePresence; + int phasePresence = staticDat_[dofIdxGlobal].phasePresence; int newPhasePresence = phasePresence; // check if a primary var switch is necessary @@ -603,7 +603,7 @@ public: Scalar xwMax = 1.0; if (xww + xwn > xwMax) wouldSwitch = true; - if (staticDat_[globalIdx].wasSwitched) + if (staticDat_[dofIdxGlobal].wasSwitched) xwMax *= 1.02; // if the sum of the mole fractions is larger than @@ -611,14 +611,14 @@ public: if (xww + xwn > xwMax) { // wetting phase appears - std::cout << "wetting phase appears at vertex " << globalIdx + std::cout << "wetting phase appears at vertex " << dofIdxGlobal << ", coordinates: " << globalPos << ", xww + xwn: " << xww + xwn << std::endl; newPhasePresence = bothPhases; if (formulation == pnsw) - globalSol[globalIdx][switchIdx] = 0.0; + globalSol[dofIdxGlobal][switchIdx] = 0.0; else if (formulation == pwsn) - globalSol[globalIdx][switchIdx] = 1.0; + globalSol[dofIdxGlobal][switchIdx] = 1.0; } } else if (phasePresence == wPhaseOnly) @@ -631,7 +631,7 @@ public: Scalar xgMax = 1.0; if (xnw + xnn > xgMax) wouldSwitch = true; - if (staticDat_[globalIdx].wasSwitched) + if (staticDat_[dofIdxGlobal].wasSwitched) xgMax *= 1.02; // if the sum of the mole fractions is larger than @@ -639,39 +639,39 @@ public: if (xnw + xnn > xgMax) { // nonwetting phase appears - std::cout << "nonwetting phase appears at vertex " << globalIdx + std::cout << "nonwetting phase appears at vertex " << dofIdxGlobal << ", coordinates: " << globalPos << ", xnw + xnn: " << xnw + xnn << std::endl; newPhasePresence = bothPhases; if (formulation == pnsw) - globalSol[globalIdx][switchIdx] = 0.999; + globalSol[dofIdxGlobal][switchIdx] = 0.999; else if (formulation == pwsn) - globalSol[globalIdx][switchIdx] = 0.001; + globalSol[dofIdxGlobal][switchIdx] = 0.001; } } else if (phasePresence == bothPhases) { Scalar Smin = 0.0; - if (staticDat_[globalIdx].wasSwitched) + if (staticDat_[dofIdxGlobal].wasSwitched) Smin = -0.01; if (volVars.saturation(nPhaseIdx) <= Smin) { wouldSwitch = true; // nonwetting phase disappears - std::cout << "Nonwetting phase disappears at vertex " << globalIdx + std::cout << "Nonwetting phase disappears at vertex " << dofIdxGlobal << ", coordinates: " << globalPos << ", sn: " << volVars.saturation(nPhaseIdx) << std::endl; newPhasePresence = wPhaseOnly; if(!useMoles) //mass-fraction formulation { - globalSol[globalIdx][switchIdx] + globalSol[dofIdxGlobal][switchIdx] = volVars.massFraction(wPhaseIdx, nCompIdx); } else //mole-fraction formulation { - globalSol[globalIdx][switchIdx] + globalSol[dofIdxGlobal][switchIdx] = volVars.moleFraction(wPhaseIdx, nCompIdx); } } @@ -679,26 +679,26 @@ public: { wouldSwitch = true; // wetting phase disappears - std::cout << "Wetting phase disappears at vertex " << globalIdx + std::cout << "Wetting phase disappears at vertex " << dofIdxGlobal << ", coordinates: " << globalPos << ", sw: " << volVars.saturation(wPhaseIdx) << std::endl; newPhasePresence = nPhaseOnly; if(!useMoles) //mass-fraction formulation { - globalSol[globalIdx][switchIdx] + globalSol[dofIdxGlobal][switchIdx] = volVars.massFraction(nPhaseIdx, wCompIdx); } else //mole-fraction formulation { - globalSol[globalIdx][switchIdx] + globalSol[dofIdxGlobal][switchIdx] = volVars.moleFraction(nPhaseIdx, wCompIdx); } } } - staticDat_[globalIdx].phasePresence = newPhasePresence; - staticDat_[globalIdx].wasSwitched = wouldSwitch; + staticDat_[dofIdxGlobal].phasePresence = newPhasePresence; + staticDat_[dofIdxGlobal].wasSwitched = wouldSwitch; return phasePresence != newPhasePresence; } diff --git a/dumux/implicit/3p3c/3p3cmodel.hh b/dumux/implicit/3p3c/3p3cmodel.hh index 2938c2924afc4cd05d3528a9189c7492c464565d..31e8574b237a12d60c2dca0cb3f40801fba6c7f4 100644 --- a/dumux/implicit/3p3c/3p3cmodel.hh +++ b/dumux/implicit/3p3c/3p3cmodel.hh @@ -163,17 +163,17 @@ public: const VertexIterator &vEndIt = this->gridView_().template end<dim> (); for (; vIt != vEndIt; ++vIt) { - int globalIdx = this->dofMapper().map(*vIt); + int vIdxGlobal = this->dofMapper().map(*vIt); const GlobalPosition &globalPos = vIt->geometry().corner(0); // initialize phase presence - staticDat_[globalIdx].phasePresence - = this->problem_().initialPhasePresence(*vIt, globalIdx, + staticDat_[vIdxGlobal].phasePresence + = this->problem_().initialPhasePresence(*vIt, vIdxGlobal, globalPos); - staticDat_[globalIdx].wasSwitched = false; + staticDat_[vIdxGlobal].wasSwitched = false; - staticDat_[globalIdx].oldPhasePresence - = staticDat_[globalIdx].phasePresence; + staticDat_[vIdxGlobal].oldPhasePresence + = staticDat_[vIdxGlobal].phasePresence; } } else @@ -182,17 +182,17 @@ public: const ElementIterator &eEndIt = this->gridView_().template end<0> (); for (; eIt != eEndIt; ++eIt) { - int globalIdx = this->dofMapper().map(*eIt); + int eIdxGlobal = this->dofMapper().map(*eIt); const GlobalPosition &globalPos = eIt->geometry().center(); // initialize phase presence - staticDat_[globalIdx].phasePresence + staticDat_[eIdxGlobal].phasePresence = this->problem_().initialPhasePresence(*this->gridView_().template begin<dim> (), - globalIdx, globalPos); - staticDat_[globalIdx].wasSwitched = false; + eIdxGlobal, globalPos); + staticDat_[eIdxGlobal].wasSwitched = false; - staticDat_[globalIdx].oldPhasePresence - = staticDat_[globalIdx].phasePresence; + staticDat_[eIdxGlobal].oldPhasePresence + = staticDat_[eIdxGlobal].phasePresence; } } } @@ -264,15 +264,15 @@ public: /*! * \brief Returns the phase presence of the current or the old solution of a degree of freedom. * - * \param globalIdx The global index of the degree of freedom + * \param dofIdxGlobal The global index of the degree of freedom * \param oldSol Evaluate function with solution of current or previous time step */ - int phasePresence(int globalIdx, bool oldSol) const + int phasePresence(int dofIdxGlobal, bool oldSol) const { return oldSol - ? staticDat_[globalIdx].oldPhasePresence - : staticDat_[globalIdx].phasePresence; + ? staticDat_[dofIdxGlobal].oldPhasePresence + : staticDat_[dofIdxGlobal].phasePresence; } /*! @@ -351,27 +351,27 @@ public: for (int scvIdx = 0; scvIdx < fvGeometry.numScv; ++scvIdx) { - int globalIdx = this->dofMapper().map(*eIt, scvIdx, dofCodim); + int dofIdxGlobal = this->dofMapper().map(*eIt, scvIdx, dofCodim); for (int phaseIdx = 0; phaseIdx < numPhases; ++ phaseIdx) { - (*saturation[phaseIdx])[globalIdx] = elemVolVars[scvIdx].saturation(phaseIdx); - (*pressure[phaseIdx])[globalIdx] = elemVolVars[scvIdx].pressure(phaseIdx); - (*density[phaseIdx])[globalIdx] = elemVolVars[scvIdx].density(phaseIdx); + (*saturation[phaseIdx])[dofIdxGlobal] = elemVolVars[scvIdx].saturation(phaseIdx); + (*pressure[phaseIdx])[dofIdxGlobal] = elemVolVars[scvIdx].pressure(phaseIdx); + (*density[phaseIdx])[dofIdxGlobal] = elemVolVars[scvIdx].density(phaseIdx); } for (int phaseIdx = 0; phaseIdx < numPhases; ++phaseIdx) { for (int compIdx = 0; compIdx < numComponents; ++compIdx) { - (*moleFraction[phaseIdx][compIdx])[globalIdx] = + (*moleFraction[phaseIdx][compIdx])[dofIdxGlobal] = elemVolVars[scvIdx].moleFraction(phaseIdx, compIdx); - Valgrind::CheckDefined((*moleFraction[phaseIdx][compIdx])[globalIdx]); + Valgrind::CheckDefined((*moleFraction[phaseIdx][compIdx])[dofIdxGlobal]); } } - (*poro)[globalIdx] = elemVolVars[scvIdx].porosity(); - (*temperature)[globalIdx] = elemVolVars[scvIdx].temperature(); - (*phasePresence)[globalIdx] = staticDat_[globalIdx].phasePresence; + (*poro)[dofIdxGlobal] = elemVolVars[scvIdx].porosity(); + (*temperature)[dofIdxGlobal] = elemVolVars[scvIdx].temperature(); + (*phasePresence)[dofIdxGlobal] = staticDat_[dofIdxGlobal].phasePresence; } // velocity output @@ -429,11 +429,11 @@ public: // write primary variables ParentType::serializeEntity(outStream, entity); - int globalIdx = this->dofMapper().map(entity); + int dofIdxGlobal = this->dofMapper().map(entity); if (!outStream.good()) - DUNE_THROW(Dune::IOError, "Could not serialize entity " << globalIdx); + DUNE_THROW(Dune::IOError, "Could not serialize entity " << dofIdxGlobal); - outStream << staticDat_[globalIdx].phasePresence << " "; + outStream << staticDat_[dofIdxGlobal].phasePresence << " "; } /*! @@ -449,14 +449,14 @@ public: ParentType::deserializeEntity(inStream, entity); // read phase presence - int globalIdx = this->dofMapper().map(entity); + int dofIdxGlobal = this->dofMapper().map(entity); if (!inStream.good()) DUNE_THROW(Dune::IOError, - "Could not deserialize entity " << globalIdx); + "Could not deserialize entity " << dofIdxGlobal); - inStream >> staticDat_[globalIdx].phasePresence; - staticDat_[globalIdx].oldPhasePresence - = staticDat_[globalIdx].phasePresence; + inStream >> staticDat_[dofIdxGlobal].phasePresence; + staticDat_[dofIdxGlobal].oldPhasePresence + = staticDat_[dofIdxGlobal].phasePresence; } @@ -483,13 +483,13 @@ public: fvGeometry.update(this->gridView_(), *eIt); for (int scvIdx = 0; scvIdx < fvGeometry.numScv; ++scvIdx) { - int globalIdx = this->dofMapper().map(*eIt, scvIdx, dofCodim); + int dofIdxGlobal = this->dofMapper().map(*eIt, scvIdx, dofCodim); - if (staticDat_[globalIdx].visited) + if (staticDat_[dofIdxGlobal].visited) continue; - staticDat_[globalIdx].visited = true; - volVars.update(curGlobalSol[globalIdx], + staticDat_[dofIdxGlobal].visited = true; + volVars.update(curGlobalSol[dofIdxGlobal], this->problem_(), *eIt, fvGeometry, @@ -498,10 +498,10 @@ public: const GlobalPosition &globalPos = fvGeometry.subContVol[scvIdx].global; if (primaryVarSwitch_(curGlobalSol, volVars, - globalIdx, + dofIdxGlobal, globalPos)) { - this->jacobianAssembler().markDofRed(globalIdx); + this->jacobianAssembler().markDofRed(dofIdxGlobal); wasSwitched = true; } } @@ -571,55 +571,55 @@ protected: // variable switch was performed. bool primaryVarSwitch_(SolutionVector &globalSol, const VolumeVariables &volVars, - int globalIdx, + int dofIdxGlobal, const GlobalPosition &globalPos) { // evaluate primary variable switch bool wouldSwitch = false; - int phasePresence = staticDat_[globalIdx].phasePresence; + int phasePresence = staticDat_[dofIdxGlobal].phasePresence; int newPhasePresence = phasePresence; // check if a primary var switch is necessary if (phasePresence == threePhases) { Scalar Smin = 0; - if (staticDat_[globalIdx].wasSwitched) + if (staticDat_[dofIdxGlobal].wasSwitched) Smin = -0.01; if (volVars.saturation(gPhaseIdx) <= Smin) { wouldSwitch = true; // gas phase disappears - std::cout << "Gas phase disappears at vertex " << globalIdx + std::cout << "Gas phase disappears at vertex " << dofIdxGlobal << ", coordinates: " << globalPos << ", sg: " << volVars.saturation(gPhaseIdx) << std::endl; newPhasePresence = wnPhaseOnly; - globalSol[globalIdx][switch1Idx] + globalSol[dofIdxGlobal][switch1Idx] = volVars.moleFraction(wPhaseIdx, gCompIdx); } else if (volVars.saturation(wPhaseIdx) <= Smin) { wouldSwitch = true; // water phase disappears - std::cout << "Water phase disappears at vertex " << globalIdx + std::cout << "Water phase disappears at vertex " << dofIdxGlobal << ", coordinates: " << globalPos << ", sw: " << volVars.saturation(wPhaseIdx) << std::endl; newPhasePresence = gnPhaseOnly; - globalSol[globalIdx][switch1Idx] + globalSol[dofIdxGlobal][switch1Idx] = volVars.moleFraction(gPhaseIdx, wCompIdx); } else if (volVars.saturation(nPhaseIdx) <= Smin) { wouldSwitch = true; // NAPL phase disappears - std::cout << "NAPL phase disappears at vertex " << globalIdx + std::cout << "NAPL phase disappears at vertex " << dofIdxGlobal << ", coordinates: " << globalPos << ", sn: " << volVars.saturation(nPhaseIdx) << std::endl; newPhasePresence = wgPhaseOnly; - globalSol[globalIdx][switch2Idx] + globalSol[dofIdxGlobal][switch2Idx] = volVars.moleFraction(gPhaseIdx, nCompIdx); } } @@ -641,7 +641,7 @@ protected: Scalar xgMax = 1.0; if (xwg + xgg + xng > xgMax) wouldSwitch = true; - if (staticDat_[globalIdx].wasSwitched) + if (staticDat_[dofIdxGlobal].wasSwitched) xgMax *= 1.02; // if the sum of the mole fractions would be larger than @@ -649,7 +649,7 @@ protected: if (xwg + xgg + xng > xgMax) { // gas phase appears - std::cout << "gas phase appears at vertex " << globalIdx + std::cout << "gas phase appears at vertex " << dofIdxGlobal << ", coordinates: " << globalPos << ", xwg + xgg + xng: " << xwg + xgg + xng << std::endl; gasFlag = 1; @@ -667,7 +667,7 @@ protected: Scalar xnMax = 1.0; if (xnn > xnMax) wouldSwitch = true; - if (staticDat_[globalIdx].wasSwitched) + if (staticDat_[dofIdxGlobal].wasSwitched) xnMax *= 1.02; // if the sum of the hypothetical mole fractions would be larger than @@ -675,7 +675,7 @@ protected: if (xnn > xnMax) { // NAPL phase appears - std::cout << "NAPL phase appears at vertex " << globalIdx + std::cout << "NAPL phase appears at vertex " << dofIdxGlobal << ", coordinates: " << globalPos << ", xnn: " << xnn << std::endl; nonwettingFlag = 1; @@ -684,21 +684,21 @@ protected: if ((gasFlag == 1) && (nonwettingFlag == 0)) { newPhasePresence = wgPhaseOnly; - globalSol[globalIdx][switch1Idx] = 0.9999; - globalSol[globalIdx][switch2Idx] = 0.0001; + globalSol[dofIdxGlobal][switch1Idx] = 0.9999; + globalSol[dofIdxGlobal][switch2Idx] = 0.0001; } else if ((gasFlag == 1) && (nonwettingFlag == 1)) { newPhasePresence = threePhases; - globalSol[globalIdx][switch1Idx] = 0.9999; - globalSol[globalIdx][switch2Idx] = 0.0001; + globalSol[dofIdxGlobal][switch1Idx] = 0.9999; + globalSol[dofIdxGlobal][switch2Idx] = 0.0001; } else if ((gasFlag == 0) && (nonwettingFlag == 1)) { newPhasePresence = wnPhaseOnly; - globalSol[globalIdx][switch1Idx] + globalSol[dofIdxGlobal][switch1Idx] = volVars.moleFraction(wPhaseIdx, gCompIdx); - globalSol[globalIdx][switch2Idx] = 0.0001; + globalSol[dofIdxGlobal][switch2Idx] = 0.0001; } } else if (phasePresence == gnPhaseOnly) @@ -707,14 +707,14 @@ protected: bool wettingFlag = 0; Scalar Smin = 0.0; - if (staticDat_[globalIdx].wasSwitched) + if (staticDat_[dofIdxGlobal].wasSwitched) Smin = -0.01; if (volVars.saturation(nPhaseIdx) <= Smin) { wouldSwitch = true; // NAPL phase disappears - std::cout << "NAPL phase disappears at vertex " << globalIdx + std::cout << "NAPL phase disappears at vertex " << dofIdxGlobal << ", coordinates: " << globalPos << ", sn: " << volVars.saturation(nPhaseIdx) << std::endl; nonwettingFlag = 1; @@ -730,7 +730,7 @@ protected: Scalar xwMax = 1.0; if (xww > xwMax) wouldSwitch = true; - if (staticDat_[globalIdx].wasSwitched) + if (staticDat_[dofIdxGlobal].wasSwitched) xwMax *= 1.02; // if the sum of the mole fractions would be larger than @@ -738,7 +738,7 @@ protected: if (xww > xwMax) { // water phase appears - std::cout << "water phase appears at vertex " << globalIdx + std::cout << "water phase appears at vertex " << dofIdxGlobal << ", coordinates: " << globalPos << ", xww=xwg*pg/pwsat : " << xww << std::endl; wettingFlag = 1; @@ -747,22 +747,22 @@ protected: if ((wettingFlag == 1) && (nonwettingFlag == 0)) { newPhasePresence = threePhases; - globalSol[globalIdx][switch1Idx] = 0.0001; - globalSol[globalIdx][switch2Idx] = volVars.saturation(nPhaseIdx); + globalSol[dofIdxGlobal][switch1Idx] = 0.0001; + globalSol[dofIdxGlobal][switch2Idx] = volVars.saturation(nPhaseIdx); } else if ((wettingFlag == 1) && (nonwettingFlag == 1)) { newPhasePresence = wgPhaseOnly; - globalSol[globalIdx][switch1Idx] = 0.0001; - globalSol[globalIdx][switch2Idx] + globalSol[dofIdxGlobal][switch1Idx] = 0.0001; + globalSol[dofIdxGlobal][switch2Idx] = volVars.moleFraction(gPhaseIdx, nCompIdx); } else if ((wettingFlag == 0) && (nonwettingFlag == 1)) { newPhasePresence = gPhaseOnly; - globalSol[globalIdx][switch1Idx] + globalSol[dofIdxGlobal][switch1Idx] = volVars.moleFraction(gPhaseIdx, wCompIdx); - globalSol[globalIdx][switch2Idx] + globalSol[dofIdxGlobal][switch2Idx] = volVars.moleFraction(gPhaseIdx, nCompIdx); } } @@ -772,14 +772,14 @@ protected: bool gasFlag = 0; Scalar Smin = 0.0; - if (staticDat_[globalIdx].wasSwitched) + if (staticDat_[dofIdxGlobal].wasSwitched) Smin = -0.01; if (volVars.saturation(nPhaseIdx) <= Smin) { wouldSwitch = true; // NAPL phase disappears - std::cout << "NAPL phase disappears at vertex " << globalIdx + std::cout << "NAPL phase disappears at vertex " << dofIdxGlobal << ", coordinates: " << globalPos << ", sn: " << volVars.saturation(nPhaseIdx) << std::endl; nonwettingFlag = 1; @@ -798,7 +798,7 @@ protected: Scalar xgMax = 1.0; if (xwg + xgg + xng > xgMax) wouldSwitch = true; - if (staticDat_[globalIdx].wasSwitched) + if (staticDat_[dofIdxGlobal].wasSwitched) xgMax *= 1.02; // if the sum of the mole fractions would be larger than @@ -806,7 +806,7 @@ protected: if (xwg + xgg + xng > xgMax) { // gas phase appears - std::cout << "gas phase appears at vertex " << globalIdx + std::cout << "gas phase appears at vertex " << dofIdxGlobal << ", coordinates: " << globalPos << ", xwg + xgg + xng: " << xwg + xgg + xng << std::endl; gasFlag = 1; @@ -815,22 +815,22 @@ protected: if ((gasFlag == 1) && (nonwettingFlag == 0)) { newPhasePresence = threePhases; - globalSol[globalIdx][switch1Idx] = volVars.saturation(wPhaseIdx); - globalSol[globalIdx][switch2Idx] = volVars.saturation(nPhaseIdx); + globalSol[dofIdxGlobal][switch1Idx] = volVars.saturation(wPhaseIdx); + globalSol[dofIdxGlobal][switch2Idx] = volVars.saturation(nPhaseIdx); } else if ((gasFlag == 1) && (nonwettingFlag == 1)) { newPhasePresence = wgPhaseOnly; - globalSol[globalIdx][switch1Idx] = volVars.saturation(wPhaseIdx); - globalSol[globalIdx][switch2Idx] + globalSol[dofIdxGlobal][switch1Idx] = volVars.saturation(wPhaseIdx); + globalSol[dofIdxGlobal][switch2Idx] = volVars.moleFraction(gPhaseIdx, nCompIdx); } else if ((gasFlag == 0) && (nonwettingFlag == 1)) { newPhasePresence = wPhaseOnly; - globalSol[globalIdx][switch1Idx] + globalSol[dofIdxGlobal][switch1Idx] = volVars.moleFraction(wPhaseIdx, gCompIdx); - globalSol[globalIdx][switch2Idx] + globalSol[dofIdxGlobal][switch2Idx] = volVars.moleFraction(wPhaseIdx, nCompIdx); } } @@ -849,7 +849,7 @@ protected: Scalar xnMax = 1.0; if (xnn > xnMax) wouldSwitch = true; - if (staticDat_[globalIdx].wasSwitched) + if (staticDat_[dofIdxGlobal].wasSwitched) xnMax *= 1.02; // if the sum of the hypothetical mole fraction would be larger than @@ -857,7 +857,7 @@ protected: if (xnn > xnMax) { // NAPL phase appears - std::cout << "NAPL phase appears at vertex " << globalIdx + std::cout << "NAPL phase appears at vertex " << dofIdxGlobal << ", coordinates: " << globalPos << ", xnn: " << xnn << std::endl; nonwettingFlag = 1; @@ -871,7 +871,7 @@ protected: Scalar xwMax = 1.0; if (xww > xwMax) wouldSwitch = true; - if (staticDat_[globalIdx].wasSwitched) + if (staticDat_[dofIdxGlobal].wasSwitched) xwMax *= 1.02; // if the sum of the mole fractions would be larger than @@ -879,7 +879,7 @@ protected: if (xww > xwMax) { // water phase appears - std::cout << "water phase appears at vertex " << globalIdx + std::cout << "water phase appears at vertex " << dofIdxGlobal << ", coordinates: " << globalPos << ", xww=xwg*pg/pwsat : " << xww << std::endl; wettingFlag = 1; @@ -887,22 +887,22 @@ protected: if ((wettingFlag == 1) && (nonwettingFlag == 0)) { newPhasePresence = wgPhaseOnly; - globalSol[globalIdx][switch1Idx] = 0.0001; - globalSol[globalIdx][switch2Idx] + globalSol[dofIdxGlobal][switch1Idx] = 0.0001; + globalSol[dofIdxGlobal][switch2Idx] = volVars.moleFraction(gPhaseIdx, nCompIdx); } else if ((wettingFlag == 1) && (nonwettingFlag == 1)) { newPhasePresence = threePhases; - globalSol[globalIdx][switch1Idx] = 0.0001; - globalSol[globalIdx][switch2Idx] = 0.0001; + globalSol[dofIdxGlobal][switch1Idx] = 0.0001; + globalSol[dofIdxGlobal][switch2Idx] = 0.0001; } else if ((wettingFlag == 0) && (nonwettingFlag == 1)) { newPhasePresence = gnPhaseOnly; - globalSol[globalIdx][switch1Idx] + globalSol[dofIdxGlobal][switch1Idx] = volVars.moleFraction(gPhaseIdx, wCompIdx); - globalSol[globalIdx][switch2Idx] = 0.0001; + globalSol[dofIdxGlobal][switch2Idx] = 0.0001; } } else if (phasePresence == wgPhaseOnly) @@ -920,7 +920,7 @@ protected: Scalar xnMax = 1.0; if (xnn > xnMax) wouldSwitch = true; - if (staticDat_[globalIdx].wasSwitched) + if (staticDat_[dofIdxGlobal].wasSwitched) xnMax *= 1.02; // if the sum of the hypothetical mole fraction would be larger than @@ -928,35 +928,35 @@ protected: if (xnn > xnMax) { // NAPL phase appears - std::cout << "NAPL phase appears at vertex " << globalIdx + std::cout << "NAPL phase appears at vertex " << dofIdxGlobal << ", coordinates: " << globalPos << ", xnn: " << xnn << std::endl; nonwettingFlag = 1; } Scalar Smin = -1.e-6; - if (staticDat_[globalIdx].wasSwitched) + if (staticDat_[dofIdxGlobal].wasSwitched) Smin = -0.01; if (volVars.saturation(gPhaseIdx) <= Smin) { wouldSwitch = true; // gas phase disappears - std::cout << "Gas phase disappears at vertex " << globalIdx + std::cout << "Gas phase disappears at vertex " << dofIdxGlobal << ", coordinates: " << globalPos << ", sg: " << volVars.saturation(gPhaseIdx) << std::endl; gasFlag = 1; } Smin = 0.0; - if (staticDat_[globalIdx].wasSwitched) + if (staticDat_[dofIdxGlobal].wasSwitched) Smin = -0.01; if (volVars.saturation(wPhaseIdx) <= Smin) { wouldSwitch = true; // gas phase disappears - std::cout << "Water phase disappears at vertex " << globalIdx + std::cout << "Water phase disappears at vertex " << dofIdxGlobal << ", coordinates: " << globalPos << ", sw: " << volVars.saturation(wPhaseIdx) << std::endl; wettingFlag = 1; @@ -965,36 +965,36 @@ protected: if ((gasFlag == 0) && (nonwettingFlag == 1) && (wettingFlag == 1)) { newPhasePresence = gnPhaseOnly; - globalSol[globalIdx][switch1Idx] + globalSol[dofIdxGlobal][switch1Idx] = volVars.moleFraction(gPhaseIdx, wCompIdx); - globalSol[globalIdx][switch2Idx] = 0.0001; + globalSol[dofIdxGlobal][switch2Idx] = 0.0001; } else if ((gasFlag == 0) && (nonwettingFlag == 1) && (wettingFlag == 0)) { newPhasePresence = threePhases; - globalSol[globalIdx][switch1Idx] = volVars.saturation(wPhaseIdx); - globalSol[globalIdx][switch2Idx] = 0.0; + globalSol[dofIdxGlobal][switch1Idx] = volVars.saturation(wPhaseIdx); + globalSol[dofIdxGlobal][switch2Idx] = 0.0; } else if ((gasFlag == 1) && (nonwettingFlag == 0) && (wettingFlag == 0)) { newPhasePresence = wPhaseOnly; - globalSol[globalIdx][switch1Idx] + globalSol[dofIdxGlobal][switch1Idx] = volVars.moleFraction(wPhaseIdx, gCompIdx); - globalSol[globalIdx][switch2Idx] + globalSol[dofIdxGlobal][switch2Idx] = volVars.moleFraction(wPhaseIdx, nCompIdx); } else if ((gasFlag == 0) && (nonwettingFlag == 0) && (wettingFlag == 1)) { newPhasePresence = gPhaseOnly; - globalSol[globalIdx][switch1Idx] + globalSol[dofIdxGlobal][switch1Idx] = volVars.moleFraction(gPhaseIdx, wCompIdx); - globalSol[globalIdx][switch2Idx] + globalSol[dofIdxGlobal][switch2Idx] = volVars.moleFraction(gPhaseIdx, nCompIdx); } } - staticDat_[globalIdx].phasePresence = newPhasePresence; - staticDat_[globalIdx].wasSwitched = wouldSwitch; + staticDat_[dofIdxGlobal].phasePresence = newPhasePresence; + staticDat_[dofIdxGlobal].wasSwitched = wouldSwitch; return phasePresence != newPhasePresence; } diff --git a/dumux/implicit/common/implicitmodel.hh b/dumux/implicit/common/implicitmodel.hh index 9ce1ccbf82cb1c8d86126bd51ee0b474f395b05b..ff720d9d087c79a58336a42373910d57bfb300df 100644 --- a/dumux/implicit/common/implicitmodel.hh +++ b/dumux/implicit/common/implicitmodel.hh @@ -144,15 +144,15 @@ public: prevVolVars.resize(n); curVolVars.resize(n); for (int i = 0; i < n; ++i) { - int globalIdx = vertexMapper().map(element, i, dim); + int vIdxGlobal = vertexMapper().map(element, i, dim); - if (!hintsUsable_[globalIdx]) { + if (!hintsUsable_[vIdxGlobal]) { curVolVars[i].setHint(NULL); prevVolVars[i].setHint(NULL); } else { - curVolVars[i].setHint(&curHints_[globalIdx]); - prevVolVars[i].setHint(&prevHints_[globalIdx]); + curVolVars[i].setHint(&curHints_[vIdxGlobal]); + prevVolVars[i].setHint(&prevHints_[vIdxGlobal]); } } } @@ -170,12 +170,12 @@ public: #endif curVolVars.resize(n); for (int i = 0; i < n; ++i) { - int globalIdx = vertexMapper().map(element, i, dim); + int vIdxGlobal = vertexMapper().map(element, i, dim); - if (!hintsUsable_[globalIdx]) + if (!hintsUsable_[vIdxGlobal]) curVolVars[i].setHint(NULL); else - curVolVars[i].setHint(&curHints_[globalIdx]); + curVolVars[i].setHint(&curHints_[vIdxGlobal]); } } @@ -194,11 +194,11 @@ public: return; for (unsigned int i = 0; i < elemVolVars.size(); ++i) { - int globalIdx = vertexMapper().map(element, i, dim); - curHints_[globalIdx] = elemVolVars[i]; - if (!hintsUsable_[globalIdx]) - prevHints_[globalIdx] = elemVolVars[i]; - hintsUsable_[globalIdx] = true; + int vIdxGlobal = vertexMapper().map(element, i, dim); + curHints_[vIdxGlobal] = elemVolVars[i]; + if (!hintsUsable_[vIdxGlobal]) + prevHints_[vIdxGlobal] = elemVolVars[i]; + hintsUsable_[vIdxGlobal] = true; } } @@ -313,14 +313,14 @@ public: /*! * \brief Returns the volume \f$\mathrm{[m^3]}\f$ of a given control volume. * - * \param globalIdx The global index of the control volume's + * \param vIdxGlobal The global index of the control volume's * associated vertex */ - Scalar boxVolume(const int globalIdx) const + Scalar boxVolume(const int vIdxGlobal) const { if (isBox) { - return boxVolume_[globalIdx][0]; + return boxVolume_[vIdxGlobal][0]; } else { @@ -695,13 +695,13 @@ public: def[eqIdx] = writer.allocateManagedBuffer(numDofs); } - for (unsigned int globalIdx = 0; globalIdx < u.size(); globalIdx++) + for (unsigned int dofIdxGlobal = 0; dofIdxGlobal < u.size(); dofIdxGlobal++) { for (int eqIdx = 0; eqIdx < numEq; ++eqIdx) { - (*x[eqIdx])[globalIdx] = u[globalIdx][eqIdx]; - (*delta[eqIdx])[globalIdx] = - deltaU[globalIdx][eqIdx]; - (*def[eqIdx])[globalIdx] = residual[globalIdx][eqIdx]; + (*x[eqIdx])[dofIdxGlobal] = u[dofIdxGlobal][eqIdx]; + (*delta[eqIdx])[dofIdxGlobal] = - deltaU[dofIdxGlobal][eqIdx]; + (*def[eqIdx])[dofIdxGlobal] = residual[dofIdxGlobal][eqIdx]; } } @@ -754,10 +754,10 @@ public: x[eqIdx] = writer.allocateManagedBuffer(numDofs); } - for (int globalIdx = 0; globalIdx < sol.size(); globalIdx++) + for (int dofIdxGlobal = 0; dofIdxGlobal < sol.size(); dofIdxGlobal++) { for (int eqIdx = 0; eqIdx < numEq; ++eqIdx) { - (*x[eqIdx])[globalIdx] = sol[globalIdx][eqIdx]; + (*x[eqIdx])[dofIdxGlobal] = sol[dofIdxGlobal][eqIdx]; } } @@ -778,13 +778,13 @@ public: { return problem_().gridView(); } /*! - * \brief Returns true if the entity indicated by 'globalIdx' + * \brief Returns true if the entity indicated by 'dofIdxGlobal' * is located on / touches the grid's boundary. * - * \param globalIdx The global index of the entity + * \param dofIdxGlobal The global index of the entity */ - bool onBoundary(const int globalIdx) const - { return boundaryIndices_[globalIdx]; } + bool onBoundary(const int dofIdxGlobal) const + { return boundaryIndices_[dofIdxGlobal]; } /*! * \brief Returns true if a vertex is located on the grid's @@ -895,7 +895,7 @@ protected: for (int scvIdx = 0; scvIdx < fvGeometry.numScv; scvIdx++) { // get the global index of the degree of freedom - int globalIdx = dofMapper().map(*eIt, scvIdx, dofCodim); + int dofIdxGlobal = dofMapper().map(*eIt, scvIdx, dofCodim); // let the problem do the dirty work of nailing down // the initial solution. @@ -914,11 +914,11 @@ protected: // different sub control volumes, the initial value // will be the arithmetic mean. initPriVars *= fvGeometry.subContVol[scvIdx].volume; - boxVolume_[globalIdx] += fvGeometry.subContVol[scvIdx].volume; + boxVolume_[dofIdxGlobal] += fvGeometry.subContVol[scvIdx].volume; } - uCur_[globalIdx] += initPriVars; - Valgrind::CheckDefined(uCur_[globalIdx]); + uCur_[dofIdxGlobal] += initPriVars; + Valgrind::CheckDefined(uCur_[dofIdxGlobal]); } } @@ -986,8 +986,8 @@ protected: } else { - int globalIdx = elementMapper().map(*eIt); - boundaryIndices_[globalIdx] = true; + int eIdxGlobal = elementMapper().map(*eIt); + boundaryIndices_[eIdxGlobal] = true; } } } diff --git a/dumux/implicit/mpnc/energy/mpncvtkwriterenergykinetic.hh b/dumux/implicit/mpnc/energy/mpncvtkwriterenergykinetic.hh index 4cb395e4eb33f9733d7bddcc0422a8ff4a67ad65..b8a871eb20421a5e5b6c58ddbf6df0348f32e16a 100644 --- a/dumux/implicit/mpnc/energy/mpncvtkwriterenergykinetic.hh +++ b/dumux/implicit/mpnc/energy/mpncvtkwriterenergykinetic.hh @@ -131,33 +131,33 @@ public: { int numLocalVertices = element.geometry().corners(); for (int localVertexIdx = 0; localVertexIdx < numLocalVertices; ++localVertexIdx) { - const unsigned int globalIdx = this->problem_.vertexMapper().map(element, localVertexIdx, dim); + const unsigned int vIdxGlobal = this->problem_.vertexMapper().map(element, localVertexIdx, dim); const VolumeVariables &volVars = elemVolVars[localVertexIdx]; for (int phaseIdx = 0; phaseIdx < numPhases; ++ phaseIdx) { - enthalpy_[phaseIdx][globalIdx] = volVars.fluidState().enthalpy(phaseIdx); - internalEnergy_[phaseIdx][globalIdx] = volVars.fluidState().internalEnergy(phaseIdx); - reynoldsNumber_[phaseIdx][globalIdx] = volVars.reynoldsNumber(phaseIdx); - prandtlNumber_[phaseIdx][globalIdx] = volVars.prandtlNumber(phaseIdx); - nusseltNumber_[phaseIdx][globalIdx] = volVars.nusseltNumber(phaseIdx); + enthalpy_[phaseIdx][vIdxGlobal] = volVars.fluidState().enthalpy(phaseIdx); + internalEnergy_[phaseIdx][vIdxGlobal] = volVars.fluidState().internalEnergy(phaseIdx); + reynoldsNumber_[phaseIdx][vIdxGlobal] = volVars.reynoldsNumber(phaseIdx); + prandtlNumber_[phaseIdx][vIdxGlobal] = volVars.prandtlNumber(phaseIdx); + nusseltNumber_[phaseIdx][vIdxGlobal] = volVars.nusseltNumber(phaseIdx); } // because numPhases only counts liquid phases for (int phaseIdx = 0; phaseIdx < numEnergyEqs; ++ phaseIdx) { - temperature_[phaseIdx][globalIdx] = volVars.temperature(phaseIdx); - Valgrind::CheckDefined(temperature_[phaseIdx][globalIdx]); + temperature_[phaseIdx][vIdxGlobal] = volVars.temperature(phaseIdx); + Valgrind::CheckDefined(temperature_[phaseIdx][vIdxGlobal]); } const unsigned int wPhaseIdx = FluidSystem::wPhaseIdx; const unsigned int nPhaseIdx = FluidSystem::nPhaseIdx; const unsigned int sPhaseIdx = FluidSystem::sPhaseIdx; - TwMinusTn_[globalIdx] = volVars.temperature(wPhaseIdx) - volVars.temperature(nPhaseIdx); - TnMinusTs_[globalIdx] = volVars.temperature(nPhaseIdx) - volVars.temperature(sPhaseIdx); + TwMinusTn_[vIdxGlobal] = volVars.temperature(wPhaseIdx) - volVars.temperature(nPhaseIdx); + TnMinusTs_[vIdxGlobal] = volVars.temperature(nPhaseIdx) - volVars.temperature(sPhaseIdx); - awn_[globalIdx] = volVars.interfacialArea(wPhaseIdx, nPhaseIdx); - aws_[globalIdx] = volVars.interfacialArea(wPhaseIdx, sPhaseIdx); - ans_[globalIdx] = volVars.interfacialArea(nPhaseIdx, sPhaseIdx); + awn_[vIdxGlobal] = volVars.interfacialArea(wPhaseIdx, nPhaseIdx); + aws_[vIdxGlobal] = volVars.interfacialArea(wPhaseIdx, sPhaseIdx); + ans_[vIdxGlobal] = volVars.interfacialArea(nPhaseIdx, sPhaseIdx); /*only one of the two output options, otherwise paraview segfaults due to two times the same field name*/ if (velocityAveragingInModel and not velocityOutput){ @@ -368,25 +368,25 @@ public: { int numLocalVertices = element.geometry().corners(); for (int localVertexIdx = 0; localVertexIdx < numLocalVertices; ++localVertexIdx) { - const unsigned int globalIdx = this->problem_.vertexMapper().map(element, localVertexIdx, dim); + const unsigned int vIdxGlobal = this->problem_.vertexMapper().map(element, localVertexIdx, dim); const VolumeVariables &volVars = elemVolVars[localVertexIdx]; - qBoil_[globalIdx] = LocalResidual::QBoilFunc(volVars, volVars.fluidState().saturation(wPhaseIdx)); - qsf_[globalIdx] = LocalResidual::qsf(volVars); + qBoil_[vIdxGlobal] = LocalResidual::QBoilFunc(volVars, volVars.fluidState().saturation(wPhaseIdx)); + qsf_[vIdxGlobal] = LocalResidual::qsf(volVars); for (int phaseIdx = 0; phaseIdx < numPhases; ++ phaseIdx) { - enthalpy_[phaseIdx][globalIdx] = volVars.fluidState().enthalpy(phaseIdx); - internalEnergy_[phaseIdx][globalIdx] = volVars.fluidState().internalEnergy(phaseIdx); - reynoldsNumber_[phaseIdx][globalIdx] = volVars.reynoldsNumber(phaseIdx); - prandtlNumber_[phaseIdx][globalIdx] = volVars.prandtlNumber(phaseIdx); - nusseltNumber_[phaseIdx][globalIdx] = volVars.nusseltNumber(phaseIdx); + enthalpy_[phaseIdx][vIdxGlobal] = volVars.fluidState().enthalpy(phaseIdx); + internalEnergy_[phaseIdx][vIdxGlobal] = volVars.fluidState().internalEnergy(phaseIdx); + reynoldsNumber_[phaseIdx][vIdxGlobal] = volVars.reynoldsNumber(phaseIdx); + prandtlNumber_[phaseIdx][vIdxGlobal] = volVars.prandtlNumber(phaseIdx); + nusseltNumber_[phaseIdx][vIdxGlobal] = volVars.nusseltNumber(phaseIdx); } // because numPhases only counts liquid phases for (int phaseIdx = 0; phaseIdx < numEnergyEqs; ++ phaseIdx) { - temperature_[phaseIdx][globalIdx] = volVars.temperature(phaseIdx); - Valgrind::CheckDefined(temperature_[phaseIdx][globalIdx]); + temperature_[phaseIdx][vIdxGlobal] = volVars.temperature(phaseIdx); + Valgrind::CheckDefined(temperature_[phaseIdx][vIdxGlobal]); } if (velocityAveragingInModel and not velocityOutput/*only one of the two output options, otherwise paraview segfaults due to two times the same field name*/){ diff --git a/dumux/implicit/mpnc/mass/mpncvtkwritermasskinetic.hh b/dumux/implicit/mpnc/mass/mpncvtkwritermasskinetic.hh index c1fcdf89f0696941c46a4cd70c7d78e945cf5233..d126f2ade141470026d9560318f8efd23fb091ee 100644 --- a/dumux/implicit/mpnc/mass/mpncvtkwritermasskinetic.hh +++ b/dumux/implicit/mpnc/mass/mpncvtkwritermasskinetic.hh @@ -109,25 +109,25 @@ public: { int numLocalVertices = element.geometry().corners(); for (int localVertexIdx = 0; localVertexIdx< numLocalVertices; ++localVertexIdx) { - const unsigned int globalIdx = this->problem_.vertexMapper().map(element, localVertexIdx, dim); + const unsigned int vIdxGlobal = this->problem_.vertexMapper().map(element, localVertexIdx, dim); const VolumeVariables &volVars = elemVolVars[localVertexIdx]; for (unsigned int phaseIdx = 0; phaseIdx < numPhases; ++ phaseIdx) { for (unsigned int compIdx = 0; compIdx < numComponents; ++ compIdx) { - moleFracEquil_[phaseIdx][compIdx][globalIdx] = volVars.xEquil(phaseIdx, compIdx); + moleFracEquil_[phaseIdx][compIdx][vIdxGlobal] = volVars.xEquil(phaseIdx, compIdx); } } // for (unsigned int phaseIdx = 0; phaseIdx < numPhases; ++ phaseIdx) { // for (unsigned int compIdx = 0; compIdx < numComponents; ++ compIdx) { -// drivingThingyMole_[phaseIdx][compIdx][globalIdx] = volVars.xEquil(phaseIdx, compIdx) - volVars.fluidState().moleFraction(phaseIdx, compIdx); -// drivingThingyMu_[phaseIdx][compIdx][globalIdx] = volVars.chemicalPotentialEquil(phaseIdx, compIdx) - volVars.chemicalPotential(phaseIdx, compIdx); -//// percentageEquilMoleFrac_[phaseIdx][compIdx][globalIdx] = (volVars.fluidState().moleFraction(phaseIdx, compIdx)) / volVars.xEquil(phaseIdx, compIdx); +// drivingThingyMole_[phaseIdx][compIdx][vIdxGlobal] = volVars.xEquil(phaseIdx, compIdx) - volVars.fluidState().moleFraction(phaseIdx, compIdx); +// drivingThingyMu_[phaseIdx][compIdx][vIdxGlobal] = volVars.chemicalPotentialEquil(phaseIdx, compIdx) - volVars.chemicalPotential(phaseIdx, compIdx); +//// percentageEquilMoleFrac_[phaseIdx][compIdx][vIdxGlobal] = (volVars.fluidState().moleFraction(phaseIdx, compIdx)) / volVars.xEquil(phaseIdx, compIdx); // } // } if (deltaPOutput_) { - deltaP_[globalIdx] = volVars.fluidState().pressure(nPhaseIdx) - 100000.; + deltaP_[vIdxGlobal] = volVars.fluidState().pressure(nPhaseIdx) - 100000.; } } } diff --git a/dumux/io/plotoverline2d.hh b/dumux/io/plotoverline2d.hh index c2d7de4b4dab175158248ac7fce14bb3ca664d85..345bd775f4358a1a047cd235ac81a32718254105 100644 --- a/dumux/io/plotoverline2d.hh +++ b/dumux/io/plotoverline2d.hh @@ -110,13 +110,13 @@ public: for (unsigned int scvIdx=0; scvIdx < numScv; ++scvIdx) { // find some global identification - const unsigned int globalIdx = problem.vertexMapper().map(*eIt, scvIdx, dim); + const unsigned int vIdxGlobal = problem.vertexMapper().map(*eIt, scvIdx, dim); // only write out if the vertex was not already visited - if (isVisited[globalIdx]) + if (isVisited[vIdxGlobal]) continue; - isVisited[globalIdx] = true ; + isVisited[vIdxGlobal] = true ; // Getting the spatial coordinate const GlobalPosition & globalPosCurrent diff --git a/test/decoupled/1p/test_diffusionspatialparams.hh b/test/decoupled/1p/test_diffusionspatialparams.hh index d33c8a5f635a6c4abe201f74160488876b874650..31e5f9031c875fde1b8604c9fc6fe4368adee96b 100644 --- a/test/decoupled/1p/test_diffusionspatialparams.hh +++ b/test/decoupled/1p/test_diffusionspatialparams.hh @@ -125,10 +125,10 @@ public: ElementIterator eEndIt = gridView_.template end<0>(); for(;eIt != eEndIt; ++eIt) { - int globalIdx = indexSet_.index(*eIt); - (*permXX)[globalIdx][0] = permeability_[globalIdx][0][0]; - (*permXY)[globalIdx][0] = permeability_[globalIdx][0][1]; - (*permYY)[globalIdx][0] = permeability_[globalIdx][1][1]; + int eIdxGlobal = indexSet_.index(*eIt); + (*permXX)[eIdxGlobal][0] = permeability_[eIdxGlobal][0][0]; + (*permXY)[eIdxGlobal][0] = permeability_[eIdxGlobal][0][1]; + (*permYY)[eIdxGlobal][0] = permeability_[eIdxGlobal][1][1]; } writer.attachCellData(*permXX, "permeability-X"); diff --git a/test/decoupled/2p/test_transportproblem.hh b/test/decoupled/2p/test_transportproblem.hh index ab403316ea9f8ce13237b5f3cede82e503ea487b..bc7004a0012498c05b99338bc84da8f80dabf379 100644 --- a/test/decoupled/2p/test_transportproblem.hh +++ b/test/decoupled/2p/test_transportproblem.hh @@ -154,9 +154,9 @@ public: for (ElementIterator eIt = this->gridView().template begin<0> (); eIt != eEndIt; ++eIt) { // cell index - int globalIdx = this->elementMapper().map(*eIt); + int eIdxGlobal = this->elementMapper().map(*eIt); - CellData& cellData = this->variables().cellData(globalIdx); + CellData& cellData = this->variables().cellData(eIdxGlobal); // run through all intersections with neighbors and boundary IntersectionIterator isEndIt = this->gridView().iend(*eIt); diff --git a/test/geomechanics/el2p/el2pproblem.hh b/test/geomechanics/el2p/el2pproblem.hh index b5b05745589c494f116e94311dd888ecdab84209..4e830c68abe67d3a134210116125596573421b80 100644 --- a/test/geomechanics/el2p/el2pproblem.hh +++ b/test/geomechanics/el2p/el2pproblem.hh @@ -277,11 +277,11 @@ public: VertexIterator vEndIt = gridView_.template end<dim>(); for(; vIt != vEndIt; ++vIt) { - int globalIdx = vertexMapper_.map(*vIt); + int vIdxGlobal = vertexMapper_.map(*vIt); GlobalPosition globalPos = (*vIt).geometry().corner(0); // initial approximate pressure distribution at start of initialization run - pInit_[globalIdx] = -(1.013e5 + (depthBOR_ - globalPos[2]) * brineDensity_ * 9.81); + pInit_[vIdxGlobal] = -(1.013e5 + (depthBOR_ - globalPos[2]) * brineDensity_ * 9.81); } } @@ -319,9 +319,9 @@ public: VertexIterator vEndIt = gridView_.template end<dim>(); for(; vIt != vEndIt; ++vIt) { - int globalIdx = vertexMapper_.map(*vIt); + int vIdxGlobal = vertexMapper_.map(*vIt); // - pInit_[globalIdx] = -this->model().curSol().base()[globalIdx*2][0]; + pInit_[vIdxGlobal] = -this->model().curSol().base()[vIdxGlobal*2][0]; } } @@ -339,7 +339,7 @@ public: // function which returns an in-situ stress field that needs to be provided // for the principal stress calculation - GlobalPosition initialStress(const GlobalPosition globalPos, const int globalIdx) const + GlobalPosition initialStress(const GlobalPosition globalPos, const int dofIdxGlobal) const { GlobalPosition stress; Scalar porosity, rockDensity, gravity; @@ -415,8 +415,8 @@ public: for (int i = 0; i < element.template count<dim>(); i++) #endif { - int globalIdx = this->vertexMapper().map(element, i, dim); - pValue += pInit_[globalIdx] * shapeVal[i]; + int vIdxGlobal = this->vertexMapper().map(element, i, dim); + pValue += pInit_[vIdxGlobal] * shapeVal[i]; } return pValue; @@ -847,7 +847,7 @@ public: for (; vIt != vEndIt; ++vIt) { // get global index of current vertex - int globalIdx = vertexMapper_.map(*vIt); + int vIdxGlobal = vertexMapper_.map(*vIt); Dune::FieldVector<double, 3> globalPos = (*vIt).geometry().corner(0); @@ -858,8 +858,8 @@ public: && globalPos[2] <= position[2] + eps_) { // if coordinates are identical write the pressure value for this - // vertex (with index globalIdx) into the values vector - values[pressureIdx] = pInit_[globalIdx]; + // vertex (with index vIdxGlobal) into the values vector + values[pressureIdx] = pInit_[vIdxGlobal]; // the value of this vertex is set valueSet = true; } @@ -892,8 +892,8 @@ public: gridView_.template end<GridView::dimension> (); for (; vIt != vEndIt; ++vIt) { - int globalIdx = vertexMapper_.map(*vIt); - pInit_[globalIdx] = -pInit[globalIdx]; + int vIdxGlobal = vertexMapper_.map(*vIt); + pInit_[vIdxGlobal] = -pInit[vIdxGlobal]; } } diff --git a/test/implicit/2pdfm/2pdfmspatialparams.hh b/test/implicit/2pdfm/2pdfmspatialparams.hh index 2a5886ca0670daec24ccb8c3b4950e9bc82940d3..8bc11c89ffa2b55cfcb5b149d19b76e63660ce55 100644 --- a/test/implicit/2pdfm/2pdfmspatialparams.hh +++ b/test/implicit/2pdfm/2pdfmspatialparams.hh @@ -216,10 +216,10 @@ public: const FVElementGeometry &fvGeometry, int scvIdx) const { - DUNE_UNUSED int globalIdx = vertexMapper_.map(element, scvIdx, dim); + DUNE_UNUSED int vIdxGlobal = vertexMapper_.map(element, scvIdx, dim); // be picky if called for non-fracture vertices - assert(isVertexFracture(globalIdx)); + assert(isVertexFracture(vIdxGlobal)); return fractureMaterialParams_; } @@ -236,22 +236,22 @@ public: { return false; } - int globalIdx = vertexMapper_.map(element, localVertexIdx, dim); - return fractureMapper_.isDuneFractureVertex(globalIdx); + int vIdxGlobal = vertexMapper_.map(element, localVertexIdx, dim); + return fractureMapper_.isDuneFractureVertex(vIdxGlobal); } /*! * \brief Checks whether vertex is a fracture. * - * \param globalIdx Vertex index to be checked + * \param vIdxGlobal Vertex index to be checked */ - bool isVertexFracture(int globalIdx) const + bool isVertexFracture(int vIdxGlobal) const { if (inactivateFractures_) { return false; } - return fractureMapper_.isDuneFractureVertex(globalIdx); + return fractureMapper_.isDuneFractureVertex(vIdxGlobal); } /*! @@ -262,8 +262,8 @@ public: */ bool isEdgeFracture(const Element &element, int localFaceIdx) const { - int globalIdx = faceMapper_.map(element, localFaceIdx, 1); - return fractureMapper_.isDuneFractureEdge(globalIdx); + int fIdxGlobal = faceMapper_.map(element, localFaceIdx, 1); + return fractureMapper_.isDuneFractureEdge(fIdxGlobal); } /*! diff --git a/test/multidomain/2cnistokes2p2cni/2cnistokes2p2cniproblem.hh b/test/multidomain/2cnistokes2p2cni/2cnistokes2p2cniproblem.hh index b7bfb9c3b38ea903471dff81dcc61decf4a3f381..bc36393d4737d92034ba2dda8aeae5a9f17c6231 100644 --- a/test/multidomain/2cnistokes2p2cni/2cnistokes2p2cniproblem.hh +++ b/test/multidomain/2cnistokes2p2cni/2cnistokes2p2cniproblem.hh @@ -470,7 +470,7 @@ public: bool existing = false; for (int interfaceVertex=0; interfaceVertex < numInterfaceVertices; ++interfaceVertex) { - if (firstGlobalIdx == outputVector[interfaceVertex].globalIdx) + if (firstGlobalIdx == outputVector[interfaceVertex].vIdxGlobal) { existing = true; interfaceVertIdx = interfaceVertex; @@ -484,7 +484,7 @@ public: if (shouldWriteFluxFile()) // compute only if required { outputVector[interfaceVertIdx].interfaceVertex = interfaceVertIdx; - outputVector[interfaceVertIdx].globalIdx = firstGlobalIdx; + outputVector[interfaceVertIdx].vIdxGlobal = firstGlobalIdx; outputVector[interfaceVertIdx].xCoord = vertexGlobal[0]; outputVector[interfaceVertIdx].yCoord = vertexGlobal[1]; outputVector[interfaceVertIdx].count += 1; @@ -607,7 +607,7 @@ public: // loop over all interface vertices to check if vertex id is already in stack for (int interfaceVertex=0; interfaceVertex < numInterfaceVertices; ++interfaceVertex) { - if (secondGlobalIdx == outputVector[interfaceVertex].globalIdx) + if (secondGlobalIdx == outputVector[interfaceVertex].vIdxGlobal) { existing = true; interfaceVertIdx = interfaceVertex; @@ -621,7 +621,7 @@ public: if (shouldWriteFluxFile()) { outputVector[interfaceVertIdx].interfaceVertex = interfaceVertIdx; - outputVector[interfaceVertIdx].globalIdx = secondGlobalIdx; + outputVector[interfaceVertIdx].vIdxGlobal = secondGlobalIdx; outputVector[interfaceVertIdx].xCoord = vertexGlobal[0]; outputVector[interfaceVertIdx].yCoord = vertexGlobal[1]; for (int eqIdx=0; eqIdx < numEq2; ++eqIdx) @@ -821,7 +821,7 @@ private: { unsigned count; unsigned interfaceVertex; - unsigned globalIdx; + unsigned vIdxGlobal; Scalar xCoord; Scalar yCoord; Dune::FieldVector<Scalar, numEq> residual; @@ -830,7 +830,7 @@ private: { count = 0; interfaceVertex = 0; - globalIdx = 0; + vIdxGlobal = 0; xCoord = 0.0; yCoord = 0.0; residual = 0.0; diff --git a/test/multidomain/2cnistokes2p2cni/2p2cnisubproblem.hh b/test/multidomain/2cnistokes2p2cni/2p2cnisubproblem.hh index 464d21d08296abf5fc1fc045f905312db468808b..f94e2a86650793ecdff0beab318573cfb148714f 100644 --- a/test/multidomain/2cnistokes2p2cni/2p2cnisubproblem.hh +++ b/test/multidomain/2cnistokes2p2cni/2p2cnisubproblem.hh @@ -438,11 +438,11 @@ public: * \brief Return the initial phase state inside a control volume. * * \param vert The vertex - * \param globalIdx The index of the global vertex + * \param dofIdxGlobal The global index of the degree of freedom * \param globalPos The global position */ int initialPhasePresence(const Vertex &vert, - const int &globalIdx, + const int &dofIdxGlobal, const GlobalPosition &globalPos) const { return bothPhases; diff --git a/test/multidomain/2cstokes2p2c/2cstokes2p2cproblem.hh b/test/multidomain/2cstokes2p2c/2cstokes2p2cproblem.hh index d449f95073218bde5d65386886941a1d57f0f491..8aa61e23dd10921d31c0fc152a25c0f2b55a99ce 100644 --- a/test/multidomain/2cstokes2p2c/2cstokes2p2cproblem.hh +++ b/test/multidomain/2cstokes2p2c/2cstokes2p2cproblem.hh @@ -451,7 +451,7 @@ public: bool existing = false; for (int interfaceVertex=0; interfaceVertex < numInterfaceVertices; ++interfaceVertex) { - if (firstGlobalIdx == outputVector[interfaceVertex].globalIdx) + if (firstGlobalIdx == outputVector[interfaceVertex].vIdxGlobal) { existing = true; interfaceVertIdx = interfaceVertex; @@ -465,7 +465,7 @@ public: if (shouldWriteFluxFile()) // compute only if required { outputVector[interfaceVertIdx].interfaceVertex = interfaceVertIdx; - outputVector[interfaceVertIdx].globalIdx = firstGlobalIdx; + outputVector[interfaceVertIdx].vIdxGlobal = firstGlobalIdx; outputVector[interfaceVertIdx].xCoord = vertexGlobal[0]; outputVector[interfaceVertIdx].yCoord = vertexGlobal[1]; outputVector[interfaceVertIdx].count += 1; @@ -585,7 +585,7 @@ public: // loop over all interface vertices to check if vertex id is already in stack for (int interfaceVertex=0; interfaceVertex < numInterfaceVertices; ++interfaceVertex) { - if (secondGlobalIdx == outputVector[interfaceVertex].globalIdx) + if (secondGlobalIdx == outputVector[interfaceVertex].vIdxGlobal) { existing = true; interfaceVertIdx = interfaceVertex; @@ -599,7 +599,7 @@ public: if (shouldWriteFluxFile()) { outputVector[interfaceVertIdx].interfaceVertex = interfaceVertIdx; - outputVector[interfaceVertIdx].globalIdx = secondGlobalIdx; + outputVector[interfaceVertIdx].vIdxGlobal = secondGlobalIdx; outputVector[interfaceVertIdx].xCoord = vertexGlobal[0]; outputVector[interfaceVertIdx].yCoord = vertexGlobal[1]; for (int eqIdx=0; eqIdx < numEq2; ++eqIdx) @@ -793,7 +793,7 @@ private: { unsigned count; unsigned interfaceVertex; - unsigned globalIdx; + unsigned vIdxGlobal; Scalar xCoord; Scalar yCoord; Dune::FieldVector<Scalar, numEq> defect; @@ -802,7 +802,7 @@ private: { count = 0; interfaceVertex = 0; - globalIdx = 0; + vIdxGlobal = 0; xCoord = 0.0; yCoord = 0.0; defect = 0.0; diff --git a/test/multidomain/2cstokes2p2c/2cstokes2p2cspatialparams.hh b/test/multidomain/2cstokes2p2c/2cstokes2p2cspatialparams.hh index 4a79f7e2a0a77d6c18e2a64103617df3c2fd3dc4..0bc423eb02fba01eb725173d50abdb0846a5da77 100644 --- a/test/multidomain/2cstokes2p2c/2cstokes2p2cspatialparams.hh +++ b/test/multidomain/2cstokes2p2c/2cstokes2p2cspatialparams.hh @@ -433,15 +433,15 @@ public: // for (VertexIterator vIt = gridView.template begin<dim> (); vIt // != vItEnd; ++vIt) // { -// int globalIdx = indexSet_.index(*vIt); +// int vIdxGlobal = indexSet_.index(*vIt); // // Scalar elementEntryPressure = 1./GET_RUNTIME_PARAM_FROM_GROUP(TypeTag, Scalar, SpatialParams.Medium, VgAlpha2); -// elementEntryPressure *= sqrt(meanPermeability / permeability_[globalIdx]); +// elementEntryPressure *= sqrt(meanPermeability / permeability_[vIdxGlobal]); // -// materialLawParams_[globalIdx].setVgAlpha(1./elementEntryPressure); -// materialLawParams_[globalIdx].setVgn(GET_RUNTIME_PARAM_FROM_GROUP(TypeTag, Scalar, SpatialParams.Medium, VgN2)); -// materialLawParams_[globalIdx].setSwr(GET_RUNTIME_PARAM_FROM_GROUP(TypeTag, Scalar, SpatialParams.Medium, Swr2)); -// materialLawParams_[globalIdx].setSnr(GET_RUNTIME_PARAM_FROM_GROUP(TypeTag, Scalar, SpatialParams.Medium, Snr2)); +// materialLawParams_[vIdxGlobal].setVgAlpha(1./elementEntryPressure); +// materialLawParams_[vIdxGlobal].setVgn(GET_RUNTIME_PARAM_FROM_GROUP(TypeTag, Scalar, SpatialParams.Medium, VgN2)); +// materialLawParams_[vIdxGlobal].setSwr(GET_RUNTIME_PARAM_FROM_GROUP(TypeTag, Scalar, SpatialParams.Medium, Swr2)); +// materialLawParams_[vIdxGlobal].setSnr(GET_RUNTIME_PARAM_FROM_GROUP(TypeTag, Scalar, SpatialParams.Medium, Snr2)); // } // // // if (create) diff --git a/test/multidomain/2cstokes2p2c/2p2csubproblem.hh b/test/multidomain/2cstokes2p2c/2p2csubproblem.hh index 843d9314520c5459cba247111cd641836bd608c8..b142a3e90f604d260c30f8b595775b9b48d7dc5b 100644 --- a/test/multidomain/2cstokes2p2c/2p2csubproblem.hh +++ b/test/multidomain/2cstokes2p2c/2p2csubproblem.hh @@ -369,11 +369,11 @@ public: * \brief Return the initial phase state inside a control volume. * * \param vertex The vertex - * \param globalIdx The index of the global vertex + * \param dofIdxGlobal The global index of the degree of freedom * \param globalPos The global position */ int initialPhasePresence(const Vertex &vertex, - const int &globalIdx, + const int &dofIdxGlobal, const GlobalPosition &globalPos) const { return bothPhases;