26#ifndef DUMUX_FACETCOUPLING_BOX_SUBCONTROLVOLUMEFACE_HH
27#define DUMUX_FACETCOUPLING_BOX_SUBCONTROLVOLUMEFACE_HH
31#include <dune/geometry/type.hh>
32#include <dune/geometry/multilineargeometry.hh>
50template<
class GV,
class T = BoxDefaultScvfGeometryTraits<GV> >
56 using GridIndexType =
typename T::GridIndexType;
57 using LocalIndexType =
typename T::LocalIndexType;
58 using Scalar =
typename T::Scalar;
59 using CornerStorage =
typename T::CornerStorage;
60 using Geometry =
typename T::Geometry;
61 using BoundaryFlag =
typename T::BoundaryFlag;
73 template<
class GeometryHelper,
class Element>
75 const Element& element,
76 const typename Element::Geometry& elemGeometry,
77 unsigned int scvfIndex,
78 std::vector<LocalIndexType>&& scvIndices)
79 : corners_(geometryHelper.getScvfCorners(scvfIndex))
81 , unitOuterNormal_(geometryHelper.
normal(corners_, scvIndices))
83 Dune::GeometryTypes::cube(T::dim-1),
84 [&](unsigned int i){
return corners_[i]; })
86 , scvfIndex_(scvfIndex)
87 , scvIndices_(std::move(scvIndices))
91 , interiorBoundary_(
false)
94 for (
const auto&
corner : corners_)
96 center_ /= corners_.size();
100 template<
class GeometryHelper,
class Intersection>
102 const Intersection& intersection,
103 const typename Intersection::Geometry& isGeometry,
104 LocalIndexType indexInIntersection,
105 GridIndexType scvfIndex,
106 std::vector<LocalIndexType>&& scvIndices,
109 : corners_(geometryHelper.getBoundaryScvfCorners(intersection.indexInInside(), indexInIntersection))
111 , unitOuterNormal_(intersection.centerUnitOuterNormal())
113 Dune::GeometryTypes::cube(T::dim-1),
114 [&](unsigned int i){
return corners_[i]; })
116 , scvfIndex_(scvfIndex)
117 , scvIndices_(std::move(scvIndices))
118 , facetIndex_(intersection.indexInInside())
119 , indexInFacet_(indexInIntersection)
122 , boundaryFlag_{intersection}
124 for (
const auto&
corner : corners_)
126 center_ /= corners_.size();
143 {
return boundary_; }
147 {
return interiorBoundary_; }
152 {
return unitOuterNormal_; }
156 {
return scvIndices_[0]; }
160 {
return scvfIndex_; }
167 return scvIndices_[1];
180 assert(interiorBoundary_ || boundary_);
188 assert(interiorBoundary_ || boundary_);
189 return indexInFacet_;
194 {
return Geometry(Dune::GeometryTypes::cube(Geometry::mydimension), corners_); }
198 {
return boundaryFlag_.get(); }
203 assert(localIdx < corners_.size() &&
"provided index exceeds the number of corners");
204 return corners_[localIdx];
209 CornerStorage corners_;
215 GridIndexType scvfIndex_;
216 std::vector<LocalIndexType> scvIndices_;
219 LocalIndexType facetIndex_;
220 LocalIndexType indexInFacet_;
224 bool interiorBoundary_;
Compute the volume of several common geometry types.
Base class for a sub control volume face.
Helper class constructing the dual grid finite volume geometries for the box discretizazion method.
Boundary flag to store e.g. in sub control volume faces.
Vector normal(const Vector &v)
Create a vector normal to the given one (v is expected to be non-zero).
Definition normal.hh:38
auto convexPolytopeVolume(Dune::GeometryType type, const CornerF &c)
Compute the volume of several common geometry types.
Definition volume.hh:53
Adaption of the non-isothermal two-phase two-component flow model to problems with CO2.
Definition adapt.hh:29
Definition deprecated.hh:149
std::size_t value_type
Definition boundaryflag.hh:51
Boundary flag to store e.g. in sub control volume faces.
Definition boundaryflag.hh:67
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
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
bool boundary() const
Definition multidomain/facet/box/subcontrolvolumeface.hh:142
LocalIndexType facetIndexInElement() const
Definition multidomain/facet/box/subcontrolvolumeface.hh:178
Geometry geometry() const
The geometry of the sub control volume face.
Definition multidomain/facet/box/subcontrolvolumeface.hh:193
LocalIndexType insideScvIdx() const
index of the inside sub control volume
Definition multidomain/facet/box/subcontrolvolumeface.hh:155
GridIndexType index() const
The element-local index of this sub control volume face.
Definition multidomain/facet/box/subcontrolvolumeface.hh:159
BoxDefaultScvfGeometryTraits< GridView > Traits
Definition multidomain/facet/box/subcontrolvolumeface.hh:67
Scalar area() const
The area of the sub control volume face.
Definition multidomain/facet/box/subcontrolvolumeface.hh:138
BoxFacetCouplingSubControlVolumeFace(const GeometryHelper &geometryHelper, const Element &element, const typename Element::Geometry &elemGeometry, unsigned int scvfIndex, std::vector< LocalIndexType > &&scvIndices)
Constructor for inner scvfs.
Definition multidomain/facet/box/subcontrolvolumeface.hh:74
typename BoxDefaultScvfGeometryTraits< GridView >::GlobalPosition GlobalPosition
Definition multidomain/facet/box/subcontrolvolumeface.hh:65
BoxFacetCouplingSubControlVolumeFace()=default
The default constructor.
const GlobalPosition & center() const
The center of the sub control volume face.
Definition multidomain/facet/box/subcontrolvolumeface.hh:130
const GlobalPosition & ipGlobal() const
The integration point for flux evaluations in global coordinates.
Definition multidomain/facet/box/subcontrolvolumeface.hh:134
const GlobalPosition & corner(unsigned int localIdx) const
returns the position of a corner of the face
Definition multidomain/facet/box/subcontrolvolumeface.hh:201
BoxFacetCouplingSubControlVolumeFace(const GeometryHelper &geometryHelper, const Intersection &intersection, const typename Intersection::Geometry &isGeometry, LocalIndexType indexInIntersection, GridIndexType scvfIndex, std::vector< LocalIndexType > &&scvIndices, bool boundary, bool interiorBoundary)
Constructor for domain or interior boundary scvfs.
Definition multidomain/facet/box/subcontrolvolumeface.hh:101
bool interiorBoundary() const
Definition multidomain/facet/box/subcontrolvolumeface.hh:146
std::size_t numOutsideScvs() const
The number of scvs on the outside of this face.
Definition multidomain/facet/box/subcontrolvolumeface.hh:171
LocalIndexType indexInElementFacet() const
Definition multidomain/facet/box/subcontrolvolumeface.hh:186
const GlobalPosition & unitOuterNormal() const
Definition multidomain/facet/box/subcontrolvolumeface.hh:151
BoundaryFlag::value_type boundaryFlag() const
Return the boundary flag.
Definition multidomain/facet/box/subcontrolvolumeface.hh:197
LocalIndexType outsideScvIdx(int i=0) const
Index of the i-th outside sub control volume or boundary scv index.
Definition multidomain/facet/box/subcontrolvolumeface.hh:164
Base class for a sub control volume face.