37#include <pybind11/stl.h>
75 std::vector<std::string> filenames(argc - 1);
76 for (
int i = 1; i < argc; ++i)
78 filenames[i - 1] = std::string(argv[i]);
83 SessionReader::CreateInstance(argc, argv, filenames, MPICOMM);
98 py::class_<SessionReader, std::shared_ptr<SessionReader>>(m,
103 .def(
"GetSessionName", &SessionReader::GetSessionName,
106 .def(
"InitSession", &SessionReader::InitSession,
107 py::arg(
"filenames") = py::list())
111 .def(
"DefinesParameter", &SessionReader::DefinesParameter)
112 .def(
"GetParameter", &SessionReader::GetParameter,
114 .def(
"GetParameters", &SessionReader::GetParameters)
116 .def(
"SetParameter", py::overload_cast<const std::string &, int &>(
117 &SessionReader::SetParameter))
118 .def(
"SetParameter", py::overload_cast<const std::string &, double &>(
119 &SessionReader::SetParameter))
120 .def(
"SetParameter", py::overload_cast<const std::string &, size_t &>(
121 &SessionReader::SetParameter))
123 .def(
"DefinesSolverInfo", &SessionReader::DefinesSolverInfo)
124 .def(
"GetSolverInfo", &SessionReader::GetSolverInfo,
126 .def(
"SetSolverInfo", &SessionReader::SetSolverInfo)
128 .def(
"GetVariable", &SessionReader::GetVariable,
130 .def(
"GetVariables", &SessionReader::GetVariables)
133 py::overload_cast<
const std::string &,
const std::string &,
134 const int>(&SessionReader::GetFunction,
136 py::arg(
"name"), py::arg(
"var"), py::arg(
"domain") = 0)
138 py::overload_cast<
const std::string &,
const unsigned int &,
139 const int>(&SessionReader::GetFunction,
141 py::arg(
"name"), py::arg(
"var"), py::arg(
"domain") = 0)
143 .def(
"GetComm", &SessionReader::GetComm)
145 .def(
"GetSharedFilesystem", &SessionReader::GetSharedFilesystem);
void export_SessionReader(py::module &m)
SessionReader exports.
SessionReaderSharedPtr SessionReader_CreateInstance(py::list &ns)
tBaseSharedPtr CreateInstance(tKey idKey, tParam... args)
Create an instance of the class referred to by idKey.
static void Finalise(gs_data *pGsh)
Deallocates the GSLib mapping data.
std::shared_ptr< SessionReader > SessionReaderSharedPtr
CommFactory & GetCommFactory()
std::shared_ptr< Comm > CommSharedPtr
Pointer to a Communicator object.
Helper structure to construct C++ command line argc and argv variables from a Python list.
int GetArgc()
Returns the constructed argc.
char ** GetArgv()
Returns the constructed argv.