DNDSR 0.1.0.dev1+gcd065ad
Distributed Numeric Data Structure for CFV
Loading...
Searching...
No Matches
BenchmarkFiniteVolume_bind.hpp
Go to the documentation of this file.
1#pragma once
2#include "VRDefines.hpp"
3#include "VRDefines_bind.hpp"
5#include <pybind11_json/pybind11_json.hpp>
6#include <string>
7
8namespace DNDS::CFV
9{
10 template <DeviceBackend B>
12 {
13 m.def((std::string("finiteVolumeCellOpTest_main_") + device_backend_name(B)).c_str(),
14 [](FiniteVolume &fv,
17 int nIter,
18 py::object settings)
19 {
20 nlohmann::json settings_json = settings;
21
22 finiteVolumeCellOpTest_main<B>(fv, u, u_grad, nIter, t_jsonconfig(settings_json));
23 },
24 py::arg("fv"), py::arg("u"), py::arg("u_grad"), py::arg("nIter") = 1, py::arg("settings") = py::none());
25 }
26
27 template <DeviceBackend B, int nVarsFixed>
29 {
30 m.def((std::string("finiteVolumeCellOpTest_Fixed_main_") + device_backend_name(B) + "_N" + std::to_string(nVarsFixed)).c_str(),
31 [](FiniteVolume &fv,
34 int nIter,
35 py::object settings)
36 {
37 nlohmann::json settings_json = settings;
38
39 finiteVolumeCellOpTest_Fixed_main<B, nVarsFixed>(fv, u, u_grad, nIter, t_jsonconfig(settings_json));
40 },
41 py::arg("fv"), py::arg("u"), py::arg("u_grad"), py::arg("nIter") = 1, py::arg("settings") = py::none());
42 }
43
44 template <DeviceBackend B, int nVarsFixed>
46 {
47 m.def((std::string("finiteVolumeCellOpTest_SOA_ver0_main_") + device_backend_name(B) + "_N" + std::to_string(nVarsFixed)).c_str(),
48 [](FiniteVolume &fv,
49 std::array<tUDof<1>, nVarsFixed> &u,
50 std::array<tUGrad<1, 3>, nVarsFixed> &u_grad,
51 int nIter,
52 py::object settings)
53 {
54 nlohmann::json settings_json = settings;
55
56 finiteVolumeCellOpTest_SOA_ver0_main<B, nVarsFixed>(fv, u, u_grad, nIter, t_jsonconfig(settings_json));
57 },
58 py::arg("fv"), py::arg("u"), py::arg("u_grad"), py::arg("nIter") = 1, py::arg("settings") = py::none());
59 }
60}
Primary solver state container: an ArrayEigenMatrix pair with MPI-collective vector-space operations.
Definition ArrayDOF.hpp:172
void pybind11_BenchmarkFiniteVolume_define_Fixed(py::module_ &m)
void pybind11_BenchmarkFiniteVolume_define_SOA_ver0(py::module_ &m)
void pybind11_BenchmarkFiniteVolume_define(py::module_ &m)
const char * device_backend_name(DeviceBackend B)
Canonical string name for a DeviceBackend (used in log messages).
nlohmann::ordered_json t_jsonconfig
Project-wide JSON type alias: nlohmann/json with ordered keys.
Definition JsonUtil.hpp:19