12#ifndef DUMUX_DISCRETIZATION_FACECENTERED_STAGGERED_SUBCONTROLVOLUME_HH
13#define DUMUX_DISCRETIZATION_FACECENTERED_STAGGERED_SUBCONTROLVOLUME_HH
18#include <dune/geometry/type.hh>
19#include <dune/geometry/axisalignedcubegeometry.hh>
31template<
class Gr
idView>
36 using Scalar =
typename GridView::ctype;
37 using Element =
typename GridView::template Codim<0>::Entity;
40 static constexpr int dim = GridView::Grid::dimension;
41 static constexpr int dimWorld = GridView::Grid::dimensionworld;
43 using Geometry = Dune::AxisAlignedCubeGeometry<Scalar, dim, dimWorld>;
50template<
class Gr
idView,
class T = FaceCenteredDefaultScvGeometryTraits<Gr
idView>>
53 using Geometry =
typename T::Geometry;
54 using CornerStorage =
typename T::CornerStorage;
55 using Element =
typename T::Element;
56 using GlobalPosition =
typename T::GlobalPosition;
57 using Scalar =
typename T::Scalar;
58 using GridIndexType =
typename T::GridIndexType;
61 using ElementGeometry =
typename Element::Geometry;
62 using IntersectionGeometry =
typename GridView::Intersection::Geometry;
72 const IntersectionGeometry& intersectionGeometry,
73 const GridIndexType globalIndex,
75 const GridIndexType dofIdx,
76 const SmallLocalIndexType
dofAxis,
77 const GridIndexType eIdx,
79 : center_(0.5*(intersectionGeometry.
center() + elementGeometry.
center()))
80 , dofPosition_(intersectionGeometry.
center())
81 , volume_(elementGeometry.
volume()*0.5)
82 , globalIndex_(globalIndex)
98 {
return dofPosition_; }
107 {
return globalIndex_; }
113 {
return indexInElement_; }
116 {
return indexInElement_; }
122 {
return directionSign_; }
125 {
return boundary_; }
128 GlobalPosition center_;
129 GlobalPosition dofPosition_;
131 GridIndexType globalIndex_;
132 SmallLocalIndexType indexInElement_;
133 GridIndexType dofIdx_;
134 SmallLocalIndexType dofAxis_;
135 std::int_least8_t directionSign_;
Face centered staggered sub control volume.
Definition: discretization/facecentered/staggered/subcontrolvolume.hh:52
const GlobalPosition & center() const
The center of the sub control volume.
Definition: discretization/facecentered/staggered/subcontrolvolume.hh:93
const GlobalPosition & dofPosition() const
The position of the degree of freedom.
Definition: discretization/facecentered/staggered/subcontrolvolume.hh:97
GridIndexType elementIndex() const
Definition: discretization/facecentered/staggered/subcontrolvolume.hh:109
T Traits
state the traits public and thus export all types
Definition: discretization/facecentered/staggered/subcontrolvolume.hh:67
SmallLocalIndexType localDofIndex() const
Definition: discretization/facecentered/staggered/subcontrolvolume.hh:115
Scalar volume() const
Definition: discretization/facecentered/staggered/subcontrolvolume.hh:100
FaceCenteredStaggeredSubControlVolume()=default
SmallLocalIndexType dofAxis() const
Definition: discretization/facecentered/staggered/subcontrolvolume.hh:118
GridIndexType index() const
Definition: discretization/facecentered/staggered/subcontrolvolume.hh:106
SmallLocalIndexType indexInElement() const
Definition: discretization/facecentered/staggered/subcontrolvolume.hh:112
FaceCenteredStaggeredSubControlVolume(const ElementGeometry &elementGeometry, const IntersectionGeometry &intersectionGeometry, const GridIndexType globalIndex, const SmallLocalIndexType indexInElement, const GridIndexType dofIdx, const SmallLocalIndexType dofAxis, const GridIndexType eIdx, const bool boundary)
Definition: discretization/facecentered/staggered/subcontrolvolume.hh:71
std::int_least8_t directionSign() const
Definition: discretization/facecentered/staggered/subcontrolvolume.hh:121
GridIndexType dofIndex() const
Definition: discretization/facecentered/staggered/subcontrolvolume.hh:103
bool boundary() const
Definition: discretization/facecentered/staggered/subcontrolvolume.hh:124
Default traits class to be used for the sub-control volumes for the face-centered staggered scheme.
Definition: discretization/facecentered/staggered/subcontrolvolume.hh:33
static constexpr int dimWorld
Definition: discretization/facecentered/staggered/subcontrolvolume.hh:41
typename GridView::template Codim< 0 >::Entity Element
Definition: discretization/facecentered/staggered/subcontrolvolume.hh:37
std::array< GlobalPosition,(1<<(dim))> CornerStorage
Definition: discretization/facecentered/staggered/subcontrolvolume.hh:42
typename GridView::ctype Scalar
Definition: discretization/facecentered/staggered/subcontrolvolume.hh:36
static constexpr int dim
Definition: discretization/facecentered/staggered/subcontrolvolume.hh:40
typename IndexTraits< GridView >::GridIndex GridIndexType
Definition: discretization/facecentered/staggered/subcontrolvolume.hh:34
Dune::AxisAlignedCubeGeometry< Scalar, dim, dimWorld > Geometry
Definition: discretization/facecentered/staggered/subcontrolvolume.hh:43
typename Element::Geometry::GlobalCoordinate GlobalPosition
Definition: discretization/facecentered/staggered/subcontrolvolume.hh:38
typename IndexTraits< GridView >::LocalIndex LocalIndexType
Definition: discretization/facecentered/staggered/subcontrolvolume.hh:35
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