second order segments available for Python

This commit is contained in:
Joachim Schöberl 2017-06-28 07:23:28 +02:00
parent 792ff477be
commit f2f3e92125
2 changed files with 25 additions and 1 deletions

View File

@ -238,12 +238,19 @@ void WriteNeutralFormat (const Mesh & mesh,
if (mesh.GetDimension() == 2)
{
outfile << nseg << "\n";
for (i = 1; i <= nseg; i++)
for (int i = 1; i <= nseg; i++)
{
const Segment & seg = mesh.LineSegment(i);
outfile.width(4);
outfile << seg.si << " ";
for (int j = 0; j < seg.GetNP(); j++)
{
outfile << " ";
outfile.width(8);
outfile << seg[j];
}
/*
outfile << " ";
outfile.width(8);
outfile << seg[0];
@ -255,6 +262,7 @@ void WriteNeutralFormat (const Mesh & mesh,
outfile.width(8);
outfile << seg[2];
}
*/
outfile << "\n";
}
}

View File

@ -284,6 +284,14 @@ DLL_HEADER void ExportNetgenMeshing(py::module &m)
li.append(py::cast(self[i]));
return li;
}))
.def_property_readonly("points",
FunctionPointer ([](const Element2d & self) -> py::list
{
py::list li;
for (int i = 0; i < self.GetNP(); i++)
li.append (py::cast(self[i]));
return li;
}))
;
py::class_<Segment>(m, "Element1D")
@ -316,6 +324,14 @@ DLL_HEADER void ExportNetgenMeshing(py::module &m)
li.append (py::cast(self[i]));
return li;
}))
.def_property_readonly("points",
FunctionPointer ([](const Segment & self) -> py::list
{
py::list li;
for (int i = 0; i < self.GetNP(); i++)
li.append (py::cast(self[i]));
return li;
}))
.def_property_readonly("surfaces",
FunctionPointer ([](const Segment & self) -> py::list
{