12#ifndef DUMUX_DISCRETIZATION_PNM_GRID_GEOMETRY_HH
13#define DUMUX_DISCRETIZATION_PNM_GRID_GEOMETRY_HH
17#include <unordered_map>
20#include <dune/common/exceptions.hh>
21#include <dune/localfunctions/lagrange/lagrangelfecache.hh>
42template<
class Scalar,
class Gr
idView>
47 using Label = std::int_least8_t;
48 using Vertex =
typename GridView::template Codim<GridView::dimension>::Entity;
49 using Element =
typename GridView::template Codim<0>::Entity;
51 static const int dim = GridView::dimension;
55 template<
class Gr
idData>
60 const auto numThroats = gridView.size(0);
61 throatInscribedRadius_.resize(numThroats);
62 throatLength_.resize(numThroats);
63 throatLabel_.resize(numThroats);
64 throatCrossSectionalArea_.resize(numThroats);
65 throatShapeFactor_.resize(numThroats);
67 useSameGeometryForAllPores_ =
true;
68 useSameShapeForAllThroats_ =
true;
69 overwriteGridDataWithShapeSpecificValues_ =
false;
74 const auto throatGeometryInput = getParamFromGroup<std::string>(gridData.
paramGroup(),
"Grid.ThroatCrossSectionShape");
76 throatGeometry_.resize(1);
77 throatGeometry_[0] = throatGeometry;
78 overwriteGridDataWithShapeSpecificValues_ = getParamFromGroup<bool>(gridData.
paramGroup(),
"Grid.OverwriteGridDataWithShapeSpecificValues",
true);
80 std::cout <<
"Using '" << throatGeometryInput <<
"' as cross-sectional shape for all throats." << std::endl;
84 std::cout <<
"Reading shape factors for throats from grid data." << std::endl;
85 useSameShapeForAllThroats_ =
false;
86 throatGeometry_.resize(numThroats);
90 const auto numPores = gridView.size(dim);
91 poreInscribedRadius_.resize(numPores);
92 poreLabel_.resize(numPores);
93 poreVolume_.resize(numPores);
98 const auto poreGeometryInput = getParamFromGroup<std::string>(gridData.
paramGroup(),
"Grid.PoreGeometry");
99 poreGeometry_.resize(1);
102 std::cout <<
"Using '" << poreGeometryInput <<
"' as geometry for all pores." << std::endl;
106 std::cout <<
"Reading pore shapes from grid data." << std::endl;
107 useSameGeometryForAllPores_ =
false;
108 poreGeometry_.resize(numPores);
112 for (
const auto& vertex : vertices(gridView))
114 static const auto poreInscribedRadiusIdx = gridData.
parameterIndex(
"PoreInscribedRadius");
115 static const auto poreLabelIdx = gridData.
parameterIndex(
"PoreLabel");
116 const auto vIdx = gridView.indexSet().index(vertex);
117 const auto& params = gridData.
parameters(vertex);
118 poreInscribedRadius_[vIdx] = params[poreInscribedRadiusIdx];
119 assert(poreInscribedRadius_[vIdx] > 0.0);
120 poreLabel_[vIdx] = params[poreLabelIdx];
123 poreGeometry_[vIdx] = getPoreGeometry_(gridData, vertex);
125 poreVolume_[vIdx] = getPoreVolume_(gridData, vertex, vIdx);
128 for (
const auto& element : elements(gridView))
130 const int eIdx = gridView.indexSet().index(element);
131 const auto& params = gridData.
parameters(element);
132 static const auto throatInscribedRadiusIdx = gridData.
parameterIndex(
"ThroatInscribedRadius");
133 static const auto throatLengthIdx = gridData.
parameterIndex(
"ThroatLength");
134 throatInscribedRadius_[eIdx] = params[throatInscribedRadiusIdx];
135 throatLength_[eIdx] = params[throatLengthIdx];
139 if (gridHasThroatLabel)
141 static const auto throatLabelIdx = gridData.
parameterIndex(
"ThroatLabel");
142 throatLabel_[eIdx] = params[throatLabelIdx];
146 const auto vIdx0 = gridView.indexSet().subIndex(element, 0, dim);
147 const auto vIdx1 = gridView.indexSet().subIndex(element, 1, dim);
149 const auto poreLabel0 =
poreLabel(vIdx0);
150 const auto poreLabel1 =
poreLabel(vIdx1);
152 if (poreLabel0 >= 0 && poreLabel1 >= 0)
154 std::cout <<
"\n Warning: Throat "
155 << eIdx <<
" connects two boundary pores with different pore labels. Using the greater pore label as throat label.\n"
156 <<
"Set the throat labels explicitly in your grid file, if needed." << std::endl;
160 throatLabel_[eIdx] = max(poreLabel0, poreLabel1);
165 static const auto throatShapeFactorIdx = gridData.
parameterIndex(
"ThroatShapeFactor");
166 static const auto throatAreaIdx = gridData.
parameterIndex(
"ThroatCrossSectionalArea");
167 throatShapeFactor_[eIdx] = params[throatShapeFactorIdx];
168 throatGeometry_[eIdx] =
Throat::shape(throatShapeFactor_[eIdx]);
169 throatCrossSectionalArea_[eIdx] = params[throatAreaIdx];
173 throatCrossSectionalArea_[eIdx] = getThroatCrossSectionalArea_(gridData, element, eIdx);
174 throatShapeFactor_[eIdx] = getThroatShapeFactor_(gridData, element, eIdx);
177 assert(throatInscribedRadius_[eIdx] > 0.0);
178 assert(throatLength_[eIdx] > 0.0);
179 assert(throatCrossSectionalArea_[eIdx] > 0.0);
181 static const bool addThroatVolumeToPoreVolume = getParamFromGroup<bool>(gridData.
paramGroup(),
"Grid.AddThroatVolumeToPoreVolume",
false);
182 if (addThroatVolumeToPoreVolume)
184 for (
int vIdxLocal = 0; vIdxLocal < 2; ++vIdxLocal)
186 const auto vIdx = gridView.indexSet().subIndex(element, vIdxLocal, dim);
187 poreVolume_[vIdx] += 0.5 * throatCrossSectionalArea_[eIdx] * throatLength_[eIdx];
192 maybeResizeContainers_();
197 {
return poreLabel_[dofIdxGlobal]; }
201 {
return poreLabel_; }
205 {
return poreInscribedRadius_[dofIdxGlobal]; }
209 {
return poreInscribedRadius_; }
213 {
return poreVolume_[dofIdxGlobal]; }
217 {
return poreVolume_; }
221 {
return throatInscribedRadius_[eIdx]; }
225 {
return throatInscribedRadius_; }
229 {
return throatLength_[eIdx]; }
233 {
return throatLength_; }
237 {
return throatLabel_[eIdx]; }
241 {
return throatLabel_; }
245 {
return coordinationNumber_[dofIdxGlobal]; }
249 {
return coordinationNumber_; }
262 const auto poreGeo = poreGeometry_[0];
263 poreGeometry_.resize(poreInscribedRadius_.size(), poreGeo);
266 return poreGeometry_;
280 const auto throatShape = throatGeometry_[0];
281 throatGeometry_.resize(throatInscribedRadius_.size(), throatShape);
284 return throatGeometry_;
289 {
return throatCrossSectionalArea_[eIdx]; }
293 {
return throatCrossSectionalArea_; }
307 throatShapeFactor_.resize(throatInscribedRadius_.size(),
shapeFactor);
310 return throatShapeFactor_;
315 {
return useSameGeometryForAllPores_; }
319 {
return useSameShapeForAllThroats_; }
324 template<
class Gr
idData>
327 static const auto poreGeometryIdx = gridData.
parameterIndex(
"PoreGeometry");
328 using T = std::underlying_type_t<Pore::Shape>;
329 const auto poreGeometryValue =
static_cast<T
>(gridData.
parameters(vertex)[poreGeometryIdx]);
330 return static_cast<Pore::Shape>(poreGeometryValue);
334 template<
class Gr
idData>
335 Scalar getPoreVolume_(
const GridData& gridData,
const Vertex& vertex,
const std::size_t vIdx)
const
337 static const bool gridHasPoreVolume = gridData.gridHasVertexParameter(
"PoreVolume");
339 if (gridHasPoreVolume)
341 static const auto poreVolumeIdx = gridData.parameterIndex(
"PoreVolume");
342 return gridData.
parameters(vertex)[poreVolumeIdx];
348 static const Scalar fixedHeight = getParamFromGroup<Scalar>(gridData.paramGroup(),
"Grid.PoreHeight", -1.0);
349 const Scalar h = fixedHeight > 0.0 ? fixedHeight : gridData.
getParameter(vertex,
"PoreHeight");
358 template<
class Gr
idData>
359 Scalar getThroatCrossSectionalArea_(
const GridData& gridData,
const Element& element,
const std::size_t eIdx)
const
361 static const bool gridHasThroatCrossSectionalArea = gridData.gridHasElementParameter(
"ThroatCrossSectionalArea");
362 if (gridHasThroatCrossSectionalArea && !overwriteGridDataWithShapeSpecificValues_)
364 static const auto throatAreaIdx = gridData.parameterIndex(
"ThroatCrossSectionalArea");
365 return gridData.parameters(element)[throatAreaIdx];
371 static const auto throatHeight = getParamFromGroup<Scalar>(gridData.paramGroup(),
"Grid.ThroatHeight");
380 template<
class Gr
idData>
381 Scalar getThroatShapeFactor_(
const GridData& gridData,
const Element& element,
const std::size_t eIdx)
const
383 static const bool gridHasThroatShapeFactor = gridData.gridHasElementParameter(
"ThroatShapeFactor");
384 if (gridHasThroatShapeFactor && !overwriteGridDataWithShapeSpecificValues_)
386 static const auto throatShapeFactorIdx = gridData.parameterIndex(
"ThroatShapeFactor");
387 return gridData.parameters(element)[throatShapeFactorIdx];
393 static const auto throatHeight = getParamFromGroup<Scalar>(gridData.paramGroup(),
"Grid.ThroatHeight");
398 static const auto shapeFactor = getParamFromGroup<Scalar>(gridData.paramGroup(),
"Grid.ThroatShapeFactor");
402 return Throat::shapeFactor<Scalar>(
shape, throatInscribedRadius_[eIdx]);
406 void maybeResizeContainers_()
410 std::adjacent_find(throatGeometry_.begin(), throatGeometry_.end(), std::not_equal_to<Throat::Shape>() ) == throatGeometry_.end())
412 std::cout <<
"All throats feature the same shape, resizing containers" << std::endl;
413 useSameShapeForAllThroats_ =
true;
415 const auto throatGeometry = throatGeometry_[0];
416 throatShapeFactor_.resize(1);
417 throatGeometry_.resize(1);
419 throatGeometry_[0] = throatGeometry;
424 std::adjacent_find(poreGeometry_.begin(), poreGeometry_.end(), std::not_equal_to<Pore::Shape>() ) == poreGeometry_.end())
426 std::cout <<
"All pores feature the same shape, resizing containers" << std::endl;
427 useSameGeometryForAllPores_ =
true;
429 poreGeometry_.resize(1);
434 mutable std::vector<Pore::Shape> poreGeometry_;
435 std::vector<Scalar> poreInscribedRadius_;
436 std::vector<Scalar> poreVolume_;
437 std::vector<Label> poreLabel_;
438 std::vector<SmallLocalIndex> coordinationNumber_;
439 mutable std::vector<Throat::Shape> throatGeometry_;
440 mutable std::vector<Scalar> throatShapeFactor_;
441 std::vector<Scalar> throatInscribedRadius_;
442 std::vector<Scalar> throatLength_;
443 std::vector<Label> throatLabel_;
444 std::vector<Scalar> throatCrossSectionalArea_;
445 bool useSameGeometryForAllPores_;
446 bool useSameShapeForAllThroats_;
447 bool overwriteGridDataWithShapeSpecificValues_;
455template<
class Gr
idView,
class MapperTraits = DefaultMapperTraits<Gr
idView>>
462 template<
class Gr
idGeometry,
bool enableCache>
473template<
class Scalar,
475 bool enableGridGeometryCache =
false,
484template<
class Scalar,
class GV,
class Traits>
487,
public Traits::PNMData
493 using PNMData =
typename Traits::PNMData;
495 using Element =
typename GV::template Codim<0>::Entity;
496 using CoordScalar =
typename GV::ctype;
497 static const int dim = GV::dimension;
498 static const int dimWorld = GV::dimensionworld;
516 using FeCache = Dune::LagrangeLocalFiniteElementCache<CoordScalar, Scalar, dim, 1>;
521 template<
class Gr
idData>
525 static_assert(GridView::dimension == 1,
"Porenetwork model only allow GridView::dimension == 1!");
532 {
return this->vertexMapper(); }
549 {
return this->vertexMapper().size(); }
552 template<
class Gr
idData>
555 ParentType::update(gridView);
560 template<
class Gr
idData>
563 ParentType::update(std::move(gridView));
572 const std::array<SubControlVolume, 2>&
scvs(GridIndexType eIdx)
const
573 {
return scvs_[eIdx]; }
576 const std::array<SubControlVolumeFace, 1>&
scvfs(GridIndexType eIdx)
const
577 {
return scvfs_[eIdx]; }
581 {
return boundaryDofIndices_[dofIdx]; }
589 { DUNE_THROW(Dune::NotImplemented,
"Periodic boundaries"); }
592 [[deprecated(
"Will be removed after release 3.9. Implement periodicDofMap() if periodic bcs are supported.")]]
594 {
return std::unordered_map<GridIndexType, GridIndexType>{}; }
598 {
return hasBoundaryScvf_[eIdx]; }
602 template<
class Gr
idData>
603 void update_(
const GridData& gridData)
605 PNMData::update(this->gridView(), gridData);
610 auto numElements = this->gridView().size(0);
611 scvs_.resize(numElements);
612 scvfs_.resize(numElements);
613 hasBoundaryScvf_.resize(numElements,
false);
615 boundaryDofIndices_.assign(numDofs(),
false);
617 numScvf_ = numElements;
618 numScv_ = 2*numElements;
621 for (
const auto& element : elements(this->gridView()))
624 auto eIdx = this->elementMapper().index(element);
625 auto elementGeometry = element.geometry();
628 for (LocalIndexType scvLocalIdx = 0; scvLocalIdx < elementGeometry.corners(); ++scvLocalIdx)
630 const auto dofIdxGlobal = this->vertexMapper().subIndex(element, scvLocalIdx, dim);
633 auto corners = std::array{elementGeometry.corner(scvLocalIdx), elementGeometry.center()};
636 const auto volume = this->poreVolume(dofIdxGlobal) / this->coordinationNumber(dofIdxGlobal);
638 scvs_[eIdx][scvLocalIdx] = SubControlVolume(dofIdxGlobal,
644 if (this->poreLabel(dofIdxGlobal) > 0)
646 if (boundaryDofIndices_[dofIdxGlobal])
649 boundaryDofIndices_[dofIdxGlobal] =
true;
650 hasBoundaryScvf_[eIdx] =
true;
655 auto unitOuterNormal = elementGeometry.corner(1)-elementGeometry.corner(0);
656 unitOuterNormal /= unitOuterNormal.two_norm();
657 LocalIndexType scvfLocalIdx = 0;
658 scvfs_[eIdx][0] = SubControlVolumeFace(elementGeometry.center(),
659 std::move(unitOuterNormal),
660 this->throatCrossSectionalArea(this->elementMapper().index(element)),
662 std::array<LocalIndexType, 2>({0, 1}));
666 const FeCache feCache_;
668 std::vector<std::array<SubControlVolume, 2>> scvs_;
669 std::vector<std::array<SubControlVolumeFace, 1>> scvfs_;
672 std::size_t numScvf_;
675 std::vector<bool> boundaryDofIndices_;
676 std::vector<bool> hasBoundaryScvf_;
685template<
class Scalar,
class GV,
class Traits>
688,
public Traits::PNMData
694 using PNMData =
typename Traits::PNMData;
696 static const int dim = GV::dimension;
697 static const int dimWorld = GV::dimensionworld;
699 using Element =
typename GV::template Codim<0>::Entity;
700 using CoordScalar =
typename GV::ctype;
718 using FeCache = Dune::LagrangeLocalFiniteElementCache<CoordScalar, Scalar, dim, 1>;
723 template<
class Gr
idData>
727 static_assert(GridView::dimension == 1,
"Porenetwork model only allow GridView::dimension == 1!");
735 {
return this->vertexMapper(); }
752 {
return this->vertexMapper().size(); }
755 template<
class Gr
idData>
758 ParentType::update(gridView);
763 template<
class Gr
idData>
766 ParentType::update(std::move(gridView));
776 {
return boundaryDofIndices_[dofIdx]; }
784 { DUNE_THROW(Dune::NotImplemented,
"Periodic boundaries"); }
787 [[deprecated(
"Will be removed after release 3.9. Implement periodicDofMap() if periodic bcs are supported.")]]
789 {
return std::unordered_map<GridIndexType, GridIndexType>{}; }
793 template<
class Gr
idData>
794 void update_(
const GridData& gridData)
796 PNMData::update(this->gridView(), gridData);
798 boundaryDofIndices_.assign(numDofs(),
false);
801 numScvf_ = this->gridView().size(0);
802 numScv_ = 2*numScvf_;
804 for (
const auto& element : elements(this->gridView()))
807 for (LocalIndexType vIdxLocal = 0; vIdxLocal < 2; ++vIdxLocal)
809 const auto vIdxGlobal = this->vertexMapper().subIndex(element, vIdxLocal, dim);
810 if (this->poreLabel(vIdxGlobal) > 0)
812 if (boundaryDofIndices_[vIdxGlobal])
815 boundaryDofIndices_[vIdxGlobal] =
true;
821 const FeCache feCache_;
825 std::size_t numScvf_;
828 std::vector<bool> boundaryDofIndices_;
Base class for grid geometries.
Base class for all grid geometries.
Definition: basegridgeometry.hh:52
typename BaseImplementation::GridView GridView
export the grid view type
Definition: basegridgeometry.hh:60
Class for grid data attached to dgf or gmsh grid files.
Definition: griddata.hh:55
double getParameter(const Element &element, const std::string &fieldName) const
Get an element parameter.
Definition: griddata.hh:242
const std::vector< double > & parameters(const Vertex &vertex) const
Call the parameters function of the DGF grid pointer if available for vertex data.
Definition: griddata.hh:102
Base class for geometry data extraction from the grid data format.
Definition: discretization/porenetwork/gridgeometry.hh:44
Scalar throatCrossSectionalArea(const GridIndex eIdx) const
Returns the throat's cross-sectional area.
Definition: discretization/porenetwork/gridgeometry.hh:288
const std::vector< Scalar > & poreVolume() const
Returns the vector of pore volumes.
Definition: discretization/porenetwork/gridgeometry.hh:216
const std::vector< Scalar > & throatInscribedRadius() const
Returns the vector of inscribed throat radii.
Definition: discretization/porenetwork/gridgeometry.hh:224
bool useSameGeometryForAllPores() const
Returns whether all pores feature the same shape.
Definition: discretization/porenetwork/gridgeometry.hh:314
const std::vector< Label > & poreLabel() const
Returns the vector of pore labels.
Definition: discretization/porenetwork/gridgeometry.hh:200
bool useSameShapeForAllThroats() const
Returns whether all throats feature the same cross-sectional shape.
Definition: discretization/porenetwork/gridgeometry.hh:318
SmallLocalIndex coordinationNumber(const GridIndex dofIdxGlobal) const
Returns the number of throats connected to a pore (coordination number)
Definition: discretization/porenetwork/gridgeometry.hh:244
void update(const GridView &gridView, const GridData &gridData)
Definition: discretization/porenetwork/gridgeometry.hh:56
const std::vector< SmallLocalIndex > & coordinationNumber() const
Returns the vector of coordination numbers.
Definition: discretization/porenetwork/gridgeometry.hh:248
const std::vector< Scalar > & throatShapeFactor() const
Returns the vector of throat shape factors.
Definition: discretization/porenetwork/gridgeometry.hh:300
const std::vector< Scalar > & throatCrossSectionalArea() const
Returns the vector of throat cross-sectional areas.
Definition: discretization/porenetwork/gridgeometry.hh:292
Pore::Shape poreGeometry(const GridIndex vIdx) const
the geometry of the pore
Definition: discretization/porenetwork/gridgeometry.hh:252
Throat::Shape throatCrossSectionShape(const GridIndex eIdx) const
Returns the throat's cross-sectional shape.
Definition: discretization/porenetwork/gridgeometry.hh:270
Label throatLabel(const GridIndex eIdx) const
Returns an index indicating if a throat is touching the domain boundary.
Definition: discretization/porenetwork/gridgeometry.hh:236
const std::vector< Label > & throatLabel() const
Returns the vector of throat labels.
Definition: discretization/porenetwork/gridgeometry.hh:240
Scalar throatLength(const GridIndex eIdx) const
Returns the length of the throat.
Definition: discretization/porenetwork/gridgeometry.hh:228
const std::vector< Throat::Shape > & throatCrossSectionShape() const
Returns the vector of cross-sectional shapes.
Definition: discretization/porenetwork/gridgeometry.hh:274
Scalar poreVolume(const GridIndex dofIdxGlobal) const
Returns the volume of the pore.
Definition: discretization/porenetwork/gridgeometry.hh:212
Scalar throatInscribedRadius(const GridIndex eIdx) const
Returns the inscribed radius of the throat.
Definition: discretization/porenetwork/gridgeometry.hh:220
Label poreLabel(const GridIndex dofIdxGlobal) const
Returns the pore label (e.g. used for setting BCs)
Definition: discretization/porenetwork/gridgeometry.hh:196
Scalar poreInscribedRadius(const GridIndex dofIdxGlobal) const
Returns the inscribed radius of the pore.
Definition: discretization/porenetwork/gridgeometry.hh:204
const std::vector< Scalar > & throatLength() const
Returns the vector of throat lengths.
Definition: discretization/porenetwork/gridgeometry.hh:232
const std::vector< Pore::Shape > & poreGeometry() const
Returns the vector of pore geometries.
Definition: discretization/porenetwork/gridgeometry.hh:256
Scalar throatShapeFactor(const GridIndex eIdx) const
Returns the throat's shape factor.
Definition: discretization/porenetwork/gridgeometry.hh:296
const std::vector< Scalar > & poreInscribedRadius() const
Returns the vector of inscribed pore radii.
Definition: discretization/porenetwork/gridgeometry.hh:208
Class for grid data attached to dgf or gmsh grid files.
Definition: porenetwork/griddata.hh:44
bool gridHasElementParameter(const std::string ¶m) const
Return if a given element parameter is provided by the grid.
Definition: porenetwork/griddata.hh:254
std::vector< SmallLocalIndex > getCoordinationNumbers() const
Returns the coordination numbers for all pore bodies.
Definition: porenetwork/griddata.hh:139
int parameterIndex(const std::string ¶mName) const
Return the index for a given parameter name.
Definition: porenetwork/griddata.hh:222
const std::string & paramGroup() const
Return the parameter group.
Definition: porenetwork/griddata.hh:248
const std::vector< double > & parameters(const Vertex &vertex) const
Call the parameters function of the DGF grid pointer if available for vertex data.
Definition: porenetwork/griddata.hh:86
Base class for the finite volume geometry for porenetwork models.
Definition: discretization/porenetwork/gridgeometry.hh:689
bool dofOnBoundary(GridIndexType dofIdx) const
If a vertex / d.o.f. is on the boundary.
Definition: discretization/porenetwork/gridgeometry.hh:775
Dune::LagrangeLocalFiniteElementCache< CoordScalar, Scalar, dim, 1 > FeCache
export the finite element cache type
Definition: discretization/porenetwork/gridgeometry.hh:718
std::size_t numDofs() const
The total number of degrees of freedom.
Definition: discretization/porenetwork/gridgeometry.hh:751
std::size_t numBoundaryScvf() const
Definition: discretization/porenetwork/gridgeometry.hh:747
void update(GridView &&gridView, const GridData &gridData)
update all fvElementGeometries (call this after grid adaption)
Definition: discretization/porenetwork/gridgeometry.hh:764
void update(const GridView &gridView, const GridData &gridData)
update all fvElementGeometries (call this after grid adaption)
Definition: discretization/porenetwork/gridgeometry.hh:756
std::size_t numScv() const
The total number of sub control volumes.
Definition: discretization/porenetwork/gridgeometry.hh:738
typename Traits::VertexMapper DofMapper
export dof mapper type
Definition: discretization/porenetwork/gridgeometry.hh:716
GridGeometry(const GridView &gridView, const GridData &gridData)
Constructor.
Definition: discretization/porenetwork/gridgeometry.hh:724
const FeCache & feCache() const
The finite element cache for creating local FE bases.
Definition: discretization/porenetwork/gridgeometry.hh:771
typename Traits::SubControlVolumeFace SubControlVolumeFace
export the type of sub control volume
Definition: discretization/porenetwork/gridgeometry.hh:712
std::unordered_map< GridIndexType, GridIndexType > periodicVertexMap() const
Returns the map between dofs across periodic boundaries.
Definition: discretization/porenetwork/gridgeometry.hh:788
Extrusion_t< Traits > Extrusion
export the type of extrusion
Definition: discretization/porenetwork/gridgeometry.hh:714
std::size_t numScvf() const
The total number of sun control volume faces.
Definition: discretization/porenetwork/gridgeometry.hh:742
typename Traits::SubControlVolume SubControlVolume
export the type of sub control volume
Definition: discretization/porenetwork/gridgeometry.hh:710
typename Traits::template LocalView< ThisType, false > LocalView
export the type of the fv element geometry (the local view type)
Definition: discretization/porenetwork/gridgeometry.hh:708
const DofMapper & dofMapper() const
Definition: discretization/porenetwork/gridgeometry.hh:734
GridIndexType periodicallyMappedDof(GridIndexType dofIdx) const
The index of the vertex / d.o.f. on the other side of the periodic boundary.
Definition: discretization/porenetwork/gridgeometry.hh:783
bool dofOnPeriodicBoundary(GridIndexType dofIdx) const
If a vertex / d.o.f. is on a periodic boundary (not implemented)
Definition: discretization/porenetwork/gridgeometry.hh:779
Base class for the finite volume geometry for porenetwork models.
Definition: discretization/porenetwork/gridgeometry.hh:488
Dune::LagrangeLocalFiniteElementCache< CoordScalar, Scalar, dim, 1 > FeCache
export the finite element cache type
Definition: discretization/porenetwork/gridgeometry.hh:516
std::size_t numDofs() const
The total number of degrees of freedom.
Definition: discretization/porenetwork/gridgeometry.hh:548
const std::array< SubControlVolume, 2 > & scvs(GridIndexType eIdx) const
Get the local scvs for an element.
Definition: discretization/porenetwork/gridgeometry.hh:572
GridIndexType periodicallyMappedDof(GridIndexType dofIdx) const
The index of the vertex / d.o.f. on the other side of the periodic boundary.
Definition: discretization/porenetwork/gridgeometry.hh:588
std::unordered_map< GridIndexType, GridIndexType > periodicVertexMap() const
Returns the map between dofs across periodic boundaries.
Definition: discretization/porenetwork/gridgeometry.hh:593
typename Traits::SubControlVolumeFace SubControlVolumeFace
export the type of sub control volume
Definition: discretization/porenetwork/gridgeometry.hh:510
const DofMapper & dofMapper() const
Definition: discretization/porenetwork/gridgeometry.hh:531
std::size_t numScv() const
The total number of sub control volumes.
Definition: discretization/porenetwork/gridgeometry.hh:535
bool dofOnPeriodicBoundary(GridIndexType dofIdx) const
If a vertex / d.o.f. is on a periodic boundary (not implemented)
Definition: discretization/porenetwork/gridgeometry.hh:584
bool dofOnBoundary(GridIndexType dofIdx) const
If a vertex / d.o.f. is on the boundary.
Definition: discretization/porenetwork/gridgeometry.hh:580
typename Traits::SubControlVolume SubControlVolume
export the type of sub control volume
Definition: discretization/porenetwork/gridgeometry.hh:508
typename Traits::template LocalView< ThisType, true > LocalView
export the type of the fv element geometry (the local view type)
Definition: discretization/porenetwork/gridgeometry.hh:506
std::size_t numScvf() const
The total number of sun control volume faces.
Definition: discretization/porenetwork/gridgeometry.hh:539
Extrusion_t< Traits > Extrusion
export the type of extrusion
Definition: discretization/porenetwork/gridgeometry.hh:512
const std::array< SubControlVolumeFace, 1 > & scvfs(GridIndexType eIdx) const
Get the local scvfs for an element.
Definition: discretization/porenetwork/gridgeometry.hh:576
std::size_t numBoundaryScvf() const
Definition: discretization/porenetwork/gridgeometry.hh:544
void update(const GridView &gridView, const GridData &gridData)
update all fvElementGeometries (call this after grid adaption)
Definition: discretization/porenetwork/gridgeometry.hh:553
const FeCache & feCache() const
The finite element cache for creating local FE bases.
Definition: discretization/porenetwork/gridgeometry.hh:568
typename Traits::VertexMapper DofMapper
export dof mapper type
Definition: discretization/porenetwork/gridgeometry.hh:514
bool hasBoundaryScvf(GridIndexType eIdx) const
Returns whether one of the geometry's scvfs lies on a boundary.
Definition: discretization/porenetwork/gridgeometry.hh:597
GridGeometry(const GridView &gridView, const GridData &gridData)
Constructor.
Definition: discretization/porenetwork/gridgeometry.hh:522
void update(GridView &&gridView, const GridData &gridData)
update all fvElementGeometries (call this after grid adaption)
Definition: discretization/porenetwork/gridgeometry.hh:561
Base class for the finite volume geometry for porenetwork models.
Definition: discretization/porenetwork/gridgeometry.hh:477
Base class for the local geometry for porenetworks.
Definition: discretization/porenetwork/fvelementgeometry.hh:33
Class for a sub control volume face for porenetworks.
Definition: discretization/porenetwork/subcontrolvolumeface.hh:53
the sub control volume for porenetworks
Definition: discretization/porenetwork/subcontrolvolume.hh:52
Defines the default element and vertex mapper types.
Base class for the local geometry for porenetworks.
the sub control volume for pore networks
Base class for a sub control volume face.
Helper classes to compute the integration elements.
auto volume(const Geometry &geo, unsigned int integrationOrder=4)
The volume of a given geometry.
Definition: volume.hh:159
bool hasParamInGroup(const std::string ¶mGroup, const std::string ¶m)
Check whether a key exists in the parameter tree with a model group prefix.
Definition: parameters.hh:165
The available discretization methods in Dumux.
CVFE< CVFEMethods::PQ1 > Box
Definition: method.hh:94
Shape shapeFromString(const std::string &s)
Get the shape from a string description of the shape.
Definition: poreproperties.hh:44
Scalar volume(Shape shape, Scalar inscribedRadius)
Returns the volume of a given geometry based on the inscribed radius.
Definition: poreproperties.hh:61
Shape
Collection of different pore-body shapes.
Definition: poreproperties.hh:23
constexpr Scalar totalCrossSectionalAreaForRectangle(const Scalar inscribedRadius, const Scalar height) noexcept
Returns the cross-sectional area of a rectangle.
Definition: throatproperties.hh:214
constexpr Shape shape(const Scalar shapeFactor) noexcept
Returns the shape for a given shape factor.
Definition: throatproperties.hh:165
constexpr Scalar shapeFactorRectangle(const Scalar inscribedRadius, const Scalar height) noexcept
Returns the value of the shape factor for a rectangle.
Definition: throatproperties.hh:132
Scalar totalCrossSectionalArea(const Shape shape, const Scalar inscribedRadius)
Returns the cross-sectional area of a given geometry.
Definition: throatproperties.hh:199
Shape shapeFromString(const std::string &s)
Get the shape from a string description of the shape.
Definition: throatproperties.hh:45
Shape
Collection of different pore-throat shapes.
Definition: throatproperties.hh:26
Scalar shapeFactor(Shape shape, const Scalar inscribedRadius)
Returns the value of the shape factor for a given shape.
Definition: throatproperties.hh:150
Definition: discretization/porenetwork/fvelementgeometry.hh:24
typename Extrusion< T >::type Extrusion_t
Convenience alias for obtaining the extrusion type.
Definition: extrusion.hh:166
The infrastructure to retrieve run-time parameters from Dune::ParameterTrees.
This file contains functions related to calculate pore-body properties.
Structure to define the index types used for grid and local indices.
Definition: indextraits.hh:26
typename GridView::IndexSet::IndexType GridIndex
Definition: indextraits.hh:27
std::uint_least8_t SmallLocalIndex
Definition: indextraits.hh:29
The default traits.
Definition: discretization/porenetwork/gridgeometry.hh:458
This file contains functions related to calculate pore-throat properties.