24#ifndef DUMUX_DISCRETIZATION_BOX_SUBCONTROLVOLUME_HH
25#define DUMUX_DISCRETIZATION_BOX_SUBCONTROLVOLUME_HH
27#include <dune/geometry/type.hh>
28#include <dune/geometry/multilineargeometry.hh>
45template<
class Gr
idView>
48 using Grid =
typename GridView::Grid;
50 static const int dim = Grid::dimension;
51 static const int dimWorld = Grid::dimensionworld;
57 using Geometry = Dune::MultiLinearGeometry<Scalar, dim, dimWorld, GeometryTraits>;
75 using Geometry =
typename T::Geometry;
76 using GridIndexType =
typename T::GridIndexType;
77 using LocalIndexType =
typename T::LocalIndexType;
78 using Scalar =
typename T::Scalar;
79 using CornerStorage =
typename T::CornerStorage;
80 static constexpr int dim = Geometry::mydimension;
92 template<
class GeometryHelper>
94 LocalIndexType scvIdx,
97 : corners_(geometryHelper.getScvCorners(scvIdx))
100 , localDofIdx_(scvIdx)
103 volume_ = Dumux::convexPolytopeVolume<dim>(
104 Dune::GeometryTypes::cube(dim),
105 [&](
unsigned int i){
return corners_[i]; }
123 [[deprecated(
"This will be removed after 3.6. Use fvGeometry.geometry(scv).")]]
126 return Geometry(Dune::GeometryTypes::cube(dim), corners_);
158 return elementIndex_;
162 [[deprecated(
"This will be removed after 3.6. Use fvGeometry.geometry(scv).corner(i).")]]
165 assert(localIdx < corners_.size() &&
"provided index exceeds the number of corners");
166 return corners_[localIdx];
170 CornerStorage corners_;
173 GridIndexType elementIndex_;
174 LocalIndexType localDofIdx_;
175 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.
Helper class constructing the dual grid finite volume geometries for the box discretizazion method.
Compute the volume of several common geometry types.
Compute the center point of a convex polytope geometry or a random-access container of corner points.
Adaption of the non-isothermal two-phase two-component flow model to problems with CO2.
Definition: adapt.hh:29
typename GridView::IndexSet::IndexType GridIndex
Definition: indextraits.hh:39
unsigned int LocalIndex
Definition: indextraits.hh:40
Traits for an efficient corner storage for box method sub control volumes.
Definition: boxgeometryhelper.hh:44
Default traits class to be used for the sub-control volumes for the box scheme.
Definition: discretization/box/subcontrolvolume.hh:47
typename GridView::Grid Grid
Definition: discretization/box/subcontrolvolume.hh:48
Dune::MultiLinearGeometry< Scalar, dim, dimWorld, GeometryTraits > Geometry
Definition: discretization/box/subcontrolvolume.hh:57
typename IndexTraits< GridView >::GridIndex GridIndexType
Definition: discretization/box/subcontrolvolume.hh:53
typename IndexTraits< GridView >::LocalIndex LocalIndexType
Definition: discretization/box/subcontrolvolume.hh:54
static const int dim
Definition: discretization/box/subcontrolvolume.hh:50
static const int dimWorld
Definition: discretization/box/subcontrolvolume.hh:51
typename Grid::ctype Scalar
Definition: discretization/box/subcontrolvolume.hh:55
typename CornerStorage::value_type GlobalPosition
Definition: discretization/box/subcontrolvolume.hh:59
typename GeometryTraits::template CornerStorage< dim, dimWorld >::Type CornerStorage
Definition: discretization/box/subcontrolvolume.hh:58
the sub control volume for the box scheme
Definition: discretization/box/subcontrolvolume.hh:72
Geometry geometry() const
The geometry of the sub control volume.
Definition: discretization/box/subcontrolvolume.hh:124
const GlobalPosition & corner(LocalIndexType localIdx) const
Return the corner for the given local index.
Definition: discretization/box/subcontrolvolume.hh:163
T Traits
state the traits public and thus export all types
Definition: discretization/box/subcontrolvolume.hh:86
LocalIndexType localDofIndex() const
The element-local index of the dof this scv is embedded in.
Definition: discretization/box/subcontrolvolume.hh:130
const GlobalPosition & center() const
The center of the sub control volume.
Definition: discretization/box/subcontrolvolume.hh:110
BoxSubControlVolume()=default
The default constructor.
typename T::GlobalPosition GlobalPosition
export the type used for global coordinates
Definition: discretization/box/subcontrolvolume.hh:84
LocalIndexType indexInElement() const
Definition: discretization/box/subcontrolvolume.hh:137
GridIndexType elementIndex() const
The global index of the element this scv is embedded in.
Definition: discretization/box/subcontrolvolume.hh:156
GridIndexType dofIndex() const
The index of the dof this scv is embedded in.
Definition: discretization/box/subcontrolvolume.hh:143
Scalar volume() const
The volume of the sub control volume.
Definition: discretization/box/subcontrolvolume.hh:116
const GlobalPosition & dofPosition() const
Definition: discretization/box/subcontrolvolume.hh:149
BoxSubControlVolume(const GeometryHelper &geometryHelper, LocalIndexType scvIdx, GridIndexType elementIndex, GridIndexType dofIndex)
Definition: discretization/box/subcontrolvolume.hh:93
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