2016-10-03 19:53:47 +05:00
|
|
|
# Radial Quadrangle 1D-2D example
|
2013-02-12 20:37:44 +06:00
|
|
|
|
2013-04-04 13:08:19 +06:00
|
|
|
import salome
|
2021-08-12 14:38:10 +05:00
|
|
|
salome.salome_init_without_session()
|
2013-04-04 13:08:19 +06:00
|
|
|
import GEOM
|
|
|
|
from salome.geom import geomBuilder
|
2017-06-13 15:01:10 +05:00
|
|
|
geompy = geomBuilder.New()
|
2013-02-12 20:37:44 +06:00
|
|
|
|
2013-04-04 13:08:19 +06:00
|
|
|
import SMESH, SALOMEDS
|
|
|
|
from salome.smesh import smeshBuilder
|
2017-06-13 15:01:10 +05:00
|
|
|
smesh = smeshBuilder.New()
|
2013-02-12 20:37:44 +06:00
|
|
|
|
|
|
|
# Create face from the wire and add to study
|
|
|
|
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])
|
|
|
|
geompy.addToStudy(Face,"Face")
|
2016-03-21 17:03:25 +05:00
|
|
|
circle, radius1, radius2 = geompy.SubShapeAllSorted(Face, geompy.ShapeType["EDGE"])
|
2013-02-12 20:37:44 +06:00
|
|
|
geompy.addToStudyInFather(Face, radius1,"radius1")
|
|
|
|
geompy.addToStudyInFather(Face, radius2,"radius2")
|
|
|
|
geompy.addToStudyInFather(Face, circle,"circle")
|
|
|
|
|
|
|
|
|
|
|
|
# Define geometry for mesh, and Radial Quadrange algorithm
|
|
|
|
mesh = smesh.Mesh(Face)
|
2013-04-04 13:08:19 +06:00
|
|
|
radial_Quad_algo = mesh.Quadrangle(algo=smeshBuilder.RADIAL_QUAD)
|
2013-02-12 20:37:44 +06:00
|
|
|
|
|
|
|
# The Radial Quadrange algorithm can work without any hypothesis
|
|
|
|
# In this case it uses "Default Nb of Segments" preferences parameter to discretize edges
|
2018-04-16 17:04:33 +05:00
|
|
|
# So by default there will be 15 segments in both radial and circular directions
|
2013-02-12 20:37:44 +06:00
|
|
|
mesh.Compute()
|
|
|
|
|
|
|
|
# The Radial Quadrange uses global or local 1d hypotheses if it does
|
|
|
|
# not have its own hypotheses.
|
|
|
|
# Define global hypotheses to discretize radial edges and a local one for circular edge
|
2018-04-16 17:04:33 +05:00
|
|
|
# So that there will be 5 radial layers and 10 circular segments
|
2013-02-12 20:37:44 +06:00
|
|
|
global_Nb_Segments = mesh.Segment().NumberOfSegments(5)
|
|
|
|
local_Nb_Segments = mesh.Segment(circle).NumberOfSegments(10)
|
|
|
|
mesh.Compute()
|
|
|
|
|
|
|
|
# Define own parameters of Radial Quadrange algorithm
|
2018-04-16 17:04:33 +05:00
|
|
|
# The number of radial layers will be 4
|
2013-02-12 20:37:44 +06:00
|
|
|
radial_Quad_algo.NumberOfLayers( 4 )
|
|
|
|
mesh.Compute()
|