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