Skip to content
Snippets Groups Projects
Commit 8c459e68 authored by Tom Fischer's avatar Tom Fischer
Browse files

[PL/STs/Python] Have to use vector instead of array.

pybind11 could not cast python tuple to C++ pair<double, std::array<double, 3>>
parent 1194fce2
No related branches found
No related tags found
No related merge requests found
...@@ -29,11 +29,11 @@ public: ...@@ -29,11 +29,11 @@ public:
using PythonSourceTermPythonSideInterface:: using PythonSourceTermPythonSideInterface::
PythonSourceTermPythonSideInterface; PythonSourceTermPythonSideInterface;
std::pair<double, std::array<double, 3>> getFlux( std::pair<double, std::vector<double>> getFlux(
double t, std::array<double, 3> x, double t, std::array<double, 3> const& x,
std::vector<double> const& primary_variables) const override std::vector<double> const& primary_variables) const override
{ {
using Ret = std::pair<double, std::array<double, 3>>; using Ret = std::pair<double, std::vector<double>>;
PYBIND11_OVERLOAD(Ret, PythonSourceTermPythonSideInterface, PYBIND11_OVERLOAD(Ret, PythonSourceTermPythonSideInterface,
getFlux, t, x, primary_variables); getFlux, t, x, primary_variables);
} }
......
...@@ -28,11 +28,14 @@ public: ...@@ -28,11 +28,14 @@ public:
* \return flux Flux of the source term at that node and derivative of the * \return flux Flux of the source term at that node and derivative of the
* flux w.r.t. all primary variables. * flux w.r.t. all primary variables.
*/ */
virtual std::pair<double, std::array<double, 3>> getFlux( virtual std::pair<double, std::vector<double>> getFlux(
double /*t*/, std::array<double, 3> /*x*/, double /*t*/, std::array<double, 3> const& /*x*/,
std::vector<double> const& /*primary_variables*/) const std::vector<double> const& /*primary_variables*/) const
{ {
return {std::numeric_limits<double>::quiet_NaN(), {}}; return {std::numeric_limits<double>::quiet_NaN(),
std::vector<double>{std::numeric_limits<double>::quiet_NaN(),
std::numeric_limits<double>::quiet_NaN(),
std::numeric_limits<double>::quiet_NaN()}};
} }
//! Tells if getFlux() has been overridden in the derived class in Python. //! Tells if getFlux() has been overridden in the derived class in Python.
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment