Hello alessio,
when you iterate over elements
Code:
for el in mesh.Elements(VOL):
print(type(el))
you get objects of the type "Ngs_Element", which is defined in python_comp_mesh.cpp:L252. All the attributes of this type are read only, thus your approach does not work.
If you really want to change some elements, you would have to copy the mesh points, copy the unchanged elements and then add your custom elements. Might be helpful to check
this
out.
Modifying/moving some points, leaving the mesh topology the same, is way easier. The mesh on the Netgen side provides a reference to the points
Code:
pnts = mesh.ngmesh.Points()
and you can change the coordinates of the point corresponding to "v1" by
Code:
pnts[v1] = MeshPoint(Pnt(-1.5,-0.5,0))
The change should be visible in the GUI you after calling "mesh.ngmesh.Update()".
Hope that helps.
Best,
Christoph