24#ifndef DUMUX_DISCRETIZATION_PNM_SUBCONTROLVOLUME_HH
25#define DUMUX_DISCRETIZATION_PNM_SUBCONTROLVOLUME_HH
27#include <dune/geometry/affinegeometry.hh>
39template<
class Gr
idView>
42 using Grid =
typename GridView::Grid;
44 static const int dim = Grid::dimension;
45 static const int dimWorld = Grid::dimensionworld;
52 using Geometry = Dune::AffineGeometry<Scalar, 1, dimWorld>;
68 using GridIndexType =
typename T::GridIndexType;
69 using LocalIndexType =
typename T::LocalIndexType;
70 using Scalar =
typename T::Scalar;
71 using CornerStorage =
typename T::CornerStorage;
72 using Geometry =
typename T::Geometry;
84 template<
class Corners>
86 LocalIndexType scvIdx,
90 : center_((corners[0]+corners[1])/2.0),
91 corners_(std::forward<CornerStorage>(corners)),
109 {
return localDofIdx_; }
113 {
return localDofIdx_; }
117 {
return dofIndex_; }
121 {
return corners_[0]; }
125 {
return elementIndex_; }
130 assert(localIdx < corners_.size() &&
"provided index exceeds the number of corners");
131 return corners_[localIdx];
137 return Geometry(Dune::GeometryTypes::simplex(1), corners_);
142 CornerStorage corners_;
144 GridIndexType elementIndex_;
145 LocalIndexType localDofIdx_;
146 GridIndexType dofIndex_;
Defines the index types used for grid and local indices.
Define some often used mathematical functions.
Base class for a sub control volume.
Definition: discretization/porenetwork/fvelementgeometry.hh:33
typename GridView::IndexSet::IndexType GridIndex
Definition: indextraits.hh:39
unsigned int LocalIndex
Definition: indextraits.hh:40
Default traits class.
Definition: discretization/porenetwork/subcontrolvolume.hh:41
static const int dim
Definition: discretization/porenetwork/subcontrolvolume.hh:44
typename GridView::Grid Grid
Definition: discretization/porenetwork/subcontrolvolume.hh:42
typename Grid::ctype Scalar
Definition: discretization/porenetwork/subcontrolvolume.hh:49
std::array< GlobalPosition, 2 > CornerStorage
Definition: discretization/porenetwork/subcontrolvolume.hh:51
Dune::AffineGeometry< Scalar, 1, dimWorld > Geometry
Definition: discretization/porenetwork/subcontrolvolume.hh:52
static const int dimWorld
Definition: discretization/porenetwork/subcontrolvolume.hh:45
Dune::FieldVector< Scalar, dimWorld > GlobalPosition
Definition: discretization/porenetwork/subcontrolvolume.hh:50
typename IndexTraits< GridView >::LocalIndex LocalIndexType
Definition: discretization/porenetwork/subcontrolvolume.hh:48
typename IndexTraits< GridView >::GridIndex GridIndexType
Definition: discretization/porenetwork/subcontrolvolume.hh:47
the sub control volume for porenetworks
Definition: discretization/porenetwork/subcontrolvolume.hh:65
Geometry geometry() const
The geometry of the sub control volume e.g. for integration.
Definition: discretization/porenetwork/subcontrolvolume.hh:135
T Traits
state the traits public and thus export all types
Definition: discretization/porenetwork/subcontrolvolume.hh:78
LocalIndexType localDofIndex() const
The element-local index of the dof this scv is embedded in.
Definition: discretization/porenetwork/subcontrolvolume.hh:108
GridIndexType dofIndex() const
The index of the dof this scv is embedded in.
Definition: discretization/porenetwork/subcontrolvolume.hh:116
const GlobalPosition & corner(LocalIndexType localIdx) const
Return the corner for the given local index.
Definition: discretization/porenetwork/subcontrolvolume.hh:128
GridIndexType elementIndex() const
The global index of the element this scv is embedded in.
Definition: discretization/porenetwork/subcontrolvolume.hh:124
const GlobalPosition & center() const
Definition: discretization/porenetwork/subcontrolvolume.hh:100
Scalar volume() const
The volume of the sub control volume (part of a pore)
Definition: discretization/porenetwork/subcontrolvolume.hh:104
PNMSubControlVolume(GridIndexType dofIndex, LocalIndexType scvIdx, GridIndexType elementIndex, Corners &&corners, const Scalar volume)
Definition: discretization/porenetwork/subcontrolvolume.hh:85
PNMSubControlVolume()=default
The default constructor.
typename T::GlobalPosition GlobalPosition
export the type used for global coordinates
Definition: discretization/porenetwork/subcontrolvolume.hh:76
LocalIndexType indexInElement() const
The element-local index of this scv.
Definition: discretization/porenetwork/subcontrolvolume.hh:112
const GlobalPosition & dofPosition() const
Definition: discretization/porenetwork/subcontrolvolume.hh:120
Base class for a sub control volume, i.e a part of the control volume we are making the balance for....
Definition: subcontrolvolumebase.hh:38