From 349c79e3874f1e0a29acb5f79372979fda5393a9 Mon Sep 17 00:00:00 2001 From: Martin Schneider Date: Wed, 28 Jul 2021 12:18:12 +0200 Subject: [PATCH 01/10] [disc][gg] New update functions for gridgeometries deprecate old update functions that do not have gridView argument and implement new functions --- dumux/discretization/basegridgeometry.hh | 57 ++-- dumux/discretization/box/fvgridgeometry.hh | 148 ++++++---- .../cellcentered/mpfa/fvgridgeometry.hh | 181 +++++++----- .../cellcentered/tpfa/fvgridgeometry.hh | 144 ++++++---- .../porenetwork/gridgeometry.hh | 90 +++--- .../staggered/fvgridgeometry.hh | 270 ++++++++++-------- dumux/multidomain/facet/box/fvgridgeometry.hh | 180 ++++++++---- .../porousmediumflow/boxdfm/fvgridgeometry.hh | 133 ++++++--- 8 files changed, 753 insertions(+), 450 deletions(-) diff --git a/dumux/discretization/basegridgeometry.hh b/dumux/discretization/basegridgeometry.hh index 56f7690135..2e108d0de3 100644 --- a/dumux/discretization/basegridgeometry.hh +++ b/dumux/discretization/basegridgeometry.hh @@ -24,6 +24,7 @@ #ifndef DUMUX_DISCRETIZATION_BASE_GRID_GEOMETRY_HH #define DUMUX_DISCRETIZATION_BASE_GRID_GEOMETRY_HH +#include #include #include @@ -88,25 +89,28 @@ public: /*! * \brief Update all fvElementGeometries (do this again after grid adaption) */ + [[deprecated("Use update(gridView) instead! Will be removed after release 3.5.")]] void update() { - //! Update the mappers - if constexpr (Deprecated::hasUpdateGridView()) - elementMapper_.update(gridView_); - else - Deprecated::update(elementMapper_); - - if constexpr (Deprecated::hasUpdateGridView()) - vertexMapper_.update(gridView_); - else - Deprecated::update(vertexMapper_); + update_(); + } - //! Compute the bouding box of the entire domain, for e.g. setting boundary conditions - computeGlobalBoundingBox_(); + /*! + * \brief Update all fvElementGeometries (do this again after grid adaption) + */ + void update(const GridView& gridView) + { + gridView_ = gridView; + update_(); + } - //! reset bounding box tree and the element map until requested the next time - boundingBoxTree_.release(); - elementMap_.reset(); + /*! + * \brief Update all fvElementGeometries (do this again after grid adaption) + */ + void update(GridView&& gridView) + { + gridView_ = std::move(gridView); + update_(); } /*! @@ -243,8 +247,29 @@ private: } } + void update_() + { + //! Update the mappers + if constexpr (Deprecated::hasUpdateGridView()) + elementMapper_.update(gridView_); + else + Deprecated::update(elementMapper_); + + if constexpr (Deprecated::hasUpdateGridView()) + vertexMapper_.update(gridView_); + else + Deprecated::update(vertexMapper_); + + //! Compute the bouding box of the entire domain, for e.g. setting boundary conditions + computeGlobalBoundingBox_(); + + //! reset bounding box tree and the element map until requested the next time + boundingBoxTree_.release(); + elementMap_.reset(); + } + //! the process grid view - const GridView gridView_; + GridView gridView_; //! entity mappers ElementMapper elementMapper_; diff --git a/dumux/discretization/box/fvgridgeometry.hh b/dumux/discretization/box/fvgridgeometry.hh index 58479f2276..8860d640d8 100644 --- a/dumux/discretization/box/fvgridgeometry.hh +++ b/dumux/discretization/box/fvgridgeometry.hh @@ -26,6 +26,7 @@ #ifndef DUMUX_DISCRETIZATION_BOX_GRID_FVGEOMETRY_HH #define DUMUX_DISCRETIZATION_BOX_GRID_FVGEOMETRY_HH +#include #include #include @@ -142,10 +143,61 @@ public: { return this->vertexMapper().size(); } //! update all fvElementGeometries (do this again after grid adaption) + [[deprecated("Use update(gridView) instead! Will be removed after release 3.5.")]] void update() { ParentType::update(); + update_(); + } + + //! update all fvElementGeometries (do this again after grid adaption) + void update(const GridView& gridView) + { + ParentType::update(gridView); + update_(); + } + void update(GridView&& gridView) + { + ParentType::update(std::move(gridView)); + update_(); + } + + //! The finite element cache for creating local FE bases + const FeCache& feCache() const + { return feCache_; } + + //! Get the local scvs for an element + const std::vector& scvs(GridIndexType eIdx) const + { return scvs_[eIdx]; } + + //! Get the local scvfs for an element + const std::vector& scvfs(GridIndexType eIdx) const + { return scvfs_[eIdx]; } + + //! If a vertex / d.o.f. is on the boundary + bool dofOnBoundary(GridIndexType dofIdx) const + { return boundaryDofIndices_[dofIdx]; } + + //! If a vertex / d.o.f. is on a periodic boundary + bool dofOnPeriodicBoundary(GridIndexType dofIdx) const + { return periodicVertexMap_.count(dofIdx); } + + //! The index of the vertex / d.o.f. on the other side of the periodic boundary + GridIndexType periodicallyMappedDof(GridIndexType dofIdx) const + { return periodicVertexMap_.at(dofIdx); } + + //! Returns the map between dofs across periodic boundaries + const std::unordered_map& periodicVertexMap() const + { return periodicVertexMap_; } + + //! Returns whether one of the geometry's scvfs lies on a boundary + bool hasBoundaryScvf(GridIndexType eIdx) const + { return hasBoundaryScvf_[eIdx]; } + +private: + void update_() + { scvs_.clear(); scvfs_.clear(); @@ -291,40 +343,6 @@ public: DUNE_THROW(Dune::NotImplemented, "Periodic boundaries for box method for parallel simulations!"); } - //! The finite element cache for creating local FE bases - const FeCache& feCache() const - { return feCache_; } - - //! Get the local scvs for an element - const std::vector& scvs(GridIndexType eIdx) const - { return scvs_[eIdx]; } - - //! Get the local scvfs for an element - const std::vector& scvfs(GridIndexType eIdx) const - { return scvfs_[eIdx]; } - - //! If a vertex / d.o.f. is on the boundary - bool dofOnBoundary(GridIndexType dofIdx) const - { return boundaryDofIndices_[dofIdx]; } - - //! If a vertex / d.o.f. is on a periodic boundary - bool dofOnPeriodicBoundary(GridIndexType dofIdx) const - { return periodicVertexMap_.count(dofIdx); } - - //! The index of the vertex / d.o.f. on the other side of the periodic boundary - GridIndexType periodicallyMappedDof(GridIndexType dofIdx) const - { return periodicVertexMap_.at(dofIdx); } - - //! Returns the map between dofs across periodic boundaries - const std::unordered_map& periodicVertexMap() const - { return periodicVertexMap_; } - - //! Returns whether one of the geometry's scvfs lies on a boundary - bool hasBoundaryScvf(GridIndexType eIdx) const - { return hasBoundaryScvf_[eIdx]; } - -private: - const FeCache feCache_; std::vector> scvs_; @@ -410,10 +428,50 @@ public: { return this->vertexMapper().size(); } //! update all fvElementGeometries (do this again after grid adaption) + [[deprecated("Use update(gridView) instead! Will be removed after release 3.5.")]] void update() { ParentType::update(); + update_(); + } + + //! update all fvElementGeometries (do this again after grid adaption) + void update(const GridView& gridView) + { + ParentType::update(gridView); + update_(); + } + + void update(GridView&& gridView) + { + ParentType::update(std::move(gridView)); + update_(); + } + + //! The finite element cache for creating local FE bases + const FeCache& feCache() const + { return feCache_; } + + //! If a vertex / d.o.f. is on the boundary + bool dofOnBoundary(GridIndexType dofIdx) const + { return boundaryDofIndices_[dofIdx]; } + + //! If a vertex / d.o.f. is on a periodic boundary + bool dofOnPeriodicBoundary(GridIndexType dofIdx) const + { return periodicVertexMap_.count(dofIdx); } + + //! The index of the vertex / d.o.f. on the other side of the periodic boundary + GridIndexType periodicallyMappedDof(GridIndexType dofIdx) const + { return periodicVertexMap_.at(dofIdx); } + + //! Returns the map between dofs across periodic boundaries + const std::unordered_map& periodicVertexMap() const + { return periodicVertexMap_; } + +private: + void update_() + { boundaryDofIndices_.assign(numDofs(), false); // save global data on the grid's scvs and scvfs @@ -494,28 +552,6 @@ public: DUNE_THROW(Dune::NotImplemented, "Periodic boundaries for box method for parallel simulations!"); } - //! The finite element cache for creating local FE bases - const FeCache& feCache() const - { return feCache_; } - - //! If a vertex / d.o.f. is on the boundary - bool dofOnBoundary(GridIndexType dofIdx) const - { return boundaryDofIndices_[dofIdx]; } - - //! If a vertex / d.o.f. is on a periodic boundary - bool dofOnPeriodicBoundary(GridIndexType dofIdx) const - { return periodicVertexMap_.count(dofIdx); } - - //! The index of the vertex / d.o.f. on the other side of the periodic boundary - GridIndexType periodicallyMappedDof(GridIndexType dofIdx) const - { return periodicVertexMap_.at(dofIdx); } - - //! Returns the map between dofs across periodic boundaries - const std::unordered_map& periodicVertexMap() const - { return periodicVertexMap_; } - -private: - const FeCache feCache_; // Information on the global number of geometries diff --git a/dumux/discretization/cellcentered/mpfa/fvgridgeometry.hh b/dumux/discretization/cellcentered/mpfa/fvgridgeometry.hh index aa8d4ae436..9b5ca3491b 100644 --- a/dumux/discretization/cellcentered/mpfa/fvgridgeometry.hh +++ b/dumux/discretization/cellcentered/mpfa/fvgridgeometry.hh @@ -26,6 +26,8 @@ #ifndef DUMUX_DISCRETIZATION_CC_MPFA_FV_GRID_GEOMETRY_HH #define DUMUX_DISCRETIZATION_CC_MPFA_FV_GRID_GEOMETRY_HH +#include + #include #include #include @@ -169,10 +171,68 @@ public: { return false; } //! update all fvElementGeometries (do this again after grid adaption) + [[deprecated("Use update(gridView) instead! Will be removed after release 3.5.")]] void update() { ParentType::update(); + update_(); + } + + //! update all fvElementGeometries (do this again after grid adaption) + void update(const GridView& gridView) + { + ParentType::update(gridView); + update_(); + } + + void update(GridView&& gridView) + { + ParentType::update(std::move(gridView)); + update_(); + } + + //! Returns instance of the mpfa helper type + MpfaHelper mpfaHelper() const + { return MpfaHelper(); } + + //! Get a sub control volume with a global scv index + const SubControlVolume& scv(GridIndexType scvIdx) const + { return scvs_[scvIdx]; } + + //! Get a sub control volume face with a global scvf index + const SubControlVolumeFace& scvf(GridIndexType scvfIdx) const + { return scvfs_[scvfIdx]; } + //! Returns the connectivity map of which dofs + //! have derivatives with respect to a given dof. + const ConnectivityMap& connectivityMap() const + { return connectivityMap_; } + + //! Returns the grid interaction volume index set class. + const GridIVIndexSets& gridInteractionVolumeIndexSets() const + { return ivIndexSets_; } + + //! Get the sub control volume face indices of an scv by global index + const std::vector& scvfIndicesOfScv(GridIndexType scvIdx) const + { return scvfIndicesOfScv_[scvIdx]; } + + //! Returns the flip scvf index set + const FlipScvfIndexSet& flipScvfIndexSet() const + { return flipScvfIndices_; } + + //! Get the scvf on the same face but from the other side + //! Note that e.g. the normals might be different in the case of surface grids + const SubControlVolumeFace& flipScvf(GridIndexType scvfIdx, unsigned int outsideScvfIdx = 0) const + { return scvfs_[flipScvfIndices_[scvfIdx][outsideScvfIdx]]; } + + //! Returns whether one of the geometry's scvfs lies on a boundary + bool hasBoundaryScvf(GridIndexType eIdx) const + { return hasBoundaryScvf_[eIdx]; } + +private: + + void update_() + { // stop the time required for the update Dune::Timer timer; @@ -365,45 +425,6 @@ public: std::cout << "Initializing of the connectivity map took " << timer.elapsed() << " seconds." << std::endl; } - //! Returns instance of the mpfa helper type - MpfaHelper mpfaHelper() const - { return MpfaHelper(); } - - //! Get a sub control volume with a global scv index - const SubControlVolume& scv(GridIndexType scvIdx) const - { return scvs_[scvIdx]; } - - //! Get a sub control volume face with a global scvf index - const SubControlVolumeFace& scvf(GridIndexType scvfIdx) const - { return scvfs_[scvfIdx]; } - - //! Returns the connectivity map of which dofs - //! have derivatives with respect to a given dof. - const ConnectivityMap& connectivityMap() const - { return connectivityMap_; } - - //! Returns the grid interaction volume index set class. - const GridIVIndexSets& gridInteractionVolumeIndexSets() const - { return ivIndexSets_; } - - //! Get the sub control volume face indices of an scv by global index - const std::vector& scvfIndicesOfScv(GridIndexType scvIdx) const - { return scvfIndicesOfScv_[scvIdx]; } - - //! Returns the flip scvf index set - const FlipScvfIndexSet& flipScvfIndexSet() const - { return flipScvfIndices_; } - - //! Get the scvf on the same face but from the other side - //! Note that e.g. the normals might be different in the case of surface grids - const SubControlVolumeFace& flipScvf(GridIndexType scvfIdx, unsigned int outsideScvfIdx = 0) const - { return scvfs_[flipScvfIndices_[scvfIdx][outsideScvfIdx]]; } - - //! Returns whether one of the geometry's scvfs lies on a boundary - bool hasBoundaryScvf(GridIndexType eIdx) const - { return hasBoundaryScvf_[eIdx]; } - -private: // connectivity map for efficient assembly ConnectivityMap connectivityMap_; @@ -546,9 +567,60 @@ public: { return isGhostVertex_[vIdxGlobal]; } //! Updates all finite volume geometries of the grid. Has to be called again after grid adaption. + [[deprecated("Use update(gridView) instead! Will be removed after release 3.5.")]] void update() { ParentType::update(); + update_(); + } + + //! update all fvElementGeometries (do this again after grid adaption) + void update(const GridView& gridView) + { + ParentType::update(gridView); + update_(); + } + + void update(GridView&& gridView) + { + ParentType::update(std::move(gridView)); + update_(); + } + + //! Returns instance of the mpfa helper type + MpfaHelper mpfaHelper() const + { return MpfaHelper(); } + + //! Returns the sub control volume face indices of an scv by global index. + const std::vector& scvfIndicesOfScv(GridIndexType scvIdx) const + { return scvfIndicesOfScv_[scvIdx]; } + + //! Returns the neighboring vol var indices for each scvf contained in an scv. + const std::vector& neighborVolVarIndices(GridIndexType scvIdx) const + { return neighborVolVarIndices_[scvIdx]; } + + //! Get the index scvf on the same face but from the other side + //! Note that e.g. the normals might be different in the case of surface grids + const GridIndexType flipScvfIdx(GridIndexType scvfIdx, unsigned int outsideScvfIdx = 0) const + { return flipScvfIndices_[scvfIdx][outsideScvfIdx]; } + + //! Returns the flip scvf index set + const FlipScvfIndexSet& flipScvfIndexSet() const + { return flipScvfIndices_; } + + //! Returns the connectivity map of which dofs + //! have derivatives with respect to a given dof. + const ConnectivityMap& connectivityMap() const + { return connectivityMap_; } + + //! Returns the grid interaction volume seeds class. + const GridIVIndexSets& gridInteractionVolumeIndexSets() const + { return ivIndexSets_; } + +private: + + void update_() + { // stop the time required for the update Dune::Timer timer; @@ -728,37 +800,6 @@ public: std::cout << "Initializing of the connectivity map took " << timer.elapsed() << " seconds." << std::endl; } - //! Returns instance of the mpfa helper type - MpfaHelper mpfaHelper() const - { return MpfaHelper(); } - - //! Returns the sub control volume face indices of an scv by global index. - const std::vector& scvfIndicesOfScv(GridIndexType scvIdx) const - { return scvfIndicesOfScv_[scvIdx]; } - - //! Returns the neighboring vol var indices for each scvf contained in an scv. - const std::vector& neighborVolVarIndices(GridIndexType scvIdx) const - { return neighborVolVarIndices_[scvIdx]; } - - //! Get the index scvf on the same face but from the other side - //! Note that e.g. the normals might be different in the case of surface grids - const GridIndexType flipScvfIdx(GridIndexType scvfIdx, unsigned int outsideScvfIdx = 0) const - { return flipScvfIndices_[scvfIdx][outsideScvfIdx]; } - - //! Returns the flip scvf index set - const FlipScvfIndexSet& flipScvfIndexSet() const - { return flipScvfIndices_; } - - //! Returns the connectivity map of which dofs - //! have derivatives with respect to a given dof. - const ConnectivityMap& connectivityMap() const - { return connectivityMap_; } - - //! Returns the grid interaction volume seeds class. - const GridIVIndexSets& gridInteractionVolumeIndexSets() const - { return ivIndexSets_; } - -private: // connectivity map for efficient assembly ConnectivityMap connectivityMap_; diff --git a/dumux/discretization/cellcentered/tpfa/fvgridgeometry.hh b/dumux/discretization/cellcentered/tpfa/fvgridgeometry.hh index 76d6be3cec..b3d7f8d31e 100644 --- a/dumux/discretization/cellcentered/tpfa/fvgridgeometry.hh +++ b/dumux/discretization/cellcentered/tpfa/fvgridgeometry.hh @@ -26,6 +26,7 @@ #ifndef DUMUX_DISCRETIZATION_CCTPFA_FV_GRID_GEOMETRY_HH #define DUMUX_DISCRETIZATION_CCTPFA_FV_GRID_GEOMETRY_HH +#include #include #include @@ -157,10 +158,66 @@ public: { return this->gridView().size(0); } //! update all fvElementGeometries (do this again after grid adaption) + [[deprecated("Use update(gridView) instead! Will be removed after release 3.5.")]] void update() { ParentType::update(); + update_(); + } + + //! update all fvElementGeometries (do this again after grid adaption) + void update(const GridView& gridView) + { + ParentType::update(gridView); + update_(); + } + + void update(GridView&& gridView) + { + ParentType::update(std::move(gridView)); + update_(); + } + + //! Get a sub control volume with a global scv index + const SubControlVolume& scv(GridIndexType scvIdx) const + { + return scvs_[scvIdx]; + } + + //! Get a sub control volume face with a global scvf index + const SubControlVolumeFace& scvf(GridIndexType scvfIdx) const + { + return scvfs_[scvfIdx]; + } + + //! Get the scvf on the same face but from the other side + //! Note that e.g. the normals might be different in the case of surface grids + const SubControlVolumeFace& flipScvf(GridIndexType scvfIdx, unsigned int outsideScvfIdx = 0) const + { + return scvfs_[flipScvfIndices_[scvfIdx][outsideScvfIdx]]; + } + //! Get the sub control volume face indices of an scv by global index + const std::vector& scvfIndicesOfScv(GridIndexType scvIdx) const + { + return scvfIndicesOfScv_[scvIdx]; + } + + /*! + * \brief Returns the connectivity map of which dofs have derivatives with respect + * to a given dof. + */ + const ConnectivityMap &connectivityMap() const + { return connectivityMap_; } + + //! Returns whether one of the geometry's scvfs lies on a boundary + bool hasBoundaryScvf(GridIndexType eIdx) const + { return hasBoundaryScvf_[eIdx]; } + +private: + + void update_() + { // clear containers (necessary after grid refinement) scvs_.clear(); scvfs_.clear(); @@ -290,43 +347,6 @@ public: connectivityMap_.update(*this); } - //! Get a sub control volume with a global scv index - const SubControlVolume& scv(GridIndexType scvIdx) const - { - return scvs_[scvIdx]; - } - - //! Get a sub control volume face with a global scvf index - const SubControlVolumeFace& scvf(GridIndexType scvfIdx) const - { - return scvfs_[scvfIdx]; - } - - //! Get the scvf on the same face but from the other side - //! Note that e.g. the normals might be different in the case of surface grids - const SubControlVolumeFace& flipScvf(GridIndexType scvfIdx, unsigned int outsideScvfIdx = 0) const - { - return scvfs_[flipScvfIndices_[scvfIdx][outsideScvfIdx]]; - } - - //! Get the sub control volume face indices of an scv by global index - const std::vector& scvfIndicesOfScv(GridIndexType scvIdx) const - { - return scvfIndicesOfScv_[scvIdx]; - } - - /*! - * \brief Returns the connectivity map of which dofs have derivatives with respect - * to a given dof. - */ - const ConnectivityMap &connectivityMap() const - { return connectivityMap_; } - - //! Returns whether one of the geometry's scvfs lies on a boundary - bool hasBoundaryScvf(GridIndexType eIdx) const - { return hasBoundaryScvf_[eIdx]; } - -private: // find the scvf that has insideScvIdx in its outsideScvIdx list and outsideScvIdx as its insideScvIdx GridIndexType findFlippedScvfIndex_(GridIndexType insideScvIdx, GridIndexType outsideScvIdx) { @@ -441,10 +461,44 @@ public: { return this->gridView().size(0); } //! update all fvElementGeometries (do this again after grid adaption) + [[deprecated("Use update(gridView) instead! Will be removed after release 3.5.")]] void update() { ParentType::update(); + update_(); + } + + //! update all fvElementGeometries (do this again after grid adaption) + void update(const GridView& gridView) + { + ParentType::update(gridView); + update_(); + } + + void update(GridView&& gridView) + { + ParentType::update(std::move(gridView)); + update_(); + } + + const std::vector& scvfIndicesOfScv(GridIndexType scvIdx) const + { return scvfIndicesOfScv_[scvIdx]; } + + //! Return the neighbor volVar indices for all scvfs in the scv with index scvIdx + const std::vector& neighborVolVarIndices(GridIndexType scvIdx) const + { return neighborVolVarIndices_[scvIdx]; } + + /*! + * \brief Returns the connectivity map of which dofs have derivatives with respect + * to a given dof. + */ + const ConnectivityMap &connectivityMap() const + { return connectivityMap_; } +private: + + void update_() + { // clear local data scvfIndicesOfScv_.clear(); neighborVolVarIndices_.clear(); @@ -532,22 +586,6 @@ public: connectivityMap_.update(*this); } - const std::vector& scvfIndicesOfScv(GridIndexType scvIdx) const - { return scvfIndicesOfScv_[scvIdx]; } - - //! Return the neighbor volVar indices for all scvfs in the scv with index scvIdx - const std::vector& neighborVolVarIndices(GridIndexType scvIdx) const - { return neighborVolVarIndices_[scvIdx]; } - - /*! - * \brief Returns the connectivity map of which dofs have derivatives with respect - * to a given dof. - */ - const ConnectivityMap &connectivityMap() const - { return connectivityMap_; } - -private: - //! Information on the global number of geometries std::size_t numScvs_; std::size_t numScvf_; diff --git a/dumux/discretization/porenetwork/gridgeometry.hh b/dumux/discretization/porenetwork/gridgeometry.hh index c790bbb5a6..6238fcbf13 100644 --- a/dumux/discretization/porenetwork/gridgeometry.hh +++ b/dumux/discretization/porenetwork/gridgeometry.hh @@ -25,6 +25,7 @@ #define DUMUX_DISCRETIZATION_PNM_GRID_GEOMETRY_HH #include +#include #include #include @@ -558,9 +559,65 @@ public: //! update all fvElementGeometries (do this again after grid adaption) template + [[deprecated("Use update(gridView, gridData) instead! Will be removed after release 3.5.")]] void update(const GridData& gridData) { ParentType::update(); + update_(gridData); + } + + //! update all fvElementGeometries (do this again after grid adaption) + template + void update(const GridView& gridView, const GridData& gridData) + { + ParentType::update(gridView); + update_(gridData); + } + + template + void update(GridView&& gridView, const GridData& gridData) + { + ParentType::update(std::move(gridView)); + update_(gridData); + } + + //! The finite element cache for creating local FE bases + const FeCache& feCache() const + { return feCache_; } + + //! Get the local scvs for an element + const std::array& scvs(GridIndexType eIdx) const + { return scvs_[eIdx]; } + + //! Get the local scvfs for an element + const std::array& scvfs(GridIndexType eIdx) const + { return scvfs_[eIdx]; } + + //! If a vertex / d.o.f. is on the boundary + bool dofOnBoundary(GridIndexType dofIdx) const + { return boundaryDofIndices_[dofIdx]; } + + //! If a vertex / d.o.f. is on a periodic boundary (not implemented) + bool dofOnPeriodicBoundary(GridIndexType dofIdx) const + { return false; } + + //! The index of the vertex / d.o.f. on the other side of the periodic boundary + GridIndexType periodicallyMappedDof(GridIndexType dofIdx) const + { DUNE_THROW(Dune::NotImplemented, "Periodic boundaries"); } + + //! Returns the map between dofs across periodic boundaries + std::unordered_map periodicVertexMap() const + { return std::unordered_map{}; } + + //! Returns whether one of the geometry's scvfs lies on a boundary + bool hasBoundaryScvf(GridIndexType eIdx) const + { return hasBoundaryScvf_[eIdx]; } + +private: + + template + void update_(const GridData& gridData) + { PNMData::update(this->gridView(), gridData); scvs_.clear(); @@ -622,39 +679,6 @@ public: } } - //! The finite element cache for creating local FE bases - const FeCache& feCache() const - { return feCache_; } - - //! Get the local scvs for an element - const std::array& scvs(GridIndexType eIdx) const - { return scvs_[eIdx]; } - - //! Get the local scvfs for an element - const std::array& scvfs(GridIndexType eIdx) const - { return scvfs_[eIdx]; } - - //! If a vertex / d.o.f. is on the boundary - bool dofOnBoundary(GridIndexType dofIdx) const - { return boundaryDofIndices_[dofIdx]; } - - //! If a vertex / d.o.f. is on a periodic boundary (not implemented) - bool dofOnPeriodicBoundary(GridIndexType dofIdx) const - { return false; } - - //! The index of the vertex / d.o.f. on the other side of the periodic boundary - GridIndexType periodicallyMappedDof(GridIndexType dofIdx) const - { DUNE_THROW(Dune::NotImplemented, "Periodic boundaries"); } - - //! Returns the map between dofs across periodic boundaries - std::unordered_map periodicVertexMap() const - { return std::unordered_map{}; } - - //! Returns whether one of the geometry's scvfs lies on a boundary - bool hasBoundaryScvf(GridIndexType eIdx) const - { return hasBoundaryScvf_[eIdx]; } - -private: const FeCache feCache_; std::vector> scvs_; diff --git a/dumux/discretization/staggered/fvgridgeometry.hh b/dumux/discretization/staggered/fvgridgeometry.hh index 02a1d93636..3d6044644b 100644 --- a/dumux/discretization/staggered/fvgridgeometry.hh +++ b/dumux/discretization/staggered/fvgridgeometry.hh @@ -24,6 +24,8 @@ #ifndef DUMUX_DISCRETIZATION_STAGGERED_FV_GRID_GEOMETRY #define DUMUX_DISCRETIZATION_STAGGERED_FV_GRID_GEOMETRY +#include + #include #include #include @@ -277,7 +279,92 @@ public: { return this->gridView().size(1); } //! update all fvElementGeometries (do this again after grid adaption) + [[deprecated("Use update(gridView) instead! Will be removed after release 3.5.")]] void update() + { + ParentType::update(); + update_(); + } + + //! update all fvElementGeometries (do this again after grid adaption) + void update(const GridView& gridView) + { + ParentType::update(gridView); + update_(); + } + + void update(GridView&& gridView) + { + ParentType::update(std::move(gridView)); + update_(); + } + + //! Get a sub control volume with a global scv index + const SubControlVolume& scv(GridIndexType scvIdx) const + { + return scvs_[scvIdx]; + } + + //! Get a sub control volume face with a global scvf index + const SubControlVolumeFace& scvf(GridIndexType scvfIdx) const + { + return scvfs_[scvfIdx]; + } + + //! Get the sub control volume face indices of an scv by global index + const std::vector& scvfIndicesOfScv(GridIndexType scvIdx) const + { + return scvfIndicesOfScv_[scvIdx]; + } + + GridIndexType localToGlobalScvfIndex(GridIndexType eIdx, LocalIndexType localScvfIdx) const + { + return localToGlobalScvfIndices_[eIdx][localScvfIdx]; + } + + const SubControlVolumeFace& scvf(GridIndexType eIdx, LocalIndexType localScvfIdx) const + { + return scvf(localToGlobalScvfIndex(eIdx, localScvfIdx)); + } + + /*! + * \brief Returns the connectivity map of which dofs have derivatives with respect + * to a given dof. + */ + const ConnectivityMap &connectivityMap() const + { return connectivityMap_; } + + //! Returns a pointer the cell center specific auxiliary class. Required for the multi-domain FVAssembler's ctor. + std::unique_ptr> cellCenterFVGridGeometryPtr() const + { + return std::make_unique>(this); + } + + //! Returns a pointer the face specific auxiliary class. Required for the multi-domain FVAssembler's ctor. + std::unique_ptr> faceFVGridGeometryPtr() const + { + return std::make_unique>(this); + } + + //! Return a copy of the cell center specific auxiliary class. + CellCenterFVGridGeometry cellCenterFVGridGeometry() const + { + return CellCenterFVGridGeometry(this); + } + + //! Return a copy of the face specific auxiliary class. + FaceFVGridGeometry faceFVGridGeometry() const + { + return FaceFVGridGeometry(this); + } + + //! Returns whether one of the geometry's scvfs lies on a boundary + bool hasBoundaryScvf(GridIndexType eIdx) const + { return hasBoundaryScvf_[eIdx]; } + +private: + + void update_() { // clear containers (necessary after grid refinement) scvs_.clear(); @@ -359,71 +446,6 @@ public: connectivityMap_.update(*this); } - //! Get a sub control volume with a global scv index - const SubControlVolume& scv(GridIndexType scvIdx) const - { - return scvs_[scvIdx]; - } - - //! Get a sub control volume face with a global scvf index - const SubControlVolumeFace& scvf(GridIndexType scvfIdx) const - { - return scvfs_[scvfIdx]; - } - - //! Get the sub control volume face indices of an scv by global index - const std::vector& scvfIndicesOfScv(GridIndexType scvIdx) const - { - return scvfIndicesOfScv_[scvIdx]; - } - - GridIndexType localToGlobalScvfIndex(GridIndexType eIdx, LocalIndexType localScvfIdx) const - { - return localToGlobalScvfIndices_[eIdx][localScvfIdx]; - } - - const SubControlVolumeFace& scvf(GridIndexType eIdx, LocalIndexType localScvfIdx) const - { - return scvf(localToGlobalScvfIndex(eIdx, localScvfIdx)); - } - - /*! - * \brief Returns the connectivity map of which dofs have derivatives with respect - * to a given dof. - */ - const ConnectivityMap &connectivityMap() const - { return connectivityMap_; } - - //! Returns a pointer the cell center specific auxiliary class. Required for the multi-domain FVAssembler's ctor. - std::unique_ptr> cellCenterFVGridGeometryPtr() const - { - return std::make_unique>(this); - } - - //! Returns a pointer the face specific auxiliary class. Required for the multi-domain FVAssembler's ctor. - std::unique_ptr> faceFVGridGeometryPtr() const - { - return std::make_unique>(this); - } - - //! Return a copy of the cell center specific auxiliary class. - CellCenterFVGridGeometry cellCenterFVGridGeometry() const - { - return CellCenterFVGridGeometry(this); - } - - //! Return a copy of the face specific auxiliary class. - FaceFVGridGeometry faceFVGridGeometry() const - { - return FaceFVGridGeometry(this); - } - - //! Returns whether one of the geometry's scvfs lies on a boundary - bool hasBoundaryScvf(GridIndexType eIdx) const - { return hasBoundaryScvf_[eIdx]; } - -private: - // mappers ConnectivityMap connectivityMap_; IntersectionMapper intersectionMapper_; @@ -509,59 +531,24 @@ public: } //! update all fvElementGeometries (do this again after grid adaption) + [[deprecated("Use update(gridView) instead! Will be removed after release 3.5.")]] void update() { - // clear containers (necessary after grid refinement) - scvfIndicesOfScv_.clear(); - if constexpr (Deprecated::hasUpdateGridView()) - intersectionMapper_.update(this->gridView()); - else - Deprecated::update(intersectionMapper_); - neighborVolVarIndices_.clear(); - - numScvs_ = numCellCenterDofs(); - numScvf_ = 0; - numBoundaryScvf_ = 0; - scvfIndicesOfScv_.resize(numScvs_); - localToGlobalScvfIndices_.resize(numScvs_); - neighborVolVarIndices_.resize(numScvs_); - - // Build the scvs and scv faces - for (const auto& element : elements(this->gridView())) - { - auto eIdx = this->elementMapper().index(element); - - // the element-wise index sets for finite volume geometry - auto numLocalFaces = intersectionMapper_.numFaces(element); - std::vector scvfsIndexSet; - scvfsIndexSet.reserve(numLocalFaces); - localToGlobalScvfIndices_[eIdx].resize(numLocalFaces); - - std::vector neighborVolVarIndexSet; - neighborVolVarIndexSet.reserve(numLocalFaces); - - for (const auto& intersection : intersections(this->gridView(), element)) - { - const auto localFaceIndex = intersection.indexInInside(); - localToGlobalScvfIndices_[eIdx][localFaceIndex] = numScvf_; - scvfsIndexSet.push_back(numScvf_++); - - if (intersection.neighbor()) - { - const auto nIdx = this->elementMapper().index(intersection.outside()); - neighborVolVarIndexSet.emplace_back(nIdx); - } - else - neighborVolVarIndexSet.emplace_back(numScvs_ + numBoundaryScvf_++); - } + ParentType::update(); + update_(); + } - // Save the scvf indices belonging to this scv to build up fv element geometries fast - scvfIndicesOfScv_[eIdx] = scvfsIndexSet; - neighborVolVarIndices_[eIdx] = neighborVolVarIndexSet; - } + //! update all fvElementGeometries (do this again after grid adaption) + void update(const GridView& gridView) + { + ParentType::update(gridView); + update_(); + } - // build the connectivity map for an effecient assembly - connectivityMap_.update(*this); + void update(GridView&& gridView) + { + ParentType::update(std::move(gridView)); + update_(); } //! The total number of sub control volumes @@ -649,6 +636,61 @@ public: private: + void update_() + { + // clear containers (necessary after grid refinement) + scvfIndicesOfScv_.clear(); + if constexpr (Deprecated::hasUpdateGridView()) + intersectionMapper_.update(this->gridView()); + else + Deprecated::update(intersectionMapper_); + neighborVolVarIndices_.clear(); + + numScvs_ = numCellCenterDofs(); + numScvf_ = 0; + numBoundaryScvf_ = 0; + scvfIndicesOfScv_.resize(numScvs_); + localToGlobalScvfIndices_.resize(numScvs_); + neighborVolVarIndices_.resize(numScvs_); + + // Build the scvs and scv faces + for (const auto& element : elements(this->gridView())) + { + auto eIdx = this->elementMapper().index(element); + + // the element-wise index sets for finite volume geometry + auto numLocalFaces = intersectionMapper_.numFaces(element); + std::vector scvfsIndexSet; + scvfsIndexSet.reserve(numLocalFaces); + localToGlobalScvfIndices_[eIdx].resize(numLocalFaces); + + std::vector neighborVolVarIndexSet; + neighborVolVarIndexSet.reserve(numLocalFaces); + + for (const auto& intersection : intersections(this->gridView(), element)) + { + const auto localFaceIndex = intersection.indexInInside(); + localToGlobalScvfIndices_[eIdx][localFaceIndex] = numScvf_; + scvfsIndexSet.push_back(numScvf_++); + + if (intersection.neighbor()) + { + const auto nIdx = this->elementMapper().index(intersection.outside()); + neighborVolVarIndexSet.emplace_back(nIdx); + } + else + neighborVolVarIndexSet.emplace_back(numScvs_ + numBoundaryScvf_++); + } + + // Save the scvf indices belonging to this scv to build up fv element geometries fast + scvfIndicesOfScv_[eIdx] = scvfsIndexSet; + neighborVolVarIndices_[eIdx] = neighborVolVarIndexSet; + } + + // build the connectivity map for an effecient assembly + connectivityMap_.update(*this); + } + //! Information on the global number of geometries std::size_t numScvs_; std::size_t numScvf_; diff --git a/dumux/multidomain/facet/box/fvgridgeometry.hh b/dumux/multidomain/facet/box/fvgridgeometry.hh index d16a2f9170..a5085251f2 100644 --- a/dumux/multidomain/facet/box/fvgridgeometry.hh +++ b/dumux/multidomain/facet/box/fvgridgeometry.hh @@ -28,6 +28,7 @@ #define DUMUX_FACETCOUPLING_BOX_GRID_FVGEOMETRY_HH #include +#include #include #include @@ -162,13 +163,75 @@ public: * \param verbose Verbosity level for vertex enrichment */ template + [[deprecated("Use update(gridView) instead! Will be removed after release 3.5.")]] void update(const FacetGridView& facetGridView, const CodimOneGridAdapter& codimOneGridAdapter, bool verbose = false) { // first update the parent (mappers etc) ParentType::update(); + update_(); + } + + template + void update(const GridView& gridView, + const FacetGridView& facetGridView, + const CodimOneGridAdapter& codimOneGridAdapter, + bool verbose = false) + { + ParentType::update(gridView); + update_(facetGridView, codimOneGridAdapter, verbose); + } + + template + void update(GridView&& gridView, + const FacetGridView& facetGridView, + const CodimOneGridAdapter& codimOneGridAdapter, + bool verbose = false) + { + ParentType::update(std::move(gridView)); + update_(facetGridView, codimOneGridAdapter, verbose); + } + + //! The finite element cache for creating local FE bases + const FeCache& feCache() const + { return feCache_; } + + //! Get the local scvs for an element + const std::vector& scvs(GridIndexType eIdx) const + { return scvs_[eIdx]; } + + //! Get the local scvfs for an element + const std::vector& scvfs(GridIndexType eIdx) const + { return scvfs_[eIdx]; } + + //! If a d.o.f. is on the boundary + bool dofOnBoundary(GridIndexType dofIdx) const + { return boundaryDofIndices_[dofIdx]; } + + //! If a d.o.f. is on an interior boundary + bool dofOnInteriorBoundary(GridIndexType dofIdx) const + { return interiorBoundaryDofIndices_[dofIdx]; } + + //! Periodic boundaries are not supported for the box facet coupling scheme + bool dofOnPeriodicBoundary(GridIndexType dofIdx) const + { return false; } + //! The index of the vertex / d.o.f. on the other side of the periodic boundary + GridIndexType periodicallyMappedDof(GridIndexType dofIdx) const + { DUNE_THROW(Dune::InvalidStateException, "Periodic boundaries are not supported by the box facet coupling scheme"); } + + //! Returns the map between dofs across periodic boundaries + std::unordered_map periodicVertexMap() const + { return std::unordered_map(); } + +private: + + template + void update_(const FacetGridView& facetGridView, + const CodimOneGridAdapter& codimOneGridAdapter, + bool verbose = false) + { // enrich the vertex mapper subject to the provided facet grid this->vertexMapper().enrich(facetGridView, codimOneGridAdapter, verbose); @@ -294,39 +357,6 @@ public: } } - //! The finite element cache for creating local FE bases - const FeCache& feCache() const - { return feCache_; } - - //! Get the local scvs for an element - const std::vector& scvs(GridIndexType eIdx) const - { return scvs_[eIdx]; } - - //! Get the local scvfs for an element - const std::vector& scvfs(GridIndexType eIdx) const - { return scvfs_[eIdx]; } - - //! If a d.o.f. is on the boundary - bool dofOnBoundary(GridIndexType dofIdx) const - { return boundaryDofIndices_[dofIdx]; } - - //! If a d.o.f. is on an interior boundary - bool dofOnInteriorBoundary(GridIndexType dofIdx) const - { return interiorBoundaryDofIndices_[dofIdx]; } - - //! Periodic boundaries are not supported for the box facet coupling scheme - bool dofOnPeriodicBoundary(GridIndexType dofIdx) const - { return false; } - - //! The index of the vertex / d.o.f. on the other side of the periodic boundary - GridIndexType periodicallyMappedDof(GridIndexType dofIdx) const - { DUNE_THROW(Dune::InvalidStateException, "Periodic boundaries are not supported by the box facet coupling scheme"); } - - //! Returns the map between dofs across periodic boundaries - std::unordered_map periodicVertexMap() const - { return std::unordered_map(); } - -private: const FeCache feCache_; std::vector> scvs_; @@ -424,13 +454,68 @@ public: * \param verbose Verbosity level */ template + [[deprecated("Use update(gridView) instead! Will be removed after release 3.5.")]] void update(const FacetGridView& facetGridView, const CodimOneGridAdapter& codimOneGridAdapter, bool verbose = false) { // first update the parent (mappers etc) ParentType::update(); + update_(); + } + + template + void update(const GridView& gridView, + const FacetGridView& facetGridView, + const CodimOneGridAdapter& codimOneGridAdapter, + bool verbose = false) + { + ParentType::update(gridView); + update_(facetGridView, codimOneGridAdapter, verbose); + } + + template + void update(GridView&& gridView, + const FacetGridView& facetGridView, + const CodimOneGridAdapter& codimOneGridAdapter, + bool verbose = false) + { + ParentType::update(std::move(gridView)); + update_(facetGridView, codimOneGridAdapter, verbose); + } + + //! The finite element cache for creating local FE bases + const FeCache& feCache() const + { return feCache_; } + + //! If a d.o.f. is on the boundary + bool dofOnBoundary(unsigned int dofIdx) const + { return boundaryDofIndices_[dofIdx]; } + + //! If a d.o.f. is on an interior boundary + bool dofOnInteriorBoundary(unsigned int dofIdx) const + { return interiorBoundaryDofIndices_[dofIdx]; } + + //! returns true if an intersection is on an interior boundary + bool isOnInteriorBoundary(const Element& element, const Intersection& intersection) const + { return facetIsOnInteriorBoundary_[ facetMapper_.subIndex(element, intersection.indexInInside(), 1) ]; } + + //! Periodic boundaries are not supported for the box facet coupling scheme + bool dofOnPeriodicBoundary(GridIndexType dofIdx) const + { return false; } + + //! The index of the vertex / d.o.f. on the other side of the periodic boundary + GridIndexType periodicallyMappedDof(GridIndexType dofIdx) const + { DUNE_THROW(Dune::InvalidStateException, "Periodic boundaries are not supported by the facet coupling scheme"); } + + //! Returns the map between dofs across periodic boundaries + std::unordered_map periodicVertexMap() const + { return std::unordered_map(); } +private: + + void update_() + { // enrich the vertex mapper subject to the provided facet grid this->vertexMapper().enrich(facetGridView, codimOneGridAdapter, verbose); @@ -504,35 +589,6 @@ public: } } - //! The finite element cache for creating local FE bases - const FeCache& feCache() const - { return feCache_; } - - //! If a d.o.f. is on the boundary - bool dofOnBoundary(unsigned int dofIdx) const - { return boundaryDofIndices_[dofIdx]; } - - //! If a d.o.f. is on an interior boundary - bool dofOnInteriorBoundary(unsigned int dofIdx) const - { return interiorBoundaryDofIndices_[dofIdx]; } - - //! returns true if an intersection is on an interior boundary - bool isOnInteriorBoundary(const Element& element, const Intersection& intersection) const - { return facetIsOnInteriorBoundary_[ facetMapper_.subIndex(element, intersection.indexInInside(), 1) ]; } - - //! Periodic boundaries are not supported for the box facet coupling scheme - bool dofOnPeriodicBoundary(GridIndexType dofIdx) const - { return false; } - - //! The index of the vertex / d.o.f. on the other side of the periodic boundary - GridIndexType periodicallyMappedDof(GridIndexType dofIdx) const - { DUNE_THROW(Dune::InvalidStateException, "Periodic boundaries are not supported by the facet coupling scheme"); } - - //! Returns the map between dofs across periodic boundaries - std::unordered_map periodicVertexMap() const - { return std::unordered_map(); } - -private: const FeCache feCache_; // Information on the global number of geometries diff --git a/dumux/porousmediumflow/boxdfm/fvgridgeometry.hh b/dumux/porousmediumflow/boxdfm/fvgridgeometry.hh index 2d5a23fa1a..d5f8f1d9b6 100644 --- a/dumux/porousmediumflow/boxdfm/fvgridgeometry.hh +++ b/dumux/porousmediumflow/boxdfm/fvgridgeometry.hh @@ -29,6 +29,7 @@ #ifndef DUMUX_POROUSMEDIUMFLOW_BOXDFM_GRID_FVGEOMETRY_HH #define DUMUX_POROUSMEDIUMFLOW_BOXDFM_GRID_FVGEOMETRY_HH +#include #include #include @@ -159,10 +160,53 @@ public: //! Update all fvElementGeometries (do this again after grid adaption) template< class FractureGridAdapter > + [[deprecated("Use update(gridView) instead! Will be removed after release 3.5.")]] void update(const FractureGridAdapter& fractureGridAdapter) { ParentType::update(); + update_(fractureGridAdapter); + } + + template< class FractureGridAdapter > + void update(const GridView& gridView, const FractureGridAdapter& fractureGridAdapter) + { + ParentType::update(gridView); + update_(fractureGridAdapter); + } + template< class FractureGridAdapter > + void update(GridView&& gridView, const FractureGridAdapter& fractureGridAdapter) + { + ParentType::update(std::move(gridView)); + update_(fractureGridAdapter); + } + + //! The finite element cache for creating local FE bases + const FeCache& feCache() const { return feCache_; } + //! Get the local scvs for an element + const std::vector& scvs(GridIndexType eIdx) const { return scvs_[eIdx]; } + //! Get the local scvfs for an element + const std::vector& scvfs(GridIndexType eIdx) const { return scvfs_[eIdx]; } + //! If a vertex / d.o.f. is on the boundary + bool dofOnBoundary(unsigned int dofIdx) const { return boundaryDofIndices_[dofIdx]; } + //! If a vertex / d.o.f. is on a fracture + bool dofOnFracture(unsigned int dofIdx) const { return fractureDofIndices_[dofIdx]; } + //! Periodic boundaries are not supported for the box-dfm scheme + bool dofOnPeriodicBoundary(std::size_t dofIdx) const { return false; } + + //! The index of the vertex / d.o.f. on the other side of the periodic boundary + std::size_t periodicallyMappedDof(std::size_t dofIdx) const + { DUNE_THROW(Dune::InvalidStateException, "Periodic boundaries are not supported by the box-dfm scheme"); } + + //! Returns the map between dofs across periodic boundaries + std::unordered_map periodicVertexMap() const + { return std::unordered_map(); } + +private: + + template< class FractureGridAdapter > + void update_(const FractureGridAdapter& fractureGridAdapter) + { scvs_.clear(); scvfs_.clear(); @@ -353,28 +397,6 @@ public: } } - //! The finite element cache for creating local FE bases - const FeCache& feCache() const { return feCache_; } - //! Get the local scvs for an element - const std::vector& scvs(GridIndexType eIdx) const { return scvs_[eIdx]; } - //! Get the local scvfs for an element - const std::vector& scvfs(GridIndexType eIdx) const { return scvfs_[eIdx]; } - //! If a vertex / d.o.f. is on the boundary - bool dofOnBoundary(unsigned int dofIdx) const { return boundaryDofIndices_[dofIdx]; } - //! If a vertex / d.o.f. is on a fracture - bool dofOnFracture(unsigned int dofIdx) const { return fractureDofIndices_[dofIdx]; } - //! Periodic boundaries are not supported for the box-dfm scheme - bool dofOnPeriodicBoundary(std::size_t dofIdx) const { return false; } - - //! The index of the vertex / d.o.f. on the other side of the periodic boundary - std::size_t periodicallyMappedDof(std::size_t dofIdx) const - { DUNE_THROW(Dune::InvalidStateException, "Periodic boundaries are not supported by the box-dfm scheme"); } - - //! Returns the map between dofs across periodic boundaries - std::unordered_map periodicVertexMap() const - { return std::unordered_map(); } - -private: const FeCache feCache_; std::vector> scvs_; @@ -459,12 +481,54 @@ public: std::size_t numDofs() const { return this->gridView().size(dim); } - //! update all fvElementGeometries (do this again after grid adaption) + //! Update all fvElementGeometries (do this again after grid adaption) template< class FractureGridAdapter > + [[deprecated("Use update(gridView) instead! Will be removed after release 3.5.")]] void update(const FractureGridAdapter& fractureGridAdapter) { ParentType::update(); + update_(fractureGridAdapter); + } + + template< class FractureGridAdapter > + void update(const GridView& gridView, const FractureGridAdapter& fractureGridAdapter) + { + ParentType::update(gridView); + update_(fractureGridAdapter); + } + + template< class FractureGridAdapter > + void update(GridView&& gridView, const FractureGridAdapter& fractureGridAdapter) + { + ParentType::update(std::move(gridView)); + update_(fractureGridAdapter); + } + + //! The finite element cache for creating local FE bases + const FeCache& feCache() const { return feCache_; } + //! If a vertex / d.o.f. is on the boundary + bool dofOnBoundary(unsigned int dofIdx) const { return boundaryDofIndices_[dofIdx]; } + //! If a vertex / d.o.f. is on a fracture + bool dofOnFracture(unsigned int dofIdx) const { return fractureDofIndices_[dofIdx]; } + //! Periodic boundaries are not supported for the box-dfm scheme + bool dofOnPeriodicBoundary(std::size_t dofIdx) const { return false; } + + //! Returns true if an intersection coincides with a fracture element + bool isOnFracture(const Element& element, const Intersection& intersection) const + { return facetOnFracture_[facetMapper_.subIndex(element, intersection.indexInInside(), 1)]; } + + //! The index of the vertex / d.o.f. on the other side of the periodic boundary + std::size_t periodicallyMappedDof(std::size_t dofIdx) const + { DUNE_THROW(Dune::InvalidStateException, "Periodic boundaries are not supported by the box-dfm scheme"); } + + //! Returns the map between dofs across periodic boundaries + std::unordered_map periodicVertexMap() const + { return std::unordered_map(); } + +private: + void update_() + { boundaryDofIndices_.assign(numDofs(), false); fractureDofIndices_.assign(numDofs(), false); facetOnFracture_.assign(this->gridView().size(1), false); @@ -532,29 +596,6 @@ public: } } - //! The finite element cache for creating local FE bases - const FeCache& feCache() const { return feCache_; } - //! If a vertex / d.o.f. is on the boundary - bool dofOnBoundary(unsigned int dofIdx) const { return boundaryDofIndices_[dofIdx]; } - //! If a vertex / d.o.f. is on a fracture - bool dofOnFracture(unsigned int dofIdx) const { return fractureDofIndices_[dofIdx]; } - //! Periodic boundaries are not supported for the box-dfm scheme - bool dofOnPeriodicBoundary(std::size_t dofIdx) const { return false; } - - //! Returns true if an intersection coincides with a fracture element - bool isOnFracture(const Element& element, const Intersection& intersection) const - { return facetOnFracture_[facetMapper_.subIndex(element, intersection.indexInInside(), 1)]; } - - //! The index of the vertex / d.o.f. on the other side of the periodic boundary - std::size_t periodicallyMappedDof(std::size_t dofIdx) const - { DUNE_THROW(Dune::InvalidStateException, "Periodic boundaries are not supported by the box-dfm scheme"); } - - //! Returns the map between dofs across periodic boundaries - std::unordered_map periodicVertexMap() const - { return std::unordered_map(); } - -private: - const FeCache feCache_; // Information on the global number of geometries -- GitLab From f67d6b2c9f6f1e3cd582577c2bf88ef0e0294932 Mon Sep 17 00:00:00 2001 From: Martin Schneider Date: Wed, 28 Jul 2021 13:52:27 +0200 Subject: [PATCH 02/10] [gg] Call update function already in constructor --- dumux/discretization/basegridgeometry.hh | 1 + dumux/discretization/box/fvgridgeometry.hh | 8 ++++++-- dumux/discretization/cellcentered/mpfa/fvgridgeometry.hh | 4 ++++ dumux/discretization/cellcentered/tpfa/fvgridgeometry.hh | 4 ++++ dumux/discretization/staggered/fvgridgeometry.hh | 4 ++++ 5 files changed, 19 insertions(+), 2 deletions(-) diff --git a/dumux/discretization/basegridgeometry.hh b/dumux/discretization/basegridgeometry.hh index 2e108d0de3..cff928b269 100644 --- a/dumux/discretization/basegridgeometry.hh +++ b/dumux/discretization/basegridgeometry.hh @@ -84,6 +84,7 @@ public: , bBoxMax_(-std::numeric_limits::max()) { computeGlobalBoundingBox_(); + update_(); } /*! diff --git a/dumux/discretization/box/fvgridgeometry.hh b/dumux/discretization/box/fvgridgeometry.hh index 8860d640d8..9c8e111541 100644 --- a/dumux/discretization/box/fvgridgeometry.hh +++ b/dumux/discretization/box/fvgridgeometry.hh @@ -118,7 +118,9 @@ public: //! Constructor BoxFVGridGeometry(const GridView gridView) : ParentType(gridView) - {} + { + update_(); + } //! the vertex mapper is the dofMapper //! this is convenience to have better chance to have the same main files for box/tpfa/mpfa... @@ -403,7 +405,9 @@ public: //! Constructor BoxFVGridGeometry(const GridView gridView) : ParentType(gridView) - {} + { + update_(); + } //! the vertex mapper is the dofMapper //! this is convenience to have better chance to have the same main files for box/tpfa/mpfa... diff --git a/dumux/discretization/cellcentered/mpfa/fvgridgeometry.hh b/dumux/discretization/cellcentered/mpfa/fvgridgeometry.hh index 9b5ca3491b..14e2734405 100644 --- a/dumux/discretization/cellcentered/mpfa/fvgridgeometry.hh +++ b/dumux/discretization/cellcentered/mpfa/fvgridgeometry.hh @@ -127,6 +127,7 @@ public: { return is.boundary() || isBranching; } ) { checkOverlapSizeCCMpfa(gridView); + update_(); } //! Constructor with user-defined indicator function for secondary interaction volumes @@ -135,6 +136,7 @@ public: , secondaryIvIndicator_(indicator) { checkOverlapSizeCCMpfa(gridView); + update_(); } //! the element mapper is the dofMapper @@ -515,6 +517,7 @@ public: { return is.boundary() || isBranching; } ) { checkOverlapSizeCCMpfa(gridView); + update_(); } //! Constructor with user-defined indicator function for secondary interaction volumes @@ -523,6 +526,7 @@ public: , secondaryIvIndicator_(indicator) { checkOverlapSizeCCMpfa(gridView); + update_(); } //! the element mapper is the dofMapper diff --git a/dumux/discretization/cellcentered/tpfa/fvgridgeometry.hh b/dumux/discretization/cellcentered/tpfa/fvgridgeometry.hh index b3d7f8d31e..ea120c644a 100644 --- a/dumux/discretization/cellcentered/tpfa/fvgridgeometry.hh +++ b/dumux/discretization/cellcentered/tpfa/fvgridgeometry.hh @@ -128,6 +128,8 @@ public: if (!CheckOverlapSize::isValid(gridView)) DUNE_THROW(Dune::InvalidStateException, "The cctpfa discretization method needs at least an overlap of 1 for parallel computations. " << " Set the parameter \"Grid.Overlap\" in the input file."); + + update_(); } //! the element mapper is the dofMapper @@ -431,6 +433,8 @@ public: if (!CheckOverlapSize::isValid(gridView)) DUNE_THROW(Dune::InvalidStateException, "The cctpfa discretization method needs at least an overlap of 1 for parallel computations. " << " Set the parameter \"Grid.Overlap\" in the input file."); + + update_(); } //! the element mapper is the dofMapper diff --git a/dumux/discretization/staggered/fvgridgeometry.hh b/dumux/discretization/staggered/fvgridgeometry.hh index 3d6044644b..0f00c115af 100644 --- a/dumux/discretization/staggered/fvgridgeometry.hh +++ b/dumux/discretization/staggered/fvgridgeometry.hh @@ -241,6 +241,8 @@ public: if (!CheckOverlapSize::isValid(gridView)) DUNE_THROW(Dune::InvalidStateException, "The staggered discretization method needs at least an overlap of 1 for parallel computations. " << " Set the parameter \"Grid.Overlap\" in the input file."); + + update_(); } //! The total number of sub control volumes @@ -528,6 +530,8 @@ public: if (!CheckOverlapSize::isValid(gridView)) DUNE_THROW(Dune::InvalidStateException, "The staggered discretization method needs at least an overlap of 1 for parallel computations. " << " Set the parameter \"Grid.Overlap\" in the input file."); + + update_(); } //! update all fvElementGeometries (do this again after grid adaption) -- GitLab From 5878fe0c298a46638469372336f3c765baaae0a8 Mon Sep 17 00:00:00 2001 From: Martin Schneider Date: Wed, 28 Jul 2021 14:46:08 +0200 Subject: [PATCH 03/10] [gg] Add constructors to grid geometry classes To not apply the copy operator for gridView twice (by calling update(gridView)), additional constructors are added where needed --- .../porenetwork/gridgeometry.hh | 83 ++++++++++++++----- dumux/multidomain/facet/box/fvgridgeometry.hh | 44 ++++++++-- .../porousmediumflow/boxdfm/fvgridgeometry.hh | 28 ++++++- 3 files changed, 128 insertions(+), 27 deletions(-) diff --git a/dumux/discretization/porenetwork/gridgeometry.hh b/dumux/discretization/porenetwork/gridgeometry.hh index 6238fcbf13..a05d383c8f 100644 --- a/dumux/discretization/porenetwork/gridgeometry.hh +++ b/dumux/discretization/porenetwork/gridgeometry.hh @@ -529,12 +529,21 @@ public: using GridView = GV; //! Constructor + [[deprecated("Use GridGeometry(gridView, gridData) instead! Will be removed after release 3.5.")]] GridGeometry(const GridView gridView) : ParentType(gridView) { static_assert(GridView::dimension == 1, "Porenetwork model only allow GridView::dimension == 1!"); } + template + GridGeometry(const GridView& gridView, const GridData& gridData) + : ParentType(gridView) + { + static_assert(GridView::dimension == 1, "Porenetwork model only allow GridView::dimension == 1!"); + update_(gridData); + } + //! the vertex mapper is the dofMapper //! this is convenience to have better chance to have the same main files for box/tpfa/mpfa... const DofMapper& dofMapper() const @@ -735,12 +744,22 @@ public: using GridView = GV; //! Constructor + [[deprecated("Use GridGeometry(gridView, gridData) instead! Will be removed after release 3.5.")]] GridGeometry(const GridView gridView) : ParentType(gridView) { static_assert(GridView::dimension == 1, "Porenetwork model only allow GridView::dimension == 1!"); } + template + GridGeometry(const GridView& gridView, const GridData& gridData) + : ParentType(gridView) + { + static_assert(GridView::dimension == 1, "Porenetwork model only allow GridView::dimension == 1!"); + update_(gridData); + } + + //! the vertex mapper is the dofMapper //! this is convenience to have better chance to have the same main files for box/tpfa/mpfa... const DofMapper& dofMapper() const @@ -765,32 +784,26 @@ public: //! update all fvElementGeometries (do this again after grid adaption) template + [[deprecated("Use update(gridView, gridData) instead! Will be removed after release 3.5.")]] void update(const GridData& gridData) { ParentType::update(); - PNMData::update(this->gridView(), gridData); - - boundaryDofIndices_.assign(numDofs(), false); - - // save global data on the grid's scvs and scvfs - numScvf_ = this->gridView().size(0); - numScv_ = 2*numScvf_; + update_(gridData); + } - for (const auto& element : elements(this->gridView())) - { - // treat boundaries - for (LocalIndexType vIdxLocal = 0; vIdxLocal < 2; ++vIdxLocal) - { - const auto vIdxGlobal = this->vertexMapper().subIndex(element, vIdxLocal, dim); - if (this->poreLabel(vIdxGlobal) > 0) - { - if (boundaryDofIndices_[vIdxGlobal]) - continue; + //! update all fvElementGeometries (do this again after grid adaption) + template + void update(const GridView& gridView, const GridData& gridData) + { + ParentType::update(gridView); + update_(gridData); + } - boundaryDofIndices_[vIdxGlobal] = true; - } - } - } + template + void update(GridView&& gridView, const GridData& gridData) + { + ParentType::update(std::move(gridView)); + update_(gridData); } //! The finite element cache for creating local FE bases @@ -815,6 +828,34 @@ public: private: + template + void update_(const GridData& gridData) + { + PNMData::update(this->gridView(), gridData); + + boundaryDofIndices_.assign(numDofs(), false); + + // save global data on the grid's scvs and scvfs + numScvf_ = this->gridView().size(0); + numScv_ = 2*numScvf_; + + for (const auto& element : elements(this->gridView())) + { + // treat boundaries + for (LocalIndexType vIdxLocal = 0; vIdxLocal < 2; ++vIdxLocal) + { + const auto vIdxGlobal = this->vertexMapper().subIndex(element, vIdxLocal, dim); + if (this->poreLabel(vIdxGlobal) > 0) + { + if (boundaryDofIndices_[vIdxGlobal]) + continue; + + boundaryDofIndices_[vIdxGlobal] = true; + } + } + } + } + const FeCache feCache_; // Information on the global number of geometries diff --git a/dumux/multidomain/facet/box/fvgridgeometry.hh b/dumux/multidomain/facet/box/fvgridgeometry.hh index a5085251f2..2d43c7033a 100644 --- a/dumux/multidomain/facet/box/fvgridgeometry.hh +++ b/dumux/multidomain/facet/box/fvgridgeometry.hh @@ -127,9 +127,20 @@ public: using GridView = GV; //! Constructor + [[deprecated("Use BoxFacetCouplingFVGridGeometry(gridView, facetGridView, codimOneGridAdapter) instead! Will be removed after release 3.5.")]] BoxFacetCouplingFVGridGeometry(const GridView& gridView) : ParentType(gridView) {} + template + BoxFacetCouplingFVGridGeometry(const GridView& gridView, + const FacetGridView& facetGridView, + const CodimOneGridAdapter& codimOneGridAdapter, + bool verbose = false) + : ParentType(gridView) + { + update_(facetGridView, codimOneGridAdapter, verbose); + } + //! the vertex mapper is the dofMapper const DofMapper& dofMapper() const { return this->vertexMapper(); } @@ -170,7 +181,7 @@ public: { // first update the parent (mappers etc) ParentType::update(); - update_(); + update_(facetGridView, codimOneGridAdapter, verbose); } template @@ -229,8 +240,8 @@ private: template void update_(const FacetGridView& facetGridView, - const CodimOneGridAdapter& codimOneGridAdapter, - bool verbose = false) + const CodimOneGridAdapter& codimOneGridAdapter, + bool verbose = false) { // enrich the vertex mapper subject to the provided facet grid this->vertexMapper().enrich(facetGridView, codimOneGridAdapter, verbose); @@ -415,11 +426,23 @@ public: using GridView = GV; //! Constructor + [[deprecated("Use BoxFacetCouplingFVGridGeometry(gridView, facetGridView, codimOneGridAdapter) instead! Will be removed after release 3.5.")]] BoxFacetCouplingFVGridGeometry(const GridView gridView) : ParentType(gridView) , facetMapper_(gridView, Dune::mcmgLayout(Dune::template Codim<1>())) {} + template + BoxFacetCouplingFVGridGeometry(const GridView& gridView, + const FacetGridView& facetGridView, + const CodimOneGridAdapter& codimOneGridAdapter, + bool verbose = false) + : ParentType(gridView) + , facetMapper_(gridView, Dune::mcmgLayout(Dune::template Codim<1>())) + { + update_(facetGridView, codimOneGridAdapter, verbose); + } + //! the vertex mapper is the dofMapper //! this is convenience to have better chance to have the same main files for box/tpfa/mpfa... const DofMapper& dofMapper() const @@ -461,7 +484,7 @@ public: { // first update the parent (mappers etc) ParentType::update(); - update_(); + update_(facetGridView, codimOneGridAdapter, verbose); } template @@ -514,7 +537,18 @@ public: private: - void update_() + void updateFacetMapper_() + { + if constexpr (Deprecated::hasUpdateGridView()) + facetMapper_.update(this->gridView()); + else + Deprecated::update(facetMapper_); + } + + template + void update_(const FacetGridView& facetGridView, + const CodimOneGridAdapter& codimOneGridAdapter, + bool verbose) { // enrich the vertex mapper subject to the provided facet grid this->vertexMapper().enrich(facetGridView, codimOneGridAdapter, verbose); diff --git a/dumux/porousmediumflow/boxdfm/fvgridgeometry.hh b/dumux/porousmediumflow/boxdfm/fvgridgeometry.hh index d5f8f1d9b6..fe75055395 100644 --- a/dumux/porousmediumflow/boxdfm/fvgridgeometry.hh +++ b/dumux/porousmediumflow/boxdfm/fvgridgeometry.hh @@ -133,9 +133,17 @@ public: using GridView = GV; //! Constructor + [[deprecated("Use BoxDfmFVGridGeometry(gridView, fractureGridAdapter) instead! Will be removed after release 3.5.")]] BoxDfmFVGridGeometry(const GridView gridView) : ParentType(gridView) {} + template< class FractureGridAdapter > + BoxDfmFVGridGeometry(const GridView gridView, const FractureGridAdapter& fractureGridAdapter) + : ParentType(gridView) + { + update_(fractureGridAdapter); + } + //! The vertex mapper is the dofMapper //! This is convenience to have better chance to have the same main files for box/tpfa/mpfa... const DofMapper& dofMapper() const @@ -454,11 +462,20 @@ public: using GridView = GV; //! Constructor + [[deprecated("Use BoxDfmFVGridGeometry(gridView, fractureGridAdapter) instead! Will be removed after release 3.5.")]] BoxDfmFVGridGeometry(const GridView gridView) : ParentType(gridView) , facetMapper_(gridView, Dune::mcmgLayout(Dune::template Codim<1>())) {} + template< class FractureGridAdapter > + BoxDfmFVGridGeometry(const GridView gridView, const FractureGridAdapter& fractureGridAdapter) + : ParentType(gridView) + , facetMapper_(gridView, Dune::mcmgLayout(Dune::template Codim<1>())) + { + update_(fractureGridAdapter); + } + //! the vertex mapper is the dofMapper //! this is convenience to have better chance to have the same main files for box/tpfa/mpfa... const DofMapper& dofMapper() const @@ -527,7 +544,16 @@ public: private: - void update_() + void updateFacetMapper_() + { + if constexpr (Deprecated::hasUpdateGridView()) + facetMapper_.update(this->gridView()); + else + Deprecated::update(facetMapper_); + } + + template< class FractureGridAdapter > + void update_(const FractureGridAdapter& fractureGridAdapter) { boundaryDofIndices_.assign(numDofs(), false); fractureDofIndices_.assign(numDofs(), false); -- GitLab From 47c28b59068d2876ccc776e3590ac1a389d59e98 Mon Sep 17 00:00:00 2001 From: Martin Schneider Date: Wed, 28 Jul 2021 20:57:35 +0200 Subject: [PATCH 04/10] [adaptive] New interface of reconstruct function gridGeometry needs gridView in update function such that the reconstruct interface has to be changed --- dumux/adaptive/adapt.hh | 6 ++--- dumux/adaptive/griddatatransfer.hh | 8 +++---- dumux/porousmediumflow/2p/griddatatransfer.hh | 22 ++++++++++++------- 3 files changed, 21 insertions(+), 15 deletions(-) diff --git a/dumux/adaptive/adapt.hh b/dumux/adaptive/adapt.hh index b5cc28e80f..64dc9716e2 100644 --- a/dumux/adaptive/adapt.hh +++ b/dumux/adaptive/adapt.hh @@ -37,19 +37,19 @@ namespace Dumux { * transfer from the old to the new grid. */ template -bool adapt(Grid& grid, GridDataTransfer& dataTransfer) +bool adapt(Grid& grid, GridDataTransfer& dataTransfer) { // Do pre-adaption step of the grid const bool mightCoarsen = grid.preAdapt(); // Let the helper do storage of variables - dataTransfer.store(); + dataTransfer.store(grid); // adapt the grid const bool refine = grid.adapt(); // (Re-)construct variables to new grid - dataTransfer.reconstruct(); + dataTransfer.reconstruct(grid); // delete markers in grid grid.postAdapt(); diff --git a/dumux/adaptive/griddatatransfer.hh b/dumux/adaptive/griddatatransfer.hh index 043b3686f4..48b0401954 100644 --- a/dumux/adaptive/griddatatransfer.hh +++ b/dumux/adaptive/griddatatransfer.hh @@ -30,6 +30,7 @@ namespace Dumux { * \ingroup Adaptive * \brief Interface to be used by classes transferring grid data on adpative grids */ +template class GridDataTransfer { public: @@ -37,12 +38,11 @@ public: virtual ~GridDataTransfer() = default; //! store user data before grid adaption - virtual void store() = 0; + virtual void store(const Grid&) = 0; - //! store user data after adaption - virtual void reconstruct() = 0; + //! store user data after grid adaption + virtual void reconstruct(const Grid&) = 0; }; - } // end namespace Dumux #endif diff --git a/dumux/porousmediumflow/2p/griddatatransfer.hh b/dumux/porousmediumflow/2p/griddatatransfer.hh index a10fff8980..e7a87d189e 100644 --- a/dumux/porousmediumflow/2p/griddatatransfer.hh +++ b/dumux/porousmediumflow/2p/griddatatransfer.hh @@ -45,12 +45,14 @@ namespace Dumux { * \brief Class performing the transfer of data on a grid from before to after adaptation. */ template -class TwoPGridDataTransfer : public GridDataTransfer +class TwoPGridDataTransfer : public GridDataTransfer> { using Grid = GetPropType; + using ParentType = GridDataTransfer; using Scalar = GetPropType; using Problem = GetPropType; using GridGeometry = GetPropType; + using GridView = typename GridGeometry::GridView; using FVElementGeometry = typename GridGeometry::LocalView; using SubControlVolume = typename FVElementGeometry::SubControlVolume; using Extrusion = Extrusion_t; @@ -119,7 +121,7 @@ public: std::shared_ptr gridGeometry, std::shared_ptr gridVariables, SolutionVector& sol) - : GridDataTransfer() + : ParentType() , problem_(problem) , gridGeometry_(gridGeometry) , gridVariables_(gridVariables) @@ -135,11 +137,10 @@ public: * into a container object, before the grid is adapted. Father elements hold averaged * information from the son cells for the case of the sons being coarsened. */ - void store() override + void store(const Grid& grid) override { adaptionMap_.resize(); - const auto& grid = gridGeometry_->gridView().grid(); for (auto level = grid.maxLevel(); level >= 0; level--) { for (const auto& element : elements(grid.levelGridView(level))) @@ -201,11 +202,18 @@ public: * and then a new son is created. That is then stored into the general data * structure (AdaptedValues). */ - void reconstruct() override + void reconstruct(const Grid& grid) override + { + gridGeometry_->update(grid.leafGridView()); + reconstruct_(); + } + + private: + + void reconstruct_() { // resize stuff (grid might have changed) adaptionMap_.resize(); - gridGeometry_->update(); sol_.resize(gridGeometry_->numDofs()); // vectors storing the mass associated with each vertex, when using the box method @@ -392,8 +400,6 @@ public: //#endif } - private: - /*! * \brief Stores sons entries into father element for averaging * -- GitLab From 4d951cc8bf27b9e15c5105e69a3ecdfaf167f1c7 Mon Sep 17 00:00:00 2001 From: Martin Schneider Date: Wed, 28 Jul 2021 21:35:10 +0200 Subject: [PATCH 05/10] [gg][mapper] Make sure mapper are updated --- .../staggered/fvgridgeometry.hh | 29 ++++++++++++++----- dumux/multidomain/facet/box/fvgridgeometry.hh | 4 +++ .../porousmediumflow/boxdfm/fvgridgeometry.hh | 4 +++ 3 files changed, 30 insertions(+), 7 deletions(-) diff --git a/dumux/discretization/staggered/fvgridgeometry.hh b/dumux/discretization/staggered/fvgridgeometry.hh index 0f00c115af..d847861c0d 100644 --- a/dumux/discretization/staggered/fvgridgeometry.hh +++ b/dumux/discretization/staggered/fvgridgeometry.hh @@ -285,6 +285,7 @@ public: void update() { ParentType::update(); + updateIntersectionMapper_(); update_(); } @@ -292,12 +293,14 @@ public: void update(const GridView& gridView) { ParentType::update(gridView); + updateIntersectionMapper_(); update_(); } void update(GridView&& gridView) { ParentType::update(std::move(gridView)); + updateIntersectionMapper_(); update_(); } @@ -366,16 +369,21 @@ public: private: + void updateIntersectionMapper_() + { + if constexpr (Deprecated::hasUpdateGridView()) + intersectionMapper_.update(this->gridView()); + else + Deprecated::update(intersectionMapper_); + } + void update_() { // clear containers (necessary after grid refinement) scvs_.clear(); scvfs_.clear(); scvfIndicesOfScv_.clear(); - if constexpr (Deprecated::hasUpdateGridView()) - intersectionMapper_.update(this->gridView()); - else - Deprecated::update(intersectionMapper_); + // determine size of containers std::size_t numScvs = this->gridView().size(0); std::size_t numScvf = 0; @@ -539,6 +547,7 @@ public: void update() { ParentType::update(); + updateIntersectionMapper_(); update_(); } @@ -546,12 +555,14 @@ public: void update(const GridView& gridView) { ParentType::update(gridView); + updateIntersectionMapper_(); update_(); } void update(GridView&& gridView) { ParentType::update(std::move(gridView)); + updateIntersectionMapper_(); update_(); } @@ -640,14 +651,18 @@ public: private: - void update_() + void updateIntersectionMapper_() { - // clear containers (necessary after grid refinement) - scvfIndicesOfScv_.clear(); if constexpr (Deprecated::hasUpdateGridView()) intersectionMapper_.update(this->gridView()); else Deprecated::update(intersectionMapper_); + } + + void update_() + { + // clear containers (necessary after grid refinement) + scvfIndicesOfScv_.clear(); neighborVolVarIndices_.clear(); numScvs_ = numCellCenterDofs(); diff --git a/dumux/multidomain/facet/box/fvgridgeometry.hh b/dumux/multidomain/facet/box/fvgridgeometry.hh index 2d43c7033a..4f56c2dd63 100644 --- a/dumux/multidomain/facet/box/fvgridgeometry.hh +++ b/dumux/multidomain/facet/box/fvgridgeometry.hh @@ -33,6 +33,7 @@ #include #include +#include #include #include #include @@ -484,6 +485,7 @@ public: { // first update the parent (mappers etc) ParentType::update(); + updateFacetMapper_(); update_(facetGridView, codimOneGridAdapter, verbose); } @@ -494,6 +496,7 @@ public: bool verbose = false) { ParentType::update(gridView); + updateFacetMapper_(); update_(facetGridView, codimOneGridAdapter, verbose); } @@ -504,6 +507,7 @@ public: bool verbose = false) { ParentType::update(std::move(gridView)); + updateFacetMapper_(); update_(facetGridView, codimOneGridAdapter, verbose); } diff --git a/dumux/porousmediumflow/boxdfm/fvgridgeometry.hh b/dumux/porousmediumflow/boxdfm/fvgridgeometry.hh index fe75055395..85b5b2b0d6 100644 --- a/dumux/porousmediumflow/boxdfm/fvgridgeometry.hh +++ b/dumux/porousmediumflow/boxdfm/fvgridgeometry.hh @@ -36,6 +36,7 @@ #include #include +#include #include #include #include @@ -504,6 +505,7 @@ public: void update(const FractureGridAdapter& fractureGridAdapter) { ParentType::update(); + updateFacetMapper_(); update_(fractureGridAdapter); } @@ -511,6 +513,7 @@ public: void update(const GridView& gridView, const FractureGridAdapter& fractureGridAdapter) { ParentType::update(gridView); + updateFacetMapper_(); update_(fractureGridAdapter); } @@ -518,6 +521,7 @@ public: void update(GridView&& gridView, const FractureGridAdapter& fractureGridAdapter) { ParentType::update(std::move(gridView)); + updateFacetMapper_(); update_(fractureGridAdapter); } -- GitLab From 3d4c18c1b69d27c68d775b178f4dfb519173dbb5 Mon Sep 17 00:00:00 2001 From: Martin Schneider Date: Wed, 28 Jul 2021 14:10:59 +0200 Subject: [PATCH 06/10] [tests][gg] Adapt to new update strategy for grid geometry Grid geometries constructed with a grid view are already initialized/updated from now on. The update interface changed to require a grid view. Remove duplicate updates and use new update interface with gridview. --- examples/1protationsymmetry/main.cc | 3 +- examples/1ptracer/main.cc | 1 - examples/2pinfiltration/main.cc | 1 - examples/biomineralization/main.cc | 1 - examples/freeflowchannel/main.cc | 1 - examples/liddrivencavity/main.cc | 1 - examples/porenetwork_upscaling/main.cc | 5 +- examples/shallowwaterfriction/main.cc | 1 - test/discretization/box/test_boxfvgeometry.cc | 1 - .../cellcentered/tpfa/test_tpfafvgeometry.cc | 1 - .../tpfa/test_tpfafvgeometry_nonconforming.cc | 1 - .../test_rotationsymmetric_gridgeometry.cc | 4 -- .../test_staggered_free_flow_geometry.cc | 1 - .../staggered/test_staggeredfvgeometry.cc | 1 - test/freeflow/navierstokes/angeli/main.cc | 1 - test/freeflow/navierstokes/channel/1d/main.cc | 1 - test/freeflow/navierstokes/channel/2d/main.cc | 1 - test/freeflow/navierstokes/channel/3d/main.cc | 1 - .../navierstokes/channel/pipe/main.cc | 1 - test/freeflow/navierstokes/donea/main.cc | 1 - test/freeflow/navierstokes/kovasznay/main.cc | 1 - test/freeflow/navierstokes/sincos/main.cc | 1 - test/freeflow/navierstokesnc/channel/main.cc | 1 - .../navierstokesnc/densitydrivenflow/main.cc | 1 - .../navierstokesnc/maxwellstefan/main.cc | 1 - test/freeflow/rans/main.cc | 1 - test/freeflow/ransnc/main.cc | 1 - test/freeflow/shallowwater/bowl/main.cc | 1 - test/freeflow/shallowwater/dambreak/main.cc | 1 - .../shallowwater/poiseuilleflow/main.cc | 1 - .../shallowwater/roughchannel/main.cc | 1 - test/geomechanics/elastic/main.cc | 1 - test/geomechanics/poroelastic/main.cc | 1 - test/io/gridmanager/test_gmshboundaryflag.cc | 2 - test/io/gridmanager/test_pnm_subgriddata.cc | 3 +- .../vtk/test_vtk_staggeredfreeflowpvnames.cc | 1 - .../boundary/darcydarcy/1p_1p/main.cc | 2 - .../boundary/darcydarcy/1p_2p/main.cc | 2 - .../1p2c_1p2c/diffusionlawcomparison/main.cc | 2 - .../boundary/stokesdarcy/1p2c_1p2c/main.cc | 2 - .../boundary/stokesdarcy/1p2c_2p2c/main.cc | 2 - .../boundary/stokesdarcy/1p3c_1p3c/main.cc | 2 - .../stokesdarcy/1p_1p/convergencetest/main.cc | 2 - .../boundary/stokesdarcy/1p_1p/main.cc | 2 - .../boundary/stokesdarcy/1p_2p/main.cc | 2 - .../embedded/1d3d/1p2c_richards2c/main.cc | 10 +--- test/multidomain/embedded/1d3d/1p_1p/main.cc | 2 - .../embedded/1d3d/1p_richards/main.cc | 2 - test/multidomain/embedded/2d3d/1p_1p/main.cc | 2 - .../facet/1p_1p/analytical/main.cc | 36 +++++++------- test/multidomain/facet/1p_1p/gravity/main.cc | 2 - .../facet/1p_1p/linearprofile/main.cc | 2 - test/multidomain/facet/1pnc_1pnc/main.cc | 38 +++++++-------- .../facet/test_facetcouplingmapper.cc | 48 ++++++++++++------- .../test_facetcouplingmapper_boundary.cc | 2 - test/multidomain/facet/tracer_tracer/main.cc | 38 +++++++-------- test/multidomain/poromechanics/el1p/main.cc | 2 - test/multidomain/poromechanics/el2p/main.cc | 2 - test/porenetwork/1p/main.cc | 3 +- test/porenetwork/1p/noncreepingflow/main.cc | 3 +- .../1p/noncreepingflow/nonisothermal/main.cc | 3 +- test/porenetwork/1p/nonisothermal/main.cc | 3 +- test/porenetwork/1pnc/main.cc | 3 +- test/porenetwork/2p/main.cc | 3 +- test/porenetwork/2p/static/main.cc | 3 +- .../1p/compressible/instationary/main.cc | 1 - .../instationary/main_experimental.cc | 1 - .../1p/compressible/stationary/main.cc | 1 - .../1p/convergence/analyticsolution/main.cc | 1 - .../1p/convergence/discretesolution/solver.hh | 1 - test/porousmediumflow/1p/fracture2d3d/main.cc | 1 - .../1p/incompressible/main.cc | 1 - test/porousmediumflow/1p/isothermal/main.cc | 1 - test/porousmediumflow/1p/network1d3d/main.cc | 1 - .../porousmediumflow/1p/nonisothermal/main.cc | 1 - test/porousmediumflow/1p/periodicbc/main.cc | 1 - .../1p/pointsources/timedependent/main.cc | 1 - .../1p/pointsources/timeindependent/main.cc | 1 - .../porousmediumflow/1p/rootbenchmark/main.cc | 1 - .../1pnc/1p2c/isothermal/main.cc | 1 - .../isothermal/saltwaterintrusion/main.cc | 1 - .../1p2c/nonisothermal/conduction/main.cc | 1 - .../1p2c/nonisothermal/convection/main.cc | 1 - .../1p2c/nonisothermal/transientbc/main.cc | 1 - test/porousmediumflow/1pnc/1p3c/main.cc | 1 - .../1pnc/nonequilibrium/main.cc | 1 - .../1pncmin/nonisothermal/main.cc | 1 - test/porousmediumflow/2p/adaptive/main.cc | 1 - test/porousmediumflow/2p/boxdfm/main.cc | 3 +- test/porousmediumflow/2p/cornerpoint/main.cc | 1 - test/porousmediumflow/2p/fracture/main.cc | 1 - .../2p/incompressible/main.cc | 1 - .../porousmediumflow/2p/nonisothermal/main.cc | 1 - .../2p/rotationsymmetry/main.cc | 1 - test/porousmediumflow/2p1c/main.cc | 1 - .../2p2c/chemicalnonequilibrium/main.cc | 1 - test/porousmediumflow/2p2c/injection/main.cc | 1 - .../2p2c/mpnccomparison/main.cc | 1 - test/porousmediumflow/2p2c/waterair/main.cc | 1 - test/porousmediumflow/2pnc/diffusion/main.cc | 1 - test/porousmediumflow/2pnc/fuelcell/main.cc | 1 - .../2pncmin/isothermal/main.cc | 1 - .../2pncmin/nonisothermal/main.cc | 1 - test/porousmediumflow/3p/conduction/main.cc | 1 - test/porousmediumflow/3p/convection/main.cc | 1 - test/porousmediumflow/3p/infiltration/main.cc | 1 - .../porousmediumflow/3p3c/columnxylol/main.cc | 1 - .../3p3c/infiltration/main.cc | 1 - test/porousmediumflow/3p3c/kuevette/main.cc | 1 - test/porousmediumflow/3pwateroil/main.cc | 1 - test/porousmediumflow/co2/main.cc | 1 - .../mpnc/2p2ccomparison/main.cc | 1 - test/porousmediumflow/mpnc/kinetic/main.cc | 1 - test/porousmediumflow/mpnc/obstacle/main.cc | 1 - .../mpnc/thermalnonequilibrium/main.cc | 1 - .../richards/analytical/main.cc | 1 - .../richards/benchmarks/main.cc | 1 - test/porousmediumflow/richards/lens/main.cc | 1 - .../richards/nonisothermal/conduction/main.cc | 1 - .../richards/nonisothermal/convection/main.cc | 1 - .../nonisothermal/evaporation/main.cc | 1 - test/porousmediumflow/richardsnc/main.cc | 1 - test/porousmediumflow/solidenergy/main.cc | 1 - test/porousmediumflow/tracer/2ptracer/main.cc | 1 - test/porousmediumflow/tracer/constvel/main.cc | 1 - .../tracer/multiphase/main.cc | 1 - 126 files changed, 100 insertions(+), 236 deletions(-) diff --git a/examples/1protationsymmetry/main.cc b/examples/1protationsymmetry/main.cc index e25029a781..f75766827f 100644 --- a/examples/1protationsymmetry/main.cc +++ b/examples/1protationsymmetry/main.cc @@ -74,7 +74,6 @@ int main(int argc, char** argv) try // instantiate the grid geometry using GridGeometry = GetPropType; auto gridGeometry = std::make_shared(leafGridView); - gridGeometry->update(); // [[/codeblock]] // ### Initialize the problem and grid variables @@ -158,7 +157,7 @@ int main(int argc, char** argv) try // update the grid geometry, the grid variables and // the solution vectors now that the grid has been refined - gridGeometry->update(); + gridGeometry->update(gridManager.grid().leafGridView()); gridVariables->updateAfterGridAdaption(p); p.resize(gridGeometry->numDofs()); diff --git a/examples/1ptracer/main.cc b/examples/1ptracer/main.cc index 7cf95abb43..21569bc52d 100644 --- a/examples/1ptracer/main.cc +++ b/examples/1ptracer/main.cc @@ -105,7 +105,6 @@ int main(int argc, char** argv) try // of the grid partition. using GridGeometry = GetPropType; auto gridGeometry = std::make_shared(leafGridView); - gridGeometry->update(); // We now instantiate the problem, in which we define the boundary and initial conditions. using OnePProblem = GetPropType; diff --git a/examples/2pinfiltration/main.cc b/examples/2pinfiltration/main.cc index 80458c97f4..3f590b2745 100644 --- a/examples/2pinfiltration/main.cc +++ b/examples/2pinfiltration/main.cc @@ -98,7 +98,6 @@ int main(int argc, char** argv) try // We need the finite volume geometry to build up the subcontrolvolumes (scv) and subcontrolvolume faces (scvf) for each element of the grid partition. using GridGeometry = GetPropType; auto gridGeometry = std::make_shared(leafGridView); - gridGeometry->update(); // In the problem, we define the boundary and initial conditions and compute the point sources. The `computePointSourceMap` method is inherited from the fvproblem and therefore specified in the `dumux/common/fvproblem.hh`. It calls the `addPointSources` method specified in the `problem.hh` file. // [[codeblock]] diff --git a/examples/biomineralization/main.cc b/examples/biomineralization/main.cc index 8ae2cc3b84..45fa5a95e6 100644 --- a/examples/biomineralization/main.cc +++ b/examples/biomineralization/main.cc @@ -96,7 +96,6 @@ int main(int argc, char** argv) try // We need the finite volume geometry to build up the subcontrolvolumes (scv) and subcontrolvolume faces (scvf) for each element of the grid partition. using GridGeometry = GetPropType; auto gridGeometry = std::make_shared(leafGridView); - gridGeometry->update(); // We now instantiate the problem, in which we define the boundary and initial conditions. using Problem = GetPropType; diff --git a/examples/freeflowchannel/main.cc b/examples/freeflowchannel/main.cc index 8994914603..abe4b4e163 100644 --- a/examples/freeflowchannel/main.cc +++ b/examples/freeflowchannel/main.cc @@ -106,7 +106,6 @@ int main(int argc, char** argv) try // of the grid partition. using GridGeometry = GetPropType; auto gridGeometry = std::make_shared(leafGridView); - gridGeometry->update(); // We now instantiate the problem, in which we define the boundary and initial conditions. using Problem = GetPropType; diff --git a/examples/liddrivencavity/main.cc b/examples/liddrivencavity/main.cc index d8c88134d8..0b6680b1a4 100644 --- a/examples/liddrivencavity/main.cc +++ b/examples/liddrivencavity/main.cc @@ -126,7 +126,6 @@ int main(int argc, char** argv) // of the grid partition. using GridGeometry = GetPropType; auto gridGeometry = std::make_shared(leafGridView); - gridGeometry->update(); // We now instantiate the problem, in which we define the boundary and initial conditions. using Problem = GetPropType; diff --git a/examples/porenetwork_upscaling/main.cc b/examples/porenetwork_upscaling/main.cc index dfd431878d..af9cb30c19 100644 --- a/examples/porenetwork_upscaling/main.cc +++ b/examples/porenetwork_upscaling/main.cc @@ -73,10 +73,9 @@ int main(int argc, char** argv) try const auto& leafGridView = gridManager.grid().leafGridView(); // instantiate the grid geometry - using GridGeometry = GetPropType; - auto gridGeometry = std::make_shared(leafGridView); auto gridData = gridManager.getGridData(); - gridGeometry->update(*gridData); + using GridGeometry = GetPropType; + auto gridGeometry = std::make_shared(leafGridView, *gridData); // [[/codeblock]] // ### Initialize the problem and grid variables diff --git a/examples/shallowwaterfriction/main.cc b/examples/shallowwaterfriction/main.cc index f231708a7a..5e6dfd4ed0 100644 --- a/examples/shallowwaterfriction/main.cc +++ b/examples/shallowwaterfriction/main.cc @@ -97,7 +97,6 @@ int main(int argc, char** argv) try // of the grid partition. using GridGeometry = GetPropType; auto gridGeometry = std::make_shared(leafGridView); - gridGeometry->update(); // We now instantiate the problem, in which we define the boundary and initial conditions. using Problem = GetPropType; diff --git a/test/discretization/box/test_boxfvgeometry.cc b/test/discretization/box/test_boxfvgeometry.cc index da016a1757..1434154d32 100644 --- a/test/discretization/box/test_boxfvgeometry.cc +++ b/test/discretization/box/test_boxfvgeometry.cc @@ -73,7 +73,6 @@ int main (int argc, char *argv[]) auto leafGridView = grid->leafGridView(); GridGeometry gridGeometry(leafGridView); - gridGeometry.update(); // iterate over elements. For every element get fv geometry and loop over scvs and scvfaces for (const auto& element : elements(leafGridView)) diff --git a/test/discretization/cellcentered/tpfa/test_tpfafvgeometry.cc b/test/discretization/cellcentered/tpfa/test_tpfafvgeometry.cc index a106e92a85..435fb6e862 100644 --- a/test/discretization/cellcentered/tpfa/test_tpfafvgeometry.cc +++ b/test/discretization/cellcentered/tpfa/test_tpfafvgeometry.cc @@ -74,7 +74,6 @@ int main (int argc, char *argv[]) // obtain leaf and make GridGeometry auto leafGridView = grid->leafGridView(); GridGeometry gridGeometry(leafGridView); - gridGeometry.update(); // iterate over elements. For every element get fv geometry and loop over scvs and scvfaces for (const auto& element : elements(leafGridView)) diff --git a/test/discretization/cellcentered/tpfa/test_tpfafvgeometry_nonconforming.cc b/test/discretization/cellcentered/tpfa/test_tpfafvgeometry_nonconforming.cc index 36218567fb..aa91b0b44b 100644 --- a/test/discretization/cellcentered/tpfa/test_tpfafvgeometry_nonconforming.cc +++ b/test/discretization/cellcentered/tpfa/test_tpfafvgeometry_nonconforming.cc @@ -143,7 +143,6 @@ int main (int argc, char *argv[]) //! instantiate and update gridGeometry GridGeometry gridGeometry(leafGridView); - gridGeometry.update(); //! We should have constructed 12 scvfs if (gridGeometry.numScv() != 12) diff --git a/test/discretization/rotationsymmetry/test_rotationsymmetric_gridgeometry.cc b/test/discretization/rotationsymmetry/test_rotationsymmetric_gridgeometry.cc index 2f4ebe24c5..fb1094e1d8 100644 --- a/test/discretization/rotationsymmetry/test_rotationsymmetric_gridgeometry.cc +++ b/test/discretization/rotationsymmetry/test_rotationsymmetric_gridgeometry.cc @@ -114,7 +114,6 @@ int main (int argc, char *argv[]) // obtain leaf and make GridGeometry auto leafGridView = grid->leafGridView(); GridGeometry gg(leafGridView); - gg.update(); // compute the annulus area and the surface const double refVolume = M_PI*(outerRadius*outerRadius - innerRadius*innerRadius); @@ -144,7 +143,6 @@ int main (int argc, char *argv[]) // obtain leaf and make GridGeometry auto leafGridView = grid->leafGridView(); GridGeometry gg(leafGridView); - gg.update(); // compute the ball volume and the surface const double refVolume = 4.0/3.0*M_PI*(outerRadius*outerRadius*outerRadius - innerRadius*innerRadius*innerRadius); @@ -177,7 +175,6 @@ int main (int argc, char *argv[]) // make GridGeometry GridGeometry gg(leafGridView); - gg.update(); // compute the volume and the surface const auto centroidRadius = 0.5*(innerRadius + outerRadius); @@ -195,7 +192,6 @@ int main (int argc, char *argv[]) { using Extrusion = RotationalExtrusion<1>; }; using GridGeometry = CCTpfaFVGridGeometry; GridGeometry gg(leafGridView); - gg.update(); // compute the volume and the surface const auto centroidRadius = 0.5*height; diff --git a/test/discretization/staggered/test_staggered_free_flow_geometry.cc b/test/discretization/staggered/test_staggered_free_flow_geometry.cc index 5fce7aa9e4..d5d034c2db 100644 --- a/test/discretization/staggered/test_staggered_free_flow_geometry.cc +++ b/test/discretization/staggered/test_staggered_free_flow_geometry.cc @@ -88,7 +88,6 @@ int main (int argc, char *argv[]) auto leafGridView = grid->leafGridView(); GridGeometry gridGeometry(leafGridView); - gridGeometry.update(); std::cout << "Abbreviatons:\n" << "pos - postition of face center\n" diff --git a/test/discretization/staggered/test_staggeredfvgeometry.cc b/test/discretization/staggered/test_staggeredfvgeometry.cc index 44214918e2..bf1377d0ff 100644 --- a/test/discretization/staggered/test_staggeredfvgeometry.cc +++ b/test/discretization/staggered/test_staggeredfvgeometry.cc @@ -124,7 +124,6 @@ int main (int argc, char *argv[]) auto leafGridView = grid->leafGridView(); GridGeometry gridGeometry(leafGridView); - gridGeometry.update(); // iterate over elements. For every element get fv geometry and loop over scvs and scvfaces for (const auto& element : elements(leafGridView)) diff --git a/test/freeflow/navierstokes/angeli/main.cc b/test/freeflow/navierstokes/angeli/main.cc index bf7b1d7009..2ec5ab225d 100644 --- a/test/freeflow/navierstokes/angeli/main.cc +++ b/test/freeflow/navierstokes/angeli/main.cc @@ -132,7 +132,6 @@ int main(int argc, char** argv) // create the finite volume grid geometry using GridGeometry = GetPropType; auto gridGeometry = std::make_shared(leafGridView); - gridGeometry->update(); // get some time loop parameters using Scalar = GetPropType; diff --git a/test/freeflow/navierstokes/channel/1d/main.cc b/test/freeflow/navierstokes/channel/1d/main.cc index 5af6b61779..f1aa15c446 100644 --- a/test/freeflow/navierstokes/channel/1d/main.cc +++ b/test/freeflow/navierstokes/channel/1d/main.cc @@ -75,7 +75,6 @@ int main(int argc, char** argv) // create the finite volume grid geometry using GridGeometry = GetPropType; auto gridGeometry = std::make_shared(leafGridView); - gridGeometry->update(); // the problem (boundary conditions) using Problem = GetPropType; diff --git a/test/freeflow/navierstokes/channel/2d/main.cc b/test/freeflow/navierstokes/channel/2d/main.cc index bbcb337b62..2c180790aa 100644 --- a/test/freeflow/navierstokes/channel/2d/main.cc +++ b/test/freeflow/navierstokes/channel/2d/main.cc @@ -76,7 +76,6 @@ int main(int argc, char** argv) // create the finite volume grid geometry using GridGeometry = GetPropType; auto gridGeometry = std::make_shared(leafGridView); - gridGeometry->update(); // the problem (initial and boundary conditions) using Problem = GetPropType; diff --git a/test/freeflow/navierstokes/channel/3d/main.cc b/test/freeflow/navierstokes/channel/3d/main.cc index bc41689723..40df458c2b 100644 --- a/test/freeflow/navierstokes/channel/3d/main.cc +++ b/test/freeflow/navierstokes/channel/3d/main.cc @@ -101,7 +101,6 @@ int main(int argc, char** argv) // create the finite volume grid geometry using GridGeometry = GetPropType; auto gridGeometry = std::make_shared(leafGridView); - gridGeometry->update(); // the problem (boundary conditions) using Problem = GetPropType; diff --git a/test/freeflow/navierstokes/channel/pipe/main.cc b/test/freeflow/navierstokes/channel/pipe/main.cc index d8980e1270..5e5a62fbad 100644 --- a/test/freeflow/navierstokes/channel/pipe/main.cc +++ b/test/freeflow/navierstokes/channel/pipe/main.cc @@ -90,7 +90,6 @@ int main(int argc, char** argv) // create the finite volume grid geometry using GridGeometry = GetPropType; auto gridGeometry = std::make_shared(gridView); - gridGeometry->update(); // the problem (initial and boundary conditions) using Problem = GetPropType; diff --git a/test/freeflow/navierstokes/donea/main.cc b/test/freeflow/navierstokes/donea/main.cc index b0dffe48ad..177bb4f434 100644 --- a/test/freeflow/navierstokes/donea/main.cc +++ b/test/freeflow/navierstokes/donea/main.cc @@ -77,7 +77,6 @@ int main(int argc, char** argv) // create the finite volume grid geometry using GridGeometry = GetPropType; auto gridGeometry = std::make_shared(leafGridView); - gridGeometry->update(); // the problem (boundary conditions) using Problem = GetPropType; diff --git a/test/freeflow/navierstokes/kovasznay/main.cc b/test/freeflow/navierstokes/kovasznay/main.cc index e0c81ef42e..c9af40ea99 100644 --- a/test/freeflow/navierstokes/kovasznay/main.cc +++ b/test/freeflow/navierstokes/kovasznay/main.cc @@ -105,7 +105,6 @@ int main(int argc, char** argv) // create the finite volume grid geometry using GridGeometry = GetPropType; auto gridGeometry = std::make_shared(leafGridView); - gridGeometry->update(); // the problem (boundary conditions) using Problem = GetPropType; diff --git a/test/freeflow/navierstokes/sincos/main.cc b/test/freeflow/navierstokes/sincos/main.cc index 8830ec2ba6..ecfd4a251a 100644 --- a/test/freeflow/navierstokes/sincos/main.cc +++ b/test/freeflow/navierstokes/sincos/main.cc @@ -197,7 +197,6 @@ int main(int argc, char** argv) // create the finite volume grid geometry using GridGeometry = GetPropType; auto gridGeometry = std::make_shared(leafGridView); - gridGeometry->update(); // get some time loop parameters using Scalar = GetPropType; diff --git a/test/freeflow/navierstokesnc/channel/main.cc b/test/freeflow/navierstokesnc/channel/main.cc index 28e799b106..c09c219c9b 100644 --- a/test/freeflow/navierstokesnc/channel/main.cc +++ b/test/freeflow/navierstokesnc/channel/main.cc @@ -75,7 +75,6 @@ int main(int argc, char** argv) // create the finite volume grid geometry using GridGeometry = GetPropType; auto gridGeometry = std::make_shared(leafGridView); - gridGeometry->update(); // the problem (initial and boundary conditions) using Problem = GetPropType; diff --git a/test/freeflow/navierstokesnc/densitydrivenflow/main.cc b/test/freeflow/navierstokesnc/densitydrivenflow/main.cc index 0f595dbe68..b67b928577 100644 --- a/test/freeflow/navierstokesnc/densitydrivenflow/main.cc +++ b/test/freeflow/navierstokesnc/densitydrivenflow/main.cc @@ -75,7 +75,6 @@ int main(int argc, char** argv) // create the finite volume grid geometry using GridGeometry = GetPropType; auto gridGeometry = std::make_shared(leafGridView); - gridGeometry->update(); // the problem (initial and boundary conditions) using Problem = GetPropType; diff --git a/test/freeflow/navierstokesnc/maxwellstefan/main.cc b/test/freeflow/navierstokesnc/maxwellstefan/main.cc index a9348bc5ed..85c094f25a 100644 --- a/test/freeflow/navierstokesnc/maxwellstefan/main.cc +++ b/test/freeflow/navierstokesnc/maxwellstefan/main.cc @@ -75,7 +75,6 @@ int main(int argc, char** argv) // create the finite volume grid geometry using GridGeometry = GetPropType; auto gridGeometry = std::make_shared(leafGridView); - gridGeometry->update(); // the problem (initial and boundary conditions) using Problem = GetPropType; diff --git a/test/freeflow/rans/main.cc b/test/freeflow/rans/main.cc index 2360d7879b..39e2a52fa7 100644 --- a/test/freeflow/rans/main.cc +++ b/test/freeflow/rans/main.cc @@ -99,7 +99,6 @@ int main(int argc, char** argv) // create the finite volume grid geometry using GridGeometry = GetPropType; auto gridGeometry = std::make_shared(leafGridView); - gridGeometry->update(); // the problem (initial and boundary conditions) using Problem = GetPropType; diff --git a/test/freeflow/ransnc/main.cc b/test/freeflow/ransnc/main.cc index 9b55db443e..518732f24b 100644 --- a/test/freeflow/ransnc/main.cc +++ b/test/freeflow/ransnc/main.cc @@ -97,7 +97,6 @@ int main(int argc, char** argv) // create the finite volume grid geometry using GridGeometry = GetPropType; auto gridGeometry = std::make_shared(leafGridView); - gridGeometry->update(); // the problem (initial and boundary conditions) using Problem = GetPropType; diff --git a/test/freeflow/shallowwater/bowl/main.cc b/test/freeflow/shallowwater/bowl/main.cc index f777814f21..4f9e24fab4 100644 --- a/test/freeflow/shallowwater/bowl/main.cc +++ b/test/freeflow/shallowwater/bowl/main.cc @@ -154,7 +154,6 @@ int main(int argc, char** argv) // create the finite volume grid geometry using GridGeometry = GetPropType; auto gridGeometry = std::make_shared(leafGridView); - gridGeometry->update(); // the problem (initial and boundary conditions) using Problem = GetPropType; diff --git a/test/freeflow/shallowwater/dambreak/main.cc b/test/freeflow/shallowwater/dambreak/main.cc index 7755ceefac..3d9aa15439 100644 --- a/test/freeflow/shallowwater/dambreak/main.cc +++ b/test/freeflow/shallowwater/dambreak/main.cc @@ -88,7 +88,6 @@ int main(int argc, char** argv) // create the finite volume grid geometry using GridGeometry = GetPropType; auto gridGeometry = std::make_shared(leafGridView); - gridGeometry->update(); // the problem (initial and boundary conditions) using Problem = GetPropType; diff --git a/test/freeflow/shallowwater/poiseuilleflow/main.cc b/test/freeflow/shallowwater/poiseuilleflow/main.cc index 932bb3d1fb..8d31944398 100644 --- a/test/freeflow/shallowwater/poiseuilleflow/main.cc +++ b/test/freeflow/shallowwater/poiseuilleflow/main.cc @@ -57,7 +57,6 @@ int main(int argc, char** argv) using GridGeometry = GetPropType; auto gridGeometry = std::make_shared(leafGridView); - gridGeometry->update(); // problem, in which we define the boundary and initial conditions. using Problem = GetPropType; diff --git a/test/freeflow/shallowwater/roughchannel/main.cc b/test/freeflow/shallowwater/roughchannel/main.cc index 3976a282c3..a1c1201043 100644 --- a/test/freeflow/shallowwater/roughchannel/main.cc +++ b/test/freeflow/shallowwater/roughchannel/main.cc @@ -78,7 +78,6 @@ int main(int argc, char** argv) // create the finite volume grid geometry using GridGeometry = GetPropType; auto gridGeometry = std::make_shared(leafGridView); - gridGeometry->update(); // the problem (initial and boundary conditions) using Problem = GetPropType; diff --git a/test/geomechanics/elastic/main.cc b/test/geomechanics/elastic/main.cc index c613701af2..a6b49e382f 100644 --- a/test/geomechanics/elastic/main.cc +++ b/test/geomechanics/elastic/main.cc @@ -82,7 +82,6 @@ int main(int argc, char** argv) // create the finite volume grid geometry using GridGeometry = GetPropType; auto gridGeometry = std::make_shared(leafGridView); - gridGeometry->update(); // the problem (initial and boundary conditions) using Problem = GetPropType; diff --git a/test/geomechanics/poroelastic/main.cc b/test/geomechanics/poroelastic/main.cc index 64d9b6abb9..2dd74851c0 100644 --- a/test/geomechanics/poroelastic/main.cc +++ b/test/geomechanics/poroelastic/main.cc @@ -125,7 +125,6 @@ int main(int argc, char** argv) // create the finite volume grid geometry using GridGeometry = GetPropType; auto gridGeometry = std::make_shared(leafGridView); - gridGeometry->update(); // the problem (initial and boundary conditions) using Problem = GetPropType; diff --git a/test/io/gridmanager/test_gmshboundaryflag.cc b/test/io/gridmanager/test_gmshboundaryflag.cc index df8a729257..4152906458 100644 --- a/test/io/gridmanager/test_gmshboundaryflag.cc +++ b/test/io/gridmanager/test_gmshboundaryflag.cc @@ -87,7 +87,6 @@ int main(int argc, char** argv) > >; auto boxFvGridGeometry = std::make_shared(leafGridView); - boxFvGridGeometry->update(); // run the test GmshBoundaryFlagTest::testGmshBoundaryFlag(leafGridView, boxFvGridGeometry, gridData); @@ -104,7 +103,6 @@ int main(int argc, char** argv) > >; auto ccTpfaFvGridGeometry = std::make_shared(leafGridView); - ccTpfaFvGridGeometry->update(); // run the test GmshBoundaryFlagTest::testGmshBoundaryFlag(leafGridView, ccTpfaFvGridGeometry, gridData); diff --git a/test/io/gridmanager/test_pnm_subgriddata.cc b/test/io/gridmanager/test_pnm_subgriddata.cc index ff48ab79ab..40b6e5936a 100644 --- a/test/io/gridmanager/test_pnm_subgriddata.cc +++ b/test/io/gridmanager/test_pnm_subgriddata.cc @@ -63,8 +63,7 @@ int main(int argc, char** argv) using SubGridData = PoreNetwork::SubGridData; auto gridData = std::make_shared(subGridManager.grid(), hostGridData); - PoreNetwork::GridGeometry gridGeometry(subGridManager.grid().leafGridView()); - gridGeometry.update(*gridData); + PoreNetwork::GridGeometry gridGeometry(subGridManager.grid().leafGridView(), *gridData); const auto& params = gridData->parameters(*(elements(subGridManager.grid().leafGridView()).begin())); for (const auto& p : params) diff --git a/test/io/vtk/test_vtk_staggeredfreeflowpvnames.cc b/test/io/vtk/test_vtk_staggeredfreeflowpvnames.cc index 0f35516cfc..2e9cfc15f3 100644 --- a/test/io/vtk/test_vtk_staggeredfreeflowpvnames.cc +++ b/test/io/vtk/test_vtk_staggeredfreeflowpvnames.cc @@ -328,7 +328,6 @@ int main(int argc, char** argv) const auto grid = Dune::StructuredGridFactory::createCubeGrid(lowerLeft, upperRight, cells); const auto gridView = grid->leafGridView(); auto gridGeometry = std::make_shared(gridView); - gridGeometry->update(); using FluidSystem = GetPropType; FluidSystem::init(); diff --git a/test/multidomain/boundary/darcydarcy/1p_1p/main.cc b/test/multidomain/boundary/darcydarcy/1p_1p/main.cc index 8afc1660b0..c9b8cc5ca5 100644 --- a/test/multidomain/boundary/darcydarcy/1p_1p/main.cc +++ b/test/multidomain/boundary/darcydarcy/1p_1p/main.cc @@ -122,8 +122,6 @@ int main(int argc, char** argv) using GridGeometry = GetPropType; auto fvGridGeometry0 = std::make_shared(gridView0); auto fvGridGeometry1 = std::make_shared(gridView1); - fvGridGeometry0->update(); - fvGridGeometry1->update(); // the mixed dimension type traits using Traits = MultiDomainTraits; diff --git a/test/multidomain/boundary/darcydarcy/1p_2p/main.cc b/test/multidomain/boundary/darcydarcy/1p_2p/main.cc index 372b400335..385d63c448 100644 --- a/test/multidomain/boundary/darcydarcy/1p_2p/main.cc +++ b/test/multidomain/boundary/darcydarcy/1p_2p/main.cc @@ -107,8 +107,6 @@ int main(int argc, char** argv) using GridGeometry = GetPropType; auto fvGridGeometry0 = std::make_shared(gridView0); auto fvGridGeometry1 = std::make_shared(gridView1); - fvGridGeometry0->update(); - fvGridGeometry1->update(); // the mixed dimension type traits using Traits = MultiDomainTraits; diff --git a/test/multidomain/boundary/stokesdarcy/1p2c_1p2c/diffusionlawcomparison/main.cc b/test/multidomain/boundary/stokesdarcy/1p2c_1p2c/diffusionlawcomparison/main.cc index 442fddcaf9..9e6bc2159a 100644 --- a/test/multidomain/boundary/stokesdarcy/1p2c_1p2c/diffusionlawcomparison/main.cc +++ b/test/multidomain/boundary/stokesdarcy/1p2c_1p2c/diffusionlawcomparison/main.cc @@ -83,10 +83,8 @@ int main(int argc, char** argv) // create the finite volume grid geometry using StokesFVGridGeometry = GetPropType; auto stokesFvGridGeometry = std::make_shared(stokesGridView); - stokesFvGridGeometry->update(); using DarcyFVGridGeometry = GetPropType; auto darcyFvGridGeometry = std::make_shared(darcyGridView); - darcyFvGridGeometry->update(); using Traits = StaggeredMultiDomainTraits; diff --git a/test/multidomain/boundary/stokesdarcy/1p2c_1p2c/main.cc b/test/multidomain/boundary/stokesdarcy/1p2c_1p2c/main.cc index bd62179d14..4c2ac5bfa2 100644 --- a/test/multidomain/boundary/stokesdarcy/1p2c_1p2c/main.cc +++ b/test/multidomain/boundary/stokesdarcy/1p2c_1p2c/main.cc @@ -82,10 +82,8 @@ int main(int argc, char** argv) // create the finite volume grid geometry using StokesFVGridGeometry = GetPropType; auto stokesFvGridGeometry = std::make_shared(stokesGridView); - stokesFvGridGeometry->update(); using DarcyFVGridGeometry = GetPropType; auto darcyFvGridGeometry = std::make_shared(darcyGridView); - darcyFvGridGeometry->update(); using Traits = StaggeredMultiDomainTraits; diff --git a/test/multidomain/boundary/stokesdarcy/1p2c_2p2c/main.cc b/test/multidomain/boundary/stokesdarcy/1p2c_2p2c/main.cc index 5787d767af..eed0b9f294 100644 --- a/test/multidomain/boundary/stokesdarcy/1p2c_2p2c/main.cc +++ b/test/multidomain/boundary/stokesdarcy/1p2c_2p2c/main.cc @@ -84,10 +84,8 @@ int main(int argc, char** argv) // create the finite volume grid geometry using StokesFVGridGeometry = GetPropType; auto stokesFvGridGeometry = std::make_shared(stokesGridView); - stokesFvGridGeometry->update(); using DarcyFVGridGeometry = GetPropType; auto darcyFvGridGeometry = std::make_shared(darcyGridView); - darcyFvGridGeometry->update(); using Traits = StaggeredMultiDomainTraits; diff --git a/test/multidomain/boundary/stokesdarcy/1p3c_1p3c/main.cc b/test/multidomain/boundary/stokesdarcy/1p3c_1p3c/main.cc index 66fc70abde..ed7fdbf249 100644 --- a/test/multidomain/boundary/stokesdarcy/1p3c_1p3c/main.cc +++ b/test/multidomain/boundary/stokesdarcy/1p3c_1p3c/main.cc @@ -82,10 +82,8 @@ int main(int argc, char** argv) // create the finite volume grid geometry using StokesFVGridGeometry = GetPropType; auto stokesFvGridGeometry = std::make_shared(stokesGridView); - stokesFvGridGeometry->update(); using DarcyFVGridGeometry = GetPropType; auto darcyFvGridGeometry = std::make_shared(darcyGridView); - darcyFvGridGeometry->update(); using Traits = StaggeredMultiDomainTraits; diff --git a/test/multidomain/boundary/stokesdarcy/1p_1p/convergencetest/main.cc b/test/multidomain/boundary/stokesdarcy/1p_1p/convergencetest/main.cc index 9176d17e57..a77c039eed 100644 --- a/test/multidomain/boundary/stokesdarcy/1p_1p/convergencetest/main.cc +++ b/test/multidomain/boundary/stokesdarcy/1p_1p/convergencetest/main.cc @@ -246,10 +246,8 @@ int main(int argc, char** argv) // create the finite volume grid geometry using FreeFlowGridGeometry = GetPropType; auto freeFlowGridGeometry = std::make_shared(freeFlowGridView); - freeFlowGridGeometry->update(); using DarcyGridGeometry = GetPropType; auto darcyGridGeometry = std::make_shared(darcyGridView); - darcyGridGeometry->update(); using Traits = StaggeredMultiDomainTraits; diff --git a/test/multidomain/boundary/stokesdarcy/1p_1p/main.cc b/test/multidomain/boundary/stokesdarcy/1p_1p/main.cc index 3d97cb2e03..b4c3684eab 100644 --- a/test/multidomain/boundary/stokesdarcy/1p_1p/main.cc +++ b/test/multidomain/boundary/stokesdarcy/1p_1p/main.cc @@ -84,10 +84,8 @@ int main(int argc, char** argv) // create the finite volume grid geometry using StokesFVGridGeometry = GetPropType; auto stokesFvGridGeometry = std::make_shared(stokesGridView); - stokesFvGridGeometry->update(); using DarcyFVGridGeometry = GetPropType; auto darcyFvGridGeometry = std::make_shared(darcyGridView); - darcyFvGridGeometry->update(); using Traits = StaggeredMultiDomainTraits; diff --git a/test/multidomain/boundary/stokesdarcy/1p_2p/main.cc b/test/multidomain/boundary/stokesdarcy/1p_2p/main.cc index 784fc4a29d..946fedec05 100644 --- a/test/multidomain/boundary/stokesdarcy/1p_2p/main.cc +++ b/test/multidomain/boundary/stokesdarcy/1p_2p/main.cc @@ -81,10 +81,8 @@ int main(int argc, char** argv) // create the finite volume grid geometry using StokesFVGridGeometry = GetPropType; auto stokesFvGridGeometry = std::make_shared(stokesGridView); - stokesFvGridGeometry->update(); using DarcyFVGridGeometry = GetPropType; auto darcyFvGridGeometry = std::make_shared(darcyGridView); - darcyFvGridGeometry->update(); using Traits = StaggeredMultiDomainTraits; diff --git a/test/multidomain/embedded/1d3d/1p2c_richards2c/main.cc b/test/multidomain/embedded/1d3d/1p2c_richards2c/main.cc index 39f5383ff8..8e2b987a2d 100644 --- a/test/multidomain/embedded/1d3d/1p2c_richards2c/main.cc +++ b/test/multidomain/embedded/1d3d/1p2c_richards2c/main.cc @@ -183,10 +183,8 @@ int main(int argc, char** argv) // create the finite volume grid geometry using BulkFVGridGeometry = GetPropType; auto bulkFvGridGeometry = std::make_shared(bulkGridView); - bulkFvGridGeometry->update(); using LowDimFVGridGeometry = GetPropType; auto lowDimFvGridGeometry = std::make_shared(lowDimGridView); - lowDimFvGridGeometry->update(); // the mixed dimension type traits using Traits = MultiDomainTraits; @@ -269,14 +267,10 @@ int main(int argc, char** argv) soilGrid.postAdapt(); } - // update the bounding box tree - bulkFvGridGeometry->update(); + // update the grid geometry (including the bounding box tree) + bulkFvGridGeometry->update(bulkGridView); } - // update geometry after refinement - bulkFvGridGeometry->update(); - lowDimFvGridGeometry->update(); - // output min max h double bulkHMin = 1.0; double bulkHMax = 0.0; for (const auto& element : elements(bulkGridView)) diff --git a/test/multidomain/embedded/1d3d/1p_1p/main.cc b/test/multidomain/embedded/1d3d/1p_1p/main.cc index f6ce4a1dea..05c21c5537 100644 --- a/test/multidomain/embedded/1d3d/1p_1p/main.cc +++ b/test/multidomain/embedded/1d3d/1p_1p/main.cc @@ -86,10 +86,8 @@ int main(int argc, char** argv) // create the finite volume grid geometry using BulkFVGridGeometry = GetPropType; auto bulkFvGridGeometry = std::make_shared(bulkGridView); - bulkFvGridGeometry->update(); using LowDimFVGridGeometry = GetPropType; auto lowDimFvGridGeometry = std::make_shared(lowDimGridView); - lowDimFvGridGeometry->update(); // the mixed dimension type traits using Traits = MultiDomainTraits; diff --git a/test/multidomain/embedded/1d3d/1p_richards/main.cc b/test/multidomain/embedded/1d3d/1p_richards/main.cc index 6b049d59bb..0790f9c809 100644 --- a/test/multidomain/embedded/1d3d/1p_richards/main.cc +++ b/test/multidomain/embedded/1d3d/1p_richards/main.cc @@ -85,10 +85,8 @@ int main(int argc, char** argv) // create the finite volume grid geometry using BulkFVGridGeometry = GetPropType; auto bulkFvGridGeometry = std::make_shared(bulkGridView); - bulkFvGridGeometry->update(); using LowDimFVGridGeometry = GetPropType; auto lowDimFvGridGeometry = std::make_shared(lowDimGridView); - lowDimFvGridGeometry->update(); // the mixed dimension type traits using Traits = MultiDomainTraits; diff --git a/test/multidomain/embedded/2d3d/1p_1p/main.cc b/test/multidomain/embedded/2d3d/1p_1p/main.cc index d22958f2fd..9ed63755aa 100644 --- a/test/multidomain/embedded/2d3d/1p_1p/main.cc +++ b/test/multidomain/embedded/2d3d/1p_1p/main.cc @@ -142,10 +142,8 @@ int main(int argc, char** argv) // create the finite volume grid geometry using BulkFVGridGeometry = GetPropType; auto bulkFvGridGeometry = std::make_shared(bulkGridView); - bulkFvGridGeometry->update(); using LowDimFVGridGeometry = GetPropType; auto lowDimFvGridGeometry = std::make_shared(lowDimGridView); - lowDimFvGridGeometry->update(); // the mixed dimension type traits using Traits = MultiDomainTraits; diff --git a/test/multidomain/facet/1p_1p/analytical/main.cc b/test/multidomain/facet/1p_1p/analytical/main.cc index 99a958919f..fc0eca5cc2 100644 --- a/test/multidomain/facet/1p_1p/analytical/main.cc +++ b/test/multidomain/facet/1p_1p/analytical/main.cc @@ -117,38 +117,40 @@ computeL2Norm(const GridView& gridView, } /*! - * \brief Updates the finite volume grid geometry for the box scheme. + * \brief Constructs the finite volume grid geometry for the box scheme. * * This is necessary as the finite volume grid geometry for the box scheme with - * facet coupling requires additional data for the update. The reason is that + * facet coupling requires additional data for the constructor. The reason is that * we have to create additional faces on interior boundaries, which wouldn't be * created in the standard scheme. */ -template< class GridGeometry, +template< class BulkGridGeometry, class GridManager, + class BulkGridView, class LowDimGridView, - std::enable_if_t = 0 > -void updateBulkFVGridGeometry(GridGeometry& gridGeometry, - const GridManager& gridManager, - const LowDimGridView& lowDimGridView) + std::enable_if_t = 0 > +auto makeBulkFVGridGeometry(const GridManager& gridManager, + const BulkGridView& bulkGridView, + const LowDimGridView& lowDimGridView) { using BulkFacetGridAdapter = Dumux::CodimOneGridAdapter; BulkFacetGridAdapter facetGridAdapter(gridManager.getEmbeddings()); - gridGeometry.update(lowDimGridView, facetGridAdapter); + return std::make_shared(bulkGridView, lowDimGridView, facetGridAdapter); } /*! - * \brief Updates the finite volume grid geometry for the cell-centered schemes. + * \brief Constructs the finite volume grid geometry for the cell-centered schemes. */ -template< class GridGeometry, +template< class BulkGridGeometry, class GridManager, + class BulkGridView, class LowDimGridView, - std::enable_if_t = 0 > -void updateBulkFVGridGeometry(GridGeometry& gridGeometry, - const GridManager& gridManager, - const LowDimGridView& lowDimGridView) + std::enable_if_t = 0 > +auto makeBulkFVGridGeometry(const GridManager& gridManager, + const BulkGridView& bulkGridView, + const LowDimGridView& lowDimGridView) { - gridGeometry.update(); + return std::make_shared(bulkGridView); } } // end namespace Dumux @@ -195,10 +197,8 @@ int main(int argc, char** argv) // create the finite volume grid geometries using BulkFVGridGeometry = GetPropType; using LowDimFVGridGeometry = GetPropType; - auto bulkFvGridGeometry = std::make_shared(bulkGridView); auto lowDimFvGridGeometry = std::make_shared(lowDimGridView); - updateBulkFVGridGeometry(*bulkFvGridGeometry, gridManager, lowDimGridView); - lowDimFvGridGeometry->update(); + auto bulkFvGridGeometry = makeBulkFVGridGeometry(gridManager, bulkGridView, lowDimGridView); // the coupling manager using TestTraits = Properties::TestTraits; diff --git a/test/multidomain/facet/1p_1p/gravity/main.cc b/test/multidomain/facet/1p_1p/gravity/main.cc index 17e8981a3a..eae2efaf32 100644 --- a/test/multidomain/facet/1p_1p/gravity/main.cc +++ b/test/multidomain/facet/1p_1p/gravity/main.cc @@ -88,8 +88,6 @@ int main(int argc, char** argv) using LowDimFVGridGeometry = GetPropType; auto bulkFvGridGeometry = std::make_shared(bulkGridView); auto lowDimFvGridGeometry = std::make_shared(lowDimGridView); - bulkFvGridGeometry->update(); - lowDimFvGridGeometry->update(); // the coupling mapper using TestTraits = Properties::TestTraits; diff --git a/test/multidomain/facet/1p_1p/linearprofile/main.cc b/test/multidomain/facet/1p_1p/linearprofile/main.cc index c4855bdd8b..938953174d 100644 --- a/test/multidomain/facet/1p_1p/linearprofile/main.cc +++ b/test/multidomain/facet/1p_1p/linearprofile/main.cc @@ -89,8 +89,6 @@ int main(int argc, char** argv) using LowDimFVGridGeometry = GetPropType; auto bulkFvGridGeometry = std::make_shared(bulkGridView); auto lowDimFvGridGeometry = std::make_shared(lowDimGridView); - bulkFvGridGeometry->update(); - lowDimFvGridGeometry->update(); // the coupling mapper using TestTraits = Properties::TestTraits; diff --git a/test/multidomain/facet/1pnc_1pnc/main.cc b/test/multidomain/facet/1pnc_1pnc/main.cc index c0894e28e5..c973b6f105 100644 --- a/test/multidomain/facet/1pnc_1pnc/main.cc +++ b/test/multidomain/facet/1pnc_1pnc/main.cc @@ -47,38 +47,40 @@ namespace Dumux { /*! - * \brief Updates the finite volume grid geometry for the box scheme. + * \brief Constructs the finite volume grid geometry for the box scheme. * * This is necessary as the finite volume grid geometry for the box scheme with - * facet coupling requires additional data for the update. The reason is that + * facet coupling requires additional data for the constructor. The reason is that * we have to create additional faces on interior boundaries, which wouldn't be * created in the standard scheme. */ -template< class GridGeometry, +template< class BulkGridGeometry, class GridManager, - class FacetGridView, - std::enable_if_t = 0 > -void updateBulkFVGridGeometry(GridGeometry& gridGeometry, - const GridManager& gridManager, - const FacetGridView& facetGridView) + class BulkGridView, + class LowDimGridView, + std::enable_if_t = 0 > +auto makeBulkFVGridGeometry(const GridManager& gridManager, + const BulkGridView& bulkGridView, + const LowDimGridView& lowDimGridView) { using BulkFacetGridAdapter = Dumux::CodimOneGridAdapter; BulkFacetGridAdapter facetGridAdapter(gridManager.getEmbeddings()); - gridGeometry.update(facetGridView, facetGridAdapter); + return std::make_shared(bulkGridView, lowDimGridView, facetGridAdapter); } /*! - * \brief Updates the finite volume grid geometry for the cell-centered schemes. + * \brief Constructs the finite volume grid geometry for the cell-centered schemes. */ -template< class GridGeometry, +template< class BulkGridGeometry, class GridManager, + class BulkGridView, class LowDimGridView, - std::enable_if_t = 0 > -void updateBulkFVGridGeometry(GridGeometry& gridGeometry, - const GridManager& gridManager, - const LowDimGridView& lowDimGridView) + std::enable_if_t = 0 > +auto makeBulkFVGridGeometry(const GridManager& gridManager, + const BulkGridView& bulkGridView, + const LowDimGridView& lowDimGridView) { - gridGeometry.update(); + return std::make_shared(bulkGridView); } } // end namespace Dumux @@ -116,10 +118,8 @@ int main(int argc, char** argv) // create the finite volume grid geometries using BulkFVGridGeometry = GetPropType; using FacetFVGridGeometry = GetPropType; - auto bulkFvGridGeometry = std::make_shared(bulkGridView); auto facetFvGridGeometry = std::make_shared(facetGridView); - updateBulkFVGridGeometry(*bulkFvGridGeometry, gridManager, facetGridView); - facetFvGridGeometry->update(); + auto bulkFvGridGeometry = makeBulkFVGridGeometry(gridManager, bulkGridView, facetGridView); // the coupling mapper using TestTraits = Properties::TestTraits; diff --git a/test/multidomain/facet/test_facetcouplingmapper.cc b/test/multidomain/facet/test_facetcouplingmapper.cc index 98b3a7e68e..464c747dfa 100644 --- a/test/multidomain/facet/test_facetcouplingmapper.cc +++ b/test/multidomain/facet/test_facetcouplingmapper.cc @@ -96,21 +96,36 @@ void checkScvfEmbedment(const Scvf& scvf, const LowDimGeom& lowDimGeom) DUNE_THROW(Dune::InvalidStateException, "Scvf does not coincide with low dim element"); } -//! Updates a tpfa finite volume grid geometry. -template< class BulkFVG, class FacetFVG, class GridManager, - std::enable_if_t = 0 > -void updateBulkFvGeometry(BulkFVG& bulkFVG, const FacetFVG& facetFVG, const GridManager& gm) +/*! + * \brief Constructs the finite volume grid geometry for the box scheme. + */ +template< class BulkGridGeometry, + class GridManager, + class BulkGridView, + class LowDimGridView, + std::enable_if_t = 0 > +auto makeBulkFVGridGeometry(const GridManager& gridManager, + const BulkGridView& bulkGridView, + const LowDimGridView& lowDimGridView) { - bulkFVG.update(); + using BulkFacetGridAdapter = Dumux::CodimOneGridAdapter; + BulkFacetGridAdapter facetGridAdapter(gridManager.getEmbeddings()); + return BulkGridGeometry(bulkGridView, lowDimGridView, facetGridAdapter, true); } -//! Updates a box finite volume grid geometry. -template< class BulkFVG, class FacetFVG, class GridManager, - std::enable_if_t = 0 > -void updateBulkFvGeometry(BulkFVG& bulkFVG, const FacetFVG& facetFVG, const GridManager& gm) +/*! + * \brief Constructs the finite volume grid geometry for the cell-centered schemes. + */ +template< class BulkGridGeometry, + class GridManager, + class BulkGridView, + class LowDimGridView, + std::enable_if_t = 0 > +auto makeBulkFVGridGeometry(const GridManager& gridManager, + const BulkGridView& bulkGridView, + const LowDimGridView& lowDimGridView) { - using FacetGridAdapter = Dumux::CodimOneGridAdapter; - bulkFVG.update(facetFVG.gridView(), FacetGridAdapter(gm.getEmbeddings()), true); + return BulkGridGeometry(bulkGridView); } // main program @@ -142,21 +157,18 @@ int main (int argc, char *argv[]) typename std::conditional::type >::type; - BulkFVGridGeometry bulkFvGeometry( gridManager.grid<0>().leafGridView() ); - using FacetGridView = typename FacetGrid::LeafGridView; using FacetFVGridGeometry = Dumux::CCTpfaFVGridGeometry; FacetFVGridGeometry facetFvGeometry( gridManager.grid<1>().leafGridView() ); - facetFvGeometry.update(); using EdgeGridView = typename EdgeGrid::LeafGridView; using EdgeFVGridGeometry = Dumux::CCTpfaFVGridGeometry; EdgeFVGridGeometry edgeFvGeometry( gridManager.grid<2>().leafGridView() ); - // update grid geometries - edgeFvGeometry.update(); - facetFvGeometry.update(); - updateBulkFvGeometry(bulkFvGeometry, facetFvGeometry, gridManager); + // construct bulk grid geometry + BulkFVGridGeometry bulkFvGeometry( makeBulkFVGridGeometry(gridManager, + gridManager.grid<0>().leafGridView(), + facetFvGeometry.gridView())); // instantiate and update mappers for all domain combinations Dumux::FacetCouplingMapper bulkFacetMapper; diff --git a/test/multidomain/facet/test_facetcouplingmapper_boundary.cc b/test/multidomain/facet/test_facetcouplingmapper_boundary.cc index d6faa41415..5d0bf9ac45 100644 --- a/test/multidomain/facet/test_facetcouplingmapper_boundary.cc +++ b/test/multidomain/facet/test_facetcouplingmapper_boundary.cc @@ -69,12 +69,10 @@ int main (int argc, char *argv[]) using BulkGridView = typename BulkGrid::LeafGridView; using BulkFVGridGeometry = Dumux::CCTpfaFVGridGeometry; BulkFVGridGeometry bulkFvGeometry( gridManager.grid<0>().leafGridView() ); - bulkFvGeometry.update(); using FacetGridView = typename FacetGrid::LeafGridView; using FacetFVGridGeometry = Dumux::CCTpfaFVGridGeometry; FacetFVGridGeometry facetFvGeometry( gridManager.grid<1>().leafGridView() ); - facetFvGeometry.update(); // instantiate and update mapper for all domain combinations Dumux::FacetCouplingMapper mapper; diff --git a/test/multidomain/facet/tracer_tracer/main.cc b/test/multidomain/facet/tracer_tracer/main.cc index 45f1fbb320..7051d059d9 100644 --- a/test/multidomain/facet/tracer_tracer/main.cc +++ b/test/multidomain/facet/tracer_tracer/main.cc @@ -52,38 +52,40 @@ namespace Dumux { /*! - * \brief Updates the finite volume grid geometry for the box scheme. + * \brief Constructs the finite volume grid geometry for the box scheme. * * This is necessary as the finite volume grid geometry for the box scheme with - * facet coupling requires additional data for the update. The reason is that we - * have to create additional faces on interior boundaries, which wouldn't be + * facet coupling requires additional data for the constructor. The reason is that + * we have to create additional faces on interior boundaries, which wouldn't be * created in the standard scheme. */ -template< class GridGeometry, +template< class BulkGridGeometry, class GridManager, + class BulkGridView, class LowDimGridView, - std::enable_if_t = 0 > -void updateBulkFVGridGeometry(GridGeometry& gridGeometry, - const GridManager& gridManager, - const LowDimGridView& lowDimGridView) + std::enable_if_t = 0 > +auto makeBulkFVGridGeometry(const GridManager& gridManager, + const BulkGridView& bulkGridView, + const LowDimGridView& lowDimGridView) { using BulkFacetGridAdapter = Dumux::CodimOneGridAdapter; BulkFacetGridAdapter facetGridAdapter(gridManager.getEmbeddings()); - gridGeometry.update(lowDimGridView, facetGridAdapter); + return std::make_shared(bulkGridView, lowDimGridView, facetGridAdapter); } /*! - * \brief Updates the finite volume grid geometry for the cell centered schemes. + * \brief Constructs the finite volume grid geometry for the cell-centered schemes. */ - template< class GridGeometry, +template< class BulkGridGeometry, class GridManager, + class BulkGridView, class LowDimGridView, - std::enable_if_t = 0 > -void updateBulkFVGridGeometry(GridGeometry& gridGeometry, - const GridManager& gridManager, - const LowDimGridView& lowDimGridView) + std::enable_if_t = 0 > +auto makeBulkFVGridGeometry(const GridManager& gridManager, + const BulkGridView& bulkGridView, + const LowDimGridView& lowDimGridView) { - gridGeometry.update(); + return std::make_shared(bulkGridView); } //! Computes the volume fluxes on all scvfs for a sub-domain. @@ -195,10 +197,8 @@ int main(int argc, char** argv) // create the finite volume grid geometries using BulkFVGridGeometry = GetPropType; using LowDimFVGridGeometry = GetPropType; - auto bulkFvGridGeometry = std::make_shared(bulkGridView); auto lowDimFvGridGeometry = std::make_shared(lowDimGridView); - updateBulkFVGridGeometry(*bulkFvGridGeometry, gridManager, lowDimGridView); - lowDimFvGridGeometry->update(); + auto bulkFvGridGeometry = makeBulkFVGridGeometry(gridManager, bulkGridView, lowDimGridView); // the coupling mapper using OnePTestTraits = Properties::TestTraits; diff --git a/test/multidomain/poromechanics/el1p/main.cc b/test/multidomain/poromechanics/el1p/main.cc index 66a688b4cd..0c8fd89651 100644 --- a/test/multidomain/poromechanics/el1p/main.cc +++ b/test/multidomain/poromechanics/el1p/main.cc @@ -81,8 +81,6 @@ int main(int argc, char** argv) using PoroMechFVGridGeometry = GetPropType; auto onePFvGridGeometry = std::make_shared(leafGridView); auto poroMechFvGridGeometry = std::make_shared(leafGridView); - onePFvGridGeometry->update(); - poroMechFvGridGeometry->update(); // the coupling manager using Traits = MultiDomainTraits; diff --git a/test/multidomain/poromechanics/el2p/main.cc b/test/multidomain/poromechanics/el2p/main.cc index 681330ffcd..d43c3f1c68 100644 --- a/test/multidomain/poromechanics/el2p/main.cc +++ b/test/multidomain/poromechanics/el2p/main.cc @@ -82,8 +82,6 @@ int main(int argc, char** argv) using PoroMechFVGridGeometry = GetPropType; auto twoPFvGridGeometry = std::make_shared(leafGridView); auto poroMechFvGridGeometry = std::make_shared(leafGridView); - twoPFvGridGeometry->update(); - poroMechFvGridGeometry->update(); // the coupling manager using Traits = MultiDomainTraits; diff --git a/test/porenetwork/1p/main.cc b/test/porenetwork/1p/main.cc index 060a706449..c0004b776b 100644 --- a/test/porenetwork/1p/main.cc +++ b/test/porenetwork/1p/main.cc @@ -76,8 +76,7 @@ int main(int argc, char** argv) // create the finite volume grid geometry using GridGeometry = GetPropType; - auto gridGeometry = std::make_shared(leafGridView); - gridGeometry->update(*gridData); + auto gridGeometry = std::make_shared(leafGridView, *gridData); // the spatial parameters using SpatialParams = GetPropType; diff --git a/test/porenetwork/1p/noncreepingflow/main.cc b/test/porenetwork/1p/noncreepingflow/main.cc index 1d273bed3c..72c47c04d4 100644 --- a/test/porenetwork/1p/noncreepingflow/main.cc +++ b/test/porenetwork/1p/noncreepingflow/main.cc @@ -74,8 +74,7 @@ int main(int argc, char** argv) // create the finite volume grid geometry using GridGeometry = GetPropType; - auto gridGeometry = std::make_shared(leafGridView); - gridGeometry->update(*gridData); + auto gridGeometry = std::make_shared(leafGridView, *gridData); // the spatial parameters using SpatialParams = GetPropType; diff --git a/test/porenetwork/1p/noncreepingflow/nonisothermal/main.cc b/test/porenetwork/1p/noncreepingflow/nonisothermal/main.cc index 5e8762f26c..b8b60a76fd 100644 --- a/test/porenetwork/1p/noncreepingflow/nonisothermal/main.cc +++ b/test/porenetwork/1p/noncreepingflow/nonisothermal/main.cc @@ -78,8 +78,7 @@ int main(int argc, char** argv) // create the finite volume grid geometry using GridGeometry = GetPropType; - auto gridGeometry = std::make_shared(leafGridView); - gridGeometry->update(*gridData); + auto gridGeometry = std::make_shared(leafGridView, *gridData); // the spatial parameters using SpatialParams = GetPropType; diff --git a/test/porenetwork/1p/nonisothermal/main.cc b/test/porenetwork/1p/nonisothermal/main.cc index f1aa8092b0..9069b7d032 100644 --- a/test/porenetwork/1p/nonisothermal/main.cc +++ b/test/porenetwork/1p/nonisothermal/main.cc @@ -77,8 +77,7 @@ int main(int argc, char** argv) // create the finite volume grid geometry using GridGeometry = GetPropType; - auto gridGeometry = std::make_shared(leafGridView); - gridGeometry->update(*gridData); + auto gridGeometry = std::make_shared(leafGridView, *gridData); // the spatial parameters using SpatialParams = GetPropType; diff --git a/test/porenetwork/1pnc/main.cc b/test/porenetwork/1pnc/main.cc index 93b077b034..1f8fb3dd68 100644 --- a/test/porenetwork/1pnc/main.cc +++ b/test/porenetwork/1pnc/main.cc @@ -76,8 +76,7 @@ int main(int argc, char** argv) // create the finite volume grid geometry using GridGeometry = GetPropType; - auto gridGeometry = std::make_shared(leafGridView); - gridGeometry->update(*gridData); + auto gridGeometry = std::make_shared(leafGridView, *gridData); // the spatial parameters using SpatialParams = GetPropType; diff --git a/test/porenetwork/2p/main.cc b/test/porenetwork/2p/main.cc index 18cc23e4e1..d01b7059b9 100644 --- a/test/porenetwork/2p/main.cc +++ b/test/porenetwork/2p/main.cc @@ -76,8 +76,7 @@ int main(int argc, char** argv) // create the finite volume grid geometry using GridGeometry = GetPropType; - auto gridGeometry = std::make_shared(leafGridView); - gridGeometry->update(*gridData); + auto gridGeometry = std::make_shared(leafGridView, *gridData); // the spatial parameters using SpatialParams = GetPropType; diff --git a/test/porenetwork/2p/static/main.cc b/test/porenetwork/2p/static/main.cc index 208d7c618f..5d906ba173 100644 --- a/test/porenetwork/2p/static/main.cc +++ b/test/porenetwork/2p/static/main.cc @@ -106,8 +106,7 @@ int main(int argc, char** argv) // create the finite volume grid geometry using GridGeometry = GetPropType; - auto gridGeometry = std::make_shared(leafGridView); - gridGeometry->update(*gridData); + auto gridGeometry = std::make_shared(leafGridView, *gridData); // get some network properties using Scalar = GetPropType; diff --git a/test/porousmediumflow/1p/compressible/instationary/main.cc b/test/porousmediumflow/1p/compressible/instationary/main.cc index d9b60a4b39..3ca1bf4761 100644 --- a/test/porousmediumflow/1p/compressible/instationary/main.cc +++ b/test/porousmediumflow/1p/compressible/instationary/main.cc @@ -84,7 +84,6 @@ int main(int argc, char** argv) // create the finite volume grid geometry using GridGeometry = GetPropType; auto gridGeometry = std::make_shared(leafGridView); - gridGeometry->update(); // the problem (initial and boundary conditions) using Problem = GetPropType; diff --git a/test/porousmediumflow/1p/compressible/instationary/main_experimental.cc b/test/porousmediumflow/1p/compressible/instationary/main_experimental.cc index 06f71a35b3..14c403ded6 100644 --- a/test/porousmediumflow/1p/compressible/instationary/main_experimental.cc +++ b/test/porousmediumflow/1p/compressible/instationary/main_experimental.cc @@ -84,7 +84,6 @@ int main(int argc, char** argv) // create the finite volume grid geometry using GridGeometry = GetPropType; auto gridGeometry = std::make_shared(leafGridView); - gridGeometry->update(); // the problem (initial and boundary conditions) using Problem = GetPropType; diff --git a/test/porousmediumflow/1p/compressible/stationary/main.cc b/test/porousmediumflow/1p/compressible/stationary/main.cc index 947fa53ad3..9141d23374 100644 --- a/test/porousmediumflow/1p/compressible/stationary/main.cc +++ b/test/porousmediumflow/1p/compressible/stationary/main.cc @@ -83,7 +83,6 @@ int main(int argc, char** argv) // create the finite volume grid geometry using GridGeometry = GetPropType; auto gridGeometry = std::make_shared(leafGridView); - gridGeometry->update(); // the problem (initial and boundary conditions) using Problem = GetPropType; diff --git a/test/porousmediumflow/1p/convergence/analyticsolution/main.cc b/test/porousmediumflow/1p/convergence/analyticsolution/main.cc index 2c15f35aae..d5a5f0e705 100644 --- a/test/porousmediumflow/1p/convergence/analyticsolution/main.cc +++ b/test/porousmediumflow/1p/convergence/analyticsolution/main.cc @@ -112,7 +112,6 @@ int main(int argc, char** argv) // create the finite volume grid geometry using GridGeometry = GetPropType; auto gridGeometry = std::make_shared(leafGridView); - gridGeometry->update(); // the problem (boundary conditions) using Problem = GetPropType; diff --git a/test/porousmediumflow/1p/convergence/discretesolution/solver.hh b/test/porousmediumflow/1p/convergence/discretesolution/solver.hh index 51ce8280a2..066f9ba365 100644 --- a/test/porousmediumflow/1p/convergence/discretesolution/solver.hh +++ b/test/porousmediumflow/1p/convergence/discretesolution/solver.hh @@ -89,7 +89,6 @@ SolutionStorage solveRefinementLevel(int numCells) // create the finite volume grid geometry using GridGeometry = GetPropType; auto gridGeometry = std::make_shared(leafGridView); - gridGeometry->update(); // the problem (boundary conditions) using Problem = GetPropType; diff --git a/test/porousmediumflow/1p/fracture2d3d/main.cc b/test/porousmediumflow/1p/fracture2d3d/main.cc index afed760585..93a52887ef 100644 --- a/test/porousmediumflow/1p/fracture2d3d/main.cc +++ b/test/porousmediumflow/1p/fracture2d3d/main.cc @@ -106,7 +106,6 @@ int main(int argc, char** argv) // create the finite volume grid geometry using GridGeometry = GetPropType; auto gridGeometry = std::make_shared(leafGridView); - gridGeometry->update(); // the problem (initial and boundary conditions) using Problem = GetPropType; diff --git a/test/porousmediumflow/1p/incompressible/main.cc b/test/porousmediumflow/1p/incompressible/main.cc index f0d7a5e666..0ce2c66ad1 100644 --- a/test/porousmediumflow/1p/incompressible/main.cc +++ b/test/porousmediumflow/1p/incompressible/main.cc @@ -112,7 +112,6 @@ int main(int argc, char** argv) // create the finite volume grid geometry using GridGeometry = GetPropType; auto gridGeometry = std::make_shared(leafGridView); - gridGeometry->update(); // the problem (boundary conditions) using Problem = GetPropType; diff --git a/test/porousmediumflow/1p/isothermal/main.cc b/test/porousmediumflow/1p/isothermal/main.cc index 70f8f1c5e6..f432f51268 100644 --- a/test/porousmediumflow/1p/isothermal/main.cc +++ b/test/porousmediumflow/1p/isothermal/main.cc @@ -112,7 +112,6 @@ int main(int argc, char** argv) // create the finite volume grid geometry using GridGeometry = GetPropType; auto gridGeometry = std::make_shared(leafGridView); - gridGeometry->update(); // the problem (initial and boundary conditions) using Problem = GetPropType; diff --git a/test/porousmediumflow/1p/network1d3d/main.cc b/test/porousmediumflow/1p/network1d3d/main.cc index f0f9d5a25c..efa270bfc3 100644 --- a/test/porousmediumflow/1p/network1d3d/main.cc +++ b/test/porousmediumflow/1p/network1d3d/main.cc @@ -106,7 +106,6 @@ int main(int argc, char** argv) // create the finite volume grid geometry using GridGeometry = GetPropType; auto gridGeometry = std::make_shared(leafGridView); - gridGeometry->update(); // the problem (initial and boundary conditions) using Problem = GetPropType; diff --git a/test/porousmediumflow/1p/nonisothermal/main.cc b/test/porousmediumflow/1p/nonisothermal/main.cc index a60a35b3ac..74b658e8b8 100644 --- a/test/porousmediumflow/1p/nonisothermal/main.cc +++ b/test/porousmediumflow/1p/nonisothermal/main.cc @@ -109,7 +109,6 @@ int main(int argc, char** argv) // create the finite volume grid geometry using GridGeometry = GetPropType; auto gridGeometry = std::make_shared(leafGridView); - gridGeometry->update(); // the problem (initial and boundary conditions) using Problem = GetPropType; diff --git a/test/porousmediumflow/1p/periodicbc/main.cc b/test/porousmediumflow/1p/periodicbc/main.cc index 5eff6fc9bf..cad884638e 100644 --- a/test/porousmediumflow/1p/periodicbc/main.cc +++ b/test/porousmediumflow/1p/periodicbc/main.cc @@ -78,7 +78,6 @@ int main(int argc, char** argv) // create the finite volume grid geometry (and make it periodic) using GridGeometry = GetPropType; auto gridGeometry = std::make_shared(leafGridView); - gridGeometry->update(); bool periodic = gridGeometry->isPeriodic(); periodic = gridGeometry->gridView().comm().max(periodic); diff --git a/test/porousmediumflow/1p/pointsources/timedependent/main.cc b/test/porousmediumflow/1p/pointsources/timedependent/main.cc index 3426e6fb00..f270524999 100644 --- a/test/porousmediumflow/1p/pointsources/timedependent/main.cc +++ b/test/porousmediumflow/1p/pointsources/timedependent/main.cc @@ -81,7 +81,6 @@ int main(int argc, char** argv) // create the finite volume grid geometry using GridGeometry = GetPropType; auto gridGeometry = std::make_shared(leafGridView); - gridGeometry->update(); // the problem (initial and boundary conditions) using Problem = GetPropType; diff --git a/test/porousmediumflow/1p/pointsources/timeindependent/main.cc b/test/porousmediumflow/1p/pointsources/timeindependent/main.cc index 6f4e0b8aca..a9c7a570c4 100644 --- a/test/porousmediumflow/1p/pointsources/timeindependent/main.cc +++ b/test/porousmediumflow/1p/pointsources/timeindependent/main.cc @@ -81,7 +81,6 @@ int main(int argc, char** argv) // create the finite volume grid geometry using GridGeometry = GetPropType; auto gridGeometry = std::make_shared(leafGridView); - gridGeometry->update(); // the problem (initial and boundary conditions) using Problem = GetPropType; diff --git a/test/porousmediumflow/1p/rootbenchmark/main.cc b/test/porousmediumflow/1p/rootbenchmark/main.cc index 8ac8a5dd02..5a7b7c7d75 100644 --- a/test/porousmediumflow/1p/rootbenchmark/main.cc +++ b/test/porousmediumflow/1p/rootbenchmark/main.cc @@ -66,7 +66,6 @@ int main(int argc, char** argv) // create the finite volume grid geometry using GridGeometry = GetPropType; auto gridGeometry = std::make_shared(leafGridView); - gridGeometry->update(); // the problem (initial and boundary conditions) using Problem = GetPropType; diff --git a/test/porousmediumflow/1pnc/1p2c/isothermal/main.cc b/test/porousmediumflow/1pnc/1p2c/isothermal/main.cc index d0d2e2eacc..34223ee0bd 100644 --- a/test/porousmediumflow/1pnc/1p2c/isothermal/main.cc +++ b/test/porousmediumflow/1pnc/1p2c/isothermal/main.cc @@ -85,7 +85,6 @@ int main(int argc, char** argv) // create the finite volume grid geometry using GridGeometry = GetPropType; auto gridGeometry = std::make_shared(leafGridView); - gridGeometry->update(); // the problem (initial and boundary conditions) using Problem = GetPropType; diff --git a/test/porousmediumflow/1pnc/1p2c/isothermal/saltwaterintrusion/main.cc b/test/porousmediumflow/1pnc/1p2c/isothermal/saltwaterintrusion/main.cc index 129236b0fc..f6af56eb1f 100644 --- a/test/porousmediumflow/1pnc/1p2c/isothermal/saltwaterintrusion/main.cc +++ b/test/porousmediumflow/1pnc/1p2c/isothermal/saltwaterintrusion/main.cc @@ -80,7 +80,6 @@ int main(int argc, char** argv) // create the finite volume grid geometry using GridGeometry = GetPropType; auto gridGeometry = std::make_shared(leafGridView); - gridGeometry->update(); // the problem (initial and boundary conditions) using Problem = GetPropType; diff --git a/test/porousmediumflow/1pnc/1p2c/nonisothermal/conduction/main.cc b/test/porousmediumflow/1pnc/1p2c/nonisothermal/conduction/main.cc index 80b4ee6a8a..fba087eefb 100644 --- a/test/porousmediumflow/1pnc/1p2c/nonisothermal/conduction/main.cc +++ b/test/porousmediumflow/1pnc/1p2c/nonisothermal/conduction/main.cc @@ -85,7 +85,6 @@ int main(int argc, char** argv) // create the finite volume grid geometry using GridGeometry = GetPropType; auto gridGeometry = std::make_shared(leafGridView); - gridGeometry->update(); // the problem (initial and boundary conditions) using Problem = GetPropType; diff --git a/test/porousmediumflow/1pnc/1p2c/nonisothermal/convection/main.cc b/test/porousmediumflow/1pnc/1p2c/nonisothermal/convection/main.cc index 7bccd573ab..763261a947 100644 --- a/test/porousmediumflow/1pnc/1p2c/nonisothermal/convection/main.cc +++ b/test/porousmediumflow/1pnc/1p2c/nonisothermal/convection/main.cc @@ -85,7 +85,6 @@ int main(int argc, char** argv) // create the finite volume grid geometry using GridGeometry = GetPropType; auto gridGeometry = std::make_shared(leafGridView); - gridGeometry->update(); // the problem (initial and boundary conditions) using Problem = GetPropType; diff --git a/test/porousmediumflow/1pnc/1p2c/nonisothermal/transientbc/main.cc b/test/porousmediumflow/1pnc/1p2c/nonisothermal/transientbc/main.cc index c0f3ffd833..ee07edeb2d 100644 --- a/test/porousmediumflow/1pnc/1p2c/nonisothermal/transientbc/main.cc +++ b/test/porousmediumflow/1pnc/1p2c/nonisothermal/transientbc/main.cc @@ -85,7 +85,6 @@ int main(int argc, char** argv) // create the finite volume grid geometry using GridGeometry = GetPropType; auto gridGeometry = std::make_shared(leafGridView); - gridGeometry->update(); // the problem (initial and boundary conditions) using Problem = GetPropType; diff --git a/test/porousmediumflow/1pnc/1p3c/main.cc b/test/porousmediumflow/1pnc/1p3c/main.cc index cceb35b987..96bb10e487 100644 --- a/test/porousmediumflow/1pnc/1p3c/main.cc +++ b/test/porousmediumflow/1pnc/1p3c/main.cc @@ -86,7 +86,6 @@ int main(int argc, char** argv) // create the finite volume grid geometry using GridGeometry = GetPropType; auto gridGeometry = std::make_shared(leafGridView); - gridGeometry->update(); // the problem (initial and boundary conditions) using Problem = GetPropType; diff --git a/test/porousmediumflow/1pnc/nonequilibrium/main.cc b/test/porousmediumflow/1pnc/nonequilibrium/main.cc index 446b517528..293d4329ce 100644 --- a/test/porousmediumflow/1pnc/nonequilibrium/main.cc +++ b/test/porousmediumflow/1pnc/nonequilibrium/main.cc @@ -85,7 +85,6 @@ int main(int argc, char** argv) // create the finite volume grid geometry using GridGeometry = GetPropType; auto gridGeometry = std::make_shared(leafGridView); - gridGeometry->update(); // the problem (initial and boundary conditions) using Problem = GetPropType; diff --git a/test/porousmediumflow/1pncmin/nonisothermal/main.cc b/test/porousmediumflow/1pncmin/nonisothermal/main.cc index 4ebab6144b..d68144baac 100644 --- a/test/porousmediumflow/1pncmin/nonisothermal/main.cc +++ b/test/porousmediumflow/1pncmin/nonisothermal/main.cc @@ -112,7 +112,6 @@ int main(int argc, char** argv) // create the finite volume grid geometry using GridGeometry = GetPropType; auto gridGeometry = std::make_shared(leafGridView); - gridGeometry->update(); // the problem (initial and boundary conditions) using Problem = GetPropType; diff --git a/test/porousmediumflow/2p/adaptive/main.cc b/test/porousmediumflow/2p/adaptive/main.cc index ff4cc3a4ee..e207f80eda 100644 --- a/test/porousmediumflow/2p/adaptive/main.cc +++ b/test/porousmediumflow/2p/adaptive/main.cc @@ -92,7 +92,6 @@ int main(int argc, char** argv) // create the finite volume grid geometry using GridGeometry = GetPropType; auto gridGeometry = std::make_shared(leafGridView); - gridGeometry->update(); // the problem (initial and boundary conditions) using Problem = GetPropType; diff --git a/test/porousmediumflow/2p/boxdfm/main.cc b/test/porousmediumflow/2p/boxdfm/main.cc index 74670c52a0..2e1d923b3e 100644 --- a/test/porousmediumflow/2p/boxdfm/main.cc +++ b/test/porousmediumflow/2p/boxdfm/main.cc @@ -85,8 +85,7 @@ int main(int argc, char** argv) // create the finite volume grid geometry using GridGeometry = GetPropType; - auto gridGeometry = std::make_shared(leafGridView); - gridGeometry->update(fractureGridAdapter); + auto gridGeometry = std::make_shared(leafGridView, fractureGridAdapter); // the problem (initial and boundary conditions) using Problem = GetPropType; diff --git a/test/porousmediumflow/2p/cornerpoint/main.cc b/test/porousmediumflow/2p/cornerpoint/main.cc index 53f526a8b4..c9489e2ea6 100644 --- a/test/porousmediumflow/2p/cornerpoint/main.cc +++ b/test/porousmediumflow/2p/cornerpoint/main.cc @@ -81,7 +81,6 @@ int main(int argc, char** argv) // create the finite volume grid geometry using GridGeometry = GetPropType; auto gridGeometry = std::make_shared(leafGridView); - gridGeometry->update(); // the problem (initial and boundary conditions) using Problem = GetPropType; diff --git a/test/porousmediumflow/2p/fracture/main.cc b/test/porousmediumflow/2p/fracture/main.cc index b2a06cbb52..7f4cc22c75 100644 --- a/test/porousmediumflow/2p/fracture/main.cc +++ b/test/porousmediumflow/2p/fracture/main.cc @@ -78,7 +78,6 @@ int main(int argc, char** argv) // create the finite volume grid geometry using GridGeometry = GetPropType; auto gridGeometry = std::make_shared(leafGridView); - gridGeometry->update(); // the problem (initial and boundary conditions) using Problem = GetPropType; diff --git a/test/porousmediumflow/2p/incompressible/main.cc b/test/porousmediumflow/2p/incompressible/main.cc index 19e46cf60a..95157002b2 100644 --- a/test/porousmediumflow/2p/incompressible/main.cc +++ b/test/porousmediumflow/2p/incompressible/main.cc @@ -80,7 +80,6 @@ int main(int argc, char** argv) // create the finite volume grid geometry using GridGeometry = GetPropType; auto gridGeometry = std::make_shared(leafGridView); - gridGeometry->update(); // the problem (initial and boundary conditions) using Problem = GetPropType; diff --git a/test/porousmediumflow/2p/nonisothermal/main.cc b/test/porousmediumflow/2p/nonisothermal/main.cc index 16f49b8bb5..a39f81784e 100644 --- a/test/porousmediumflow/2p/nonisothermal/main.cc +++ b/test/porousmediumflow/2p/nonisothermal/main.cc @@ -76,7 +76,6 @@ int main(int argc, char** argv) // create the finite volume grid geometry using GridGeometry = GetPropType; auto gridGeometry = std::make_shared(leafGridView); - gridGeometry->update(); // the problem (initial and boundary conditions) using Problem = GetPropType; diff --git a/test/porousmediumflow/2p/rotationsymmetry/main.cc b/test/porousmediumflow/2p/rotationsymmetry/main.cc index 9b56ad1e0d..23ba36e42e 100644 --- a/test/porousmediumflow/2p/rotationsymmetry/main.cc +++ b/test/porousmediumflow/2p/rotationsymmetry/main.cc @@ -58,7 +58,6 @@ int main(int argc, char** argv) // create the grid geometry using GridGeometry = GetPropType; auto gridGeometry = std::make_shared(leafGridView); - gridGeometry->update(); // the problem (initial and boundary conditions) using Problem = GetPropType; diff --git a/test/porousmediumflow/2p1c/main.cc b/test/porousmediumflow/2p1c/main.cc index 04fc295fd9..885a6bc267 100644 --- a/test/porousmediumflow/2p1c/main.cc +++ b/test/porousmediumflow/2p1c/main.cc @@ -80,7 +80,6 @@ int main(int argc, char** argv) // create the finite volume grid geometry using GridGeometry = GetPropType; auto gridGeometry = std::make_shared(leafGridView); - gridGeometry->update(); // the problem (initial and boundary conditions) using Problem = GetPropType; diff --git a/test/porousmediumflow/2p2c/chemicalnonequilibrium/main.cc b/test/porousmediumflow/2p2c/chemicalnonequilibrium/main.cc index 6f772d097f..d85d1f19c4 100644 --- a/test/porousmediumflow/2p2c/chemicalnonequilibrium/main.cc +++ b/test/porousmediumflow/2p2c/chemicalnonequilibrium/main.cc @@ -77,7 +77,6 @@ int main(int argc, char** argv) // create the finite volume grid geometry using GridGeometry = GetPropType; auto gridGeometry = std::make_shared(leafGridView); - gridGeometry->update(); // the problem (initial and boundary conditions) using Problem = GetPropType; diff --git a/test/porousmediumflow/2p2c/injection/main.cc b/test/porousmediumflow/2p2c/injection/main.cc index 61e21d6621..8ba188a6a9 100644 --- a/test/porousmediumflow/2p2c/injection/main.cc +++ b/test/porousmediumflow/2p2c/injection/main.cc @@ -75,7 +75,6 @@ int main(int argc, char** argv) // create the finite volume grid geometry using GridGeometry = GetPropType; auto gridGeometry = std::make_shared(leafGridView); - gridGeometry->update(); // the problem (initial and boundary conditions) using Problem = GetPropType; diff --git a/test/porousmediumflow/2p2c/mpnccomparison/main.cc b/test/porousmediumflow/2p2c/mpnccomparison/main.cc index 46823d8414..d04a955bf7 100644 --- a/test/porousmediumflow/2p2c/mpnccomparison/main.cc +++ b/test/porousmediumflow/2p2c/mpnccomparison/main.cc @@ -77,7 +77,6 @@ int main(int argc, char** argv) // create the finite volume grid geometry using GridGeometry = GetPropType; auto gridGeometry = std::make_shared(leafGridView); - gridGeometry->update(); // the problem (initial and boundary conditions) using Problem = GetPropType; diff --git a/test/porousmediumflow/2p2c/waterair/main.cc b/test/porousmediumflow/2p2c/waterair/main.cc index dc65e4f6f7..6faa549539 100644 --- a/test/porousmediumflow/2p2c/waterair/main.cc +++ b/test/porousmediumflow/2p2c/waterair/main.cc @@ -70,7 +70,6 @@ int main(int argc, char** argv) // create the finite volume grid geometry using GridGeometry = GetPropType; auto gridGeometry = std::make_shared(leafGridView); - gridGeometry->update(); //////////////////////////////////////////////////////////// // run instationary non-linear problem on this grid diff --git a/test/porousmediumflow/2pnc/diffusion/main.cc b/test/porousmediumflow/2pnc/diffusion/main.cc index c5b5181def..ec3f1cfff3 100644 --- a/test/porousmediumflow/2pnc/diffusion/main.cc +++ b/test/porousmediumflow/2pnc/diffusion/main.cc @@ -74,7 +74,6 @@ int main(int argc, char** argv) // create the finite volume grid geometry using GridGeometry = GetPropType; auto gridGeometry = std::make_shared(leafGridView); - gridGeometry->update(); // the problem (initial and boundary conditions) using Problem = GetPropType; diff --git a/test/porousmediumflow/2pnc/fuelcell/main.cc b/test/porousmediumflow/2pnc/fuelcell/main.cc index 72dbd873dc..1f4ebd28d5 100644 --- a/test/porousmediumflow/2pnc/fuelcell/main.cc +++ b/test/porousmediumflow/2pnc/fuelcell/main.cc @@ -74,7 +74,6 @@ int main(int argc, char** argv) // create the finite volume grid geometry using GridGeometry = GetPropType; auto gridGeometry = std::make_shared(leafGridView); - gridGeometry->update(); // the problem (initial and boundary conditions) using Problem = GetPropType; diff --git a/test/porousmediumflow/2pncmin/isothermal/main.cc b/test/porousmediumflow/2pncmin/isothermal/main.cc index c616678107..3909bf55d8 100644 --- a/test/porousmediumflow/2pncmin/isothermal/main.cc +++ b/test/porousmediumflow/2pncmin/isothermal/main.cc @@ -75,7 +75,6 @@ int main(int argc, char** argv) // create the finite volume grid geometry using GridGeometry = GetPropType; auto gridGeometry = std::make_shared(leafGridView); - gridGeometry->update(); // the problem (initial and boundary conditions) using Problem = GetPropType; diff --git a/test/porousmediumflow/2pncmin/nonisothermal/main.cc b/test/porousmediumflow/2pncmin/nonisothermal/main.cc index a34c7ff000..5f23efa88c 100644 --- a/test/porousmediumflow/2pncmin/nonisothermal/main.cc +++ b/test/porousmediumflow/2pncmin/nonisothermal/main.cc @@ -75,7 +75,6 @@ int main(int argc, char** argv) // create the finite volume grid geometry using GridGeometry = GetPropType; auto gridGeometry = std::make_shared(leafGridView); - gridGeometry->update(); // the problem (initial and boundary conditions) using Problem = GetPropType; diff --git a/test/porousmediumflow/3p/conduction/main.cc b/test/porousmediumflow/3p/conduction/main.cc index 5947a520a5..e717f6cc81 100644 --- a/test/porousmediumflow/3p/conduction/main.cc +++ b/test/porousmediumflow/3p/conduction/main.cc @@ -77,7 +77,6 @@ int main(int argc, char** argv) // create the finite volume grid geometry using GridGeometry = GetPropType; auto gridGeometry = std::make_shared(leafGridView); - gridGeometry->update(); // the problem (initial and boundary conditions) using Problem = GetPropType; diff --git a/test/porousmediumflow/3p/convection/main.cc b/test/porousmediumflow/3p/convection/main.cc index bf5a3d2b62..fe31fa06b9 100644 --- a/test/porousmediumflow/3p/convection/main.cc +++ b/test/porousmediumflow/3p/convection/main.cc @@ -76,7 +76,6 @@ int main(int argc, char** argv) // create the finite volume grid geometry using GridGeometry = GetPropType; auto gridGeometry = std::make_shared(leafGridView); - gridGeometry->update(); // the problem (initial and boundary conditions) using Problem = GetPropType; diff --git a/test/porousmediumflow/3p/infiltration/main.cc b/test/porousmediumflow/3p/infiltration/main.cc index cd5072b299..65023af8e1 100644 --- a/test/porousmediumflow/3p/infiltration/main.cc +++ b/test/porousmediumflow/3p/infiltration/main.cc @@ -110,7 +110,6 @@ int main(int argc, char** argv) // create the finite volume grid geometry using GridGeometry = GetPropType; auto gridGeometry = std::make_shared(leafGridView); - gridGeometry->update(); // the problem (initial and boundary conditions) using Problem = GetPropType; diff --git a/test/porousmediumflow/3p3c/columnxylol/main.cc b/test/porousmediumflow/3p3c/columnxylol/main.cc index bebc4a11a3..eaebb40520 100644 --- a/test/porousmediumflow/3p3c/columnxylol/main.cc +++ b/test/porousmediumflow/3p3c/columnxylol/main.cc @@ -77,7 +77,6 @@ int main(int argc, char** argv) // create the finite volume grid geometry using GridGeometry = GetPropType; auto gridGeometry = std::make_shared(leafGridView); - gridGeometry->update(); // the problem (initial and boundary conditions) using Problem = GetPropType; diff --git a/test/porousmediumflow/3p3c/infiltration/main.cc b/test/porousmediumflow/3p3c/infiltration/main.cc index 6fd11e24ef..6580f1b414 100644 --- a/test/porousmediumflow/3p3c/infiltration/main.cc +++ b/test/porousmediumflow/3p3c/infiltration/main.cc @@ -79,7 +79,6 @@ int main(int argc, char** argv) // create the finite volume grid geometry using GridGeometry = GetPropType; auto gridGeometry = std::make_shared(leafGridView); - gridGeometry->update(); // the problem (initial and boundary conditions) using Problem = GetPropType; diff --git a/test/porousmediumflow/3p3c/kuevette/main.cc b/test/porousmediumflow/3p3c/kuevette/main.cc index 9ca8b8fc6f..18e7d5ea49 100644 --- a/test/porousmediumflow/3p3c/kuevette/main.cc +++ b/test/porousmediumflow/3p3c/kuevette/main.cc @@ -78,7 +78,6 @@ int main(int argc, char** argv) // create the finite volume grid geometry using GridGeometry = GetPropType; auto gridGeometry = std::make_shared(leafGridView); - gridGeometry->update(); // the problem (initial and boundary conditions) using Problem = GetPropType; diff --git a/test/porousmediumflow/3pwateroil/main.cc b/test/porousmediumflow/3pwateroil/main.cc index 8e59b9b3a4..19809cef28 100644 --- a/test/porousmediumflow/3pwateroil/main.cc +++ b/test/porousmediumflow/3pwateroil/main.cc @@ -79,7 +79,6 @@ int main(int argc, char** argv) // create the finite volume grid geometry using GridGeometry = GetPropType; auto gridGeometry = std::make_shared(leafGridView); - gridGeometry->update(); // the problem (initial and boundary conditions) using Problem = GetPropType; diff --git a/test/porousmediumflow/co2/main.cc b/test/porousmediumflow/co2/main.cc index 7f46a0fbff..a00e5ab330 100644 --- a/test/porousmediumflow/co2/main.cc +++ b/test/porousmediumflow/co2/main.cc @@ -74,7 +74,6 @@ int main(int argc, char** argv) // create the finite volume grid geometry using GridGeometry = GetPropType; auto gridGeometry = std::make_shared(leafGridView); - gridGeometry->update(); // the spatial parameters using SpatialParams = GetPropType; diff --git a/test/porousmediumflow/mpnc/2p2ccomparison/main.cc b/test/porousmediumflow/mpnc/2p2ccomparison/main.cc index 7e79c23275..1795427149 100644 --- a/test/porousmediumflow/mpnc/2p2ccomparison/main.cc +++ b/test/porousmediumflow/mpnc/2p2ccomparison/main.cc @@ -77,7 +77,6 @@ int main(int argc, char** argv) // create the finite volume grid geometry using GridGeometry = GetPropType; auto gridGeometry = std::make_shared(leafGridView); - gridGeometry->update(); // the problem (initial and boundary conditions) using Problem = GetPropType; diff --git a/test/porousmediumflow/mpnc/kinetic/main.cc b/test/porousmediumflow/mpnc/kinetic/main.cc index 37f9febf02..b65bc1c5de 100644 --- a/test/porousmediumflow/mpnc/kinetic/main.cc +++ b/test/porousmediumflow/mpnc/kinetic/main.cc @@ -81,7 +81,6 @@ int main(int argc, char** argv) // create the finite volume grid geometry using GridGeometry = GetPropType; auto gridGeometry = std::make_shared(leafGridView); - gridGeometry->update(); // the problem (initial and boundary conditions) using Problem = GetPropType; diff --git a/test/porousmediumflow/mpnc/obstacle/main.cc b/test/porousmediumflow/mpnc/obstacle/main.cc index 7e79c23275..1795427149 100644 --- a/test/porousmediumflow/mpnc/obstacle/main.cc +++ b/test/porousmediumflow/mpnc/obstacle/main.cc @@ -77,7 +77,6 @@ int main(int argc, char** argv) // create the finite volume grid geometry using GridGeometry = GetPropType; auto gridGeometry = std::make_shared(leafGridView); - gridGeometry->update(); // the problem (initial and boundary conditions) using Problem = GetPropType; diff --git a/test/porousmediumflow/mpnc/thermalnonequilibrium/main.cc b/test/porousmediumflow/mpnc/thermalnonequilibrium/main.cc index 11b3036c8a..9e5f167218 100644 --- a/test/porousmediumflow/mpnc/thermalnonequilibrium/main.cc +++ b/test/porousmediumflow/mpnc/thermalnonequilibrium/main.cc @@ -81,7 +81,6 @@ int main(int argc, char** argv) // create the finite volume grid geometry using GridGeometry = GetPropType; auto gridGeometry = std::make_shared(leafGridView); - gridGeometry->update(); // the problem (initial and boundary conditions) using Problem = GetPropType; diff --git a/test/porousmediumflow/richards/analytical/main.cc b/test/porousmediumflow/richards/analytical/main.cc index 7a0cf3e5fe..a8174f4daf 100644 --- a/test/porousmediumflow/richards/analytical/main.cc +++ b/test/porousmediumflow/richards/analytical/main.cc @@ -77,7 +77,6 @@ int main(int argc, char** argv) // create the finite volume grid geometry using GridGeometry = GetPropType; auto gridGeometry = std::make_shared(leafGridView); - gridGeometry->update(); // the problem (initial and boundary conditions) using Problem = GetPropType; diff --git a/test/porousmediumflow/richards/benchmarks/main.cc b/test/porousmediumflow/richards/benchmarks/main.cc index aeb226cd0d..0cfd475e87 100644 --- a/test/porousmediumflow/richards/benchmarks/main.cc +++ b/test/porousmediumflow/richards/benchmarks/main.cc @@ -74,7 +74,6 @@ int main(int argc, char** argv) using GridGeometry = GetPropType; auto gridGeometry = std::make_shared(leafGridView); - gridGeometry->update(); // the problem (initial and boundary conditions) using Problem = GetPropType; diff --git a/test/porousmediumflow/richards/lens/main.cc b/test/porousmediumflow/richards/lens/main.cc index 43dcc8e09f..0c0f3aafd7 100644 --- a/test/porousmediumflow/richards/lens/main.cc +++ b/test/porousmediumflow/richards/lens/main.cc @@ -92,7 +92,6 @@ int main(int argc, char** argv) // create the finite volume grid geometry using GridGeometry = GetPropType; auto gridGeometry = std::make_shared(leafGridView); - gridGeometry->update(); // the problem (initial and boundary conditions) using Problem = GetPropType; diff --git a/test/porousmediumflow/richards/nonisothermal/conduction/main.cc b/test/porousmediumflow/richards/nonisothermal/conduction/main.cc index 12489bae7b..49c9927efa 100644 --- a/test/porousmediumflow/richards/nonisothermal/conduction/main.cc +++ b/test/porousmediumflow/richards/nonisothermal/conduction/main.cc @@ -77,7 +77,6 @@ int main(int argc, char** argv) // create the finite volume grid geometry using GridGeometry = GetPropType; auto gridGeometry = std::make_shared(leafGridView); - gridGeometry->update(); // the problem (initial and boundary conditions) using Problem = GetPropType; diff --git a/test/porousmediumflow/richards/nonisothermal/convection/main.cc b/test/porousmediumflow/richards/nonisothermal/convection/main.cc index 12489bae7b..49c9927efa 100644 --- a/test/porousmediumflow/richards/nonisothermal/convection/main.cc +++ b/test/porousmediumflow/richards/nonisothermal/convection/main.cc @@ -77,7 +77,6 @@ int main(int argc, char** argv) // create the finite volume grid geometry using GridGeometry = GetPropType; auto gridGeometry = std::make_shared(leafGridView); - gridGeometry->update(); // the problem (initial and boundary conditions) using Problem = GetPropType; diff --git a/test/porousmediumflow/richards/nonisothermal/evaporation/main.cc b/test/porousmediumflow/richards/nonisothermal/evaporation/main.cc index 6c936ecd2b..3af49f0a63 100644 --- a/test/porousmediumflow/richards/nonisothermal/evaporation/main.cc +++ b/test/porousmediumflow/richards/nonisothermal/evaporation/main.cc @@ -80,7 +80,6 @@ int main(int argc, char** argv) // create the finite volume grid geometry using GridGeometry = GetPropType; auto gridGeometry = std::make_shared(leafGridView); - gridGeometry->update(); // the problem (initial and boundary conditions) using Problem = GetPropType; diff --git a/test/porousmediumflow/richardsnc/main.cc b/test/porousmediumflow/richardsnc/main.cc index 1dd7d5d799..2610981aff 100644 --- a/test/porousmediumflow/richardsnc/main.cc +++ b/test/porousmediumflow/richardsnc/main.cc @@ -77,7 +77,6 @@ int main(int argc, char** argv) // create the finite volume grid geometry using GridGeometry = GetPropType; auto gridGeometry = std::make_shared(leafGridView); - gridGeometry->update(); // the problem (initial and boundary conditions) using Problem = GetPropType; diff --git a/test/porousmediumflow/solidenergy/main.cc b/test/porousmediumflow/solidenergy/main.cc index 7d9365d05c..f809e8e70a 100644 --- a/test/porousmediumflow/solidenergy/main.cc +++ b/test/porousmediumflow/solidenergy/main.cc @@ -75,7 +75,6 @@ int main(int argc, char** argv) // create the finite volume grid geometry using GridGeometry = GetPropType; auto gridGeometry = std::make_shared(leafGridView); - gridGeometry->update(); // the problem (initial and boundary conditions) using Problem = GetPropType; diff --git a/test/porousmediumflow/tracer/2ptracer/main.cc b/test/porousmediumflow/tracer/2ptracer/main.cc index 0c46226265..f39d6851c7 100644 --- a/test/porousmediumflow/tracer/2ptracer/main.cc +++ b/test/porousmediumflow/tracer/2ptracer/main.cc @@ -93,7 +93,6 @@ int main(int argc, char** argv) // create the finite volume grid geometry using GridGeometry = GetPropType; auto gridGeometry = std::make_shared(leafGridView); - gridGeometry->update(); // the problem (initial and boundary conditions) using TwoPProblem = GetPropType; diff --git a/test/porousmediumflow/tracer/constvel/main.cc b/test/porousmediumflow/tracer/constvel/main.cc index 39f605be34..aff94accde 100644 --- a/test/porousmediumflow/tracer/constvel/main.cc +++ b/test/porousmediumflow/tracer/constvel/main.cc @@ -78,7 +78,6 @@ int main(int argc, char** argv) //! create the finite volume grid geometry using GridGeometry = GetPropType; auto gridGeometry = std::make_shared(leafGridView); - gridGeometry->update(); //! the problem (initial and boundary conditions) using Problem = GetPropType; diff --git a/test/porousmediumflow/tracer/multiphase/main.cc b/test/porousmediumflow/tracer/multiphase/main.cc index 41afd56645..4f491977f0 100644 --- a/test/porousmediumflow/tracer/multiphase/main.cc +++ b/test/porousmediumflow/tracer/multiphase/main.cc @@ -75,7 +75,6 @@ int main(int argc, char** argv) //! create the finite volume grid geometry using GridGeometry = GetPropType; auto gridGeometry = std::make_shared(leafGridView); - gridGeometry->update(); //! the problem (initial and boundary conditions) using Problem = GetPropType; -- GitLab From f6ba8bff1b5cedee46f9aa9070f038e49073eae9 Mon Sep 17 00:00:00 2001 From: Martin Schneider Date: Fri, 30 Jul 2021 10:18:38 +0200 Subject: [PATCH 07/10] [examples] Regenerate doc after gg.update() changes --- examples/1protationsymmetry/doc/main.md | 3 +-- examples/1ptracer/doc/main.md | 1 - examples/2pinfiltration/doc/main.md | 1 - examples/biomineralization/doc/mainfile.md | 1 - examples/freeflowchannel/README.md | 1 - examples/liddrivencavity/doc/problem.md | 1 - examples/porenetwork_upscaling/doc/main.md | 5 ++--- examples/shallowwaterfriction/doc/main.md | 1 - 8 files changed, 3 insertions(+), 11 deletions(-) diff --git a/examples/1protationsymmetry/doc/main.md b/examples/1protationsymmetry/doc/main.md index 8fafcb7edb..2d475ca49e 100644 --- a/examples/1protationsymmetry/doc/main.md +++ b/examples/1protationsymmetry/doc/main.md @@ -80,7 +80,6 @@ int main(int argc, char** argv) try // instantiate the grid geometry using GridGeometry = GetPropType; auto gridGeometry = std::make_shared(leafGridView); - gridGeometry->update(); ``` ### Initialize the problem and grid variables @@ -171,7 +170,7 @@ in the input file. // update the grid geometry, the grid variables and // the solution vectors now that the grid has been refined - gridGeometry->update(); + gridGeometry->update(gridManager.grid().leafGridView()); gridVariables->updateAfterGridAdaption(p); p.resize(gridGeometry->numDofs()); diff --git a/examples/1ptracer/doc/main.md b/examples/1ptracer/doc/main.md index 24d3ffd954..045bfc3e38 100644 --- a/examples/1ptracer/doc/main.md +++ b/examples/1ptracer/doc/main.md @@ -129,7 +129,6 @@ of the grid partition. ```cpp using GridGeometry = GetPropType; auto gridGeometry = std::make_shared(leafGridView); - gridGeometry->update(); ``` We now instantiate the problem, in which we define the boundary and initial conditions. diff --git a/examples/2pinfiltration/doc/main.md b/examples/2pinfiltration/doc/main.md index e1295b8b9a..88b4655dff 100644 --- a/examples/2pinfiltration/doc/main.md +++ b/examples/2pinfiltration/doc/main.md @@ -129,7 +129,6 @@ We need the finite volume geometry to build up the subcontrolvolumes (scv) and s ```cpp using GridGeometry = GetPropType; auto gridGeometry = std::make_shared(leafGridView); - gridGeometry->update(); ``` In the problem, we define the boundary and initial conditions and compute the point sources. The `computePointSourceMap` method is inherited from the fvproblem and therefore specified in the `dumux/common/fvproblem.hh`. It calls the `addPointSources` method specified in the `problem.hh` file. diff --git a/examples/biomineralization/doc/mainfile.md b/examples/biomineralization/doc/mainfile.md index 3fbcc53d68..165c571045 100644 --- a/examples/biomineralization/doc/mainfile.md +++ b/examples/biomineralization/doc/mainfile.md @@ -121,7 +121,6 @@ We need the finite volume geometry to build up the subcontrolvolumes (scv) and s ```cpp using GridGeometry = GetPropType; auto gridGeometry = std::make_shared(leafGridView); - gridGeometry->update(); ``` We now instantiate the problem, in which we define the boundary and initial conditions. diff --git a/examples/freeflowchannel/README.md b/examples/freeflowchannel/README.md index 083f38209d..8cff6b94eb 100644 --- a/examples/freeflowchannel/README.md +++ b/examples/freeflowchannel/README.md @@ -477,7 +477,6 @@ of the grid partition. ```cpp using GridGeometry = GetPropType; auto gridGeometry = std::make_shared(leafGridView); - gridGeometry->update(); ``` We now instantiate the problem, in which we define the boundary and initial conditions. diff --git a/examples/liddrivencavity/doc/problem.md b/examples/liddrivencavity/doc/problem.md index 1e2d99474d..5f139b903a 100644 --- a/examples/liddrivencavity/doc/problem.md +++ b/examples/liddrivencavity/doc/problem.md @@ -429,7 +429,6 @@ of the grid partition. ```cpp using GridGeometry = GetPropType; auto gridGeometry = std::make_shared(leafGridView); - gridGeometry->update(); ``` We now instantiate the problem, in which we define the boundary and initial conditions. diff --git a/examples/porenetwork_upscaling/doc/main.md b/examples/porenetwork_upscaling/doc/main.md index a42d8e3a99..4433880183 100644 --- a/examples/porenetwork_upscaling/doc/main.md +++ b/examples/porenetwork_upscaling/doc/main.md @@ -79,10 +79,9 @@ int main(int argc, char** argv) try const auto& leafGridView = gridManager.grid().leafGridView(); // instantiate the grid geometry - using GridGeometry = GetPropType; - auto gridGeometry = std::make_shared(leafGridView); auto gridData = gridManager.getGridData(); - gridGeometry->update(*gridData); + using GridGeometry = GetPropType; + auto gridGeometry = std::make_shared(leafGridView, *gridData); ``` ### Initialize the problem and grid variables diff --git a/examples/shallowwaterfriction/doc/main.md b/examples/shallowwaterfriction/doc/main.md index ebf2c5f6c9..6989c8bb8b 100644 --- a/examples/shallowwaterfriction/doc/main.md +++ b/examples/shallowwaterfriction/doc/main.md @@ -122,7 +122,6 @@ of the grid partition. ```cpp using GridGeometry = GetPropType; auto gridGeometry = std::make_shared(leafGridView); - gridGeometry->update(); ``` We now instantiate the problem, in which we define the boundary and initial conditions. -- GitLab From 152e53cde07a2a3cb2edb59ffd2e733198b71a92 Mon Sep 17 00:00:00 2001 From: Martin Schneider Date: Mon, 2 Aug 2021 10:21:59 +0200 Subject: [PATCH 08/10] [disc][gg] Doc of update functions --- dumux/discretization/basegridgeometry.hh | 4 +-- dumux/discretization/box/fvgridgeometry.hh | 6 ++-- .../cellcentered/mpfa/fvgridgeometry.hh | 6 ++-- .../cellcentered/tpfa/fvgridgeometry.hh | 6 ++-- .../porenetwork/gridgeometry.hh | 6 ++-- .../staggered/fvgridgeometry.hh | 6 ++-- dumux/multidomain/facet/box/fvgridgeometry.hh | 28 +++++++++++++++++++ .../porousmediumflow/boxdfm/fvgridgeometry.hh | 4 +++ 8 files changed, 54 insertions(+), 12 deletions(-) diff --git a/dumux/discretization/basegridgeometry.hh b/dumux/discretization/basegridgeometry.hh index cff928b269..7ffc3dfb9d 100644 --- a/dumux/discretization/basegridgeometry.hh +++ b/dumux/discretization/basegridgeometry.hh @@ -97,7 +97,7 @@ public: } /*! - * \brief Update all fvElementGeometries (do this again after grid adaption) + * \brief Update all fvElementGeometries (call this after grid adaption) */ void update(const GridView& gridView) { @@ -106,7 +106,7 @@ public: } /*! - * \brief Update all fvElementGeometries (do this again after grid adaption) + * \brief Update all fvElementGeometries (call this after grid adaption) */ void update(GridView&& gridView) { diff --git a/dumux/discretization/box/fvgridgeometry.hh b/dumux/discretization/box/fvgridgeometry.hh index 9c8e111541..95938a6bd5 100644 --- a/dumux/discretization/box/fvgridgeometry.hh +++ b/dumux/discretization/box/fvgridgeometry.hh @@ -152,13 +152,14 @@ public: update_(); } - //! update all fvElementGeometries (do this again after grid adaption) + //! update all fvElementGeometries (call this after grid adaption) void update(const GridView& gridView) { ParentType::update(gridView); update_(); } + //! update all fvElementGeometries (call this after grid adaption) void update(GridView&& gridView) { ParentType::update(std::move(gridView)); @@ -439,13 +440,14 @@ public: update_(); } - //! update all fvElementGeometries (do this again after grid adaption) + //! update all fvElementGeometries (call this after grid adaption) void update(const GridView& gridView) { ParentType::update(gridView); update_(); } + //! update all fvElementGeometries (call this after grid adaption) void update(GridView&& gridView) { ParentType::update(std::move(gridView)); diff --git a/dumux/discretization/cellcentered/mpfa/fvgridgeometry.hh b/dumux/discretization/cellcentered/mpfa/fvgridgeometry.hh index 14e2734405..b9969e5819 100644 --- a/dumux/discretization/cellcentered/mpfa/fvgridgeometry.hh +++ b/dumux/discretization/cellcentered/mpfa/fvgridgeometry.hh @@ -180,13 +180,14 @@ public: update_(); } - //! update all fvElementGeometries (do this again after grid adaption) + //! update all fvElementGeometries (call this after grid adaption) void update(const GridView& gridView) { ParentType::update(gridView); update_(); } + //! update all fvElementGeometries (call this after grid adaption) void update(GridView&& gridView) { ParentType::update(std::move(gridView)); @@ -578,13 +579,14 @@ public: update_(); } - //! update all fvElementGeometries (do this again after grid adaption) + //! update all fvElementGeometries (call this after grid adaption) void update(const GridView& gridView) { ParentType::update(gridView); update_(); } + //! update all fvElementGeometries (call this after grid adaption) void update(GridView&& gridView) { ParentType::update(std::move(gridView)); diff --git a/dumux/discretization/cellcentered/tpfa/fvgridgeometry.hh b/dumux/discretization/cellcentered/tpfa/fvgridgeometry.hh index ea120c644a..538031d5f4 100644 --- a/dumux/discretization/cellcentered/tpfa/fvgridgeometry.hh +++ b/dumux/discretization/cellcentered/tpfa/fvgridgeometry.hh @@ -167,13 +167,14 @@ public: update_(); } - //! update all fvElementGeometries (do this again after grid adaption) + //! update all fvElementGeometries (call this after grid adaption) void update(const GridView& gridView) { ParentType::update(gridView); update_(); } + //! update all fvElementGeometries (call this after grid adaption) void update(GridView&& gridView) { ParentType::update(std::move(gridView)); @@ -472,13 +473,14 @@ public: update_(); } - //! update all fvElementGeometries (do this again after grid adaption) + //! update all fvElementGeometries (call this after grid adaption) void update(const GridView& gridView) { ParentType::update(gridView); update_(); } + //! update all fvElementGeometries (call this after grid adaption) void update(GridView&& gridView) { ParentType::update(std::move(gridView)); diff --git a/dumux/discretization/porenetwork/gridgeometry.hh b/dumux/discretization/porenetwork/gridgeometry.hh index a05d383c8f..ee3407341f 100644 --- a/dumux/discretization/porenetwork/gridgeometry.hh +++ b/dumux/discretization/porenetwork/gridgeometry.hh @@ -575,7 +575,7 @@ public: update_(gridData); } - //! update all fvElementGeometries (do this again after grid adaption) + //! update all fvElementGeometries (call this after grid adaption) template void update(const GridView& gridView, const GridData& gridData) { @@ -583,6 +583,7 @@ public: update_(gridData); } + //! update all fvElementGeometries (call this after grid adaption) template void update(GridView&& gridView, const GridData& gridData) { @@ -791,7 +792,7 @@ public: update_(gridData); } - //! update all fvElementGeometries (do this again after grid adaption) + //! update all fvElementGeometries (call this after grid adaption) template void update(const GridView& gridView, const GridData& gridData) { @@ -799,6 +800,7 @@ public: update_(gridData); } + //! update all fvElementGeometries (call this after grid adaption) template void update(GridView&& gridView, const GridData& gridData) { diff --git a/dumux/discretization/staggered/fvgridgeometry.hh b/dumux/discretization/staggered/fvgridgeometry.hh index d847861c0d..496317c4ba 100644 --- a/dumux/discretization/staggered/fvgridgeometry.hh +++ b/dumux/discretization/staggered/fvgridgeometry.hh @@ -289,7 +289,7 @@ public: update_(); } - //! update all fvElementGeometries (do this again after grid adaption) + //! update all fvElementGeometries (call this after grid adaption) void update(const GridView& gridView) { ParentType::update(gridView); @@ -297,6 +297,7 @@ public: update_(); } + //! update all fvElementGeometries (call this after grid adaption) void update(GridView&& gridView) { ParentType::update(std::move(gridView)); @@ -551,7 +552,7 @@ public: update_(); } - //! update all fvElementGeometries (do this again after grid adaption) + //! update all fvElementGeometries (call this after grid adaption) void update(const GridView& gridView) { ParentType::update(gridView); @@ -559,6 +560,7 @@ public: update_(); } + //! update all fvElementGeometries (call this after grid adaption) void update(GridView&& gridView) { ParentType::update(std::move(gridView)); diff --git a/dumux/multidomain/facet/box/fvgridgeometry.hh b/dumux/multidomain/facet/box/fvgridgeometry.hh index 4f56c2dd63..deff0e2f51 100644 --- a/dumux/multidomain/facet/box/fvgridgeometry.hh +++ b/dumux/multidomain/facet/box/fvgridgeometry.hh @@ -185,6 +185,19 @@ public: update_(facetGridView, codimOneGridAdapter, verbose); } + /*! + * \brief update all fvElementGeometries (call this after grid adaption) + * \note This assumes conforming grids! + * + * \param gridView The grid view of a dim-dimensional grid. + * + * \param facetGridView The grid view of a (dim-1)-dimensional grid conforming + * with the facets of this grid view, indicating on which facets + * nodal dofs should be enriched. + * \param codimOneGridAdapter Adapter class that allows access to information on the d- + * dimensional grid for entities of the (d-1)-dimensional grid + * \param verbose Verbosity level for vertex enrichment + */ template void update(const GridView& gridView, const FacetGridView& facetGridView, @@ -195,6 +208,7 @@ public: update_(facetGridView, codimOneGridAdapter, verbose); } + //! update all fvElementGeometries (call this after grid adaption) template void update(GridView&& gridView, const FacetGridView& facetGridView, @@ -489,6 +503,19 @@ public: update_(facetGridView, codimOneGridAdapter, verbose); } + /*! + * \brief update all fvElementGeometries (call this after grid adaption) + * \note This assumes conforming grids! + * + * \param gridView The grid view of a dim-dimensional grid. + * + * \param facetGridView The grid view of a (dim-1)-dimensional grid conforming + * with the facets of this grid view, indicating on which facets + * nodal dofs should be enriched. + * \param codimOneGridAdapter Adapter class that allows access to information on the d- + * dimensional grid for entities of the (d-1)-dimensional grid + * \param verbose Verbosity level for vertex enrichment + */ template void update(const GridView& gridView, const FacetGridView& facetGridView, @@ -500,6 +527,7 @@ public: update_(facetGridView, codimOneGridAdapter, verbose); } + //! update all fvElementGeometries (call this after grid adaption) template void update(GridView&& gridView, const FacetGridView& facetGridView, diff --git a/dumux/porousmediumflow/boxdfm/fvgridgeometry.hh b/dumux/porousmediumflow/boxdfm/fvgridgeometry.hh index 85b5b2b0d6..16dd5b706c 100644 --- a/dumux/porousmediumflow/boxdfm/fvgridgeometry.hh +++ b/dumux/porousmediumflow/boxdfm/fvgridgeometry.hh @@ -176,6 +176,7 @@ public: update_(fractureGridAdapter); } + //! update all fvElementGeometries (call this after grid adaption) template< class FractureGridAdapter > void update(const GridView& gridView, const FractureGridAdapter& fractureGridAdapter) { @@ -183,6 +184,7 @@ public: update_(fractureGridAdapter); } + //! update all fvElementGeometries (call this after grid adaption) template< class FractureGridAdapter > void update(GridView&& gridView, const FractureGridAdapter& fractureGridAdapter) { @@ -509,6 +511,7 @@ public: update_(fractureGridAdapter); } + //! update all fvElementGeometries (call this after grid adaption) template< class FractureGridAdapter > void update(const GridView& gridView, const FractureGridAdapter& fractureGridAdapter) { @@ -517,6 +520,7 @@ public: update_(fractureGridAdapter); } + //! update all fvElementGeometries (call this after grid adaption) template< class FractureGridAdapter > void update(GridView&& gridView, const FractureGridAdapter& fractureGridAdapter) { -- GitLab From e98c6bd2d98827e1cdcb6304ba9d0b87cefc2117 Mon Sep 17 00:00:00 2001 From: Martin Schneider Date: Mon, 2 Aug 2021 11:32:10 +0200 Subject: [PATCH 09/10] [Changelog] Add comments related to grid geometry changes --- CHANGELOG.md | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 1f0a210d36..ae686d52bc 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,21 @@ +Differences Between DuMux 3.5 and DuMux 3.4 +============================================= + +### Improvements and Enhancements +- __Construction and update of GridGeometries changed__: Grid geometries are fully updated after construction. + Additional call of update functions are therefore only needed after grid adaption. Calling the update functions after construction now leads to a performance penalty. + +### Immediate interface changes not allowing/requiring a deprecation period: +- __Virtual interface of GridDataTransfer__: The `GridDataTransfer` abstract base class now required the Grid type as a template argument. Furthermore, the `store` and `reconstruct` interface functions do now expect the grid as a function argument. This allows to correctly update grid geometries and corresponding mapper (see "Construction and update of GridGeometries changed" above in the changelog) + +### Deprecated properties/classes/functions/files, to be removed after 3.5: + +- `update()` functions of grid geometries, which do not receive the `gridView`, are deprecated, use `update(gridView)` instead. + +### New experimental features (possibly subject to backwards-incompatible changes in the future) + +### Continuous integration + Differences Between DuMux 3.4 and DuMux 3.3 ============================================= -- GitLab From 8fe092f1aa515ebbc832bab31fd63519c90cfd86 Mon Sep 17 00:00:00 2001 From: Martin Schneider Date: Mon, 2 Aug 2021 15:31:45 +0200 Subject: [PATCH 10/10] [tests][facet] Use constexpr if for gg construction --- .../facet/1p_1p/analytical/main.cc | 44 ++++++++----------- test/multidomain/facet/1pnc_1pnc/main.cc | 44 ++++++++----------- .../facet/test_facetcouplingmapper.cc | 39 ++++++++-------- test/multidomain/facet/tracer_tracer/main.cc | 44 ++++++++----------- 4 files changed, 72 insertions(+), 99 deletions(-) diff --git a/test/multidomain/facet/1p_1p/analytical/main.cc b/test/multidomain/facet/1p_1p/analytical/main.cc index fc0eca5cc2..469735bbaf 100644 --- a/test/multidomain/facet/1p_1p/analytical/main.cc +++ b/test/multidomain/facet/1p_1p/analytical/main.cc @@ -117,40 +117,32 @@ computeL2Norm(const GridView& gridView, } /*! - * \brief Constructs the finite volume grid geometry for the box scheme. - * - * This is necessary as the finite volume grid geometry for the box scheme with - * facet coupling requires additional data for the constructor. The reason is that - * we have to create additional faces on interior boundaries, which wouldn't be - * created in the standard scheme. + * \brief Constructs the finite volume grid geometry. */ template< class BulkGridGeometry, class GridManager, class BulkGridView, - class LowDimGridView, - std::enable_if_t = 0 > + class LowDimGridView > auto makeBulkFVGridGeometry(const GridManager& gridManager, const BulkGridView& bulkGridView, const LowDimGridView& lowDimGridView) { - using BulkFacetGridAdapter = Dumux::CodimOneGridAdapter; - BulkFacetGridAdapter facetGridAdapter(gridManager.getEmbeddings()); - return std::make_shared(bulkGridView, lowDimGridView, facetGridAdapter); -} - -/*! - * \brief Constructs the finite volume grid geometry for the cell-centered schemes. - */ -template< class BulkGridGeometry, - class GridManager, - class BulkGridView, - class LowDimGridView, - std::enable_if_t = 0 > -auto makeBulkFVGridGeometry(const GridManager& gridManager, - const BulkGridView& bulkGridView, - const LowDimGridView& lowDimGridView) -{ - return std::make_shared(bulkGridView); + /*! + * The finite volume grid geometry for the box scheme with facet coupling + * requires additional data for the constructor. The reason is that + * we have to create additional faces on interior boundaries, which are not + * created in the standard scheme. + */ + if constexpr (BulkGridGeometry::discMethod == Dumux::DiscretizationMethod::box) + { + using BulkFacetGridAdapter = Dumux::CodimOneGridAdapter; + BulkFacetGridAdapter facetGridAdapter(gridManager.getEmbeddings()); + return std::make_shared(bulkGridView, lowDimGridView, facetGridAdapter); + } + else + { + return std::make_shared(bulkGridView); + } } } // end namespace Dumux diff --git a/test/multidomain/facet/1pnc_1pnc/main.cc b/test/multidomain/facet/1pnc_1pnc/main.cc index c973b6f105..ef93d5c560 100644 --- a/test/multidomain/facet/1pnc_1pnc/main.cc +++ b/test/multidomain/facet/1pnc_1pnc/main.cc @@ -47,40 +47,32 @@ namespace Dumux { /*! - * \brief Constructs the finite volume grid geometry for the box scheme. - * - * This is necessary as the finite volume grid geometry for the box scheme with - * facet coupling requires additional data for the constructor. The reason is that - * we have to create additional faces on interior boundaries, which wouldn't be - * created in the standard scheme. + * \brief Constructs the finite volume grid geometry. */ template< class BulkGridGeometry, class GridManager, class BulkGridView, - class LowDimGridView, - std::enable_if_t = 0 > + class LowDimGridView > auto makeBulkFVGridGeometry(const GridManager& gridManager, const BulkGridView& bulkGridView, const LowDimGridView& lowDimGridView) { - using BulkFacetGridAdapter = Dumux::CodimOneGridAdapter; - BulkFacetGridAdapter facetGridAdapter(gridManager.getEmbeddings()); - return std::make_shared(bulkGridView, lowDimGridView, facetGridAdapter); -} - -/*! - * \brief Constructs the finite volume grid geometry for the cell-centered schemes. - */ -template< class BulkGridGeometry, - class GridManager, - class BulkGridView, - class LowDimGridView, - std::enable_if_t = 0 > -auto makeBulkFVGridGeometry(const GridManager& gridManager, - const BulkGridView& bulkGridView, - const LowDimGridView& lowDimGridView) -{ - return std::make_shared(bulkGridView); + /*! + * The finite volume grid geometry for the box scheme with facet coupling + * requires additional data for the constructor. The reason is that + * we have to create additional faces on interior boundaries, which are not + * created in the standard scheme. + */ + if constexpr (BulkGridGeometry::discMethod == Dumux::DiscretizationMethod::box) + { + using BulkFacetGridAdapter = Dumux::CodimOneGridAdapter; + BulkFacetGridAdapter facetGridAdapter(gridManager.getEmbeddings()); + return std::make_shared(bulkGridView, lowDimGridView, facetGridAdapter); + } + else + { + return std::make_shared(bulkGridView); + } } } // end namespace Dumux diff --git a/test/multidomain/facet/test_facetcouplingmapper.cc b/test/multidomain/facet/test_facetcouplingmapper.cc index 464c747dfa..d4cccd887e 100644 --- a/test/multidomain/facet/test_facetcouplingmapper.cc +++ b/test/multidomain/facet/test_facetcouplingmapper.cc @@ -97,35 +97,32 @@ void checkScvfEmbedment(const Scvf& scvf, const LowDimGeom& lowDimGeom) } /*! - * \brief Constructs the finite volume grid geometry for the box scheme. + * \brief Constructs the finite volume grid geometry. */ template< class BulkGridGeometry, class GridManager, class BulkGridView, - class LowDimGridView, - std::enable_if_t = 0 > + class LowDimGridView > auto makeBulkFVGridGeometry(const GridManager& gridManager, const BulkGridView& bulkGridView, const LowDimGridView& lowDimGridView) { - using BulkFacetGridAdapter = Dumux::CodimOneGridAdapter; - BulkFacetGridAdapter facetGridAdapter(gridManager.getEmbeddings()); - return BulkGridGeometry(bulkGridView, lowDimGridView, facetGridAdapter, true); -} - -/*! - * \brief Constructs the finite volume grid geometry for the cell-centered schemes. - */ -template< class BulkGridGeometry, - class GridManager, - class BulkGridView, - class LowDimGridView, - std::enable_if_t = 0 > -auto makeBulkFVGridGeometry(const GridManager& gridManager, - const BulkGridView& bulkGridView, - const LowDimGridView& lowDimGridView) -{ - return BulkGridGeometry(bulkGridView); + /*! + * The finite volume grid geometry for the box scheme with facet coupling + * requires additional data for the constructor. The reason is that + * we have to create additional faces on interior boundaries, which are not + * created in the standard scheme. + */ + if constexpr (BulkGridGeometry::discMethod == Dumux::DiscretizationMethod::box) + { + using BulkFacetGridAdapter = Dumux::CodimOneGridAdapter; + BulkFacetGridAdapter facetGridAdapter(gridManager.getEmbeddings()); + return BulkGridGeometry(bulkGridView, lowDimGridView, facetGridAdapter, true); + } + else + { + return BulkGridGeometry(bulkGridView); + } } // main program diff --git a/test/multidomain/facet/tracer_tracer/main.cc b/test/multidomain/facet/tracer_tracer/main.cc index 7051d059d9..582191d825 100644 --- a/test/multidomain/facet/tracer_tracer/main.cc +++ b/test/multidomain/facet/tracer_tracer/main.cc @@ -52,40 +52,32 @@ namespace Dumux { /*! - * \brief Constructs the finite volume grid geometry for the box scheme. - * - * This is necessary as the finite volume grid geometry for the box scheme with - * facet coupling requires additional data for the constructor. The reason is that - * we have to create additional faces on interior boundaries, which wouldn't be - * created in the standard scheme. + * \brief Constructs the finite volume grid geometry. */ template< class BulkGridGeometry, class GridManager, class BulkGridView, - class LowDimGridView, - std::enable_if_t = 0 > + class LowDimGridView > auto makeBulkFVGridGeometry(const GridManager& gridManager, const BulkGridView& bulkGridView, const LowDimGridView& lowDimGridView) { - using BulkFacetGridAdapter = Dumux::CodimOneGridAdapter; - BulkFacetGridAdapter facetGridAdapter(gridManager.getEmbeddings()); - return std::make_shared(bulkGridView, lowDimGridView, facetGridAdapter); -} - -/*! - * \brief Constructs the finite volume grid geometry for the cell-centered schemes. - */ -template< class BulkGridGeometry, - class GridManager, - class BulkGridView, - class LowDimGridView, - std::enable_if_t = 0 > -auto makeBulkFVGridGeometry(const GridManager& gridManager, - const BulkGridView& bulkGridView, - const LowDimGridView& lowDimGridView) -{ - return std::make_shared(bulkGridView); + /*! + * The finite volume grid geometry for the box scheme with facet coupling + * requires additional data for the constructor. The reason is that + * we have to create additional faces on interior boundaries, which are not + * created in the standard scheme. + */ + if constexpr (BulkGridGeometry::discMethod == Dumux::DiscretizationMethod::box) + { + using BulkFacetGridAdapter = Dumux::CodimOneGridAdapter; + BulkFacetGridAdapter facetGridAdapter(gridManager.getEmbeddings()); + return std::make_shared(bulkGridView, lowDimGridView, facetGridAdapter); + } + else + { + return std::make_shared(bulkGridView); + } } //! Computes the volume fluxes on all scvfs for a sub-domain. -- GitLab