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)
65 : corners_(geometryHelper.getScvfCorners(scvfIndex))
67 , unitOuterNormal_(geometryHelper.
normal(corners_, scvIndices))
69 Dune::GeometryTypes::cube(T::dim-1),
70 [&](unsigned int i){
return corners_[i]; })
72 , scvfIndex_(scvfIndex)
73 , scvIndices_(std::move(scvIndices))
77 , interiorBoundary_(
false)
80 for (
const auto& corner : corners_)
82 center_ /= corners_.size();
86 template<
class GeometryHelper,
class Intersection>
88 const Intersection& intersection,
89 const typename Intersection::Geometry& isGeometry,
90 LocalIndexType indexInIntersection,
91 GridIndexType scvfIndex,
92 std::vector<LocalIndexType>&& scvIndices,
95 : corners_(geometryHelper.getBoundaryScvfCorners(intersection.indexInInside(), indexInIntersection))
97 , unitOuterNormal_(intersection.centerUnitOuterNormal())
99 Dune::GeometryTypes::cube(T::dim-1),
100 [&](unsigned int i){
return corners_[i]; })
102 , scvfIndex_(scvfIndex)
103 , scvIndices_(std::move(scvIndices))
104 , facetIndex_(intersection.indexInInside())
105 , indexInFacet_(indexInIntersection)
108 , boundaryFlag_{intersection}
110 for (
const auto& corner : corners_)
112 center_ /= corners_.size();
129 {
return boundary_; }
133 {
return interiorBoundary_; }
138 {
return unitOuterNormal_; }
142 {
return scvIndices_[0]; }
146 {
return scvfIndex_; }
153 return scvIndices_[1];
166 assert(interiorBoundary_ || boundary_);
174 assert(interiorBoundary_ || boundary_);
175 return indexInFacet_;
179 [[deprecated(
"Will be removed after 3.7. Use fvGeometry.geometry(scvf).")]]
181 {
return Geometry(Dune::GeometryTypes::cube(Geometry::mydimension), corners_); }
185 {
return boundaryFlag_.get(); }
189 CornerStorage corners_;
195 GridIndexType scvfIndex_;
196 std::vector<LocalIndexType> scvIndices_;
199 LocalIndexType facetIndex_;
200 LocalIndexType indexInFacet_;
204 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:128
LocalIndexType facetIndexInElement() const
Definition multidomain/facet/box/subcontrolvolumeface.hh:164
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
Definition multidomain/facet/box/subcontrolvolumeface.hh:141
GridIndexType index() const
The element-local index of this sub control volume face.
Definition multidomain/facet/box/subcontrolvolumeface.hh:145
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:124
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:116
const GlobalPosition & ipGlobal() const
The integration point for flux evaluations in global coordinates.
Definition multidomain/facet/box/subcontrolvolumeface.hh:120
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:87
bool interiorBoundary() const
returns true if the sub control volume face is on an interior boundary
Definition multidomain/facet/box/subcontrolvolumeface.hh:132
std::size_t numOutsideScvs() const
The number of scvs on the outside of this face.
Definition multidomain/facet/box/subcontrolvolumeface.hh:157
LocalIndexType indexInElementFacet() const
Definition multidomain/facet/box/subcontrolvolumeface.hh:172
const GlobalPosition & unitOuterNormal() const
Definition multidomain/facet/box/subcontrolvolumeface.hh:137
BoundaryFlag::value_type boundaryFlag() const
Return the boundary flag.
Definition multidomain/facet/box/subcontrolvolumeface.hh:184
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:150
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.
Vector normal(const Vector &v)
Create a vector normal to the given one (v is expected to be non-zero)
Definition normal.hh:26
auto convexPolytopeVolume(Dune::GeometryType type, const CornerF &c)
Compute the volume of several common geometry types.
Definition volume.hh:41
Definition common/pdesolver.hh:24
Base class for a sub control volume face.
Compute the volume of several common geometry types.