40:
public Dumux::Python::FVProblem<GridGeometry_, SpatialParams_, PrimaryVariables, enableInternalDirichletConstraints>
46 using Scalar =
typename PrimaryVariables::value_type;
47 using NumEqVector = Dune::FieldVector<Scalar, PrimaryVariables::dimension>;
48 using Element =
typename GridGeometry::GridView::template Codim<0>::Entity;
55 static constexpr std::size_t
numEq =
static_cast<std::size_t
>(PrimaryVariables::dimension);
60 pybind11::object pyProblem)
66 {
return *spatialParams_; }
69 std::shared_ptr<const SpatialParams> spatialParams_;
76 using pybind11::operator
""_a;
77 using namespace Dune::Python;
79 using GridGeometry =
typename Problem::GridGeometry;
80 using SpatialParams =
typename Problem::SpatialParams;
81 cls.def(pybind11::init([](std::shared_ptr<const GridGeometry> gridGeometry,
82 std::shared_ptr<SpatialParams> spatialParams,
84 return std::make_shared<Problem>(gridGeometry, spatialParams, p);
87 cls.def_property_readonly(
"name", &Problem::name);
88 cls.def_property_readonly(
"numEq", [](Problem&){
return Problem::numEq; });
90 using GridView =
typename GridGeometry::GridView;
91 using Element =
typename GridView::template Codim<0>::Entity;
92 using Vertex =
typename GridView::template Codim<GridView::dimension>::Entity;
94 if constexpr (Problem::isBox)
96 using SCV =
typename Problem::SubControlVolume;
97 cls.def(
"boundaryTypes", pybind11::overload_cast<const Element&, const SCV&>(&Problem::boundaryTypes, pybind11::const_),
"element"_a,
"scv"_a);
98 cls.def(
"dirichlet", pybind11::overload_cast<const Element&, const SCV&>(&Problem::dirichlet, pybind11::const_),
"element"_a,
"scv"_a);
102 using SCVF =
typename Problem::SubControlVolumeFace;
103 cls.def(
"boundaryTypes", pybind11::overload_cast<const Element&, const SCVF&>(&Problem::boundaryTypes, pybind11::const_),
"element"_a,
"scvf"_a);
104 cls.def(
"dirichlet", pybind11::overload_cast<const Element&, const SCVF&>(&Problem::dirichlet, pybind11::const_),
"element"_a,
"scvf"_a);
107 cls.def(
"neumann", &Problem::template neumann<
decltype(std::ignore),
decltype(std::ignore)>);
108 cls.def(
"source", &Problem::template source<
decltype(std::ignore)>);
109 cls.def(
"sourceAtPos", &Problem::sourceAtPos);
110 cls.def(
"initial", &Problem::template initial<Element>);
111 cls.def(
"initial", &Problem::template initial<Vertex>);
112 cls.def(
"gridGeometry", &Problem::gridGeometry);
113 cls.def(
"spatialParams", &Problem::spatialParams);