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

Go to the source code of this file.

Functions

CompositeSharedPtr Composite_Init (py::list geometries)
 
void export_MeshGraph ()
 MeshGraph exports. More...
 

Function Documentation

◆ Composite_Init()

CompositeSharedPtr Composite_Init ( py::list  geometries)

Definition at line 49 of file Python/MeshGraph.cpp.

50{
51 CompositeSharedPtr composite = std::make_shared<Composite>();
52 composite->m_geomVec.clear();
53 for (int i = 0; i < py::len(geometries); i++)
54 {
55 composite->m_geomVec.emplace_back(
56 py::extract<GeometrySharedPtr>(geometries[i]));
57 }
58 return composite;
59}
std::shared_ptr< Composite > CompositeSharedPtr
Definition: MeshGraph.h:135

Referenced by export_MeshGraph().

◆ export_MeshGraph()

void export_MeshGraph ( )

MeshGraph exports.

Definition at line 64 of file Python/MeshGraph.cpp.

65{
66 py::class_<LibUtilities::FieldMetaDataMap>("FieldMetaDataMap")
67 .def(py::map_indexing_suite<LibUtilities::FieldMetaDataMap, true>());
68
69 py::class_<std::vector<GeometrySharedPtr>>("GeometryList")
70 .def(py::vector_indexing_suite<std::vector<GeometrySharedPtr>, true>());
71 py::class_<Composite, std::shared_ptr<Composite>>("Composite", py::init<>())
72 .def("__init__", py::make_constructor(&Composite_Init))
73 .def_readwrite("geometries", &Composite::m_geomVec);
74
75 py::class_<PointGeomMap>("PointGeomMap")
76 .def(py::map_indexing_suite<PointGeomMap, true>());
77 py::class_<SegGeomMap>("SegGeomMap")
78 .def(py::map_indexing_suite<SegGeomMap, true>());
79 py::class_<QuadGeomMap>("QuadGeomMap")
80 .def(py::map_indexing_suite<QuadGeomMap, true>());
81 py::class_<TriGeomMap>("TriGeomMap")
82 .def(py::map_indexing_suite<TriGeomMap, true>());
83 py::class_<TetGeomMap>("TetGeomMap")
84 .def(py::map_indexing_suite<TetGeomMap, true>());
85 py::class_<PrismGeomMap>("PrismGeomMap")
86 .def(py::map_indexing_suite<PrismGeomMap, true>());
87 py::class_<PyrGeomMap>("PyrGeomMap")
88 .def(py::map_indexing_suite<PyrGeomMap, true>());
89 py::class_<HexGeomMap>("HexGeomMap")
90 .def(py::map_indexing_suite<HexGeomMap, true>());
91 py::class_<CurveMap>("CurveMap")
92 .def(py::map_indexing_suite<CurveMap, true>());
93 py::class_<CompositeMap>("CompositeMap")
94 .def(py::map_indexing_suite<CompositeMap, true>());
95 py::class_<std::map<int, CompositeMap>>("DomainMap")
96 .def(py::map_indexing_suite<std::map<int, CompositeMap>, true>());
97
98 py::class_<MeshGraph, std::shared_ptr<MeshGraph>, boost::noncopyable>(
99 "MeshGraph", py::init<>())
100
101 .def("Empty", &MeshGraph::Empty)
102
103 .def("GetMeshDimension", &MeshGraph::GetMeshDimension)
104 .def("GetSpaceDimension", &MeshGraph::GetSpaceDimension)
105
106 .def("SetMeshDimension", &MeshGraph::SetMeshDimension)
107 .def("SetSpaceDimension", &MeshGraph::SetSpaceDimension)
108
109 .def("GetAllPointGeoms", &MeshGraph::GetAllPointGeoms,
110 py::return_internal_reference<>())
111 .def("GetAllSegGeoms", &MeshGraph::GetAllSegGeoms,
112 py::return_internal_reference<>())
113 .def("GetAllQuadGeoms", &MeshGraph::GetAllQuadGeoms,
114 py::return_internal_reference<>())
115 .def("GetAllTriGeoms", &MeshGraph::GetAllTriGeoms,
116 py::return_internal_reference<>())
117 .def("GetAllTetGeoms", &MeshGraph::GetAllTetGeoms,
118 py::return_internal_reference<>())
119 .def("GetAllPrismGeoms", &MeshGraph::GetAllPrismGeoms,
120 py::return_internal_reference<>())
121 .def("GetAllPyrGeoms", &MeshGraph::GetAllPyrGeoms,
122 py::return_internal_reference<>())
123 .def("GetAllHexGeoms", &MeshGraph::GetAllHexGeoms,
124 py::return_internal_reference<>())
125 .def("GetCurvedEdges", &MeshGraph::GetCurvedEdges,
126 py::return_internal_reference<>())
127 .def("GetCurvedFaces", &MeshGraph::GetCurvedFaces,
128 py::return_internal_reference<>())
129 .def("GetComposites", &MeshGraph::GetComposites,
130 py::return_internal_reference<>())
131 .def<std::map<int, CompositeMap> &(MeshGraph::*)()>(
132 "GetDomain", &MeshGraph::GetDomain,
133 py::return_internal_reference<>())
134
135 .def("GetMovement", &MeshGraph::GetMovement,
136 py::return_value_policy<py::return_by_value>())
137
138 .def("GetNumElements", &MeshGraph::GetNumElements)
139
140 .def("SetExpansionInfosToEvenlySpacedPoints",
141 &MeshGraph::SetExpansionInfoToEvenlySpacedPoints)
142 .def("SetExpansionInfosToPolyOrder",
143 &MeshGraph::SetExpansionInfoToNumModes)
144 .def("SetExpansionInfosToPointOrder",
145 &MeshGraph::SetExpansionInfoToPointOrder);
146}
CompositeSharedPtr Composite_Init(py::list geometries)
Base class for a spectral/hp element mesh.
Definition: MeshGraph.h:181

References Composite_Init().

Referenced by BOOST_PYTHON_MODULE().