Skip to content

Commit

Permalink
initial commit
Browse files Browse the repository at this point in the history
  • Loading branch information
Henry Yu authored and Henry Yu committed Aug 25, 2023
1 parent 8f2284f commit c592fa5
Showing 1 changed file with 31 additions and 0 deletions.
31 changes: 31 additions & 0 deletions bindings/pylibROM/algo/pyAdaptiveDMD.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
#include <pybind11/pybind11.h>
#include <pybind11/stl.h>
#include "algo/AdaptiveDMD.h"
#include "linalg/Vector.h"
#include "linalg/Matrix.h"

namespace py = pybind11;
using namespace CAROM;

PYBIND11_MODULE(adaptivedmd, m) {
py::class_<AdaptiveDMD, DMD>(m, "AdaptiveDMD")
.def(py::init<int, double, std::string, std::string, double, bool, Vector*>(),
py::arg("dim"),
py::arg("desired_dt") = -1.0,
py::arg("rbf") = "G",
py::arg("interp_method") = "LS",
py::arg("closest_rbf_val") = 0.9,
py::arg("alt_output_basis") = false,
py::arg("state_offset") = nullptr)
.def("train", (void (AdaptiveDMD::*)(double, const Matrix*, double)) &AdaptiveDMD::train,
py::arg("energy_fraction"),
py::arg("W0") = nullptr,
py::arg("linearity_tol") = 0.0)
.def("train", (void (AdaptiveDMD::*)(int, const Matrix*, double)) &AdaptiveDMD::train,
py::arg("k"),
py::arg("W0") = nullptr,
py::arg("linearity_tol") = 0.0)
.def("getTrueDt", &AdaptiveDMD::getTrueDt)
.def("getInterpolatedSnapshots", &AdaptiveDMD::getInterpolatedSnapshots);
}

0 comments on commit c592fa5

Please sign in to comment.