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]);
98 py::class_<SessionReader, std::shared_ptr<SessionReader>>(m,
104 py::return_value_policy::copy)
107 py::arg(
"filenames") = py::list())
113 py::return_value_policy::copy)
116 .def(
"SetParameter", py::overload_cast<const std::string &, int &>(
118 .def(
"SetParameter", py::overload_cast<const std::string &, double &>(
120 .def(
"SetParameter", py::overload_cast<const std::string &, size_t &>(
125 py::return_value_policy::copy)
129 py::return_value_policy::copy)
133 py::overload_cast<
const std::string &,
const std::string &,
136 py::arg(
"name"), py::arg(
"var"), py::arg(
"domain") = 0)
138 py::overload_cast<
const std::string &,
const unsigned int &,
141 py::arg(
"name"), py::arg(
"var"), py::arg(
"domain") = 0)
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.
bool DefinesSolverInfo(const std::string &name) const
Checks if a solver info property is specified.
const std::string & GetSessionName() const
Returns the session name of the loaded XML document.
void Finalise()
Finalises the session.
void InitSession(const std::vector< std::string > &filenames=std::vector< std::string >())
std::vector< std::string > GetVariables() const
Returns the names of all variables.
static SessionReaderSharedPtr CreateInstance(int argc, char *argv[])
Creates an instance of the SessionReader class.
const ParameterMap & GetParameters()
CommSharedPtr GetComm()
Returns the communication object.
const NekDouble & GetParameter(const std::string &pName) const
Returns the value of the specified parameter.
void SetParameter(const std::string &name, int &var)
Set an integer parameter.
void SetSolverInfo(const std::string &pProperty, const std::string &pValue)
Sets the value of the specified solver info property.
const std::string & GetVariable(const unsigned int &idx) const
Returns the name of the variable specified by the given index.
EquationSharedPtr GetFunction(const std::string &name, const std::string &variable, const int pDomain=0) const
Returns an EquationSharedPtr to a given function variable.
bool DefinesParameter(const std::string &name) const
Checks if a parameter is specified in the XML document.
const std::string & GetSolverInfo(const std::string &pProperty) const
Returns the value of the specified solver info property.
bool GetSharedFilesystem()
Returns if file system shared.
std::shared_ptr< SessionReader > SessionReaderSharedPtr
CommFactory & GetCommFactory()
std::shared_ptr< Comm > CommSharedPtr
Pointer to a Communicator object.
int GetArgc()
Returns the constructed argc.
char ** GetArgv()
Returns the constructed argv.
Helper structure to construct C++ command line argc and argv variables from a Python list.