12#ifndef DUMUX_DISCRETIZATION_CC_MPFA_SUBCONTROLVOLUMEFACE_HH
13#define DUMUX_DISCRETIZATION_CC_MPFA_SUBCONTROLVOLUMEFACE_HH
18#include <dune/common/reservedvector.hh>
19#include <dune/common/fvector.hh>
20#include <dune/geometry/type.hh>
21#include <dune/geometry/multilineargeometry.hh>
34template<
class Gr
idView>
37 using Grid =
typename GridView::Grid;
39 static const int dim = Grid::dimension;
40 static const int dimWorld = Grid::dimensionworld;
46 std::vector<GridIndexType>,
47 Dune::ReservedVector<GridIndexType, 1> >;
55 template<
int mydim,
int cdim >
58 using Type = std::array< Dune::FieldVector< ct, cdim >, (1<<(
dim-1)) >;
65 static const bool v =
true;
66 static const unsigned int topologyId = Dune::GeometryTypes::cube(
dim).id();
87 using GridIndexType =
typename T::GridIndexType;
88 using Scalar =
typename T::Scalar;
89 using CornerStorage =
typename T::CornerStorage;
90 using OutsideGridIndexStorage =
typename T::OutsideGridIndexStorage;
91 using Geometry =
typename T::Geometry;
92 using BoundaryFlag =
typename T::BoundaryFlag;
115 template<
class MpfaHelper,
class Intersection>
118 const Intersection& intersection,
119 GridIndexType vIdxGlobal,
120 unsigned int vIdxLocal,
121 GridIndexType scvfIndex,
127 , vertexIndex_(vIdxGlobal)
128 , scvfIndex_(scvfIndex)
131 , vIdxInElement_(vIdxLocal)
134 , unitOuterNormal_(intersection.centerUnitOuterNormal())
135 , boundaryFlag_{intersection}
138 for (
const auto&
corner : corners_)
140 center_ /= corners_.size();
143 ipGlobal_ = helper.getScvfIntegrationPoint(corners_, q);
144 area_ = helper.computeScvfArea(corners_);
153 {
return boundary_; }
157 {
return scvfIndex_; }
161 {
return vertexIndex_; }
165 {
return vIdxInElement_; }
169 {
return insideScvIdx_; }
173 {
return outsideScvIndices_.size(); }
178 {
return outsideScvIndices_[i]; }
182 {
return outsideScvIndices_; }
186 {
return corners_.size(); }
189 [[deprecated(
"Will be removed after 3.7. Use fvGeometry.geometry(scvf).corner(i).")]]
192 assert(localIdx < corners_.size() &&
"provided index exceeds the number of corners");
193 return corners_[localIdx];
198 {
return corners_.back(); }
202 {
return corners_[0]; }
210 {
return ipGlobal_; }
214 {
return unitOuterNormal_; }
217 [[deprecated(
"Will be removed after 3.7. Use fvGeometry.geometry(scvf).")]]
219 {
return Geometry(Dune::GeometryTypes::cube(Geometry::mydimension), corners_); }
223 {
return boundaryFlag_.get(); }
227 GridIndexType vertexIndex_;
228 GridIndexType scvfIndex_;
229 GridIndexType insideScvIdx_;
230 OutsideGridIndexStorage outsideScvIndices_;
231 unsigned int vIdxInElement_;
233 CornerStorage corners_;
Boundary flag to store e.g. in sub control volume faces.
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 mpfa methods, i.e a part of the boundary of a control volume w...
Definition: discretization/cellcentered/mpfa/subcontrolvolumeface.hh:86
std::size_t corners() const
Returns the number of corners.
Definition: discretization/cellcentered/mpfa/subcontrolvolumeface.hh:185
GridIndexType index() const
The global index of this sub control volume face.
Definition: discretization/cellcentered/mpfa/subcontrolvolumeface.hh:156
const GlobalPosition & ipGlobal() const
The integration point for flux evaluations in global coordinates.
Definition: discretization/cellcentered/mpfa/subcontrolvolumeface.hh:209
unsigned int vertexIndexInElement() const
Returns the element-local vertex index the scvf is connected to.
Definition: discretization/cellcentered/mpfa/subcontrolvolumeface.hh:164
Scalar area() const
The area of the sub control volume face.
Definition: discretization/cellcentered/mpfa/subcontrolvolumeface.hh:148
typename T::GlobalPosition GlobalPosition
export the type used for global coordinates
Definition: discretization/cellcentered/mpfa/subcontrolvolumeface.hh:96
GridIndexType insideScvIdx() const
index of the inside sub control volume
Definition: discretization/cellcentered/mpfa/subcontrolvolumeface.hh:168
const GlobalPosition & vertexCorner() const
Returns the global position of the vertex the scvf is connected to.
Definition: discretization/cellcentered/mpfa/subcontrolvolumeface.hh:197
const GlobalPosition & unitOuterNormal() const
returns the unit outer normal vector (assumes non-curved geometries)
Definition: discretization/cellcentered/mpfa/subcontrolvolumeface.hh:213
const GlobalPosition & facetCorner() const
Returns the global position of the center of the element facet this scvf is embedded in.
Definition: discretization/cellcentered/mpfa/subcontrolvolumeface.hh:201
const GlobalPosition & center() const
The center of the sub control volume face.
Definition: discretization/cellcentered/mpfa/subcontrolvolumeface.hh:205
const GlobalPosition & corner(unsigned int localIdx) const
Returns the corner for a given local index.
Definition: discretization/cellcentered/mpfa/subcontrolvolumeface.hh:190
GridIndexType outsideScvIdx(int i=0) const
Index of the i-th outside sub control volume or boundary scv index.
Definition: discretization/cellcentered/mpfa/subcontrolvolumeface.hh:177
BoundaryFlag::value_type boundaryFlag() const
Return the boundary flag.
Definition: discretization/cellcentered/mpfa/subcontrolvolumeface.hh:222
Geometry geometry() const
The geometry of the sub control volume face.
Definition: discretization/cellcentered/mpfa/subcontrolvolumeface.hh:218
GridIndexType vertexIndex() const
Returns the index of the vertex the scvf is connected to.
Definition: discretization/cellcentered/mpfa/subcontrolvolumeface.hh:160
const OutsideGridIndexStorage & outsideScvIndices() const
returns the outside scv indices (can be more than one index for dim < dimWorld)
Definition: discretization/cellcentered/mpfa/subcontrolvolumeface.hh:181
CCMpfaSubControlVolumeFace(const MpfaHelper &helper, CornerStorage &&corners, const Intersection &intersection, GridIndexType vIdxGlobal, unsigned int vIdxLocal, GridIndexType scvfIndex, GridIndexType insideScvIdx, const OutsideGridIndexStorage &outsideScvIndices, Scalar q, bool boundary)
Constructor.
Definition: discretization/cellcentered/mpfa/subcontrolvolumeface.hh:116
bool boundary() const
returns true if the sub control volume face is on the domain boundary
Definition: discretization/cellcentered/mpfa/subcontrolvolumeface.hh:152
T Traits
state the traits public and thus export all types
Definition: discretization/cellcentered/mpfa/subcontrolvolumeface.hh:98
std::size_t numOutsideScvs() const
The number of scvs on the outside of this scv face.
Definition: discretization/cellcentered/mpfa/subcontrolvolumeface.hh:172
Definition: discretization/cellcentered/mpfa/subcontrolvolumeface.hh:57
std::array< Dune::FieldVector< ct, cdim >,(1<<(dim-1)) > Type
Definition: discretization/cellcentered/mpfa/subcontrolvolumeface.hh:58
Definition: discretization/cellcentered/mpfa/subcontrolvolumeface.hh:64
static const bool v
Definition: discretization/cellcentered/mpfa/subcontrolvolumeface.hh:65
static const unsigned int topologyId
Definition: discretization/cellcentered/mpfa/subcontrolvolumeface.hh:66
Definition: discretization/cellcentered/mpfa/subcontrolvolumeface.hh:52
Default traits class to be used for the sub-control volume faces for the cell-centered finite volume ...
Definition: discretization/cellcentered/mpfa/subcontrolvolumeface.hh:36
typename IndexTraits< GridView >::LocalIndex LocalIndexType
Definition: discretization/cellcentered/mpfa/subcontrolvolumeface.hh:44
typename CornerStorage::value_type GlobalPosition
Definition: discretization/cellcentered/mpfa/subcontrolvolumeface.hh:72
Dune::MultiLinearGeometry< Scalar, dim-1, dimWorld, ScvfMLGTraits< Scalar > > Geometry
Definition: discretization/cellcentered/mpfa/subcontrolvolumeface.hh:70
typename IndexTraits< GridView >::GridIndex GridIndexType
Definition: discretization/cellcentered/mpfa/subcontrolvolumeface.hh:43
typename ScvfMLGTraits< Scalar >::template CornerStorage< dim-1, dimWorld >::Type CornerStorage
Definition: discretization/cellcentered/mpfa/subcontrolvolumeface.hh:71
static const int dim
Definition: discretization/cellcentered/mpfa/subcontrolvolumeface.hh:39
typename std::conditional_t<(dim< dimWorld), std::vector< GridIndexType >, Dune::ReservedVector< GridIndexType, 1 > > OutsideGridIndexStorage
Definition: discretization/cellcentered/mpfa/subcontrolvolumeface.hh:47
static const int dimWorld
Definition: discretization/cellcentered/mpfa/subcontrolvolumeface.hh:40
typename Grid::ctype Scalar
Definition: discretization/cellcentered/mpfa/subcontrolvolumeface.hh:42
typename GridView::Grid Grid
Definition: discretization/cellcentered/mpfa/subcontrolvolumeface.hh:37
typename GridView::IndexSet::IndexType GridIndex
Definition: indextraits.hh:27
unsigned int LocalIndex
Definition: indextraits.hh:28