mirror of
https://github.com/NGSolve/netgen.git
synced 2024-11-11 16:49:16 +05:00
export Mesh.SecondOrder
This commit is contained in:
parent
c9ac332971
commit
e8712aa8ae
@ -237,6 +237,14 @@ DLL_HEADER void ExportNetgenMeshing(py::module &m)
|
||||
li.append (py::cast(self[i]));
|
||||
return li;
|
||||
}))
|
||||
.def_property_readonly("points",
|
||||
FunctionPointer ([](const Element & self) -> py::list
|
||||
{
|
||||
py::list li;
|
||||
for (int i = 0; i < self.GetNP(); i++)
|
||||
li.append (py::cast(self[i]));
|
||||
return li;
|
||||
}))
|
||||
;
|
||||
|
||||
py::class_<Element2d>(m, "Element2D")
|
||||
@ -601,6 +609,15 @@ DLL_HEADER void ExportNetgenMeshing(py::module &m)
|
||||
Refinement().Refine(self);
|
||||
}))
|
||||
|
||||
.def ("SecondOrder", FunctionPointer
|
||||
([](Mesh & self)
|
||||
{
|
||||
if (self.GetGeometry())
|
||||
self.GetGeometry()->GetRefinement().MakeSecondOrder(self);
|
||||
else
|
||||
Refinement().MakeSecondOrder(self);
|
||||
}))
|
||||
|
||||
.def ("SetGeometry", FunctionPointer
|
||||
([](Mesh & self, shared_ptr<NetgenGeometry> geo)
|
||||
{
|
||||
|
@ -17,8 +17,8 @@ def Export (mesh, filename):
|
||||
print (len(volels), file=f)
|
||||
for el in volels:
|
||||
print (el.index, end=" ", file=f)
|
||||
for j in el.vertices:
|
||||
print (j.nr, end=" ", file=f)
|
||||
for p in el.points:
|
||||
print (p.nr, end=" ", file=f)
|
||||
print(file=f)
|
||||
|
||||
|
||||
|
@ -8,7 +8,7 @@ param.maxh = 10
|
||||
print (param)
|
||||
|
||||
m1 = GenerateMesh (geo, param)
|
||||
|
||||
m1.SecondOrder()
|
||||
|
||||
import exportNeutral
|
||||
exportNeutral.Export (m1, "shaft.mesh")
|
||||
@ -16,3 +16,4 @@ exportNeutral.Export (m1, "shaft.mesh")
|
||||
|
||||
|
||||
Save (m1, "mesh.vol", geo)
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user