Nektar++
Classes | Macros
NekPyConfig.hpp File Reference
#include <memory>
#include <pybind11/numpy.h>
#include <pybind11/pybind11.h>
#include <pybind11/stl.h>
#include <pybind11/stl_bind.h>

Go to the source code of this file.

Classes

struct  CppCommandLine
 Helper structure to construct C++ command line argc and argv variables from a Python list. More...
 

Macros

#define PYBIND11_DETAILED_ERROR_MESSAGES
 
#define SIZENAME(s)   SIZE_##s
 
#define NEKPY_WRAP_ENUM(MOD, ENUMNAME, MAPNAME)
 
#define NEKPY_WRAP_ENUM_STRING(MOD, ENUMNAME, MAPNAME)
 
#define NEKPY_WRAP_ENUM_STRING_DOCS(MOD, ENUMNAME, MAPNAME, DOCSTRING)
 

Macro Definition Documentation

◆ NEKPY_WRAP_ENUM

#define NEKPY_WRAP_ENUM (   MOD,
  ENUMNAME,
  MAPNAME 
)
Value:
{ \
py::enum_<ENUMNAME> tmp(MOD, #ENUMNAME); \
for (int a = 0; a < (int)SIZENAME(ENUMNAME); ++a) \
{ \
tmp.value(MAPNAME[a], (ENUMNAME)a); \
} \
tmp.export_values(); \
}
#define SIZENAME(s)
Definition: NekPyConfig.hpp:52

Definition at line 53 of file NekPyConfig.hpp.

◆ NEKPY_WRAP_ENUM_STRING

#define NEKPY_WRAP_ENUM_STRING (   MOD,
  ENUMNAME,
  MAPNAME 
)
Value:
{ \
py::enum_<ENUMNAME> tmp(MOD, #ENUMNAME); \
for (int a = 0; a < (int)SIZENAME(ENUMNAME); ++a) \
{ \
tmp.value(MAPNAME[a].c_str(), (ENUMNAME)a); \
} \
tmp.export_values(); \
}

Definition at line 62 of file NekPyConfig.hpp.

◆ NEKPY_WRAP_ENUM_STRING_DOCS

#define NEKPY_WRAP_ENUM_STRING_DOCS (   MOD,
  ENUMNAME,
  MAPNAME,
  DOCSTRING 
)
Value:
{ \
py::enum_<ENUMNAME> tmp(MOD, #ENUMNAME); \
for (int a = 0; a < (int)SIZENAME(ENUMNAME); ++a) \
{ \
tmp.value(MAPNAME[a].c_str(), (ENUMNAME)a); \
} \
tmp.export_values(); \
PyTypeObject *pto = reinterpret_cast<PyTypeObject *>(tmp.ptr()); \
PyDict_SetItemString(pto->tp_dict, "__doc__", \
PyUnicode_FromString(DOCSTRING)); \
}

Definition at line 71 of file NekPyConfig.hpp.

◆ PYBIND11_DETAILED_ERROR_MESSAGES

#define PYBIND11_DETAILED_ERROR_MESSAGES

Definition at line 39 of file NekPyConfig.hpp.

◆ SIZENAME

#define SIZENAME (   s)    SIZE_##s

Definition at line 52 of file NekPyConfig.hpp.