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];
167 assert(interiorBoundary_ || boundary_);
175 assert(interiorBoundary_ || boundary_);
176 return indexInFacet_;
181 {
return Geometry(Dune::GeometryTypes::cube(Geometry::mydimension), corners_); }
185 {
return boundaryFlag_.get(); }
190 assert(localIdx < corners_.size() &&
"provided index exceeds the number of corners");
191 return corners_[localIdx];
196 CornerStorage corners_;
202 GridIndexType scvfIndex_;
203 std::vector<LocalIndexType> scvIndices_;
206 LocalIndexType facetIndex_;
207 LocalIndexType indexInFacet_;
211 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.
Base class for a sub control volume face.
make the local view function available whenever we use the grid geometry
Definition: adapt.hh:29
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 bolean 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:165
Geometry geometry() const
The geometry of the sub control volume face.
Definition: multidomain/facet/box/subcontrolvolumeface.hh:180
LocalIndexType insideScvIdx() const
index of the inside sub control volume for spatial param evaluation
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
LocalIndexType outsideScvIdx() const
Definition: multidomain/facet/box/subcontrolvolumeface.hh:157
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:188
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 bolean if the sub control volume face is on an interior boundary
Definition: multidomain/facet/box/subcontrolvolumeface.hh:139
LocalIndexType indexInElementFacet() const
Definition: multidomain/facet/box/subcontrolvolumeface.hh:173
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:184
Base class for a sub control volume face.