24#ifndef DUMUX_DISCRETIZATION_CC_SUBCONTROLVOLUME_HH
25#define DUMUX_DISCRETIZATION_CC_SUBCONTROLVOLUME_HH
27#include <dune/common/fvector.hh>
41template<
class Gr
idView>
44 using Geometry =
typename GridView::template Codim<0>::Geometry;
47 using Scalar =
typename GridView::ctype;
48 using Element =
typename GridView::template Codim<0>::Entity;
65 using Geometry =
typename T::Geometry;
66 using GridIndexType =
typename T::GridIndexType;
67 using LocalIndexType =
typename T::LocalIndexType;
68 using Scalar =
typename T::Scalar;
78 using Element =
typename GV::template Codim<0>::Entity;
79 using GeometryRT =
decltype(std::declval<Element>().geometry());
80 static constexpr bool grtIsReference = std::is_lvalue_reference<GeometryRT>::value;
81 using GeometryParamType = std::conditional_t<grtIsReference, Geometry, Geometry&&>;
95 , center_(geometry_.value().
center())
113 center_ = other.center_;
114 elementIndex_ = other.elementIndex_;
125 geometry_.
emplace(std::move(other.geometry_.value()));
126 center_ = std::move(other.center_);
127 elementIndex_ = std::move(other.elementIndex_);
148 return geometry_.
value();
179 return elementIndex_;
185 assert(localIdx <
geometry().corners() &&
"provided index exceeds the number of corners");
193 GridIndexType elementIndex_;
Defines the index types used for grid and local indices.
A wrapper that can either contain an object of T or be empty. This might be used as a workaround for ...
Base class for a sub control volume.
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
const T & value() const
Definition: optional.hh:117
void emplace(Args &&... args)
Definition: optional.hh:128
void release()
Definition: optional.hh:135
Default traits class to be used for the sub-control volumes for the cell-centered finite volume schem...
Definition: discretization/cellcentered/subcontrolvolume.hh:43
typename IndexTraits< GridView >::GridIndex GridIndexType
Definition: discretization/cellcentered/subcontrolvolume.hh:45
typename GridView::template Codim< 0 >::Geometry Geometry
Definition: discretization/cellcentered/subcontrolvolume.hh:44
typename IndexTraits< GridView >::LocalIndex LocalIndexType
Definition: discretization/cellcentered/subcontrolvolume.hh:46
typename GridView::template Codim< 0 >::Entity Element
Definition: discretization/cellcentered/subcontrolvolume.hh:48
typename Element::Geometry::GlobalCoordinate GlobalPosition
Definition: discretization/cellcentered/subcontrolvolume.hh:49
typename GridView::ctype Scalar
Definition: discretization/cellcentered/subcontrolvolume.hh:47
Sub control volumes for cell-centered discretization schemes.
Definition: discretization/cellcentered/subcontrolvolume.hh:62
GridIndexType elementIndex() const
The global index of the element this scv is embedded in.
Definition: discretization/cellcentered/subcontrolvolume.hh:177
CCSubControlVolume & operator=(const CCSubControlVolume &other)
The copy assignment operator.
Definition: discretization/cellcentered/subcontrolvolume.hh:106
Scalar volume() const
The volume of the sub control volume.
Definition: discretization/cellcentered/subcontrolvolume.hh:138
LocalIndexType localDofIndex() const
The element-local index of the dof this scv is embedded in.
Definition: discretization/cellcentered/subcontrolvolume.hh:158
LocalIndexType indexInElement() const
Definition: discretization/cellcentered/subcontrolvolume.hh:165
CCSubControlVolume(const CCSubControlVolume &other)=default
The copy constrcutor.
GlobalPosition corner(LocalIndexType localIdx) const
Return the corner for the given local index.
Definition: discretization/cellcentered/subcontrolvolume.hh:183
T Traits
state the traits public and thus export all types
Definition: discretization/cellcentered/subcontrolvolume.hh:86
CCSubControlVolume()=default
typename T::GlobalPosition GlobalPosition
export the type used for global coordinates
Definition: discretization/cellcentered/subcontrolvolume.hh:84
const Geometry & geometry() const
The geometry of the sub control volume.
Definition: discretization/cellcentered/subcontrolvolume.hh:145
CCSubControlVolume(CCSubControlVolume &&other)=default
The move constrcutor.
const GlobalPosition & dofPosition() const
Definition: discretization/cellcentered/subcontrolvolume.hh:171
CCSubControlVolume(GeometryParamType geometry, GridIndexType elementIndex)
Definition: discretization/cellcentered/subcontrolvolume.hh:91
GridIndexType dofIndex() const
The index of the dof this scv is embedded in (the global index of this scv)
Definition: discretization/cellcentered/subcontrolvolume.hh:152
const GlobalPosition & center() const
The center of the sub control volume.
Definition: discretization/cellcentered/subcontrolvolume.hh:132
CCSubControlVolume & operator=(CCSubControlVolume &&other) noexcept
The move assignment operator.
Definition: discretization/cellcentered/subcontrolvolume.hh:119
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