Hi Henry,
Thanks lot your reply.
I've tried your advice, there are still some problem.
1. The object in mesh.Elements(VOL) is read only, right? So, we have to pass to mesh.ngmesh, where all the stuff can be modified.
However, this code mesh.ngmesh[ElementId(VOL, i)] seems not work: the argument not support.
2. To modify the position of the nodes, the ng.mesh.Points() should be used? or there are other functions?
Here is my simple test code (I just want move the the nodes associated with cut elements vertically for example:
map = lambda x,y: (x*0.7-0.5, y/10)
mesh = MakeStructured2DMesh(quads=False, nx=5, ny=2, mapping=map)
levelset = x-0.
lsetmeshadap = LevelSetMeshAdaptation(mesh, order=order-1, levelset=levelset)
deformation = lsetmeshadap.CalcDeformation(levelset)
lsetp1 = lsetmeshadap.lset_p1
ci = CutInfo(mesh, lsetp1)
for i in range(mesh.ne):
if ci.GetElementsOfType(IF):
print(i, 'is a cut element')
el = mesh.ngmesh[ElementId(VOL, i)] # here is a problem
p = [list(mesh[el.vertices].point) for i in range(3)]
print ("vertices: ", el.vertices) # get vertices of an element
print ("points associated: ", p)
for i in range(3):
p[0] +=0.05
print ("points associated: ", p)
Thanks again !