28 mesh, reader, name2Id = create_mesh_from_CGNS(
30 os.path.dirname(__file__),
35 "Uniform32_Periodic.cgns",
39 inner_process_parts=4,
51 n2idmap = name2Id.n2id_map
52 id2nmap = {k: v
for v, k
in n2idmap.items()}
54 def name_is_wall(name: str):
55 name = name.capitalize()
58 if "bc-4".capitalize()
in name:
61 def id_is_wall(id: int):
63 if id
in id2nmap
and name_is_wall(id2nmap[id]):
67 wallDistOptions = Geom.UnstructuredMesh.WallDistOptions()
68 wallDistOptions.method = 1
69 wallDistOptions.subdivide_quad = 5
70 wallDistOptions.verbose = 10
71 wallDistOptions.wallDistExecution = 4
72 mesh.BuildNodeWallDist(id_is_wall, wallDistOptions)
74 meshBnd, readerBnd = create_bnd_mesh(mesh)
76 mesh_bytes = mesh.getArrayBytes()
77 mesh_nCell = mesh.NumCellGlobal()
80 print(f
"mesh num cell: {mesh_nCell}")
81 print(f
"mesh size total: {mesh_bytes / (1024 * 1024):.4g} MB")
83 mesh.coords.to_device(
"CUDA")
84 mesh.to_device(
"CUDA")