From aeaa28f3cfae67eababbbb15f664c936c923dd70 Mon Sep 17 00:00:00 2001 From: Bernd Flemisch <bernd@iws.uni-stuttgart.de> Date: Wed, 9 Oct 2019 20:39:53 +0200 Subject: [PATCH] [cleanup] replace fvGridGeometry_ by gridGeometry_ for private variables --- dumux/adaptive/initializationindicator.hh | 14 ++++---- dumux/common/fvproblem.hh | 28 +++++++-------- dumux/discretization/fvgridvariables.hh | 16 ++++----- .../staggered/fvgridgeometry.hh | 18 +++++----- .../discretization/staggered/gridvariables.hh | 10 +++--- dumux/material/spatialparams/fv1p.hh | 8 ++--- dumux/material/spatialparams/fvelastic.hh | 8 ++--- dumux/material/spatialparams/fvporoelastic.hh | 8 ++--- dumux/nonlinear/newtonconvergencewriter.hh | 6 ++-- .../staggerednewtonconvergencewriter.hh | 12 +++---- .../porousmediumflow/2p/gridadaptindicator.hh | 34 +++++++++---------- dumux/porousmediumflow/2p/griddatatransfer.hh | 32 ++++++++--------- .../nonequilibrium/gridvariables.hh | 10 +++--- dumux/porousmediumflow/velocity.hh | 16 ++++----- 14 files changed, 110 insertions(+), 110 deletions(-) diff --git a/dumux/adaptive/initializationindicator.hh b/dumux/adaptive/initializationindicator.hh index 079a63de27..885def6841 100644 --- a/dumux/adaptive/initializationindicator.hh +++ b/dumux/adaptive/initializationindicator.hh @@ -73,7 +73,7 @@ public: std::shared_ptr<const GridGeometry> gridGeometry, std::shared_ptr<const GridVariables> gridVariables) : problem_(problem) - , fvGridGeometry_(gridGeometry) + , gridGeometry_(gridGeometry) , gridVariables_(gridVariables) , minLevel_(getParamFromGroup<int>(problem->paramGroup(), "Adaptive.MinLevel")) , maxLevel_(getParamFromGroup<int>(problem->paramGroup(), "Adaptive.MaxLevel")) @@ -141,11 +141,11 @@ public: void calculate(const SolutionVector& sol) { //! prepare an indicator for refinement - indicatorVector_.assign(fvGridGeometry_->gridView().size(0), false); + indicatorVector_.assign(gridGeometry_->gridView().size(0), false); - for (const auto& element : elements(fvGridGeometry_->gridView())) + for (const auto& element : elements(gridGeometry_->gridView())) { - const auto eIdx = fvGridGeometry_->elementMapper().index(element); + const auto eIdx = gridGeometry_->elementMapper().index(element); //! refine any element being below the minimum level if (element.level() < minLevel_) @@ -163,7 +163,7 @@ public: continue; // get the fvGeometry and elementVolVars needed for the bc and source interfaces - auto fvGeometry = localView(*fvGridGeometry_); + auto fvGeometry = localView(*gridGeometry_); fvGeometry.bind(element); auto elemVolVars = localView(gridVariables_->curGridVolVars()); @@ -274,14 +274,14 @@ public: */ int operator() (const Element& element) const { - if (indicatorVector_[fvGridGeometry_->elementMapper().index(element)]) + if (indicatorVector_[gridGeometry_->elementMapper().index(element)]) return 1; return 0; } private: std::shared_ptr<const Problem> problem_; //!< The problem to be solved - std::shared_ptr<const GridGeometry> fvGridGeometry_; //!< The finite volume grid geometry + std::shared_ptr<const GridGeometry> gridGeometry_; //!< The finite volume grid geometry std::shared_ptr<const GridVariables> gridVariables_; //!< The secondary variables on the grid std::vector<bool> indicatorVector_; //!< Indicator for BCs/sources diff --git a/dumux/common/fvproblem.hh b/dumux/common/fvproblem.hh index b40f3337b1..d60eda1297 100644 --- a/dumux/common/fvproblem.hh +++ b/dumux/common/fvproblem.hh @@ -96,7 +96,7 @@ public: * \param paramGroup The parameter group in which to look for runtime parameters first (default is "") */ FVProblem(std::shared_ptr<const FVGridGeometry> fvGridGeometry, const std::string& paramGroup = "") - : fvGridGeometry_(fvGridGeometry) + : gridGeometry_(fvGridGeometry) , paramGroup_(paramGroup) { // set a default name for the problem @@ -439,7 +439,7 @@ public: { NumEqVector source(0); auto scvIdx = scv.indexInElement(); - auto key = std::make_pair(fvGridGeometry_->elementMapper().index(element), scvIdx); + auto key = std::make_pair(gridGeometry_->elementMapper().index(element), scvIdx); if (pointSourceMap_.count(key)) { // call the solDependent function. Herein the user might fill/add values to the point sources @@ -493,7 +493,7 @@ public: if (!sources.empty()) { // calculate point source locations and save them in a map - PointSourceHelper::computePointSourceMap(*fvGridGeometry_, + PointSourceHelper::computePointSourceMap(*gridGeometry_, sources, pointSourceMap_); } @@ -586,7 +586,7 @@ public: //! The finite volume grid geometry const FVGridGeometry& gridGeometry() const - { return *fvGridGeometry_; } + { return *gridGeometry_; } //! The parameter group in which to retrieve runtime parameters const std::string& paramGroup() const @@ -607,8 +607,8 @@ private: */ void applyInitialSolutionImpl_(SolutionVector& sol, /*isBox=*/std::true_type) const { - const auto numDofs = fvGridGeometry_->vertexMapper().size(); - const auto numVert = fvGridGeometry_->gridView().size(dim); + const auto numDofs = gridGeometry_->vertexMapper().size(); + const auto numVert = gridGeometry_->gridView().size(dim); sol.resize(numDofs); // if there are more dofs than vertices (enriched nodal dofs), we have to @@ -616,11 +616,11 @@ private: if (numDofs != numVert) { std::vector<bool> dofVisited(numDofs, false); - for (const auto& element : elements(fvGridGeometry_->gridView())) + for (const auto& element : elements(gridGeometry_->gridView())) { for (int i = 0; i < element.subEntities(dim); ++i) { - const auto dofIdxGlobal = fvGridGeometry_->vertexMapper().subIndex(element, i, dim); + const auto dofIdxGlobal = gridGeometry_->vertexMapper().subIndex(element, i, dim); // forward to implementation if value at dof is not set yet if (!dofVisited[dofIdxGlobal]) @@ -635,9 +635,9 @@ private: // otherwise we directly loop over the vertices else { - for (const auto& vertex : vertices(fvGridGeometry_->gridView())) + for (const auto& vertex : vertices(gridGeometry_->gridView())) { - const auto dofIdxGlobal = fvGridGeometry_->vertexMapper().index(vertex); + const auto dofIdxGlobal = gridGeometry_->vertexMapper().index(vertex); sol[dofIdxGlobal] = asImp_().initial(vertex); } } @@ -648,16 +648,16 @@ private: */ void applyInitialSolutionImpl_(SolutionVector& sol, /*isBox=*/std::false_type) const { - sol.resize(fvGridGeometry_->numDofs()); - for (const auto& element : elements(fvGridGeometry_->gridView())) + sol.resize(gridGeometry_->numDofs()); + for (const auto& element : elements(gridGeometry_->gridView())) { - const auto dofIdxGlobal = fvGridGeometry_->elementMapper().index(element); + const auto dofIdxGlobal = gridGeometry_->elementMapper().index(element); sol[dofIdxGlobal] = asImp_().initial(element); } } //! The finite volume grid geometry - std::shared_ptr<const FVGridGeometry> fvGridGeometry_; + std::shared_ptr<const FVGridGeometry> gridGeometry_; //! The parameter group in which to retrieve runtime parameters std::string paramGroup_; diff --git a/dumux/discretization/fvgridvariables.hh b/dumux/discretization/fvgridvariables.hh index 751bfff5a0..b40876a230 100644 --- a/dumux/discretization/fvgridvariables.hh +++ b/dumux/discretization/fvgridvariables.hh @@ -62,7 +62,7 @@ public: template<class Problem> FVGridVariables(std::shared_ptr<Problem> problem, std::shared_ptr<const GridGeometry> fvGridGeometry) - : fvGridGeometry_(fvGridGeometry) + : gridGeometry_(fvGridGeometry) , curGridVolVars_(*problem) , prevGridVolVars_(*problem) , gridFluxVarsCache_(*problem) @@ -73,10 +73,10 @@ public: void init(const SolutionVector& curSol) { // resize and update the volVars with the initial solution - curGridVolVars_.update(*fvGridGeometry_, curSol); + curGridVolVars_.update(*gridGeometry_, curSol); // update the flux variables caches (always force flux cache update on initialization) - gridFluxVarsCache_.update(*fvGridGeometry_, curGridVolVars_, curSol, true); + gridFluxVarsCache_.update(*gridGeometry_, curGridVolVars_, curSol, true); // set the volvars of the previous time step in case we have an instationary problem // note that this means some memory overhead in the case of enabled caching, however @@ -99,10 +99,10 @@ public: void update(const SolutionVector& curSol, bool forceFluxCacheUpdate = false) { // resize and update the volVars with the initial solution - curGridVolVars_.update(*fvGridGeometry_, curSol); + curGridVolVars_.update(*gridGeometry_, curSol); // update the flux variables caches - gridFluxVarsCache_.update(*fvGridGeometry_, curGridVolVars_, curSol, forceFluxCacheUpdate); + gridFluxVarsCache_.update(*gridGeometry_, curGridVolVars_, curSol, forceFluxCacheUpdate); } //! update all variables after grid adaption @@ -134,7 +134,7 @@ public: curGridVolVars_ = prevGridVolVars_; // update the flux variables caches - gridFluxVarsCache_.update(*fvGridGeometry_, curGridVolVars_, solution); + gridFluxVarsCache_.update(*gridGeometry_, curGridVolVars_, solution); } //! return the flux variables cache @@ -168,11 +168,11 @@ public: //! return the finite volume grid geometry const GridGeometry& gridGeometry() const - { return *fvGridGeometry_; } + { return *gridGeometry_; } protected: - std::shared_ptr<const GridGeometry> fvGridGeometry_; //!< pointer to the constant grid geometry + std::shared_ptr<const GridGeometry> gridGeometry_; //!< pointer to the constant grid geometry private: GridVolumeVariables curGridVolVars_; //!< the current volume variables (primary and secondary variables) diff --git a/dumux/discretization/staggered/fvgridgeometry.hh b/dumux/discretization/staggered/fvgridgeometry.hh index 72f1f40ea1..df122047d2 100644 --- a/dumux/discretization/staggered/fvgridgeometry.hh +++ b/dumux/discretization/staggered/fvgridgeometry.hh @@ -42,7 +42,7 @@ class GridGeometryView public: explicit GridGeometryView(const ActualFVGridGeometry* actualFVGridGeometry) - : fvGridGeometry_(actualFVGridGeometry) {} + : gridGeometry_(actualFVGridGeometry) {} //! export the GridView type and the discretization method using GridView = typename ActualFVGridGeometry::GridView; @@ -75,35 +75,35 @@ public: * \brief Return the gridView this grid geometry object lives on */ const auto& gridView() const - { return fvGridGeometry_->gridView(); } + { return gridGeometry_->gridView(); } /*! * \brief Returns the connectivity map of which dofs have derivatives with respect * to a given dof. */ const auto& connectivityMap() const // TODO return correct map - { return fvGridGeometry_->connectivityMap(); } + { return gridGeometry_->connectivityMap(); } /*! * \brief Returns the mapper for vertices to indices for possibly adaptive grids. */ const auto& vertexMapper() const - { return fvGridGeometry_->vertexMapper(); } + { return gridGeometry_->vertexMapper(); } /*! * \brief Returns the mapper for elements to indices for constant grids. */ const auto& elementMapper() const - { return fvGridGeometry_->elementMapper(); } + { return gridGeometry_->elementMapper(); } /*! * \brief Returns the actual gridGeometry we are a restriction of */ const ActualFVGridGeometry& actualfvGridGeometry() const - { return *fvGridGeometry_; } + { return *gridGeometry_; } protected: - const ActualFVGridGeometry* fvGridGeometry_; + const ActualFVGridGeometry* gridGeometry_; }; @@ -129,7 +129,7 @@ public: * \brief The total number of cell centered dofs */ std::size_t numDofs() const - { return this->fvGridGeometry_->numCellCenterDofs(); } + { return this->gridGeometry_->numCellCenterDofs(); } }; /*! @@ -154,7 +154,7 @@ public: * \brief The total number of cell centered dofs */ std::size_t numDofs() const - { return this->fvGridGeometry_->numFaceDofs(); } + { return this->gridGeometry_->numFaceDofs(); } }; /*! diff --git a/dumux/discretization/staggered/gridvariables.hh b/dumux/discretization/staggered/gridvariables.hh index 95d8578a92..02d1f7663a 100644 --- a/dumux/discretization/staggered/gridvariables.hh +++ b/dumux/discretization/staggered/gridvariables.hh @@ -95,10 +95,10 @@ public: //! return the fv grid geometry [[deprecated("Use gridGeometry() instead. fvGridGeometry() will be removed after 3.1!")]] const FVGridGeometry& fvGridGeometry() const - { return (*gridVariables_->fvGridGeometry_); } + { return (*gridVariables_->gridGeometry_); } //! return the fv grid geometry const FVGridGeometry& gridGeometry() const - { return (*gridVariables_->fvGridGeometry_); } + { return (*gridVariables_->gridGeometry_); } // return the actual grid variables const ActualGridVariables& gridVariables() const @@ -249,7 +249,7 @@ public: void update(const SolutionVector& curSol) { ParentType::update(curSol[cellCenterIdx]); - curGridFaceVariables_.update(*this->fvGridGeometry_, curSol[faceIdx]); + curGridFaceVariables_.update(*this->gridGeometry_, curSol[faceIdx]); } //! initialize all variables (stationary case) @@ -257,8 +257,8 @@ public: void init(const SolutionVector& curSol) { ParentType::init(curSol[cellCenterIdx]); - curGridFaceVariables_.update(*this->fvGridGeometry_, curSol[faceIdx]); - prevGridFaceVariables_.update(*this->fvGridGeometry_, curSol[faceIdx]); + curGridFaceVariables_.update(*this->gridGeometry_, curSol[faceIdx]); + prevGridFaceVariables_.update(*this->gridGeometry_, curSol[faceIdx]); } //! initialize all variables (instationary case) diff --git a/dumux/material/spatialparams/fv1p.hh b/dumux/material/spatialparams/fv1p.hh index c058c4804d..fecc19e4e1 100644 --- a/dumux/material/spatialparams/fv1p.hh +++ b/dumux/material/spatialparams/fv1p.hh @@ -89,7 +89,7 @@ class FVSpatialParamsOneP public: FVSpatialParamsOneP(std::shared_ptr<const GridGeometry> gridGeometry) - : fvGridGeometry_(gridGeometry) + : gridGeometry_(gridGeometry) , gravity_(0.0) { const bool enableGravity = getParam<bool>("Problem.EnableGravity"); @@ -328,11 +328,11 @@ public: //! The finite volume grid geometry [[deprecated("Use gridGeometry() instead. fvGridGeometry() will be removed after 3.1!")]] const GridGeometry& fvGridGeometry() const - { return *fvGridGeometry_; } + { return *gridGeometry_; } //! The finite volume grid geometry const GridGeometry& gridGeometry() const - { return *fvGridGeometry_; } + { return *gridGeometry_; } protected: @@ -343,7 +343,7 @@ protected: { return *static_cast<const Implementation*>(this); } private: - std::shared_ptr<const GridGeometry> fvGridGeometry_; + std::shared_ptr<const GridGeometry> gridGeometry_; GlobalPosition gravity_; //!< The gravity vector Scalar forchCoeffDefault_; }; diff --git a/dumux/material/spatialparams/fvelastic.hh b/dumux/material/spatialparams/fvelastic.hh index e13dcad2dc..84f67a3363 100644 --- a/dumux/material/spatialparams/fvelastic.hh +++ b/dumux/material/spatialparams/fvelastic.hh @@ -67,7 +67,7 @@ class FVSpatialParamsElastic public: //! The constructor FVSpatialParamsElastic(std::shared_ptr<const GridGeometry> gridGeometry) - : fvGridGeometry_(gridGeometry) + : gridGeometry_(gridGeometry) , gravity_(0.0) { const bool enableGravity = getParam<bool>("Problem.EnableGravity"); @@ -161,11 +161,11 @@ public: //! The finite volume grid geometry [[deprecated("Use gridGeometry() instead. fvGridGeometry() will be removed after 3.1!")]] const GridGeometry& fvGridGeometry() const - { return *fvGridGeometry_; } + { return *gridGeometry_; } //! The finite volume grid geometry const GridGeometry& gridGeometry() const - { return *fvGridGeometry_; } + { return *gridGeometry_; } protected: Implementation &asImp_() @@ -175,7 +175,7 @@ protected: { return *static_cast<const Implementation*>(this); } private: - std::shared_ptr<const GridGeometry> fvGridGeometry_; + std::shared_ptr<const GridGeometry> gridGeometry_; GlobalPosition gravity_; //!< The gravity vector }; } // end namespace Dumuxs diff --git a/dumux/material/spatialparams/fvporoelastic.hh b/dumux/material/spatialparams/fvporoelastic.hh index 26df014c13..602893c0c2 100644 --- a/dumux/material/spatialparams/fvporoelastic.hh +++ b/dumux/material/spatialparams/fvporoelastic.hh @@ -88,7 +88,7 @@ class FVSpatialParamsPoroElastic public: //! The constructor FVSpatialParamsPoroElastic(std::shared_ptr<const GridGeometry> gridGeometry) - : fvGridGeometry_(gridGeometry) + : gridGeometry_(gridGeometry) , gravity_(0.0) { const bool enableGravity = getParam<bool>("Problem.EnableGravity"); @@ -316,11 +316,11 @@ public: //! The finite volume grid geometry [[deprecated("Use gridGeometry() instead. fvGridGeometry() will be removed after 3.1!")]] const GridGeometry& fvGridGeometry() const - { return *fvGridGeometry_; } + { return *gridGeometry_; } //! The finite volume grid geometry const GridGeometry& gridGeometry() const - { return *fvGridGeometry_; } + { return *gridGeometry_; } protected: Implementation &asImp_() @@ -330,7 +330,7 @@ protected: { return *static_cast<const Implementation*>(this); } private: - std::shared_ptr<const GridGeometry> fvGridGeometry_; + std::shared_ptr<const GridGeometry> gridGeometry_; GlobalPosition gravity_; //!< The gravity vector }; } // end namespace Dumux diff --git a/dumux/nonlinear/newtonconvergencewriter.hh b/dumux/nonlinear/newtonconvergencewriter.hh index c3c25469b1..cadf82de45 100644 --- a/dumux/nonlinear/newtonconvergencewriter.hh +++ b/dumux/nonlinear/newtonconvergencewriter.hh @@ -67,7 +67,7 @@ public: */ NewtonConvergenceWriter(const GridGeometry& gridGeometry, const std::string& name = "newton_convergence") - : fvGridGeometry_(gridGeometry) + : gridGeometry_(gridGeometry) , writer_(gridGeometry.gridView(), name, "", "") { resize(); @@ -95,7 +95,7 @@ public: //! Resizes the output fields. This has to be called whenever the grid changes void resize() { - const auto numDofs = fvGridGeometry_.numDofs(); + const auto numDofs = gridGeometry_.numDofs(); // resize the output fields for (int eqIdx = 0; eqIdx < numEq; ++eqIdx) @@ -135,7 +135,7 @@ private: std::size_t id_ = 0UL; std::size_t iteration_ = 0UL; - const GridGeometry& fvGridGeometry_; + const GridGeometry& gridGeometry_; Dune::VTKSequenceWriter<GridView> writer_; diff --git a/dumux/nonlinear/staggerednewtonconvergencewriter.hh b/dumux/nonlinear/staggerednewtonconvergencewriter.hh index e8d09157ce..251a6d5379 100644 --- a/dumux/nonlinear/staggerednewtonconvergencewriter.hh +++ b/dumux/nonlinear/staggerednewtonconvergencewriter.hh @@ -69,7 +69,7 @@ public: */ StaggeredNewtonConvergenceWriter(const GridGeometry& gridGeometry, const std::string& name = "newton_convergence") - : fvGridGeometry_(gridGeometry) + : gridGeometry_(gridGeometry) , ccWriter_(gridGeometry.gridView(), name, "", "") , faceWriter_(std::make_shared<PointCloudVtkWriter<Scalar, GlobalPosition>>(coordinates_)) , faceSequenceWriter_(faceWriter_, name + "-face", "","", @@ -89,8 +89,8 @@ public: //! Resizes the output fields. This has to be called whenever the grid changes void resize() { - const auto numCellCenterDofs = fvGridGeometry_.numCellCenterDofs(); - const auto numFaceDofs = fvGridGeometry_.numFaceDofs(); + const auto numCellCenterDofs = gridGeometry_.numCellCenterDofs(); + const auto numFaceDofs = gridGeometry_.numFaceDofs(); // resize the cell center output fields for (int eqIdx = 0; eqIdx < numEqCellCenter; ++eqIdx) @@ -109,9 +109,9 @@ public: } coordinates_.resize(numFaceDofs); - for (auto&& facet : facets(fvGridGeometry_.gridView())) + for (auto&& facet : facets(gridGeometry_.gridView())) { - const auto dofIdxGlobal = fvGridGeometry_.gridView().indexSet().index(facet); + const auto dofIdxGlobal = gridGeometry_.gridView().indexSet().index(facet); coordinates_[dofIdxGlobal] = facet.geometry().center(); } } @@ -163,7 +163,7 @@ private: std::size_t id_ = 0UL; std::size_t iteration_ = 0UL; - const GridGeometry& fvGridGeometry_; + const GridGeometry& gridGeometry_; Dune::VTKSequenceWriter<GridView> ccWriter_; diff --git a/dumux/porousmediumflow/2p/gridadaptindicator.hh b/dumux/porousmediumflow/2p/gridadaptindicator.hh index 08dbb21ec8..fbf5205699 100644 --- a/dumux/porousmediumflow/2p/gridadaptindicator.hh +++ b/dumux/porousmediumflow/2p/gridadaptindicator.hh @@ -64,10 +64,10 @@ public: * before having been calculated. */ TwoPGridAdaptIndicator(std::shared_ptr<const GridGeometry> gridGeometry, const std::string& paramGroup = "") - : fvGridGeometry_(gridGeometry) + : gridGeometry_(gridGeometry) , refineBound_(std::numeric_limits<Scalar>::max()) , coarsenBound_(std::numeric_limits<Scalar>::lowest()) - , maxSaturationDelta_(fvGridGeometry_->gridView().size(0), 0.0) + , maxSaturationDelta_(gridGeometry_->gridView().size(0), 0.0) , minLevel_(getParamFromGroup<std::size_t>(paramGroup, "Adaptive.MinLevel", 0)) , maxLevel_(getParamFromGroup<std::size_t>(paramGroup, "Adaptive.MaxLevel", 0)) {} @@ -120,7 +120,7 @@ public: //! Reset the indicator to a state that returns false for all elements refineBound_ = std::numeric_limits<Scalar>::max(); coarsenBound_ = std::numeric_limits<Scalar>::lowest(); - maxSaturationDelta_.assign(fvGridGeometry_->gridView().size(0), 0.0); + maxSaturationDelta_.assign(gridGeometry_->gridView().size(0), 0.0); //! maxLevel_ must be higher than minLevel_ to allow for refinement if (minLevel_ >= maxLevel_) @@ -135,15 +135,15 @@ public: Scalar globalMin = std::numeric_limits<Scalar>::max(); //! Calculate minimum and maximum saturation - for (const auto& element : elements(fvGridGeometry_->gridView())) + for (const auto& element : elements(gridGeometry_->gridView())) { //! Index of the current leaf-element - const auto globalIdxI = fvGridGeometry_->elementMapper().index(element); + const auto globalIdxI = gridGeometry_->elementMapper().index(element); //! Obtain the saturation at the center of the element const auto geometry = element.geometry(); - const auto elemSol = elementSolution(element, sol, *fvGridGeometry_); - const Scalar satI = evalSolution(element, geometry, *fvGridGeometry_, elemSol, geometry.center())[saturationIdx]; + const auto elemSol = elementSolution(element, sol, *gridGeometry_); + const Scalar satI = evalSolution(element, geometry, *gridGeometry_, elemSol, geometry.center())[saturationIdx]; //! Maybe update the global minimum/maximum using std::min; @@ -152,22 +152,22 @@ public: globalMax = max(satI, globalMax); //! Calculate maximum delta in saturation for this cell - for (const auto& intersection : intersections(fvGridGeometry_->gridView(), element)) + for (const auto& intersection : intersections(gridGeometry_->gridView(), element)) { //! Only consider internal intersections if (intersection.neighbor()) { //! Access neighbor const auto outside = intersection.outside(); - const auto globalIdxJ = fvGridGeometry_->elementMapper().index(outside); + const auto globalIdxJ = gridGeometry_->elementMapper().index(outside); //! Visit intersection only once if (element.level() > outside.level() || (element.level() == outside.level() && globalIdxI < globalIdxJ)) { //! Obtain saturation in the neighbor const auto outsideGeometry = outside.geometry(); - const auto elemSolJ = elementSolution(outside, sol, *fvGridGeometry_); - const Scalar satJ = evalSolution(outside, outsideGeometry, *fvGridGeometry_, elemSolJ, outsideGeometry.center())[saturationIdx]; + const auto elemSolJ = elementSolution(outside, sol, *gridGeometry_); + const Scalar satJ = evalSolution(outside, outsideGeometry, *gridGeometry_, elemSolJ, outsideGeometry.center())[saturationIdx]; using std::abs; Scalar localdelta = abs(satI - satJ); @@ -201,7 +201,7 @@ public: //#endif //! check if neighbors have to be refined too - for (const auto& element : elements(fvGridGeometry_->gridView(), Dune::Partitions::interior)) + for (const auto& element : elements(gridGeometry_->gridView(), Dune::Partitions::interior)) if (this->operator()(element) > 0) checkNeighborsRefine_(element); } @@ -218,12 +218,12 @@ public: int operator() (const Element& element) const { if (element.hasFather() - && maxSaturationDelta_[fvGridGeometry_->elementMapper().index(element)] < coarsenBound_) + && maxSaturationDelta_[gridGeometry_->elementMapper().index(element)] < coarsenBound_) { return -1; } else if (element.level() < maxLevel_ - && maxSaturationDelta_[fvGridGeometry_->elementMapper().index(element)] > refineBound_) + && maxSaturationDelta_[gridGeometry_->elementMapper().index(element)] > refineBound_) { return 1; } @@ -245,7 +245,7 @@ private: */ bool checkNeighborsRefine_(const Element &element, std::size_t level = 1) { - for(const auto& intersection : intersections(fvGridGeometry_->gridView(), element)) + for(const auto& intersection : intersections(gridGeometry_->gridView(), element)) { if(!intersection.neighbor()) continue; @@ -260,7 +260,7 @@ private: if (outside.level() < maxLevel_ && outside.level() < element.level()) { // ensure refinement for outside element - maxSaturationDelta_[fvGridGeometry_->elementMapper().index(outside)] = std::numeric_limits<Scalar>::max(); + maxSaturationDelta_[gridGeometry_->elementMapper().index(outside)] = std::numeric_limits<Scalar>::max(); if(level < maxLevel_) checkNeighborsRefine_(outside, ++level); } @@ -269,7 +269,7 @@ private: return true; } - std::shared_ptr<const GridGeometry> fvGridGeometry_; + std::shared_ptr<const GridGeometry> gridGeometry_; Scalar refineBound_; Scalar coarsenBound_; diff --git a/dumux/porousmediumflow/2p/griddatatransfer.hh b/dumux/porousmediumflow/2p/griddatatransfer.hh index 9dbf6bf9f7..8027dd913e 100644 --- a/dumux/porousmediumflow/2p/griddatatransfer.hh +++ b/dumux/porousmediumflow/2p/griddatatransfer.hh @@ -119,7 +119,7 @@ public: SolutionVector& sol) : GridDataTransfer() , problem_(problem) - , fvGridGeometry_(gridGeometry) + , gridGeometry_(gridGeometry) , gridVariables_(gridVariables) , sol_(sol) , adaptionMap_(gridGeometry->gridView().grid(), 0) @@ -137,7 +137,7 @@ public: { adaptionMap_.resize(); - const auto& grid = fvGridGeometry_->gridView().grid(); + const auto& grid = gridGeometry_->gridView().grid(); for (auto level = grid.maxLevel(); level >= 0; level--) { for (const auto& element : elements(grid.levelGridView(level))) @@ -148,11 +148,11 @@ public: // put values in the map for leaf elements if (element.isLeaf()) { - auto fvGeometry = localView(*fvGridGeometry_); + auto fvGeometry = localView(*gridGeometry_); fvGeometry.bindElement(element); // store current element solution - adaptedValues.u = ElementSolution(element, sol_, *fvGridGeometry_); + adaptedValues.u = ElementSolution(element, sol_, *gridGeometry_); // compute mass in the scvs for (const auto& scv : scvs(fvGeometry)) @@ -183,7 +183,7 @@ public: // This element solution constructor uses the vertex mapper to obtain // the privars at the vertices, thus, this works for non-leaf elements! if(isBox && !element.isLeaf()) - adaptedValues.u = ElementSolution(element, sol_, *fvGridGeometry_); + adaptedValues.u = ElementSolution(element, sol_, *gridGeometry_); } } } @@ -203,8 +203,8 @@ public: { // resize stuff (grid might have changed) adaptionMap_.resize(); - fvGridGeometry_->update(); - sol_.resize(fvGridGeometry_->numDofs()); + gridGeometry_->update(); + sol_.resize(gridGeometry_->numDofs()); // vectors storing the mass associated with each vertex, when using the box method std::vector<Scalar> massCoeff; @@ -212,18 +212,18 @@ public: if(isBox) { - massCoeff.resize(fvGridGeometry_->numDofs(), 0.0); - associatedMass.resize(fvGridGeometry_->numDofs(), 0.0); + massCoeff.resize(gridGeometry_->numDofs(), 0.0); + associatedMass.resize(gridGeometry_->numDofs(), 0.0); } // iterate over leaf and reconstruct the solution - for (const auto& element : elements(fvGridGeometry_->gridView().grid().leafGridView(), Dune::Partitions::interior)) + for (const auto& element : elements(gridGeometry_->gridView().grid().leafGridView(), Dune::Partitions::interior)) { if (!element.isNew()) { const auto& adaptedValues = adaptionMap_[element]; - auto fvGeometry = localView(*fvGridGeometry_); + auto fvGeometry = localView(*gridGeometry_); fvGeometry.bindElement(element); // obtain element solution from map (divide by count!) @@ -302,7 +302,7 @@ public: auto elemSolSon = adaptedValuesFather.u; elemSolSon[0] /= adaptedValuesFather.count; - auto fvGeometry = localView(*fvGridGeometry_); + auto fvGeometry = localView(*gridGeometry_); fvGeometry.bindElement(element); for (const auto& scv : scvs(fvGeometry)) @@ -326,11 +326,11 @@ public: { auto& adaptedValuesFather = adaptionMap_[fatherElement]; - auto fvGeometry = localView(*fvGridGeometry_); + auto fvGeometry = localView(*gridGeometry_); fvGeometry.bindElement(element); // interpolate solution in the father to the vertices of the new son - ElementSolution elemSolSon(element, sol_, *fvGridGeometry_); + ElementSolution elemSolSon(element, sol_, *gridGeometry_); const auto fatherGeometry = fatherElement.geometry(); for (const auto& scv : scvs(fvGeometry)) elemSolSon[scv.localDofIndex()] = evalSolution(fatherElement, @@ -367,7 +367,7 @@ public: if(isBox) { - for(std::size_t dofIdxGlobal = 0; dofIdxGlobal < fvGridGeometry_->numDofs(); dofIdxGlobal++) + for(std::size_t dofIdxGlobal = 0; dofIdxGlobal < gridGeometry_->numDofs(); dofIdxGlobal++) sol_[dofIdxGlobal][saturationIdx] = associatedMass[dofIdxGlobal] / massCoeff[dofIdxGlobal]; } @@ -434,7 +434,7 @@ public: } std::shared_ptr<const Problem> problem_; - std::shared_ptr<GridGeometry> fvGridGeometry_; + std::shared_ptr<GridGeometry> gridGeometry_; std::shared_ptr<const GridVariables> gridVariables_; SolutionVector& sol_; PersistentContainer adaptionMap_; diff --git a/dumux/porousmediumflow/nonequilibrium/gridvariables.hh b/dumux/porousmediumflow/nonequilibrium/gridvariables.hh index 7d2e2660a3..e273129750 100644 --- a/dumux/porousmediumflow/nonequilibrium/gridvariables.hh +++ b/dumux/porousmediumflow/nonequilibrium/gridvariables.hh @@ -88,15 +88,15 @@ public: for (int phaseIdx = 0; phaseIdx < numPhases; ++phaseIdx) { if(isBox && dim == 1) - velocity[phaseIdx].resize(this->fvGridGeometry_->gridView().size(0)); + velocity[phaseIdx].resize(this->gridGeometry_->gridView().size(0)); else - velocity[phaseIdx].resize(this->fvGridGeometry_->numDofs()); + velocity[phaseIdx].resize(this->gridGeometry_->numDofs()); } - for (const auto& element : elements(this->fvGridGeometry_->gridView(), Dune::Partitions::interior)) + for (const auto& element : elements(this->gridGeometry_->gridView(), Dune::Partitions::interior)) { - const auto eIdxGlobal = this->fvGridGeometry_->elementMapper().index(element); + const auto eIdxGlobal = this->gridGeometry_->elementMapper().index(element); - auto fvGeometry = localView(*this->fvGridGeometry_); + auto fvGeometry = localView(*this->gridGeometry_); auto elemVolVars = localView(this->curGridVolVars()); auto elemFluxVarsCache = localView(this->gridFluxVarsCache()); diff --git a/dumux/porousmediumflow/velocity.hh b/dumux/porousmediumflow/velocity.hh index 4bae490fe2..5531251ccb 100644 --- a/dumux/porousmediumflow/velocity.hh +++ b/dumux/porousmediumflow/velocity.hh @@ -80,18 +80,18 @@ public: */ PorousMediumFlowVelocity(const GridVariables& gridVariables) : problem_(gridVariables.curGridVolVars().problem()) - , fvGridGeometry_(gridVariables.gridGeometry()) + , gridGeometry_(gridVariables.gridGeometry()) , gridVariables_(gridVariables) { // set the number of scvs the vertices are connected to if (isBox && dim > 1) { // resize to the number of vertices of the grid - cellNum_.assign(fvGridGeometry_.gridView().size(dim), 0); + cellNum_.assign(gridGeometry_.gridView().size(dim), 0); - for (const auto& element : elements(fvGridGeometry_.gridView())) + for (const auto& element : elements(gridGeometry_.gridView())) for (unsigned int vIdx = 0; vIdx < element.subEntities(dim); ++vIdx) - ++cellNum_[fvGridGeometry_.vertexMapper().subIndex(element, vIdx, dim)]; + ++cellNum_[gridGeometry_.vertexMapper().subIndex(element, vIdx, dim)]; } } @@ -135,7 +135,7 @@ public: flux /= insideVolVars.extrusionFactor(); tmpVelocity *= flux; - const int eIdxGlobal = fvGridGeometry_.elementMapper().index(element); + const int eIdxGlobal = gridGeometry_.elementMapper().index(element); velocity[eIdxGlobal] = tmpVelocity; } return; @@ -225,7 +225,7 @@ public: // find the local face indices of the scvfs (for conforming meshes) std::vector<unsigned int> scvfIndexInInside(fvGeometry.numScvf()); int localScvfIdx = 0; - for (const auto& intersection : intersections(fvGridGeometry_.gridView(), element)) + for (const auto& intersection : intersections(gridGeometry_.gridView(), element)) { if (dim < dimWorld) if (handledScvf[intersection.indexInInside()]) @@ -331,7 +331,7 @@ public: scvVelocity /= geometry.integrationElement(localPos); - int eIdxGlobal = fvGridGeometry_.elementMapper().index(element); + int eIdxGlobal = gridGeometry_.elementMapper().index(element); velocity[eIdxGlobal] = scvVelocity; @@ -420,7 +420,7 @@ private: { return BoundaryTypes(); } const Problem& problem_; - const GridGeometry& fvGridGeometry_; + const GridGeometry& gridGeometry_; const GridVariables& gridVariables_; std::vector<int> cellNum_; -- GitLab