diff --git a/dumux/decoupled/1p/diffusion/fv/fvvelocity1p.hh b/dumux/decoupled/1p/diffusion/fv/fvvelocity1p.hh index cdf4f540613fc2dd8f555759f194520a770911f2..887e056d592080a248b247ca3b2e93d5f1bbab88 100644 --- a/dumux/decoupled/1p/diffusion/fv/fvvelocity1p.hh +++ b/dumux/decoupled/1p/diffusion/fv/fvvelocity1p.hh @@ -175,9 +175,6 @@ void FVVelocity1P<TypeTag>::calculateVelocity() ElementIterator eItEnd = problem_.gridView().template end<0>(); for (ElementIterator eIt = problem_.gridView().template begin<0>(); eIt != eItEnd; ++eIt) { - // - GlobalPosition globalPos = eIt->geometry().center(); - // cell index int globalIdxI = problem_.variables().index(*eIt); @@ -199,7 +196,7 @@ void FVVelocity1P<TypeTag>::calculateVelocity() // local number of facet int isIndex = isIt->indexInInside(); - Dune::FieldVector<Scalar,dimWorld> unitOuterNormal = isIt->centerUnitOuterNormal(); + const GlobalPosition& unitOuterNormal = isIt->centerUnitOuterNormal(); // handle interior face if (isIt->neighbor()) @@ -216,7 +213,7 @@ void FVVelocity1P<TypeTag>::calculateVelocity() const GlobalPosition& globalPosNeighbor = neighborPointer->geometry().center(); // distance vector between barycenters - Dune::FieldVector<Scalar,dimWorld> distVec = globalPosNeighbor - globalPos; + GlobalPosition distVec = globalPosNeighbor - globalPos; // compute distance between cell centers Scalar dist = distVec.two_norm(); @@ -261,10 +258,10 @@ void FVVelocity1P<TypeTag>::calculateVelocity() density = (potential == 0.) ? 0.5 * (densityI + densityJ) : density; //calculate the gravity term - Dune::FieldVector<Scalar,dimWorld> velocity(permeability); + GlobalPosition velocity(permeability); velocity *= (pressI - pressJ)/dist; - Dune::FieldVector<Scalar,dimWorld> gravityTerm(unitOuterNormal); + GlobalPosition gravityTerm(unitOuterNormal); gravityTerm *= (this->gravity*permeability)*density; //store velocities @@ -276,7 +273,7 @@ void FVVelocity1P<TypeTag>::calculateVelocity() else if (isIt->boundary()) { // center of face in global coordinates - GlobalPosition globalPosFace = isIt->geometry().center(); + const GlobalPosition& globalPosFace = isIt->geometry().center(); //get boundary type problem_.boundaryTypes(bcType, *isIt); @@ -287,10 +284,10 @@ void FVVelocity1P<TypeTag>::calculateVelocity() problem_.dirichlet(boundValues, *isIt); // cell center in global coordinates - GlobalPosition globalPos = eIt->geometry().center(); + const GlobalPosition& globalPos = eIt->geometry().center(); // distance vector between barycenters - Dune::FieldVector<Scalar,dimWorld> distVec = globalPosFace - globalPos; + GlobalPosition distVec = globalPosFace - globalPos; // compute distance between cell centers Scalar dist = distVec.two_norm(); @@ -310,10 +307,10 @@ void FVVelocity1P<TypeTag>::calculateVelocity() Scalar pressBound = boundValues; //calculate the gravity term - Dune::FieldVector<Scalar,dimWorld> velocity(permeability); + GlobalPosition velocity(permeability); velocity *= (pressI - pressBound)/dist; - Dune::FieldVector<Scalar,dimWorld> gravityTerm(unitOuterNormal); + GlobalPosition gravityTerm(unitOuterNormal); gravityTerm *= (this->gravity*permeability)*densityI; problem_.variables().velocity()[globalIdxI][isIndex] = (velocity + gravityTerm); @@ -323,7 +320,7 @@ void FVVelocity1P<TypeTag>::calculateVelocity() else { problem_.neumann(boundValues, *isIt); - Dune::FieldVector<Scalar,dimWorld> velocity(unitOuterNormal); + GlobalPosition velocity(unitOuterNormal); velocity *= boundValues[pressEqIdx]/densityI; diff --git a/dumux/decoupled/2p/diffusion/fv/fvpressure2p.hh b/dumux/decoupled/2p/diffusion/fv/fvpressure2p.hh index 63a5a722d1b4362cc971aef330e56e3bd3a1339b..626e57cd1bf9a1ba6ccffb38704852b0d69ccb5f 100644 --- a/dumux/decoupled/2p/diffusion/fv/fvpressure2p.hh +++ b/dumux/decoupled/2p/diffusion/fv/fvpressure2p.hh @@ -278,7 +278,7 @@ private: Matrix A_; Dune::BlockVector<Dune::FieldVector<Scalar, 1> > f_; protected: - const Dune::FieldVector<Scalar, dimWorld>& gravity; //!< vector including the gravity constant + const GlobalPosition& gravity; //!< vector including the gravity constant static const bool compressibility = GET_PROP_VALUE(TypeTag, PTAG(EnableCompressibility)); static const int pressureType = GET_PROP_VALUE(TypeTag, PTAG(PressureFormulation)); //!< gives kind of pressure used (\f$p_w\f$, \f$p_n\f$, \f$p_{global}\f$) static const int saturationType = GET_PROP_VALUE(TypeTag, PTAG(SaturationFormulation)); //!< gives kind of saturation used (\f$S_w\f$, \f$S_n\f$) @@ -386,7 +386,7 @@ void FVPressure2P<TypeTag>::assemble(bool first) // get normal vector - Dune::FieldVector<Scalar, dimWorld> unitOuterNormal = isIt->centerUnitOuterNormal(); + const GlobalPosition& unitOuterNormal = isIt->centerUnitOuterNormal(); // get face volume Scalar faceArea = isIt->geometry().volume(); @@ -402,7 +402,7 @@ void FVPressure2P<TypeTag>::assemble(bool first) const GlobalPosition& globalPosNeighbor = neighborPointer->geometry().center(); // distance vector between barycenters - Dune::FieldVector<Scalar, dimWorld> distVec = globalPosNeighbor - globalPos; + GlobalPosition distVec = globalPosNeighbor - globalPos; // compute distance between cell centers Scalar dist = distVec.two_norm(); @@ -558,7 +558,7 @@ void FVPressure2P<TypeTag>::assemble(bool first) problem().boundaryTypes(bcType, *isIt); PrimaryVariables boundValues(0.0); - Dune::FieldVector<Scalar, dimWorld> distVec(globalPosFace - globalPos); + GlobalPosition distVec(globalPosFace - globalPos); Scalar dist = distVec.two_norm(); if (bcType.isDirichlet(eqIdxPress)) @@ -856,9 +856,6 @@ void FVPressure2P<TypeTag>::updateMaterialLaws() ElementIterator eItEnd = problem_.gridView().template end<0> (); for (ElementIterator eIt = problem_.gridView().template begin<0> (); eIt != eItEnd; ++eIt) { - // get global coordinate of cell center - GlobalPosition globalPos = eIt->geometry().center(); - int globalIdx = problem_.variables().index(*eIt); Scalar temperature = problem_.temperature(*eIt); diff --git a/dumux/decoupled/2p/diffusion/mimetic/mimeticgroundwater.hh b/dumux/decoupled/2p/diffusion/mimetic/mimeticgroundwater.hh index c6b8650fcb376cec28e8769286bed1376593df63..5d0867d223ad6959f1beaeff5bd1b1de4c7fd4d4 100644 --- a/dumux/decoupled/2p/diffusion/mimetic/mimeticgroundwater.hh +++ b/dumux/decoupled/2p/diffusion/mimetic/mimeticgroundwater.hh @@ -178,7 +178,7 @@ public: this->setcurrentsize(numFaces); // get global coordinate of cell center - Dune::FieldVector<Scalar,dim> centerGlobal = element.geometry().center(); + const Dune::FieldVector<Scalar,dim>& centerGlobal = element.geometry().center(); int globalIdx = problem_.variables().index(element); @@ -205,11 +205,11 @@ public: // local number of facet i = it->indexInInside(); - Dune::FieldVector<Scalar,dim> faceGlobal = it->geometry().center(); + const Dune::FieldVector<Scalar,dim>& faceGlobal = it->geometry().center(); faceVol[i] = it->geometry().volume(); // get normal vector - Dune::FieldVector<Scalar,dim> unitOuterNormal = it->centerUnitOuterNormal(); + const Dune::FieldVector<Scalar,dim>& unitOuterNormal = it->centerUnitOuterNormal(); N[i] = unitOuterNormal; @@ -394,8 +394,6 @@ private: for (IntersectionIterator it = gridView_.ibegin(element); it!=endit; ++it) if (!it->neighbor()) { - Dune::FieldVector<Scalar,dim> faceGlobal = it->geometry().center(); - unsigned int faceIndex = it->indexInInside(); problem_.boundaryTypes(bcType, *it); diff --git a/dumux/decoupled/2p/transport/fv/fvsaturation2p.hh b/dumux/decoupled/2p/transport/fv/fvsaturation2p.hh index 808d15cacb51fb44f48b0bf1b5ab6e1142c6aaa1..1fe13e1d4737e12f5d242f3c67ef7b9492aae968 100644 --- a/dumux/decoupled/2p/transport/fv/fvsaturation2p.hh +++ b/dumux/decoupled/2p/transport/fv/fvsaturation2p.hh @@ -298,7 +298,7 @@ int FVSaturation2P<TypeTag>::update(const Scalar t, Scalar& dt, updateVec = 0; // some phase properties - //Dune::FieldVector<Scalar, dimWorld> gravity = problem_.gravity(); + //const GlobalPosition& gravity = problem_.gravity(); BoundaryTypes bcType; @@ -314,7 +314,7 @@ int FVSaturation2P<TypeTag>::update(const Scalar t, Scalar& dt, } #endif // - GlobalPosition globalPos = eIt->geometry().center(); + const GlobalPosition& globalPos = eIt->geometry().center(); // cell volume, assume linear map here Scalar volume = eIt->geometry().volume(); @@ -347,8 +347,7 @@ int FVSaturation2P<TypeTag>::update(const Scalar t, Scalar& dt, // local number of facet int isIndex = isIt->indexInInside(); - Dune::FieldVector<Scalar, dimWorld> unitOuterNormal = - isIt->centerUnitOuterNormal(); + GlobalPosition unitOuterNormal = isIt->centerUnitOuterNormal(); if (switchNormals_) unitOuterNormal *= -1.0; @@ -369,8 +368,7 @@ int FVSaturation2P<TypeTag>::update(const Scalar t, Scalar& dt, neighborPointer->geometry().center(); // distance vector between barycenters - Dune::FieldVector<Scalar, dimWorld> distVec = globalPosNeighbor - - globalPos; + GlobalPosition distVec = globalPosNeighbor - globalPos; // compute distance between cell centers Scalar dist = distVec.two_norm(); @@ -474,8 +472,7 @@ int FVSaturation2P<TypeTag>::update(const Scalar t, Scalar& dt, globalIdxJ); // calculate the saturation gradient - Dune::FieldVector<Scalar, dimWorld> pcGradient = - unitOuterNormal; + GlobalPosition pcGradient = unitOuterNormal; pcGradient *= (pcI - pcJ) / dist; // get the diffusive part @@ -559,11 +556,10 @@ int FVSaturation2P<TypeTag>::update(const Scalar t, Scalar& dt, PrimaryVariables boundValues(0.0); // center of face in global coordinates - GlobalPosition globalPosFace = isIt->geometry().center(); + const GlobalPosition& globalPosFace = isIt->geometry().center(); // distance vector between barycenters - Dune::FieldVector<Scalar, dimWorld> distVec = globalPosFace - - globalPos; + GlobalPosition distVec = globalPosFace - globalPos; // compute distance between cell centers Scalar dist = distVec.two_norm(); @@ -708,8 +704,7 @@ int FVSaturation2P<TypeTag>::update(const Scalar t, Scalar& dt, globalIdxI); // calculate the saturation gradient - Dune::FieldVector<Scalar, dimWorld> pcGradient = - unitOuterNormal; + GlobalPosition pcGradient = unitOuterNormal; pcGradient *= (pcI - pcBound) / dist; // get the diffusive part -> give 1-sat because sat = S_n and lambda = lambda(S_w) and pc = pc(S_w) @@ -1038,9 +1033,6 @@ void FVSaturation2P<TypeTag>::initialize() for (ElementIterator eIt = problem_.gridView().template begin<0> (); eIt != eItEnd; ++eIt) { - // get global coordinate of cell center - GlobalPosition globalPos = eIt->geometry().center(); - PrimaryVariables initSol(0.0); problem_.initial(initSol, *eIt); // initialize cell concentration @@ -1063,9 +1055,6 @@ void FVSaturation2P<TypeTag>::updateMaterialLaws( for (ElementIterator eIt = problem_.gridView().template begin<0> (); eIt != eItEnd; ++eIt) { - // get global coordinate of cell center - GlobalPosition globalPos = eIt->geometry().center(); - int globalIdx = problem_.variables().index(*eIt); Scalar sat = 0; diff --git a/dumux/decoupled/2p/transport/fv/gravitypart.hh b/dumux/decoupled/2p/transport/fv/gravitypart.hh index 0095d1d1cfc5ba8fca8a49aba2bc8a3727c88f5f..588e662d7da7656ef4abed8681ceb4f07d49fc57 100644 --- a/dumux/decoupled/2p/transport/fv/gravitypart.hh +++ b/dumux/decoupled/2p/transport/fv/gravitypart.hh @@ -86,9 +86,6 @@ public: */ FieldVector operator() (const Element& element, const int indexInInside, const Scalar satI, const Scalar satJ) const { - // get global coordinate of cell center - const GlobalPosition& globalPos = element.geometry().center(); - Scalar temperature = problem_.temperature(element); Scalar referencePressure = problem_.referencePressure(element); FluidState fluidState; @@ -145,9 +142,6 @@ public: int globalIdxJ = problem_.variables().index(*neighborPointer); - // neighbor cell center in global coordinates - const GlobalPosition& globalPosNeighbor = neighborPointer->geometry().center(); - // get permeability problem_.spatialParameters().meanK(meanPermeability, problem_.spatialParameters().intrinsicPermeability(element), diff --git a/dumux/decoupled/2p2c/fvpressure2p2c.hh b/dumux/decoupled/2p2c/fvpressure2p2c.hh index 7176db38cbbd21a7162280a6c2193f5928967801..e05f0746371dfb7116a8e4a192e6ae619cda6eb3 100644 --- a/dumux/decoupled/2p2c/fvpressure2p2c.hh +++ b/dumux/decoupled/2p2c/fvpressure2p2c.hh @@ -1071,7 +1071,7 @@ void FVPressure2P2C<TypeTag>::initialMaterialLaws(bool compositional) // iterate through leaf grid an evaluate c0 at cell center ElementIterator eItEnd = problem_.gridView().template end<0>(); ElementIterator eIt = problem_.gridView().template begin<0>(); - for (ElementIterator eIt = problem_.gridView().template begin<0> (); eIt != eItEnd; ++eIt) + for (; eIt != eItEnd; ++eIt) { // get global coordinate of cell center GlobalPosition globalPos = eIt->geometry().center(); diff --git a/dumux/decoupled/2p2c/fvpressure2p2cmultiphysics.hh b/dumux/decoupled/2p2c/fvpressure2p2cmultiphysics.hh index f19bdf41afb8760f990dd46f04fe6669d7ae6f33..9dd05396a1434695e14e6a6ecc5ab90522b6743c 100644 --- a/dumux/decoupled/2p2c/fvpressure2p2cmultiphysics.hh +++ b/dumux/decoupled/2p2c/fvpressure2p2cmultiphysics.hh @@ -307,7 +307,6 @@ void FVPressure2P2CMultiPhysics<TypeTag>::assemble(bool first) // gemotry info of neighbor const typename ElementIterator::Entity::Geometry &geoNeighbor = neighborPointer->geometry(); - Dune::GeometryType neighborGT = geoNeighbor.type(); const GlobalPosition& globalPosNeighbor = geoNeighbor.center(); // distance vector between barycenters diff --git a/dumux/decoupled/2p2c/fvtransport2p2cmultiphysics.hh b/dumux/decoupled/2p2c/fvtransport2p2cmultiphysics.hh index a3951a6e01b1278232abef31ba0c15da6199f7c4..47b2ec82b5df180b40db6b8f3ff30f7d2d9558d4 100644 --- a/dumux/decoupled/2p2c/fvtransport2p2cmultiphysics.hh +++ b/dumux/decoupled/2p2c/fvtransport2p2cmultiphysics.hh @@ -172,7 +172,6 @@ void FVTransport2P2CMultiPhysics<TypeTag>::update(const Scalar t, Scalar& dt, Tr { // cell geometry type const typename ElementIterator::Entity::Geometry &entityGeo = eIt->geometry(); - Dune::GeometryType gt = entityGeo.type(); // get position GlobalPosition globalPos = entityGeo.center(); @@ -227,7 +226,6 @@ void FVTransport2P2CMultiPhysics<TypeTag>::update(const Scalar t, Scalar& dt, Tr // compute factor in neighbor const typename ElementIterator::Entity::Geometry &entityGeo = eIt->geometry(); - Dune::GeometryType neighborGT = neighborPointer->geometry().type(); // cell center in global coordinates const GlobalPosition& globalPos = entityGeo.center();