26#ifndef DUMUX_LENSPROBLEM_ADAPTIVE_HH
27#define DUMUX_LENSPROBLEM_ADAPTIVE_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");
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.
@ box
Definition method.hh:38
make the local view function available whenever we use the grid geometry
Definition adapt.hh:29
Container readFileToContainer(const std::string &filename)
Read a simple text file into a container.
Definition container.hh:66
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
const GridGeometry & gridGeometry() const
The finite volume grid geometry.
Definition common/fvproblem.hh:588
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
TwoPTestProblem(std::shared_ptr< const GridGeometry > gridGeometry)
Definition test/porousmediumflow/2p/implicit/boxdfm/problem.hh:147