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"); }
593 {
return std::unordered_map<GridIndexType, GridIndexType>{}; }
597 {
return hasBoundaryScvf_[eIdx]; }
601 template<
class Gr
idData>
602 void update_(
const GridData& gridData)
604 PNMData::update(this->gridView(), gridData);
609 auto numElements = this->gridView().size(0);
610 scvs_.resize(numElements);
611 scvfs_.resize(numElements);
612 hasBoundaryScvf_.resize(numElements,
false);
614 boundaryDofIndices_.assign(numDofs(),
false);
616 numScvf_ = numElements;
617 numScv_ = 2*numElements;
620 for (
const auto& element : elements(this->gridView()))
623 auto eIdx = this->elementMapper().index(element);
624 auto elementGeometry = element.geometry();
627 for (LocalIndexType scvLocalIdx = 0; scvLocalIdx < elementGeometry.corners(); ++scvLocalIdx)
629 const auto dofIdxGlobal = this->vertexMapper().subIndex(element, scvLocalIdx, dim);
632 auto corners = std::array{elementGeometry.corner(scvLocalIdx), elementGeometry.center()};
635 const auto volume = this->poreVolume(dofIdxGlobal) / this->coordinationNumber(dofIdxGlobal);
637 scvs_[eIdx][scvLocalIdx] = SubControlVolume(dofIdxGlobal,
643 if (this->poreLabel(dofIdxGlobal) > 0)
645 if (boundaryDofIndices_[dofIdxGlobal])
648 boundaryDofIndices_[dofIdxGlobal] =
true;
649 hasBoundaryScvf_[eIdx] =
true;
654 auto unitOuterNormal = elementGeometry.corner(1)-elementGeometry.corner(0);
655 unitOuterNormal /= unitOuterNormal.two_norm();
656 LocalIndexType scvfLocalIdx = 0;
657 scvfs_[eIdx][0] = SubControlVolumeFace(elementGeometry.center(),
658 std::move(unitOuterNormal),
659 this->throatCrossSectionalArea(this->elementMapper().index(element)),
661 std::array<LocalIndexType, 2>({0, 1}));
665 const FeCache feCache_;
667 std::vector<std::array<SubControlVolume, 2>> scvs_;
668 std::vector<std::array<SubControlVolumeFace, 1>> scvfs_;
671 std::size_t numScvf_;
674 std::vector<bool> boundaryDofIndices_;
675 std::vector<bool> hasBoundaryScvf_;
684template<
class Scalar,
class GV,
class Traits>
687,
public Traits::PNMData
693 using PNMData =
typename Traits::PNMData;
695 static const int dim = GV::dimension;
696 static const int dimWorld = GV::dimensionworld;
698 using Element =
typename GV::template Codim<0>::Entity;
699 using CoordScalar =
typename GV::ctype;
717 using FeCache = Dune::LagrangeLocalFiniteElementCache<CoordScalar, Scalar, dim, 1>;
722 template<
class Gr
idData>
726 static_assert(GridView::dimension == 1,
"Porenetwork model only allow GridView::dimension == 1!");
734 {
return this->vertexMapper(); }
751 {
return this->vertexMapper().size(); }
754 template<
class Gr
idData>
757 ParentType::update(gridView);
762 template<
class Gr
idData>
765 ParentType::update(std::move(gridView));
775 {
return boundaryDofIndices_[dofIdx]; }
783 { DUNE_THROW(Dune::NotImplemented,
"Periodic boundaries"); }
787 {
return std::unordered_map<GridIndexType, GridIndexType>{}; }
791 template<
class Gr
idData>
792 void update_(
const GridData& gridData)
794 PNMData::update(this->gridView(), gridData);
796 boundaryDofIndices_.assign(numDofs(),
false);
799 numScvf_ = this->gridView().size(0);
800 numScv_ = 2*numScvf_;
802 for (
const auto& element : elements(this->gridView()))
805 for (LocalIndexType vIdxLocal = 0; vIdxLocal < 2; ++vIdxLocal)
807 const auto vIdxGlobal = this->vertexMapper().subIndex(element, vIdxLocal, dim);
808 if (this->poreLabel(vIdxGlobal) > 0)
810 if (boundaryDofIndices_[vIdxGlobal])
813 boundaryDofIndices_[vIdxGlobal] =
true;
819 const FeCache feCache_;
823 std::size_t numScvf_;
826 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:54
double getParameter(const Element &element, const std::string &fieldName) const
Get a element parameter.
Definition: griddata.hh:240
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:100
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:688
bool dofOnBoundary(GridIndexType dofIdx) const
If a vertex / d.o.f. is on the boundary.
Definition: discretization/porenetwork/gridgeometry.hh:774
Dune::LagrangeLocalFiniteElementCache< CoordScalar, Scalar, dim, 1 > FeCache
export the finite element cache type
Definition: discretization/porenetwork/gridgeometry.hh:717
std::size_t numDofs() const
The total number of degrees of freedom.
Definition: discretization/porenetwork/gridgeometry.hh:750
std::size_t numBoundaryScvf() const
Definition: discretization/porenetwork/gridgeometry.hh:746
void update(GridView &&gridView, const GridData &gridData)
update all fvElementGeometries (call this after grid adaption)
Definition: discretization/porenetwork/gridgeometry.hh:763
void update(const GridView &gridView, const GridData &gridData)
update all fvElementGeometries (call this after grid adaption)
Definition: discretization/porenetwork/gridgeometry.hh:755
std::size_t numScv() const
The total number of sub control volumes.
Definition: discretization/porenetwork/gridgeometry.hh:737
typename Traits::VertexMapper DofMapper
export dof mapper type
Definition: discretization/porenetwork/gridgeometry.hh:715
GridGeometry(const GridView &gridView, const GridData &gridData)
Constructor.
Definition: discretization/porenetwork/gridgeometry.hh:723
const FeCache & feCache() const
The finite element cache for creating local FE bases.
Definition: discretization/porenetwork/gridgeometry.hh:770
typename Traits::SubControlVolumeFace SubControlVolumeFace
export the type of sub control volume
Definition: discretization/porenetwork/gridgeometry.hh:711
std::unordered_map< GridIndexType, GridIndexType > periodicVertexMap() const
Returns the map between dofs across periodic boundaries.
Definition: discretization/porenetwork/gridgeometry.hh:786
Extrusion_t< Traits > Extrusion
export the type of extrusion
Definition: discretization/porenetwork/gridgeometry.hh:713
std::size_t numScvf() const
The total number of sun control volume faces.
Definition: discretization/porenetwork/gridgeometry.hh:741
typename Traits::SubControlVolume SubControlVolume
export the type of sub control volume
Definition: discretization/porenetwork/gridgeometry.hh:709
typename Traits::template LocalView< ThisType, false > LocalView
export the type of the fv element geometry (the local view type)
Definition: discretization/porenetwork/gridgeometry.hh:707
const DofMapper & dofMapper() const
Definition: discretization/porenetwork/gridgeometry.hh:733
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:782
bool dofOnPeriodicBoundary(GridIndexType dofIdx) const
If a vertex / d.o.f. is on a periodic boundary (not implemented)
Definition: discretization/porenetwork/gridgeometry.hh:778
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:592
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:596
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.