Nektar++
Functions
Python/Movement.cpp File Reference
#include <LibUtilities/Python/NekPyConfig.hpp>
#include <SpatialDomains/Movement/Movement.h>
#include <boost/python/suite/indexing/map_indexing_suite.hpp>

Go to the source code of this file.

Functions

py::dict GetInterfaces_wrapper (MovementSharedPtr movement)
 
MovementSharedPtr Movement_Init ()
 
void export_Movement ()
 

Function Documentation

◆ export_Movement()

void export_Movement ( )

Definition at line 61 of file Python/Movement.cpp.

62{
63
64 py::class_<std::map<int, ZoneBaseShPtr>>("ZoneMap").def(
65 py::map_indexing_suite<std::map<int, ZoneBaseShPtr>, true>());
66
67 py::class_<Movement, std::shared_ptr<Movement>>("Movement", py::no_init)
68 .def("__init__", py::make_constructor(&Movement_Init))
69 .def("GetInterfaces", &GetInterfaces_wrapper)
70 .def("GetZones", &Movement::GetZones,
71 py::return_value_policy<py::copy_const_reference>())
72 .def("PerformMovement", &Movement::PerformMovement)
73 .def("AddZone", &Movement::AddZone)
74 .def("AddInterface", &Movement::AddInterface);
75}
py::dict GetInterfaces_wrapper(MovementSharedPtr movement)
MovementSharedPtr Movement_Init()

References GetInterfaces_wrapper(), and Movement_Init().

Referenced by BOOST_PYTHON_MODULE().

◆ GetInterfaces_wrapper()

py::dict GetInterfaces_wrapper ( MovementSharedPtr  movement)

Definition at line 45 of file Python/Movement.cpp.

46{
47 py::dict d;
48 for (auto &iter : movement->GetInterfaces())
49 {
50 py::tuple key = py::make_tuple(iter.first.first, iter.first.second);
51 d[key] = iter.second;
52 }
53 return d;
54}
std::vector< double > d(NPUPPER *NPUPPER)

References Nektar::UnitTests::d().

Referenced by export_Movement().

◆ Movement_Init()

MovementSharedPtr Movement_Init ( )

Definition at line 56 of file Python/Movement.cpp.

57{
58 return std::make_shared<Movement>();
59}

Referenced by export_Movement().