4 env = cf.Core.environment()
6 env.only_cpu0_writes =
True
7 env.exception_backtrace =
False
8 env.assertion_backtrace =
False
9 env.assertion_throws =
False
14 domain = root.create_component(
'Domain',
'cf3.mesh.Domain')
15 mesh = domain.create_component(
'mesh',
'cf3.mesh.Mesh')
17 mesh_generator = domain.create_component(
"MeshGenerator",
"cf3.mesh.SimpleMeshGenerator")
18 mesh_generator.mesh = mesh.uri()
19 mesh_generator.nb_cells = [20,20]
20 mesh_generator.lengths = [1.,1.]
21 mesh_generator.offsets = [0.,0.]
22 mesh_generator.execute()
26 my_rank = cf.Core.rank()
28 ranks = mesh.geometry.children.rank
34 print 'nodes for rank before:', my_rank,
':', my_nb_nodes
36 partitioner = domain.create_component(
'Partitioner',
'cf3.zoltan.PHG')
37 partitioner.mesh = mesh
41 ranks = mesh.geometry.children.rank
47 print 'nodes for rank after:', my_rank,
':', my_nb_nodes
49 make_par_data = root.create_component(
'MakeParData',
'cf3.solver.actions.ParallelDataToFields')
50 make_par_data.mesh = mesh
51 make_par_data.execute()
53 domain.write_mesh(cf.URI(
'phg-output.pvtu'))