12#ifndef DUMUX_DISCRETIZATION_PNM_GRID_GEOMETRY_HH
13#define DUMUX_DISCRETIZATION_PNM_GRID_GEOMETRY_HH
19#include <unordered_map>
22#include <dune/common/exceptions.hh>
23#include <dune/localfunctions/lagrange/lagrangelfecache.hh>
44template<
class Scalar,
class Gr
idView>
49 using Label = std::int_least8_t;
50 using Vertex =
typename GridView::template Codim<GridView::dimension>::Entity;
51 using Element =
typename GridView::template Codim<0>::Entity;
53 static const int dim = GridView::dimension;
57 template<
class Gr
idData>
62 const auto numThroats = gridView.size(0);
63 throatInscribedRadius_.resize(numThroats);
64 throatLength_.resize(numThroats);
65 throatLabel_.resize(numThroats);
66 throatCrossSectionalArea_.resize(numThroats);
67 throatShapeFactor_.resize(numThroats);
69 useSameGeometryForAllPores_ =
true;
70 useSameShapeForAllThroats_ =
true;
71 overwriteGridDataWithShapeSpecificValues_ =
false;
78 throatGeometry_.resize(1);
79 throatGeometry_[0] = throatGeometry;
82 std::cout <<
"Using '" << throatGeometryInput <<
"' as cross-sectional shape for all throats." << std::endl;
86 std::cout <<
"Reading shape factors for throats from grid data." << std::endl;
87 useSameShapeForAllThroats_ =
false;
88 throatGeometry_.resize(numThroats);
92 const auto numPores = gridView.size(dim);
93 poreInscribedRadius_.resize(numPores);
94 poreLabel_.resize(numPores);
95 poreVolume_.resize(numPores);
101 poreGeometry_.resize(1);
104 std::cout <<
"Using '" << poreGeometryInput <<
"' as geometry for all pores." << std::endl;
108 std::cout <<
"Reading pore shapes from grid data." << std::endl;
109 useSameGeometryForAllPores_ =
false;
110 poreGeometry_.resize(numPores);
114 for (
const auto& vertex : vertices(gridView))
116 static const auto poreInscribedRadiusIdx = gridData.
parameterIndex(
"PoreInscribedRadius");
117 static const auto poreLabelIdx = gridData.
parameterIndex(
"PoreLabel");
118 const auto vIdx = gridView.indexSet().index(vertex);
119 const auto& params = gridData.
parameters(vertex);
120 poreInscribedRadius_[vIdx] = params[poreInscribedRadiusIdx];
121 assert(poreInscribedRadius_[vIdx] > 0.0);
122 poreLabel_[vIdx] = params[poreLabelIdx];
125 poreGeometry_[vIdx] = getPoreGeometry_(gridData, vertex);
127 poreVolume_[vIdx] = getPoreVolume_(gridData, vertex, vIdx);
130 for (
const auto& element : elements(gridView))
132 const int eIdx = gridView.indexSet().index(element);
133 const auto& params = gridData.
parameters(element);
134 static const auto throatInscribedRadiusIdx = gridData.
parameterIndex(
"ThroatInscribedRadius");
135 static const auto throatLengthIdx = gridData.
parameterIndex(
"ThroatLength");
136 throatInscribedRadius_[eIdx] = params[throatInscribedRadiusIdx];
137 throatLength_[eIdx] = params[throatLengthIdx];
141 if (gridHasThroatLabel)
143 static const auto throatLabelIdx = gridData.
parameterIndex(
"ThroatLabel");
144 throatLabel_[eIdx] = params[throatLabelIdx];
148 const auto vIdx0 = gridView.indexSet().subIndex(element, 0, dim);
149 const auto vIdx1 = gridView.indexSet().subIndex(element, 1, dim);
151 const auto poreLabel0 =
poreLabel(vIdx0);
152 const auto poreLabel1 =
poreLabel(vIdx1);
154 if (poreLabel0 >= 0 && poreLabel1 >= 0)
156 std::cout <<
"\n Warning: Throat "
157 << eIdx <<
" connects two boundary pores with different pore labels. Using the greater pore label as throat label.\n"
158 <<
"Set the throat labels explicitly in your grid file, if needed." << std::endl;
162 throatLabel_[eIdx] = max(poreLabel0, poreLabel1);
167 static const auto throatShapeFactorIdx = gridData.
parameterIndex(
"ThroatShapeFactor");
168 static const auto throatAreaIdx = gridData.
parameterIndex(
"ThroatCrossSectionalArea");
169 throatShapeFactor_[eIdx] = params[throatShapeFactorIdx];
170 throatGeometry_[eIdx] =
Throat::shape(throatShapeFactor_[eIdx]);
171 throatCrossSectionalArea_[eIdx] = params[throatAreaIdx];
175 throatCrossSectionalArea_[eIdx] = getThroatCrossSectionalArea_(gridData, element, eIdx);
176 throatShapeFactor_[eIdx] = getThroatShapeFactor_(gridData, element, eIdx);
179 assert(throatInscribedRadius_[eIdx] > 0.0);
180 assert(throatLength_[eIdx] > 0.0);
181 assert(throatCrossSectionalArea_[eIdx] > 0.0);
184 if (addThroatVolumeToPoreVolume)
186 for (
int vIdxLocal = 0; vIdxLocal < 2; ++vIdxLocal)
188 const auto vIdx = gridView.indexSet().subIndex(element, vIdxLocal, dim);
189 poreVolume_[vIdx] += 0.5 * throatCrossSectionalArea_[eIdx] * throatLength_[eIdx];
194 maybeResizeContainers_();
199 {
return poreLabel_[dofIdxGlobal]; }
203 {
return poreLabel_; }
207 {
return poreInscribedRadius_[dofIdxGlobal]; }
211 {
return poreInscribedRadius_; }
215 {
return poreVolume_[dofIdxGlobal]; }
219 {
return poreVolume_; }
223 {
return throatInscribedRadius_[eIdx]; }
227 {
return throatInscribedRadius_; }
231 {
return throatLength_[eIdx]; }
235 {
return throatLength_; }
239 {
return throatLabel_[eIdx]; }
243 {
return throatLabel_; }
247 {
return coordinationNumber_[dofIdxGlobal]; }
251 {
return coordinationNumber_; }
264 const auto poreGeo = poreGeometry_[0];
265 poreGeometry_.resize(poreInscribedRadius_.size(), poreGeo);
268 return poreGeometry_;
282 const auto throatShape = throatGeometry_[0];
283 throatGeometry_.resize(throatInscribedRadius_.size(), throatShape);
286 return throatGeometry_;
291 {
return throatCrossSectionalArea_[eIdx]; }
295 {
return throatCrossSectionalArea_; }
308 const auto shapeFactor = throatShapeFactor_[0];
309 throatShapeFactor_.resize(throatInscribedRadius_.size(), shapeFactor);
312 return throatShapeFactor_;
317 {
return useSameGeometryForAllPores_; }
321 {
return useSameShapeForAllThroats_; }
326 template<
class Gr
idData>
329 static const auto poreGeometryIdx = gridData.
parameterIndex(
"PoreGeometry");
330 using T = std::underlying_type_t<Pore::Shape>;
331 const auto poreGeometryValue =
static_cast<T
>(gridData.
parameters(vertex)[poreGeometryIdx]);
332 return static_cast<Pore::Shape>(poreGeometryValue);
336 template<
class Gr
idData>
337 Scalar getPoreVolume_(
const GridData& gridData,
const Vertex& vertex,
const std::size_t vIdx)
const
339 static const bool gridHasPoreVolume = gridData.gridHasVertexParameter(
"PoreVolume");
341 if (gridHasPoreVolume)
343 static const auto poreVolumeIdx = gridData.parameterIndex(
"PoreVolume");
344 return gridData.
parameters(vertex)[poreVolumeIdx];
351 const Scalar h = fixedHeight > 0.0 ? fixedHeight : gridData.
getParameter(vertex,
"PoreHeight");
360 template<
class Gr
idData>
361 Scalar getThroatCrossSectionalArea_(
const GridData& gridData,
const Element& element,
const std::size_t eIdx)
const
363 static const bool gridHasThroatCrossSectionalArea = gridData.gridHasElementParameter(
"ThroatCrossSectionalArea");
364 if (gridHasThroatCrossSectionalArea && !overwriteGridDataWithShapeSpecificValues_)
366 static const auto throatAreaIdx = gridData.parameterIndex(
"ThroatCrossSectionalArea");
367 return gridData.parameters(element)[throatAreaIdx];
382 template<
class Gr
idData>
383 Scalar getThroatShapeFactor_(
const GridData& gridData,
const Element& element,
const std::size_t eIdx)
const
385 static const bool gridHasThroatShapeFactor = gridData.gridHasElementParameter(
"ThroatShapeFactor");
386 if (gridHasThroatShapeFactor && !overwriteGridDataWithShapeSpecificValues_)
388 static const auto throatShapeFactorIdx = gridData.parameterIndex(
"ThroatShapeFactor");
389 return gridData.parameters(element)[throatShapeFactorIdx];
408 void maybeResizeContainers_()
412 std::adjacent_find(throatGeometry_.begin(), throatGeometry_.end(), std::not_equal_to<Throat::Shape>() ) == throatGeometry_.end())
414 std::cout <<
"All throats feature the same shape, resizing containers" << std::endl;
415 useSameShapeForAllThroats_ =
true;
417 const auto throatGeometry = throatGeometry_[0];
418 throatShapeFactor_.resize(1);
419 throatGeometry_.resize(1);
421 throatGeometry_[0] = throatGeometry;
426 std::adjacent_find(poreGeometry_.begin(), poreGeometry_.end(), std::not_equal_to<Pore::Shape>() ) == poreGeometry_.end())
428 std::cout <<
"All pores feature the same shape, resizing containers" << std::endl;
429 useSameGeometryForAllPores_ =
true;
431 poreGeometry_.resize(1);
436 mutable std::vector<Pore::Shape> poreGeometry_;
437 std::vector<Scalar> poreInscribedRadius_;
438 std::vector<Scalar> poreVolume_;
439 std::vector<Label> poreLabel_;
440 std::vector<SmallLocalIndex> coordinationNumber_;
441 mutable std::vector<Throat::Shape> throatGeometry_;
442 mutable std::vector<Scalar> throatShapeFactor_;
443 std::vector<Scalar> throatInscribedRadius_;
444 std::vector<Scalar> throatLength_;
445 std::vector<Label> throatLabel_;
446 std::vector<Scalar> throatCrossSectionalArea_;
447 bool useSameGeometryForAllPores_;
448 bool useSameShapeForAllThroats_;
449 bool overwriteGridDataWithShapeSpecificValues_;
457template<
class Gr
idView,
class MapperTraits = DefaultMapperTraits<Gr
idView>>
464 template<
class Gr
idGeometry,
bool enableCache>
475template<
class Scalar,
477 bool enableGridGeometryCache =
false,
486template<
class Scalar,
class GV,
class Traits>
489,
public Traits::PNMData
495 using PNMData =
typename Traits::PNMData;
497 using Element =
typename GV::template Codim<0>::Entity;
498 using CoordScalar =
typename GV::ctype;
499 static const int dim = GV::dimension;
500 static const int dimWorld = GV::dimensionworld;
518 using FeCache = Dune::LagrangeLocalFiniteElementCache<CoordScalar, Scalar, dim, 1>;
523 template<
class Gr
idData>
527 static_assert(GridView::dimension == 1,
"Porenetwork model only allow GridView::dimension == 1!");
554 template<
class Gr
idData>
562 template<
class Gr
idData>
574 const std::array<SubControlVolume, 2>&
scvs(GridIndexType eIdx)
const
575 {
return scvs_[eIdx]; }
578 const std::array<SubControlVolumeFace, 1>&
scvfs(GridIndexType eIdx)
const
579 {
return scvfs_[eIdx]; }
583 {
return boundaryDofIndices_[dofIdx]; }
590 [[deprecated(
"Will be removed after release 3.11. Use periodicallyMappedDofs, returning a range of dofs")]]
592 { DUNE_THROW(Dune::NotImplemented,
"Periodic boundaries"); }
596 { DUNE_THROW(Dune::NotImplemented,
"Periodic boundaries"); }
600 {
return hasBoundaryScvf_[eIdx]; }
604 template<
class Gr
idData>
605 void update_(
const GridData& gridData)
607 PNMData::update(this->gridView(), gridData);
612 auto numElements = this->gridView().size(0);
613 scvs_.resize(numElements);
614 scvfs_.resize(numElements);
615 hasBoundaryScvf_.resize(numElements,
false);
617 boundaryDofIndices_.assign(numDofs(),
false);
619 numScvf_ = numElements;
620 numScv_ = 2*numElements;
623 for (
const auto& element : elements(this->gridView()))
626 auto eIdx = this->elementMapper().index(element);
627 auto elementGeometry = element.geometry();
630 for (LocalIndexType scvLocalIdx = 0; scvLocalIdx < elementGeometry.corners(); ++scvLocalIdx)
632 const auto dofIdxGlobal = this->vertexMapper().subIndex(element, scvLocalIdx, dim);
635 auto corners = std::array{elementGeometry.corner(scvLocalIdx), elementGeometry.center()};
638 const auto volume = this->poreVolume(dofIdxGlobal) / this->coordinationNumber(dofIdxGlobal);
640 scvs_[eIdx][scvLocalIdx] = SubControlVolume(dofIdxGlobal,
646 if (this->poreLabel(dofIdxGlobal) > 0)
648 if (boundaryDofIndices_[dofIdxGlobal])
651 boundaryDofIndices_[dofIdxGlobal] =
true;
652 hasBoundaryScvf_[eIdx] =
true;
657 auto unitOuterNormal = elementGeometry.corner(1)-elementGeometry.corner(0);
658 unitOuterNormal /= unitOuterNormal.two_norm();
659 LocalIndexType scvfLocalIdx = 0;
660 scvfs_[eIdx][0] = SubControlVolumeFace(elementGeometry.center(),
661 std::move(unitOuterNormal),
662 this->throatCrossSectionalArea(this->elementMapper().index(element)),
664 std::array<LocalIndexType, 2>({0, 1}));
668 const FeCache feCache_;
670 std::vector<std::array<SubControlVolume, 2>> scvs_;
671 std::vector<std::array<SubControlVolumeFace, 1>> scvfs_;
674 std::size_t numScvf_;
677 std::vector<bool> boundaryDofIndices_;
678 std::vector<bool> hasBoundaryScvf_;
687template<
class Scalar,
class GV,
class Traits>
690,
public Traits::PNMData
696 using PNMData =
typename Traits::PNMData;
698 static const int dim = GV::dimension;
699 static const int dimWorld = GV::dimensionworld;
701 using Element =
typename GV::template Codim<0>::Entity;
702 using CoordScalar =
typename GV::ctype;
720 using FeCache = Dune::LagrangeLocalFiniteElementCache<CoordScalar, Scalar, dim, 1>;
725 template<
class Gr
idData>
729 static_assert(GridView::dimension == 1,
"Porenetwork model only allow GridView::dimension == 1!");
757 template<
class Gr
idData>
765 template<
class Gr
idData>
778 {
return boundaryDofIndices_[dofIdx]; }
785 [[deprecated(
"Will be removed after release 3.11. Use periodicallyMappedDofs, returning a range of dofs")]]
787 { DUNE_THROW(Dune::NotImplemented,
"Periodic boundaries"); }
791 { DUNE_THROW(Dune::NotImplemented,
"Periodic boundaries"); }
795 template<
class Gr
idData>
796 void update_(
const GridData& gridData)
798 PNMData::update(this->gridView(), gridData);
800 boundaryDofIndices_.assign(numDofs(),
false);
803 numScvf_ = this->gridView().size(0);
804 numScv_ = 2*numScvf_;
806 for (
const auto& element : elements(this->gridView()))
809 for (LocalIndexType vIdxLocal = 0; vIdxLocal < 2; ++vIdxLocal)
811 const auto vIdxGlobal = this->vertexMapper().subIndex(element, vIdxLocal, dim);
812 if (this->poreLabel(vIdxGlobal) > 0)
814 if (boundaryDofIndices_[vIdxGlobal])
817 boundaryDofIndices_[vIdxGlobal] =
true;
823 const FeCache feCache_;
827 std::size_t numScvf_;
830 std::vector<bool> boundaryDofIndices_;
Base class for grid geometries.
const VertexMapper & vertexMapper() const
Returns the mapper for vertices to indices for constant grids.
Definition basegridgeometry.hh:106
const GridView & gridView() const
Return the gridView this grid geometry object lives on.
Definition basegridgeometry.hh:100
void update(const GridView &gridView)
Update all fvElementGeometries (call this after grid adaption).
Definition basegridgeometry.hh:88
Class for grid data attached to dgf or gmsh grid files.
Definition griddata.hh:57
double getParameter(const Element &element, const std::string &fieldName) const
Get an element parameter.
Definition griddata.hh:254
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:114
Base class for geometry data extraction from the grid data format.
Definition discretization/porenetwork/gridgeometry.hh:46
Scalar throatCrossSectionalArea(const GridIndex eIdx) const
Returns the throat's cross-sectional area.
Definition discretization/porenetwork/gridgeometry.hh:290
const std::vector< Scalar > & poreVolume() const
Returns the vector of pore volumes.
Definition discretization/porenetwork/gridgeometry.hh:218
const std::vector< Scalar > & throatInscribedRadius() const
Returns the vector of inscribed throat radii.
Definition discretization/porenetwork/gridgeometry.hh:226
bool useSameGeometryForAllPores() const
Returns whether all pores feature the same shape.
Definition discretization/porenetwork/gridgeometry.hh:316
const std::vector< Label > & poreLabel() const
Returns the vector of pore labels.
Definition discretization/porenetwork/gridgeometry.hh:202
bool useSameShapeForAllThroats() const
Returns whether all throats feature the same cross-sectional shape.
Definition discretization/porenetwork/gridgeometry.hh:320
SmallLocalIndex coordinationNumber(const GridIndex dofIdxGlobal) const
Returns the number of throats connected to a pore (coordination number).
Definition discretization/porenetwork/gridgeometry.hh:246
void update(const GridView &gridView, const GridData &gridData)
Definition discretization/porenetwork/gridgeometry.hh:58
const std::vector< SmallLocalIndex > & coordinationNumber() const
Returns the vector of coordination numbers.
Definition discretization/porenetwork/gridgeometry.hh:250
const std::vector< Scalar > & throatShapeFactor() const
Returns the vector of throat shape factors.
Definition discretization/porenetwork/gridgeometry.hh:302
const std::vector< Scalar > & throatCrossSectionalArea() const
Returns the vector of throat cross-sectional areas.
Definition discretization/porenetwork/gridgeometry.hh:294
Pore::Shape poreGeometry(const GridIndex vIdx) const
the geometry of the pore
Definition discretization/porenetwork/gridgeometry.hh:254
Throat::Shape throatCrossSectionShape(const GridIndex eIdx) const
Returns the throat's cross-sectional shape.
Definition discretization/porenetwork/gridgeometry.hh:272
Label throatLabel(const GridIndex eIdx) const
Returns an index indicating if a throat is touching the domain boundary.
Definition discretization/porenetwork/gridgeometry.hh:238
const std::vector< Label > & throatLabel() const
Returns the vector of throat labels.
Definition discretization/porenetwork/gridgeometry.hh:242
Scalar throatLength(const GridIndex eIdx) const
Returns the length of the throat.
Definition discretization/porenetwork/gridgeometry.hh:230
const std::vector< Throat::Shape > & throatCrossSectionShape() const
Returns the vector of cross-sectional shapes.
Definition discretization/porenetwork/gridgeometry.hh:276
Scalar poreVolume(const GridIndex dofIdxGlobal) const
Returns the volume of the pore.
Definition discretization/porenetwork/gridgeometry.hh:214
Scalar throatInscribedRadius(const GridIndex eIdx) const
Returns the inscribed radius of the throat.
Definition discretization/porenetwork/gridgeometry.hh:222
Label poreLabel(const GridIndex dofIdxGlobal) const
Returns the pore label (e.g. used for setting BCs).
Definition discretization/porenetwork/gridgeometry.hh:198
Scalar poreInscribedRadius(const GridIndex dofIdxGlobal) const
Returns the inscribed radius of the pore.
Definition discretization/porenetwork/gridgeometry.hh:206
const std::vector< Scalar > & throatLength() const
Returns the vector of throat lengths.
Definition discretization/porenetwork/gridgeometry.hh:234
const std::vector< Pore::Shape > & poreGeometry() const
Returns the vector of pore geometries.
Definition discretization/porenetwork/gridgeometry.hh:258
Scalar throatShapeFactor(const GridIndex eIdx) const
Returns the throat's shape factor.
Definition discretization/porenetwork/gridgeometry.hh:298
const std::vector< Scalar > & poreInscribedRadius() const
Returns the vector of inscribed pore radii.
Definition discretization/porenetwork/gridgeometry.hh:210
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
bool dofOnBoundary(GridIndexType dofIdx) const
If a vertex / d.o.f. is on the boundary.
Definition discretization/porenetwork/gridgeometry.hh:777
Dune::LagrangeLocalFiniteElementCache< CoordScalar, Scalar, dim, 1 > FeCache
export the finite element cache type
Definition discretization/porenetwork/gridgeometry.hh:720
static constexpr DiscretizationMethod discMethod
Definition discretization/porenetwork/gridgeometry.hh:707
std::size_t numDofs() const
The total number of degrees of freedom.
Definition discretization/porenetwork/gridgeometry.hh:753
std::size_t numBoundaryScvf() const
Definition discretization/porenetwork/gridgeometry.hh:749
void update(GridView &&gridView, const GridData &gridData)
update all fvElementGeometries (call this after grid adaption)
Definition discretization/porenetwork/gridgeometry.hh:766
void update(const GridView &gridView, const GridData &gridData)
update all fvElementGeometries (call this after grid adaption)
Definition discretization/porenetwork/gridgeometry.hh:758
std::size_t numScv() const
The total number of sub control volumes.
Definition discretization/porenetwork/gridgeometry.hh:740
typename Traits::VertexMapper DofMapper
export dof mapper type
Definition discretization/porenetwork/gridgeometry.hh:718
GridGeometry(const GridView &gridView, const GridData &gridData)
Constructor.
Definition discretization/porenetwork/gridgeometry.hh:726
const FeCache & feCache() const
The finite element cache for creating local FE bases.
Definition discretization/porenetwork/gridgeometry.hh:773
typename Traits::SubControlVolumeFace SubControlVolumeFace
export the type of sub control volume
Definition discretization/porenetwork/gridgeometry.hh:714
Extrusion_t< Traits > Extrusion
export the type of extrusion
Definition discretization/porenetwork/gridgeometry.hh:716
std::size_t numScvf() const
The total number of sun control volume faces.
Definition discretization/porenetwork/gridgeometry.hh:744
typename Traits::SubControlVolume SubControlVolume
export the type of sub control volume
Definition discretization/porenetwork/gridgeometry.hh:712
typename Traits::template LocalView< ThisType, false > LocalView
export the type of the fv element geometry (the local view type)
Definition discretization/porenetwork/gridgeometry.hh:710
const DofMapper & dofMapper() const
Definition discretization/porenetwork/gridgeometry.hh:736
GV GridView
export the grid view type
Definition discretization/porenetwork/gridgeometry.hh:722
DiscretizationMethods::Box DiscretizationMethod
export the discretization method this geometry belongs to
Definition discretization/porenetwork/gridgeometry.hh:706
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:786
std::span< const GridIndexType > periodicallyMappedDofs(GridIndexType dofIdx) const
The indices of the vertices / d.o.f.s on the other side of the periodic boundary.
Definition discretization/porenetwork/gridgeometry.hh:790
bool dofOnPeriodicBoundary(GridIndexType dofIdx) const
If a vertex / d.o.f. is on a periodic boundary (not implemented).
Definition discretization/porenetwork/gridgeometry.hh:781
Dune::LagrangeLocalFiniteElementCache< CoordScalar, Scalar, dim, 1 > FeCache
export the finite element cache type
Definition discretization/porenetwork/gridgeometry.hh:518
std::size_t numDofs() const
The total number of degrees of freedom.
Definition discretization/porenetwork/gridgeometry.hh:550
const std::array< SubControlVolume, 2 > & scvs(GridIndexType eIdx) const
Get the local scvs for an element.
Definition discretization/porenetwork/gridgeometry.hh:574
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:591
DiscretizationMethods::Box DiscretizationMethod
export the discretization method this geometry belongs to
Definition discretization/porenetwork/gridgeometry.hh:504
typename Traits::SubControlVolumeFace SubControlVolumeFace
export the type of sub control volume
Definition discretization/porenetwork/gridgeometry.hh:512
const DofMapper & dofMapper() const
Definition discretization/porenetwork/gridgeometry.hh:533
std::size_t numScv() const
The total number of sub control volumes.
Definition discretization/porenetwork/gridgeometry.hh:537
bool dofOnPeriodicBoundary(GridIndexType dofIdx) const
If a vertex / d.o.f. is on a periodic boundary (not implemented).
Definition discretization/porenetwork/gridgeometry.hh:586
bool dofOnBoundary(GridIndexType dofIdx) const
If a vertex / d.o.f. is on the boundary.
Definition discretization/porenetwork/gridgeometry.hh:582
std::span< const GridIndexType > periodicallyMappedDofs(GridIndexType dofIdx) const
The indices of the vertices / d.o.f.s on the other side of the periodic boundary.
Definition discretization/porenetwork/gridgeometry.hh:595
typename Traits::SubControlVolume SubControlVolume
export the type of sub control volume
Definition discretization/porenetwork/gridgeometry.hh:510
typename Traits::template LocalView< ThisType, true > LocalView
export the type of the fv element geometry (the local view type)
Definition discretization/porenetwork/gridgeometry.hh:508
GV GridView
export the grid view type
Definition discretization/porenetwork/gridgeometry.hh:520
std::size_t numScvf() const
The total number of sun control volume faces.
Definition discretization/porenetwork/gridgeometry.hh:541
Extrusion_t< Traits > Extrusion
export the type of extrusion
Definition discretization/porenetwork/gridgeometry.hh:514
const std::array< SubControlVolumeFace, 1 > & scvfs(GridIndexType eIdx) const
Get the local scvfs for an element.
Definition discretization/porenetwork/gridgeometry.hh:578
std::size_t numBoundaryScvf() const
Definition discretization/porenetwork/gridgeometry.hh:546
void update(const GridView &gridView, const GridData &gridData)
update all fvElementGeometries (call this after grid adaption)
Definition discretization/porenetwork/gridgeometry.hh:555
static constexpr DiscretizationMethod discMethod
Definition discretization/porenetwork/gridgeometry.hh:505
const FeCache & feCache() const
The finite element cache for creating local FE bases.
Definition discretization/porenetwork/gridgeometry.hh:570
typename Traits::VertexMapper DofMapper
export dof mapper type
Definition discretization/porenetwork/gridgeometry.hh:516
bool hasBoundaryScvf(GridIndexType eIdx) const
Returns whether one of the geometry's scvfs lies on a boundary.
Definition discretization/porenetwork/gridgeometry.hh:599
GridGeometry(const GridView &gridView, const GridData &gridData)
Constructor.
Definition discretization/porenetwork/gridgeometry.hh:524
void update(GridView &&gridView, const GridData &gridData)
update all fvElementGeometries (call this after grid adaption)
Definition discretization/porenetwork/gridgeometry.hh:563
Base class for the finite volume geometry for porenetwork models.
Definition discretization/porenetwork/gridgeometry.hh:479
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:51
the sub control volume for porenetworks
Definition discretization/porenetwork/subcontrolvolume.hh:50
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.
BaseGridGeometry(std::shared_ptr< BaseImplementation > impl)
Constructor from a BaseImplementation.
Definition basegridgeometry.hh:72
auto volume(const Geometry &geo, unsigned int integrationOrder=4)
The volume of a given geometry.
Definition volume.hh:159
T getParamFromGroup(Args &&... args)
A free function to get a parameter from the parameter tree singleton with a model group.
Definition parameters.hh:165
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:181
The available discretization methods in Dumux.
CVFE< CVFEMethods::PQ1 > Box
Definition method.hh:102
typename ScalarType< X >::Type Scalar
Definition odesolver.hh:52
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
@ cylinder
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
@ scaleneTriangle
Definition throatproperties.hh:26
@ rectangle
Definition throatproperties.hh:26
@ polygon
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:257
The infrastructure to retrieve run-time parameters from Dune::ParameterTrees.
This file contains functions related to calculate pore-body properties.
typename GridView::IndexSet::IndexType GridIndex
Definition indextraits.hh:27
std::uint_least8_t SmallLocalIndex
Definition indextraits.hh:29
unsigned int LocalIndex
Definition indextraits.hh:28
The default traits.
Definition discretization/porenetwork/gridgeometry.hh:460
PNMFVElementGeometry< GridGeometry, enableCache > LocalView
Definition discretization/porenetwork/gridgeometry.hh:465
PNMSubControlVolume< GridView > SubControlVolume
Definition discretization/porenetwork/gridgeometry.hh:461
DefaultPNMData< typename SubControlVolume::Traits::Scalar, GridView > PNMData
Definition discretization/porenetwork/gridgeometry.hh:467
PNMSubControlVolumeFace< GridView > SubControlVolumeFace
Definition discretization/porenetwork/gridgeometry.hh:462
This file contains functions related to calculate pore-throat properties.