19#ifndef DUMUX_VARIABLECLASS_HH
20#define DUMUX_VARIABLECLASS_HH
47template<
class TypeTag>
52 using SolutionTypes =
typename GET_PROP(TypeTag, SolutionTypes);
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 elementMapper_.update();
93 vertexMapper_.update();
94 cellDataVector_.resize(gridView_.size(0));
104 cellDataVector_.resize(size);
110 return cellDataVector_;
115 assert(cellDataVector_.size() == gridView_.size(0));
117 return cellDataVector_;
123 assert(cellDataVector_.size() == gridView_.size(0));
125 return cellDataVector_[idx];
130 assert(cellDataVector_.size() == gridView_.size(0));
132 return cellDataVector_[idx];
140 int index(
const Element& element)
const
142 return elementMapper_.index(element);
150 int index(
const Vertex& vertex)
const
152 return vertexMapper_.index(vertex);
164 return elementMapper_;
169 return elementMapper_;
174 return vertexMapper_;
179 return vertexMapper_;
#define GET_PROP(TypeTag, PropTagName)
Definition: propertysystemmacros.hh:281
#define GET_PROP_TYPE(TypeTag, PropTagName)
Definition: propertysystemmacros.hh:283
make the local view function available whenever we use the grid geometry
Definition: adapt.hh:29
Definition: common/properties/model.hh:34
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:150
const CellData & cellData(const int idx) const
Definition: variableclass.hh:128
CellData & cellData(const int idx)
Return the cell data of a specific cell.
Definition: variableclass.hh:121
typename std::vector< CellData > CellDataVector
Definition: variableclass.hh:67
CellDataVector & cellDataGlobal()
Return the vector holding all cell data.
Definition: variableclass.hh:108
void initialize()
Initializes the variable class.
Definition: variableclass.hh:90
const ElementMapper & elementMapper() const
Return mapper for elements (for static grids)
Definition: variableclass.hh:167
int index(const Element &element) const
Get index of element (codim 0 entity)
Definition: variableclass.hh:140
const VertexMapper & vertexMapper() const
Return mapper for vertices (for static grids)
Definition: variableclass.hh:177
const GridView & gridView() const
Return gridView.
Definition: variableclass.hh:156
VertexMapper & vertexMapper()
Return mapper for vertices (for adaptive grids)
Definition: variableclass.hh:172
ElementMapper & elementMapper()
Return mapper for elements (for adaptive grids)
Definition: variableclass.hh:162
VariableClass(const GridView &gridView)
Constructs a VariableClass object.
Definition: variableclass.hh:80
const CellDataVector & cellDataGlobal() const
Definition: variableclass.hh:113
void adaptVariableSize(const int size)
Resizes sequential variable vectors.
Definition: variableclass.hh:102
Base file for properties related to sequential models.