#include <pybind11/pybind11.h>
#include <pybind11/stl.h> // Needed for vectors, maps, sets, strings
#include <pybind11/stl_bind.h> // Needed for binding std::vector, std::map etc if needed directly
#include <pybind11/numpy.h>

#include "bindings.h"
#include "EOSio.h"
#include "helm.h"
#include "polySolver.h"
#include "mfem.hpp"

namespace py = pybind11;

void register_polytrope_bindings(pybind11::module &polytrope_submodule) {
    py::class_<serif::polytrope::PolySolver>(polytrope_submodule, "PolySolver")
        .def(py::init<double, int>(), py::arg("polytropic_index"), py::arg("FEM_order"))
        .def("solve", &serif::polytrope::PolySolver::solve, "Solve the polytrope equation.")
        .def("get_theta", &serif::polytrope::PolySolver::getTheta, py::return_value_policy::reference_internal)
        .def("get_phi", &serif::polytrope::PolySolver::getPhi, py::return_value_policy::reference_internal)
        .def("get_order", &serif::polytrope::PolySolver::getOrder)
        .def("get_n", &serif::polytrope::PolySolver::getN);

    py::class_<serif::polytrope::PolytropeOperator, mfem::Operator>(polytrope_submodule, "PolytropeOperator")
        .def("Mult", &serif::polytrope::PolytropeOperator::Mult);

}
