1 # Usage of Radial Prism 3D meshing algorithm
4 salome.salome_init_without_session()
6 from salome.geom import geomBuilder
7 from salome.smesh import smeshBuilder
9 geom_builder = geomBuilder.New()
10 smesh_builder = smeshBuilder.New()
12 # Create geometry: hollow sphere
14 sphere_1 = geom_builder.MakeSphereR( 100 )
15 sphere_2 = geom_builder.MakeSphereR( 50 )
17 hollow_sphere = geom_builder.MakeCut( sphere_1, sphere_2, theName="hollow sphere")
19 faces = geom_builder.ExtractShapes( hollow_sphere, geom_builder.ShapeType["FACE"] )
23 mesh = smesh_builder.Mesh( hollow_sphere, "Mesh of hollow sphere" )
25 # assign Global Radial Prism algorithm
26 prism_algo = mesh.Prism()
28 # define projection between the inner and outer spheres
29 mesh.Triangle( smeshBuilder.NETGEN_1D2D, faces[0] ) # NETGEN on faces[0]
30 mesh.Projection1D2D( faces[1] ).SourceFace( faces[0] ) # projection faces[0] -> faces[1]
32 # define distribution of layers using Number of Segments hypothesis in logarithmic mode
33 prism_algo.NumberOfSegments( 4, 5. )
36 if not mesh.Compute(): raise Exception("Error when computing Mesh")