Nektar++
Classes | Functions
Python/BasicUtils/SharedArray.hpp File Reference
#include <LibUtilities/BasicUtils/SharedArray.hpp>
#include <LibUtilities/Python/NekPyConfig.hpp>
#include <type_traits>

Go to the source code of this file.

Classes

struct  is_shared_ptr< T >
 Template type to determine whether. More...
 
struct  is_shared_ptr< std::shared_ptr< T > >
 
struct  is_shared_ptr< const std::shared_ptr< T > >
 
struct  is_nekarray_oned< T >
 Template utility to determine whether. More...
 
struct  is_nekarray_oned< Array< OneD, T > >
 
struct  is_nekarray_oned< const Array< OneD, T > >
 
struct  OneDArrayToPython< T >
 Convert for Array<OneD, T> to Python list of objects for numeric types T. More...
 
struct  PythonToOneDArray< T >
 Converter for Python to Nektar::Array<OneD, T>. More...
 

Functions

template<typename T >
void CapsuleDestructor (PyObject *ptr)
 
template<typename T >
void export_SharedArray ()
 Convenience function to export C++-to-Python and Python-to-C++ converters for the requested type. More...
 

Function Documentation

◆ CapsuleDestructor()

template<typename T >
void CapsuleDestructor ( PyObject *  ptr)

Definition at line 82 of file Python/BasicUtils/SharedArray.hpp.

83{
84 Array<OneD, T> *tmp = (Array<OneD, T> *)PyCapsule_GetPointer(ptr, nullptr);
85 delete tmp;
86}

◆ export_SharedArray()

template<typename T >
void export_SharedArray ( )

Convenience function to export C++-to-Python and Python-to-C++ converters for the requested type.

Template Parameters
T.

Definition at line 328 of file Python/BasicUtils/SharedArray.hpp.

329{
330 py::to_python_converter<Array<OneD, T>, OneDArrayToPython<T>>();
332}
Convert for Array<OneD, T> to Python list of objects for numeric types T.
Converter for Python to Nektar::Array<OneD, T>.