12#ifndef DUMUX_DISCRETIZATION_PNM_SUBCONTROLVOLUME_HH
13#define DUMUX_DISCRETIZATION_PNM_SUBCONTROLVOLUME_HH
15#include <dune/geometry/affinegeometry.hh>
26template<
class Gr
idView>
29 using Grid =
typename GridView::Grid;
31 static const int dim = Grid::dimension;
32 static const int dimWorld = Grid::dimensionworld;
38 using Geometry = Dune::AffineGeometry<Scalar, 1, dimWorld>;
52 using GridIndexType =
typename T::GridIndexType;
53 using LocalIndexType =
typename T::LocalIndexType;
54 using Scalar =
typename T::Scalar;
55 using Geometry =
typename T::Geometry;
67 template<
class Corners>
69 LocalIndexType scvIdx,
73 : center_(0.5*(corners[0]+corners[1]))
74 , dofPosition_(corners[0])
77 , localDofIdx_(scvIdx)
92 {
return localDofIdx_; }
96 {
return localDofIdx_; }
100 {
return dofIndex_; }
104 {
return dofPosition_; }
108 {
return elementIndex_; }
114 GridIndexType elementIndex_;
115 LocalIndexType localDofIdx_;
116 GridIndexType dofIndex_;
the sub control volume for porenetworks
Definition: discretization/porenetwork/subcontrolvolume.hh:50
T Traits
state the traits public and thus export all types
Definition: discretization/porenetwork/subcontrolvolume.hh:61
LocalIndexType localDofIndex() const
The element-local index of the dof this scv is embedded in.
Definition: discretization/porenetwork/subcontrolvolume.hh:91
GridIndexType dofIndex() const
The index of the dof this scv is embedded in.
Definition: discretization/porenetwork/subcontrolvolume.hh:99
GridIndexType elementIndex() const
The global index of the element this scv is embedded in.
Definition: discretization/porenetwork/subcontrolvolume.hh:107
const GlobalPosition & center() const
Definition: discretization/porenetwork/subcontrolvolume.hh:83
Scalar volume() const
The volume of the sub control volume (part of a pore)
Definition: discretization/porenetwork/subcontrolvolume.hh:87
PNMSubControlVolume(GridIndexType dofIndex, LocalIndexType scvIdx, GridIndexType elementIndex, Corners &&corners, const Scalar volume)
Definition: discretization/porenetwork/subcontrolvolume.hh:68
PNMSubControlVolume()=default
The default constructor.
typename T::GlobalPosition GlobalPosition
export the type used for global coordinates
Definition: discretization/porenetwork/subcontrolvolume.hh:59
LocalIndexType indexInElement() const
The element-local index of this scv.
Definition: discretization/porenetwork/subcontrolvolume.hh:95
const GlobalPosition & dofPosition() const
Definition: discretization/porenetwork/subcontrolvolume.hh:103
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:28
static const int dim
Definition: discretization/porenetwork/subcontrolvolume.hh:31
typename GridView::Grid Grid
Definition: discretization/porenetwork/subcontrolvolume.hh:29
typename Grid::ctype Scalar
Definition: discretization/porenetwork/subcontrolvolume.hh:36
Dune::AffineGeometry< Scalar, 1, dimWorld > Geometry
Definition: discretization/porenetwork/subcontrolvolume.hh:38
static const int dimWorld
Definition: discretization/porenetwork/subcontrolvolume.hh:32
Dune::FieldVector< Scalar, dimWorld > GlobalPosition
Definition: discretization/porenetwork/subcontrolvolume.hh:37
typename IndexTraits< GridView >::LocalIndex LocalIndexType
Definition: discretization/porenetwork/subcontrolvolume.hh:35
typename IndexTraits< GridView >::GridIndex GridIndexType
Definition: discretization/porenetwork/subcontrolvolume.hh:34