fix create vol-element (thx Astrid)

This commit is contained in:
Joachim Schöberl 2016-11-23 20:44:52 +01:00
parent ee4d5e89d8
commit 5b3eb4077a

View File

@ -128,21 +128,22 @@ DLL_HEADER void ExportNetgenMeshing(py::module &m)
(*instance)[i] = py::extract<PointIndex>(vertices[i])();
instance->SetIndex(index);
}
if (py::len(vertices) == 6)
else if (py::len(vertices) == 6)
{
new (instance) Element(PRISM);
for (int i = 0; i < 6; i++)
(*instance)[i] = py::extract<PointIndex>(vertices[i])();
instance->SetIndex(index);
}
if (py::len(vertices) == 8)
else if (py::len(vertices) == 8)
{
new (instance) Element(HEX);
for (int i = 0; i < 8; i++)
(*instance)[i] = py::extract<PointIndex>(vertices[i])();
instance->SetIndex(index);
}
throw NgException ("cannot create element");
else
throw NgException ("cannot create element");
},
py::arg("index")=1,py::arg("vertices"),
"create volume element"