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>
49template<
class GV,
class T = BoxDefaultScvfGeometryTraits<GV> >
55 using GridIndexType =
typename T::GridIndexType;
56 using LocalIndexType =
typename T::LocalIndexType;
57 using Scalar =
typename T::Scalar;
58 using CornerStorage =
typename T::CornerStorage;
59 using Geometry =
typename T::Geometry;
60 using BoundaryFlag =
typename T::BoundaryFlag;
72 template<
class GeometryHelper,
class Element>
74 const Element& element,
75 const typename Element::Geometry& elemGeometry,
76 unsigned int scvfIndex,
77 std::vector<LocalIndexType>&& scvIndices)
78 : corners_(geometryHelper.getScvfCorners(scvfIndex))
80 , unitOuterNormal_(geometryHelper.
normal(corners_, scvIndices))
81 , area_(geometryHelper.scvfArea(corners_))
82 , scvfIndex_(scvfIndex)
83 , scvIndices_(std::move(scvIndices))
87 , interiorBoundary_(false)
90 for (
const auto&
corner : corners_)
92 center_ /= corners_.size();
96 template<
class GeometryHelper,
class Intersection>
98 const Intersection& intersection,
99 const typename Intersection::Geometry& isGeometry,
100 LocalIndexType indexInIntersection,
101 GridIndexType scvfIndex,
102 std::vector<LocalIndexType>&& scvIndices,
105 : corners_(geometryHelper.getBoundaryScvfCorners(intersection, isGeometry, indexInIntersection))
107 , unitOuterNormal_(intersection.centerUnitOuterNormal())
108 , area_(geometryHelper.scvfArea(corners_))
109 , scvfIndex_(scvfIndex)
110 , scvIndices_(std::move(scvIndices))
111 , facetIndex_(intersection.indexInInside())
112 , indexInFacet_(indexInIntersection)
115 , boundaryFlag_{intersection}
117 for (
const auto&
corner : corners_)
119 center_ /= corners_.size();
136 {
return boundary_; }
140 {
return interiorBoundary_; }
145 {
return unitOuterNormal_; }
149 {
return scvIndices_[0]; }
153 {
return scvfIndex_; }
160 return scvIndices_[1];
173 assert(interiorBoundary_ || boundary_);
181 assert(interiorBoundary_ || boundary_);
182 return indexInFacet_;
187 {
return Geometry(Dune::GeometryTypes::cube(Geometry::mydimension), corners_); }
191 {
return boundaryFlag_.get(); }
196 assert(localIdx < corners_.size() &&
"provided index exceeds the number of corners");
197 return corners_[localIdx];
202 CornerStorage corners_;
208 GridIndexType scvfIndex_;
209 std::vector<LocalIndexType> scvIndices_;
212 LocalIndexType facetIndex_;
213 LocalIndexType indexInFacet_;
217 bool interiorBoundary_;
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:36
std::size_t value_type
Definition: boundaryflag.hh:51
Definition: boundaryflag.hh:68
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:93
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
Class for a sub control volume face in the box method, i.e a part of the boundary of a sub control vo...
Definition: multidomain/facet/box/subcontrolvolumeface.hh:52
bool boundary() const
returns true if the sub control volume face is on the boundary
Definition: multidomain/facet/box/subcontrolvolumeface.hh:135
LocalIndexType facetIndexInElement() const
Definition: multidomain/facet/box/subcontrolvolumeface.hh:171
Geometry geometry() const
The geometry of the sub control volume face.
Definition: multidomain/facet/box/subcontrolvolumeface.hh:186
LocalIndexType insideScvIdx() const
index of the inside sub control volume
Definition: multidomain/facet/box/subcontrolvolumeface.hh:148
GridIndexType index() const
The element-local index of this sub control volume face.
Definition: multidomain/facet/box/subcontrolvolumeface.hh:152
T Traits
state the traits public and thus export all types
Definition: multidomain/facet/box/subcontrolvolumeface.hh:66
Scalar area() const
The area of the sub control volume face.
Definition: multidomain/facet/box/subcontrolvolumeface.hh:131
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:73
typename T::GlobalPosition GlobalPosition
export the type used for global coordinates
Definition: multidomain/facet/box/subcontrolvolumeface.hh:64
BoxFacetCouplingSubControlVolumeFace()=default
The default constructor.
const GlobalPosition & center() const
The center of the sub control volume face.
Definition: multidomain/facet/box/subcontrolvolumeface.hh:123
const GlobalPosition & ipGlobal() const
The integration point for flux evaluations in global coordinates.
Definition: multidomain/facet/box/subcontrolvolumeface.hh:127
const GlobalPosition & corner(unsigned int localIdx) const
returns the position of a corner of the face
Definition: multidomain/facet/box/subcontrolvolumeface.hh:194
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:97
bool interiorBoundary() const
returns true if the sub control volume face is on an interior boundary
Definition: multidomain/facet/box/subcontrolvolumeface.hh:139
std::size_t numOutsideScvs() const
The number of scvs on the outside of this face.
Definition: multidomain/facet/box/subcontrolvolumeface.hh:164
LocalIndexType indexInElementFacet() const
Definition: multidomain/facet/box/subcontrolvolumeface.hh:179
const GlobalPosition & unitOuterNormal() const
Definition: multidomain/facet/box/subcontrolvolumeface.hh:144
BoundaryFlag::value_type boundaryFlag() const
Return the boundary flag.
Definition: multidomain/facet/box/subcontrolvolumeface.hh:190
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:157
Base class for a sub control volume face.