12#ifndef DUMUX_DISCRETIZATION_CC_SUBCONTROLVOLUME_HH
13#define DUMUX_DISCRETIZATION_CC_SUBCONTROLVOLUME_HH
17#include <dune/common/fvector.hh>
30template<
class Gr
idView>
33 using Geometry =
typename GridView::template Codim<0>::Geometry;
36 using Scalar =
typename GridView::ctype;
37 using Element =
typename GridView::template Codim<0>::Entity;
54 using Geometry =
typename T::Geometry;
55 using GridIndexType =
typename T::GridIndexType;
56 using LocalIndexType =
typename T::LocalIndexType;
57 using Scalar =
typename T::Scalar;
67 using Element =
typename GV::template Codim<0>::Entity;
68 using GeometryRT =
decltype(std::declval<Element>().geometry());
69 static constexpr bool grtIsReference = std::is_lvalue_reference<GeometryRT>::value;
70 using GeometryParamType = std::conditional_t<grtIsReference, Geometry, Geometry&&>;
83 , geometry_(std::make_unique<Geometry>(std::move(
geometry)))
84 , center_(geometry_->
center())
114 return geometry_->volume();
119 [[deprecated(
"Will be removed after 3.7. Use fvGeometry.geometry(scv).")]]
153 return elementIndex_;
157 [[deprecated(
"Will be removed after 3.7. Use fvGeometry.geometry(scv).corner(i).")]]
160 return geometry_->corner(localIdx);
167 geometry_ = std::make_unique<Geometry>(*other.geometry_);
170 center_ = other.center_;
171 elementIndex_ = other.elementIndex_;
175 std::unique_ptr<Geometry> geometry_;
177 GridIndexType elementIndex_;
Sub control volumes for cell-centered discretization schemes.
Definition: discretization/cellcentered/subcontrolvolume.hh:51
GridIndexType elementIndex() const
The global index of the element this scv is embedded in.
Definition: discretization/cellcentered/subcontrolvolume.hh:151
CCSubControlVolume & operator=(const CCSubControlVolume &other)
The copy assignment operator.
Definition: discretization/cellcentered/subcontrolvolume.hh:96
Scalar volume() const
The volume of the sub control volume.
Definition: discretization/cellcentered/subcontrolvolume.hh:112
LocalIndexType localDofIndex() const
The element-local index of the dof this scv is embedded in.
Definition: discretization/cellcentered/subcontrolvolume.hh:132
LocalIndexType indexInElement() const
Definition: discretization/cellcentered/subcontrolvolume.hh:139
CCSubControlVolume(const CCSubControlVolume &other)
The copy constructor.
Definition: discretization/cellcentered/subcontrolvolume.hh:89
GlobalPosition corner(LocalIndexType localIdx) const
Return the corner for the given local index.
Definition: discretization/cellcentered/subcontrolvolume.hh:158
T Traits
state the traits public and thus export all types
Definition: discretization/cellcentered/subcontrolvolume.hh:75
CCSubControlVolume()=default
typename T::GlobalPosition GlobalPosition
export the type used for global coordinates
Definition: discretization/cellcentered/subcontrolvolume.hh:73
const Geometry & geometry() const
The geometry of the sub control volume.
Definition: discretization/cellcentered/subcontrolvolume.hh:120
CCSubControlVolume(CCSubControlVolume &&other)=default
The move constructor.
const GlobalPosition & dofPosition() const
Definition: discretization/cellcentered/subcontrolvolume.hh:145
CCSubControlVolume(GeometryParamType geometry, GridIndexType elementIndex)
Definition: discretization/cellcentered/subcontrolvolume.hh:80
GridIndexType dofIndex() const
The index of the dof this scv is embedded in (the global index of this scv)
Definition: discretization/cellcentered/subcontrolvolume.hh:126
const GlobalPosition & center() const
The center of the sub control volume.
Definition: discretization/cellcentered/subcontrolvolume.hh:106
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:26
Default traits class to be used for the sub-control volumes for the cell-centered finite volume schem...
Definition: discretization/cellcentered/subcontrolvolume.hh:32
typename IndexTraits< GridView >::GridIndex GridIndexType
Definition: discretization/cellcentered/subcontrolvolume.hh:34
typename GridView::template Codim< 0 >::Geometry Geometry
Definition: discretization/cellcentered/subcontrolvolume.hh:33
typename IndexTraits< GridView >::LocalIndex LocalIndexType
Definition: discretization/cellcentered/subcontrolvolume.hh:35
typename GridView::template Codim< 0 >::Entity Element
Definition: discretization/cellcentered/subcontrolvolume.hh:37
typename Element::Geometry::GlobalCoordinate GlobalPosition
Definition: discretization/cellcentered/subcontrolvolume.hh:38
typename GridView::ctype Scalar
Definition: discretization/cellcentered/subcontrolvolume.hh:36
typename GridView::IndexSet::IndexType GridIndex
Definition: indextraits.hh:27
unsigned int LocalIndex
Definition: indextraits.hh:28
Base class for a sub control volume.