Salome HOME
Redesign SALOME documentation
[modules/smesh.git] / doc / salome / examples / defining_hypotheses_ex13.py
1 # Radial Quadrangle 1D-2D example
2
3 import salome
4 salome.salome_init()
5 import GEOM
6 from salome.geom import geomBuilder
7 geompy = geomBuilder.New(salome.myStudy)
8
9 import SMESH, SALOMEDS
10 from salome.smesh import smeshBuilder
11 smesh =  smeshBuilder.New(salome.myStudy)
12
13 # Create face from the wire and add to study
14 Face = geompy.MakeSketcher("Sketcher:F 0 0:TT 20 0:R 90:C 20 90:WF", [0, 0, 0, 1, 0, 0, 0, 0, 1])
15 geompy.addToStudy(Face,"Face")
16 circle, radius1, radius2 = geompy.SubShapeAllSorted(Face, geompy.ShapeType["EDGE"])
17 geompy.addToStudyInFather(Face, radius1,"radius1")
18 geompy.addToStudyInFather(Face, radius2,"radius2")
19 geompy.addToStudyInFather(Face, circle,"circle")
20
21
22 # Define geometry for mesh, and Radial Quadrange algorithm
23 mesh = smesh.Mesh(Face)
24 radial_Quad_algo = mesh.Quadrangle(algo=smeshBuilder.RADIAL_QUAD)
25
26 # The Radial Quadrange algorithm can work without any hypothesis
27 # In this case it uses "Default Nb of Segments" preferences parameter to discretize edges
28 mesh.Compute()
29
30 # The Radial Quadrange uses global or local 1d hypotheses if it does
31 # not have its own hypotheses.
32 # Define global hypotheses to discretize radial edges and a local one for circular edge
33 global_Nb_Segments = mesh.Segment().NumberOfSegments(5)
34 local_Nb_Segments  = mesh.Segment(circle).NumberOfSegments(10)
35 mesh.Compute()
36
37 # Define own parameters of Radial Quadrange algorithm
38 radial_Quad_algo.NumberOfLayers( 4 )
39 mesh.Compute()