Merge branch 'second_order_trigs' into 'master'

Python export of second order trigs

See merge request jschoeberl/netgen!75
This commit is contained in:
Joachim Schöberl 2018-01-23 16:53:35 +01:00
commit 93840787b3

View File

@ -270,15 +270,25 @@ DLL_HEADER void ExportNetgenMeshing(py::module &m)
for (int i = 0; i < 3; i++) for (int i = 0; i < 3; i++)
(*instance)[i] = py::extract<PointIndex>(vertices[i])(); (*instance)[i] = py::extract<PointIndex>(vertices[i])();
instance->SetIndex(index); instance->SetIndex(index);
return;
} }
else if (py::len(vertices) == 4)
{ {
new (instance) Element2d(QUAD); new (instance) Element2d(QUAD);
for (int i = 0; i < 4; i++) for (int i = 0; i < 4; i++)
(*instance)[i] = py::extract<PointIndex>(vertices[i])(); (*instance)[i] = py::extract<PointIndex>(vertices[i])();
instance->SetIndex(index); instance->SetIndex(index);
return;
} }
if (py::len(vertices) == 6)
{
new (instance) Element2d(TRIG6);
for(int i = 0; i<6; i++)
(*instance)[i] = py::extract<PointIndex>(vertices[i])();
instance->SetIndex(index);
return;
}
throw NgException("Inconsistent number of vertices in Element2D");
}, },
py::arg("index")=1,py::arg("vertices"), py::arg("index")=1,py::arg("vertices"),
"create surface element" "create surface element"