24#ifndef DUMUX_DISCRETIZATION_BOX_SUBCONTROLVOLUMEFACE_HH
25#define DUMUX_DISCRETIZATION_BOX_SUBCONTROLVOLUMEFACE_HH
29#include <dune/geometry/type.hh>
30#include <dune/geometry/multilineargeometry.hh>
47template<
class Gr
idView>
50 using Grid =
typename GridView::Grid;
51 static constexpr int dim = Grid::dimension;
52 static constexpr int dimWorld = Grid::dimensionworld;
77 using GridIndexType =
typename T::GridIndexType;
78 using LocalIndexType =
typename T::LocalIndexType;
79 using Scalar =
typename T::Scalar;
80 using CornerStorage =
typename T::CornerStorage;
81 using Geometry =
typename T::Geometry;
82 using BoundaryFlag =
typename T::BoundaryFlag;
83 static constexpr int dim = Geometry::mydimension;
95 template<
class GeometryHelper,
class Element>
97 const Element& element,
98 const typename Element::Geometry& elemGeometry,
99 GridIndexType scvfIndex,
100 std::vector<LocalIndexType>&& scvIndices,
102 : corners_(geometryHelper.getScvfCorners(scvfIndex))
104 , unitOuterNormal_(geometryHelper.
normal(corners_, scvIndices))
105 , scvfIndex_(scvfIndex)
106 , scvIndices_(std::move(scvIndices))
110 area_ = Dumux::convexPolytopeVolume<dim>(
111 Dune::GeometryTypes::cube(dim),
112 [&](
unsigned int i){
return corners_[i]; }
117 template<
class GeometryHelper,
class Intersection>
119 const Intersection& intersection,
120 const typename Intersection::Geometry& isGeometry,
121 LocalIndexType indexInIntersection,
122 GridIndexType scvfIndex,
123 std::vector<LocalIndexType>&& scvIndices,
125 : corners_(geometryHelper.getBoundaryScvfCorners(intersection.indexInInside(), indexInIntersection))
127 , unitOuterNormal_(intersection.centerUnitOuterNormal())
128 , scvfIndex_(scvfIndex)
129 , scvIndices_(std:: move(scvIndices))
131 , boundaryFlag_{intersection}
133 area_ = Dumux::convexPolytopeVolume<dim>(
134 Dune::GeometryTypes::cube(dim),
135 [&](
unsigned int i){
return corners_[i]; }
165 return unitOuterNormal_;
171 return scvIndices_[0];
179 return scvIndices_[1];
185 return static_cast<std::size_t
>(!
boundary());
194 [[deprecated(
"This will be removed after 3.6. Use fvGeometry.geometry(scvf).corner(i).")]]
197 assert(localIdx < corners_.size() &&
"provided index exceeds the number of corners");
198 return corners_[localIdx];
202 [[deprecated(
"This will be removed after 3.6. Use fvGeometry.geometry(scvf).")]]
205 return Geometry(Dune::GeometryTypes::cube(dim), corners_);
211 return boundaryFlag_.get();
215 CornerStorage corners_;
219 GridIndexType scvfIndex_;
220 std::vector<LocalIndexType> scvIndices_;
Boundary flag to store e.g. in sub control volume faces.
Defines the index types used for grid and local indices.
Helper class constructing the dual grid finite volume geometries for the box discretizazion method.
Base class for a sub control volume face.
Compute the center point of a convex polytope geometry or a random-access container of corner points.
Compute the volume of several common geometry types.
Vector normal(const Vector &v)
Create a vector normal to the given one (v is expected to be non-zero)
Definition: normal.hh:38
Adaption of the non-isothermal two-phase two-component flow model to problems with CO2.
Definition: adapt.hh:29
std::size_t value_type
Definition: boundaryflag.hh:51
Boundary flag to store e.g. in sub control volume faces.
Definition: boundaryflag.hh:67
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 volume faces for the box scheme.
Definition: discretization/box/subcontrolvolumeface.hh:49
typename Grid::ctype Scalar
Definition: discretization/box/subcontrolvolumeface.hh:55
typename CornerStorage::value_type GlobalPosition
Definition: discretization/box/subcontrolvolumeface.hh:59
typename GridView::Grid Grid
Definition: discretization/box/subcontrolvolumeface.hh:50
typename GeometryTraits::template CornerStorage< dim-1, dimWorld >::Type CornerStorage
Definition: discretization/box/subcontrolvolumeface.hh:58
static constexpr int dimWorld
Definition: discretization/box/subcontrolvolumeface.hh:52
typename IndexTraits< GridView >::LocalIndex LocalIndexType
Definition: discretization/box/subcontrolvolumeface.hh:54
static constexpr int dim
Definition: discretization/box/subcontrolvolumeface.hh:51
typename IndexTraits< GridView >::GridIndex GridIndexType
Definition: discretization/box/subcontrolvolumeface.hh:53
Dune::MultiLinearGeometry< Scalar, dim-1, dimWorld, GeometryTraits > Geometry
Definition: discretization/box/subcontrolvolumeface.hh:57
Class for a sub control volume face in the box method, i.e a part of the boundary of a sub control vo...
Definition: discretization/box/subcontrolvolumeface.hh:74
LocalIndexType outsideScvIdx(int i=0) const
Index of the i-th outside sub control volume or boundary scv index.
Definition: discretization/box/subcontrolvolumeface.hh:176
const GlobalPosition & unitOuterNormal() const
Definition: discretization/box/subcontrolvolumeface.hh:163
T Traits
state the traits public and thus export all types
Definition: discretization/box/subcontrolvolumeface.hh:89
GridIndexType index() const
The local index of this sub control volume face.
Definition: discretization/box/subcontrolvolumeface.hh:189
BoxSubControlVolumeFace(const GeometryHelper &geometryHelper, const Intersection &intersection, const typename Intersection::Geometry &isGeometry, LocalIndexType indexInIntersection, GridIndexType scvfIndex, std::vector< LocalIndexType > &&scvIndices, bool boundary=false)
Constructor for boundary scvfs.
Definition: discretization/box/subcontrolvolumeface.hh:118
BoxSubControlVolumeFace()=default
The default constructor.
const GlobalPosition & center() const
The center of the sub control volume face.
Definition: discretization/box/subcontrolvolumeface.hh:140
bool boundary() const
returns true if the sub control volume face is on the boundary
Definition: discretization/box/subcontrolvolumeface.hh:158
LocalIndexType insideScvIdx() const
index of the inside sub control volume
Definition: discretization/box/subcontrolvolumeface.hh:169
BoundaryFlag::value_type boundaryFlag() const
Return the boundary flag.
Definition: discretization/box/subcontrolvolumeface.hh:209
const GlobalPosition & corner(unsigned int localIdx) const
Definition: discretization/box/subcontrolvolumeface.hh:195
std::size_t numOutsideScvs() const
The number of scvs on the outside of this face.
Definition: discretization/box/subcontrolvolumeface.hh:183
BoxSubControlVolumeFace(const GeometryHelper &geometryHelper, const Element &element, const typename Element::Geometry &elemGeometry, GridIndexType scvfIndex, std::vector< LocalIndexType > &&scvIndices, bool boundary=false)
Constructor for inner scvfs.
Definition: discretization/box/subcontrolvolumeface.hh:96
const GlobalPosition & ipGlobal() const
The integration point for flux evaluations in global coordinates.
Definition: discretization/box/subcontrolvolumeface.hh:146
typename T::GlobalPosition GlobalPosition
export the type used for global coordinates
Definition: discretization/box/subcontrolvolumeface.hh:87
Geometry geometry() const
The geometry of the sub control volume face.
Definition: discretization/box/subcontrolvolumeface.hh:203
Scalar area() const
The area of the sub control volume face.
Definition: discretization/box/subcontrolvolumeface.hh:152
Base class for a sub control volume face, i.e a part of the boundary of a sub control volume we compu...
Definition: subcontrolvolumefacebase.hh:41