feat(pythonInterface/mfem): added loads of mfem bindings to make interacting through python easy

This commit is contained in:
2025-06-16 12:01:03 -04:00
parent 94a0fa947a
commit 79c585892f
24 changed files with 1467 additions and 55 deletions

View File

@@ -0,0 +1,27 @@
#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 {
// --- Trampoline for the abstract Coefficient base class ---
class PyCoefficient : public Coefficient {
public:
using Coefficient::Coefficient;
real_t Eval(ElementTransformation &T, const IntegrationPoint &ip) override;
void SetTime(real_t t) override;
};
// --- Trampoline for the abstract VectorCoefficient base class ---
class PyVectorCoefficient : public VectorCoefficient {
public:
using VectorCoefficient::VectorCoefficient;
void Eval(Vector &V, ElementTransformation &T, const IntegrationPoint &ip) override;
void SetTime(real_t t) override;
};
}