diff --git a/exercises/exercise-basic/2p2cmain.cc b/exercises/exercise-basic/2p2cmain.cc index a5b2abac2b4f7c2586064d38b09f70e4397316b4..68c0a3ee2f54218f182a0a36de2245772f3fff10 100644 --- a/exercises/exercise-basic/2p2cmain.cc +++ b/exercises/exercise-basic/2p2cmain.cc @@ -81,7 +81,7 @@ int main(int argc, char** argv) try const auto& leafGridView = gridManager.grid().leafGridView(); // create the finite volume grid geometry - using FVGridGeometry = GetPropType<TypeTag, Properties::FVGridGeometry>; + using FVGridGeometry = GetPropType<TypeTag, Properties::GridGeometry>; auto fvGridGeometry = std::make_shared<FVGridGeometry>(leafGridView); fvGridGeometry->update(); diff --git a/exercises/exercise-basic/2pmain.cc b/exercises/exercise-basic/2pmain.cc index d539ab3af69d10a41fbfd3f1409199de53d7fe6c..a00ad7ad047c2172cbc07355eacf8e467f1197b5 100644 --- a/exercises/exercise-basic/2pmain.cc +++ b/exercises/exercise-basic/2pmain.cc @@ -81,7 +81,7 @@ int main(int argc, char** argv) try const auto& leafGridView = gridManager.grid().leafGridView(); // create the finite volume grid geometry - using FVGridGeometry = GetPropType<TypeTag, Properties::FVGridGeometry>; + using FVGridGeometry = GetPropType<TypeTag, Properties::GridGeometry>; auto fvGridGeometry = std::make_shared<FVGridGeometry>(leafGridView); fvGridGeometry->update(); diff --git a/exercises/exercise-basic/injection2p2cproblem.hh b/exercises/exercise-basic/injection2p2cproblem.hh index 16fc3b2410c46203648b3d01568f0ab36697a290..970b1aa13e0b67cb1a1a790ce8e76337173d50b3 100644 --- a/exercises/exercise-basic/injection2p2cproblem.hh +++ b/exercises/exercise-basic/injection2p2cproblem.hh @@ -59,7 +59,7 @@ template<class TypeTag> struct SpatialParams<TypeTag, TTag::Injection2p2c> { private: - using FVGridGeometry = GetPropType<TypeTag, Properties::FVGridGeometry>; + using FVGridGeometry = GetPropType<TypeTag, Properties::GridGeometry>; using Scalar = GetPropType<TypeTag, Properties::Scalar>; public: using type = InjectionSpatialParams<FVGridGeometry, Scalar>; @@ -104,8 +104,8 @@ class Injection2p2cProblem : public PorousMediumFlowProblem<TypeTag> using Indices = typename GetPropType<TypeTag, Properties::ModelTraits>::Indices; using PrimaryVariables = GetPropType<TypeTag, Properties::PrimaryVariables>; using BoundaryTypes = GetPropType<TypeTag, Properties::BoundaryTypes>; - using FVGridGeometry = GetPropType<TypeTag, Properties::FVGridGeometry>; - using FVElementGeometry = typename GetPropType<TypeTag, Properties::FVGridGeometry>::LocalView; + using FVGridGeometry = GetPropType<TypeTag, Properties::GridGeometry>; + using FVElementGeometry = typename GetPropType<TypeTag, Properties::GridGeometry>::LocalView; using FluidSystem = GetPropType<TypeTag, Properties::FluidSystem>; using NumEqVector = GetPropType<TypeTag, Properties::NumEqVector>; @@ -204,7 +204,7 @@ public: // if we are inside the injection zone set inflow Neumann boundary conditions if (time_ < injectionDuration_ - && globalPos[1] < 15 + eps_ && globalPos[1] > 7 - eps_ && globalPos[0] > 0.9*this->fvGridGeometry().bBoxMax()[0]) + && globalPos[1] < 15 + eps_ && globalPos[1] > 7 - eps_ && globalPos[0] > 0.9*this->gridGeometry().bBoxMax()[0]) { // TODO: dumux-course-task //instead of setting -1e-4 here directly use totalAreaSpecificInflow_ in the computation diff --git a/exercises/exercise-basic/injection2pniproblem.hh b/exercises/exercise-basic/injection2pniproblem.hh index f8b6ee1267ec397955a67bbef776e1eb5fc904d3..f6cc0c82da167277c9989e0a471a4a8bc4ac1b8a 100644 --- a/exercises/exercise-basic/injection2pniproblem.hh +++ b/exercises/exercise-basic/injection2pniproblem.hh @@ -65,7 +65,7 @@ template<class TypeTag> struct SpatialParams<TypeTag, TTag::Injection2pNITypeTag> { private: - using FVGridGeometry = GetPropType<TypeTag, Properties::FVGridGeometry>; + using FVGridGeometry = GetPropType<TypeTag, Properties::GridGeometry>; using Scalar = GetPropType<TypeTag, Properties::Scalar>; public: using type = InjectionSpatialParams<FVGridGeometry, Scalar>; @@ -110,8 +110,8 @@ class Injection2PNIProblem : public PorousMediumFlowProblem<TypeTag> using Indices = typename GetPropType<TypeTag, Properties::ModelTraits>::Indices; using PrimaryVariables = GetPropType<TypeTag, Properties::PrimaryVariables>; using BoundaryTypes = GetPropType<TypeTag, Properties::BoundaryTypes>; - using FVGridGeometry = GetPropType<TypeTag, Properties::FVGridGeometry>; - using FVElementGeometry = typename GetPropType<TypeTag, Properties::FVGridGeometry>::LocalView; + using FVGridGeometry = GetPropType<TypeTag, Properties::GridGeometry>; + using FVElementGeometry = typename GetPropType<TypeTag, Properties::GridGeometry>::LocalView; using FluidSystem = GetPropType<TypeTag, Properties::FluidSystem>; using NumEqVector = GetPropType<TypeTag, Properties::NumEqVector>; @@ -202,7 +202,7 @@ public: // if we are inside the injection zone set inflow Neumann boundary conditions if (time_ < injectionDuration_ - && globalPos[1] < 15 + eps_ && globalPos[1] > 7 - eps_ && globalPos[0] > 0.9*this->fvGridGeometry().bBoxMax()[0]) + && globalPos[1] < 15 + eps_ && globalPos[1] > 7 - eps_ && globalPos[0] > 0.9*this->gridGeometry().bBoxMax()[0]) { // inject nitrogen. negative values mean injection // units kg/(s*m^2) diff --git a/exercises/exercise-basic/injection2pproblem.hh b/exercises/exercise-basic/injection2pproblem.hh index e20e85c8ce34689d2f88d9db145af99b50d33949..1b7c1823e2acf5b7b3a6fd497a490e2c69601606 100644 --- a/exercises/exercise-basic/injection2pproblem.hh +++ b/exercises/exercise-basic/injection2pproblem.hh @@ -61,7 +61,7 @@ template<class TypeTag> struct SpatialParams<TypeTag, TTag::Injection2p> { private: - using FVGridGeometry = GetPropType<TypeTag, Properties::FVGridGeometry>; + using FVGridGeometry = GetPropType<TypeTag, Properties::GridGeometry>; using Scalar = GetPropType<TypeTag, Properties::Scalar>; public: using type = InjectionSpatialParams<FVGridGeometry, Scalar>; @@ -102,8 +102,8 @@ class Injection2PProblem : public PorousMediumFlowProblem<TypeTag> using Indices = typename GetPropType<TypeTag, Properties::ModelTraits>::Indices; using PrimaryVariables = GetPropType<TypeTag, Properties::PrimaryVariables>; using BoundaryTypes = GetPropType<TypeTag, Properties::BoundaryTypes>; - using FVGridGeometry = GetPropType<TypeTag, Properties::FVGridGeometry>; - using FVElementGeometry = typename GetPropType<TypeTag, Properties::FVGridGeometry>::LocalView; + using FVGridGeometry = GetPropType<TypeTag, Properties::GridGeometry>; + using FVElementGeometry = typename GetPropType<TypeTag, Properties::GridGeometry>::LocalView; using FluidSystem = GetPropType<TypeTag, Properties::FluidSystem>; using NumEqVector = GetPropType<TypeTag, Properties::NumEqVector>; @@ -206,7 +206,7 @@ public: // using < boundary + eps_ or > boundary - eps_ is safer for floating point comparisons // than using <= or >= as it is robust with regard to imprecision introduced by rounding errors. if (time_ < injectionDuration_ - && globalPos[1] < 15 + eps_ && globalPos[1] > 7 - eps_ && globalPos[0] > 0.9*this->fvGridGeometry().bBoxMax()[0]) + && globalPos[1] < 15 + eps_ && globalPos[1] > 7 - eps_ && globalPos[0] > 0.9*this->gridGeometry().bBoxMax()[0]) { // inject nitrogen. negative values mean injection // units kg/(s*m^2) diff --git a/exercises/exercise-biomineralization/biominproblem.hh b/exercises/exercise-biomineralization/biominproblem.hh index 7eed331b0b6ec1696a812a07a6e120ec641fca18..46ac8f91ab91ffde882e94cc025428dacc4382c0 100644 --- a/exercises/exercise-biomineralization/biominproblem.hh +++ b/exercises/exercise-biomineralization/biominproblem.hh @@ -91,7 +91,7 @@ struct SpatialParams<TypeTag, TTag::ExerciseFourBioMin> { using MT = GetPropType<TypeTag, ModelTraits>; static constexpr int numFluidComps = MT::numFluidComponents(); static constexpr int numActiveSolidComps = MT::numSolidComps() - MT::numInertSolidComps(); - using type = BioMinSpatialparams<GetPropType<TypeTag, FVGridGeometry>, GetPropType<TypeTag, Scalar>, numFluidComps, numActiveSolidComps>; + using type = BioMinSpatialparams<GetPropType<TypeTag, GridGeometry>, GetPropType<TypeTag, Scalar>, numFluidComps, numActiveSolidComps>; }; template<class TypeTag> @@ -118,8 +118,8 @@ class BioMinProblem : public PorousMediumFlowProblem<TypeTag> using PrimaryVariables = GetPropType<TypeTag, Properties::PrimaryVariables>; using BoundaryTypes = GetPropType<TypeTag, Properties::BoundaryTypes>; using VolumeVariables = GetPropType<TypeTag, Properties::VolumeVariables>; - using FVGridGeometry = GetPropType<TypeTag, Properties::FVGridGeometry>; - using FVElementGeometry = typename GetPropType<TypeTag, Properties::FVGridGeometry>::LocalView; + using FVGridGeometry = GetPropType<TypeTag, Properties::GridGeometry>; + using FVElementGeometry = typename GetPropType<TypeTag, Properties::GridGeometry>::LocalView; // Grid dimension enum @@ -182,7 +182,7 @@ public: concCa_ = getParam<Scalar>("Injection.ConcCa"); concUrea_ = getParam<Scalar>("Injection.ConcUrea"); - unsigned int codim = GetPropType<TypeTag, Properties::FVGridGeometry>::discMethod == DiscretizationMethod::box ? dim : 0; + unsigned int codim = GetPropType<TypeTag, Properties::GridGeometry>::discMethod == DiscretizationMethod::box ? dim : 0; Kxx_.resize(fvGridGeometry->gridView().size(codim)); Kyy_.resize(fvGridGeometry->gridView().size(codim)); @@ -238,7 +238,7 @@ public: BoundaryTypes bcTypes; // we don't set any BCs for the solid phases - Scalar xmax = this->fvGridGeometry().bBoxMax()[0]; + Scalar xmax = this->gridGeometry().bBoxMax()[0]; // set all Neumann bcTypes.setAllNeumann(); @@ -313,7 +313,7 @@ public: PrimaryVariables priVars(0.0); priVars.setState(liquidPhaseOnly); - Scalar hmax = this->fvGridGeometry().bBoxMax()[1]; + Scalar hmax = this->gridGeometry().bBoxMax()[1]; priVars[pressureIdx] = initPressure_ - (globalPos[1] - hmax)*densityW_*9.81; priVars[switchIdx] = 0.0; priVars[CaIdx] = 0.0; @@ -381,11 +381,11 @@ public: */ void updateVtkOutput(const SolutionVector& curSol) { - for (const auto& element : elements(this->fvGridGeometry().gridView())) + for (const auto& element : elements(this->gridGeometry().gridView())) { - const auto elemSol = elementSolution(element, curSol, this->fvGridGeometry()); + const auto elemSol = elementSolution(element, curSol, this->gridGeometry()); - auto fvGeometry = localView(this->fvGridGeometry()); + auto fvGeometry = localView(this->gridGeometry()); fvGeometry.bindElement(element); for (auto&& scv : scvs(fvGeometry)) diff --git a/exercises/exercise-biomineralization/biominspatialparams.hh b/exercises/exercise-biomineralization/biominspatialparams.hh index 3815f373ea76d1647d6d836ec1c2b225c4ef8178..2c901dc9379771d5e15dccf17763305d571448e4 100644 --- a/exercises/exercise-biomineralization/biominspatialparams.hh +++ b/exercises/exercise-biomineralization/biominspatialparams.hh @@ -119,7 +119,7 @@ public: Scalar referencePorosity(const Element& element, const SubControlVolume &scv) const { - const auto eIdx = this->fvGridGeometry().elementMapper().index(element); + const auto eIdx = this->gridGeometry().elementMapper().index(element); return referencePorosity_[eIdx][scv.indexInElement()]; } @@ -148,7 +148,7 @@ public: auto fvGeometry = localView(fvGridGeometry); fvGeometry.bindElement(element); - const auto eIdx = this->fvGridGeometry().elementMapper().index(element); + const auto eIdx = this->gridGeometry().elementMapper().index(element); auto elemSol = elementSolution(element, sol, fvGridGeometry); referencePorosity_[eIdx].resize(fvGeometry.numScv()); @@ -189,7 +189,7 @@ public: PermeabilityType referencePermeability(const Element& element, const SubControlVolume &scv) const { - const auto eIdx = this->fvGridGeometry().elementMapper().index(element); + const auto eIdx = this->gridGeometry().elementMapper().index(element); return referencePermeability_[eIdx][scv.indexInElement()]; } @@ -220,7 +220,7 @@ public: auto fvGeometry = localView(fvGridGeometry); fvGeometry.bindElement(element); - const auto eIdx = this->fvGridGeometry().elementMapper().index(element); + const auto eIdx = this->gridGeometry().elementMapper().index(element); auto elemSol = elementSolution(element, sol, fvGridGeometry); referencePermeability_[eIdx].resize(fvGeometry.numScv()); diff --git a/exercises/exercise-biomineralization/main.cc b/exercises/exercise-biomineralization/main.cc index f6da4fd801db9588687345cf3bb9a30b49c96054..c9b3513bc866bc86dbd976f4f40c5f952b43b846 100644 --- a/exercises/exercise-biomineralization/main.cc +++ b/exercises/exercise-biomineralization/main.cc @@ -83,7 +83,7 @@ int main(int argc, char** argv) try const auto& leafGridView = gridManager.grid().leafGridView(); // create the finite volume grid geometry - using FVGridGeometry = GetPropType<TypeTag, Properties::FVGridGeometry>; + using FVGridGeometry = GetPropType<TypeTag, Properties::GridGeometry>; auto fvGridGeometry = std::make_shared<FVGridGeometry>(leafGridView); fvGridGeometry->update(); diff --git a/exercises/exercise-coupling-ff-pm/interface/freeflowsubproblem.hh b/exercises/exercise-coupling-ff-pm/interface/freeflowsubproblem.hh index 58670a5fe4c4eb6856c23ac2371623617569ea92..85864cd1ff0436bf9636c9a89b82e30ce5adb74a 100644 --- a/exercises/exercise-coupling-ff-pm/interface/freeflowsubproblem.hh +++ b/exercises/exercise-coupling-ff-pm/interface/freeflowsubproblem.hh @@ -100,7 +100,7 @@ class FreeFlowSubProblem : public NavierStokesProblem<TypeTag> using BoundaryTypes = GetPropType<TypeTag, Properties::BoundaryTypes>; - using FVGridGeometry = GetPropType<TypeTag, Properties::FVGridGeometry>; + using FVGridGeometry = GetPropType<TypeTag, Properties::GridGeometry>; using FVElementGeometry = typename FVGridGeometry::LocalView; using SubControlVolumeFace = typename FVElementGeometry::SubControlVolumeFace; using Element = typename GridView::template Codim<0>::Entity; @@ -250,7 +250,7 @@ public: PrimaryVariables initialAtPos(const GlobalPosition &globalPos) const { PrimaryVariables values(0.0); - values[Indices::velocityYIdx] = -1e-6 * globalPos[0] * (this->fvGridGeometry().bBoxMax()[0] - globalPos[0]); + values[Indices::velocityYIdx] = -1e-6 * globalPos[0] * (this->gridGeometry().bBoxMax()[0] - globalPos[0]); return values; } @@ -276,22 +276,22 @@ public: */ void calculateAnalyticalVelocityX() const { - analyticalVelocityX_.resize(this->fvGridGeometry().gridView().size(0)); + analyticalVelocityX_.resize(this->gridGeometry().gridView().size(0)); using std::sqrt; - const Scalar dPdX = -deltaP_ / (this->fvGridGeometry().bBoxMax()[0] - this->fvGridGeometry().bBoxMin()[0]); + const Scalar dPdX = -deltaP_ / (this->gridGeometry().bBoxMax()[0] - this->gridGeometry().bBoxMin()[0]); static const Scalar mu = FluidSystem::viscosity(temperature(), 1e5); static const Scalar alpha = getParam<Scalar>("Darcy.SpatialParams.AlphaBeaversJoseph"); static const Scalar K = getParam<Scalar>("Darcy.SpatialParams.Permeability"); static const Scalar sqrtK = sqrt(K); - const Scalar sigma = (this->fvGridGeometry().bBoxMax()[1] - this->fvGridGeometry().bBoxMin()[1])/sqrtK; + const Scalar sigma = (this->gridGeometry().bBoxMax()[1] - this->gridGeometry().bBoxMin()[1])/sqrtK; const Scalar uB = -K/(2.0*mu) * ((sigma*sigma + 2.0*alpha*sigma) / (1.0 + alpha*sigma)) * dPdX; - for (const auto& element : elements(this->fvGridGeometry().gridView())) + for (const auto& element : elements(this->gridGeometry().gridView())) { - const auto eIdx = this->fvGridGeometry().gridView().indexSet().index(element); - const Scalar y = element.geometry().center()[1] - this->fvGridGeometry().bBoxMin()[1]; + const auto eIdx = this->gridGeometry().gridView().indexSet().index(element); + const Scalar y = element.geometry().center()[1] - this->gridGeometry().bBoxMin()[1]; const Scalar u = uB*(1.0 + alpha/sqrtK*y) + 1.0/(2.0*mu) * (y*y + 2*alpha*y*sqrtK) * dPdX; analyticalVelocityX_[eIdx] = u; @@ -312,16 +312,16 @@ public: private: bool onLeftBoundary_(const GlobalPosition &globalPos) const - { return globalPos[0] < this->fvGridGeometry().bBoxMin()[0] + eps_; } + { return globalPos[0] < this->gridGeometry().bBoxMin()[0] + eps_; } bool onRightBoundary_(const GlobalPosition &globalPos) const - { return globalPos[0] > this->fvGridGeometry().bBoxMax()[0] - eps_; } + { return globalPos[0] > this->gridGeometry().bBoxMax()[0] - eps_; } bool onLowerBoundary_(const GlobalPosition &globalPos) const - { return globalPos[1] < this->fvGridGeometry().bBoxMin()[1] + eps_; } + { return globalPos[1] < this->gridGeometry().bBoxMin()[1] + eps_; } bool onUpperBoundary_(const GlobalPosition &globalPos) const - { return globalPos[1] > this->fvGridGeometry().bBoxMax()[1] - eps_; } + { return globalPos[1] > this->gridGeometry().bBoxMax()[1] - eps_; } Scalar eps_; Scalar deltaP_; diff --git a/exercises/exercise-coupling-ff-pm/interface/main.cc b/exercises/exercise-coupling-ff-pm/interface/main.cc index d94b7a614d0e41becb7741b1e525dfefa1fd6b3f..1e3b4908a8cd614688286c700fba830a8281e401 100644 --- a/exercises/exercise-coupling-ff-pm/interface/main.cc +++ b/exercises/exercise-coupling-ff-pm/interface/main.cc @@ -157,10 +157,10 @@ int main(int argc, char** argv) try // create the finite volume grid geometry - using StokesFVGridGeometry = GetPropType<StokesTypeTag, Properties::FVGridGeometry>; + using StokesFVGridGeometry = GetPropType<StokesTypeTag, Properties::GridGeometry>; auto stokesFvGridGeometry = std::make_shared<StokesFVGridGeometry>(stokesGridView); stokesFvGridGeometry->update(); - using DarcyFVGridGeometry = GetPropType<DarcyTypeTag, Properties::FVGridGeometry>; + using DarcyFVGridGeometry = GetPropType<DarcyTypeTag, Properties::GridGeometry>; auto darcyFvGridGeometry = std::make_shared<DarcyFVGridGeometry>(darcyGridView); darcyFvGridGeometry->update(); diff --git a/exercises/exercise-coupling-ff-pm/interface/porousmediumsubproblem.hh b/exercises/exercise-coupling-ff-pm/interface/porousmediumsubproblem.hh index 8ef6d1827db8b382dddfc8d320055770f7052816..848178a05bccf34f73d0679ce7cdec9b4feb1dcb 100644 --- a/exercises/exercise-coupling-ff-pm/interface/porousmediumsubproblem.hh +++ b/exercises/exercise-coupling-ff-pm/interface/porousmediumsubproblem.hh @@ -82,7 +82,7 @@ struct Grid<TypeTag, TTag::DarcyOneP> template<class TypeTag> struct SpatialParams<TypeTag, TTag::DarcyOneP> { - using type = OnePSpatialParams<GetPropType<TypeTag, FVGridGeometry>, GetPropType<TypeTag, Scalar>>; + using type = OnePSpatialParams<GetPropType<TypeTag, GridGeometry>, GetPropType<TypeTag, Scalar>>; }; } // end namespace Properties @@ -100,10 +100,10 @@ class PorousMediumSubProblem : public PorousMediumFlowProblem<TypeTag> using NumEqVector = GetPropType<TypeTag, Properties::NumEqVector>; using BoundaryTypes = GetPropType<TypeTag, Properties::BoundaryTypes>; using VolumeVariables = GetPropType<TypeTag, Properties::VolumeVariables>; - using FVElementGeometry = typename GetPropType<TypeTag, Properties::FVGridGeometry>::LocalView; + using FVElementGeometry = typename GetPropType<TypeTag, Properties::GridGeometry>::LocalView; using SubControlVolume = typename FVElementGeometry::SubControlVolume; using SubControlVolumeFace = typename FVElementGeometry::SubControlVolumeFace; - using FVGridGeometry = GetPropType<TypeTag, Properties::FVGridGeometry>; + using FVGridGeometry = GetPropType<TypeTag, Properties::GridGeometry>; using GridVariables = GetPropType<TypeTag, Properties::GridVariables>; using ElementFluxVariablesCache = typename GridVariables::GridFluxVariablesCache::LocalView; @@ -256,16 +256,16 @@ public: private: bool onLeftBoundary_(const GlobalPosition &globalPos) const - { return globalPos[0] < this->fvGridGeometry().bBoxMin()[0] + eps_; } + { return globalPos[0] < this->gridGeometry().bBoxMin()[0] + eps_; } bool onRightBoundary_(const GlobalPosition &globalPos) const - { return globalPos[0] > this->fvGridGeometry().bBoxMax()[0] - eps_; } + { return globalPos[0] > this->gridGeometry().bBoxMax()[0] - eps_; } bool onLowerBoundary_(const GlobalPosition &globalPos) const - { return globalPos[1] < this->fvGridGeometry().bBoxMin()[1] + eps_; } + { return globalPos[1] < this->gridGeometry().bBoxMin()[1] + eps_; } bool onUpperBoundary_(const GlobalPosition &globalPos) const - { return globalPos[1] > this->fvGridGeometry().bBoxMax()[1] - eps_; } + { return globalPos[1] > this->gridGeometry().bBoxMax()[1] - eps_; } Scalar eps_; std::shared_ptr<CouplingManager> couplingManager_; diff --git a/exercises/exercise-coupling-ff-pm/models/freeflowsubproblem.hh b/exercises/exercise-coupling-ff-pm/models/freeflowsubproblem.hh index bf883a3377a9f78c658f79a38ce1851bf6d7eb65..952c9b8841146be82ecc85f4fe3afcf6f6f178b6 100644 --- a/exercises/exercise-coupling-ff-pm/models/freeflowsubproblem.hh +++ b/exercises/exercise-coupling-ff-pm/models/freeflowsubproblem.hh @@ -94,7 +94,7 @@ class FreeFlowSubProblem : public NavierStokesProblem<TypeTag> using Indices = typename GetPropType<TypeTag, Properties::ModelTraits>::Indices; using BoundaryTypes = GetPropType<TypeTag, Properties::BoundaryTypes>; - using FVGridGeometry = GetPropType<TypeTag, Properties::FVGridGeometry>; + using FVGridGeometry = GetPropType<TypeTag, Properties::GridGeometry>; using FVElementGeometry = typename FVGridGeometry::LocalView; using SubControlVolumeFace = typename FVElementGeometry::SubControlVolumeFace; using Element = typename GridView::template Codim<0>::Entity; @@ -268,13 +268,13 @@ public: FluidState fluidState; updateFluidStateForBC_(fluidState, pressure_); const Scalar density = FluidSystem::density(fluidState, 0); - values[Indices::pressureIdx] = pressure_ - density*this->gravity()[1]*(this->fvGridGeometry().bBoxMax()[1] - globalPos[1]); + values[Indices::pressureIdx] = pressure_ - density*this->gravity()[1]*(this->gridGeometry().bBoxMax()[1] - globalPos[1]); // gravity has negative sign values[Indices::conti0EqIdx + 1] = moleFraction_; - values[Indices::velocityXIdx] = 4.0 * velocity_ * (globalPos[1] - this->fvGridGeometry().bBoxMin()[1]) - * (this->fvGridGeometry().bBoxMax()[1] - globalPos[1]) + values[Indices::velocityXIdx] = 4.0 * velocity_ * (globalPos[1] - this->gridGeometry().bBoxMin()[1]) + * (this->gridGeometry().bBoxMax()[1] - globalPos[1]) / (height_() * height_()); return values; @@ -303,16 +303,16 @@ public: private: bool onLeftBoundary_(const GlobalPosition &globalPos) const - { return globalPos[0] < this->fvGridGeometry().bBoxMin()[0] + eps_; } + { return globalPos[0] < this->gridGeometry().bBoxMin()[0] + eps_; } bool onRightBoundary_(const GlobalPosition &globalPos) const - { return globalPos[0] > this->fvGridGeometry().bBoxMax()[0] - eps_; } + { return globalPos[0] > this->gridGeometry().bBoxMax()[0] - eps_; } bool onLowerBoundary_(const GlobalPosition &globalPos) const - { return globalPos[1] < this->fvGridGeometry().bBoxMin()[1] + eps_; } + { return globalPos[1] < this->gridGeometry().bBoxMin()[1] + eps_; } bool onUpperBoundary_(const GlobalPosition &globalPos) const - { return globalPos[1] > this->fvGridGeometry().bBoxMax()[1] - eps_; } + { return globalPos[1] > this->gridGeometry().bBoxMax()[1] - eps_; } //! \brief updates the fluid state to obtain required quantities for IC/BC void updateFluidStateForBC_(FluidState& fluidState, const Scalar pressure) const @@ -337,7 +337,7 @@ private: } // the height of the free-flow domain const Scalar height_() const - { return this->fvGridGeometry().bBoxMax()[1] - this->fvGridGeometry().bBoxMin()[1]; } + { return this->gridGeometry().bBoxMax()[1] - this->gridGeometry().bBoxMin()[1]; } Scalar eps_; diff --git a/exercises/exercise-coupling-ff-pm/models/main.cc b/exercises/exercise-coupling-ff-pm/models/main.cc index 63aaf9b4d83eb694bc55fddd4f6a3328a77e7e9a..b5bd97a9ffdf3e6b34713203ade0db853ecce657 100644 --- a/exercises/exercise-coupling-ff-pm/models/main.cc +++ b/exercises/exercise-coupling-ff-pm/models/main.cc @@ -105,10 +105,10 @@ int main(int argc, char** argv) try const auto& stokesGridView = stokesGridManager.grid().leafGridView(); // create the finite volume grid geometry - using StokesFVGridGeometry = GetPropType<StokesTypeTag, Properties::FVGridGeometry>; + using StokesFVGridGeometry = GetPropType<StokesTypeTag, Properties::GridGeometry>; auto stokesFvGridGeometry = std::make_shared<StokesFVGridGeometry>(stokesGridView); stokesFvGridGeometry->update(); - using DarcyFVGridGeometry = GetPropType<DarcyTypeTag, Properties::FVGridGeometry>; + using DarcyFVGridGeometry = GetPropType<DarcyTypeTag, Properties::GridGeometry>; auto darcyFvGridGeometry = std::make_shared<DarcyFVGridGeometry>(darcyGridView); darcyFvGridGeometry->update(); diff --git a/exercises/exercise-coupling-ff-pm/models/porousmediumsubproblem.hh b/exercises/exercise-coupling-ff-pm/models/porousmediumsubproblem.hh index 6e35406425fa4c7408f57dbd2bdd0ad2c083595c..e4845cfb66aac5a61d114d56d10d035d3dd5f954 100644 --- a/exercises/exercise-coupling-ff-pm/models/porousmediumsubproblem.hh +++ b/exercises/exercise-coupling-ff-pm/models/porousmediumsubproblem.hh @@ -80,7 +80,7 @@ struct Grid<TypeTag, TTag::DarcyOnePNC> { using type = Dune::YaspGrid<2>; }; // Set the spatial paramaters type template<class TypeTag> struct SpatialParams<TypeTag, TTag::DarcyOnePNC> { - using type = OnePSpatialParams<GetPropType<TypeTag, FVGridGeometry>, GetPropType<TypeTag, Scalar>>; + using type = OnePSpatialParams<GetPropType<TypeTag, GridGeometry>, GetPropType<TypeTag, Scalar>>; }; } // end namespace Properties @@ -95,10 +95,10 @@ class PorousMediumSubProblem : public PorousMediumFlowProblem<TypeTag> using FluidSystem = GetPropType<TypeTag, Properties::FluidSystem>; using NumEqVector = GetPropType<TypeTag, Properties::NumEqVector>; using BoundaryTypes = GetPropType<TypeTag, Properties::BoundaryTypes>; - using FVElementGeometry = typename GetPropType<TypeTag, Properties::FVGridGeometry>::LocalView; + using FVElementGeometry = typename GetPropType<TypeTag, Properties::GridGeometry>::LocalView; using SubControlVolume = typename FVElementGeometry::SubControlVolume; using SubControlVolumeFace = typename FVElementGeometry::SubControlVolumeFace; - using FVGridGeometry = GetPropType<TypeTag, Properties::FVGridGeometry>; + using FVGridGeometry = GetPropType<TypeTag, Properties::GridGeometry>; using GridVariables = GetPropType<TypeTag, Properties::GridVariables>; using ElementFluxVariablesCache = typename GridVariables::GridFluxVariablesCache::LocalView; @@ -185,9 +185,9 @@ public: // compute the mass in the entire domain Scalar waterMass = 0.0; - for (const auto& element : elements(this->fvGridGeometry().gridView())) + for (const auto& element : elements(this->gridGeometry().gridView())) { - auto fvGeometry = localView(this->fvGridGeometry()); + auto fvGeometry = localView(this->gridGeometry()); fvGeometry.bindElement(element); auto elemVolVars = localView(gridVariables.curGridVolVars()); @@ -203,7 +203,7 @@ public: Scalar cumMassLoss = initialWaterContent_ - waterMass; Scalar evaporationRate = (lastWaterMass_ - waterMass) * 86400 - / (this->fvGridGeometry().bBoxMax()[0] - this->fvGridGeometry().bBoxMin()[0]) + / (this->gridGeometry().bBoxMax()[0] - this->gridGeometry().bBoxMin()[0]) / timeLoop_->timeStepSize(); lastWaterMass_ = waterMass; @@ -224,9 +224,9 @@ public: std::vector<Scalar> x; std::vector<Scalar> y; - for (const auto& element : elements(this->fvGridGeometry().gridView())) + for (const auto& element : elements(this->gridGeometry().gridView())) { - auto fvGeometry = localView(this->fvGridGeometry()); + auto fvGeometry = localView(this->gridGeometry()); fvGeometry.bindElement(element); auto elemVolVars = localView(gridVariables.curGridVolVars()); @@ -246,7 +246,7 @@ public: gnuplotInterfaceFluxes_.resetPlot(); gnuplotInterfaceFluxes_.setXlabel("x-position [m]"); - gnuplotInterfaceFluxes_.setXRange(this->fvGridGeometry().bBoxMin()[0], this->fvGridGeometry().bBoxMax()[0]); + gnuplotInterfaceFluxes_.setXRange(this->gridGeometry().bBoxMin()[0], this->gridGeometry().bBoxMax()[0]); gnuplotInterfaceFluxes_.setYlabel("flux [kg/(m^2 s)]"); gnuplotInterfaceFluxes_.setYRange(-5e-4, 0.0); gnuplotInterfaceFluxes_.setOption("set label 'time: " + std::to_string(timeLoop_->time()/86400.) + "d' at graph 0.8,0.8 "); @@ -375,16 +375,16 @@ public: private: bool onLeftBoundary_(const GlobalPosition &globalPos) const - { return globalPos[0] < this->fvGridGeometry().bBoxMin()[0] + eps_; } + { return globalPos[0] < this->gridGeometry().bBoxMin()[0] + eps_; } bool onRightBoundary_(const GlobalPosition &globalPos) const - { return globalPos[0] > this->fvGridGeometry().bBoxMax()[0] - eps_; } + { return globalPos[0] > this->gridGeometry().bBoxMax()[0] - eps_; } bool onLowerBoundary_(const GlobalPosition &globalPos) const - { return globalPos[1] < this->fvGridGeometry().bBoxMin()[1] + eps_; } + { return globalPos[1] < this->gridGeometry().bBoxMin()[1] + eps_; } bool onUpperBoundary_(const GlobalPosition &globalPos) const - { return globalPos[1] > this->fvGridGeometry().bBoxMax()[1] - eps_; } + { return globalPos[1] > this->gridGeometry().bBoxMax()[1] - eps_; } Scalar eps_; Scalar moleFraction_; diff --git a/exercises/exercise-coupling-ff-pm/turbulence/freeflowsubproblem.hh b/exercises/exercise-coupling-ff-pm/turbulence/freeflowsubproblem.hh index e6abb8e430d72f705f03bc7b19fa3a15032a2507..374f9db44e8ea0260fae8f4150abc42c3178f050 100644 --- a/exercises/exercise-coupling-ff-pm/turbulence/freeflowsubproblem.hh +++ b/exercises/exercise-coupling-ff-pm/turbulence/freeflowsubproblem.hh @@ -90,7 +90,7 @@ class FreeFlowSubProblem : public NavierStokesProblem<TypeTag> using Indices = typename GetPropType<TypeTag, Properties::ModelTraits>::Indices; using BoundaryTypes = GetPropType<TypeTag, Properties::BoundaryTypes>; - using FVGridGeometry = GetPropType<TypeTag, Properties::FVGridGeometry>; + using FVGridGeometry = GetPropType<TypeTag, Properties::GridGeometry>; using FVElementGeometry = typename FVGridGeometry::LocalView; using SubControlVolumeFace = typename FVElementGeometry::SubControlVolumeFace; using Element = typename GridView::template Codim<0>::Entity; @@ -280,7 +280,7 @@ public: const Scalar density = FluidSystem::density(fluidState, 0); PrimaryVariables values(0.0); - values[Indices::pressureIdx] = refPressure() + density*this->gravity()[1]*(globalPos[1] - this->fvGridGeometry().bBoxMin()[1]); + values[Indices::pressureIdx] = refPressure() + density*this->gravity()[1]*(globalPos[1] - this->gridGeometry().bBoxMin()[1]); values[Indices::conti0EqIdx + 1] = refMoleFrac(); values[Indices::velocityXIdx] = refVelocity(); values[Indices::temperatureIdx] = refTemperature(); @@ -331,16 +331,16 @@ public: private: bool onLeftBoundary_(const GlobalPosition &globalPos) const - { return globalPos[0] < this->fvGridGeometry().bBoxMin()[0] + eps_; } + { return globalPos[0] < this->gridGeometry().bBoxMin()[0] + eps_; } bool onRightBoundary_(const GlobalPosition &globalPos) const - { return globalPos[0] > this->fvGridGeometry().bBoxMax()[0] - eps_; } + { return globalPos[0] > this->gridGeometry().bBoxMax()[0] - eps_; } bool onLowerBoundary_(const GlobalPosition &globalPos) const - { return globalPos[1] < this->fvGridGeometry().bBoxMin()[1] + eps_; } + { return globalPos[1] < this->gridGeometry().bBoxMin()[1] + eps_; } bool onUpperBoundary_(const GlobalPosition &globalPos) const - { return globalPos[1] > this->fvGridGeometry().bBoxMax()[1] - eps_; } + { return globalPos[1] > this->gridGeometry().bBoxMax()[1] - eps_; } //! \brief updates the fluid state to obtain required quantities for IC/BC void updateFluidStateForBC_(FluidState& fluidState, const Scalar temperature, @@ -367,7 +367,7 @@ private: // the height of the free-flow domain const Scalar height_() const - { return this->fvGridGeometry().bBoxMax()[1] - this->fvGridGeometry().bBoxMin()[1]; } + { return this->gridGeometry().bBoxMax()[1] - this->gridGeometry().bBoxMin()[1]; } Scalar eps_; diff --git a/exercises/exercise-coupling-ff-pm/turbulence/main.cc b/exercises/exercise-coupling-ff-pm/turbulence/main.cc index 555feebca9370f26c279b8a08548c150039274bb..ac198a94997ca90e3fc799f7133ab2149932da47 100644 --- a/exercises/exercise-coupling-ff-pm/turbulence/main.cc +++ b/exercises/exercise-coupling-ff-pm/turbulence/main.cc @@ -105,10 +105,10 @@ int main(int argc, char** argv) try const auto& stokesGridView = stokesGridManager.grid().leafGridView(); // create the finite volume grid geometry - using StokesFVGridGeometry = GetPropType<StokesTypeTag, Properties::FVGridGeometry>; + using StokesFVGridGeometry = GetPropType<StokesTypeTag, Properties::GridGeometry>; auto stokesFvGridGeometry = std::make_shared<StokesFVGridGeometry>(stokesGridView); stokesFvGridGeometry->update(); - using DarcyFVGridGeometry = GetPropType<DarcyTypeTag, Properties::FVGridGeometry>; + using DarcyFVGridGeometry = GetPropType<DarcyTypeTag, Properties::GridGeometry>; auto darcyFvGridGeometry = std::make_shared<DarcyFVGridGeometry>(darcyGridView); darcyFvGridGeometry->update(); diff --git a/exercises/exercise-coupling-ff-pm/turbulence/porousmediumsubproblem.hh b/exercises/exercise-coupling-ff-pm/turbulence/porousmediumsubproblem.hh index 7b0ab9821c40d9f125e3ba1fc96e22d6d40fac75..dd44bac6e5ccffb2cfb8e712e9c1197c611acd35 100644 --- a/exercises/exercise-coupling-ff-pm/turbulence/porousmediumsubproblem.hh +++ b/exercises/exercise-coupling-ff-pm/turbulence/porousmediumsubproblem.hh @@ -73,7 +73,7 @@ struct UseMoles<TypeTag, TTag::DarcyTwoPTwoCNI> { static constexpr bool value = template<class TypeTag> struct SpatialParams<TypeTag, TTag::DarcyTwoPTwoCNI> { - using type = TwoPSpatialParams<GetPropType<TypeTag, FVGridGeometry>, GetPropType<TypeTag, Scalar>>; + using type = TwoPSpatialParams<GetPropType<TypeTag, GridGeometry>, GetPropType<TypeTag, Scalar>>; }; } // end namespace Properties @@ -91,10 +91,10 @@ class PorousMediumSubProblem : public PorousMediumFlowProblem<TypeTag> using NumEqVector = GetPropType<TypeTag, Properties::NumEqVector>; using BoundaryTypes = GetPropType<TypeTag, Properties::BoundaryTypes>; using VolumeVariables = GetPropType<TypeTag, Properties::VolumeVariables>; - using FVElementGeometry = typename GetPropType<TypeTag, Properties::FVGridGeometry>::LocalView; + using FVElementGeometry = typename GetPropType<TypeTag, Properties::GridGeometry>::LocalView; using SubControlVolume = typename FVElementGeometry::SubControlVolume; using SubControlVolumeFace = typename FVElementGeometry::SubControlVolumeFace; - using FVGridGeometry = GetPropType<TypeTag, Properties::FVGridGeometry>; + using FVGridGeometry = GetPropType<TypeTag, Properties::GridGeometry>; using ElementVolumeVariables = typename GetPropType<TypeTag, Properties::GridVolumeVariables>::LocalView; using GridVariables = GetPropType<TypeTag, Properties::GridVariables>; using ElementFluxVariablesCache = typename GridVariables::GridFluxVariablesCache::LocalView; @@ -149,9 +149,9 @@ public: Scalar massWater = 0.0; // bulk elements - for (const auto& element : elements(this->fvGridGeometry().gridView())) + for (const auto& element : elements(this->gridGeometry().gridView())) { - auto fvGeometry = localView(this->fvGridGeometry()); + auto fvGeometry = localView(this->gridGeometry()); fvGeometry.bindElement(element); auto elemVolVars = localView(gridVariables.curGridVolVars()); @@ -286,7 +286,7 @@ public: PrimaryVariables values(0.0); values.setState(initialPhasePresence_); - values[pressureIdx] = pressure_ + 1. * this->spatialParams().gravity(globalPos)[1] * (globalPos[1] - this->fvGridGeometry().bBoxMax()[1]); + values[pressureIdx] = pressure_ + 1. * this->spatialParams().gravity(globalPos)[1] * (globalPos[1] - this->gridGeometry().bBoxMax()[1]); values[switchIdx] = initialSw_; values[Indices::temperatureIdx] = temperature_; @@ -312,16 +312,16 @@ public: private: bool onLeftBoundary_(const GlobalPosition &globalPos) const - { return globalPos[0] < this->fvGridGeometry().bBoxMin()[0] + eps_; } + { return globalPos[0] < this->gridGeometry().bBoxMin()[0] + eps_; } bool onRightBoundary_(const GlobalPosition &globalPos) const - { return globalPos[0] > this->fvGridGeometry().bBoxMax()[0] - eps_; } + { return globalPos[0] > this->gridGeometry().bBoxMax()[0] - eps_; } bool onLowerBoundary_(const GlobalPosition &globalPos) const - { return globalPos[1] < this->fvGridGeometry().bBoxMin()[1] + eps_; } + { return globalPos[1] < this->gridGeometry().bBoxMin()[1] + eps_; } bool onUpperBoundary_(const GlobalPosition &globalPos) const - { return globalPos[1] > this->fvGridGeometry().bBoxMax()[1] - eps_; } + { return globalPos[1] > this->gridGeometry().bBoxMax()[1] - eps_; } Scalar pressure_; Scalar initialSw_; diff --git a/exercises/exercise-fluidsystem/2p2cproblem.hh b/exercises/exercise-fluidsystem/2p2cproblem.hh index e8aef797d6dd3d4cdccc664561cf2826d44868bb..3f39957caa4a5c26b6cf06078309ec2d5b5c190c 100644 --- a/exercises/exercise-fluidsystem/2p2cproblem.hh +++ b/exercises/exercise-fluidsystem/2p2cproblem.hh @@ -62,7 +62,7 @@ template<class TypeTag> struct SpatialParams<TypeTag, TTag::ExerciseFluidsystemTwoPTwoC> { private: - using FVGridGeometry = GetPropType<TypeTag, Properties::FVGridGeometry>; + using FVGridGeometry = GetPropType<TypeTag, Properties::GridGeometry>; using Scalar = GetPropType<TypeTag, Properties::Scalar>; public: using type = ExerciseFluidsystemSpatialParams<FVGridGeometry, Scalar>; @@ -107,8 +107,8 @@ class ExerciseFluidsystemProblemTwoPTwoC : public PorousMediumFlowProblem<TypeTa using Indices = typename GetPropType<TypeTag, Properties::ModelTraits>::Indices; using PrimaryVariables = GetPropType<TypeTag, Properties::PrimaryVariables>; using BoundaryTypes = GetPropType<TypeTag, Properties::BoundaryTypes>; - using FVGridGeometry = GetPropType<TypeTag, Properties::FVGridGeometry>; - using FVElementGeometry = typename GetPropType<TypeTag, Properties::FVGridGeometry>::LocalView; + using FVGridGeometry = GetPropType<TypeTag, Properties::GridGeometry>; + using FVElementGeometry = typename GetPropType<TypeTag, Properties::GridGeometry>::LocalView; using FluidSystem = GetPropType<TypeTag, Properties::FluidSystem>; using NumEqVector = GetPropType<TypeTag, Properties::NumEqVector>; @@ -122,7 +122,7 @@ public: FluidSystem::init(); // set the depth of the bottom of the reservoir - depthBOR_ = this->fvGridGeometry().bBoxMax()[dimWorld-1]; + depthBOR_ = this->gridGeometry().bBoxMax()[dimWorld-1]; } /*! @@ -151,7 +151,7 @@ public: { BoundaryTypes bcTypes; - if (globalPos[0] < eps_ || globalPos[0] > this->fvGridGeometry().bBoxMax()[0] - eps_) + if (globalPos[0] < eps_ || globalPos[0] > this->gridGeometry().bBoxMax()[0] - eps_) bcTypes.setAllDirichlet(); else bcTypes.setAllNeumann(); @@ -182,7 +182,7 @@ public: // initialize values to zero, i.e. no-flow Neumann boundary conditions NumEqVector values(0.0); - Scalar up = this->fvGridGeometry().bBoxMax()[dimWorld-1]; + Scalar up = this->gridGeometry().bBoxMax()[dimWorld-1]; // extraction of oil (30 g/m/s) on a segment of the upper boundary if (globalPos[dimWorld-1] > up - eps_ && globalPos[0] > 20 && globalPos[0] < 40) { diff --git a/exercises/exercise-fluidsystem/2pproblem.hh b/exercises/exercise-fluidsystem/2pproblem.hh index 4462997fa1ed2095e1d45ee9966d0d25e8967cf1..28a36b1ed86c5fe8d29faa41487070f14fa13cb4 100644 --- a/exercises/exercise-fluidsystem/2pproblem.hh +++ b/exercises/exercise-fluidsystem/2pproblem.hh @@ -76,7 +76,7 @@ template<class TypeTag> struct SpatialParams<TypeTag, TTag::ExerciseFluidsystemTwoP> { private: - using FVGridGeometry = GetPropType<TypeTag, Properties::FVGridGeometry>; + using FVGridGeometry = GetPropType<TypeTag, Properties::GridGeometry>; using Scalar = GetPropType<TypeTag, Properties::Scalar>; public: using type = ExerciseFluidsystemSpatialParams<FVGridGeometry, Scalar>; @@ -129,8 +129,8 @@ class ExerciseFluidsystemProblemTwoP : public PorousMediumFlowProblem<TypeTag> using Indices = typename GetPropType<TypeTag, Properties::ModelTraits>::Indices; using PrimaryVariables = GetPropType<TypeTag, Properties::PrimaryVariables>; using BoundaryTypes = GetPropType<TypeTag, Properties::BoundaryTypes>; - using FVGridGeometry = GetPropType<TypeTag, Properties::FVGridGeometry>; - using FVElementGeometry = typename GetPropType<TypeTag, Properties::FVGridGeometry>::LocalView; + using FVGridGeometry = GetPropType<TypeTag, Properties::GridGeometry>; + using FVElementGeometry = typename GetPropType<TypeTag, Properties::GridGeometry>::LocalView; using FluidSystem = GetPropType<TypeTag, Properties::FluidSystem>; using FluidState = GetPropType<TypeTag, Properties::FluidState>; using NumEqVector = GetPropType<TypeTag, Properties::NumEqVector>; @@ -157,7 +157,7 @@ public: /*numP=*/200); // set the depth of the bottom of the reservoir - depthBOR_ = this->fvGridGeometry().bBoxMax()[dimWorld-1]; + depthBOR_ = this->gridGeometry().bBoxMax()[dimWorld-1]; // plot density over pressure of the phase consisting of your component if(getParam<bool>("Output.PlotDensity")) @@ -190,7 +190,7 @@ public: { BoundaryTypes bcTypes; - if (globalPos[0] < eps_ || globalPos[0] > this->fvGridGeometry().bBoxMax()[0] - eps_) + if (globalPos[0] < eps_ || globalPos[0] > this->gridGeometry().bBoxMax()[0] - eps_) bcTypes.setAllDirichlet(); else bcTypes.setAllNeumann(); @@ -224,7 +224,7 @@ public: // initialize values to zero, i.e. no-flow Neumann boundary conditions NumEqVector values(0.0); - Scalar up = this->fvGridGeometry().bBoxMax()[dimWorld-1]; + Scalar up = this->gridGeometry().bBoxMax()[dimWorld-1]; // influx of oil (30 g/m/s) over a segment of the top boundary if (globalPos[dimWorld-1] > up - eps_ && globalPos[0] > 20 && globalPos[0] < 40) diff --git a/exercises/exercise-fluidsystem/main.cc b/exercises/exercise-fluidsystem/main.cc index 197c32590f582a37a4f2fa4633f6328227aac8ef..baa1ea7877ef117fee608e6c90cae94d00cd84eb 100644 --- a/exercises/exercise-fluidsystem/main.cc +++ b/exercises/exercise-fluidsystem/main.cc @@ -89,7 +89,7 @@ int main(int argc, char** argv) try const auto& leafGridView = gridManager.grid().leafGridView(); // create the finite volume grid geometry - using FVGridGeometry = GetPropType<TypeTag, Properties::FVGridGeometry>; + using FVGridGeometry = GetPropType<TypeTag, Properties::GridGeometry>; auto fvGridGeometry = std::make_shared<FVGridGeometry>(leafGridView); fvGridGeometry->update(); diff --git a/exercises/exercise-fractures/fractureproblem.hh b/exercises/exercise-fractures/fractureproblem.hh index dc92eaa54bfa1ba6e92a1d8763d148d263d80213..76493b12be18099eb3b963b34ae94033ac4b01ed 100644 --- a/exercises/exercise-fractures/fractureproblem.hh +++ b/exercises/exercise-fractures/fractureproblem.hh @@ -66,7 +66,7 @@ struct Problem<TypeTag, TTag::FractureProblem> { using type = FractureSubProblem template<class TypeTag> struct SpatialParams<TypeTag, TTag::FractureProblem> { - using type = FractureSpatialParams< GetPropType<TypeTag, Properties::FVGridGeometry>, + using type = FractureSpatialParams< GetPropType<TypeTag, Properties::GridGeometry>, GetPropType<TypeTag, Properties::Scalar> >; }; @@ -141,7 +141,7 @@ public: // However, there is one fracture reaching the top boundary. For this // fracture tip we set Dirichlet Bcs as in the matrix domain // TODO Task A: Change boundary conditions - if (globalPos[1] > this->fvGridGeometry().bBoxMax()[1] - 1e-6) + if (globalPos[1] > this->gridGeometry().bBoxMax()[1] - 1e-6) values.setAllDirichlet(); return values; @@ -179,7 +179,7 @@ public: { // For the grid used here, the height of the domain is equal // to the maximum y-coordinate - const auto domainHeight = this->fvGridGeometry().bBoxMax()[1]; + const auto domainHeight = this->gridGeometry().bBoxMax()[1]; // we assume a constant water density of 1000 for initial conditions! const auto& g = this->spatialParams().gravity(globalPos); diff --git a/exercises/exercise-fractures/main.cc b/exercises/exercise-fractures/main.cc index b52e3c9c00ff66be1068d7f0c8e474864fa832ce..cd8ba733eb26999d03b1fed1cba6f0f69ee89b85 100644 --- a/exercises/exercise-fractures/main.cc +++ b/exercises/exercise-fractures/main.cc @@ -52,8 +52,8 @@ // reuse them again in the main function with only one single definition of them here using MatrixTypeTag = Dumux::Properties::TTag::MatrixProblem; using FractureTypeTag = Dumux::Properties::TTag::FractureProblem; -using MatrixFVGridGeometry = Dumux::GetPropType<MatrixTypeTag, Dumux::Properties::FVGridGeometry>; -using FractureFVGridGeometry = Dumux::GetPropType<FractureTypeTag, Dumux::Properties::FVGridGeometry>; +using MatrixFVGridGeometry = Dumux::GetPropType<MatrixTypeTag, Dumux::Properties::GridGeometry>; +using FractureFVGridGeometry = Dumux::GetPropType<FractureTypeTag, Dumux::Properties::GridGeometry>; using TheMultiDomainTraits = Dumux::MultiDomainTraits<MatrixTypeTag, FractureTypeTag>; using TheCouplingMapper = Dumux::FacetCouplingMapper<MatrixFVGridGeometry, FractureFVGridGeometry>; using TheCouplingManager = Dumux::FacetCouplingManager<TheMultiDomainTraits, TheCouplingMapper>; diff --git a/exercises/exercise-fractures/matrixproblem.hh b/exercises/exercise-fractures/matrixproblem.hh index 85092b7e79da06302c7c3da9e63d7bd57c30f2ff..07920241a9dd0673e1caf9c11c0ecbbad9e88d32 100644 --- a/exercises/exercise-fractures/matrixproblem.hh +++ b/exercises/exercise-fractures/matrixproblem.hh @@ -74,7 +74,7 @@ struct Problem<TypeTag, TTag::MatrixProblem> { using type = MatrixSubProblem<Typ template<class TypeTag> struct SpatialParams<TypeTag, TTag::MatrixProblem> { - using type = MatrixSpatialParams< GetPropType<TypeTag, Properties::FVGridGeometry>, + using type = MatrixSpatialParams< GetPropType<TypeTag, Properties::GridGeometry>, GetPropType<TypeTag, Properties::Scalar> >; }; @@ -146,7 +146,7 @@ public: // Dirichlet BCs on the top and bottom boundary // TODO Task A: Change boundary conditions and Dirichlet values! values.setAllNeumann(); - if (globalPos[1] < 1e-6 || globalPos[1] > this->fvGridGeometry().bBoxMax()[1] - 1e-6) + if (globalPos[1] < 1e-6 || globalPos[1] > this->gridGeometry().bBoxMax()[1] - 1e-6) values.setAllDirichlet(); return values; @@ -196,7 +196,7 @@ public: { // For the grid used here, the height of the domain is equal // to the maximum y-coordinate - const auto domainHeight = this->fvGridGeometry().bBoxMax()[1]; + const auto domainHeight = this->gridGeometry().bBoxMax()[1]; // we assume a constant water density of 1000 for initial conditions! const auto& g = this->spatialParams().gravity(globalPos); diff --git a/exercises/exercise-grids/main.cc b/exercises/exercise-grids/main.cc index 9e094d98dfd66b7a486d4c523c6dd29dbbf0d8b4..90fc1fbad5dfca2f16a769a50d783cacdc105461 100644 --- a/exercises/exercise-grids/main.cc +++ b/exercises/exercise-grids/main.cc @@ -81,7 +81,7 @@ int main(int argc, char** argv) try const auto& leafGridView = gridManager.grid().leafGridView(); // create the finite volume grid geometry - using FVGridGeometry = GetPropType<TypeTag, Properties::FVGridGeometry>; + using FVGridGeometry = GetPropType<TypeTag, Properties::GridGeometry>; auto fvGridGeometry = std::make_shared<FVGridGeometry>(leafGridView); fvGridGeometry->update(); diff --git a/exercises/exercise-grids/problem.hh b/exercises/exercise-grids/problem.hh index 680ea9ab8a6d0c2701f091f1381e5dda663a196f..855d4c9e2089ef729166c35393253a6c71938ba0 100644 --- a/exercises/exercise-grids/problem.hh +++ b/exercises/exercise-grids/problem.hh @@ -64,7 +64,7 @@ template<class TypeTag> struct SpatialParams<TypeTag, TTag::Injection2p> { private: - using FVGridGeometry = GetPropType<TypeTag, Properties::FVGridGeometry>; + using FVGridGeometry = GetPropType<TypeTag, Properties::GridGeometry>; using Scalar = GetPropType<TypeTag, Properties::Scalar>; public: using type = InjectionSpatialParams<FVGridGeometry, Scalar>; @@ -105,8 +105,8 @@ class InjectionProblem2P : public PorousMediumFlowProblem<TypeTag> using Indices = typename GetPropType<TypeTag, Properties::ModelTraits>::Indices; using PrimaryVariables = GetPropType<TypeTag, Properties::PrimaryVariables>; using BoundaryTypes = GetPropType<TypeTag, Properties::BoundaryTypes>; - using FVGridGeometry = GetPropType<TypeTag, Properties::FVGridGeometry>; - using FVElementGeometry = typename GetPropType<TypeTag, Properties::FVGridGeometry>::LocalView; + using FVGridGeometry = GetPropType<TypeTag, Properties::GridGeometry>; + using FVElementGeometry = typename GetPropType<TypeTag, Properties::GridGeometry>::LocalView; using FluidSystem = GetPropType<TypeTag, Properties::FluidSystem>; using NumEqVector = GetPropType<TypeTag, Properties::NumEqVector>; @@ -209,7 +209,7 @@ public: // using < boundary + eps_ or > boundary - eps_ is safer for floating point comparisons // than using <= or >= as it is robust with regard to imprecision introduced by rounding errors. if (time_ < injectionDuration_ - && globalPos[1] < 15 + eps_ && globalPos[1] > 7 - eps_ && globalPos[0] > 0.9*this->fvGridGeometry().bBoxMax()[0]) + && globalPos[1] < 15 + eps_ && globalPos[1] > 7 - eps_ && globalPos[0] > 0.9*this->gridGeometry().bBoxMax()[0]) { // inject nitrogen. negative values mean injection // units kg/(s*m^2) diff --git a/exercises/exercise-mainfile/1pproblem.hh b/exercises/exercise-mainfile/1pproblem.hh index 31f4f9336de5d4295cff5893351381e7e53f3588..13edd6a8fcb4d4eb5fd4fb17e80bfe4163a37ebc 100644 --- a/exercises/exercise-mainfile/1pproblem.hh +++ b/exercises/exercise-mainfile/1pproblem.hh @@ -71,7 +71,7 @@ struct Problem<TypeTag, TTag::OnePBase> { using type = OnePTestProblem<TypeTag>; // set the spatial params template<class TypeTag> struct SpatialParams<TypeTag, TTag::OnePBase> { - using type = OnePTestSpatialParams<GetPropType<TypeTag, FVGridGeometry>, GetPropType<TypeTag, Scalar>>; + using type = OnePTestSpatialParams<GetPropType<TypeTag, GridGeometry>, GetPropType<TypeTag, Scalar>>; }; // the fluid system for incompressible tests @@ -124,7 +124,7 @@ class OnePTestProblem : public PorousMediumFlowProblem<TypeTag> using Element = typename GridView::template Codim<0>::Entity; using Scalar = GetPropType<TypeTag, Properties::Scalar>; using PrimaryVariables = GetPropType<TypeTag, Properties::PrimaryVariables>; - using FVGridGeometry = GetPropType<TypeTag, Properties::FVGridGeometry>; + using FVGridGeometry = GetPropType<TypeTag, Properties::GridGeometry>; using BoundaryTypes = GetPropType<TypeTag, Properties::BoundaryTypes>; static constexpr int dimWorld = GridView::dimensionworld; using GlobalPosition = typename Element::Geometry::GlobalCoordinate; @@ -153,7 +153,7 @@ public: BoundaryTypes values; Scalar eps = 1.0e-6; - if (globalPos[dimWorld-1] < eps || globalPos[dimWorld-1] > this->fvGridGeometry().bBoxMax()[dimWorld-1] - eps) + if (globalPos[dimWorld-1] < eps || globalPos[dimWorld-1] > this->gridGeometry().bBoxMax()[dimWorld-1] - eps) values.setAllDirichlet(); else values.setAllNeumann(); diff --git a/exercises/exercise-mainfile/exercise1pamain.cc b/exercises/exercise-mainfile/exercise1pamain.cc index 1c260a38d5907094debe842cfb60a9e8dd3650cc..6cfe2dc436d398cd9966f8f5a56aba7861400134 100644 --- a/exercises/exercise-mainfile/exercise1pamain.cc +++ b/exercises/exercise-mainfile/exercise1pamain.cc @@ -81,7 +81,7 @@ int main(int argc, char** argv) try const auto& leafGridView = gridManager.grid().leafGridView(); // create the finite volume grid geometry - using FVGridGeometry = GetPropType<TypeTag, Properties::FVGridGeometry>; + using FVGridGeometry = GetPropType<TypeTag, Properties::GridGeometry>; auto fvGridGeometry = std::make_shared<FVGridGeometry>(leafGridView); fvGridGeometry->update(); diff --git a/exercises/exercise-mainfile/exercise1pbmain.cc b/exercises/exercise-mainfile/exercise1pbmain.cc index 9c4af7d58f7b97b9239422b722ccde1495da9bb1..b5091b33c9d64278f2727ac915cdb44d9e8ad85c 100644 --- a/exercises/exercise-mainfile/exercise1pbmain.cc +++ b/exercises/exercise-mainfile/exercise1pbmain.cc @@ -82,7 +82,7 @@ int main(int argc, char** argv) try const auto& leafGridView = gridManager.grid().leafGridView(); // create the finite volume grid geometry - using FVGridGeometry = GetPropType<TypeTag, Properties::FVGridGeometry>; + using FVGridGeometry = GetPropType<TypeTag, Properties::GridGeometry>; auto fvGridGeometry = std::make_shared<FVGridGeometry>(leafGridView); fvGridGeometry->update(); diff --git a/exercises/exercise-mainfile/exercise1pcmain.cc b/exercises/exercise-mainfile/exercise1pcmain.cc index 94636e1af9c6c49ac11750dad520a35b405afee8..64a7f2adaeb421efab6a669097802c4838146e42 100644 --- a/exercises/exercise-mainfile/exercise1pcmain.cc +++ b/exercises/exercise-mainfile/exercise1pcmain.cc @@ -82,7 +82,7 @@ int main(int argc, char** argv) try const auto& leafGridView = gridManager.grid().leafGridView(); // create the finite volume grid geometry - using FVGridGeometry = GetPropType<TypeTag, Properties::FVGridGeometry>; + using FVGridGeometry = GetPropType<TypeTag, Properties::GridGeometry>; auto fvGridGeometry = std::make_shared<FVGridGeometry>(leafGridView); fvGridGeometry->update(); diff --git a/exercises/exercise-properties/main.cc b/exercises/exercise-properties/main.cc index 96d9e9ac9c800df50034f0e8391df62a8bbbc176..a0179621fad3a6c76329e87ddbe6987840c84532 100644 --- a/exercises/exercise-properties/main.cc +++ b/exercises/exercise-properties/main.cc @@ -112,7 +112,7 @@ int main(int argc, char** argv) try const auto& leafGridView = gridManager.grid().leafGridView(); // create the finite volume grid geometry - using FVGridGeometry = GetPropType<TypeTag, Properties::FVGridGeometry>; + using FVGridGeometry = GetPropType<TypeTag, Properties::GridGeometry>; auto fvGridGeometry = std::make_shared<FVGridGeometry>(leafGridView); fvGridGeometry->update(); diff --git a/exercises/exercise-properties/mylocalresidual.hh b/exercises/exercise-properties/mylocalresidual.hh index f69e6b6a0d61fbd7412ffd944266908af58f6b9f..67c390b47508fd2fb050b5aebdc55efde89c9781 100644 --- a/exercises/exercise-properties/mylocalresidual.hh +++ b/exercises/exercise-properties/mylocalresidual.hh @@ -45,7 +45,7 @@ class MyLocalResidual : public GetPropType<TypeTag, Properties::BaseLocalResidua using ElementVolumeVariables = typename GetPropType<TypeTag, Properties::GridVolumeVariables>::LocalView; using FluxVariables = GetPropType<TypeTag, Properties::FluxVariables>; using ElementFluxVariablesCache = typename GetPropType<TypeTag, Properties::GridFluxVariablesCache>::LocalView; - using FVElementGeometry = typename GetPropType<TypeTag, Properties::FVGridGeometry>::LocalView; + using FVElementGeometry = typename GetPropType<TypeTag, Properties::GridGeometry>::LocalView; using SubControlVolume = typename FVElementGeometry::SubControlVolume; using SubControlVolumeFace = typename FVElementGeometry::SubControlVolumeFace; using GridView = GetPropType<TypeTag, Properties::GridView>; diff --git a/exercises/exercise-properties/problem.hh b/exercises/exercise-properties/problem.hh index b3391869c434efaf53dd816aa76538ac97276136..23c67f484de6a5b54df9b534770293fd94744460 100644 --- a/exercises/exercise-properties/problem.hh +++ b/exercises/exercise-properties/problem.hh @@ -78,7 +78,7 @@ template<class TypeTag> struct SpatialParams<TypeTag, TTag::TwoPIncompressible> { private: - using FVGridGeometry = GetPropType<TypeTag, Properties::FVGridGeometry>; + using FVGridGeometry = GetPropType<TypeTag, Properties::GridGeometry>; using Scalar = GetPropType<TypeTag, Properties::Scalar>; public: using type = TwoPTestSpatialParams<FVGridGeometry, Scalar>; @@ -98,7 +98,7 @@ class TwoPTestProblem : public PorousMediumFlowProblem<TypeTag> using Scalar = GetPropType<TypeTag, Properties::Scalar>; using FluidSystem = GetPropType<TypeTag, Properties::FluidSystem>; using PrimaryVariables = GetPropType<TypeTag, Properties::PrimaryVariables>; - using FVGridGeometry = GetPropType<TypeTag, Properties::FVGridGeometry>; + using FVGridGeometry = GetPropType<TypeTag, Properties::GridGeometry>; using BoundaryTypes = GetPropType<TypeTag, Properties::BoundaryTypes>; using GlobalPosition = typename Element::Geometry::GlobalCoordinate; using NumEqVector = GetPropType<TypeTag, Properties::NumEqVector>; @@ -150,10 +150,10 @@ public: Scalar densityW = FluidSystem::density(fluidState, waterPhaseIdx); - Scalar height = this->fvGridGeometry().bBoxMax()[1] - this->fvGridGeometry().bBoxMin()[1]; - Scalar depth = this->fvGridGeometry().bBoxMax()[1] - globalPos[1]; + Scalar height = this->gridGeometry().bBoxMax()[1] - this->gridGeometry().bBoxMin()[1]; + Scalar depth = this->gridGeometry().bBoxMax()[1] - globalPos[1]; Scalar alpha = 1 + 1.5/height; - Scalar width = this->fvGridGeometry().bBoxMax()[0] - this->fvGridGeometry().bBoxMin()[0]; + Scalar width = this->gridGeometry().bBoxMax()[0] - this->gridGeometry().bBoxMin()[0]; Scalar factor = (width*alpha + (1.0 - alpha)*globalPos[0])/width; // hydrostatic pressure scaled by alpha @@ -201,7 +201,7 @@ public: Scalar densityW = FluidSystem::density(fluidState, waterPhaseIdx); - Scalar depth = this->fvGridGeometry().bBoxMax()[1] - globalPos[1]; + Scalar depth = this->gridGeometry().bBoxMax()[1] - globalPos[1]; // hydrostatic pressure values[pressureH2OIdx] = 1e5 - densityW*this->spatialParams().gravity(globalPos)[1]*depth; @@ -224,28 +224,28 @@ public: private: bool onLeftBoundary_(const GlobalPosition &globalPos) const { - return globalPos[0] < this->fvGridGeometry().bBoxMin()[0] + eps_; + return globalPos[0] < this->gridGeometry().bBoxMin()[0] + eps_; } bool onRightBoundary_(const GlobalPosition &globalPos) const { - return globalPos[0] > this->fvGridGeometry().bBoxMax()[0] - eps_; + return globalPos[0] > this->gridGeometry().bBoxMax()[0] - eps_; } bool onLowerBoundary_(const GlobalPosition &globalPos) const { - return globalPos[1] < this->fvGridGeometry().bBoxMin()[1] + eps_; + return globalPos[1] < this->gridGeometry().bBoxMin()[1] + eps_; } bool onUpperBoundary_(const GlobalPosition &globalPos) const { - return globalPos[1] > this->fvGridGeometry().bBoxMax()[1] - eps_; + return globalPos[1] > this->gridGeometry().bBoxMax()[1] - eps_; } bool onInlet_(const GlobalPosition &globalPos) const { - Scalar width = this->fvGridGeometry().bBoxMax()[0] - this->fvGridGeometry().bBoxMin()[0]; - Scalar lambda = (this->fvGridGeometry().bBoxMax()[0] - globalPos[0])/width; + Scalar width = this->gridGeometry().bBoxMax()[0] - this->gridGeometry().bBoxMin()[0]; + Scalar lambda = (this->gridGeometry().bBoxMax()[0] - globalPos[0])/width; return onUpperBoundary_(globalPos) && 0.5 < lambda && lambda < 2.0/3.0; } diff --git a/exercises/exercise-runtimeparams/main.cc b/exercises/exercise-runtimeparams/main.cc index e4221b46173dde8e7209826fe8dc0cd30600e891..0919336e9db6e162c839d2c4621c512968580910 100644 --- a/exercises/exercise-runtimeparams/main.cc +++ b/exercises/exercise-runtimeparams/main.cc @@ -81,7 +81,7 @@ int main(int argc, char** argv) try const auto& leafGridView = gridManager.grid().leafGridView(); // create the finite volume grid geometry - using FVGridGeometry = GetPropType<TypeTag, Properties::FVGridGeometry>; + using FVGridGeometry = GetPropType<TypeTag, Properties::GridGeometry>; auto fvGridGeometry = std::make_shared<FVGridGeometry>(leafGridView); fvGridGeometry->update(); diff --git a/exercises/exercise-runtimeparams/problem.hh b/exercises/exercise-runtimeparams/problem.hh index 3ebd1a2a88c5b8c7196bd95f9dd5ffc6847a29b4..8cd8ddec8a711a246856dd84f0c53845f4f15631 100644 --- a/exercises/exercise-runtimeparams/problem.hh +++ b/exercises/exercise-runtimeparams/problem.hh @@ -61,7 +61,7 @@ template<class TypeTag> struct SpatialParams<TypeTag, TTag::Injection2p> { private: - using FVGridGeometry = GetPropType<TypeTag, Properties::FVGridGeometry>; + using FVGridGeometry = GetPropType<TypeTag, Properties::GridGeometry>; using Scalar = GetPropType<TypeTag, Properties::Scalar>; public: using type = InjectionSpatialParams<FVGridGeometry, Scalar>; @@ -102,8 +102,8 @@ class InjectionProblem2P : public PorousMediumFlowProblem<TypeTag> using Indices = typename GetPropType<TypeTag, Properties::ModelTraits>::Indices; using PrimaryVariables = GetPropType<TypeTag, Properties::PrimaryVariables>; using BoundaryTypes = GetPropType<TypeTag, Properties::BoundaryTypes>; - using FVGridGeometry = GetPropType<TypeTag, Properties::FVGridGeometry>; - using FVElementGeometry = typename GetPropType<TypeTag, Properties::FVGridGeometry>::LocalView; + using FVGridGeometry = GetPropType<TypeTag, Properties::GridGeometry>; + using FVElementGeometry = typename GetPropType<TypeTag, Properties::GridGeometry>::LocalView; using FluidSystem = GetPropType<TypeTag, Properties::FluidSystem>; using NumEqVector = GetPropType<TypeTag, Properties::NumEqVector>; @@ -209,7 +209,7 @@ public: // using < boundary + eps_ or > boundary - eps_ is safer for floating point comparisons // than using <= or >= as it is robust with regard to imprecision introduced by rounding errors. if (time_ < injectionDuration_ - && globalPos[1] < 15 + eps_ && globalPos[1] > 7 - eps_ && globalPos[0] > 0.9*this->fvGridGeometry().bBoxMax()[0]) + && globalPos[1] < 15 + eps_ && globalPos[1] > 7 - eps_ && globalPos[0] > 0.9*this->gridGeometry().bBoxMax()[0]) { // inject nitrogen. negative values mean injection // units kg/(s*m^2) diff --git a/exercises/solution/exercise-basic/2pnimain.cc b/exercises/solution/exercise-basic/2pnimain.cc index c040e49a7251c8d8d9d18ce6d2f3312844a94d06..34eb43caaf3f2e53d684a9c44b9dc52476e4ce1b 100644 --- a/exercises/solution/exercise-basic/2pnimain.cc +++ b/exercises/solution/exercise-basic/2pnimain.cc @@ -81,7 +81,7 @@ int main(int argc, char** argv) try const auto& leafGridView = gridManager.grid().leafGridView(); // create the finite volume grid geometry - using FVGridGeometry = GetPropType<TypeTag, Properties::FVGridGeometry>; + using FVGridGeometry = GetPropType<TypeTag, Properties::GridGeometry>; auto fvGridGeometry = std::make_shared<FVGridGeometry>(leafGridView); fvGridGeometry->update(); diff --git a/exercises/solution/exercise-basic/injection2pniproblem.hh b/exercises/solution/exercise-basic/injection2pniproblem.hh index 73f2fadc0874d70cdadd06a34785a821f850bc0c..e3d6c2886d57b263ba7352eec1002d13186f2766 100644 --- a/exercises/solution/exercise-basic/injection2pniproblem.hh +++ b/exercises/solution/exercise-basic/injection2pniproblem.hh @@ -60,7 +60,7 @@ template<class TypeTag> struct SpatialParams<TypeTag, TTag::Injection2pNITypeTag> { private: - using FVGridGeometry = GetPropType<TypeTag, Properties::FVGridGeometry>; + using FVGridGeometry = GetPropType<TypeTag, Properties::GridGeometry>; using Scalar = GetPropType<TypeTag, Properties::Scalar>; public: using type = InjectionSpatialParams<FVGridGeometry, Scalar>; @@ -105,8 +105,8 @@ class Injection2PNIProblem : public PorousMediumFlowProblem<TypeTag> using Indices = typename GetPropType<TypeTag, Properties::ModelTraits>::Indices; using PrimaryVariables = GetPropType<TypeTag, Properties::PrimaryVariables>; using BoundaryTypes = GetPropType<TypeTag, Properties::BoundaryTypes>; - using FVGridGeometry = GetPropType<TypeTag, Properties::FVGridGeometry>; - using FVElementGeometry = typename GetPropType<TypeTag, Properties::FVGridGeometry>::LocalView; + using FVGridGeometry = GetPropType<TypeTag, Properties::GridGeometry>; + using FVElementGeometry = typename GetPropType<TypeTag, Properties::GridGeometry>::LocalView; using FluidSystem = GetPropType<TypeTag, Properties::FluidSystem>; using NumEqVector = GetPropType<TypeTag, Properties::NumEqVector>; @@ -197,7 +197,7 @@ public: // if we are inside the injection zone set inflow Neumann boundary conditions if (time_ < injectionDuration_ - && globalPos[1] < 15 + eps_ && globalPos[1] > 7 - eps_ && globalPos[0] > 0.9*this->fvGridGeometry().bBoxMax()[0]) + && globalPos[1] < 15 + eps_ && globalPos[1] > 7 - eps_ && globalPos[0] > 0.9*this->gridGeometry().bBoxMax()[0]) { // inject nitrogen. negative values mean injection // units kg/(s*m^2) diff --git a/exercises/solution/exercise-biomineralization/biominproblem.hh b/exercises/solution/exercise-biomineralization/biominproblem.hh index 94857d1de1f70d639fb1fc1013550ffeddd00236..9bf73648e25bfecf8c02670420c867c3e986abf9 100644 --- a/exercises/solution/exercise-biomineralization/biominproblem.hh +++ b/exercises/solution/exercise-biomineralization/biominproblem.hh @@ -92,7 +92,7 @@ struct SpatialParams<TypeTag, TTag::ExerciseFourBioMin> { using MT = GetPropType<TypeTag, ModelTraits>; static constexpr int numFluidComps = MT::numFluidComponents(); static constexpr int numActiveSolidComps = MT::numSolidComps() - MT::numInertSolidComps(); - using type = BioMinSpatialparams<GetPropType<TypeTag, FVGridGeometry>, GetPropType<TypeTag, Scalar>, numFluidComps, numActiveSolidComps>; + using type = BioMinSpatialparams<GetPropType<TypeTag, GridGeometry>, GetPropType<TypeTag, Scalar>, numFluidComps, numActiveSolidComps>; }; template<class TypeTag> @@ -120,8 +120,8 @@ class BioMinProblem : public PorousMediumFlowProblem<TypeTag> using PrimaryVariables = GetPropType<TypeTag, Properties::PrimaryVariables>; using BoundaryTypes = GetPropType<TypeTag, Properties::BoundaryTypes>; using VolumeVariables = GetPropType<TypeTag, Properties::VolumeVariables>; - using FVGridGeometry = GetPropType<TypeTag, Properties::FVGridGeometry>; - using FVElementGeometry = typename GetPropType<TypeTag, Properties::FVGridGeometry>::LocalView; + using FVGridGeometry = GetPropType<TypeTag, Properties::GridGeometry>; + using FVElementGeometry = typename GetPropType<TypeTag, Properties::GridGeometry>::LocalView; // Grid dimension enum @@ -185,7 +185,7 @@ public: concCa_ = getParam<Scalar>("Injection.ConcCa"); concUrea_ = getParam<Scalar>("Injection.ConcUrea"); - unsigned int codim = GetPropType<TypeTag, Properties::FVGridGeometry>::discMethod == DiscretizationMethod::box ? dim : 0; + unsigned int codim = GetPropType<TypeTag, Properties::GridGeometry>::discMethod == DiscretizationMethod::box ? dim : 0; Kxx_.resize(fvGridGeometry->gridView().size(codim)); Kyy_.resize(fvGridGeometry->gridView().size(codim)); @@ -241,7 +241,7 @@ public: BoundaryTypes bcTypes; // we don't set any BCs for the solid phases - Scalar xmax = this->fvGridGeometry().bBoxMax()[0]; + Scalar xmax = this->gridGeometry().bBoxMax()[0]; // set all Neumann bcTypes.setAllNeumann(); @@ -323,7 +323,7 @@ public: PrimaryVariables priVars(0.0); priVars.setState(liquidPhaseOnly); - Scalar hmax = this->fvGridGeometry().bBoxMax()[1]; + Scalar hmax = this->gridGeometry().bBoxMax()[1]; priVars[pressureIdx] = initPressure_ - (globalPos[1] - hmax)*densityW_*9.81; priVars[switchIdx] = 0.0; priVars[CaIdx] = 0.0; @@ -393,11 +393,11 @@ public: */ void updateVtkOutput(const SolutionVector& curSol) { - for (const auto& element : elements(this->fvGridGeometry().gridView())) + for (const auto& element : elements(this->gridGeometry().gridView())) { - const auto elemSol = elementSolution(element, curSol, this->fvGridGeometry()); + const auto elemSol = elementSolution(element, curSol, this->gridGeometry()); - auto fvGeometry = localView(this->fvGridGeometry()); + auto fvGeometry = localView(this->gridGeometry()); fvGeometry.bindElement(element); for (auto&& scv : scvs(fvGeometry)) diff --git a/exercises/solution/exercise-biomineralization/biominspatialparams.hh b/exercises/solution/exercise-biomineralization/biominspatialparams.hh index 3815f373ea76d1647d6d836ec1c2b225c4ef8178..2c901dc9379771d5e15dccf17763305d571448e4 100644 --- a/exercises/solution/exercise-biomineralization/biominspatialparams.hh +++ b/exercises/solution/exercise-biomineralization/biominspatialparams.hh @@ -119,7 +119,7 @@ public: Scalar referencePorosity(const Element& element, const SubControlVolume &scv) const { - const auto eIdx = this->fvGridGeometry().elementMapper().index(element); + const auto eIdx = this->gridGeometry().elementMapper().index(element); return referencePorosity_[eIdx][scv.indexInElement()]; } @@ -148,7 +148,7 @@ public: auto fvGeometry = localView(fvGridGeometry); fvGeometry.bindElement(element); - const auto eIdx = this->fvGridGeometry().elementMapper().index(element); + const auto eIdx = this->gridGeometry().elementMapper().index(element); auto elemSol = elementSolution(element, sol, fvGridGeometry); referencePorosity_[eIdx].resize(fvGeometry.numScv()); @@ -189,7 +189,7 @@ public: PermeabilityType referencePermeability(const Element& element, const SubControlVolume &scv) const { - const auto eIdx = this->fvGridGeometry().elementMapper().index(element); + const auto eIdx = this->gridGeometry().elementMapper().index(element); return referencePermeability_[eIdx][scv.indexInElement()]; } @@ -220,7 +220,7 @@ public: auto fvGeometry = localView(fvGridGeometry); fvGeometry.bindElement(element); - const auto eIdx = this->fvGridGeometry().elementMapper().index(element); + const auto eIdx = this->gridGeometry().elementMapper().index(element); auto elemSol = elementSolution(element, sol, fvGridGeometry); referencePermeability_[eIdx].resize(fvGeometry.numScv()); diff --git a/exercises/solution/exercise-biomineralization/main.cc b/exercises/solution/exercise-biomineralization/main.cc index f6da4fd801db9588687345cf3bb9a30b49c96054..c9b3513bc866bc86dbd976f4f40c5f952b43b846 100644 --- a/exercises/solution/exercise-biomineralization/main.cc +++ b/exercises/solution/exercise-biomineralization/main.cc @@ -83,7 +83,7 @@ int main(int argc, char** argv) try const auto& leafGridView = gridManager.grid().leafGridView(); // create the finite volume grid geometry - using FVGridGeometry = GetPropType<TypeTag, Properties::FVGridGeometry>; + using FVGridGeometry = GetPropType<TypeTag, Properties::GridGeometry>; auto fvGridGeometry = std::make_shared<FVGridGeometry>(leafGridView); fvGridGeometry->update(); diff --git a/exercises/solution/exercise-coupling-ff-pm/interface/freeflowsubproblem.hh b/exercises/solution/exercise-coupling-ff-pm/interface/freeflowsubproblem.hh index 8145015444c8c547b0b081c3894c02a7ec8de1b8..5fbe9f0e683526b3aa97ad4ff4ed17d87e99af5e 100644 --- a/exercises/solution/exercise-coupling-ff-pm/interface/freeflowsubproblem.hh +++ b/exercises/solution/exercise-coupling-ff-pm/interface/freeflowsubproblem.hh @@ -99,7 +99,7 @@ class FreeFlowSubProblem : public NavierStokesProblem<TypeTag> using BoundaryTypes = GetPropType<TypeTag, Properties::BoundaryTypes>; - using FVGridGeometry = GetPropType<TypeTag, Properties::FVGridGeometry>; + using FVGridGeometry = GetPropType<TypeTag, Properties::GridGeometry>; using FVElementGeometry = typename FVGridGeometry::LocalView; using SubControlVolumeFace = typename FVElementGeometry::SubControlVolumeFace; using Element = typename GridView::template Codim<0>::Entity; @@ -275,7 +275,7 @@ public: { PrimaryVariables values(0.0); #if EXNUMBER == 0 - values[Indices::velocityYIdx] = -1e-6 * globalPos[0] * (this->fvGridGeometry().bBoxMax()[0] - globalPos[0]); + values[Indices::velocityYIdx] = -1e-6 * globalPos[0] * (this->gridGeometry().bBoxMax()[0] - globalPos[0]); #else // set fixed pressures on the left and right boundary if(onLeftBoundary_(globalPos)) @@ -308,22 +308,22 @@ public: */ void calculateAnalyticalVelocityX() const { - analyticalVelocityX_.resize(this->fvGridGeometry().gridView().size(0)); + analyticalVelocityX_.resize(this->gridGeometry().gridView().size(0)); using std::sqrt; - const Scalar dPdX = -deltaP_ / (this->fvGridGeometry().bBoxMax()[0] - this->fvGridGeometry().bBoxMin()[0]); + const Scalar dPdX = -deltaP_ / (this->gridGeometry().bBoxMax()[0] - this->gridGeometry().bBoxMin()[0]); static const Scalar mu = FluidSystem::viscosity(temperature(), 1e5); static const Scalar alpha = getParam<Scalar>("Darcy.SpatialParams.AlphaBeaversJoseph"); static const Scalar K = getParam<Scalar>("Darcy.SpatialParams.Permeability"); static const Scalar sqrtK = sqrt(K); - const Scalar sigma = (this->fvGridGeometry().bBoxMax()[1] - this->fvGridGeometry().bBoxMin()[1])/sqrtK; + const Scalar sigma = (this->gridGeometry().bBoxMax()[1] - this->gridGeometry().bBoxMin()[1])/sqrtK; const Scalar uB = -K/(2.0*mu) * ((sigma*sigma + 2.0*alpha*sigma) / (1.0 + alpha*sigma)) * dPdX; - for (const auto& element : elements(this->fvGridGeometry().gridView())) + for (const auto& element : elements(this->gridGeometry().gridView())) { - const auto eIdx = this->fvGridGeometry().gridView().indexSet().index(element); - const Scalar y = element.geometry().center()[1] - this->fvGridGeometry().bBoxMin()[1]; + const auto eIdx = this->gridGeometry().gridView().indexSet().index(element); + const Scalar y = element.geometry().center()[1] - this->gridGeometry().bBoxMin()[1]; const Scalar u = uB*(1.0 + alpha/sqrtK*y) + 1.0/(2.0*mu) * (y*y + 2*alpha*y*sqrtK) * dPdX; analyticalVelocityX_[eIdx] = u; @@ -344,16 +344,16 @@ public: private: bool onLeftBoundary_(const GlobalPosition &globalPos) const - { return globalPos[0] < this->fvGridGeometry().bBoxMin()[0] + eps_; } + { return globalPos[0] < this->gridGeometry().bBoxMin()[0] + eps_; } bool onRightBoundary_(const GlobalPosition &globalPos) const - { return globalPos[0] > this->fvGridGeometry().bBoxMax()[0] - eps_; } + { return globalPos[0] > this->gridGeometry().bBoxMax()[0] - eps_; } bool onLowerBoundary_(const GlobalPosition &globalPos) const - { return globalPos[1] < this->fvGridGeometry().bBoxMin()[1] + eps_; } + { return globalPos[1] < this->gridGeometry().bBoxMin()[1] + eps_; } bool onUpperBoundary_(const GlobalPosition &globalPos) const - { return globalPos[1] > this->fvGridGeometry().bBoxMax()[1] - eps_; } + { return globalPos[1] > this->gridGeometry().bBoxMax()[1] - eps_; } Scalar eps_; Scalar deltaP_; diff --git a/exercises/solution/exercise-coupling-ff-pm/interface/main.cc b/exercises/solution/exercise-coupling-ff-pm/interface/main.cc index d23c04be1ee3b2cad3fb7defba01ac31e57d2040..fe8136a84acdf54c4c0f41f8ed5869af7dd22d1d 100644 --- a/exercises/solution/exercise-coupling-ff-pm/interface/main.cc +++ b/exercises/solution/exercise-coupling-ff-pm/interface/main.cc @@ -150,10 +150,10 @@ int main(int argc, char** argv) try // create the finite volume grid geometry - using StokesFVGridGeometry = GetPropType<StokesTypeTag, Properties::FVGridGeometry>; + using StokesFVGridGeometry = GetPropType<StokesTypeTag, Properties::GridGeometry>; auto stokesFvGridGeometry = std::make_shared<StokesFVGridGeometry>(stokesGridView); stokesFvGridGeometry->update(); - using DarcyFVGridGeometry = GetPropType<DarcyTypeTag, Properties::FVGridGeometry>; + using DarcyFVGridGeometry = GetPropType<DarcyTypeTag, Properties::GridGeometry>; auto darcyFvGridGeometry = std::make_shared<DarcyFVGridGeometry>(darcyGridView); darcyFvGridGeometry->update(); diff --git a/exercises/solution/exercise-coupling-ff-pm/interface/porousmediumsubproblem.hh b/exercises/solution/exercise-coupling-ff-pm/interface/porousmediumsubproblem.hh index c472d68cea7340e450770a3d38f97f87e68cd2f0..569e99b585a942b6dc75014267360dd04f58cb54 100644 --- a/exercises/solution/exercise-coupling-ff-pm/interface/porousmediumsubproblem.hh +++ b/exercises/solution/exercise-coupling-ff-pm/interface/porousmediumsubproblem.hh @@ -82,7 +82,7 @@ struct Grid<TypeTag, TTag::DarcyOneP> template<class TypeTag> struct SpatialParams<TypeTag, TTag::DarcyOneP> { - using type = OnePSpatialParams<GetPropType<TypeTag, FVGridGeometry>, GetPropType<TypeTag, Scalar>>; + using type = OnePSpatialParams<GetPropType<TypeTag, GridGeometry>, GetPropType<TypeTag, Scalar>>; }; } // end namespace Properties @@ -99,10 +99,10 @@ class PorousMediumSubProblem : public PorousMediumFlowProblem<TypeTag> using NumEqVector = GetPropType<TypeTag, Properties::NumEqVector>; using BoundaryTypes = GetPropType<TypeTag, Properties::BoundaryTypes>; using VolumeVariables = GetPropType<TypeTag, Properties::VolumeVariables>; - using FVElementGeometry = typename GetPropType<TypeTag, Properties::FVGridGeometry>::LocalView; + using FVElementGeometry = typename GetPropType<TypeTag, Properties::GridGeometry>::LocalView; using SubControlVolume = typename FVElementGeometry::SubControlVolume; using SubControlVolumeFace = typename FVElementGeometry::SubControlVolumeFace; - using FVGridGeometry = GetPropType<TypeTag, Properties::FVGridGeometry>; + using FVGridGeometry = GetPropType<TypeTag, Properties::GridGeometry>; using GridVariables = GetPropType<TypeTag, Properties::GridVariables>; using ElementFluxVariablesCache = typename GridVariables::GridFluxVariablesCache::LocalView; @@ -250,16 +250,16 @@ public: private: bool onLeftBoundary_(const GlobalPosition &globalPos) const - { return globalPos[0] < this->fvGridGeometry().bBoxMin()[0] + eps_; } + { return globalPos[0] < this->gridGeometry().bBoxMin()[0] + eps_; } bool onRightBoundary_(const GlobalPosition &globalPos) const - { return globalPos[0] > this->fvGridGeometry().bBoxMax()[0] - eps_; } + { return globalPos[0] > this->gridGeometry().bBoxMax()[0] - eps_; } bool onLowerBoundary_(const GlobalPosition &globalPos) const - { return globalPos[1] < this->fvGridGeometry().bBoxMin()[1] + eps_; } + { return globalPos[1] < this->gridGeometry().bBoxMin()[1] + eps_; } bool onUpperBoundary_(const GlobalPosition &globalPos) const - { return globalPos[1] > this->fvGridGeometry().bBoxMax()[1] - eps_; } + { return globalPos[1] > this->gridGeometry().bBoxMax()[1] - eps_; } Scalar eps_; std::shared_ptr<CouplingManager> couplingManager_; diff --git a/exercises/solution/exercise-coupling-ff-pm/models/freeflowsubproblem.hh b/exercises/solution/exercise-coupling-ff-pm/models/freeflowsubproblem.hh index 8b421dd42a39a5df9f284b74461cffeaca3a8b3f..dd2e0a7ccba2b6473e18fbc44d0fae252868c728 100644 --- a/exercises/solution/exercise-coupling-ff-pm/models/freeflowsubproblem.hh +++ b/exercises/solution/exercise-coupling-ff-pm/models/freeflowsubproblem.hh @@ -94,7 +94,7 @@ class FreeFlowSubProblem : public NavierStokesProblem<TypeTag> using Indices = typename GetPropType<TypeTag, Properties::ModelTraits>::Indices; using BoundaryTypes = GetPropType<TypeTag, Properties::BoundaryTypes>; - using FVGridGeometry = GetPropType<TypeTag, Properties::FVGridGeometry>; + using FVGridGeometry = GetPropType<TypeTag, Properties::GridGeometry>; using FVElementGeometry = typename FVGridGeometry::LocalView; using SubControlVolumeFace = typename FVElementGeometry::SubControlVolumeFace; using Element = typename GridView::template Codim<0>::Entity; @@ -271,13 +271,13 @@ public: FluidState fluidState; updateFluidStateForBC_(fluidState, pressure_); const Scalar density = FluidSystem::density(fluidState, 0); - values[Indices::pressureIdx] = pressure_ - density*this->gravity()[1]*(this->fvGridGeometry().bBoxMax()[1] - globalPos[1]); + values[Indices::pressureIdx] = pressure_ - density*this->gravity()[1]*(this->gridGeometry().bBoxMax()[1] - globalPos[1]); // gravity has negative sign values[Indices::conti0EqIdx + 1] = moleFraction_; - values[Indices::velocityXIdx] = 4.0 * velocity_ * (globalPos[1] - this->fvGridGeometry().bBoxMin()[1]) - * (this->fvGridGeometry().bBoxMax()[1] - globalPos[1]) + values[Indices::velocityXIdx] = 4.0 * velocity_ * (globalPos[1] - this->gridGeometry().bBoxMin()[1]) + * (this->gridGeometry().bBoxMax()[1] - globalPos[1]) / (height_() * height_()); return values; @@ -306,16 +306,16 @@ public: private: bool onLeftBoundary_(const GlobalPosition &globalPos) const - { return globalPos[0] < this->fvGridGeometry().bBoxMin()[0] + eps_; } + { return globalPos[0] < this->gridGeometry().bBoxMin()[0] + eps_; } bool onRightBoundary_(const GlobalPosition &globalPos) const - { return globalPos[0] > this->fvGridGeometry().bBoxMax()[0] - eps_; } + { return globalPos[0] > this->gridGeometry().bBoxMax()[0] - eps_; } bool onLowerBoundary_(const GlobalPosition &globalPos) const - { return globalPos[1] < this->fvGridGeometry().bBoxMin()[1] + eps_; } + { return globalPos[1] < this->gridGeometry().bBoxMin()[1] + eps_; } bool onUpperBoundary_(const GlobalPosition &globalPos) const - { return globalPos[1] > this->fvGridGeometry().bBoxMax()[1] - eps_; } + { return globalPos[1] > this->gridGeometry().bBoxMax()[1] - eps_; } //! \brief updates the fluid state to obtain required quantities for IC/BC void updateFluidStateForBC_(FluidState& fluidState, const Scalar pressure) const @@ -340,7 +340,7 @@ private: } // the height of the free-flow domain const Scalar height_() const - { return this->fvGridGeometry().bBoxMax()[1] - this->fvGridGeometry().bBoxMin()[1]; } + { return this->gridGeometry().bBoxMax()[1] - this->gridGeometry().bBoxMin()[1]; } Scalar eps_; diff --git a/exercises/solution/exercise-coupling-ff-pm/models/main.cc b/exercises/solution/exercise-coupling-ff-pm/models/main.cc index e08716c0bf97c35e34680b204b6042f7898e33b4..174eddbaeeec1c7441ddca241ea31939cf4e71c2 100644 --- a/exercises/solution/exercise-coupling-ff-pm/models/main.cc +++ b/exercises/solution/exercise-coupling-ff-pm/models/main.cc @@ -105,10 +105,10 @@ int main(int argc, char** argv) try const auto& stokesGridView = stokesGridManager.grid().leafGridView(); // create the finite volume grid geometry - using StokesFVGridGeometry = GetPropType<StokesTypeTag, Properties::FVGridGeometry>; + using StokesFVGridGeometry = GetPropType<StokesTypeTag, Properties::GridGeometry>; auto stokesFvGridGeometry = std::make_shared<StokesFVGridGeometry>(stokesGridView); stokesFvGridGeometry->update(); - using DarcyFVGridGeometry = GetPropType<DarcyTypeTag, Properties::FVGridGeometry>; + using DarcyFVGridGeometry = GetPropType<DarcyTypeTag, Properties::GridGeometry>; auto darcyFvGridGeometry = std::make_shared<DarcyFVGridGeometry>(darcyGridView); darcyFvGridGeometry->update(); diff --git a/exercises/solution/exercise-coupling-ff-pm/models/porousmediumsubproblem.hh b/exercises/solution/exercise-coupling-ff-pm/models/porousmediumsubproblem.hh index c5717968952980abfca49a520bbffd4895bbbb00..3cd6b0155fa015f0ac105ccd514ce2e36e53a98b 100644 --- a/exercises/solution/exercise-coupling-ff-pm/models/porousmediumsubproblem.hh +++ b/exercises/solution/exercise-coupling-ff-pm/models/porousmediumsubproblem.hh @@ -101,12 +101,12 @@ struct Formulation<TypeTag, TTag::DarcyOnePNC> #if EXNUMBER >= 1 template<class TypeTag> struct SpatialParams<TypeTag, TTag::DarcyOnePNC> { - using type = TwoPSpatialParams<GetPropType<TypeTag, FVGridGeometry>, GetPropType<TypeTag, Scalar>>; + using type = TwoPSpatialParams<GetPropType<TypeTag, GridGeometry>, GetPropType<TypeTag, Scalar>>; }; #else template<class TypeTag> struct SpatialParams<TypeTag, TTag::DarcyOnePNC> { - using type = OnePSpatialParams<GetPropType<TypeTag, FVGridGeometry>, GetPropType<TypeTag, Scalar>>; + using type = OnePSpatialParams<GetPropType<TypeTag, GridGeometry>, GetPropType<TypeTag, Scalar>>; }; #endif @@ -122,10 +122,10 @@ class PorousMediumSubProblem : public PorousMediumFlowProblem<TypeTag> using FluidSystem = GetPropType<TypeTag, Properties::FluidSystem>; using NumEqVector = GetPropType<TypeTag, Properties::NumEqVector>; using BoundaryTypes = GetPropType<TypeTag, Properties::BoundaryTypes>; - using FVElementGeometry = typename GetPropType<TypeTag, Properties::FVGridGeometry>::LocalView; + using FVElementGeometry = typename GetPropType<TypeTag, Properties::GridGeometry>::LocalView; using SubControlVolume = typename FVElementGeometry::SubControlVolume; using SubControlVolumeFace = typename FVElementGeometry::SubControlVolumeFace; - using FVGridGeometry = GetPropType<TypeTag, Properties::FVGridGeometry>; + using FVGridGeometry = GetPropType<TypeTag, Properties::GridGeometry>; using GridVariables = GetPropType<TypeTag, Properties::GridVariables>; using ElementFluxVariablesCache = typename GridVariables::GridFluxVariablesCache::LocalView; @@ -228,9 +228,9 @@ public: // compute the mass in the entire domain Scalar waterMass = 0.0; - for (const auto& element : elements(this->fvGridGeometry().gridView())) + for (const auto& element : elements(this->gridGeometry().gridView())) { - auto fvGeometry = localView(this->fvGridGeometry()); + auto fvGeometry = localView(this->gridGeometry()); fvGeometry.bindElement(element); auto elemVolVars = localView(gridVariables.curGridVolVars()); @@ -258,7 +258,7 @@ public: Scalar cumMassLoss = initialWaterContent_ - waterMass; Scalar evaporationRate = (lastWaterMass_ - waterMass) * 86400 - / (this->fvGridGeometry().bBoxMax()[0] - this->fvGridGeometry().bBoxMin()[0]) + / (this->gridGeometry().bBoxMax()[0] - this->gridGeometry().bBoxMin()[0]) / timeLoop_->timeStepSize(); lastWaterMass_ = waterMass; @@ -279,9 +279,9 @@ public: std::vector<Scalar> x; std::vector<Scalar> y; - for (const auto& element : elements(this->fvGridGeometry().gridView())) + for (const auto& element : elements(this->gridGeometry().gridView())) { - auto fvGeometry = localView(this->fvGridGeometry()); + auto fvGeometry = localView(this->gridGeometry()); fvGeometry.bindElement(element); auto elemVolVars = localView(gridVariables.curGridVolVars()); @@ -305,7 +305,7 @@ public: gnuplotInterfaceFluxes_.resetPlot(); gnuplotInterfaceFluxes_.setXlabel("x-position [m]"); - gnuplotInterfaceFluxes_.setXRange(this->fvGridGeometry().bBoxMin()[0], this->fvGridGeometry().bBoxMax()[0]); + gnuplotInterfaceFluxes_.setXRange(this->gridGeometry().bBoxMin()[0], this->gridGeometry().bBoxMax()[0]); gnuplotInterfaceFluxes_.setYlabel("flux [kg/(m^2 s)]"); gnuplotInterfaceFluxes_.setYRange(-5e-4, 0.0); gnuplotInterfaceFluxes_.setOption("set label 'time: " + std::to_string(timeLoop_->time()/86400.) + "d' at graph 0.8,0.8 "); @@ -442,16 +442,16 @@ public: private: bool onLeftBoundary_(const GlobalPosition &globalPos) const - { return globalPos[0] < this->fvGridGeometry().bBoxMin()[0] + eps_; } + { return globalPos[0] < this->gridGeometry().bBoxMin()[0] + eps_; } bool onRightBoundary_(const GlobalPosition &globalPos) const - { return globalPos[0] > this->fvGridGeometry().bBoxMax()[0] - eps_; } + { return globalPos[0] > this->gridGeometry().bBoxMax()[0] - eps_; } bool onLowerBoundary_(const GlobalPosition &globalPos) const - { return globalPos[1] < this->fvGridGeometry().bBoxMin()[1] + eps_; } + { return globalPos[1] < this->gridGeometry().bBoxMin()[1] + eps_; } bool onUpperBoundary_(const GlobalPosition &globalPos) const - { return globalPos[1] > this->fvGridGeometry().bBoxMax()[1] - eps_; } + { return globalPos[1] > this->gridGeometry().bBoxMax()[1] - eps_; } Scalar eps_; #if EXNUMBER >= 3 diff --git a/exercises/solution/exercise-coupling-ff-pm/turbulence/freeflowsubproblem.hh b/exercises/solution/exercise-coupling-ff-pm/turbulence/freeflowsubproblem.hh index 5430d5494fcf3f85c803bec22687a99be5015cf2..ca908bf47fb8fbe9b10fc2d3a669512837249097 100644 --- a/exercises/solution/exercise-coupling-ff-pm/turbulence/freeflowsubproblem.hh +++ b/exercises/solution/exercise-coupling-ff-pm/turbulence/freeflowsubproblem.hh @@ -105,7 +105,7 @@ class FreeFlowSubProblem : public NavierStokesProblem<TypeTag> using Indices = typename GetPropType<TypeTag, Properties::ModelTraits>::Indices; using BoundaryTypes = GetPropType<TypeTag, Properties::BoundaryTypes>; - using FVGridGeometry = GetPropType<TypeTag, Properties::FVGridGeometry>; + using FVGridGeometry = GetPropType<TypeTag, Properties::GridGeometry>; using FVElementGeometry = typename FVGridGeometry::LocalView; using SubControlVolumeFace = typename FVElementGeometry::SubControlVolumeFace; using Element = typename GridView::template Codim<0>::Entity; @@ -311,7 +311,7 @@ public: const Scalar density = FluidSystem::density(fluidState, 0); PrimaryVariables values(0.0); - values[Indices::pressureIdx] = refPressure() + density*this->gravity()[1]*(globalPos[1] - this->fvGridGeometry().bBoxMin()[1]); + values[Indices::pressureIdx] = refPressure() + density*this->gravity()[1]*(globalPos[1] - this->gridGeometry().bBoxMin()[1]); values[Indices::conti0EqIdx + 1] = refMoleFrac(); values[Indices::velocityXIdx] = refVelocity(); values[Indices::temperatureIdx] = refTemperature(); @@ -367,16 +367,16 @@ public: private: bool onLeftBoundary_(const GlobalPosition &globalPos) const - { return globalPos[0] < this->fvGridGeometry().bBoxMin()[0] + eps_; } + { return globalPos[0] < this->gridGeometry().bBoxMin()[0] + eps_; } bool onRightBoundary_(const GlobalPosition &globalPos) const - { return globalPos[0] > this->fvGridGeometry().bBoxMax()[0] - eps_; } + { return globalPos[0] > this->gridGeometry().bBoxMax()[0] - eps_; } bool onLowerBoundary_(const GlobalPosition &globalPos) const - { return globalPos[1] < this->fvGridGeometry().bBoxMin()[1] + eps_; } + { return globalPos[1] < this->gridGeometry().bBoxMin()[1] + eps_; } bool onUpperBoundary_(const GlobalPosition &globalPos) const - { return globalPos[1] > this->fvGridGeometry().bBoxMax()[1] - eps_; } + { return globalPos[1] > this->gridGeometry().bBoxMax()[1] - eps_; } //! \brief updates the fluid state to obtain required quantities for IC/BC void updateFluidStateForBC_(FluidState& fluidState, const Scalar temperature, @@ -403,7 +403,7 @@ private: // the height of the free-flow domain const Scalar height_() const - { return this->fvGridGeometry().bBoxMax()[1] - this->fvGridGeometry().bBoxMin()[1]; } + { return this->gridGeometry().bBoxMax()[1] - this->gridGeometry().bBoxMin()[1]; } Scalar eps_; diff --git a/exercises/solution/exercise-coupling-ff-pm/turbulence/main.cc b/exercises/solution/exercise-coupling-ff-pm/turbulence/main.cc index a8e1dd2d3d9c52c6c6efbeed90b5973d1b97efc3..14366f44d6c0c64252c527c8473583f9ff0c460f 100644 --- a/exercises/solution/exercise-coupling-ff-pm/turbulence/main.cc +++ b/exercises/solution/exercise-coupling-ff-pm/turbulence/main.cc @@ -105,10 +105,10 @@ int main(int argc, char** argv) try const auto& stokesGridView = stokesGridManager.grid().leafGridView(); // create the finite volume grid geometry - using StokesFVGridGeometry = GetPropType<StokesTypeTag, Properties::FVGridGeometry>; + using StokesFVGridGeometry = GetPropType<StokesTypeTag, Properties::GridGeometry>; auto stokesFvGridGeometry = std::make_shared<StokesFVGridGeometry>(stokesGridView); stokesFvGridGeometry->update(); - using DarcyFVGridGeometry = GetPropType<DarcyTypeTag, Properties::FVGridGeometry>; + using DarcyFVGridGeometry = GetPropType<DarcyTypeTag, Properties::GridGeometry>; auto darcyFvGridGeometry = std::make_shared<DarcyFVGridGeometry>(darcyGridView); darcyFvGridGeometry->update(); diff --git a/exercises/solution/exercise-coupling-ff-pm/turbulence/porousmediumsubproblem.hh b/exercises/solution/exercise-coupling-ff-pm/turbulence/porousmediumsubproblem.hh index a4adce2d6ab66394a29d02cfa2974390dab53656..95b10d6b9b85c1b1f341dd7130d5d11b930193d3 100644 --- a/exercises/solution/exercise-coupling-ff-pm/turbulence/porousmediumsubproblem.hh +++ b/exercises/solution/exercise-coupling-ff-pm/turbulence/porousmediumsubproblem.hh @@ -73,7 +73,7 @@ struct UseMoles<TypeTag, TTag::DarcyTwoPTwoCNI> { static constexpr bool value = template<class TypeTag> struct SpatialParams<TypeTag, TTag::DarcyTwoPTwoCNI> { - using type = TwoPSpatialParams<GetPropType<TypeTag, FVGridGeometry>, GetPropType<TypeTag, Scalar>>; + using type = TwoPSpatialParams<GetPropType<TypeTag, GridGeometry>, GetPropType<TypeTag, Scalar>>; }; } // end namespace Properties @@ -91,10 +91,10 @@ class PorousMediumSubProblem : public PorousMediumFlowProblem<TypeTag> using NumEqVector = GetPropType<TypeTag, Properties::NumEqVector>; using BoundaryTypes = GetPropType<TypeTag, Properties::BoundaryTypes>; using VolumeVariables = GetPropType<TypeTag, Properties::VolumeVariables>; - using FVElementGeometry = typename GetPropType<TypeTag, Properties::FVGridGeometry>::LocalView; + using FVElementGeometry = typename GetPropType<TypeTag, Properties::GridGeometry>::LocalView; using SubControlVolume = typename FVElementGeometry::SubControlVolume; using SubControlVolumeFace = typename FVElementGeometry::SubControlVolumeFace; - using FVGridGeometry = GetPropType<TypeTag, Properties::FVGridGeometry>; + using FVGridGeometry = GetPropType<TypeTag, Properties::GridGeometry>; using ElementVolumeVariables = typename GetPropType<TypeTag, Properties::GridVolumeVariables>::LocalView; using GridVariables = GetPropType<TypeTag, Properties::GridVariables>; using ElementFluxVariablesCache = typename GridVariables::GridFluxVariablesCache::LocalView; @@ -149,9 +149,9 @@ public: Scalar massWater = 0.0; // bulk elements - for (const auto& element : elements(this->fvGridGeometry().gridView())) + for (const auto& element : elements(this->gridGeometry().gridView())) { - auto fvGeometry = localView(this->fvGridGeometry()); + auto fvGeometry = localView(this->gridGeometry()); fvGeometry.bindElement(element); auto elemVolVars = localView(gridVariables.curGridVolVars()); @@ -286,7 +286,7 @@ public: PrimaryVariables values(0.0); values.setState(initialPhasePresence_); - values[pressureIdx] = pressure_ + 1. * this->spatialParams().gravity(globalPos)[1] * (globalPos[1] - this->fvGridGeometry().bBoxMax()[1]); + values[pressureIdx] = pressure_ + 1. * this->spatialParams().gravity(globalPos)[1] * (globalPos[1] - this->gridGeometry().bBoxMax()[1]); values[switchIdx] = initialSw_; values[Indices::temperatureIdx] = temperature_; @@ -312,16 +312,16 @@ public: private: bool onLeftBoundary_(const GlobalPosition &globalPos) const - { return globalPos[0] < this->fvGridGeometry().bBoxMin()[0] + eps_; } + { return globalPos[0] < this->gridGeometry().bBoxMin()[0] + eps_; } bool onRightBoundary_(const GlobalPosition &globalPos) const - { return globalPos[0] > this->fvGridGeometry().bBoxMax()[0] - eps_; } + { return globalPos[0] > this->gridGeometry().bBoxMax()[0] - eps_; } bool onLowerBoundary_(const GlobalPosition &globalPos) const - { return globalPos[1] < this->fvGridGeometry().bBoxMin()[1] + eps_; } + { return globalPos[1] < this->gridGeometry().bBoxMin()[1] + eps_; } bool onUpperBoundary_(const GlobalPosition &globalPos) const - { return globalPos[1] > this->fvGridGeometry().bBoxMax()[1] - eps_; } + { return globalPos[1] > this->gridGeometry().bBoxMax()[1] - eps_; } Scalar pressure_; Scalar initialSw_; diff --git a/exercises/solution/exercise-fluidsystem/2p2cproblem.hh b/exercises/solution/exercise-fluidsystem/2p2cproblem.hh index b015f84f8184be1acd0cd9e0fb0d24701a9faa6b..be956670d39fcbf12e351512a54670254e7f1afb 100644 --- a/exercises/solution/exercise-fluidsystem/2p2cproblem.hh +++ b/exercises/solution/exercise-fluidsystem/2p2cproblem.hh @@ -62,7 +62,7 @@ template<class TypeTag> struct SpatialParams<TypeTag, TTag::ExerciseFluidsystemTwoPTwoC> { private: - using FVGridGeometry = GetPropType<TypeTag, Properties::FVGridGeometry>; + using FVGridGeometry = GetPropType<TypeTag, Properties::GridGeometry>; using Scalar = GetPropType<TypeTag, Properties::Scalar>; public: using type = ExerciseFluidsystemSpatialParams<FVGridGeometry, Scalar>; @@ -107,8 +107,8 @@ class ExerciseFluidsystemProblemTwoPTwoC : public PorousMediumFlowProblem<TypeTa using Indices = typename GetPropType<TypeTag, Properties::ModelTraits>::Indices; using PrimaryVariables = GetPropType<TypeTag, Properties::PrimaryVariables>; using BoundaryTypes = GetPropType<TypeTag, Properties::BoundaryTypes>; - using FVGridGeometry = GetPropType<TypeTag, Properties::FVGridGeometry>; - using FVElementGeometry = typename GetPropType<TypeTag, Properties::FVGridGeometry>::LocalView; + using FVGridGeometry = GetPropType<TypeTag, Properties::GridGeometry>; + using FVElementGeometry = typename GetPropType<TypeTag, Properties::GridGeometry>::LocalView; using FluidSystem = GetPropType<TypeTag, Properties::FluidSystem>; using NumEqVector = GetPropType<TypeTag, Properties::NumEqVector>; @@ -121,7 +121,7 @@ public: FluidSystem::init(); // set the depth of the bottom of the reservoir - depthBOR_ = this->fvGridGeometry().bBoxMax()[dimWorld-1]; + depthBOR_ = this->gridGeometry().bBoxMax()[dimWorld-1]; } /*! @@ -151,7 +151,7 @@ public: { BoundaryTypes bcTypes; - if (globalPos[0] < eps_ || globalPos[0] > this->fvGridGeometry().bBoxMax()[0] - eps_) + if (globalPos[0] < eps_ || globalPos[0] > this->gridGeometry().bBoxMax()[0] - eps_) bcTypes.setAllDirichlet(); else bcTypes.setAllNeumann(); @@ -187,7 +187,7 @@ public: // initialize values to zero, i.e. no-flow Neumann boundary conditions NumEqVector values(0.0); - Scalar up = this->fvGridGeometry().bBoxMax()[dimWorld-1]; + Scalar up = this->gridGeometry().bBoxMax()[dimWorld-1]; // extraction of oil (30 g/m/s) on a segment of the upper boundary if (globalPos[dimWorld-1] > up - eps_ && globalPos[0] > 20 && globalPos[0] < 40) { diff --git a/exercises/solution/exercise-fluidsystem/2pproblem.hh b/exercises/solution/exercise-fluidsystem/2pproblem.hh index 92726d10888620f36fcf940709b3d29dfbfababe..cb5b5d2fb182108193fc27eb0a7421248ede9d43 100644 --- a/exercises/solution/exercise-fluidsystem/2pproblem.hh +++ b/exercises/solution/exercise-fluidsystem/2pproblem.hh @@ -76,7 +76,7 @@ template<class TypeTag> struct SpatialParams<TypeTag, TTag::ExerciseFluidsystemTwoP> { private: - using FVGridGeometry = GetPropType<TypeTag, Properties::FVGridGeometry>; + using FVGridGeometry = GetPropType<TypeTag, Properties::GridGeometry>; using Scalar = GetPropType<TypeTag, Properties::Scalar>; public: using type = ExerciseFluidsystemSpatialParams<FVGridGeometry, Scalar>; @@ -129,8 +129,8 @@ class ExerciseFluidsystemProblemTwoP : public PorousMediumFlowProblem<TypeTag> using Indices = typename GetPropType<TypeTag, Properties::ModelTraits>::Indices; using PrimaryVariables = GetPropType<TypeTag, Properties::PrimaryVariables>; using BoundaryTypes = GetPropType<TypeTag, Properties::BoundaryTypes>; - using FVGridGeometry = GetPropType<TypeTag, Properties::FVGridGeometry>; - using FVElementGeometry = typename GetPropType<TypeTag, Properties::FVGridGeometry>::LocalView; + using FVGridGeometry = GetPropType<TypeTag, Properties::GridGeometry>; + using FVElementGeometry = typename GetPropType<TypeTag, Properties::GridGeometry>::LocalView; using FluidSystem = GetPropType<TypeTag, Properties::FluidSystem>; using FluidState = GetPropType<TypeTag, Properties::FluidState>; using NumEqVector = GetPropType<TypeTag, Properties::NumEqVector>; @@ -157,7 +157,7 @@ public: /*numP=*/200); // set the depth of the bottom of the reservoir - depthBOR_ = this->fvGridGeometry().bBoxMax()[dimWorld-1]; + depthBOR_ = this->gridGeometry().bBoxMax()[dimWorld-1]; // plot density over pressure of the phase consisting of your component if(getParam<bool>("Output.PlotDensity")) @@ -191,7 +191,7 @@ public: { BoundaryTypes bcTypes; - if (globalPos[0] < eps_ || globalPos[0] > this->fvGridGeometry().bBoxMax()[0] - eps_) + if (globalPos[0] < eps_ || globalPos[0] > this->gridGeometry().bBoxMax()[0] - eps_) bcTypes.setAllDirichlet(); else bcTypes.setAllNeumann(); @@ -227,7 +227,7 @@ public: // initialize values to zero, i.e. no-flow Neumann boundary conditions NumEqVector values(0.0); - Scalar up = this->fvGridGeometry().bBoxMax()[dimWorld-1]; + Scalar up = this->gridGeometry().bBoxMax()[dimWorld-1]; // influx of oil (30 g/m/s) over a segment of the top boundary if (globalPos[dimWorld-1] > up - eps_ && globalPos[0] > 20 && globalPos[0] < 40) diff --git a/exercises/solution/exercise-fluidsystem/main.cc b/exercises/solution/exercise-fluidsystem/main.cc index c90d22abb24024985e3bb5501aecad37cc059a34..571e04518886e6ce6c1e872fd33bd0133828f1e7 100644 --- a/exercises/solution/exercise-fluidsystem/main.cc +++ b/exercises/solution/exercise-fluidsystem/main.cc @@ -88,7 +88,7 @@ int main(int argc, char** argv) try const auto& leafGridView = gridManager.grid().leafGridView(); // create the finite volume grid geometry - using FVGridGeometry = GetPropType<TypeTag, Properties::FVGridGeometry>; + using FVGridGeometry = GetPropType<TypeTag, Properties::GridGeometry>; auto fvGridGeometry = std::make_shared<FVGridGeometry>(leafGridView); fvGridGeometry->update(); diff --git a/exercises/solution/exercise-fractures/fractureproblem.hh b/exercises/solution/exercise-fractures/fractureproblem.hh index e20a9bc5d3c56dff7a13ac5429a729d0cb1bc857..a0645b002071459aa8be60f59eee79ceea500f12 100644 --- a/exercises/solution/exercise-fractures/fractureproblem.hh +++ b/exercises/solution/exercise-fractures/fractureproblem.hh @@ -66,7 +66,7 @@ struct Problem<TypeTag, TTag::FractureProblem> { using type = FractureSubProblem template<class TypeTag> struct SpatialParams<TypeTag, TTag::FractureProblem> { - using type = FractureSpatialParams< GetPropType<TypeTag, Properties::FVGridGeometry>, + using type = FractureSpatialParams< GetPropType<TypeTag, Properties::GridGeometry>, GetPropType<TypeTag, Properties::Scalar> >; }; @@ -145,7 +145,7 @@ public: // fracture tip we set Dirichlet Bcs - only in the unmodified state of // the exercise though. In parts a, b & c we consider Neumann here. if (!isExercisePartA_ && !isExercisePartB_ && !isExercisePartC_) - if (globalPos[1] > this->fvGridGeometry().bBoxMax()[1] - 1e-6) + if (globalPos[1] > this->gridGeometry().bBoxMax()[1] - 1e-6) values.setAllDirichlet(); return values; @@ -183,7 +183,7 @@ public: { // For the grid used here, the height of the domain is equal // to the maximum y-coordinate - const auto domainHeight = this->fvGridGeometry().bBoxMax()[1]; + const auto domainHeight = this->gridGeometry().bBoxMax()[1]; // we assume a constant water density of 1000 for initial conditions! const auto& g = this->spatialParams().gravity(globalPos); diff --git a/exercises/solution/exercise-fractures/main.cc b/exercises/solution/exercise-fractures/main.cc index b52e3c9c00ff66be1068d7f0c8e474864fa832ce..cd8ba733eb26999d03b1fed1cba6f0f69ee89b85 100644 --- a/exercises/solution/exercise-fractures/main.cc +++ b/exercises/solution/exercise-fractures/main.cc @@ -52,8 +52,8 @@ // reuse them again in the main function with only one single definition of them here using MatrixTypeTag = Dumux::Properties::TTag::MatrixProblem; using FractureTypeTag = Dumux::Properties::TTag::FractureProblem; -using MatrixFVGridGeometry = Dumux::GetPropType<MatrixTypeTag, Dumux::Properties::FVGridGeometry>; -using FractureFVGridGeometry = Dumux::GetPropType<FractureTypeTag, Dumux::Properties::FVGridGeometry>; +using MatrixFVGridGeometry = Dumux::GetPropType<MatrixTypeTag, Dumux::Properties::GridGeometry>; +using FractureFVGridGeometry = Dumux::GetPropType<FractureTypeTag, Dumux::Properties::GridGeometry>; using TheMultiDomainTraits = Dumux::MultiDomainTraits<MatrixTypeTag, FractureTypeTag>; using TheCouplingMapper = Dumux::FacetCouplingMapper<MatrixFVGridGeometry, FractureFVGridGeometry>; using TheCouplingManager = Dumux::FacetCouplingManager<TheMultiDomainTraits, TheCouplingMapper>; diff --git a/exercises/solution/exercise-fractures/matrixproblem.hh b/exercises/solution/exercise-fractures/matrixproblem.hh index e967be6f5e8f496574ec0b72d572f7efae3befa4..d0dad09c39f87b0f11704c04fe2c9bf062992772 100644 --- a/exercises/solution/exercise-fractures/matrixproblem.hh +++ b/exercises/solution/exercise-fractures/matrixproblem.hh @@ -74,7 +74,7 @@ struct Problem<TypeTag, TTag::MatrixProblem> { using type = MatrixSubProblem<Typ template<class TypeTag> struct SpatialParams<TypeTag, TTag::MatrixProblem> { - using type = MatrixSpatialParams< GetPropType<TypeTag, Properties::FVGridGeometry>, + using type = MatrixSpatialParams< GetPropType<TypeTag, Properties::GridGeometry>, GetPropType<TypeTag, Properties::Scalar> >; }; @@ -154,7 +154,7 @@ public: if (!isExercisePartA_ && !isExercisePartB_ && !isExercisePartC_) { values.setAllNeumann(); - if (globalPos[1] < 1e-6 || globalPos[1] > this->fvGridGeometry().bBoxMax()[1] - 1e-6) + if (globalPos[1] < 1e-6 || globalPos[1] > this->gridGeometry().bBoxMax()[1] - 1e-6) values.setAllDirichlet(); } else @@ -162,7 +162,7 @@ public: // for exercise part a,b & c we use no-flow boundaries everywhere // except for the lower quarter of the left and the upper quarter of the right boundary values.setAllNeumann(); - if ( (globalPos[0] > this->fvGridGeometry().bBoxMax()[0] - 1e-6 && globalPos[1] > 75.0) || + if ( (globalPos[0] > this->gridGeometry().bBoxMax()[0] - 1e-6 && globalPos[1] > 75.0) || (globalPos[0] < 1e-6 && globalPos[1] < 25.0) ) values.setAllDirichlet(); } @@ -233,7 +233,7 @@ public: else { // apply overpressure on the right Dirichlet boundary segment - if (globalPos[0] > this->fvGridGeometry().bBoxMax()[0] - 1e-6) + if (globalPos[0] > this->gridGeometry().bBoxMax()[0] - 1e-6) { values[pressureIdx] += boundaryOverPressure_; values[saturationIdx] = boundarySaturation_; @@ -248,7 +248,7 @@ public: { // For the grid used here, the height of the domain is equal // to the maximum y-coordinate - const auto domainHeight = this->fvGridGeometry().bBoxMax()[1]; + const auto domainHeight = this->gridGeometry().bBoxMax()[1]; // we assume a constant water density of 1000 for initial conditions! const auto& g = this->spatialParams().gravity(globalPos); diff --git a/exercises/solution/exercise-grids/main.cc b/exercises/solution/exercise-grids/main.cc index ea52463b1f80bacc1506b8adef3511bc124145fd..62e20adf0d82b9f045711714cc8c03b19173bc79 100644 --- a/exercises/solution/exercise-grids/main.cc +++ b/exercises/solution/exercise-grids/main.cc @@ -81,7 +81,7 @@ int main(int argc, char** argv) try const auto& leafGridView = gridManager.grid().leafGridView(); // create the finite volume grid geometry - using FVGridGeometry = GetPropType<TypeTag, Properties::FVGridGeometry>; + using FVGridGeometry = GetPropType<TypeTag, Properties::GridGeometry>; auto fvGridGeometry = std::make_shared<FVGridGeometry>(leafGridView); fvGridGeometry->update(); diff --git a/exercises/solution/exercise-grids/problem.hh b/exercises/solution/exercise-grids/problem.hh index 3b4d250b3cac9829ef8cc32d1eec95b7374a87c0..a67d2f478b13c41c166d7e236ae1efe21a465e8f 100644 --- a/exercises/solution/exercise-grids/problem.hh +++ b/exercises/solution/exercise-grids/problem.hh @@ -72,7 +72,7 @@ template<class TypeTag> struct SpatialParams<TypeTag, TTag::Injection2p> { private: - using FVGridGeometry = GetPropType<TypeTag, Properties::FVGridGeometry>; + using FVGridGeometry = GetPropType<TypeTag, Properties::GridGeometry>; using Scalar = GetPropType<TypeTag, Properties::Scalar>; public: using type = InjectionSpatialParams<FVGridGeometry, Scalar>; @@ -113,8 +113,8 @@ class InjectionProblem2P : public PorousMediumFlowProblem<TypeTag> using Indices = typename GetPropType<TypeTag, Properties::ModelTraits>::Indices; using PrimaryVariables = GetPropType<TypeTag, Properties::PrimaryVariables>; using BoundaryTypes = GetPropType<TypeTag, Properties::BoundaryTypes>; - using FVGridGeometry = GetPropType<TypeTag, Properties::FVGridGeometry>; - using FVElementGeometry = typename GetPropType<TypeTag, Properties::FVGridGeometry>::LocalView; + using FVGridGeometry = GetPropType<TypeTag, Properties::GridGeometry>; + using FVElementGeometry = typename GetPropType<TypeTag, Properties::GridGeometry>::LocalView; using FluidSystem = GetPropType<TypeTag, Properties::FluidSystem>; using NumEqVector = GetPropType<TypeTag, Properties::NumEqVector>; @@ -217,7 +217,7 @@ public: // using < boundary + eps_ or > boundary - eps_ is safer for floating point comparisons // than using <= or >= as it is robust with regard to imprecision introduced by rounding errors. if (time_ < injectionDuration_ - && globalPos[1] < 15 + eps_ && globalPos[1] > 7 - eps_ && globalPos[0] > 0.9*this->fvGridGeometry().bBoxMax()[0]) + && globalPos[1] < 15 + eps_ && globalPos[1] > 7 - eps_ && globalPos[0] > 0.9*this->gridGeometry().bBoxMax()[0]) { // inject nitrogen. negative values mean injection // units kg/(s*m^2) diff --git a/exercises/solution/exercise-mainfile/1pproblem.hh b/exercises/solution/exercise-mainfile/1pproblem.hh index 7971075bd3d822dddfd5126c4a4cd1f79ebb5277..7641119d93c237c05e64f36a1c67a15a68d90e5c 100644 --- a/exercises/solution/exercise-mainfile/1pproblem.hh +++ b/exercises/solution/exercise-mainfile/1pproblem.hh @@ -71,7 +71,7 @@ struct Problem<TypeTag, TTag::OnePBase> { using type = OnePTestProblem<TypeTag>; // set the spatial params template<class TypeTag> struct SpatialParams<TypeTag, TTag::OnePBase> { - using type = OnePTestSpatialParams<GetPropType<TypeTag, FVGridGeometry>, GetPropType<TypeTag, Scalar>>; + using type = OnePTestSpatialParams<GetPropType<TypeTag, GridGeometry>, GetPropType<TypeTag, Scalar>>; }; // the fluid system for incompressible tests @@ -124,7 +124,7 @@ class OnePTestProblem : public PorousMediumFlowProblem<TypeTag> using Element = typename GridView::template Codim<0>::Entity; using Scalar = GetPropType<TypeTag, Properties::Scalar>; using PrimaryVariables = GetPropType<TypeTag, Properties::PrimaryVariables>; - using FVGridGeometry = GetPropType<TypeTag, Properties::FVGridGeometry>; + using FVGridGeometry = GetPropType<TypeTag, Properties::GridGeometry>; using BoundaryTypes = GetPropType<TypeTag, Properties::BoundaryTypes>; static constexpr int dimWorld = GridView::dimensionworld; using GlobalPosition = typename Element::Geometry::GlobalCoordinate; @@ -153,7 +153,7 @@ public: BoundaryTypes values; Scalar eps = 1.0e-6; - if (globalPos[dimWorld-1] < eps || globalPos[dimWorld-1] > this->fvGridGeometry().bBoxMax()[dimWorld-1] - eps) + if (globalPos[dimWorld-1] < eps || globalPos[dimWorld-1] > this->gridGeometry().bBoxMax()[dimWorld-1] - eps) values.setAllDirichlet(); else values.setAllNeumann(); diff --git a/exercises/solution/exercise-mainfile/exercise1pa_solution_main.cc b/exercises/solution/exercise-mainfile/exercise1pa_solution_main.cc index 93a65e39c243c1f08d8dd0b9916c38d94d048562..105fff588603de1f4b33f46e7bb76511581bd58f 100644 --- a/exercises/solution/exercise-mainfile/exercise1pa_solution_main.cc +++ b/exercises/solution/exercise-mainfile/exercise1pa_solution_main.cc @@ -81,7 +81,7 @@ int main(int argc, char** argv) try const auto& leafGridView = gridManager.grid().leafGridView(); // create the finite volume grid geometry - using FVGridGeometry = GetPropType<TypeTag, Properties::FVGridGeometry>; + using FVGridGeometry = GetPropType<TypeTag, Properties::GridGeometry>; auto fvGridGeometry = std::make_shared<FVGridGeometry>(leafGridView); fvGridGeometry->update(); diff --git a/exercises/solution/exercise-properties/main.cc b/exercises/solution/exercise-properties/main.cc index 4621c44b1d6ef2ecb027827927e3364c653c8a18..df4d8a75d2045523105fccab988e7fb2b5e92d32 100644 --- a/exercises/solution/exercise-properties/main.cc +++ b/exercises/solution/exercise-properties/main.cc @@ -113,7 +113,7 @@ int main(int argc, char** argv) try const auto& leafGridView = gridManager.grid().leafGridView(); // create the finite volume grid geometry - using FVGridGeometry = GetPropType<TypeTag, Properties::FVGridGeometry>; + using FVGridGeometry = GetPropType<TypeTag, Properties::GridGeometry>; auto fvGridGeometry = std::make_shared<FVGridGeometry>(leafGridView); fvGridGeometry->update(); diff --git a/exercises/solution/exercise-properties/mylocalresidual.hh b/exercises/solution/exercise-properties/mylocalresidual.hh index 5b80d2e3e5c9122ed0ff08ddb3c67d47b89c4783..79fb5d8088c34eca205e3e4452271d83299c3d86 100644 --- a/exercises/solution/exercise-properties/mylocalresidual.hh +++ b/exercises/solution/exercise-properties/mylocalresidual.hh @@ -45,7 +45,7 @@ class MyLocalResidual : public GetPropType<TypeTag, Properties::BaseLocalResidua using ElementVolumeVariables = typename GetPropType<TypeTag, Properties::GridVolumeVariables>::LocalView; using FluxVariables = GetPropType<TypeTag, Properties::FluxVariables>; using ElementFluxVariablesCache = typename GetPropType<TypeTag, Properties::GridFluxVariablesCache>::LocalView; - using FVElementGeometry = typename GetPropType<TypeTag, Properties::FVGridGeometry>::LocalView; + using FVElementGeometry = typename GetPropType<TypeTag, Properties::GridGeometry>::LocalView; using SubControlVolume = typename FVElementGeometry::SubControlVolume; using SubControlVolumeFace = typename FVElementGeometry::SubControlVolumeFace; using GridView = GetPropType<TypeTag, Properties::GridView>; diff --git a/exercises/solution/exercise-properties/problem.hh b/exercises/solution/exercise-properties/problem.hh index 66a822ec62742b9db02cb8a0c7fed40949652fef..123a8806d2ef83d1af47494dcc4b27c9021d35dd 100644 --- a/exercises/solution/exercise-properties/problem.hh +++ b/exercises/solution/exercise-properties/problem.hh @@ -78,7 +78,7 @@ template<class TypeTag> struct SpatialParams<TypeTag, TTag::TwoPIncompressible> { private: - using FVGridGeometry = GetPropType<TypeTag, Properties::FVGridGeometry>; + using FVGridGeometry = GetPropType<TypeTag, Properties::GridGeometry>; using Scalar = GetPropType<TypeTag, Properties::Scalar>; public: using type = TwoPTestSpatialParams<FVGridGeometry, Scalar>; @@ -98,7 +98,7 @@ class TwoPTestProblem : public PorousMediumFlowProblem<TypeTag> using Scalar = GetPropType<TypeTag, Properties::Scalar>; using FluidSystem = GetPropType<TypeTag, Properties::FluidSystem>; using PrimaryVariables = GetPropType<TypeTag, Properties::PrimaryVariables>; - using FVGridGeometry = GetPropType<TypeTag, Properties::FVGridGeometry>; + using FVGridGeometry = GetPropType<TypeTag, Properties::GridGeometry>; using BoundaryTypes = GetPropType<TypeTag, Properties::BoundaryTypes>; using GlobalPosition = typename Element::Geometry::GlobalCoordinate; using NumEqVector = GetPropType<TypeTag, Properties::NumEqVector>; @@ -150,10 +150,10 @@ public: Scalar densityW = FluidSystem::density(fluidState, waterPhaseIdx); - Scalar height = this->fvGridGeometry().bBoxMax()[1] - this->fvGridGeometry().bBoxMin()[1]; - Scalar depth = this->fvGridGeometry().bBoxMax()[1] - globalPos[1]; + Scalar height = this->gridGeometry().bBoxMax()[1] - this->gridGeometry().bBoxMin()[1]; + Scalar depth = this->gridGeometry().bBoxMax()[1] - globalPos[1]; Scalar alpha = 1 + 1.5/height; - Scalar width = this->fvGridGeometry().bBoxMax()[0] - this->fvGridGeometry().bBoxMin()[0]; + Scalar width = this->gridGeometry().bBoxMax()[0] - this->gridGeometry().bBoxMin()[0]; Scalar factor = (width*alpha + (1.0 - alpha)*globalPos[0])/width; // hydrostatic pressure scaled by alpha @@ -203,7 +203,7 @@ public: Scalar densityW = FluidSystem::density(fluidState, waterPhaseIdx); - Scalar depth = this->fvGridGeometry().bBoxMax()[1] - globalPos[1]; + Scalar depth = this->gridGeometry().bBoxMax()[1] - globalPos[1]; // hydrostatic pressure values[pressureH2OIdx] = 1e5 - densityW*this->spatialParams().gravity(globalPos)[1]*depth; @@ -226,28 +226,28 @@ public: private: bool onLeftBoundary_(const GlobalPosition &globalPos) const { - return globalPos[0] < this->fvGridGeometry().bBoxMin()[0] + eps_; + return globalPos[0] < this->gridGeometry().bBoxMin()[0] + eps_; } bool onRightBoundary_(const GlobalPosition &globalPos) const { - return globalPos[0] > this->fvGridGeometry().bBoxMax()[0] - eps_; + return globalPos[0] > this->gridGeometry().bBoxMax()[0] - eps_; } bool onLowerBoundary_(const GlobalPosition &globalPos) const { - return globalPos[1] < this->fvGridGeometry().bBoxMin()[1] + eps_; + return globalPos[1] < this->gridGeometry().bBoxMin()[1] + eps_; } bool onUpperBoundary_(const GlobalPosition &globalPos) const { - return globalPos[1] > this->fvGridGeometry().bBoxMax()[1] - eps_; + return globalPos[1] > this->gridGeometry().bBoxMax()[1] - eps_; } bool onInlet_(const GlobalPosition &globalPos) const { - Scalar width = this->fvGridGeometry().bBoxMax()[0] - this->fvGridGeometry().bBoxMin()[0]; - Scalar lambda = (this->fvGridGeometry().bBoxMax()[0] - globalPos[0])/width; + Scalar width = this->gridGeometry().bBoxMax()[0] - this->gridGeometry().bBoxMin()[0]; + Scalar lambda = (this->gridGeometry().bBoxMax()[0] - globalPos[0])/width; return onUpperBoundary_(globalPos) && 0.5 < lambda && lambda < 2.0/3.0; } diff --git a/exercises/solution/exercise-runtimeparams/main.cc b/exercises/solution/exercise-runtimeparams/main.cc index e4221b46173dde8e7209826fe8dc0cd30600e891..0919336e9db6e162c839d2c4621c512968580910 100644 --- a/exercises/solution/exercise-runtimeparams/main.cc +++ b/exercises/solution/exercise-runtimeparams/main.cc @@ -81,7 +81,7 @@ int main(int argc, char** argv) try const auto& leafGridView = gridManager.grid().leafGridView(); // create the finite volume grid geometry - using FVGridGeometry = GetPropType<TypeTag, Properties::FVGridGeometry>; + using FVGridGeometry = GetPropType<TypeTag, Properties::GridGeometry>; auto fvGridGeometry = std::make_shared<FVGridGeometry>(leafGridView); fvGridGeometry->update(); diff --git a/exercises/solution/exercise-runtimeparams/problem.hh b/exercises/solution/exercise-runtimeparams/problem.hh index b9729bcff8cd58de532d6ca2203994e7e7ae9d6f..fee8ff30d029bd91aa5b095bc3216b16eb6eab2e 100644 --- a/exercises/solution/exercise-runtimeparams/problem.hh +++ b/exercises/solution/exercise-runtimeparams/problem.hh @@ -61,7 +61,7 @@ template<class TypeTag> struct SpatialParams<TypeTag, TTag::Injection2p> { private: - using FVGridGeometry = GetPropType<TypeTag, Properties::FVGridGeometry>; + using FVGridGeometry = GetPropType<TypeTag, Properties::GridGeometry>; using Scalar = GetPropType<TypeTag, Properties::Scalar>; public: using type = InjectionSpatialParams<FVGridGeometry, Scalar>; @@ -102,8 +102,8 @@ class InjectionProblem2P : public PorousMediumFlowProblem<TypeTag> using Indices = typename GetPropType<TypeTag, Properties::ModelTraits>::Indices; using PrimaryVariables = GetPropType<TypeTag, Properties::PrimaryVariables>; using BoundaryTypes = GetPropType<TypeTag, Properties::BoundaryTypes>; - using FVGridGeometry = GetPropType<TypeTag, Properties::FVGridGeometry>; - using FVElementGeometry = typename GetPropType<TypeTag, Properties::FVGridGeometry>::LocalView; + using FVGridGeometry = GetPropType<TypeTag, Properties::GridGeometry>; + using FVElementGeometry = typename GetPropType<TypeTag, Properties::GridGeometry>::LocalView; using FluidSystem = GetPropType<TypeTag, Properties::FluidSystem>; using NumEqVector = GetPropType<TypeTag, Properties::NumEqVector>; @@ -215,7 +215,7 @@ public: // using < boundary + eps_ or > boundary - eps_ is safer for floating point comparisons // than using <= or >= as it is robust with regard to imprecision introduced by rounding errors. if (time_ < injectionDuration_ - && globalPos[1] < 15 + eps_ && globalPos[1] > 7 - eps_ && globalPos[0] > 0.9*this->fvGridGeometry().bBoxMax()[0]) + && globalPos[1] < 15 + eps_ && globalPos[1] > 7 - eps_ && globalPos[0] > 0.9*this->gridGeometry().bBoxMax()[0]) { // inject nitrogen. negative values mean injection // units kg/(s*m^2)