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;
 
   76            throatGeometry_.resize(1);
 
   77            throatGeometry_[0] = throatGeometry;
 
   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);
 
   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);
 
  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_; }
 
 
  306            const auto shapeFactor = throatShapeFactor_[0];
 
  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];
 
  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];
 
  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];
 
  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;
 
  503    static constexpr DiscretizationMethod discMethod{};
 
  506    using LocalView = 
typename Traits::template LocalView<ThisType, true>;
 
  508    using SubControlVolume = 
typename Traits::SubControlVolume;
 
  510    using SubControlVolumeFace = 
typename Traits::SubControlVolumeFace;
 
  514    using DofMapper = 
typename Traits::VertexMapper;
 
  516    using FeCache = Dune::LagrangeLocalFiniteElementCache<CoordScalar, Scalar, dim, 1>;
 
  521    template<
class Gr
idData>
 
  523    : ParentType(gridView)
 
  525        static_assert(GridView::dimension == 1, 
"Porenetwork model only allow GridView::dimension == 1!");
 
  531    const DofMapper& dofMapper()
 const 
  532    { 
return this->vertexMapper(); }
 
  535    std::size_t numScv()
 const 
  539    std::size_t numScvf()
 const 
  544    std::size_t numBoundaryScvf()
 const 
  548    std::size_t numDofs()
 const 
  549    { 
return this->vertexMapper().size(); }
 
  552    template<
class Gr
idData>
 
  553    void update(
const GridView& gridView, 
const GridData& gridData)
 
  555        ParentType::update(gridView);
 
  560    template<
class Gr
idData>
 
  561    void update(GridView&& gridView, 
const GridData& gridData)
 
  563        ParentType::update(std::move(gridView));
 
  568    const FeCache& feCache()
 const 
  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]; }
 
  580    bool dofOnBoundary(GridIndexType dofIdx)
 const 
  581    { 
return boundaryDofIndices_[dofIdx]; }
 
  584    bool dofOnPeriodicBoundary(GridIndexType dofIdx)
 const 
  588    GridIndexType periodicallyMappedDof(GridIndexType dofIdx)
 const 
  589    { DUNE_THROW(Dune::NotImplemented, 
"Periodic boundaries"); }
 
  592    bool hasBoundaryScvf(GridIndexType eIdx)
 const 
  593    { 
return hasBoundaryScvf_[eIdx]; }
 
  597    template<
class Gr
idData>
 
  598    void update_(
const GridData& gridData)
 
  600        PNMData::update(this->gridView(), gridData);
 
  605        auto numElements = this->gridView().size(0);
 
  606        scvs_.resize(numElements);
 
  607        scvfs_.resize(numElements);
 
  608        hasBoundaryScvf_.resize(numElements, 
false);
 
  610        boundaryDofIndices_.assign(numDofs(), 
false);
 
  612        numScvf_ = numElements;
 
  613        numScv_ = 2*numElements;
 
  616        for (
const auto& element : elements(this->gridView()))
 
  619            auto eIdx = this->elementMapper().index(element);
 
  620            auto elementGeometry = 
element.geometry();
 
  623            for (LocalIndexType scvLocalIdx = 0; scvLocalIdx < elementGeometry.corners(); ++scvLocalIdx)
 
  625                const auto dofIdxGlobal = this->vertexMapper().subIndex(element, scvLocalIdx, dim);
 
  628                auto corners = std::array{elementGeometry.corner(scvLocalIdx), elementGeometry.center()};
 
  631                const auto volume = this->poreVolume(dofIdxGlobal) / this->coordinationNumber(dofIdxGlobal);
 
  633                scvs_[eIdx][scvLocalIdx] = SubControlVolume(dofIdxGlobal,
 
  639                if (this->poreLabel(dofIdxGlobal) > 0)
 
  641                    if (boundaryDofIndices_[dofIdxGlobal])
 
  644                    boundaryDofIndices_[dofIdxGlobal] = 
true;
 
  645                    hasBoundaryScvf_[eIdx] = 
true;
 
  650            auto unitOuterNormal = elementGeometry.corner(1)-elementGeometry.corner(0);
 
  651            unitOuterNormal /= unitOuterNormal.two_norm();
 
  652            LocalIndexType scvfLocalIdx = 0;
 
  653            scvfs_[eIdx][0] = SubControlVolumeFace(elementGeometry.center(),
 
  654                                                   std::move(unitOuterNormal),
 
  655                                                   this->throatCrossSectionalArea(this->elementMapper().index(element)),
 
  657                                                   std::array<LocalIndexType, 2>({0, 1}));
 
  661    const FeCache feCache_;
 
  663    std::vector<std::array<SubControlVolume, 2>> scvs_;
 
  664    std::vector<std::array<SubControlVolumeFace, 1>> scvfs_;
 
  667    std::size_t numScvf_;
 
  670    std::vector<bool> boundaryDofIndices_;
 
  671    std::vector<bool> hasBoundaryScvf_;
 
  680template<
class Scalar, 
class GV, 
class Traits>
 
  682: 
public BaseGridGeometry<GV, Traits>
 
  683, 
public Traits::PNMData
 
  685    using ThisType = GridGeometry<Scalar, GV, false, Traits>;
 
  686    using ParentType = BaseGridGeometry<GV, Traits>;
 
  689    using PNMData = 
typename Traits::PNMData;
 
  691    static const int dim = GV::dimension;
 
  692    static const int dimWorld = GV::dimensionworld;
 
  694    using Element = 
typename GV::template Codim<0>::Entity;
 
  695    using CoordScalar = 
typename GV::ctype;
 
  700    static constexpr DiscretizationMethod discMethod{};
 
  703    using LocalView = 
typename Traits::template LocalView<ThisType, false>;
 
  705    using SubControlVolume = 
typename Traits::SubControlVolume;
 
  707    using SubControlVolumeFace = 
typename Traits::SubControlVolumeFace;
 
  711    using DofMapper = 
typename Traits::VertexMapper;
 
  713    using FeCache = Dune::LagrangeLocalFiniteElementCache<CoordScalar, Scalar, dim, 1>;
 
  718    template<
class Gr
idData>
 
  719    GridGeometry(
const GridView& gridView, 
const GridData& gridData)
 
  720    : ParentType(gridView)
 
  722        static_assert(GridView::dimension == 1, 
"Porenetwork model only allow GridView::dimension == 1!");
 
  729    const DofMapper& dofMapper()
 const 
  730    { 
return this->vertexMapper(); }
 
  733    std::size_t numScv()
 const 
  737    std::size_t numScvf()
 const 
  742    std::size_t numBoundaryScvf()
 const 
  746    std::size_t numDofs()
 const 
  747    { 
return this->vertexMapper().size(); }
 
  750    template<
class Gr
idData>
 
  751    void update(
const GridView& gridView, 
const GridData& gridData)
 
  753        ParentType::update(gridView);
 
  758    template<
class Gr
idData>
 
  759    void update(GridView&& gridView, 
const GridData& gridData)
 
  761        ParentType::update(std::move(gridView));
 
  766    const FeCache& feCache()
 const 
  770    bool dofOnBoundary(GridIndexType dofIdx)
 const 
  771    { 
return boundaryDofIndices_[dofIdx]; }
 
  774    bool dofOnPeriodicBoundary(GridIndexType dofIdx)
 const 
  778    GridIndexType periodicallyMappedDof(GridIndexType dofIdx)
 const 
  779    { DUNE_THROW(Dune::NotImplemented, 
"Periodic boundaries"); }
 
  783    template<
class Gr
idData>
 
  784    void update_(
const GridData& gridData)
 
  786        PNMData::update(this->gridView(), gridData);
 
  788        boundaryDofIndices_.assign(numDofs(), 
false);
 
  791        numScvf_ = this->gridView().size(0);
 
  792        numScv_ = 2*numScvf_;
 
  794        for (
const auto& element : elements(this->gridView()))
 
  797            for (LocalIndexType vIdxLocal = 0; vIdxLocal < 2; ++vIdxLocal)
 
  799                const auto vIdxGlobal = this->vertexMapper().subIndex(element, vIdxLocal, dim);
 
  800                if (this->poreLabel(vIdxGlobal) > 0)
 
  802                    if (boundaryDofIndices_[vIdxGlobal])
 
  805                    boundaryDofIndices_[vIdxGlobal] = 
true;
 
  811    const FeCache feCache_;
 
  815    std::size_t numScvf_;
 
  818    std::vector<bool> boundaryDofIndices_;
 
Base class for grid geometries.
Base class for all grid geometries.
Definition basegridgeometry.hh:52
Traits extracting the public Extrusion type from T Defaults to NoExtrusion if no such type is found.
Definition extrusion.hh:155
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: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
T getParamFromGroup(Args &&... args)
A free function to get a parameter from the parameter tree singleton with a model group.
Definition parameters.hh:149
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
@ 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:166
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:458
PNMFVElementGeometry< GridGeometry, enableCache > LocalView
Definition discretization/porenetwork/gridgeometry.hh:463
PNMSubControlVolume< GridView > SubControlVolume
Definition discretization/porenetwork/gridgeometry.hh:459
DefaultPNMData< typename SubControlVolume::Traits::Scalar, GridView > PNMData
Definition discretization/porenetwork/gridgeometry.hh:465
PNMSubControlVolumeFace< GridView > SubControlVolumeFace
Definition discretization/porenetwork/gridgeometry.hh:460
This file contains functions related to calculate pore-throat properties.