24#ifndef DUMUX_DISCRETIZATION_CC_TPFA_SUBCONTROLVOLUMEFACE_HH
25#define DUMUX_DISCRETIZATION_CC_TPFA_SUBCONTROLVOLUMEFACE_HH
30#include <dune/common/reservedvector.hh>
31#include <dune/geometry/type.hh>
32#include <dune/geometry/multilineargeometry.hh>
46template<
class Gr
idView>
49 using Grid =
typename GridView::Grid;
51 static constexpr int dim = Grid::dimension;
52 static constexpr int dimWorld = Grid::dimensionworld;
58 std::vector<GridIndexType>,
59 Dune::ReservedVector<GridIndexType, 2> >;
67 template<
int mydim,
int cdim >
70 using Type = Dune::ReservedVector< Dune::FieldVector< ct, cdim >, (1<<(
dim-1)) >;
93 using GridIndexType =
typename T::GridIndexType;
94 using Scalar =
typename T::Scalar;
95 using CornerStorage =
typename T::CornerStorage;
96 using GridIndexStorage =
typename T::GridIndexStorage;
97 using Geometry =
typename T::Geometry;
98 using BoundaryFlag =
typename T::BoundaryFlag;
118 template <
class Intersection>
120 const typename Intersection::Geometry& isGeometry,
121 GridIndexType scvfIndex,
122 const GridIndexStorage& scvIndices,
125 , geomType_(isGeometry.type())
126 , area_(isGeometry.
volume())
127 , center_(isGeometry.
center())
128 , unitOuterNormal_(is.centerUnitOuterNormal())
129 , scvfIndex_(scvfIndex)
130 , scvIndices_(scvIndices)
131 , boundary_(isBoundary)
134 corners_.resize(isGeometry.corners());
135 for (
int i = 0; i < isGeometry.corners(); ++i)
136 corners_[i] = isGeometry.corner(i);
167 return unitOuterNormal_;
173 return scvIndices_[0];
180 return scvIndices_[i+1];
186 return scvIndices_.size()-1;
198 assert(i < corners_.size() &&
"provided index exceeds the number of corners");
205 return Geometry(geomType_, corners_);
211 return boundaryFlag_.get();
215 Dune::GeometryType geomType_;
216 CornerStorage corners_;
220 GridIndexType scvfIndex_;
221 GridIndexStorage scvIndices_;
Base class for a sub control volume face.
Defines the index types used for grid and local indices.
Boundary flag to store e.g. in sub control volume faces.
Scalar volume(Shape shape, Scalar inscribedRadius)
Returns the volume of a given geometry based on the inscribed radius.
Definition: poreproperties.hh:73
std::size_t value_type
Definition: boundaryflag.hh:51
Definition: boundaryflag.hh:68
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/tpfa/subcontrolvolumeface.hh:48
typename ScvfMLGTraits< Scalar >::template CornerStorage< dim-1, dimWorld >::Type CornerStorage
Definition: discretization/cellcentered/tpfa/subcontrolvolumeface.hh:75
Dune::MultiLinearGeometry< Scalar, dim-1, dimWorld, ScvfMLGTraits< Scalar > > Geometry
Definition: discretization/cellcentered/tpfa/subcontrolvolumeface.hh:74
typename GridView::Grid Grid
Definition: discretization/cellcentered/tpfa/subcontrolvolumeface.hh:49
static constexpr int dim
Definition: discretization/cellcentered/tpfa/subcontrolvolumeface.hh:51
typename CornerStorage::value_type GlobalPosition
Definition: discretization/cellcentered/tpfa/subcontrolvolumeface.hh:76
typename IndexTraits< GridView >::LocalIndex LocalIndexType
Definition: discretization/cellcentered/tpfa/subcontrolvolumeface.hh:56
typename Grid::ctype Scalar
Definition: discretization/cellcentered/tpfa/subcontrolvolumeface.hh:54
typename IndexTraits< GridView >::GridIndex GridIndexType
Definition: discretization/cellcentered/tpfa/subcontrolvolumeface.hh:55
static constexpr int dimWorld
Definition: discretization/cellcentered/tpfa/subcontrolvolumeface.hh:52
typename std::conditional_t<(dim< dimWorld), std::vector< GridIndexType >, Dune::ReservedVector< GridIndexType, 2 > > GridIndexStorage
Definition: discretization/cellcentered/tpfa/subcontrolvolumeface.hh:59
Definition: discretization/cellcentered/tpfa/subcontrolvolumeface.hh:64
Definition: discretization/cellcentered/tpfa/subcontrolvolumeface.hh:69
Dune::ReservedVector< Dune::FieldVector< ct, cdim >,(1<<(dim-1)) > Type
Definition: discretization/cellcentered/tpfa/subcontrolvolumeface.hh:70
The sub control volume face.
Definition: discretization/cellcentered/tpfa/subcontrolvolumeface.hh:90
bool boundary() const
returns true if the sub control volume face is on the boundary
Definition: discretization/cellcentered/tpfa/subcontrolvolumeface.hh:159
typename T::GlobalPosition GlobalPosition
export the type used for global coordinates
Definition: discretization/cellcentered/tpfa/subcontrolvolumeface.hh:102
const GlobalPosition & unitOuterNormal() const
The unit outer normal of the sub control volume face.
Definition: discretization/cellcentered/tpfa/subcontrolvolumeface.hh:165
GridIndexType outsideScvIdx(int i=0) const
Index of the i-th outside sub control volume or boundary scv index.
Definition: discretization/cellcentered/tpfa/subcontrolvolumeface.hh:178
BoundaryFlag::value_type boundaryFlag() const
Return the boundary flag.
Definition: discretization/cellcentered/tpfa/subcontrolvolumeface.hh:209
const GlobalPosition & corner(int i) const
return the i-th corner of this sub control volume face
Definition: discretization/cellcentered/tpfa/subcontrolvolumeface.hh:196
std::size_t numOutsideScvs() const
The number of scvs on the outside of this face.
Definition: discretization/cellcentered/tpfa/subcontrolvolumeface.hh:184
const GlobalPosition & center() const
The center of the sub control volume face.
Definition: discretization/cellcentered/tpfa/subcontrolvolumeface.hh:140
GridIndexType insideScvIdx() const
index of the inside sub control volume
Definition: discretization/cellcentered/tpfa/subcontrolvolumeface.hh:171
T Traits
state the traits public and thus export all types
Definition: discretization/cellcentered/tpfa/subcontrolvolumeface.hh:104
Geometry geometry() const
The geometry of the sub control volume face.
Definition: discretization/cellcentered/tpfa/subcontrolvolumeface.hh:203
const GlobalPosition & ipGlobal() const
The integration point for flux evaluations in global coordinates.
Definition: discretization/cellcentered/tpfa/subcontrolvolumeface.hh:146
GridIndexType index() const
The global index of this sub control volume face.
Definition: discretization/cellcentered/tpfa/subcontrolvolumeface.hh:190
CCTpfaSubControlVolumeFace(const Intersection &is, const typename Intersection::Geometry &isGeometry, GridIndexType scvfIndex, const GridIndexStorage &scvIndices, bool isBoundary)
Constructor with intersection.
Definition: discretization/cellcentered/tpfa/subcontrolvolumeface.hh:119
Scalar area() const
The area of the sub control volume face.
Definition: discretization/cellcentered/tpfa/subcontrolvolumeface.hh:153
CCTpfaSubControlVolumeFace()=default
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:41