58 cls.def_property_readonly(
"size", &ElementSolution::size);
69 using pybind11::operator
""_a;
71 using Problem =
typename GV::GridVolumeVariables::Problem;
72 using PrimaryVariables =
typename GV::GridVolumeVariables::VolumeVariables::PrimaryVariables;
73 using GridGeometry =
typename GV::GridGeometry;
74 using Element =
typename GridGeometry::GridView::template Codim<0>::Entity;
75 using SolutionVector = Dune::BlockVector<PrimaryVariables>;
77 cls.def(pybind11::init([](std::shared_ptr<const Problem> problem,
78 std::shared_ptr<const GridGeometry> gridGeometry){
79 return std::make_shared<GV>(problem, gridGeometry);
82 cls.def(
"init", [](GV& self,
const SolutionVector& sol) {
return self.init(sol); });
83 cls.def(
"advanceTimeStep", &GV::advanceTimeStep);
84 cls.def_property_readonly(
"curGridVolVars", [](GV& self) {
return self.curGridVolVars(); });
85 cls.def_property_readonly(
"gridFluxVarsCache", [](GV& self) {
return self.gridFluxVarsCache(); });
86 cls.def_property_readonly(
"prevGridVolVars", [](GV& self) {
return self.prevGridVolVars(); });
87 cls.def_property_readonly(
"gridGeometry", &GV::gridGeometry);
89 cls.def(
"updateAfterGridAdaption", [](GV& self,
const SolutionVector& sol){
90 return self.updateAfterGridAdaption(sol);
93 cls.def(
"resetTimeStep", [](GV& self,
const SolutionVector& sol){
94 return self.resetTimeStep(sol);
97 cls.def(
"update", [](GV& self,
const SolutionVector& sol,
const bool forceFluxCacheUpdate =
false){
98 return self.update(sol, forceFluxCacheUpdate);
101 using ElementSolution = std::decay_t<decltype(elementSolution(std::declval<Element>(),
102 std::declval<SolutionVector>(),
103 std::declval<GridGeometry>()))>;
104 Impl::registerElementSolution<ElementSolution>(scope);