14#ifndef DUMUX_FACETCOUPLING_BOX_SUBCONTROLVOLUMEFACE_HH
15#define DUMUX_FACETCOUPLING_BOX_SUBCONTROLVOLUMEFACE_HH
19#include <dune/geometry/type.hh>
20#include <dune/geometry/multilineargeometry.hh>
37template<
class GV,
class T = BoxDefaultScvfGeometryTraits<GV> >
40 using GridIndexType =
typename T::GridIndexType;
41 using LocalIndexType =
typename T::LocalIndexType;
42 using Scalar =
typename T::Scalar;
43 using CornerStorage =
typename T::CornerStorage;
44 using Geometry =
typename T::Geometry;
45 using BoundaryFlag =
typename T::BoundaryFlag;
57 template<
class GeometryHelper,
class Element>
59 const Element& element,
60 unsigned int scvfIndex,
61 std::array<LocalIndexType, 2>&& scvIndices)
63 , scvfIndex_(scvfIndex)
64 , scvIndices_(std::move(scvIndices))
68 , interiorBoundary_(false)
71 const auto corners = geometryHelper.getScvfCorners(scvfIndex);
72 unitOuterNormal_ = geometryHelper.normal(corners, scvIndices_);
74 Dune::GeometryTypes::cube(T::dim-1),
75 [&](
unsigned int i){
return corners[i]; });
76 for (
const auto& corner : corners)
78 center_ /= corners.size();
82 template<
class GeometryHelper,
class Intersection>
84 const Intersection& intersection,
85 LocalIndexType indexInIntersection,
86 GridIndexType scvfIndex,
87 std::array<LocalIndexType, 2>&& scvIndices,
91 , unitOuterNormal_(intersection.centerUnitOuterNormal())
92 , scvfIndex_(scvfIndex)
93 , scvIndices_(std::move(scvIndices))
94 , facetIndex_(intersection.indexInInside())
95 , indexInFacet_(indexInIntersection)
98 , boundaryFlag_{intersection}
100 auto corners = geometryHelper.getBoundaryScvfCorners(intersection.indexInInside(), indexInIntersection);
102 Dune::GeometryTypes::cube(T::dim-1),
103 [&](
unsigned int i){ return corners[i]; });
104 for (
const auto& corner : corners)
106 center_ /= corners.size();
123 {
return boundary_; }
127 {
return interiorBoundary_; }
132 {
return unitOuterNormal_; }
136 {
return scvIndices_[0]; }
140 {
return scvfIndex_; }
147 return scvIndices_[1];
160 assert(interiorBoundary_ || boundary_);
168 assert(interiorBoundary_ || boundary_);
169 return indexInFacet_;
174 {
return boundaryFlag_.get(); }
183 GridIndexType scvfIndex_;
184 std::array<LocalIndexType, 2> scvIndices_;
187 LocalIndexType facetIndex_;
188 LocalIndexType indexInFacet_;
192 bool interiorBoundary_;
Boundary flag to store e.g. in sub control volume faces.
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.
Definition boundaryflag.hh:58
std::size_t value_type
Definition boundaryflag.hh:28
bool boundary() const
Definition multidomain/facet/box/subcontrolvolumeface.hh:122
LocalIndexType facetIndexInElement() const
Definition multidomain/facet/box/subcontrolvolumeface.hh:158
LocalIndexType insideScvIdx() const
index of the inside sub control volume
Definition multidomain/facet/box/subcontrolvolumeface.hh:135
GridIndexType index() const
The element-local index of this sub control volume face.
Definition multidomain/facet/box/subcontrolvolumeface.hh:139
BoxDefaultScvfGeometryTraits< GridView > Traits
Definition multidomain/facet/box/subcontrolvolumeface.hh:51
BoxFacetCouplingSubControlVolumeFace(const GeometryHelper &geometryHelper, const Intersection &intersection, LocalIndexType indexInIntersection, GridIndexType scvfIndex, std::array< LocalIndexType, 2 > &&scvIndices, bool boundary, bool interiorBoundary)
Constructor for domain or interior boundary scvfs.
Definition multidomain/facet/box/subcontrolvolumeface.hh:83
Scalar area() const
The area of the sub control volume face.
Definition multidomain/facet/box/subcontrolvolumeface.hh:118
typename BoxDefaultScvfGeometryTraits< GridView >::GlobalPosition GlobalPosition
Definition multidomain/facet/box/subcontrolvolumeface.hh:49
BoxFacetCouplingSubControlVolumeFace()=default
The default constructor.
const GlobalPosition & center() const
The center of the sub control volume face.
Definition multidomain/facet/box/subcontrolvolumeface.hh:110
const GlobalPosition & ipGlobal() const
The integration point for flux evaluations in global coordinates.
Definition multidomain/facet/box/subcontrolvolumeface.hh:114
bool interiorBoundary() const
Definition multidomain/facet/box/subcontrolvolumeface.hh:126
std::size_t numOutsideScvs() const
The number of scvs on the outside of this face.
Definition multidomain/facet/box/subcontrolvolumeface.hh:151
LocalIndexType indexInElementFacet() const
Definition multidomain/facet/box/subcontrolvolumeface.hh:166
BoxFacetCouplingSubControlVolumeFace(const GeometryHelper &geometryHelper, const Element &element, unsigned int scvfIndex, std::array< LocalIndexType, 2 > &&scvIndices)
Constructor for inner scvfs.
Definition multidomain/facet/box/subcontrolvolumeface.hh:58
const GlobalPosition & unitOuterNormal() const
Definition multidomain/facet/box/subcontrolvolumeface.hh:131
BoundaryFlag::value_type boundaryFlag() const
Return the boundary flag.
Definition multidomain/facet/box/subcontrolvolumeface.hh:173
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:144
Base class for a sub control volume face.
auto convexPolytopeVolume(Dune::GeometryType type, const CornerF &c)
Compute the volume of several common geometry types.
Definition volume.hh:41
Compute the volume of several common geometry types.