feat(pythonInterface/mfem): added loads of mfem bindings to make interacting through python easy
This commit is contained in:
@@ -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;
|
||||
};
|
||||
}
|
||||
Reference in New Issue
Block a user