-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #22 from LLNL/prom_dg_local_advection
Add DG local advection prom example
- Loading branch information
Showing
7 changed files
with
952 additions
and
13 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
from _pylibROM.algo.manifold_interp import * |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
#include <pybind11/pybind11.h> | ||
#include <pybind11/numpy.h> | ||
#include <pybind11/operators.h> | ||
#include <pybind11/stl.h> | ||
#include "linalg/Matrix.h" | ||
#include "linalg/Vector.h" | ||
#include "algo/manifold_interp/Interpolator.h" | ||
|
||
namespace py = pybind11; | ||
using namespace CAROM; | ||
|
||
void | ||
init_Interpolator(pybind11::module_ &m) | ||
{ | ||
m.def("obtainRBFToTrainingPoints", &obtainRBFToTrainingPoints); | ||
m.def("rbfWeightedSum", &rbfWeightedSum); | ||
m.def("obtainRBF", &obtainRBF); | ||
m.def("convertClosestRBFToEpsilon", &convertClosestRBFToEpsilon); | ||
m.def("obtainRotationMatrices", &obtainRotationMatrices); | ||
} |
27 changes: 27 additions & 0 deletions
27
bindings/pylibROM/algo/manifold_interp/pyMatrixInterpolator.cpp
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
#include <pybind11/pybind11.h> | ||
#include <pybind11/numpy.h> | ||
#include <pybind11/operators.h> | ||
#include <pybind11/stl.h> | ||
#include "linalg/Matrix.h" | ||
#include "linalg/Vector.h" | ||
#include "algo/manifold_interp/MatrixInterpolator.h" | ||
|
||
namespace py = pybind11; | ||
using namespace CAROM; | ||
|
||
void | ||
init_MatrixInterpolator(pybind11::module_ &m) | ||
{ | ||
py::class_<MatrixInterpolator>(m, "MatrixInterpolator") | ||
.def(py::init<std::vector<Vector *>, std::vector<Matrix *>, std::vector<Matrix *>, int, std::string, std::string, std::string, double>(), | ||
py::arg("parameter_points"), | ||
py::arg("rotation_matrices"), | ||
py::arg("reduced_matrices"), | ||
py::arg("ref_point"), | ||
py::arg("matrix_type"), | ||
py::arg("rbf") = "G", | ||
py::arg("interp_method") = "LS", | ||
py::arg("closest_rbf_val") = 0.9) | ||
.def("interpolate", &MatrixInterpolator::interpolate, py::arg("point"), py::arg("orthogonalize") = false) | ||
.def("__del__", [](MatrixInterpolator& self) { self.~MatrixInterpolator(); }); | ||
} |
29 changes: 29 additions & 0 deletions
29
bindings/pylibROM/algo/manifold_interp/pyVectorInterpolator.cpp
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
#include <pybind11/pybind11.h> | ||
#include <pybind11/numpy.h> | ||
#include <pybind11/operators.h> | ||
#include <pybind11/stl.h> | ||
#include "linalg/Matrix.h" | ||
#include "linalg/Vector.h" | ||
#include "algo/manifold_interp/VectorInterpolator.h" | ||
|
||
namespace py = pybind11; | ||
using namespace CAROM; | ||
|
||
void | ||
init_VectorInterpolator(pybind11::module_ &m) | ||
{ | ||
py::class_<VectorInterpolator>(m, "VectorInterpolator") | ||
.def(py::init<std::vector<Vector *>, std::vector<Matrix *>, std::vector<Vector *>, int, std::string, std::string, double>(), | ||
py::arg("parameter_points"), | ||
py::arg("rotation_matrices"), | ||
py::arg("reduced_vectors"), | ||
py::arg("ref_point"), | ||
py::arg("rbf") = "G", | ||
py::arg("interp_method") = "LS", | ||
py::arg("closest_rbf_val") = 0.9) | ||
.def("interpolate", &VectorInterpolator::interpolate) | ||
.def("__del__", [](VectorInterpolator& self) { self.~VectorInterpolator(); }); | ||
|
||
m.def("obtainInterpolatedVector", &obtainInterpolatedVector); | ||
m.def("solveLinearSystem", &solveLinearSystem); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.