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>
38template<
class GV,
class T = BoxDefaultScvfGeometryTraits<GV> >
42 using GridIndexType =
typename T::GridIndexType;
43 using LocalIndexType =
typename T::LocalIndexType;
44 using Scalar =
typename T::Scalar;
45 using CornerStorage =
typename T::CornerStorage;
46 using Geometry =
typename T::Geometry;
47 using BoundaryFlag =
typename T::BoundaryFlag;
59 template<
class GeometryHelper,
class Element>
61 const Element& element,
62 const typename Element::Geometry& elemGeometry,
63 unsigned int scvfIndex,
64 std::vector<LocalIndexType>&& scvIndices)
66 , scvfIndex_(scvfIndex)
67 , scvIndices_(std::move(scvIndices))
71 , interiorBoundary_(false)
74 const auto corners = geometryHelper.getScvfCorners(scvfIndex);
75 unitOuterNormal_ = geometryHelper.normal(corners, scvIndices_);
77 Dune::GeometryTypes::cube(T::dim-1),
78 [&](
unsigned int i){
return corners[i]; });
79 for (
const auto& corner : corners)
81 center_ /= corners.size();
85 template<
class GeometryHelper,
class Intersection>
87 const Intersection& intersection,
88 const typename Intersection::Geometry& isGeometry,
89 LocalIndexType indexInIntersection,
90 GridIndexType scvfIndex,
91 std::vector<LocalIndexType>&& scvIndices,
95 , unitOuterNormal_(intersection.centerUnitOuterNormal())
96 , scvfIndex_(scvfIndex)
97 , scvIndices_(std::move(scvIndices))
98 , facetIndex_(intersection.indexInInside())
99 , indexInFacet_(indexInIntersection)
102 , boundaryFlag_{intersection}
104 auto corners = geometryHelper.getBoundaryScvfCorners(intersection.indexInInside(), indexInIntersection);
106 Dune::GeometryTypes::cube(T::dim-1),
107 [&](
unsigned int i){ return corners[i]; });
108 for (
const auto& corner : corners)
110 center_ /= corners.size();
127 {
return boundary_; }
131 {
return interiorBoundary_; }
136 {
return unitOuterNormal_; }
140 {
return scvIndices_[0]; }
144 {
return scvfIndex_; }
151 return scvIndices_[1];
164 assert(interiorBoundary_ || boundary_);
172 assert(interiorBoundary_ || boundary_);
173 return indexInFacet_;
178 {
return boundaryFlag_.get(); }
187 GridIndexType scvfIndex_;
188 std::vector<LocalIndexType> scvIndices_;
191 LocalIndexType facetIndex_;
192 LocalIndexType indexInFacet_;
196 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:55
std::size_t value_type
Definition boundaryflag.hh:39
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:41
bool boundary() const
returns true if the sub control volume face is on the boundary
Definition multidomain/facet/box/subcontrolvolumeface.hh:126
LocalIndexType facetIndexInElement() const
Definition multidomain/facet/box/subcontrolvolumeface.hh:162
LocalIndexType insideScvIdx() const
index of the inside sub control volume
Definition multidomain/facet/box/subcontrolvolumeface.hh:139
GridIndexType index() const
The element-local index of this sub control volume face.
Definition multidomain/facet/box/subcontrolvolumeface.hh:143
T Traits
state the traits public and thus export all types
Definition multidomain/facet/box/subcontrolvolumeface.hh:53
Scalar area() const
The area of the sub control volume face.
Definition multidomain/facet/box/subcontrolvolumeface.hh:122
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:60
typename T::GlobalPosition GlobalPosition
export the type used for global coordinates
Definition multidomain/facet/box/subcontrolvolumeface.hh:51
BoxFacetCouplingSubControlVolumeFace()=default
The default constructor.
const GlobalPosition & center() const
The center of the sub control volume face.
Definition multidomain/facet/box/subcontrolvolumeface.hh:114
const GlobalPosition & ipGlobal() const
The integration point for flux evaluations in global coordinates.
Definition multidomain/facet/box/subcontrolvolumeface.hh:118
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:86
bool interiorBoundary() const
returns true if the sub control volume face is on an interior boundary
Definition multidomain/facet/box/subcontrolvolumeface.hh:130
std::size_t numOutsideScvs() const
The number of scvs on the outside of this face.
Definition multidomain/facet/box/subcontrolvolumeface.hh:155
LocalIndexType indexInElementFacet() const
Definition multidomain/facet/box/subcontrolvolumeface.hh:170
const GlobalPosition & unitOuterNormal() const
Definition multidomain/facet/box/subcontrolvolumeface.hh:135
BoundaryFlag::value_type boundaryFlag() const
Return the boundary flag.
Definition multidomain/facet/box/subcontrolvolumeface.hh:177
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:148
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:29
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
Base class for a sub control volume face.
Compute the volume of several common geometry types.