26#ifndef DUMUX_LENSPROBLEM_ADAPTIVE_HH
27#define DUMUX_LENSPROBLEM_ADAPTIVE_HH
29#include "../incompressible/problem.hh"
40template <
class TypeTag >
45 using Element =
typename GridView::template Codim<0>::Entity;
46 using Vertex =
typename GridView::template Codim<GridView::dimensionworld>::Entity;
58 initialValues_ = readFileToContainer<std::vector<PrimaryVariables>>(
"initialsolutioncc.txt");
60 initialValues_ = readFileToContainer<std::vector<PrimaryVariables>>(
"initialsolutionbox.txt");
66 PrimaryVariables
initial(
const Element& element)
const
68 const auto delta = 0.0625;
69 unsigned int cellsX = this->
gridGeometry().bBoxMax()[0]/delta;
70 const auto globalPos = element.geometry().center();
73 unsigned int dataIdx = std::trunc(globalPos[1]/delta) * cellsX + std::trunc(globalPos[0]/delta);
74 return initialValues_[dataIdx];
80 PrimaryVariables
initial(
const Vertex& vertex)
const
82 const auto delta = 0.0625;
83 unsigned int verticesX = this->
gridGeometry().bBoxMax()[0]/delta + 1;
84 const auto globalPos = vertex.geometry().center();
87 unsigned int dataIdx = std::trunc(globalPos[1]/delta) * verticesX + std::trunc(globalPos[0]/delta);
88 return initialValues_[dataIdx];
92 std::vector<PrimaryVariables> initialValues_;
Free functions to write and read a sequence container to and from a file.
make the local view function available whenever we use the grid geometry
Definition: adapt.hh:29
typename Properties::Detail::GetPropImpl< TypeTag, Property >::type::type GetPropType
get the type alias defined in the property (equivalent to old macro GET_PROP_TYPE(....
Definition: propertysystem.hh:149
Base class for all finite-volume problems.
Definition: common/fvproblem.hh:50
const GridGeometry & gridGeometry() const
The finite volume grid geometry.
Definition: common/fvproblem.hh:588
Soil contamination problem where DNAPL infiltrates a fully water saturated medium.
Definition: test/porousmediumflow/2p/implicit/adaptive/problem.hh:42
TwoPTestProblemAdaptive(std::shared_ptr< const GridGeometry > gridGeometry)
Definition: test/porousmediumflow/2p/implicit/adaptive/problem.hh:54
PrimaryVariables initial(const Vertex &vertex) const
Evaluates the initial value for a vertex for vertex-centered models.
Definition: test/porousmediumflow/2p/implicit/adaptive/problem.hh:80
PrimaryVariables initial(const Element &element) const
Evaluates the initial value for an element for cell-centered models.
Definition: test/porousmediumflow/2p/implicit/adaptive/problem.hh:66
The incompressible 2p-boxdfm test problem.
Definition: test/porousmediumflow/2p/implicit/incompressible/problem.hh:112