From 2f4ff3ab2baffd34bbc787aeef92b8aed8b9348d Mon Sep 17 00:00:00 2001 From: Christoph Wintersteiger Date: Wed, 1 Oct 2014 13:16:34 +0000 Subject: [PATCH] Element2D exported to Python --- libsrc/meshing/python_mesh.cpp | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/libsrc/meshing/python_mesh.cpp b/libsrc/meshing/python_mesh.cpp index 56f88426..74653a86 100644 --- a/libsrc/meshing/python_mesh.cpp +++ b/libsrc/meshing/python_mesh.cpp @@ -114,7 +114,18 @@ void ExportNetgenMeshing() return li; })) ; - + + bp::class_("Element2D") + .add_property("index", &Element2d::GetIndex, &Element2d::SetIndex) + .add_property("vertices", + FunctionPointer([](const Element2d & self) -> bp::list + { + bp::list li; + for (int i = 0; i < self.GetNV(); i++) + li.append(self[i]); + return li; + })) + ; ExportArray(); ExportArray(); ExportArray();