DNDSR 0.1.0.dev1+gcd065ad
Distributed Numeric Data Structure for CFV
Loading...
Searching...
No Matches
ModelEvaluator_bind.cpp
Go to the documentation of this file.
2#include <pybind11/eigen.h>
3
4namespace DNDS::CFV
5{
6 void pybind11_ModelEvaluator_define(py::module_ &m)
7 {
8 auto ModelEvaluator_ = tPy_ModelEvaluator(m, "ModelEvaluator");
9 ModelEvaluator_
10 .def(
11 py::init(
14 py::object settings,
15 int nVars)
16 {
17 ModelSettings defaultSettings;
18 nlohmann::ordered_json defaultJson;
19 to_json(defaultJson, defaultSettings);
20 nlohmann::json settings_json = settings;
21 defaultJson.merge_patch(settings_json);
22 from_json(defaultJson, defaultSettings);
23
24 return std::make_shared<ModelEvaluator>(mesh, vfv, defaultSettings, nVars);
25 }),
26 py::arg("mesh"), py::arg("vfv"), py::arg("settings"), py::arg("nVars"));
27
28 ModelEvaluator_
29 .def(
30 "ParseSettings",
31 [](ModelEvaluator &self, py::object settings)
32 {
33 ModelSettings defaultSettings;
34 nlohmann::ordered_json defaultJson;
35 to_json(defaultJson, defaultSettings);
36 nlohmann::json settings_json = settings;
37 defaultJson.merge_patch(settings_json);
38 from_json(defaultJson, defaultSettings);
39 self.get_settings() = defaultJson;
40 });
41
42 auto EvaluateRHSOptions_ = py::classh<ModelEvaluator::EvaluateRHSOptions>(ModelEvaluator_, "EvaluateRHSOptions");
43 EvaluateRHSOptions_
44 .def(py::init())
45 .def_readwrite("direct2ndRec", &ModelEvaluator::EvaluateRHSOptions::direct2ndRec)
46 .def_readwrite("direct2ndRec1stConv", &ModelEvaluator::EvaluateRHSOptions::direct2ndRec1stConv);
47 ModelEvaluator_
48 .def("EvaluateRHS", &ModelEvaluator::EvaluateRHS,
49 py::arg("rhs"), py::arg("u"), py::arg("uRec"), py::arg("t"), py::arg("options") = ModelEvaluator::EvaluateRHSOptions{})
50 .def("get_FBoundary", &ModelEvaluator::get_FBoundary, py::arg("t"));
51
52 ModelEvaluator_
53 .def("DoReconstructionIter", &ModelEvaluator::DoReconstructionIter,
54 py::arg("uRec"), py::arg("uRecNew"), py::arg("u"),
55 py::arg("t"),
56 py::arg("putIntoNew") = false, py::arg("recordInc") = false, py::arg("uRecIsZero") = false);
57 }
58}
void EvaluateRHS(tUDof< nVarsFixed > &rhs, tUDof< nVarsFixed > &u, tURec< nVarsFixed > &uRec, real t, const EvaluateRHSOptions &options=EvaluateRHSOptions{})
ModelSettings & get_settings()
void DoReconstructionIter(tURec< nVarsFixed > &uRec, tURec< nVarsFixed > &uRecNew, tUDof< nVarsFixed > &u, real t, bool putIntoNew=false, bool recordInc=false, bool uRecIsZero=false)
Tvfv_FBoundary get_FBoundary(real t)
The VR class that provides any information needed in high-order CFV.
py_class_ssp< ModelEvaluator > tPy_ModelEvaluator
void pybind11_ModelEvaluator_define(py::module_ &m)
void from_json(const nlohmann::ordered_json &j, host_device_vector< real > &v)
Definition JsonUtil.hpp:183
std::shared_ptr< T > ssp
Shortened alias for std::shared_ptr used pervasively in DNDSR.
Definition Defines.hpp:138
void to_json(nlohmann::ordered_json &j, const host_device_vector< real > &v)
Definition JsonUtil.hpp:177