5 blocks = parent.create_component(
'Blocks',
'cf3.mesh.BlockMesh.BlockArrays')
6 points = blocks.create_points(dimensions = 2, nb_points = 4)
11 block_nodes = blocks.create_blocks(1)
12 block_nodes[0] = [0, 1, 2, 3]
13 block_subdivs = blocks.create_block_subdivisions()
14 block_subdivs[0] = [40,20]
15 gradings = blocks.create_block_gradings()
16 gradings[0] = [1., 1., 1., 1.]
17 blocks.create_patch_nb_faces(name =
'bottom', nb_faces = 1)[0] = [0, 1]
18 blocks.create_patch_nb_faces(name =
'right', nb_faces = 1)[0] = [1, 2]
19 blocks.create_patch_nb_faces(name =
'top', nb_faces = 1)[0] = [2, 3]
20 blocks.create_patch_nb_faces(name =
'left', nb_faces = 1)[0] = [3, 0]
21 blocks.partition_blocks(nb_partitions = cf.Core.nb_procs(), direction = 1)
22 blocks.create_mesh(mesh.uri())
23 blocks.delete_component()
25 env = cf.Core.environment()
27 env.only_cpu0_writes =
False
30 domain = root.create_component(
'Domain',
'cf3.mesh.Domain')
31 meshdiff = domain.create_component(
'MeshDiff',
'cf3.mesh.actions.MeshDiff')
32 meshdiff.left = domain.create_component(
'mesh1',
'cf3.mesh.Mesh')
33 meshdiff.right = domain.create_component(
'mesh2',
'cf3.mesh.Mesh')
38 if meshdiff.properties()[
'mesh_equal']:
39 raise Exception(
'Incorrect meshdiff result')
44 if not meshdiff.properties()[
'mesh_equal']:
45 raise Exception(
'Incorrect meshdiff result')
47 make_par_data = root.create_component(
'MakeParData',
'cf3.solver.actions.ParallelDataToFields')
48 make_par_data.mesh = meshdiff.right
49 make_par_data.execute()
52 if meshdiff.properties()[
'mesh_equal']:
53 raise Exception(
'Incorrect meshdiff result')
55 make_par_data.mesh = meshdiff.left
56 make_par_data.execute()
59 if not meshdiff.properties()[
'mesh_equal']:
60 raise Exception(
'Incorrect meshdiff result')
def build_mesh(mesh, parent)