4 env = cf.Core.environment()
6 env.only_cpu0_writes =
True
9 mesh = root.create_component(
'mesh',
'cf3.mesh.Mesh')
12 blocks = root.create_component(
'model',
'cf3.mesh.BlockMesh.BlockArrays')
13 points = blocks.create_points(dimensions = 2, nb_points = 4)
18 block_nodes = blocks.create_blocks(1)
19 block_nodes[0] = [0, 1, 2, 3]
20 block_subdivs = blocks.create_block_subdivisions()
21 block_subdivs[0] = [10,10]
22 gradings = blocks.create_block_gradings()
23 gradings[0] = [1., 1., 1., 1.]
24 blocks.create_patch_nb_faces(name =
'bottom', nb_faces = 1)[0] = [0, 1]
25 blocks.create_patch_nb_faces(name =
'right', nb_faces = 1)[0] = [1, 2]
26 blocks.create_patch_nb_faces(name =
'top', nb_faces = 1)[0] = [2, 3]
27 blocks.create_patch_nb_faces(name =
'left', nb_faces = 1)[0] = [3, 0]
28 blocks.partition_blocks(nb_partitions = 2, direction = 0)
29 blocks.partition_blocks(nb_partitions = 2, direction = 1)
30 blocks.create_mesh(mesh.uri())
32 make_boundary_global = root.create_component(
'MakeBoundaryGlobal',
'cf3.mesh.actions.MakeBoundaryGlobal')
33 make_boundary_global.mesh = mesh
34 make_boundary_global.execute()
36 writer = root.create_component(
'MshWriter',
'cf3.mesh.gmsh.Writer')
37 writer.enable_overlap =
True
39 writer.file = cf.URI(
'make-boundary-global.msh')