GridFire 0.0.1a General Purpose Nuclear Network

Loading...
Searching...
No Matches
bindings.cpp
Go to the documentation of this file.
1#include <pybind11/pybind11.h>
2#include <pybind11/stl.h> // Needed for vectors, maps, sets, strings
3#include <pybind11/stl_bind.h> // Needed for binding std::vector, std::map etc if needed directly
4
5#include "bindings.h"
6
7#include "gridfire/solver/solver.h"
8#include "trampoline/py_solver.h"
9
10 namespace py = pybind11;
11
12
13 void register_solver_bindings(py::module &m) {
14 auto py_dynamic_network_solving_strategy = py::class_<gridfire::solver::DynamicNetworkSolverStrategy, PyDynamicNetworkSolverStrategy>(m, "DynamicNetworkSolverStrategy");
15 auto py_direct_network_solver = py::class_<gridfire::solver::DirectNetworkSolver, gridfire::solver::DynamicNetworkSolverStrategy>(m, "DirectNetworkSolver");
16
17 py_direct_network_solver.def(py::init<gridfire::DynamicEngine&>(),
18 py::arg("engine"),
19 "Constructor for the DirectNetworkSolver. Takes a DynamicEngine instance to use for evaluating the network.");
20
21 py_direct_network_solver.def("evaluate",
22 &gridfire::solver::DirectNetworkSolver::evaluate,
23 py::arg("netIn"),
24 "Evaluate the network for a given timestep. Returns the output conditions after the timestep.");
25}
26
gridfire::solver::DirectNetworkSolver::evaluate
NetOut evaluate(const NetIn &netIn) override
Evaluates the network for a given timestep using direct integration.
Definition solver.cpp:22
py_solver.h
register_solver_bindings
void register_solver_bindings(py::module &m)
Definition bindings.cpp:13
bindings.h
solver.h