12#ifndef DUMUX_DISCRETIZATION_PNM_SUBCONTROLVOLUME_HH
13#define DUMUX_DISCRETIZATION_PNM_SUBCONTROLVOLUME_HH
15#include <dune/geometry/affinegeometry.hh>
27template<
class Gr
idView>
30 using Grid =
typename GridView::Grid;
32 static const int dim = Grid::dimension;
33 static const int dimWorld = Grid::dimensionworld;
40 using Geometry = Dune::AffineGeometry<Scalar, 1, dimWorld>;
56 using GridIndexType =
typename T::GridIndexType;
57 using LocalIndexType =
typename T::LocalIndexType;
58 using Scalar =
typename T::Scalar;
59 using CornerStorage =
typename T::CornerStorage;
60 using Geometry =
typename T::Geometry;
72 template<
class Corners>
74 LocalIndexType scvIdx,
78 : center_((corners[0]+corners[1])/2.0),
79 corners_(std::forward<CornerStorage>(corners)),
97 {
return localDofIdx_; }
101 {
return localDofIdx_; }
105 {
return dofIndex_; }
109 {
return corners_[0]; }
113 {
return elementIndex_; }
116 [[deprecated(
"Will be removed after 3.7. Use fvGeometry.geometry(scv).corner(i).")]]
119 assert(localIdx < corners_.size() &&
"provided index exceeds the number of corners");
120 return corners_[localIdx];
124 [[deprecated(
"Will be removed after 3.7. Use fvGeometry.geometry(scv).")]]
127 return Geometry(Dune::GeometryTypes::simplex(1), corners_);
132 CornerStorage corners_;
134 GridIndexType elementIndex_;
135 LocalIndexType localDofIdx_;
136 GridIndexType dofIndex_;
the sub control volume for porenetworks
Definition: discretization/porenetwork/subcontrolvolume.hh:53
Geometry geometry() const
The geometry of the sub control volume e.g. for integration.
Definition: discretization/porenetwork/subcontrolvolume.hh:125
T Traits
state the traits public and thus export all types
Definition: discretization/porenetwork/subcontrolvolume.hh:66
LocalIndexType localDofIndex() const
The element-local index of the dof this scv is embedded in.
Definition: discretization/porenetwork/subcontrolvolume.hh:96
GridIndexType dofIndex() const
The index of the dof this scv is embedded in.
Definition: discretization/porenetwork/subcontrolvolume.hh:104
const GlobalPosition & corner(LocalIndexType localIdx) const
Return the corner for the given local index.
Definition: discretization/porenetwork/subcontrolvolume.hh:117
GridIndexType elementIndex() const
The global index of the element this scv is embedded in.
Definition: discretization/porenetwork/subcontrolvolume.hh:112
const GlobalPosition & center() const
Definition: discretization/porenetwork/subcontrolvolume.hh:88
Scalar volume() const
The volume of the sub control volume (part of a pore)
Definition: discretization/porenetwork/subcontrolvolume.hh:92
PNMSubControlVolume(GridIndexType dofIndex, LocalIndexType scvIdx, GridIndexType elementIndex, Corners &&corners, const Scalar volume)
Definition: discretization/porenetwork/subcontrolvolume.hh:73
PNMSubControlVolume()=default
The default constructor.
typename T::GlobalPosition GlobalPosition
export the type used for global coordinates
Definition: discretization/porenetwork/subcontrolvolume.hh:64
LocalIndexType indexInElement() const
The element-local index of this scv.
Definition: discretization/porenetwork/subcontrolvolume.hh:100
const GlobalPosition & dofPosition() const
Definition: discretization/porenetwork/subcontrolvolume.hh:108
Base class for a sub control volume, i.e a part of the control volume we are making the balance for....
Definition: subcontrolvolumebase.hh:26
Define some often used mathematical functions.
Definition: discretization/porenetwork/fvelementgeometry.hh:24
typename GridView::IndexSet::IndexType GridIndex
Definition: indextraits.hh:27
unsigned int LocalIndex
Definition: indextraits.hh:28
Default traits class.
Definition: discretization/porenetwork/subcontrolvolume.hh:29
static const int dim
Definition: discretization/porenetwork/subcontrolvolume.hh:32
typename GridView::Grid Grid
Definition: discretization/porenetwork/subcontrolvolume.hh:30
typename Grid::ctype Scalar
Definition: discretization/porenetwork/subcontrolvolume.hh:37
std::array< GlobalPosition, 2 > CornerStorage
Definition: discretization/porenetwork/subcontrolvolume.hh:39
Dune::AffineGeometry< Scalar, 1, dimWorld > Geometry
Definition: discretization/porenetwork/subcontrolvolume.hh:40
static const int dimWorld
Definition: discretization/porenetwork/subcontrolvolume.hh:33
Dune::FieldVector< Scalar, dimWorld > GlobalPosition
Definition: discretization/porenetwork/subcontrolvolume.hh:38
typename IndexTraits< GridView >::LocalIndex LocalIndexType
Definition: discretization/porenetwork/subcontrolvolume.hh:36
typename IndexTraits< GridView >::GridIndex GridIndexType
Definition: discretization/porenetwork/subcontrolvolume.hh:35
Base class for a sub control volume.