diff --git a/CHANGELOG.md b/CHANGELOG.md
index 1f0a210d36cb2c4def87547c28537388e74b0dce..ae686d52bc25eea6da88ed55ad4463414fcee8f8 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
=============================================
diff --git a/dumux/adaptive/adapt.hh b/dumux/adaptive/adapt.hh
index b5cc28e80f3761f2a032d96b4a600db7a3794ce3..64dc9716e28c64ba1bd4fc3963a188b0b2915d6a 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 043b3686f45e4d5ec20448ece3fba42e3b84ac41..48b0401954de8c65a56a44024177ff222ee33dd0 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/discretization/basegridgeometry.hh b/dumux/discretization/basegridgeometry.hh
index 56f76901357e07a753a53e8947c98a4dd2659640..7ffc3dfb9d17443bfaccc1bd2d83a90e07cf3895 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
@@ -83,30 +84,34 @@ public:
, bBoxMax_(-std::numeric_limits::max())
{
computeGlobalBoundingBox_();
+ update_();
}
/*!
* \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 (call this 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 (call this after grid adaption)
+ */
+ void update(GridView&& gridView)
+ {
+ gridView_ = std::move(gridView);
+ update_();
}
/*!
@@ -243,8 +248,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 58479f227609e9c1ccb3abc246d7966afd56f3b4..95938a6bd58a8f31eb59b11a72b17943db1afe07 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
@@ -117,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...
@@ -142,10 +145,62 @@ 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 (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));
+ 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 +346,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_;
@@ -385,7 +406,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...
@@ -410,10 +433,51 @@ 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 (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));
+ 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 +558,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 aa8d4ae436fc68c3397fb0b260dd5e462b80e58a..b9969e58190abe0996ba2ee210d8277b7e4e2e81 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
@@ -125,6 +127,7 @@ public:
{ return is.boundary() || isBranching; } )
{
checkOverlapSizeCCMpfa(gridView);
+ update_();
}
//! Constructor with user-defined indicator function for secondary interaction volumes
@@ -133,6 +136,7 @@ public:
, secondaryIvIndicator_(indicator)
{
checkOverlapSizeCCMpfa(gridView);
+ update_();
}
//! the element mapper is the dofMapper
@@ -169,10 +173,69 @@ 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 (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));
+ 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 +428,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_;
@@ -494,6 +518,7 @@ public:
{ return is.boundary() || isBranching; } )
{
checkOverlapSizeCCMpfa(gridView);
+ update_();
}
//! Constructor with user-defined indicator function for secondary interaction volumes
@@ -502,6 +527,7 @@ public:
, secondaryIvIndicator_(indicator)
{
checkOverlapSizeCCMpfa(gridView);
+ update_();
}
//! the element mapper is the dofMapper
@@ -546,9 +572,61 @@ 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 (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));
+ 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 +806,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 76d6be3cec93992b888f0dc8178e64b4e86a66c3..538031d5f49b63b829def74a8fbb8aaee110c6a1 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
@@ -127,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
@@ -157,10 +160,67 @@ 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 (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));
+ 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 +350,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)
{
@@ -411,6 +434,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
@@ -441,10 +466,45 @@ 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 (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));
+ 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 +592,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 c790bbb5a68a5949849b69f530aa77e8d4b1b026..ee3407341f38b4f77b784aa38526bab0255a5e60 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
@@ -528,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
@@ -558,9 +568,66 @@ 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 (call this after grid adaption)
+ template
+ void update(const GridView& gridView, const GridData& gridData)
+ {
+ ParentType::update(gridView);
+ update_(gridData);
+ }
+
+ //! update all fvElementGeometries (call this after grid adaption)
+ 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 +689,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_;
@@ -711,12 +745,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
@@ -741,32 +785,27 @@ 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 (call this after grid adaption)
+ template
+ void update(const GridView& gridView, const GridData& gridData)
+ {
+ ParentType::update(gridView);
+ update_(gridData);
+ }
- boundaryDofIndices_[vIdxGlobal] = true;
- }
- }
- }
+ //! update all fvElementGeometries (call this after grid adaption)
+ template
+ void update(GridView&& gridView, const GridData& gridData)
+ {
+ ParentType::update(std::move(gridView));
+ update_(gridData);
}
//! The finite element cache for creating local FE bases
@@ -791,6 +830,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/discretization/staggered/fvgridgeometry.hh b/dumux/discretization/staggered/fvgridgeometry.hh
index 02a1d936363d47df296e2b2441f15d6794f213cf..496317c4baa831ea524941802c1ecce0de2a773a 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
@@ -239,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
@@ -277,16 +281,110 @@ 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()
{
- // clear containers (necessary after grid refinement)
- scvs_.clear();
- scvfs_.clear();
- scvfIndicesOfScv_.clear();
+ ParentType::update();
+ updateIntersectionMapper_();
+ update_();
+ }
+
+ //! update all fvElementGeometries (call this after grid adaption)
+ void update(const GridView& gridView)
+ {
+ ParentType::update(gridView);
+ updateIntersectionMapper_();
+ update_();
+ }
+
+ //! update all fvElementGeometries (call this after grid adaption)
+ void update(GridView&& gridView)
+ {
+ ParentType::update(std::move(gridView));
+ updateIntersectionMapper_();
+ 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 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();
+
// determine size of containers
std::size_t numScvs = this->gridView().size(0);
std::size_t numScvf = 0;
@@ -359,71 +457,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_;
@@ -506,62 +539,33 @@ 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)
+ [[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();
+ updateIntersectionMapper_();
+ 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 (call this after grid adaption)
+ void update(const GridView& gridView)
+ {
+ ParentType::update(gridView);
+ updateIntersectionMapper_();
+ update_();
+ }
- // build the connectivity map for an effecient assembly
- connectivityMap_.update(*this);
+ //! update all fvElementGeometries (call this after grid adaption)
+ void update(GridView&& gridView)
+ {
+ ParentType::update(std::move(gridView));
+ updateIntersectionMapper_();
+ update_();
}
//! The total number of sub control volumes
@@ -649,6 +653,65 @@ public:
private:
+ void updateIntersectionMapper_()
+ {
+ 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();
+ 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 d16a2f9170e61dfdaba31aaa1225bc7892f82f13..deff0e2f51b51405a28a1465f0d6f3b67e079477 100644
--- a/dumux/multidomain/facet/box/fvgridgeometry.hh
+++ b/dumux/multidomain/facet/box/fvgridgeometry.hh
@@ -28,10 +28,12 @@
#define DUMUX_FACETCOUPLING_BOX_GRID_FVGEOMETRY_HH
#include
+#include
#include
#include
+#include
#include
#include
#include
@@ -126,9 +128,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(); }
@@ -162,13 +175,89 @@ 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_(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,
+ const CodimOneGridAdapter& codimOneGridAdapter,
+ bool verbose = false)
+ {
+ ParentType::update(gridView);
+ update_(facetGridView, codimOneGridAdapter, verbose);
+ }
+
+ //! update all fvElementGeometries (call this after grid adaption)
+ 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 +383,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_;
@@ -385,11 +441,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
@@ -424,13 +492,96 @@ 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();
+ updateFacetMapper_();
+ 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,
+ const CodimOneGridAdapter& codimOneGridAdapter,
+ bool verbose = false)
+ {
+ ParentType::update(gridView);
+ updateFacetMapper_();
+ update_(facetGridView, codimOneGridAdapter, verbose);
+ }
+
+ //! update all fvElementGeometries (call this after grid adaption)
+ template
+ void update(GridView&& gridView,
+ const FacetGridView& facetGridView,
+ const CodimOneGridAdapter& codimOneGridAdapter,
+ bool verbose = false)
+ {
+ ParentType::update(std::move(gridView));
+ updateFacetMapper_();
+ 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 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);
@@ -504,35 +655,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/2p/griddatatransfer.hh b/dumux/porousmediumflow/2p/griddatatransfer.hh
index a10fff8980c41d4b19b0921b059bed958913d6b3..e7a87d189ee73ef3f4569a5dce10ceaff595f262 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
*
diff --git a/dumux/porousmediumflow/boxdfm/fvgridgeometry.hh b/dumux/porousmediumflow/boxdfm/fvgridgeometry.hh
index 2d5a23fa1a4f4f7b24a2c1dca8919cd6adba816d..16dd5b706c767b383041da5cacea35b25f5c2a98 100644
--- a/dumux/porousmediumflow/boxdfm/fvgridgeometry.hh
+++ b/dumux/porousmediumflow/boxdfm/fvgridgeometry.hh
@@ -29,12 +29,14 @@
#ifndef DUMUX_POROUSMEDIUMFLOW_BOXDFM_GRID_FVGEOMETRY_HH
#define DUMUX_POROUSMEDIUMFLOW_BOXDFM_GRID_FVGEOMETRY_HH
+#include
#include
#include
#include
#include
+#include
#include
#include
#include
@@ -132,9 +134,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
@@ -159,10 +169,55 @@ 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);
+ }
+
+ //! update all fvElementGeometries (call this after grid adaption)
+ template< class FractureGridAdapter >
+ void update(const GridView& gridView, const FractureGridAdapter& fractureGridAdapter)
+ {
+ ParentType::update(gridView);
+ update_(fractureGridAdapter);
+ }
+
+ //! update all fvElementGeometries (call this after grid adaption)
+ 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 +408,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_;
@@ -432,11 +465,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
@@ -459,12 +501,68 @@ 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();
+ updateFacetMapper_();
+ update_(fractureGridAdapter);
+ }
+
+ //! update all fvElementGeometries (call this after grid adaption)
+ template< class FractureGridAdapter >
+ void update(const GridView& gridView, const FractureGridAdapter& fractureGridAdapter)
+ {
+ ParentType::update(gridView);
+ updateFacetMapper_();
+ update_(fractureGridAdapter);
+ }
+
+ //! update all fvElementGeometries (call this after grid adaption)
+ template< class FractureGridAdapter >
+ void update(GridView&& gridView, const FractureGridAdapter& fractureGridAdapter)
+ {
+ ParentType::update(std::move(gridView));
+ updateFacetMapper_();
+ 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 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);
facetOnFracture_.assign(this->gridView().size(1), false);
@@ -532,29 +630,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
diff --git a/examples/1protationsymmetry/doc/main.md b/examples/1protationsymmetry/doc/main.md
index 8fafcb7edbb6aa2fa92f31e10f592cd49f25f366..2d475ca49e09862011e5a0cd66b4f4b8511bf22e 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/1protationsymmetry/main.cc b/examples/1protationsymmetry/main.cc
index e25029a781aa041bb83b2b8be4f6596236b009d3..f75766827fcccc4536f59791b1f63692a490cb72 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/doc/main.md b/examples/1ptracer/doc/main.md
index 24d3ffd9544d9c8546c54151ef765f581755c0bf..045bfc3e38c43c60943f7dd3b217c5f9125288bb 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/1ptracer/main.cc b/examples/1ptracer/main.cc
index 7cf95abb433e1dfff806355e76c6fa6f7c21c3e2..21569bc52d9f5fd532aa140a8be8f529de6573b5 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/doc/main.md b/examples/2pinfiltration/doc/main.md
index e1295b8b9a9c18744648c19347795c835d570898..88b4655dff7451a33c4084126620d4babff3a083 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/2pinfiltration/main.cc b/examples/2pinfiltration/main.cc
index 80458c97f433c1c928dd9eebe425cc3026101f7f..3f590b274546bebd1eba4a735fb43f429cde2cc7 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/doc/mainfile.md b/examples/biomineralization/doc/mainfile.md
index 3fbcc53d68d0377e7de6af9842f6f7fc3c2e8c23..165c57104573c0b925fe6afe9479e5af5e92a109 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/biomineralization/main.cc b/examples/biomineralization/main.cc
index 8ae2cc3b8400f2a5dc178810a7b56a6856540ccb..45fa5a95e6cde4bf857163572cdb15e36ab7e2b1 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/README.md b/examples/freeflowchannel/README.md
index 083f38209d72e0a7b047c3be819a798206b183c8..8cff6b94eb67a539ae9d5ac83914260a49b42788 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/freeflowchannel/main.cc b/examples/freeflowchannel/main.cc
index 8994914603f92b90486c858a87779978ad7b934c..abe4b4e163b70ecf368d6ef6acfd126ac9aa8f7a 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/doc/problem.md b/examples/liddrivencavity/doc/problem.md
index 1e2d99474d0cfa94dadffbc5eb82af70d4ffdee3..5f139b903a3689ee4de9f1859bb24766c986a10e 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/liddrivencavity/main.cc b/examples/liddrivencavity/main.cc
index d8c88134d8293980af9fce9ff33c91e1a519e09b..0b6680b1a41989fcc4694f638da953bc9c3e5cda 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/doc/main.md b/examples/porenetwork_upscaling/doc/main.md
index a42d8e3a9917a7015146c9a1abd19a6544372ca3..4433880183bc7c5797fec360cdddf27f36ad13a7 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/porenetwork_upscaling/main.cc b/examples/porenetwork_upscaling/main.cc
index dfd431878d62fcdaf3a031e311744e68b56742e8..af9cb30c19e1b41649836347c1ea941b156a3325 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/doc/main.md b/examples/shallowwaterfriction/doc/main.md
index ebf2c5f6c926adde4e12b31c626affc2d242355f..6989c8bb8bb2e0c119fa21dc635f964797e854f4 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.
diff --git a/examples/shallowwaterfriction/main.cc b/examples/shallowwaterfriction/main.cc
index f231708a7aa0bc9b8dfb4f06ce5a28a5f18a3bb8..5e6dfd4ed05d693e5fb967454ee84cc52c40d1e6 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 da016a1757f0af72099b69592ea6908efadfca35..1434154d32ef052190f9f230096f444e31f34290 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 a106e92a85adab6042a01834f06ef7cb605a396b..435fb6e8620e254971d64b8c23be53cc95b7137e 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 36218567fb11e49b33366f069ee1f4dc0b5db5b7..aa91b0b44bfa88dde3724b15482c5530b936ccc6 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 2f4ebe24c5d4a24ce49c7625986d8e43afd3eb2c..fb1094e1d8e928cc4203add85f2351bec3280ddc 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 5fce7aa9e48242cab6edaf55fa728203d4036281..d5d034c2dbbb2ab4fd17473f7f05715e7b628cf2 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 44214918e25f6160b4f6d56061c801ac37cd8a8e..bf1377d0ffba6f6d38293299b121649feb0453dc 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 bf7b1d7009895ecf80a6d9b49bb711dc07fca2d8..2ec5ab225d6d57bc16cb823af2dbc5dda5ab3c58 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 5af6b617798079aa9388189e31e1a4cdadbdac0c..f1aa15c4465948b231fc8c564180bd9dd1a99977 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 bbcb337b629b2cfba38b11ca34fc3b5cfda9942e..2c180790aa28daa3df6e7cca86cf110db7b0d98f 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 bc41689723d955a234a1d0fabfdbb38a8605940b..40df458c2b91d7bb9eaeaad5bfd6cd977d3f9fe8 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 d8980e127014624ce58e85ccd069ec8d2a8eb96b..5e5a62fbada4d8dc5a8518216da3c9381a53b80d 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 b0dffe48ad481716d9f99249d155251b8e034571..177bb4f4349c2c8549076732e2c8145479bae0f8 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 e0c81ef42e0dcf5744f6174d9a84445d545c4e35..c9af40ea99d41d8dd953c7f255e6a75c3e753742 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 8830ec2ba660aa97b39d10911167afe6351e2d1f..ecfd4a251a30d0cdc82cd92f1ac41fd606b63841 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 28e799b1064b86ceb110e7b4a5b7daedcde5b8dc..c09c219c9b800fb8e04ce8f6cee73add9514ef7c 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 0f595dbe68f12e3c0bda9b8189322e2fd9a6e90d..b67b928577ad5de1431fe344a7bbe3a06f083363 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 a9348bc5ed2f7b367951775ce7b58af98dd06e66..85c094f25abe4981e8db61e560b8eaf0fa255957 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 2360d7879bc2560ba7af6f4cbebb71751335592a..39e2a52fa781efcef1cfd9b0185e21f19dbf5803 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 9b55db443ebe2951afbc919d545db07956150538..518732f24bd3e25bcf2f224e9e7b563fc2dd0b7f 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 f777814f217e692d69ac1428d126046b11358e74..4f9e24fab4e1d464a0150a98c66a70d924f9a342 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 7755ceefac4cc759859221cc8d0d2b62cb5fb773..3d9aa15439d37bf62db4a2c30c0b6e9e345c40ba 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 932bb3d1fb4e3f76a74eb9f8e6f0cb4e59e02c5b..8d31944398240cff2e6c1c99ec6356c3a46262db 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 3976a282c3a6025080b4b2c0fab4b80bc2229425..a1c1201043ce336e3c33acf644b6967570a7d80c 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