|
static void * | convertible (PyObject *objPtr) |
|
static void | decrement (void *objPtr) |
|
static void | construct (PyObject *objPtr, py::converter::rvalue_from_python_stage1_data *data) |
|
Definition at line 85 of file VarCoeffEntry.cpp.
◆ PythonToVarCoeffEntry()
PythonToVarCoeffEntry::PythonToVarCoeffEntry |
( |
| ) |
|
|
inline |
Definition at line 87 of file VarCoeffEntry.cpp.
88 {
90 py::type_id<VarCoeffEntry>());
91 }
static void * convertible(PyObject *objPtr)
static void construct(PyObject *objPtr, py::converter::rvalue_from_python_stage1_data *data)
References construct(), and convertible().
◆ construct()
static void PythonToVarCoeffEntry::construct |
( |
PyObject * |
objPtr, |
|
|
py::converter::rvalue_from_python_stage1_data * |
data |
|
) |
| |
|
inlinestatic |
Definition at line 137 of file VarCoeffEntry.cpp.
139 {
140
141
142 py::object obj((py::handle<>(py::borrowed(objPtr))));
144
145 void *storage =
146 ((py::converter::rvalue_from_python_storage<VarCoeffEntry> *)data)
147 ->storage.bytes;
148 data->convertible = storage;
149
151
152 py::incref(objPtr);
153 }
Representation of a variable coefficient.
Referenced by PythonToVarCoeffEntry().
◆ convertible()
static void * PythonToVarCoeffEntry::convertible |
( |
PyObject * |
objPtr | ) |
|
|
inlinestatic |
Definition at line 92 of file VarCoeffEntry.cpp.
93 {
94 try
95 {
96 py::object obj((py::handle<>(py::borrowed(objPtr))));
97 np::ndarray array = py::extract<np::ndarray>(obj);
98
99
100 np::dtype dtype = np::dtype::get_builtin<
101 typename boost::remove_const<NekDouble>::type>();
102 if (dtype != array.get_dtype())
103 {
104 return nullptr;
105 }
106
107
108 if (array.get_nd() != 1)
109 {
110 return nullptr;
111 }
112 }
113 catch (boost::python::error_already_set &)
114 {
115 py::handle_exception();
116 PyErr_Clear();
117 return nullptr;
118 }
119
120 return objPtr;
121 }
Referenced by PythonToVarCoeffEntry().
◆ decrement()
static void PythonToVarCoeffEntry::decrement |
( |
void * |
objPtr | ) |
|
|
inlinestatic |
Definition at line 123 of file VarCoeffEntry.cpp.
124 {
125 if (!Py_IsInitialized())
126 {
127
128
129
130 return;
131 }
132
133
134 py::decref((PyObject *)objPtr);
135 }