8 env = cf.Core.environment()
11 env.options().set(
'assertion_throws',
False)
12 env.options().set(
'assertion_backtrace',
False)
13 env.options().set(
'exception_backtrace',
False)
14 env.options().set(
'regist_signal_handlers',
False)
15 env.options().set(
'log_level', 4)
19 domain = model.create_domain()
20 physics = model.create_physics(
'cf3.UFEM.NavierStokesPhysics')
21 solver = model.create_solver(
'cf3.UFEM.Solver')
22 hc_bottom = solver.add_direct_solver(
'cf3.UFEM.HeatConductionSteady')
23 hc_top = solver.add_direct_solver(
'cf3.UFEM.HeatConductionSteady')
26 blocks = domain.create_component(
'blocks',
'cf3.mesh.BlockMesh.BlockArrays')
27 points = blocks.create_points(dimensions = 2, nb_points = 6)
35 block_nodes = blocks.create_blocks(2)
36 block_nodes[0] = [0, 1, 3, 2]
37 block_nodes[1] = [2, 3, 5, 4]
39 block_subdivs = blocks.create_block_subdivisions()
40 block_subdivs[0] = [40, 20]
41 block_subdivs[1] = [40, 20]
43 gradings = blocks.create_block_gradings()
44 gradings[0] = [1., 1., 1., 1.]
45 gradings[1] = [1., 1., 1., 1.]
47 left_patch = blocks.create_patch_nb_faces(name =
'left', nb_faces = 2)
48 left_patch[0] = [2, 0]
49 left_patch[1] = [4, 2]
51 bottom_patch = blocks.create_patch_nb_faces(name =
'bottom', nb_faces = 1)
52 bottom_patch[0] = [0, 1]
54 top_patch = blocks.create_patch_nb_faces(name =
'top', nb_faces = 1)
57 right_patch = blocks.create_patch_nb_faces(name =
'right', nb_faces = 2)
58 right_patch[0] = [1, 3]
59 right_patch[1] = [3, 5]
62 blocks.options().set(
'block_regions', [
'solid_bottom',
'solid_top'])
64 mesh = domain.create_component(
'Mesh',
'cf3.mesh.Mesh')
65 blocks.create_mesh(mesh.uri())
67 hc_bottom.options().set(
'regions', [mesh.access_component(
'topology/solid_bottom').
uri()])
68 hc_top.options().set(
'regions', [mesh.access_component(
'topology/solid_top').
uri()])
71 bc_bot = hc_bottom.get_child(
'BoundaryConditions')
72 bc_bot.options().set(
'regions', [mesh.access_component(
'topology').
uri()])
73 bc_bot.add_constant_bc(region_name =
'bottom', variable_name =
'Temperature').options().set(
'value', 10)
75 bc_bot.add_constant_bc(region_name =
'region_bnd_solid_bottom_solid_top', variable_name =
'Temperature').options().set(
'value', 50)
78 bc_top = hc_top.get_child(
'BoundaryConditions')
79 bc_top.options().set(
'regions', [mesh.access_component(
'topology').
uri()])
80 bc_top.add_constant_bc(region_name =
'top', variable_name =
'Temperature').options().set(
'value', 10)
81 bc_top.add_constant_bc(region_name =
'region_bnd_solid_top_solid_bottom', variable_name =
'Temperature').options().set(
'value', 50)
87 domain.write_mesh(cf.URI(
'atest-multiregion.pvtu'))
boost::python::object create_component(ComponentWrapper &self, const std::string &name, const std::string &builder_name)
common::URI uri(ComponentWrapper &self)