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>
33template<
class Gr
idView>
36 using Grid =
typename GridView::Grid;
38 static const int dim = Grid::dimension;
39 static const int dimWorld = Grid::dimensionworld;
45 using Geometry = Dune::MultiLinearGeometry<Scalar, dim, dimWorld, GeometryTraits>;
63 using Geometry =
typename T::Geometry;
64 using GridIndexType =
typename T::GridIndexType;
65 using LocalIndexType =
typename T::LocalIndexType;
66 using Scalar =
typename T::Scalar;
67 static constexpr int dim = Geometry::mydimension;
79 template<
class Corners>
81 LocalIndexType scvIdx,
84 : dofPosition_(corners[0])
87 , localDofIdx_(scvIdx)
91 volume_ = Dumux::convexPolytopeVolume<dim>(
92 Dune::GeometryTypes::cube(dim),
93 [&](
unsigned int i){
return corners[i]; }
137 return elementIndex_;
144 GridIndexType elementIndex_;
145 LocalIndexType localDofIdx_;
146 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:60
BoxSubControlVolume(const Corners &corners, LocalIndexType scvIdx, GridIndexType elementIndex, GridIndexType dofIndex)
Definition: discretization/box/subcontrolvolume.hh:80
T Traits
state the traits public and thus export all types
Definition: discretization/box/subcontrolvolume.hh:73
LocalIndexType localDofIndex() const
The element-local index of the dof this scv is embedded in.
Definition: discretization/box/subcontrolvolume.hh:110
const GlobalPosition & center() const
The center of the sub control volume.
Definition: discretization/box/subcontrolvolume.hh:98
BoxSubControlVolume()=default
The default constructor.
typename T::GlobalPosition GlobalPosition
export the type used for global coordinates
Definition: discretization/box/subcontrolvolume.hh:71
LocalIndexType indexInElement() const
Definition: discretization/box/subcontrolvolume.hh:117
GridIndexType elementIndex() const
The global index of the element this scv is embedded in.
Definition: discretization/box/subcontrolvolume.hh:135
GridIndexType dofIndex() const
The index of the dof this scv is embedded in.
Definition: discretization/box/subcontrolvolume.hh:123
Scalar volume() const
The volume of the sub control volume.
Definition: discretization/box/subcontrolvolume.hh:104
const GlobalPosition & dofPosition() const
Definition: discretization/box/subcontrolvolume.hh:129
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.
Default traits class to be used for the sub-control volumes for the box scheme.
Definition: discretization/box/subcontrolvolume.hh:35
typename GridView::Grid Grid
Definition: discretization/box/subcontrolvolume.hh:36
Dune::MultiLinearGeometry< Scalar, dim, dimWorld, GeometryTraits > Geometry
Definition: discretization/box/subcontrolvolume.hh:45
typename IndexTraits< GridView >::GridIndex GridIndexType
Definition: discretization/box/subcontrolvolume.hh:41
typename Geometry::GlobalCoordinate GlobalPosition
Definition: discretization/box/subcontrolvolume.hh:47
typename IndexTraits< GridView >::LocalIndex LocalIndexType
Definition: discretization/box/subcontrolvolume.hh:42
static const int dim
Definition: discretization/box/subcontrolvolume.hh:38
static const int dimWorld
Definition: discretization/box/subcontrolvolume.hh:39
typename Grid::ctype Scalar
Definition: discretization/box/subcontrolvolume.hh:43
typename GeometryTraits::template CornerStorage< dim, dimWorld >::Type CornerStorage
Definition: discretization/box/subcontrolvolume.hh:46
Traits for an efficient corner storage for box method sub control volumes.
Definition: boxgeometryhelper.hh:32
typename GridView::IndexSet::IndexType GridIndex
Definition: indextraits.hh:27
unsigned int LocalIndex
Definition: indextraits.hh:28
Base class for a sub control volume.
Compute the volume of several common geometry types.