Hi there,
Let’s say I wan to deform my mesh in the surface normal direction. For example, I have this geometry;
I want to update this geometry to this;
by manipualting the mesh with mesh.geometry.x[lateral_surface_indices]=....
I want to know how can I move the mesh points in the normal direction of lateral surface. How can I achieve that?
Here is the example code to generate the mesh;
import gmsh
from mpi4py import MPI
from dolfinx.io import gmshio
L = 0.15
R = 0.2
gdim = 3
mesh_comm = MPI.COMM_WORLD
model_rank = 0
gmsh.initialize()
if mesh_comm.rank == model_rank:
cylinder = gmsh.model.occ.add_cylinder(0,0,0,0,0,L,R)
gmsh.model.occ.synchronize()
gmsh.model.addPhysicalGroup(2, [1], 1) # Lateral surface
gmsh.model.addPhysicalGroup(2, [2], 2) # Top surface
gmsh.model.addPhysicalGroup(2, [3], 3) # Bottom surface
gmsh.model.addPhysicalGroup(3, [1], 1) # Cylinder volume
gmsh.option.setNumber("Mesh.MeshSizeMax", 0.03)
gmsh.model.mesh.generate(gdim)
gmsh.fltk.run()
mesh, subdomains, ft = gmshio.model_to_mesh(gmsh.model, mesh_comm, model_rank, gdim=gdim)
Thanks for your answers in advance.