8 mesh3d = root.create_component(
'mesh3d',
'cf3.mesh.Mesh')
9 blocks = root.create_component(
'model',
'cf3.mesh.BlockMesh.BlockArrays')
10 points = blocks.create_points(dimensions = 2, nb_points = 4)
15 block_nodes = blocks.create_blocks(1)
16 block_nodes[0] = [0, 1, 2, 3]
17 block_subdivs = blocks.create_block_subdivisions()
18 block_subdivs[0] = [segs,segs]
19 gradings = blocks.create_block_gradings()
20 gradings[0] = [1., 1., 0.1, 0.1]
21 blocks.create_patch_nb_faces(name =
'bottom', nb_faces = 1)[0] = [0, 1]
22 blocks.create_patch_nb_faces(name =
'right', nb_faces = 1)[0] = [1, 2]
23 blocks.create_patch_nb_faces(name =
'top', nb_faces = 1)[0] = [2, 3]
24 blocks.create_patch_nb_faces(name =
'left', nb_faces = 1)[0] = [3, 0]
25 blocks.extrude_blocks(positions=[1., 2.], nb_segments=[segs/2, segs/2], gradings=[1., 1.])
26 blocks.create_mesh(mesh3d.uri())
30 triangulator = root.create_component(
'Tetrahedralize',
'cf3.CGAL.Tetrahedralize')
31 triangulator.options().set(
'mesh', mesh3d)
32 triangulator.execute()
34 mesh3d.write_mesh(cf.URI(
'tetrahedralized.vtk'))