24#ifndef DUMUX_DISCRETIZATION_CC_MPFA_SUBCONTROLVOLUMEFACE_HH
25#define DUMUX_DISCRETIZATION_CC_MPFA_SUBCONTROLVOLUMEFACE_HH
30#include <dune/common/reservedvector.hh>
31#include <dune/common/fvector.hh>
32#include <dune/geometry/type.hh>
33#include <dune/geometry/multilineargeometry.hh>
45template<
class Gr
idView>
48 using Grid =
typename GridView::Grid;
50 static const int dim = Grid::dimension;
51 static const int dimWorld = Grid::dimensionworld;
57 std::vector<GridIndexType>,
58 Dune::ReservedVector<GridIndexType, 1> >;
66 template<
int mydim,
int cdim >
69 using Type = std::array< Dune::FieldVector< ct, cdim >, (1<<(
dim-1)) >;
76 static const bool v =
true;
77 static const unsigned int topologyId = Dune::Impl::CubeTopology< dim >::type::id;
97 using GridIndexType =
typename T::GridIndexType;
98 using Scalar =
typename T::Scalar;
99 using CornerStorage =
typename T::CornerStorage;
100 using OutsideGridIndexStorage =
typename T::OutsideGridIndexStorage;
101 using Geometry =
typename T::Geometry;
123 template<
class MpfaHelper>
127 GridIndexType vIdxGlobal,
128 unsigned int vIdxLocal,
129 GridIndexType scvfIndex,
135 , vertexIndex_(vIdxGlobal)
136 , scvfIndex_(scvfIndex)
139 , vIdxInElement_(vIdxLocal)
145 for (
const auto&
corner : corners_)
147 center_ /= corners_.size();
150 ipGlobal_ = helper.getScvfIntegrationPoint(corners_, q);
151 area_ = helper.computeScvfArea(corners_);
160 {
return boundary_; }
164 {
return scvfIndex_; }
168 {
return vertexIndex_; }
172 {
return vIdxInElement_; }
176 {
return insideScvIdx_; }
180 {
return outsideScvIndices_.size(); }
185 {
return outsideScvIndices_[i]; }
189 {
return outsideScvIndices_; }
193 {
return corners_.size(); }
198 assert(localIdx < corners_.size() &&
"provided index exceeds the number of corners");
199 return corners_[localIdx];
204 {
return corners_.back(); }
216 {
return ipGlobal_; }
220 {
return unitOuterNormal_; }
224 {
return Geometry(Dune::GeometryTypes::cube(Geometry::mydimension), corners_); }
228 GridIndexType vertexIndex_;
229 GridIndexType scvfIndex_;
230 GridIndexType insideScvIdx_;
231 OutsideGridIndexStorage outsideScvIndices_;
232 unsigned int vIdxInElement_;
234 CornerStorage corners_;
Defines the index types used for grid and local indices.
make the local view function available whenever we use the grid geometry
Definition: adapt.hh:29
typename GridView::IndexSet::IndexType GridIndex
Definition: indextraits.hh:39
unsigned int LocalIndex
Definition: indextraits.hh:40
Default traits class to be used for the sub-control volume faces for the cell-centered finite volume ...
Definition: discretization/cellcentered/mpfa/subcontrolvolumeface.hh:47
typename IndexTraits< GridView >::LocalIndex LocalIndexType
Definition: discretization/cellcentered/mpfa/subcontrolvolumeface.hh:55
typename CornerStorage::value_type GlobalPosition
Definition: discretization/cellcentered/mpfa/subcontrolvolumeface.hh:83
Dune::MultiLinearGeometry< Scalar, dim-1, dimWorld, ScvfMLGTraits< Scalar > > Geometry
Definition: discretization/cellcentered/mpfa/subcontrolvolumeface.hh:81
typename IndexTraits< GridView >::GridIndex GridIndexType
Definition: discretization/cellcentered/mpfa/subcontrolvolumeface.hh:54
typename ScvfMLGTraits< Scalar >::template CornerStorage< dim-1, dimWorld >::Type CornerStorage
Definition: discretization/cellcentered/mpfa/subcontrolvolumeface.hh:82
static const int dim
Definition: discretization/cellcentered/mpfa/subcontrolvolumeface.hh:50
typename std::conditional_t<(dim< dimWorld), std::vector< GridIndexType >, Dune::ReservedVector< GridIndexType, 1 > > OutsideGridIndexStorage
Definition: discretization/cellcentered/mpfa/subcontrolvolumeface.hh:58
static const int dimWorld
Definition: discretization/cellcentered/mpfa/subcontrolvolumeface.hh:51
typename Grid::ctype Scalar
Definition: discretization/cellcentered/mpfa/subcontrolvolumeface.hh:53
typename GridView::Grid Grid
Definition: discretization/cellcentered/mpfa/subcontrolvolumeface.hh:48
Definition: discretization/cellcentered/mpfa/subcontrolvolumeface.hh:63
Definition: discretization/cellcentered/mpfa/subcontrolvolumeface.hh:68
std::array< Dune::FieldVector< ct, cdim >,(1<<(dim-1)) > Type
Definition: discretization/cellcentered/mpfa/subcontrolvolumeface.hh:69
Definition: discretization/cellcentered/mpfa/subcontrolvolumeface.hh:75
static const bool v
Definition: discretization/cellcentered/mpfa/subcontrolvolumeface.hh:76
static const unsigned int topologyId
Definition: discretization/cellcentered/mpfa/subcontrolvolumeface.hh:77
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:96
std::size_t corners() const
Returns the number of corners.
Definition: discretization/cellcentered/mpfa/subcontrolvolumeface.hh:192
GridIndexType index() const
The global index of this sub control volume face.
Definition: discretization/cellcentered/mpfa/subcontrolvolumeface.hh:163
const GlobalPosition & ipGlobal() const
The integration point for flux evaluations in global coordinates.
Definition: discretization/cellcentered/mpfa/subcontrolvolumeface.hh:215
unsigned int vertexIndexInElement() const
Returns the element-local vertex index the scvf is connected to.
Definition: discretization/cellcentered/mpfa/subcontrolvolumeface.hh:171
Scalar area() const
The area of the sub control volume face.
Definition: discretization/cellcentered/mpfa/subcontrolvolumeface.hh:155
typename T::GlobalPosition GlobalPosition
export the type used for global coordinates
Definition: discretization/cellcentered/mpfa/subcontrolvolumeface.hh:105
CCMpfaSubControlVolumeFace(const MpfaHelper &helper, CornerStorage &&corners, GlobalPosition &&unitOuterNormal, GridIndexType vIdxGlobal, unsigned int vIdxLocal, GridIndexType scvfIndex, GridIndexType insideScvIdx, const OutsideGridIndexStorage &outsideScvIndices, Scalar q, bool boundary)
Constructor.
Definition: discretization/cellcentered/mpfa/subcontrolvolumeface.hh:124
GridIndexType insideScvIdx() const
index of the inside sub control volume
Definition: discretization/cellcentered/mpfa/subcontrolvolumeface.hh:175
const GlobalPosition & vertexCorner() const
Returns the global position of the vertex the scvf is connected to.
Definition: discretization/cellcentered/mpfa/subcontrolvolumeface.hh:203
const GlobalPosition & unitOuterNormal() const
returns the unit outer normal vector (assumes non-curved geometries)
Definition: discretization/cellcentered/mpfa/subcontrolvolumeface.hh:219
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:207
const GlobalPosition & center() const
The center of the sub control volume face.
Definition: discretization/cellcentered/mpfa/subcontrolvolumeface.hh:211
const GlobalPosition & corner(unsigned int localIdx) const
Returns the corner for a given local index.
Definition: discretization/cellcentered/mpfa/subcontrolvolumeface.hh:196
GridIndexType outsideScvIdx(int i=0) const
Definition: discretization/cellcentered/mpfa/subcontrolvolumeface.hh:184
Geometry geometry() const
The geometry of the sub control volume face.
Definition: discretization/cellcentered/mpfa/subcontrolvolumeface.hh:223
GridIndexType vertexIndex() const
Returns the index of the vertex the scvf is connected to.
Definition: discretization/cellcentered/mpfa/subcontrolvolumeface.hh:167
const OutsideGridIndexStorage & outsideScvIndices() const
returns the outside scv indices (can be more than one index for dim < dimWorld)
Definition: discretization/cellcentered/mpfa/subcontrolvolumeface.hh:188
bool boundary() const
returns bolean if the sub control volume face is on the domain boundary
Definition: discretization/cellcentered/mpfa/subcontrolvolumeface.hh:159
T Traits
state the traits public and thus export all types
Definition: discretization/cellcentered/mpfa/subcontrolvolumeface.hh:107
std::size_t numOutsideScvs() const
The number of outside scvs connection via this scv face.
Definition: discretization/cellcentered/mpfa/subcontrolvolumeface.hh:179