58 int i, argc = py::len(ns), bufSize = 0;
59 char **argv =
new char *[argc + 1], *
p;
64 for (i = 0; i < argc; ++i)
66 std::string tmp = py::extract<std::string>(ns[i]);
67 bufSize += tmp.size() + 1;
70 std::vector<char> buf(bufSize);
71 for (i = 0,
p = &buf[0]; i < argc; ++i)
73 std::string tmp = py::extract<std::string>(ns[i]);
95 std::vector<std::string> filenames(argc - 1);
96 for (i = 1; i < argc; ++i)
98 filenames[i - 1] = std::string(argv[i]);
116 std::string paramName,
int paramValue)
118 session->SetParameter(paramName, paramValue);
122 std::string paramName,
double paramValue)
124 session->SetParameter(paramName, paramValue);
138 py::class_<SessionReader, std::shared_ptr<SessionReader>,
139 boost::noncopyable>(
"SessionReader", py::no_init)
142 .staticmethod(
"CreateInstance")
145 py::return_value_policy<py::copy_const_reference>())
151 py::return_value_policy<py::return_by_value>())
157 py::return_value_policy<py::copy_const_reference>())
void SessionReader_SetParameterDouble(SessionReaderSharedPtr session, std::string paramName, double paramValue)
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.
const std::string & GetSessionName() const
Returns the session name of the loaded XML document.
void Finalise()
Finalises the session.
static SessionReaderSharedPtr CreateInstance(int argc, char *argv[])
Creates an instance of the SessionReader class.
CommSharedPtr GetComm()
Returns the communication object.
const NekDouble & GetParameter(const std::string &pName) const
Returns the value of the specified parameter.
const std::string & GetVariable(const unsigned int &idx) const
Returns the name of the variable specified by the given index.
bool DefinesParameter(const std::string &name) const
Checks if a parameter is specified in the XML document.
bool GetSharedFilesystem()
Returns if file system shared.
std::shared_ptr< SessionReader > SessionReaderSharedPtr
CommFactory & GetCommFactory()
std::shared_ptr< Comm > CommSharedPtr
Pointer to a Communicator object.