24#ifndef DUMUX_DISCRETIZATION_PNM_GRID_GEOMETRY_HH
25#define DUMUX_DISCRETIZATION_PNM_GRID_GEOMETRY_HH
29#include <unordered_map>
32#include <dune/common/exceptions.hh>
33#include <dune/localfunctions/lagrange/lagrangelfecache.hh>
54template<
class Scalar,
class Gr
idView>
59 using Label = std::int_least8_t;
60 using Vertex =
typename GridView::template Codim<GridView::dimension>::Entity;
61 using Element =
typename GridView::template Codim<0>::Entity;
63 static const int dim = GridView::dimension;
67 template<
class Gr
idData>
72 const auto numThroats = gridView.size(0);
73 throatInscribedRadius_.resize(numThroats);
74 throatLength_.resize(numThroats);
75 throatLabel_.resize(numThroats);
76 throatCrossSectionalArea_.resize(numThroats);
77 throatShapeFactor_.resize(numThroats);
79 useSameGeometryForAllPores_ =
true;
80 useSameShapeForAllThroats_ =
true;
81 overwriteGridDataWithShapeSpecificValues_ =
false;
86 const auto throatGeometryInput = getParamFromGroup<std::string>(gridData.
paramGroup(),
"Grid.ThroatCrossSectionShape");
88 throatGeometry_.resize(1);
89 throatGeometry_[0] = throatGeometry;
90 overwriteGridDataWithShapeSpecificValues_ = getParamFromGroup<bool>(gridData.
paramGroup(),
"Grid.OverwriteGridDataWithShapeSpecificValues",
true);
92 std::cout <<
"Using '" << throatGeometryInput <<
"' as cross-sectional shape for all throats." << std::endl;
96 std::cout <<
"Reading shape factors for throats from grid data." << std::endl;
97 useSameShapeForAllThroats_ =
false;
98 throatGeometry_.resize(numThroats);
102 const auto numPores = gridView.size(dim);
103 poreInscribedRadius_.resize(numPores);
104 poreLabel_.resize(numPores);
105 poreVolume_.resize(numPores);
110 const auto poreGeometryInput = getParamFromGroup<std::string>(gridData.
paramGroup(),
"Grid.PoreGeometry");
111 poreGeometry_.resize(1);
114 std::cout <<
"Using '" << poreGeometryInput <<
"' as geometry for all pores." << std::endl;
118 std::cout <<
"Reading pore shapes from grid data." << std::endl;
119 useSameGeometryForAllPores_ =
false;
120 poreGeometry_.resize(numPores);
124 for (
const auto& vertex : vertices(gridView))
126 static const auto poreInscribedRadiusIdx = gridData.
parameterIndex(
"PoreInscribedRadius");
127 static const auto poreLabelIdx = gridData.
parameterIndex(
"PoreLabel");
128 const auto vIdx = gridView.indexSet().index(vertex);
129 const auto& params = gridData.
parameters(vertex);
130 poreInscribedRadius_[vIdx] = params[poreInscribedRadiusIdx];
131 assert(poreInscribedRadius_[vIdx] > 0.0);
132 poreLabel_[vIdx] = params[poreLabelIdx];
135 poreGeometry_[vIdx] = getPoreGeometry_(gridData, vertex);
137 poreVolume_[vIdx] = getPoreVolume_(gridData, vertex, vIdx);
140 for (
const auto& element : elements(gridView))
142 const int eIdx = gridView.indexSet().index(element);
143 const auto& params = gridData.
parameters(element);
144 static const auto throatInscribedRadiusIdx = gridData.
parameterIndex(
"ThroatInscribedRadius");
145 static const auto throatLengthIdx = gridData.
parameterIndex(
"ThroatLength");
146 throatInscribedRadius_[eIdx] = params[throatInscribedRadiusIdx];
147 throatLength_[eIdx] = params[throatLengthIdx];
151 if (gridHasThroatLabel)
153 static const auto throatLabelIdx = gridData.
parameterIndex(
"ThroatLabel");
154 throatLabel_[eIdx] = params[throatLabelIdx];
158 const auto vIdx0 = gridView.indexSet().subIndex(element, 0, dim);
159 const auto vIdx1 = gridView.indexSet().subIndex(element, 1, dim);
161 const auto poreLabel0 =
poreLabel(vIdx0);
162 const auto poreLabel1 =
poreLabel(vIdx1);
164 if (poreLabel0 >= 0 && poreLabel1 >= 0)
166 std::cout <<
"\n Warning: Throat "
167 << eIdx <<
" connects two boundary pores with different pore labels. Using the greater pore label as throat label.\n"
168 <<
"Set the throat labels explicitly in your grid file, if needed." << std::endl;
172 throatLabel_[eIdx] = max(poreLabel0, poreLabel1);
177 static const auto throatShapeFactorIdx = gridData.
parameterIndex(
"ThroatShapeFactor");
178 static const auto throatAreaIdx = gridData.
parameterIndex(
"ThroatCrossSectionalArea");
179 throatShapeFactor_[eIdx] = params[throatShapeFactorIdx];
180 throatGeometry_[eIdx] =
Throat::shape(throatShapeFactor_[eIdx]);
181 throatCrossSectionalArea_[eIdx] = params[throatAreaIdx];
185 throatCrossSectionalArea_[eIdx] = getThroatCrossSectionalArea_(gridData, element, eIdx);
186 throatShapeFactor_[eIdx] = getThroatShapeFactor_(gridData, element, eIdx);
189 assert(throatInscribedRadius_[eIdx] > 0.0);
190 assert(throatLength_[eIdx] > 0.0);
191 assert(throatCrossSectionalArea_[eIdx] > 0.0);
193 static const bool addThroatVolumeToPoreVolume = getParamFromGroup<bool>(gridData.
paramGroup(),
"Grid.AddThroatVolumeToPoreVolume",
false);
194 if (addThroatVolumeToPoreVolume)
196 for (
int vIdxLocal = 0; vIdxLocal < 2; ++vIdxLocal)
198 const auto vIdx = gridView.indexSet().subIndex(element, vIdxLocal, dim);
199 poreVolume_[vIdx] += 0.5 * throatCrossSectionalArea_[eIdx] * throatLength_[eIdx];
204 maybeResizeContainers_();
209 {
return poreLabel_[dofIdxGlobal]; }
213 {
return poreLabel_; }
217 {
return poreInscribedRadius_[dofIdxGlobal]; }
221 {
return poreInscribedRadius_; }
225 {
return poreVolume_[dofIdxGlobal]; }
229 {
return poreVolume_; }
233 {
return throatInscribedRadius_[eIdx]; }
237 {
return throatInscribedRadius_; }
241 {
return throatLength_[eIdx]; }
245 {
return throatLength_; }
249 {
return throatLabel_[eIdx]; }
253 {
return throatLabel_; }
257 {
return coordinationNumber_[dofIdxGlobal]; }
261 {
return coordinationNumber_; }
274 const auto poreGeo = poreGeometry_[0];
275 poreGeometry_.resize(poreInscribedRadius_.size(), poreGeo);
278 return poreGeometry_;
292 const auto throatShape = throatGeometry_[0];
293 throatGeometry_.resize(throatInscribedRadius_.size(), throatShape);
296 return throatGeometry_;
301 {
return throatCrossSectionalArea_[eIdx]; }
305 {
return throatCrossSectionalArea_; }
319 throatShapeFactor_.resize(throatInscribedRadius_.size(),
shapeFactor);
322 return throatShapeFactor_;
327 {
return useSameGeometryForAllPores_; }
331 {
return useSameShapeForAllThroats_; }
336 template<
class Gr
idData>
339 static const auto poreGeometryIdx = gridData.
parameterIndex(
"PoreGeometry");
340 using T = std::underlying_type_t<Pore::Shape>;
341 const auto poreGeometryValue =
static_cast<T
>(gridData.
parameters(vertex)[poreGeometryIdx]);
342 return static_cast<Pore::Shape>(poreGeometryValue);
346 template<
class Gr
idData>
347 Scalar getPoreVolume_(
const GridData& gridData,
const Vertex& vertex,
const std::size_t vIdx)
const
349 static const bool gridHasPoreVolume = gridData.gridHasVertexParameter(
"PoreVolume");
351 if (gridHasPoreVolume)
353 static const auto poreVolumeIdx = gridData.parameterIndex(
"PoreVolume");
354 return gridData.
parameters(vertex)[poreVolumeIdx];
360 static const Scalar fixedHeight = getParamFromGroup<Scalar>(gridData.paramGroup(),
"Grid.PoreHeight", -1.0);
361 const Scalar h = fixedHeight > 0.0 ? fixedHeight : gridData.
getParameter(vertex,
"PoreHeight");
370 template<
class Gr
idData>
371 Scalar getThroatCrossSectionalArea_(
const GridData& gridData,
const Element& element,
const std::size_t eIdx)
const
373 static const bool gridHasThroatCrossSectionalArea = gridData.gridHasElementParameter(
"ThroatCrossSectionalArea");
374 if (gridHasThroatCrossSectionalArea && !overwriteGridDataWithShapeSpecificValues_)
376 static const auto throatAreaIdx = gridData.parameterIndex(
"ThroatCrossSectionalArea");
377 return gridData.parameters(element)[throatAreaIdx];
383 static const auto throatHeight = getParamFromGroup<Scalar>(gridData.paramGroup(),
"Grid.ThroatHeight");
392 template<
class Gr
idData>
393 Scalar getThroatShapeFactor_(
const GridData& gridData,
const Element& element,
const std::size_t eIdx)
const
395 static const bool gridHasThroatShapeFactor = gridData.gridHasElementParameter(
"ThroatShapeFactor");
396 if (gridHasThroatShapeFactor && !overwriteGridDataWithShapeSpecificValues_)
398 static const auto throatShapeFactorIdx = gridData.parameterIndex(
"ThroatShapeFactor");
399 return gridData.parameters(element)[throatShapeFactorIdx];
405 static const auto throatHeight = getParamFromGroup<Scalar>(gridData.paramGroup(),
"Grid.ThroatHeight");
410 static const auto shapeFactor = getParamFromGroup<Scalar>(gridData.paramGroup(),
"Grid.ThroatShapeFactor");
414 return Throat::shapeFactor<Scalar>(
shape, throatInscribedRadius_[eIdx]);
418 void maybeResizeContainers_()
422 std::adjacent_find(throatGeometry_.begin(), throatGeometry_.end(), std::not_equal_to<Throat::Shape>() ) == throatGeometry_.end())
424 std::cout <<
"All throats feature the same shape, resizing containers" << std::endl;
425 useSameShapeForAllThroats_ =
true;
427 const auto throatGeometry = throatGeometry_[0];
428 throatShapeFactor_.resize(1);
429 throatGeometry_.resize(1);
431 throatGeometry_[0] = throatGeometry;
436 std::adjacent_find(poreGeometry_.begin(), poreGeometry_.end(), std::not_equal_to<Pore::Shape>() ) == poreGeometry_.end())
438 std::cout <<
"All pores feature the same shape, resizing containers" << std::endl;
439 useSameGeometryForAllPores_ =
true;
441 poreGeometry_.resize(1);
446 mutable std::vector<Pore::Shape> poreGeometry_;
447 std::vector<Scalar> poreInscribedRadius_;
448 std::vector<Scalar> poreVolume_;
449 std::vector<Label> poreLabel_;
450 std::vector<SmallLocalIndex> coordinationNumber_;
451 mutable std::vector<Throat::Shape> throatGeometry_;
452 mutable std::vector<Scalar> throatShapeFactor_;
453 std::vector<Scalar> throatInscribedRadius_;
454 std::vector<Scalar> throatLength_;
455 std::vector<Label> throatLabel_;
456 std::vector<Scalar> throatCrossSectionalArea_;
457 bool useSameGeometryForAllPores_;
458 bool useSameShapeForAllThroats_;
459 bool overwriteGridDataWithShapeSpecificValues_;
467template<
class Gr
idView,
class MapperTraits = DefaultMapperTraits<Gr
idView>>
474 template<
class Gr
idGeometry,
bool enableCache>
485template<
class Scalar,
487 bool enableGridGeometryCache =
false,
496template<
class Scalar,
class GV,
class Traits>
499,
public Traits::PNMData
505 using PNMData =
typename Traits::PNMData;
507 using Element =
typename GV::template Codim<0>::Entity;
508 using CoordScalar =
typename GV::ctype;
509 static const int dim = GV::dimension;
510 static const int dimWorld = GV::dimensionworld;
528 using FeCache = Dune::LagrangeLocalFiniteElementCache<CoordScalar, Scalar, dim, 1>;
533 template<
class Gr
idData>
537 static_assert(GridView::dimension == 1,
"Porenetwork model only allow GridView::dimension == 1!");
544 {
return this->vertexMapper(); }
561 {
return this->vertexMapper().size(); }
564 template<
class Gr
idData>
567 ParentType::update(gridView);
572 template<
class Gr
idData>
575 ParentType::update(std::move(gridView));
584 const std::array<SubControlVolume, 2>&
scvs(GridIndexType eIdx)
const
585 {
return scvs_[eIdx]; }
588 const std::array<SubControlVolumeFace, 1>&
scvfs(GridIndexType eIdx)
const
589 {
return scvfs_[eIdx]; }
593 {
return boundaryDofIndices_[dofIdx]; }
601 { DUNE_THROW(Dune::NotImplemented,
"Periodic boundaries"); }
605 {
return std::unordered_map<GridIndexType, GridIndexType>{}; }
609 {
return hasBoundaryScvf_[eIdx]; }
613 template<
class Gr
idData>
614 void update_(
const GridData& gridData)
616 PNMData::update(this->gridView(), gridData);
621 auto numElements = this->gridView().size(0);
622 scvs_.resize(numElements);
623 scvfs_.resize(numElements);
624 hasBoundaryScvf_.resize(numElements,
false);
626 boundaryDofIndices_.assign(numDofs(),
false);
628 numScvf_ = numElements;
629 numScv_ = 2*numElements;
632 for (
const auto& element : elements(this->gridView()))
635 auto eIdx = this->elementMapper().index(element);
636 auto elementGeometry = element.geometry();
639 for (LocalIndexType scvLocalIdx = 0; scvLocalIdx < elementGeometry.corners(); ++scvLocalIdx)
641 const auto dofIdxGlobal = this->vertexMapper().subIndex(element, scvLocalIdx, dim);
644 auto corners = std::array{elementGeometry.corner(scvLocalIdx), elementGeometry.center()};
647 const auto volume = this->poreVolume(dofIdxGlobal) / this->coordinationNumber(dofIdxGlobal);
649 scvs_[eIdx][scvLocalIdx] = SubControlVolume(dofIdxGlobal,
655 if (this->poreLabel(dofIdxGlobal) > 0)
657 if (boundaryDofIndices_[dofIdxGlobal])
660 boundaryDofIndices_[dofIdxGlobal] =
true;
661 hasBoundaryScvf_[eIdx] =
true;
666 auto unitOuterNormal = elementGeometry.corner(1)-elementGeometry.corner(0);
667 unitOuterNormal /= unitOuterNormal.two_norm();
668 LocalIndexType scvfLocalIdx = 0;
669 scvfs_[eIdx][0] = SubControlVolumeFace(elementGeometry.center(),
670 std::move(unitOuterNormal),
671 this->throatCrossSectionalArea(this->elementMapper().index(element)),
673 std::array<LocalIndexType, 2>({0, 1}));
677 const FeCache feCache_;
679 std::vector<std::array<SubControlVolume, 2>> scvs_;
680 std::vector<std::array<SubControlVolumeFace, 1>> scvfs_;
683 std::size_t numScvf_;
686 std::vector<bool> boundaryDofIndices_;
687 std::vector<bool> hasBoundaryScvf_;
696template<
class Scalar,
class GV,
class Traits>
699,
public Traits::PNMData
705 using PNMData =
typename Traits::PNMData;
707 static const int dim = GV::dimension;
708 static const int dimWorld = GV::dimensionworld;
710 using Element =
typename GV::template Codim<0>::Entity;
711 using CoordScalar =
typename GV::ctype;
729 using FeCache = Dune::LagrangeLocalFiniteElementCache<CoordScalar, Scalar, dim, 1>;
734 template<
class Gr
idData>
738 static_assert(GridView::dimension == 1,
"Porenetwork model only allow GridView::dimension == 1!");
746 {
return this->vertexMapper(); }
763 {
return this->vertexMapper().size(); }
766 template<
class Gr
idData>
769 ParentType::update(gridView);
774 template<
class Gr
idData>
777 ParentType::update(std::move(gridView));
787 {
return boundaryDofIndices_[dofIdx]; }
795 { DUNE_THROW(Dune::NotImplemented,
"Periodic boundaries"); }
799 {
return std::unordered_map<GridIndexType, GridIndexType>{}; }
803 template<
class Gr
idData>
804 void update_(
const GridData& gridData)
806 PNMData::update(this->gridView(), gridData);
808 boundaryDofIndices_.assign(numDofs(),
false);
811 numScvf_ = this->gridView().size(0);
812 numScv_ = 2*numScvf_;
814 for (
const auto& element : elements(this->gridView()))
817 for (LocalIndexType vIdxLocal = 0; vIdxLocal < 2; ++vIdxLocal)
819 const auto vIdxGlobal = this->vertexMapper().subIndex(element, vIdxLocal, dim);
820 if (this->poreLabel(vIdxGlobal) > 0)
822 if (boundaryDofIndices_[vIdxGlobal])
825 boundaryDofIndices_[vIdxGlobal] =
true;
831 const FeCache feCache_;
835 std::size_t numScvf_;
838 std::vector<bool> boundaryDofIndices_;
Defines the default element and vertex mapper types.
The infrastructure to retrieve run-time parameters from Dune::ParameterTrees.
Defines the index types used for grid and local indices.
Base class for grid geometries.
Helper classes to compute the integration elements.
The available discretization methods in Dumux.
This file contains functions related to calculate pore-body properties.
This file contains functions related to calculate pore-throat properties.
auto volume(const Geometry &geo, unsigned int integrationOrder=4)
The volume of a given geometry.
Definition: volume.hh:171
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:177
typename Extrusion< T >::type Extrusion_t
Convenience alias for obtaining the extrusion type.
Definition: extrusion.hh:251
CVFE< CVFEMethods::PQ1 > Box
Definition: method.hh:83
Definition: discretization/porenetwork/fvelementgeometry.hh:34
Shape shapeFromString(const std::string &s)
Get the shape from a string description of the shape.
Definition: poreproperties.hh:56
Scalar volume(Shape shape, Scalar inscribedRadius)
Returns the volume of a given geometry based on the inscribed radius.
Definition: poreproperties.hh:73
Shape
Collection of different pore-body shapes.
Definition: poreproperties.hh:35
constexpr Scalar totalCrossSectionalAreaForRectangle(const Scalar inscribedRadius, const Scalar height) noexcept
Returns the cross-sectional area of a rectangle.
Definition: throatproperties.hh:226
constexpr Shape shape(const Scalar shapeFactor) noexcept
Returns the shape for a given shape factor.
Definition: throatproperties.hh:177
constexpr Scalar shapeFactorRectangle(const Scalar inscribedRadius, const Scalar height) noexcept
Returns the value of the shape factor for a rectangle.
Definition: throatproperties.hh:144
Scalar totalCrossSectionalArea(const Shape shape, const Scalar inscribedRadius)
Returns the cross-sectional area of a given geometry.
Definition: throatproperties.hh:211
Shape shapeFromString(const std::string &s)
Get the shape from a string description of the shape.
Definition: throatproperties.hh:57
Shape
Collection of different pore-throat shapes.
Definition: throatproperties.hh:38
Scalar shapeFactor(Shape shape, const Scalar inscribedRadius)
Returns the value of the shape factor for a given shape.
Definition: throatproperties.hh:162
Structure to define the index types used for grid and local indices.
Definition: indextraits.hh:38
typename GridView::IndexSet::IndexType GridIndex
Definition: indextraits.hh:39
std::uint_least8_t SmallLocalIndex
Definition: indextraits.hh:41
Base class for all grid geometries.
Definition: basegridgeometry.hh:61
typename BaseImplementation::GridView GridView
export the grid view type
Definition: basegridgeometry.hh:69
Base class for the local geometry for porenetworks.
Definition: discretization/porenetwork/fvelementgeometry.hh:43
Base class for geometry data extraction from the grid data format.
Definition: discretization/porenetwork/gridgeometry.hh:56
Scalar throatCrossSectionalArea(const GridIndex eIdx) const
Returns the throat's cross-sectional area.
Definition: discretization/porenetwork/gridgeometry.hh:300
const std::vector< Scalar > & poreVolume() const
Returns the vector of pore volumes.
Definition: discretization/porenetwork/gridgeometry.hh:228
const std::vector< Scalar > & throatInscribedRadius() const
Returns the vector of inscribed throat radii.
Definition: discretization/porenetwork/gridgeometry.hh:236
bool useSameGeometryForAllPores() const
Returns whether all pores feature the same shape.
Definition: discretization/porenetwork/gridgeometry.hh:326
const std::vector< Label > & poreLabel() const
Returns the vector of pore labels.
Definition: discretization/porenetwork/gridgeometry.hh:212
bool useSameShapeForAllThroats() const
Returns whether all throats feature the same cross-sectional shape.
Definition: discretization/porenetwork/gridgeometry.hh:330
SmallLocalIndex coordinationNumber(const GridIndex dofIdxGlobal) const
Returns the number of throats connected to a pore (coordination number)
Definition: discretization/porenetwork/gridgeometry.hh:256
void update(const GridView &gridView, const GridData &gridData)
Definition: discretization/porenetwork/gridgeometry.hh:68
const std::vector< SmallLocalIndex > & coordinationNumber() const
Returns the vector of coordination numbers.
Definition: discretization/porenetwork/gridgeometry.hh:260
const std::vector< Scalar > & throatShapeFactor() const
Returns the vector of throat shape factors.
Definition: discretization/porenetwork/gridgeometry.hh:312
const std::vector< Scalar > & throatCrossSectionalArea() const
Returns the vector of throat cross-sectional areas.
Definition: discretization/porenetwork/gridgeometry.hh:304
Pore::Shape poreGeometry(const GridIndex vIdx) const
the geometry of the pore
Definition: discretization/porenetwork/gridgeometry.hh:264
Throat::Shape throatCrossSectionShape(const GridIndex eIdx) const
Returns the throat's cross-sectional shape.
Definition: discretization/porenetwork/gridgeometry.hh:282
Label throatLabel(const GridIndex eIdx) const
Returns an index indicating if a throat is touching the domain boundary.
Definition: discretization/porenetwork/gridgeometry.hh:248
const std::vector< Label > & throatLabel() const
Returns the vector of throat labels.
Definition: discretization/porenetwork/gridgeometry.hh:252
Scalar throatLength(const GridIndex eIdx) const
Returns the length of the throat.
Definition: discretization/porenetwork/gridgeometry.hh:240
const std::vector< Throat::Shape > & throatCrossSectionShape() const
Returns the vector of cross-sectional shapes.
Definition: discretization/porenetwork/gridgeometry.hh:286
Scalar poreVolume(const GridIndex dofIdxGlobal) const
Returns the volume of the pore.
Definition: discretization/porenetwork/gridgeometry.hh:224
Scalar throatInscribedRadius(const GridIndex eIdx) const
Returns the inscribed radius of the throat.
Definition: discretization/porenetwork/gridgeometry.hh:232
Label poreLabel(const GridIndex dofIdxGlobal) const
Returns the pore label (e.g. used for setting BCs)
Definition: discretization/porenetwork/gridgeometry.hh:208
Scalar poreInscribedRadius(const GridIndex dofIdxGlobal) const
Returns the inscribed radius of the pore.
Definition: discretization/porenetwork/gridgeometry.hh:216
const std::vector< Scalar > & throatLength() const
Returns the vector of throat lengths.
Definition: discretization/porenetwork/gridgeometry.hh:244
const std::vector< Pore::Shape > & poreGeometry() const
Returns the vector of pore geometries.
Definition: discretization/porenetwork/gridgeometry.hh:268
Scalar throatShapeFactor(const GridIndex eIdx) const
Returns the throat's shape factor.
Definition: discretization/porenetwork/gridgeometry.hh:308
const std::vector< Scalar > & poreInscribedRadius() const
Returns the vector of inscribed pore radii.
Definition: discretization/porenetwork/gridgeometry.hh:220
The default traits.
Definition: discretization/porenetwork/gridgeometry.hh:470
Base class for the finite volume geometry for porenetwork models.
Definition: discretization/porenetwork/gridgeometry.hh:489
Base class for the finite volume geometry for porenetwork models.
Definition: discretization/porenetwork/gridgeometry.hh:500
Dune::LagrangeLocalFiniteElementCache< CoordScalar, Scalar, dim, 1 > FeCache
export the finite element cache type
Definition: discretization/porenetwork/gridgeometry.hh:528
std::size_t numDofs() const
The total number of degrees of freedom.
Definition: discretization/porenetwork/gridgeometry.hh:560
const std::array< SubControlVolume, 2 > & scvs(GridIndexType eIdx) const
Get the local scvs for an element.
Definition: discretization/porenetwork/gridgeometry.hh:584
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:600
std::unordered_map< GridIndexType, GridIndexType > periodicVertexMap() const
Returns the map between dofs across periodic boundaries.
Definition: discretization/porenetwork/gridgeometry.hh:604
typename Traits::SubControlVolumeFace SubControlVolumeFace
export the type of sub control volume
Definition: discretization/porenetwork/gridgeometry.hh:522
const DofMapper & dofMapper() const
Definition: discretization/porenetwork/gridgeometry.hh:543
std::size_t numScv() const
The total number of sub control volumes.
Definition: discretization/porenetwork/gridgeometry.hh:547
bool dofOnPeriodicBoundary(GridIndexType dofIdx) const
If a vertex / d.o.f. is on a periodic boundary (not implemented)
Definition: discretization/porenetwork/gridgeometry.hh:596
bool dofOnBoundary(GridIndexType dofIdx) const
If a vertex / d.o.f. is on the boundary.
Definition: discretization/porenetwork/gridgeometry.hh:592
typename Traits::SubControlVolume SubControlVolume
export the type of sub control volume
Definition: discretization/porenetwork/gridgeometry.hh:520
typename Traits::template LocalView< ThisType, true > LocalView
export the type of the fv element geometry (the local view type)
Definition: discretization/porenetwork/gridgeometry.hh:518
std::size_t numScvf() const
The total number of sun control volume faces.
Definition: discretization/porenetwork/gridgeometry.hh:551
Extrusion_t< Traits > Extrusion
export the type of extrusion
Definition: discretization/porenetwork/gridgeometry.hh:524
const std::array< SubControlVolumeFace, 1 > & scvfs(GridIndexType eIdx) const
Get the local scvfs for an element.
Definition: discretization/porenetwork/gridgeometry.hh:588
std::size_t numBoundaryScvf() const
Definition: discretization/porenetwork/gridgeometry.hh:556
void update(const GridView &gridView, const GridData &gridData)
update all fvElementGeometries (call this after grid adaption)
Definition: discretization/porenetwork/gridgeometry.hh:565
const FeCache & feCache() const
The finite element cache for creating local FE bases.
Definition: discretization/porenetwork/gridgeometry.hh:580
typename Traits::VertexMapper DofMapper
export dof mapper type
Definition: discretization/porenetwork/gridgeometry.hh:526
bool hasBoundaryScvf(GridIndexType eIdx) const
Returns whether one of the geometry's scvfs lies on a boundary.
Definition: discretization/porenetwork/gridgeometry.hh:608
GridGeometry(const GridView &gridView, const GridData &gridData)
Constructor.
Definition: discretization/porenetwork/gridgeometry.hh:534
void update(GridView &&gridView, const GridData &gridData)
update all fvElementGeometries (call this after grid adaption)
Definition: discretization/porenetwork/gridgeometry.hh:573
Base class for the finite volume geometry for porenetwork models.
Definition: discretization/porenetwork/gridgeometry.hh:700
bool dofOnBoundary(GridIndexType dofIdx) const
If a vertex / d.o.f. is on the boundary.
Definition: discretization/porenetwork/gridgeometry.hh:786
Dune::LagrangeLocalFiniteElementCache< CoordScalar, Scalar, dim, 1 > FeCache
export the finite element cache type
Definition: discretization/porenetwork/gridgeometry.hh:729
std::size_t numDofs() const
The total number of degrees of freedom.
Definition: discretization/porenetwork/gridgeometry.hh:762
std::size_t numBoundaryScvf() const
Definition: discretization/porenetwork/gridgeometry.hh:758
void update(GridView &&gridView, const GridData &gridData)
update all fvElementGeometries (call this after grid adaption)
Definition: discretization/porenetwork/gridgeometry.hh:775
void update(const GridView &gridView, const GridData &gridData)
update all fvElementGeometries (call this after grid adaption)
Definition: discretization/porenetwork/gridgeometry.hh:767
std::size_t numScv() const
The total number of sub control volumes.
Definition: discretization/porenetwork/gridgeometry.hh:749
typename Traits::VertexMapper DofMapper
export dof mapper type
Definition: discretization/porenetwork/gridgeometry.hh:727
GridGeometry(const GridView &gridView, const GridData &gridData)
Constructor.
Definition: discretization/porenetwork/gridgeometry.hh:735
const FeCache & feCache() const
The finite element cache for creating local FE bases.
Definition: discretization/porenetwork/gridgeometry.hh:782
typename Traits::SubControlVolumeFace SubControlVolumeFace
export the type of sub control volume
Definition: discretization/porenetwork/gridgeometry.hh:723
std::unordered_map< GridIndexType, GridIndexType > periodicVertexMap() const
Returns the map between dofs across periodic boundaries.
Definition: discretization/porenetwork/gridgeometry.hh:798
Extrusion_t< Traits > Extrusion
export the type of extrusion
Definition: discretization/porenetwork/gridgeometry.hh:725
std::size_t numScvf() const
The total number of sun control volume faces.
Definition: discretization/porenetwork/gridgeometry.hh:753
typename Traits::SubControlVolume SubControlVolume
export the type of sub control volume
Definition: discretization/porenetwork/gridgeometry.hh:721
typename Traits::template LocalView< ThisType, false > LocalView
export the type of the fv element geometry (the local view type)
Definition: discretization/porenetwork/gridgeometry.hh:719
const DofMapper & dofMapper() const
Definition: discretization/porenetwork/gridgeometry.hh:745
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:794
bool dofOnPeriodicBoundary(GridIndexType dofIdx) const
If a vertex / d.o.f. is on a periodic boundary (not implemented)
Definition: discretization/porenetwork/gridgeometry.hh:790
the sub control volume for porenetworks
Definition: discretization/porenetwork/subcontrolvolume.hh:65
Class for a sub control volume face for porenetworks.
Definition: discretization/porenetwork/subcontrolvolumeface.hh:62
Class for grid data attached to dgf or gmsh grid files.
Definition: griddata.hh:66
double getParameter(const Element &element, const std::string &fieldName) const
Get a element parameter.
Definition: griddata.hh:252
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:112
Class for grid data attached to dgf or gmsh grid files.
Definition: porenetwork/griddata.hh:56
bool gridHasElementParameter(const std::string ¶m) const
Return if a given element parameter is provided by the grid.
Definition: porenetwork/griddata.hh:266
std::vector< SmallLocalIndex > getCoordinationNumbers() const
Returns the coordination numbers for all pore bodies.
Definition: porenetwork/griddata.hh:151
int parameterIndex(const std::string ¶mName) const
Return the index for a given parameter name.
Definition: porenetwork/griddata.hh:234
const std::string & paramGroup() const
Return the parameter group.
Definition: porenetwork/griddata.hh:260
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:98
Base class for the local geometry for porenetworks.
the sub control volume for pore networks
Base class for a sub control volume face.