From 301ba176e5bfcae85cb2d82bd71dd14979fc26d9 Mon Sep 17 00:00:00 2001 From: Christopher Lackner Date: Tue, 23 Jan 2018 16:45:20 +0100 Subject: [PATCH] Python export of second order trigs --- libsrc/meshing/python_mesh.cpp | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/libsrc/meshing/python_mesh.cpp b/libsrc/meshing/python_mesh.cpp index 788717f5..60bfaa81 100644 --- a/libsrc/meshing/python_mesh.cpp +++ b/libsrc/meshing/python_mesh.cpp @@ -270,15 +270,25 @@ DLL_HEADER void ExportNetgenMeshing(py::module &m) for (int i = 0; i < 3; i++) (*instance)[i] = py::extract(vertices[i])(); instance->SetIndex(index); + return; } - else + if (py::len(vertices) == 4) { new (instance) Element2d(QUAD); for (int i = 0; i < 4; i++) (*instance)[i] = py::extract(vertices[i])(); instance->SetIndex(index); + return; } - + if (py::len(vertices) == 6) + { + new (instance) Element2d(TRIG6); + for(int i = 0; i<6; i++) + (*instance)[i] = py::extract(vertices[i])(); + instance->SetIndex(index); + return; + } + throw NgException("Inconsistent number of vertices in Element2D"); }, py::arg("index")=1,py::arg("vertices"), "create surface element"