19#ifndef DUMUX_VARIABLECLASS_HH
20#define DUMUX_VARIABLECLASS_HH
47template<
class TypeTag>
57 dim = GridView::dimension,
60 using Element =
typename GridView::Traits::template Codim<0>::Entity;
61 using Vertex =
typename GridView::Traits::template Codim<dim>::Entity;
63 using VertexMapper =
typename SolutionTypes::VertexMapper;
64 using ElementMapper =
typename SolutionTypes::ElementMapper;
70 const GridView gridView_;
71 ElementMapper elementMapper_;
72 VertexMapper vertexMapper_;
92 if constexpr (Deprecated::hasUpdateGridView<ElementMapper, GridView>())
93 elementMapper_.update(gridView_);
95 Deprecated::update(elementMapper_);
97 if constexpr (Deprecated::hasUpdateGridView<VertexMapper, GridView>())
98 vertexMapper_.update(gridView_);
100 Deprecated::update(vertexMapper_);
102 cellDataVector_.resize(gridView_.size(0));
112 cellDataVector_.resize(size);
118 return cellDataVector_;
123 assert(cellDataVector_.size() == gridView_.size(0));
125 return cellDataVector_;
131 assert(cellDataVector_.size() == gridView_.size(0));
133 return cellDataVector_[idx];
138 assert(cellDataVector_.size() == gridView_.size(0));
140 return cellDataVector_[idx];
148 int index(
const Element& element)
const
150 return elementMapper_.index(element);
158 int index(
const Vertex& vertex)
const
160 return vertexMapper_.index(vertex);
172 return elementMapper_;
177 return elementMapper_;
182 return vertexMapper_;
187 return vertexMapper_;
typename Properties::Detail::GetPropImpl< TypeTag, Property >::type GetProp
get the type of a property
Definition: propertysystem.hh:141
typename Properties::Detail::GetPropImpl< TypeTag, Property >::type::type GetPropType
get the type alias defined in the property
Definition: propertysystem.hh:150
Definition: common/pdesolver.hh:36
Base class holding the variables and discretized data for sequential models.
Definition: variableclass.hh:49
int index(const Vertex &vertex) const
Get index of vertex (codim dim entity)
Definition: variableclass.hh:158
const CellData & cellData(const int idx) const
Definition: variableclass.hh:136
CellData & cellData(const int idx)
Return the cell data of a specific cell.
Definition: variableclass.hh:129
typename std::vector< CellData > CellDataVector
Definition: variableclass.hh:67
CellDataVector & cellDataGlobal()
Return the vector holding all cell data.
Definition: variableclass.hh:116
void initialize()
Initializes the variable class.
Definition: variableclass.hh:90
const ElementMapper & elementMapper() const
Return mapper for elements (for static grids)
Definition: variableclass.hh:175
int index(const Element &element) const
Get index of element (codim 0 entity)
Definition: variableclass.hh:148
const VertexMapper & vertexMapper() const
Return mapper for vertices (for static grids)
Definition: variableclass.hh:185
const GridView & gridView() const
Return gridView.
Definition: variableclass.hh:164
VertexMapper & vertexMapper()
Return mapper for vertices (for adaptive grids)
Definition: variableclass.hh:180
ElementMapper & elementMapper()
Return mapper for elements (for adaptive grids)
Definition: variableclass.hh:170
VariableClass(const GridView &gridView)
Constructs a VariableClass object.
Definition: variableclass.hh:80
const CellDataVector & cellDataGlobal() const
Definition: variableclass.hh:121
void adaptVariableSize(const int size)
Resizes sequential variable vectors.
Definition: variableclass.hh:110
Base file for properties related to sequential models.