#include "PyCoefficient.h"

#include <pybind11/pybind11.h>
#include <pybind11/stl.h>
#include <pybind11/functional.h> // Needed for std::function
#include <memory>

#include "mfem.hpp"

namespace py = pybind11;
using namespace mfem;

namespace serif::pybind {
    real_t PyCoefficient::Eval(ElementTransformation &T, const IntegrationPoint &ip) {
        PYBIND11_OVERRIDE_PURE(
            real_t,       /* Return type */
            Coefficient,  /* Base class */
            Eval,         /* Method name */
            T, ip         /* Arguments */
        );
    }

    // Override virtual SetTime method
    void PyCoefficient::SetTime(real_t t) {
        PYBIND11_OVERRIDE(
            void,
            Coefficient,
            SetTime,
            t
        );
    }

    void PyVectorCoefficient::Eval(Vector &V, ElementTransformation &T, const IntegrationPoint &ip) {
        PYBIND11_OVERRIDE_PURE(
            void,               /* Return type */
            VectorCoefficient,  /* Base class */
            Eval,               /* Method name */
            V, T, ip            /* Arguments */
        );
    }

    // Override the virtual SetTime method
    void PyVectorCoefficient::SetTime(real_t t) {
        PYBIND11_OVERRIDE(
            void,
            VectorCoefficient,
            SetTime,
            t
        );
    }
}