24#ifndef DUMUX_DISCRETIZATION_CC_SUBCONTROLVOLUME_HH
25#define DUMUX_DISCRETIZATION_CC_SUBCONTROLVOLUME_HH
29#include <dune/common/fvector.hh>
42template<
class Gr
idView>
45 using Geometry =
typename GridView::template Codim<0>::Geometry;
48 using Scalar =
typename GridView::ctype;
49 using Element =
typename GridView::template Codim<0>::Entity;
66 using Geometry =
typename T::Geometry;
67 using GridIndexType =
typename T::GridIndexType;
68 using LocalIndexType =
typename T::LocalIndexType;
69 using Scalar =
typename T::Scalar;
79 using Element =
typename GV::template Codim<0>::Entity;
80 using GeometryRT =
decltype(std::declval<Element>().geometry());
81 static constexpr bool grtIsReference = std::is_lvalue_reference<GeometryRT>::value;
82 using GeometryParamType = std::conditional_t<grtIsReference, Geometry, Geometry&&>;
95 , geometry_(std::make_unique<Geometry>(std::move(
geometry)))
96 , center_(geometry_->
center())
102 { deepCopy_(other); }
164 return elementIndex_;
170 assert(localIdx <
geometry().corners() &&
"provided index exceeds the number of corners");
178 geometry_ = std::make_unique<Geometry>(other.
geometry());
181 center_ = other.center_;
182 elementIndex_ = other.elementIndex_;
186 std::unique_ptr<Geometry> geometry_;
188 GridIndexType elementIndex_;
Defines the index types used for grid and local indices.
Base class for a sub control volume.
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 volumes for the cell-centered finite volume schem...
Definition: discretization/cellcentered/subcontrolvolume.hh:44
typename IndexTraits< GridView >::GridIndex GridIndexType
Definition: discretization/cellcentered/subcontrolvolume.hh:46
typename GridView::template Codim< 0 >::Geometry Geometry
Definition: discretization/cellcentered/subcontrolvolume.hh:45
typename IndexTraits< GridView >::LocalIndex LocalIndexType
Definition: discretization/cellcentered/subcontrolvolume.hh:47
typename GridView::template Codim< 0 >::Entity Element
Definition: discretization/cellcentered/subcontrolvolume.hh:49
typename Element::Geometry::GlobalCoordinate GlobalPosition
Definition: discretization/cellcentered/subcontrolvolume.hh:50
typename GridView::ctype Scalar
Definition: discretization/cellcentered/subcontrolvolume.hh:48
Sub control volumes for cell-centered discretization schemes.
Definition: discretization/cellcentered/subcontrolvolume.hh:63
GridIndexType elementIndex() const
The global index of the element this scv is embedded in.
Definition: discretization/cellcentered/subcontrolvolume.hh:162
CCSubControlVolume & operator=(const CCSubControlVolume &other)
The copy assignment operator.
Definition: discretization/cellcentered/subcontrolvolume.hh:108
Scalar volume() const
The volume of the sub control volume.
Definition: discretization/cellcentered/subcontrolvolume.hh:124
LocalIndexType localDofIndex() const
The element-local index of the dof this scv is embedded in.
Definition: discretization/cellcentered/subcontrolvolume.hh:143
LocalIndexType indexInElement() const
Definition: discretization/cellcentered/subcontrolvolume.hh:150
CCSubControlVolume(const CCSubControlVolume &other)
The copy constrcutor.
Definition: discretization/cellcentered/subcontrolvolume.hh:101
GlobalPosition corner(LocalIndexType localIdx) const
Return the corner for the given local index.
Definition: discretization/cellcentered/subcontrolvolume.hh:168
T Traits
state the traits public and thus export all types
Definition: discretization/cellcentered/subcontrolvolume.hh:87
CCSubControlVolume()=default
typename T::GlobalPosition GlobalPosition
export the type used for global coordinates
Definition: discretization/cellcentered/subcontrolvolume.hh:85
const Geometry & geometry() const
The geometry of the sub control volume.
Definition: discretization/cellcentered/subcontrolvolume.hh:131
CCSubControlVolume(CCSubControlVolume &&other)=default
The move constrcutor.
const GlobalPosition & dofPosition() const
Definition: discretization/cellcentered/subcontrolvolume.hh:156
CCSubControlVolume(GeometryParamType geometry, GridIndexType elementIndex)
Definition: discretization/cellcentered/subcontrolvolume.hh:92
GridIndexType dofIndex() const
The index of the dof this scv is embedded in (the global index of this scv)
Definition: discretization/cellcentered/subcontrolvolume.hh:137
const GlobalPosition & center() const
The center of the sub control volume.
Definition: discretization/cellcentered/subcontrolvolume.hh:118
CCSubControlVolume & operator=(CCSubControlVolume &&other)=default
The move assignment operator.
Base class for a sub control volume, i.e a part of the control volume we are making the balance for....
Definition: subcontrolvolumebase.hh:38