Qiong
November 25, 2023, 2:02am
1
Dear all,

I am creating a crack inside of a rectangular domain, could anyone tell me how to refine the area along the crack?

```
width = 1
length = 1
h = 1e-3 # crack_thickness
rec1 = gmsh.model.occ.addRectangle(0, 0, 0, width, length)
rec2 = gmsh.model.occ.addRectangle(0, (width-h)/2, 0, width/2, (width+h)/2)
domain = gmsh.model.occ.cut([(2, rec1)], [(2,rec2)])
gmsh.model.occ.synchronize()
```

Thanks you

dokken
November 25, 2023, 10:38am
2
1 Like

Qiong
November 27, 2023, 1:34am
3
Hi dokken,

could I ask one more question?

```
mesh_comm = MPI.COMM_WORLD
if mesh_comm.rank == model_rank:
```

Why we need to include the above code in the tutorial?

Kindly
Qiong

dokken
November 27, 2023, 3:47am
4
Gmsh doesnâ€™t use mpi parallelism. Thus if you disregard it, N copies of the mesh generation will run on N processes with `mpirun -n N python3 â€¦`

Qiong
November 27, 2023, 11:02pm
5
Got you. I looked thought the tutorial, and I could not find the relevant explanation about the option (such as â€śIField, Lcminâ€ť etc). Do you know where I can find the detailed illustration?

```
gmsh.model.mesh.field.add("Threshold", 2)
gmsh.model.mesh.field.setNumber(2, "IField", 1)
gmsh.model.mesh.field.setNumber(2, "LcMin", r / 3)
gmsh.model.mesh.field.setNumber(2, "LcMax", 6 * r)
gmsh.model.mesh.field.setNumber(2, "DistMin", 4 * r)
gmsh.model.mesh.field.setNumber(2, "DistMax", 10 * r)
```

dokken
November 28, 2023, 5:13am
6
1 Like