5 cf.env.assertion_backtrace =
False
6 cf.env.exception_backtrace =
True
7 cf.env.regist_signal_handlers =
False
8 cf.env.exception_log_level = 0
10 cf.env.exception_outputs =
False
14 domain = model.create_domain()
15 physics = model.create_physics(
'cf3.UFEM.NavierStokesPhysics')
16 solver = model.create_solver(
'cf3.UFEM.Solver')
17 hc = solver.add_direct_solver(
'cf3.UFEM.HeatConductionSteady')
20 mesh = domain.create_component(
'mesh',
'cf3.mesh.Mesh')
22 blocks = domain.create_component(
'model',
'cf3.mesh.BlockMesh.BlockArrays')
23 points = blocks.create_points(dimensions = 2, nb_points = 4)
28 block_nodes = blocks.create_blocks(1)
29 block_nodes[0] = [0, 1, 2, 3]
30 block_subdivs = blocks.create_block_subdivisions()
31 block_subdivs[0] = [20,20]
32 gradings = blocks.create_block_gradings()
33 gradings[0] = [1., 1., 1., 1.]
34 blocks.create_patch_nb_faces(name =
'bottom', nb_faces = 1)[0] = [0, 1]
35 blocks.create_patch_nb_faces(name =
'right', nb_faces = 1)[0] = [1, 2]
36 blocks.create_patch_nb_faces(name =
'top', nb_faces = 1)[0] = [2, 3]
37 blocks.create_patch_nb_faces(name =
'left', nb_faces = 1)[0] = [3, 0]
38 blocks.partition_blocks(nb_partitions = 4, direction = 1)
39 blocks.create_mesh(mesh.uri())
41 partitioner = domain.create_component(
'Partitioner',
'cf3.mesh.actions.PeriodicMeshPartitioner')
42 partitioner.mesh = mesh
44 link_horizontal = partitioner.create_link_periodic_nodes()
45 link_horizontal.source_region = mesh.topology.right
46 link_horizontal.destination_region = mesh.topology.left
47 link_horizontal.translation_vector = [-1., 0.]
53 make_par_data = domain.create_component(
'MakeParData',
'cf3.solver.actions.ParallelDataToFields')
54 make_par_data.mesh = mesh
55 make_par_data.execute()
57 domain.write_mesh(cf.URI(
'heat2d-periodic-input.pvtu'))
59 hc.regions = [mesh.topology.interior.uri()]
61 writer = domain.create_component(
'MshWriter',
'cf3.mesh.gmsh.Writer')
62 writer.enable_overlap =
True
64 writer.fields = [mesh.geometry.node_gids.uri()]
65 writer.file = cf.URI(
'heat2d-periodic-input.msh')
69 bc = hc.BoundaryConditions
70 bc.regions = [mesh.topology.uri()]
71 bc.add_constant_bc(region_name =
'bottom', variable_name =
'Temperature').value = 10
72 bc.add_constant_bc(region_name =
'top', variable_name =
'Temperature').value = 30
78 writer.fields = [mesh.geometry.heat_conduction_solution.uri()]
79 writer.file = cf.URI(
'heat2d-periodic.msh')
81 domain.write_mesh(cf.URI(
'heat2d-periodic.pvtu'))
boost::python::object create_component(ComponentWrapper &self, const std::string &name, const std::string &builder_name)