Commit 0ee53857 by Christophe Geuzaine

setVertices

parent 6c8c49e6
Pipeline #941 passed with stage
in 39 minutes 56 seconds
......@@ -18,17 +18,17 @@ factory.addPoint(0,1,0,0.1,4)
factory.addLine(1,2,1)
factory.addLine(2,3,2)
factory.addLine(3,4,3)
line4 = factory.addLine(4,1,-1)
line4 = factory.addLine(4,1)
print("line4 received tag ", line4)
factory.addLineLoop([1,2,3,line4],1)
factory.addPlaneSurface([1],6)
factory.synchronize()
ptag = model.addPhysicalGroup(1,[1,2,3,4],-1)
ptag = model.addPhysicalGroup(1,[1,2,3,4])
ent = model.getEntitiesForPhysicalGroup(1,ptag)
print("new physical group ",ptag,":",ent, type(ent))
model.addPhysicalGroup(2,[6],-1)
model.addPhysicalGroup(2,[6])
print(gmsh.option.getString("General.BuildOptions"))
print(gmsh.option.getNumber("Mesh.Algorithm"))
......@@ -39,16 +39,18 @@ model.mesh.generate(2)
gmsh.write("square.msh")
print("Entities")
entities = model.getEntities(-1)
entities = model.getEntities()
for e in entities :
print("entity ",e)
types,tags,vertices = model.mesh.getElements(e[0],e[1])
for i in range(len(types)):
print("type ", types[i])
print("tags : ", list(tags[i]))
print("vertices : ", list(vertices[i]))
vertexTags,vertexCoords,_ = model.mesh.getVertices(e[0],e[1])
elemTypes,elemTags,elemVertices = model.mesh.getElements(e[0],e[1])
for i in range(len(elemTypes)):
print("type ", elemTypes[i])
print("tags : ", list(elemTags[i]))
print("vertices : ", list(elemVertices[i]))
if e[0] == [2] and e[1] == 6 :
model.mesh.setElements(e[0],e[1],types,[tags[0][:10]],[vertices[0][:30]])
model.mesh.setVertices(e[0],e[1],vertexTags,vertexCoords)
model.mesh.setElements(e[0],e[1],elemTypes,[elemTags[0][:10]],[elemVertices[0][:30]])
gmsh.write("mesh_truncated.msh")
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment