From 9fc779c1b4808e8b5ce6f4682b69283b7b3df123 Mon Sep 17 00:00:00 2001 From: Bernd Flemisch <bernd@iws.uni-stuttgart.de> Date: Wed, 9 Oct 2019 10:17:16 +0200 Subject: [PATCH] [cleanup][discretization] use new names G(g)ridGeometry Reflect the change introduced by commit 83fe871a to the Dumux master. Prevent deprecation warnings. --- exercises/exercise-basic/2p2cmain.cc | 2 +- exercises/exercise-basic/2pmain.cc | 2 +- .../exercise-basic/injection2p2cproblem.hh | 8 +++--- .../exercise-basic/injection2pniproblem.hh | 8 +++--- .../exercise-basic/injection2pproblem.hh | 8 +++--- .../biominproblem.hh | 18 ++++++------ .../biominspatialparams.hh | 8 +++--- exercises/exercise-biomineralization/main.cc | 2 +- .../interface/freeflowsubproblem.hh | 24 ++++++++-------- .../exercise-coupling-ff-pm/interface/main.cc | 4 +-- .../interface/porousmediumsubproblem.hh | 14 +++++----- .../models/freeflowsubproblem.hh | 18 ++++++------ .../exercise-coupling-ff-pm/models/main.cc | 4 +-- .../models/porousmediumsubproblem.hh | 26 ++++++++--------- .../turbulence/freeflowsubproblem.hh | 14 +++++----- .../turbulence/main.cc | 4 +-- .../turbulence/porousmediumsubproblem.hh | 20 ++++++------- exercises/exercise-fluidsystem/2p2cproblem.hh | 12 ++++---- exercises/exercise-fluidsystem/2pproblem.hh | 12 ++++---- exercises/exercise-fluidsystem/main.cc | 2 +- .../exercise-fractures/fractureproblem.hh | 6 ++-- exercises/exercise-fractures/main.cc | 4 +-- exercises/exercise-fractures/matrixproblem.hh | 6 ++-- exercises/exercise-grids/main.cc | 2 +- exercises/exercise-grids/problem.hh | 8 +++--- exercises/exercise-mainfile/1pproblem.hh | 6 ++-- .../exercise-mainfile/exercise1pamain.cc | 2 +- .../exercise-mainfile/exercise1pbmain.cc | 2 +- .../exercise-mainfile/exercise1pcmain.cc | 2 +- exercises/exercise-properties/main.cc | 2 +- .../exercise-properties/mylocalresidual.hh | 2 +- exercises/exercise-properties/problem.hh | 24 ++++++++-------- exercises/exercise-runtimeparams/main.cc | 2 +- exercises/exercise-runtimeparams/problem.hh | 8 +++--- exercises/solution/exercise-basic/2pnimain.cc | 2 +- .../exercise-basic/injection2pniproblem.hh | 8 +++--- .../biominproblem.hh | 18 ++++++------ .../biominspatialparams.hh | 8 +++--- .../exercise-biomineralization/main.cc | 2 +- .../interface/freeflowsubproblem.hh | 24 ++++++++-------- .../exercise-coupling-ff-pm/interface/main.cc | 4 +-- .../interface/porousmediumsubproblem.hh | 14 +++++----- .../models/freeflowsubproblem.hh | 18 ++++++------ .../exercise-coupling-ff-pm/models/main.cc | 4 +-- .../models/porousmediumsubproblem.hh | 28 +++++++++---------- .../turbulence/freeflowsubproblem.hh | 14 +++++----- .../turbulence/main.cc | 4 +-- .../turbulence/porousmediumsubproblem.hh | 20 ++++++------- .../exercise-fluidsystem/2p2cproblem.hh | 12 ++++---- .../exercise-fluidsystem/2pproblem.hh | 12 ++++---- .../solution/exercise-fluidsystem/main.cc | 2 +- .../exercise-fractures/fractureproblem.hh | 6 ++-- exercises/solution/exercise-fractures/main.cc | 4 +-- .../exercise-fractures/matrixproblem.hh | 10 +++---- exercises/solution/exercise-grids/main.cc | 2 +- exercises/solution/exercise-grids/problem.hh | 8 +++--- .../solution/exercise-mainfile/1pproblem.hh | 6 ++-- .../exercise1pa_solution_main.cc | 2 +- .../solution/exercise-properties/main.cc | 2 +- .../exercise-properties/mylocalresidual.hh | 2 +- .../solution/exercise-properties/problem.hh | 24 ++++++++-------- .../solution/exercise-runtimeparams/main.cc | 2 +- .../exercise-runtimeparams/problem.hh | 8 +++--- 63 files changed, 278 insertions(+), 278 deletions(-) diff --git a/exercises/exercise-basic/2p2cmain.cc b/exercises/exercise-basic/2p2cmain.cc index a5b2abac..68c0a3ee 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 d539ab3a..a00ad7ad 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 16fc3b24..970b1aa1 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 f8b6ee12..f6cc0c82 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 e20e85c8..1b7c1823 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 7eed331b..46ac8f91 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 3815f373..2c901dc9 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 f6da4fd8..c9b3513b 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 58670a5f..85864cd1 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 d94b7a61..1e3b4908 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 8ef6d182..848178a0 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 bf883a33..952c9b88 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 63aaf9b4..b5bd97a9 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 6e354064..e4845cfb 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 e6abb8e4..374f9db4 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 555feebc..ac198a94 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 7b0ab982..dd44bac6 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 e8aef797..3f39957c 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 4462997f..28a36b1e 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 197c3259..baa1ea78 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 dc92eaa5..76493b12 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 b52e3c9c..cd8ba733 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 85092b7e..07920241 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 9e094d98..90fc1fba 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 680ea9ab..855d4c9e 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 31f4f933..13edd6a8 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 1c260a38..6cfe2dc4 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 9c4af7d5..b5091b33 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 94636e1a..64a7f2ad 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 96d9e9ac..a0179621 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 f69e6b6a..67c390b4 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 b3391869..23c67f48 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 e4221b46..0919336e 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 3ebd1a2a..8cd8ddec 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 c040e49a..34eb43ca 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 73f2fadc..e3d6c288 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 94857d1d..9bf73648 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 3815f373..2c901dc9 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 f6da4fd8..c9b3513b 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 81450154..5fbe9f0e 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 d23c04be..fe8136a8 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 c472d68c..569e99b5 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 8b421dd4..dd2e0a7c 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 e08716c0..174eddba 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 c5717968..3cd6b015 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 5430d549..ca908bf4 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 a8e1dd2d..14366f44 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 a4adce2d..95b10d6b 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 b015f84f..be956670 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 92726d10..cb5b5d2f 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 c90d22ab..571e0451 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 e20a9bc5..a0645b00 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 b52e3c9c..cd8ba733 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 e967be6f..d0dad09c 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 ea52463b..62e20adf 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 3b4d250b..a67d2f47 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 7971075b..7641119d 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 93a65e39..105fff58 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 4621c44b..df4d8a75 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 5b80d2e3..79fb5d80 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 66a822ec..123a8806 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 e4221b46..0919336e 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 b9729bcf..fee8ff30 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) -- GitLab