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>
46template<
class Gr
idView>
49 using Grid =
typename GridView::Grid;
51 static const int dim = Grid::dimension;
52 static const int dimWorld = Grid::dimensionworld;
58 std::vector<GridIndexType>,
59 Dune::ReservedVector<GridIndexType, 1> >;
67 template<
int mydim,
int cdim >
70 using Type = std::array< Dune::FieldVector< ct, cdim >, (1<<(
dim-1)) >;
77 static const bool v =
true;
78 static const unsigned int topologyId = Dune::GeometryTypes::cube(
dim).id();
99 using GridIndexType =
typename T::GridIndexType;
100 using Scalar =
typename T::Scalar;
101 using CornerStorage =
typename T::CornerStorage;
102 using OutsideGridIndexStorage =
typename T::OutsideGridIndexStorage;
103 using Geometry =
typename T::Geometry;
104 using BoundaryFlag =
typename T::BoundaryFlag;
127 template<
class MpfaHelper,
class Intersection>
130 const Intersection& intersection,
131 GridIndexType vIdxGlobal,
132 unsigned int vIdxLocal,
133 GridIndexType scvfIndex,
139 , vertexIndex_(vIdxGlobal)
140 , scvfIndex_(scvfIndex)
143 , vIdxInElement_(vIdxLocal)
146 , unitOuterNormal_(intersection.centerUnitOuterNormal())
147 , boundaryFlag_{intersection}
150 for (
const auto&
corner : corners_)
152 center_ /= corners_.size();
155 ipGlobal_ = helper.getScvfIntegrationPoint(corners_, q);
156 area_ = helper.computeScvfArea(corners_);
165 {
return boundary_; }
169 {
return scvfIndex_; }
173 {
return vertexIndex_; }
177 {
return vIdxInElement_; }
181 {
return insideScvIdx_; }
185 {
return outsideScvIndices_.size(); }
190 {
return outsideScvIndices_[i]; }
194 {
return outsideScvIndices_; }
198 {
return corners_.size(); }
203 assert(localIdx < corners_.size() &&
"provided index exceeds the number of corners");
204 return corners_[localIdx];
209 {
return corners_.back(); }
221 {
return ipGlobal_; }
225 {
return unitOuterNormal_; }
229 {
return Geometry(Dune::GeometryTypes::cube(Geometry::mydimension), corners_); }
233 {
return boundaryFlag_.get(); }
237 GridIndexType vertexIndex_;
238 GridIndexType scvfIndex_;
239 GridIndexType insideScvIdx_;
240 OutsideGridIndexStorage outsideScvIndices_;
241 unsigned int vIdxInElement_;
243 CornerStorage corners_;
Boundary flag to store e.g. in sub control volume faces.
Defines the index types used for grid and local indices.
Adaption of the non-isothermal two-phase two-component flow model to problems with CO2.
Definition: adapt.hh:29
std::size_t value_type
Definition: boundaryflag.hh:51
Boundary flag to store e.g. in sub control volume faces.
Definition: boundaryflag.hh:67
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:48
typename IndexTraits< GridView >::LocalIndex LocalIndexType
Definition: discretization/cellcentered/mpfa/subcontrolvolumeface.hh:56
typename CornerStorage::value_type GlobalPosition
Definition: discretization/cellcentered/mpfa/subcontrolvolumeface.hh:84
Dune::MultiLinearGeometry< Scalar, dim-1, dimWorld, ScvfMLGTraits< Scalar > > Geometry
Definition: discretization/cellcentered/mpfa/subcontrolvolumeface.hh:82
typename IndexTraits< GridView >::GridIndex GridIndexType
Definition: discretization/cellcentered/mpfa/subcontrolvolumeface.hh:55
typename ScvfMLGTraits< Scalar >::template CornerStorage< dim-1, dimWorld >::Type CornerStorage
Definition: discretization/cellcentered/mpfa/subcontrolvolumeface.hh:83
static const int dim
Definition: discretization/cellcentered/mpfa/subcontrolvolumeface.hh:51
typename std::conditional_t<(dim< dimWorld), std::vector< GridIndexType >, Dune::ReservedVector< GridIndexType, 1 > > OutsideGridIndexStorage
Definition: discretization/cellcentered/mpfa/subcontrolvolumeface.hh:59
static const int dimWorld
Definition: discretization/cellcentered/mpfa/subcontrolvolumeface.hh:52
typename Grid::ctype Scalar
Definition: discretization/cellcentered/mpfa/subcontrolvolumeface.hh:54
typename GridView::Grid Grid
Definition: discretization/cellcentered/mpfa/subcontrolvolumeface.hh:49
Definition: discretization/cellcentered/mpfa/subcontrolvolumeface.hh:64
Definition: discretization/cellcentered/mpfa/subcontrolvolumeface.hh:69
std::array< Dune::FieldVector< ct, cdim >,(1<<(dim-1)) > Type
Definition: discretization/cellcentered/mpfa/subcontrolvolumeface.hh:70
Definition: discretization/cellcentered/mpfa/subcontrolvolumeface.hh:76
static const bool v
Definition: discretization/cellcentered/mpfa/subcontrolvolumeface.hh:77
static const unsigned int topologyId
Definition: discretization/cellcentered/mpfa/subcontrolvolumeface.hh:78
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:98
std::size_t corners() const
Returns the number of corners.
Definition: discretization/cellcentered/mpfa/subcontrolvolumeface.hh:197
GridIndexType index() const
The global index of this sub control volume face.
Definition: discretization/cellcentered/mpfa/subcontrolvolumeface.hh:168
const GlobalPosition & ipGlobal() const
The integration point for flux evaluations in global coordinates.
Definition: discretization/cellcentered/mpfa/subcontrolvolumeface.hh:220
unsigned int vertexIndexInElement() const
Returns the element-local vertex index the scvf is connected to.
Definition: discretization/cellcentered/mpfa/subcontrolvolumeface.hh:176
Scalar area() const
The area of the sub control volume face.
Definition: discretization/cellcentered/mpfa/subcontrolvolumeface.hh:160
typename T::GlobalPosition GlobalPosition
export the type used for global coordinates
Definition: discretization/cellcentered/mpfa/subcontrolvolumeface.hh:108
GridIndexType insideScvIdx() const
index of the inside sub control volume
Definition: discretization/cellcentered/mpfa/subcontrolvolumeface.hh:180
const GlobalPosition & vertexCorner() const
Returns the global position of the vertex the scvf is connected to.
Definition: discretization/cellcentered/mpfa/subcontrolvolumeface.hh:208
const GlobalPosition & unitOuterNormal() const
returns the unit outer normal vector (assumes non-curved geometries)
Definition: discretization/cellcentered/mpfa/subcontrolvolumeface.hh:224
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:212
const GlobalPosition & center() const
The center of the sub control volume face.
Definition: discretization/cellcentered/mpfa/subcontrolvolumeface.hh:216
const GlobalPosition & corner(unsigned int localIdx) const
Returns the corner for a given local index.
Definition: discretization/cellcentered/mpfa/subcontrolvolumeface.hh:201
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:189
BoundaryFlag::value_type boundaryFlag() const
Return the boundary flag.
Definition: discretization/cellcentered/mpfa/subcontrolvolumeface.hh:232
Geometry geometry() const
The geometry of the sub control volume face.
Definition: discretization/cellcentered/mpfa/subcontrolvolumeface.hh:228
GridIndexType vertexIndex() const
Returns the index of the vertex the scvf is connected to.
Definition: discretization/cellcentered/mpfa/subcontrolvolumeface.hh:172
const OutsideGridIndexStorage & outsideScvIndices() const
returns the outside scv indices (can be more than one index for dim < dimWorld)
Definition: discretization/cellcentered/mpfa/subcontrolvolumeface.hh:193
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:128
bool boundary() const
returns true if the sub control volume face is on the domain boundary
Definition: discretization/cellcentered/mpfa/subcontrolvolumeface.hh:164
T Traits
state the traits public and thus export all types
Definition: discretization/cellcentered/mpfa/subcontrolvolumeface.hh:110
std::size_t numOutsideScvs() const
The number of scvs on the outside of this scv face.
Definition: discretization/cellcentered/mpfa/subcontrolvolumeface.hh:184