35#include "../NekPyConvertors.hpp"
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);
93 std::string paramName,
int paramValue)
95 session->SetParameter(paramName, paramValue);
99 std::string paramName,
double paramValue)
101 session->SetParameter(paramName, paramValue);
105 std::string
func,
int var)
107 return session->GetFunction(
func, var);
111 std::string
func, std::string var)
113 return session->GetFunction(
func, var);
148 py::class_<SessionReader, std::shared_ptr<SessionReader>,
149 boost::noncopyable>(
"SessionReader", py::no_init)
152 .staticmethod(
"CreateInstance")
154 .def(
"GetSessionName", &SessionReader::GetSessionName,
155 py::return_value_policy<py::copy_const_reference>())
159 .def(
"DefinesParameter", &SessionReader::DefinesParameter)
160 .def(
"GetParameter", &SessionReader::GetParameter,
161 py::return_value_policy<py::return_by_value>())
167 .def(
"DefinesSolverInfo", &SessionReader::DefinesSolverInfo)
168 .def(
"GetSolverInfo", &SessionReader::GetSolverInfo,
169 py::return_value_policy<py::copy_const_reference>())
170 .def(
"SetSolverInfo", &SessionReader::SetSolverInfo)
172 .def(
"GetVariable", &SessionReader::GetVariable,
173 py::return_value_policy<py::copy_const_reference>())
179 .def(
"GetComm", &SessionReader::GetComm)
181 .def(
"GetSharedFilesystem", &SessionReader::GetSharedFilesystem);
py::list VectorToPyList(const std::vector< T > &input)
Converts a std::vector to a Python list.
py::dict MapToPyDict(const std::map< KeyT, ValT > &input)
Converts a std::map to a Python dict.
EquationSharedPtr SessionReader_GetFunction2(SessionReaderSharedPtr session, std::string func, std::string var)
void SessionReader_SetParameterDouble(SessionReaderSharedPtr session, std::string paramName, double paramValue)
EquationSharedPtr SessionReader_GetFunction1(SessionReaderSharedPtr session, std::string func, int var)
py::dict SessionReader_GetParameters(SessionReaderSharedPtr s)
Function to wrap SessionReader::GetParameters.
py::list SessionReader_GetVariables(SessionReaderSharedPtr s)
Function to wrap SessionReader::GetVariables.
SessionReaderSharedPtr SessionReader_CreateInstance(py::list &ns)
void SessionReader_SetParameterInt(SessionReaderSharedPtr session, std::string paramName, int paramValue)
void export_SessionReader()
SessionReader exports.
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
std::shared_ptr< Equation > EquationSharedPtr
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.