12#ifndef DUMUX_DISCRETIZATION_BOX_SUBCONTROLVOLUME_HH
13#define DUMUX_DISCRETIZATION_BOX_SUBCONTROLVOLUME_HH
15#include <dune/geometry/type.hh>
16#include <dune/geometry/multilineargeometry.hh>
32template<
class Gr
idView>
35 using Grid =
typename GridView::Grid;
37 static const int dim = Grid::dimension;
38 static const int dimWorld = Grid::dimensionworld;
44 using Geometry = Dune::MultiLinearGeometry<Scalar, dim, dimWorld, GeometryTraits>;
60 using Geometry =
typename T::Geometry;
61 using GridIndexType =
typename T::GridIndexType;
62 using LocalIndexType =
typename T::LocalIndexType;
63 using Scalar =
typename T::Scalar;
64 static constexpr int dim = Geometry::mydimension;
76 template<
class Corners>
78 LocalIndexType scvIdx,
81 : dofPosition_(corners[0])
84 , localDofIdx_(scvIdx)
88 volume_ = Dumux::convexPolytopeVolume<dim>(
89 Dune::GeometryTypes::cube(dim),
90 [&](
unsigned int i){
return corners[i]; }
134 return elementIndex_;
141 GridIndexType elementIndex_;
142 LocalIndexType localDofIdx_;
143 GridIndexType dofIndex_;
Helper class constructing the dual grid finite volume geometries for the box discretizazion method.
Compute the center point of a convex polytope geometry or a random-access container of corner points.
the sub control volume for the box scheme
Definition: discretization/box/subcontrolvolume.hh:58
BoxSubControlVolume(const Corners &corners, LocalIndexType scvIdx, GridIndexType elementIndex, GridIndexType dofIndex)
Definition: discretization/box/subcontrolvolume.hh:77
T Traits
state the traits public and thus export all types
Definition: discretization/box/subcontrolvolume.hh:70
LocalIndexType localDofIndex() const
The element-local index of the dof this scv is embedded in.
Definition: discretization/box/subcontrolvolume.hh:107
const GlobalPosition & center() const
The center of the sub control volume.
Definition: discretization/box/subcontrolvolume.hh:95
BoxSubControlVolume()=default
The default constructor.
typename T::GlobalPosition GlobalPosition
export the type used for global coordinates
Definition: discretization/box/subcontrolvolume.hh:68
LocalIndexType indexInElement() const
Definition: discretization/box/subcontrolvolume.hh:114
GridIndexType elementIndex() const
The global index of the element this scv is embedded in.
Definition: discretization/box/subcontrolvolume.hh:132
GridIndexType dofIndex() const
The index of the dof this scv is embedded in.
Definition: discretization/box/subcontrolvolume.hh:120
Scalar volume() const
The volume of the sub control volume.
Definition: discretization/box/subcontrolvolume.hh:101
const GlobalPosition & dofPosition() const
Definition: discretization/box/subcontrolvolume.hh:126
Define some often used mathematical functions.
Default traits class to be used for the sub-control volumes for the box scheme.
Definition: discretization/box/subcontrolvolume.hh:34
typename GridView::Grid Grid
Definition: discretization/box/subcontrolvolume.hh:35
Dune::MultiLinearGeometry< Scalar, dim, dimWorld, GeometryTraits > Geometry
Definition: discretization/box/subcontrolvolume.hh:44
typename IndexTraits< GridView >::GridIndex GridIndexType
Definition: discretization/box/subcontrolvolume.hh:40
typename Geometry::GlobalCoordinate GlobalPosition
Definition: discretization/box/subcontrolvolume.hh:46
typename IndexTraits< GridView >::LocalIndex LocalIndexType
Definition: discretization/box/subcontrolvolume.hh:41
static const int dim
Definition: discretization/box/subcontrolvolume.hh:37
static const int dimWorld
Definition: discretization/box/subcontrolvolume.hh:38
typename Grid::ctype Scalar
Definition: discretization/box/subcontrolvolume.hh:42
typename GeometryTraits::template CornerStorage< dim, dimWorld >::Type CornerStorage
Definition: discretization/box/subcontrolvolume.hh:45
Traits for an efficient corner storage for box method sub control volumes.
Definition: boxgeometryhelper.hh:33
typename GridView::IndexSet::IndexType GridIndex
Definition: indextraits.hh:27
unsigned int LocalIndex
Definition: indextraits.hh:28
Compute the volume of several common geometry types.