Salome HOME
Merge remote branch 'origin/V8_5_asterstudy'
[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()
8
9 import SMESH, SALOMEDS
10 from salome.smesh import smeshBuilder
11 smesh =  smeshBuilder.New()
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 # So by default there will be 15 segments in both radial and circular directions
29 mesh.Compute()
30
31 # The Radial Quadrange uses global or local 1d hypotheses if it does
32 # not have its own hypotheses.
33 # Define global hypotheses to discretize radial edges and a local one for circular edge
34 # So that there will be 5 radial layers and 10 circular segments
35 global_Nb_Segments = mesh.Segment().NumberOfSegments(5)
36 local_Nb_Segments  = mesh.Segment(circle).NumberOfSegments(10)
37 mesh.Compute()
38
39 # Define own parameters of Radial Quadrange algorithm
40 # The number of radial layers will be 4
41 radial_Quad_algo.NumberOfLayers( 4 )
42 mesh.Compute()