\r
<p> </p>\r
\r
-<p class="whs2">from geompy import \r
- *</p>\r
+<p class="whs2"><span style="font-family: 'Lucida Console', monospace;">import \r
+ geompy</span></p>\r
\r
<p class="whs2">import smesh</p>\r
\r
-<p> </p>\r
-\r
-<p># create vertices</p>\r
-\r
-<p class="whs2">Point111 = MakeVertex( \r
- 0, 0, 0)</p>\r
-\r
-<p class="whs2">Point211 = MakeVertex(10, \r
- 0, 0)</p>\r
-\r
-<p class="whs2">Point121 = MakeVertex( \r
- 0, 10, 0)</p>\r
-\r
-<p class="whs2">Point221 = MakeVertex(10, \r
- 10, 0)</p>\r
-\r
-<p class="whs2">Point112 = MakeVertex( \r
- 0, 0, 10)</p>\r
-\r
-<p class="whs2">Point212 = MakeVertex(10, \r
- 0, 10)</p>\r
-\r
-<p class="whs2">Point122 = MakeVertex( \r
- 0, 10, 10)</p>\r
-\r
-<p class="whs2">Point222 = MakeVertex(10, \r
- 10, 10)</p>\r
-\r
-<p> </p>\r
-\r
-<p># create edges</p>\r
-\r
-<p class="whs2">EdgeX111 = MakeEdge(Point111, \r
- Point211)</p>\r
-\r
-<p class="whs2">EdgeX121 = MakeEdge(Point121, \r
- Point221)</p>\r
-\r
-<p class="whs2">EdgeX112 = MakeEdge(Point112, \r
- Point212)</p>\r
-\r
-<p class="whs2">EdgeX122 = MakeEdge(Point122, \r
- Point222)</p>\r
-\r
-<p class="whs2">EdgeY11 = MakeEdge(Point111, \r
- Point121)</p>\r
-\r
-<p class="whs2">EdgeY21 = MakeEdge(Point211, \r
- Point221)</p>\r
-\r
-<p class="whs2">EdgeY12 = MakeEdge(Point112, \r
- Point122)</p>\r
-\r
-<p class="whs2">EdgeY22 = MakeEdge(Point212, \r
- Point222)</p>\r
-\r
-<p class="whs2">EdgeZ111 = MakeEdge(Point111, \r
- Point112)</p>\r
-\r
-<p class="whs2">EdgeZ211 = MakeEdge(Point211, \r
- Point212)</p>\r
-\r
-<p class="whs2">EdgeZ121 = MakeEdge(Point121, \r
- Point122)</p>\r
-\r
-<p class="whs2">EdgeZ221 = MakeEdge(Point221, \r
- Point222)</p>\r
-\r
-<p> </p>\r
-\r
-<p># create faces</p>\r
-\r
-<p class="whs2">FaceX11 = MakeQuad(EdgeY11, \r
- EdgeZ111, EdgeY12, EdgeZ121)</p>\r
-\r
-<p class="whs2">FaceX21 = MakeQuad(EdgeY21, \r
- EdgeZ211, EdgeY22, EdgeZ221)</p>\r
-\r
-<p class="whs2">FaceY111 = MakeQuad(EdgeX111, \r
- EdgeZ111, EdgeX112, EdgeZ211)</p>\r
-\r
-<p class="whs2">FaceY121 = MakeQuad(EdgeX121, \r
- EdgeZ121, EdgeX122, EdgeZ221)</p>\r
-\r
-<p class="whs2">FaceZ11 = MakeQuad(EdgeX111, \r
- EdgeY11, EdgeX121, EdgeY21)</p>\r
-\r
-<p class="whs2">FaceZ12 = MakeQuad(EdgeX112, \r
- EdgeY12, EdgeX122, EdgeY22)</p>\r
-\r
-<p> </p>\r
-\r
-<p># create a solid</p>\r
-\r
-<p class="whs2">Block = MakeHexa(FaceX11, \r
- FaceX21, FaceY111, FaceY121, FaceZ11, FaceZ12)</p>\r
-\r
-<p> </p>\r
+<p class="whs2"> </p>\r
\r
-<p># create a compound</p>\r
+<p class="whs3"># create a box</p>\r
\r
-<p class="whs2">box = MakeCompound([Block])</p>\r
+<p class="whs2">box = geompy.MakeBoxDXDYDZ(10., \r
+ 10., 10.)</p>\r
\r
-<p> </p>\r
+<p class="whs2">geompy.addToStudy(box, \r
+ "Box")</p>\r
\r
-<p># add in the study</p>\r
+<p class="whs2"> </p>\r
\r
-<p class="whs2">box_id = addToStudy(box, \r
- "Box compound")</p>\r
+<p class="whs3"># create a hexahedral \r
+ mesh on the box</p>\r
\r
-<p> </p>\r
+<p class="whs2">hexa = smesh.Mesh(box, \r
+ "Box : hexahedrical mesh")</p>\r
\r
-<p># create a hexahedral mesh on the box</p>\r
+<p class="whs2"> </p>\r
\r
-<p class="whs2">hexa = smesh.Mesh(box, \r
- "Box compound : hexahedrical mesh")</p>\r
+<p class="whs3"># create a Regular 1D \r
+ algorithm for edges</p>\r
\r
-<p class="whs2">algo = hexa.Segment()</p>\r
+<p class="whs2">algo1D = hexa.Segment()</p>\r
\r
-<p> </p>\r
+<p class="whs2"> </p>\r
\r
-<p># define "NumberOfSegments" hypothesis to cut an edge in a \r
- fixed number of segments</p>\r
+<p class="whs3"># define "Arithmetic1D" \r
+ hypothesis to cut all edges in several segments with increasing arithmetic \r
+ length </p>\r
\r
-<p class="whs2">algo.NumberOfSegments(4)</p>\r
+<p class="whs2">algo1D.Arithmetic1D(1, \r
+ 4)</p>\r
\r
-<p> </p>\r
+<p class="whs2"> </p>\r
\r
-<p># create a quadrangle 2D algorithm for faces</p>\r
+<p class="whs3"># create a quadrangle \r
+ 2D algorithm for faces</p>\r
\r
<p class="whs2">hexa.Quadrangle()</p>\r
\r
-<p> </p>\r
+<p class="whs2"> </p>\r
\r
-<p># create a hexahedron 3D algorithm for solids</p>\r
+<p class="whs3"># create a hexahedron \r
+ 3D algorithm for solids</p>\r
\r
<p class="whs2">hexa.Hexahedron()</p>\r
\r
-<p> </p>\r
-\r
-<p># create a local hypothesis</p>\r
-\r
-<p class="whs2">algo = hexa.Segment(EdgeX111)</p>\r
-\r
-<p> </p>\r
-\r
-<p># define "Arithmetic1D" hypothesis to cut an edge in several \r
- segments with arithmetic length increasing</p>\r
-\r
-<p class="whs2">algo.Arithmetic1D(1, \r
- 4)</p>\r
-\r
-<p> </p>\r
-\r
-<p># define "Propagation" hypothesis that propagates all other \r
- hypothesis on all edges on the opposite side in case of quadrangular faces</p>\r
-\r
-<p class="whs2">algo.Propagation()</p>\r
-\r
-<p> </p>\r
+<p class="whs2"> </p>\r
\r
-<p># compute the mesh</p>\r
+<p class="whs3"># compute the mesh</p>\r
\r
<p class="whs2">hexa.Compute() </p>\r
\r
\r
<h4><a name=bookmark9>Deflection 1D and Number of Segments</a></h4>\r
\r
-<p class="whs2"> </p>\r
+<p class="whs2"><span style="font-family: 'Lucida Console', monospace;">import \r
+ geompy</span></p>\r
\r
<p class="whs2">import smesh</p>\r
\r
-<p class="whs2">import geompy</p>\r
-\r
-<p class="whs2">import salome</p>\r
-\r
-<p class="whs2">gg = salome.ImportComponentGUI("GEOM")</p>\r
-\r
<p class="whs2"> </p>\r
\r
-<p class="whs3"># create vertices</p>\r
+<p class="whs3"># create a face from \r
+ arc and straight segment</p>\r
+\r
+<p class="whs2">px = geompy.MakeVertex(100., \r
+ 0. , 0. \r
+ )</p>\r
\r
-<p class="whs2">px = \r
- geompy.MakeVertex(100., 0. , \r
+<p class="whs2">py = geompy.MakeVertex(0. \r
+ , 100., \r
0. )</p>\r
\r
-<p class="whs2">py = \r
- geompy.MakeVertex(0. , \r
- 100., 0. )</p>\r
-\r
-<p class="whs2">pz = \r
- geompy.MakeVertex(0. , \r
- 0. , 100.)</p>\r
+<p class="whs2">pz = geompy.MakeVertex(0. \r
+ , 0. , \r
+ 100.)</p>\r
\r
<p class="whs2"> </p>\r
\r
-<p class="whs3"># create a vector from \r
- two points</p>\r
-\r
-<p class="whs2">vxy = geompy.MakeVector(px, \r
+<p class="whs2">exy = geompy.MakeEdge(px, \r
py)</p>\r
\r
-<p class="whs2"> </p>\r
-\r
-<p class="whs3"># create an arc from \r
- three points</p>\r
-\r
<p class="whs2">arc = geompy.MakeArc(py, \r
pz, px)</p>\r
\r
<p class="whs2"> </p>\r
\r
-<p class="whs3"># create a wire</p>\r
-\r
-<p class="whs2">wire = geompy.MakeWire([vxy, \r
+<p class="whs2">wire = geompy.MakeWire([exy, \r
arc])</p>\r
\r
-<p class="whs2">isPlanarFace = 1</p>\r
-\r
<p class="whs2"> </p>\r
\r
-<p class="whs3"># create a face from \r
- the wire</p>\r
+<p class="whs2">isPlanarFace = 1</p>\r
\r
<p class="whs2">face1 = geompy.MakeFace(wire, \r
isPlanarFace)</p>\r
\r
-<p class="whs2"> </p>\r
-\r
-<p class="whs3"><span style="font-family: 'Times New Roman', serif;"># \r
- get edges from the face</span></p>\r
-\r
-<p class="whs2">vxy,arc = geompy.SubShapeAll(face1,geompy.ShapeType["EDGE"])</p>\r
-\r
-<p class="whs3"> </p>\r
-\r
-<p class="whs3"># add objects in the \r
- study</p>\r
-\r
-<p class="whs2">id_face1 = geompy.addToStudy(face1,"Face1")</p>\r
-\r
-<p class="whs2">id_arc = geompy.addToStudyInFather(face1,arc,"Arc \r
- Edge")</p>\r
+<p class="whs2">geompy.addToStudy(face1,"Face1")</p>\r
\r
<p class="whs2"> </p>\r
\r
-<p class="whs3"># display faces</p>\r
+<p class="whs3"># get edges from the \r
+ face</p>\r
\r
-<p class="whs2">gg.createAndDisplayGO(id_face1)</p>\r
+<p class="whs2">e_straight,e_arc = \r
+ geompy.SubShapeAll(face1, geompy.ShapeType["EDGE"])</p>\r
\r
-<p class="whs2">gg.setDisplayMode(id_face1,1)</p>\r
-\r
-<p class="whs2">gg.setTransparency(id_face1,0.2)</p>\r
+<p class="whs2">geompy.addToStudyInFather(face1, \r
+ e_arc, "Arc Edge")</p>\r
\r
<p class="whs2"> </p>\r
\r
<p class="whs3"># create hexahedral mesh</p>\r
\r
<p class="whs2">hexa = smesh.Mesh(face1, \r
- "Face compound : hexahedrical mesh")</p>\r
-\r
-<p class="whs2">algo = hexa.Triangle()</p>\r
+ "Face : triangle mesh")</p>\r
\r
<p class="whs2"> </p>\r
\r
-<p class="whs3"># define "MaxElementArea" \r
- hypothesis</p>\r
-\r
-<p class="whs2">algo.MaxElementArea(30)</p>\r
-\r
-<p class="whs2"> </p>\r
+<p class="whs3"># define "NumberOfSegments" \r
+ hypothesis to cut a straight edge in a fixed number of segments</p>\r
\r
-<p class="whs3"># create a local hypothesis \r
- on the wire</p>\r
+<p class="whs2">algo1D = hexa.Segment()</p>\r
\r
-<p class="whs2">algo = hexa.Segment(wire)</p>\r
+<p class="whs2">algo1D.NumberOfSegments(6)</p>\r
\r
<p class="whs2"> </p>\r
\r
-<p class="whs3"># define "NumberOfSegments" \r
- hypothesis to cut a straight edge in a fixed number of segments</p>\r
+<p class="whs3"># define "MaxElementArea" \r
+ hypothesis</p>\r
+\r
+<p class="whs2">algo2D = hexa.Triangle()</p>\r
\r
-<p class="whs2">algo.NumberOfSegments(6)</p>\r
+<p class="whs2">algo2D.MaxElementArea(70.0)</p>\r
\r
<p class="whs2"> </p>\r
\r
<p class="whs3"># define a local "Deflection1D" \r
hypothesis on the arc</p>\r
\r
-<p class="whs2">algo = hexa.Segment(arc)</p>\r
+<p class="whs2">algo_local = hexa.Segment(e_arc)</p>\r
\r
-<p class="whs2">algo.Deflection1D(1)</p>\r
-\r
-<p class="whs2"> </p>\r
+<p class="whs2">algo_local.Deflection1D(1.0)</p>\r
\r
<p class="whs2"> </p>\r
\r
\r
<p class="whs2">hexa.Compute() </p>\r
\r
-<p> </p>\r
-\r
<h4><a name=bookmark2>Start and End Length</a></h4>\r
\r
-<p class="whs2">from geompy import \r
- *</p>\r
+<p class="whs2"><span style="font-family: 'Lucida Console', monospace;">from \r
+ geompy import *</span></p>\r
\r
<p class="whs2">import smesh</p>\r
\r
-<p> </p>\r
-\r
-<p># create vertices</p>\r
-\r
-<p class="whs2">Point111 = MakeVertex( \r
- 0, 0, 0)</p>\r
-\r
-<p class="whs2">Point211 = MakeVertex(10, \r
- 0, 0)</p>\r
-\r
-<p class="whs2">Point121 = MakeVertex( \r
- 0, 10, 0)</p>\r
-\r
-<p class="whs2">Point221 = MakeVertex(10, \r
- 10, 0)</p>\r
-\r
-<p class="whs2">Point112 = MakeVertex( \r
- 0, 0, 10)</p>\r
-\r
-<p class="whs2">Point212 = MakeVertex(10, \r
- 0, 10)</p>\r
-\r
-<p class="whs2">Point122 = MakeVertex( \r
- 0, 10, 10)</p>\r
-\r
-<p class="whs2">Point222 = MakeVertex(10, \r
- 10, 10)</p>\r
-\r
-<p> </p>\r
-\r
-<p># create edges</p>\r
-\r
-<p class="whs2">EdgeX111 = MakeEdge(Point111, \r
- Point211)</p>\r
-\r
-<p class="whs2">EdgeX121 = MakeEdge(Point121, \r
- Point221)</p>\r
-\r
-<p class="whs2">EdgeX112 = MakeEdge(Point112, \r
- Point212)</p>\r
-\r
-<p class="whs2">EdgeX122 = MakeEdge(Point122, \r
- Point222)</p>\r
-\r
-<p class="whs2">EdgeY11 = MakeEdge(Point111, \r
- Point121)</p>\r
-\r
-<p class="whs2">EdgeY21 = MakeEdge(Point211, \r
- Point221)</p>\r
-\r
-<p class="whs2">EdgeY12 = MakeEdge(Point112, \r
- Point122)</p>\r
-\r
-<p class="whs2">EdgeY22 = MakeEdge(Point212, \r
- Point222)</p>\r
-\r
-<p class="whs2">EdgeZ111 = MakeEdge(Point111, \r
- Point112)</p>\r
-\r
-<p class="whs2">EdgeZ211 = MakeEdge(Point211, \r
- Point212)</p>\r
-\r
-<p class="whs2">EdgeZ121 = MakeEdge(Point121, \r
- Point122)</p>\r
-\r
-<p class="whs2">EdgeZ221 = MakeEdge(Point221, \r
- Point222)</p>\r
-\r
-<p> </p>\r
-\r
-<p># create faces</p>\r
-\r
-<p class="whs2">FaceX11 = MakeQuad(EdgeY11, \r
- EdgeZ111, EdgeY12, EdgeZ121)</p>\r
-\r
-<p class="whs2">FaceX21 = MakeQuad(EdgeY21, \r
- EdgeZ211, EdgeY22, EdgeZ221)</p>\r
-\r
-<p class="whs2">FaceY111 = MakeQuad(EdgeX111, \r
- EdgeZ111, EdgeX112, EdgeZ211)</p>\r
-\r
-<p class="whs2">FaceY121 = MakeQuad(EdgeX121, \r
- EdgeZ121, EdgeX122, EdgeZ221)</p>\r
-\r
-<p class="whs2">FaceZ11 = MakeQuad(EdgeX111, \r
- EdgeY11, EdgeX121, EdgeY21)</p>\r
-\r
-<p class="whs2">FaceZ12 = MakeQuad(EdgeX112, \r
- EdgeY12, EdgeX122, EdgeY22)</p>\r
-\r
-<p> </p>\r
+<p class="whs2"> </p>\r
\r
-<p># create a solid</p>\r
+<p class="whs3"># create a box</p>\r
\r
-<p class="whs2">Block = MakeHexa(FaceX11, \r
- FaceX21, FaceY111, FaceY121, FaceZ11, FaceZ12)</p>\r
+<p class="whs2">box = MakeBoxDXDYDZ(10., \r
+ 10., 10.)</p>\r
\r
-<p> </p>\r
+<p class="whs2">addToStudy(box, "Box")</p>\r
\r
-<p># create a compound</p>\r
+<p class="whs2"> </p>\r
\r
-<p class="whs2">box = MakeCompound([Block])</p>\r
+<p class="whs3"># get one edge of the \r
+ box to put local hypothesis on</p>\r
\r
-<p> </p>\r
+<p class="whs2">p5 = MakeVertex(5., \r
+ 0., 0.)</p>\r
\r
-<p># add in the study</p>\r
+<p class="whs2">EdgeX = GetEdgeNearPoint(box, \r
+ p5)</p>\r
\r
-<p class="whs2">box_id = addToStudy(box, \r
- "Box compound")</p>\r
+<p class="whs2">addToStudyInFather(box, \r
+ EdgeX, "Edge [0,0,0 - 10,0,0]")</p>\r
\r
-<p> </p>\r
+<p class="whs2"> </p>\r
\r
-<p># create a hexahedral mesh on the box</p>\r
+<p class="whs3"># create a hexahedral \r
+ mesh on the box</p>\r
\r
<p class="whs2">hexa = smesh.Mesh(box, \r
- "Box compound : hexahedrical mesh")</p>\r
-\r
-<p class="whs2">algo = hexa.Segment()</p>\r
-\r
-<p> </p>\r
-\r
-<p># define "NumberOfSegments" hypothesis to cut an edge in a \r
- fixed number of segments</p>\r
+ "Box : hexahedrical mesh")</p>\r
\r
-<p class="whs2">algo.NumberOfSegments(4)</p>\r
+<p class="whs2"> </p>\r
\r
-<p> </p>\r
+<p class="whs3"># set algorithms</p>\r
\r
-<p># create a quadrangle 2D algorithm for faces</p>\r
+<p class="whs2">algo1D = hexa.Segment()</p>\r
\r
<p class="whs2">hexa.Quadrangle()</p>\r
\r
-<p> </p>\r
-\r
-<p># create a hexahedron 3D algorithm for solids</p>\r
-\r
<p class="whs2">hexa.Hexahedron()</p>\r
\r
-<p> </p>\r
-\r
-<p># create a local hypothesis</p>\r
-\r
-<p class="whs2">algo = hexa.Segment(EdgeX111)</p>\r
-\r
-<p> </p>\r
-\r
-<p># define "StartEndLength" hypothesis to cut an edge in several \r
- segments with increasing geometric length </p>\r
-\r
-<p class="whs2">algo.StartEndLength(1, \r
- 6)</p>\r
-\r
-<p> </p>\r
-\r
-<p># define "Propagation" hypothesis that propagates all other \r
- hypothesis on all edges on the opposite side in case of quadrangular faces</p>\r
-\r
-<p class="whs2">algo.Propagation()</p>\r
-\r
-<p> </p>\r
-\r
-<p># compute the mesh</p>\r
-\r
-<p class="whs2">hexa.Compute() </p>\r
-\r
<p class="whs2"> </p>\r
\r
-<h4><a name=bookmark3>Average Length</a></h4>\r
-\r
-<p class="whs2">from geompy import \r
- *</p>\r
+<p class="whs3"># define "NumberOfSegments" \r
+ hypothesis to cut an edge in a fixed number of segments</p>\r
\r
-<p class="whs2">import smesh</p>\r
+<p class="whs2">algo1D.NumberOfSegments(4)</p>\r
\r
<p class="whs2"> </p>\r
\r
-<p class="whs3"># create vertices</p>\r
-\r
-<p class="whs2">Point111 = MakeVertex( \r
- 0, 0, 0)</p>\r
-\r
-<p class="whs2">Point211 = MakeVertex(10, \r
- 0, 0)</p>\r
-\r
-<p class="whs2">Point121 = MakeVertex( \r
- 0, 10, 0)</p>\r
-\r
-<p class="whs2">Point221 = MakeVertex(10, \r
- 10, 0)</p>\r
-\r
-<p class="whs2">Point112 = MakeVertex( \r
- 0, 0, 10)</p>\r
-\r
-<p class="whs2">Point212 = MakeVertex(10, \r
- 0, 10)</p>\r
-\r
-<p class="whs2">Point122 = MakeVertex( \r
- 0, 10, 10)</p>\r
+<p class="whs3"># create a local hypothesis</p>\r
\r
-<p class="whs2">Point222 = MakeVertex(10, \r
- 10, 10)</p>\r
+<p class="whs2">algo_local = hexa.Segment(EdgeX)</p>\r
\r
<p class="whs2"> </p>\r
\r
-<p class="whs3"># create edges</p>\r
-\r
-<p class="whs2">EdgeX111 = MakeEdge(Point111, \r
- Point211)</p>\r
+<p class="whs3"># define "StartEndLength" \r
+ hypothesis to cut an edge in several segments with increasing geometric \r
+ length</p>\r
\r
-<p class="whs2">EdgeX121 = MakeEdge(Point121, \r
- Point221)</p>\r
-\r
-<p class="whs2">EdgeX112 = MakeEdge(Point112, \r
- Point212)</p>\r
-\r
-<p class="whs2">EdgeX122 = MakeEdge(Point122, \r
- Point222)</p>\r
-\r
-<p class="whs2">EdgeY11 = MakeEdge(Point111, \r
- Point121)</p>\r
-\r
-<p class="whs2">EdgeY21 = MakeEdge(Point211, \r
- Point221)</p>\r
-\r
-<p class="whs2">EdgeY12 = MakeEdge(Point112, \r
- Point122)</p>\r
-\r
-<p class="whs2">EdgeY22 = MakeEdge(Point212, \r
- Point222)</p>\r
+<p class="whs2">algo_local.StartEndLength(1, \r
+ 6)</p>\r
\r
-<p class="whs2">EdgeZ111 = MakeEdge(Point111, \r
- Point112)</p>\r
+<p class="whs2"> </p>\r
\r
-<p class="whs2">EdgeZ211 = MakeEdge(Point211, \r
- Point212)</p>\r
+<p class="whs3"># define "Propagation" \r
+ hypothesis that propagates all other hypothesis</p>\r
\r
-<p class="whs2">EdgeZ121 = MakeEdge(Point121, \r
- Point122)</p>\r
+<p class="whs3"># on all edges on the \r
+ opposite side in case of quadrangular faces</p>\r
\r
-<p class="whs2">EdgeZ221 = MakeEdge(Point221, \r
- Point222)</p>\r
+<p class="whs2">algo_local.Propagation()</p>\r
\r
<p class="whs2"> </p>\r
\r
-<p class="whs3"># create faces</p>\r
-\r
-<p class="whs2">FaceX11 = MakeQuad(EdgeY11, \r
- EdgeZ111, EdgeY12, EdgeZ121)</p>\r
-\r
-<p class="whs2">FaceX21 = MakeQuad(EdgeY21, \r
- EdgeZ211, EdgeY22, EdgeZ221)</p>\r
+<p class="whs3"># compute the mesh</p>\r
\r
-<p class="whs2">FaceY111 = MakeQuad(EdgeX111, \r
- EdgeZ111, EdgeX112, EdgeZ211)</p>\r
+<p class="whs2">hexa.Compute() </p>\r
\r
-<p class="whs2">FaceY121 = MakeQuad(EdgeX121, \r
- EdgeZ121, EdgeX122, EdgeZ221)</p>\r
+<h4><a name=bookmark3>Average Length</a></h4>\r
\r
-<p class="whs2">FaceZ11 = MakeQuad(EdgeX111, \r
- EdgeY11, EdgeX121, EdgeY21)</p>\r
+<p class="whs2"><span style="font-family: 'Lucida Console', monospace;">from \r
+ geompy import *</span></p>\r
\r
-<p class="whs2">FaceZ12 = MakeQuad(EdgeX112, \r
- EdgeY12, EdgeX122, EdgeY22)</p>\r
+<p class="whs2">import smesh</p>\r
\r
<p class="whs2"> </p>\r
\r
-<p class="whs3"># create a solid</p>\r
+<p class="whs3"># create a box</p>\r
\r
-<p class="whs2">Block = MakeHexa(FaceX11, \r
- FaceX21, FaceY111, FaceY121, FaceZ11, FaceZ12)</p>\r
+<p class="whs2">box = MakeBoxDXDYDZ(10., \r
+ 10., 10.)</p>\r
\r
-<p class="whs2"> </p>\r
+<p class="whs2">addToStudy(box, "Box")</p>\r
\r
-<p class="whs3"># create a compound</p>\r
+<p class="whs2"> </p>\r
\r
-<p class="whs2">box = MakeCompound([Block])</p>\r
+<p class="whs3"># get one edge of the \r
+ box to put local hypothesis on</p>\r
\r
-<p class="whs2"> </p>\r
+<p class="whs2">p5 = MakeVertex(5., \r
+ 0., 0.)</p>\r
\r
-<p class="whs3"># add in the study</p>\r
+<p class="whs2">EdgeX = GetEdgeNearPoint(box, \r
+ p5)</p>\r
\r
-<p class="whs2">box_id = addToStudy(box, \r
- "Box compound")</p>\r
+<p class="whs2">addToStudyInFather(box, \r
+ EdgeX, "Edge [0,0,0 - 10,0,0]")</p>\r
\r
<p class="whs2"> </p>\r
\r
mesh on the box</p>\r
\r
<p class="whs2">hexa = smesh.Mesh(box, \r
- "Box compound : hexahedrical mesh")</p>\r
-\r
-<p class="whs2">algo = hexa.Segment()</p>\r
+ "Box : hexahedrical mesh")</p>\r
\r
<p class="whs2"> </p>\r
\r
-<p class="whs3"># define "NumberOfSegments" \r
- hypothesis to cut an edge in a fixed number of segments</p>\r
-\r
-<p class="whs2">algo.NumberOfSegments(4)</p>\r
-\r
-<p class="whs2"> </p>\r
+<p class="whs3"># set algorithms</p>\r
\r
-<p class="whs3"># create a quadrangle \r
- 2D algorithm for faces</p>\r
+<p class="whs2">algo1D = hexa.Segment()</p>\r
\r
<p class="whs2">hexa.Quadrangle()</p>\r
\r
+<p class="whs2">hexa.Hexahedron()</p>\r
+\r
<p class="whs2"> </p>\r
\r
-<p class="whs3"># create a hexahedron \r
- 3D algorithm for solids</p>\r
+<p class="whs3"># define "NumberOfSegments" \r
+ hypothesis to cut all edges in a fixed number of segments</p>\r
\r
-<p class="whs2">hexa.Hexahedron()</p>\r
+<p class="whs2">algo1D.NumberOfSegments(4)</p>\r
\r
<p class="whs2"> </p>\r
\r
-<p class="whs3"># create a local hypothesis</p>\r
+<p class="whs3"># create a sub-mesh</p>\r
\r
-<p class="whs2">algo = hexa.Segment(EdgeX111)</p>\r
+<p class="whs2">algo_local = hexa.Segment(EdgeX)</p>\r
\r
<p class="whs2"> </p>\r
\r
<p class="whs3"># define "LocalLength" \r
hypothesis to cut an edge in several segments with the same length</p>\r
\r
-<p class="whs2">algo.LocalLength(2)</p>\r
+<p class="whs2">algo_local.LocalLength(2.)</p>\r
\r
<p class="whs2"> </p>\r
\r
<p class="whs3"># define "Propagation" \r
- hypothesis that propagates all other hypothesis on all edges on<span style="font-family: 'Times New Roman', serif;"> \r
- the opposite side in case of quadrangular faces</span></p>\r
+ hypothesis that propagates all other hypothesis</p>\r
\r
-<p class="whs2">algo.Propagation()</p>\r
+<p class="whs3"># on all edges on the \r
+ opposite side in case of quadrangular faces</p>\r
+\r
+<p class="whs2">algo_local.Propagation()</p>\r
\r
<p class="whs2"> </p>\r
\r
\r
<p class="whs2">hexa.Compute() </p>\r
\r
-<p class="whs2"> </p>\r
-\r
-<p class="whs2"> </p>\r
-\r
<h3>Defining 2D and 3D hypotheses</h3>\r
\r
<h4><a name=bookmark4>Maximum Element Area</a></h4>\r
<p class="whs4"><span style="font-family: 'Lucida Console', monospace;">import \r
smesh</span></p>\r
\r
-<p class="whs4">import geompy</p>\r
-\r
<p class="whs4">import salome</p>\r
\r
<p class="whs4"> </p>\r
\r
<h4><a name=bookmark5>Maximum Element Volume</a></h4>\r
\r
-<p>Attention! This script was written using old approach, based on direct usage of SMESH idl interface. To be updated for version 3.2.1 to use <b>smesh</b> package.\r
-<br> \r
-\r
<p class="whs4"><span style="font-family: 'Lucida Console', monospace;">import \r
- salome</span></p>\r
-\r
-<p class="whs4">import geompy</p>\r
-\r
-<p class="whs4">import StdMeshers</p>\r
+ geompy</span></p>\r
\r
-<p class="whs4">import NETGENPlugin</p>\r
+<p class="whs4">import smesh</p>\r
\r
<p class="whs4"> </p>\r
\r
-<p class="whs4">smesh = salome.lcc.FindOrLoadComponent("FactoryServer", \r
- "SMESH")</p>\r
+<p class="whs5"># create a cylinder</p>\r
\r
-<p class="whs4">smeshgui = salome.ImportComponentGUI("SMESH")</p>\r
+<p class="whs4">cyl = geompy.MakeCylinderRH(30., \r
+ 50.)</p>\r
\r
-<p class="whs4">smeshgui.Init(salome.myStudyId);</p>\r
+<p class="whs4">geompy.addToStudy(cyl, \r
+ "cyl")</p>\r
\r
<p class="whs4"> </p>\r
\r
-<p class="whs5"># create a box</p>\r
+<p class="whs5"># create a mesh on \r
+ the cylinder</p>\r
\r
-<p class="whs4">box = geompy.MakeCylinderRH(30, \r
- 50) #MakeBox(0., 0., 0., </p>\r
-\r
-<p class="whs4">100., 200., 300.)</p>\r
+<p class="whs4">tetra = smesh.Mesh(cyl, \r
+ "Cylinder : tetrahedrical mesh")</p>\r
\r
<p class="whs4"> </p>\r
\r
-<p class="whs5"># add the box in the \r
- study</p>\r
-\r
-<p class="whs4">idbox = geompy.addToStudy(box, \r
- "box")</p>\r
-\r
-<p class="whs4"> </p>\r
-\r
-<p class="whs5"># create a set of hypotheses</p>\r
-\r
-<p class="whs5"> </p>\r
-\r
-<p class="whs5"># Number of Segments</p>\r
-\r
-<p class="whs4">numberOfSegments \r
- = 7</p>\r
-\r
-<p class="whs4">hypNbSeg = smesh.CreateHypothesis("NumberOfSegments", \r
- "libStdMeshersEngine.so")</p>\r
+<p class="whs5"># assign algorithms</p>\r
\r
-<p class="whs4">hypNbSeg.SetNumberOfSegments(numberOfSegments)</p>\r
+<p class="whs4">algo1D = tetra.Segment()</p>\r
\r
-<p class="whs4">print hypNbSeg.GetName()</p>\r
+<p class="whs4">algo2D = tetra.Triangle()</p>\r
\r
-<p class="whs4">print hypNbSeg.GetNumberOfSegments()</p>\r
-\r
-<p class="whs4">smeshgui.SetName(salome.ObjectToID(hypNbSeg), \r
- "NumberOfSegments_7")</p>\r
+<p class="whs4">algo3D = tetra.Tetrahedron(smesh.NETGEN)</p>\r
\r
<p class="whs4"> </p>\r
\r
-<p class="whs5"># Max Element Area</p>\r
-\r
-<p class="whs4">maxElementArea = \r
- 800</p>\r
-\r
-<p class="whs4">hypArea = smesh.CreateHypothesis("MaxElementArea", \r
- "libStdMeshersEngine.so")</p>\r
+<p class="whs5"># assign 1D and 2D \r
+ hypotheses</p>\r
\r
-<p class="whs4">hypArea.SetMaxElementArea(maxElementArea)</p>\r
+<p class="whs4">algo1D.NumberOfSegments(7)</p>\r
\r
-<p class="whs4">print hypArea.GetName()</p>\r
-\r
-<p class="whs4">print hypArea.GetMaxElementArea()</p>\r
-\r
-<p class="whs4">smeshgui.SetName(salome.ObjectToID(hypArea), \r
- "MaxElementArea_800")</p>\r
+<p class="whs4">algo2D.MaxElementArea(150.)</p>\r
\r
<p class="whs4"> </p>\r
\r
-<p class="whs5"># Max Element Volume</p>\r
-\r
-<p class="whs4">maxElementVolume \r
- = 900</p>\r
-\r
-<p class="whs4">hypVolume = smesh.CreateHypothesis("MaxElementVolume", \r
- "libStdMeshersEngine.so")</p>\r
-\r
-<p class="whs4">hypVolume.SetMaxElementVolume(maxElementVolume)</p>\r
-\r
-<p class="whs4">print hypVolume.GetName()</p>\r
-\r
-<p class="whs4">print hypVolume.GetMaxElementVolume()</p>\r
-\r
-<p class="whs4">smeshgui.SetName(salome.ObjectToID(hypVolume), \r
- "MaxElementVolume_900")</p>\r
-\r
-<p class="whs4"> </p>\r
-\r
-<p class="whs5"># create a set of algorithms</p>\r
-\r
-<p class="whs5"> </p>\r
-\r
-<p class="whs5"># Regular_1D</p>\r
-\r
-<p class="whs4">regular1D = smesh.CreateHypothesis("Regular_1D", \r
- "libStdMeshersEngine.so")</p>\r
-\r
-<p class="whs4">smeshgui.SetName(salome.ObjectToID(regular1D), \r
- "Wire Discretisation")</p>\r
-\r
-<p class="whs4"> </p>\r
-\r
-<p class="whs5"># MEFISTO_2D</p>\r
-\r
-<p class="whs4">mefisto2D = smesh.CreateHypothesis("MEFISTO_2D", \r
- "libStdMeshersEngine.so")</p>\r
-\r
-<p class="whs4">smeshgui.SetName(salome.ObjectToID(mefisto2D), \r
- "MEFISTO_2D")</p>\r
-\r
-<p class="whs4"> </p>\r
-\r
-<p class="whs5"># NETGEN_3D (Tetrahedron \r
- meshing algorithm)</p>\r
-\r
-<p class="whs4">tetra3D = smesh.CreateHypothesis("NETGEN_3D", \r
- "libNETGENEngine.so")</p>\r
-\r
-<p class="whs4">smeshgui.SetName(salome.ObjectToID(tetra3D), \r
- "NETGEN_3D")</p>\r
-\r
-<p class="whs4"> </p>\r
-\r
-<p class="whs5"># initialize a mesh \r
- with the box</p>\r
-\r
-<p class="whs4">mesh = smesh.CreateMesh(box)</p>\r
-\r
-<p class="whs4">smeshgui.SetName(salome.ObjectToID(mesh), \r
- "MeshBox")</p>\r
-\r
-<p class="whs4"> </p>\r
-\r
-<p class="whs5"># add hypotheses and \r
- algorithms to the box</p>\r
-\r
-<p class="whs4">mesh.AddHypothesis(box,hypNbSeg)</p>\r
-\r
-<p class="whs4">mesh.AddHypothesis(box,hypArea)</p>\r
-\r
-<p class="whs4">mesh.AddHypothesis(box,hypVolume)</p>\r
-\r
-<p class="whs4">mesh.AddHypothesis(box,regular1D)</p>\r
-\r
-<p class="whs4">mesh.AddHypothesis(box,mefisto2D)</p>\r
+<p class="whs5"># assign Max Element \r
+ Volume hypothesis</p>\r
\r
-<p class="whs4">mesh.AddHypothesis(box,tetra3D)</p>\r
+<p class="whs4">algo3D.MaxElementVolume(200.)</p>\r
\r
<p class="whs4"> </p>\r
\r
<p class="whs5"># compute the mesh</p>\r
\r
-<p class="whs4">ret = smesh.Compute(mesh,box)</p>\r
+<p class="whs4">ret = tetra.Compute()</p>\r
\r
<p class="whs4">if ret == 0:</p>\r
\r
<p class="whs4">else:</p>\r
\r
<p class="whs4"> print \r
- "Computation succeded"</p>\r
-\r
-<p class="whs4">salome.sg.updateObjBrowser(1) \r
- </p>\r
-\r
-<p class="whs4"> </p>\r
+ "Computation succeded" </p>\r
\r
<h4><a name=bookmark6>Length from Edges</a></h4>\r
\r
<p class="whs2"><span style="font-family: 'Lucida Console', monospace;">import \r
- salome</span></p>\r
-\r
-<p class="whs2">import geompy</p>\r
+ geompy</span></p>\r
\r
<p class="whs2">import smesh</p>\r
\r
<p class="whs2">sketcher2 = geompy.MakeSketcher("Sketcher:F \r
20 20:TT 50 20:TT 50 50:TT 20 50:WW")</p>\r
\r
-<p class="whs2">isPlanarFace = 1</p>\r
-\r
<p class="whs2"> </p>\r
\r
<p class="whs3"># create a face from \r
two wires</p>\r
\r
-<p class="whs2">face1 = geompy.MakeFaces([sketcher1, \r
- sketcher2],isPlanarFace)</p>\r
-\r
-<p class="whs2"> </p>\r
+<p class="whs2">isPlanarFace = 1</p>\r
\r
-<p class="whs3"># add object in the study</p>\r
+<p class="whs2">face1 = geompy.MakeFaces([sketcher1, \r
+ sketcher2], isPlanarFace)</p>\r
\r
-<p class="whs2">id_face1 = geompy.addToStudy(face1,"Face1")</p>\r
+<p class="whs2">geompy.addToStudy(face1, \r
+ "Face1")</p>\r
\r
<p class="whs2"> </p>\r
\r
\r
<p class="whs3"># Define 1D meshing</p>\r
\r
-<p class="whs2">algo = tria.Segment()</p>\r
+<p class="whs2">algo1D = tria.Segment()</p>\r
\r
-<p class="whs2">algo.NumberOfSegments(2)</p>\r
+<p class="whs2">algo1D.NumberOfSegments(2)</p>\r
\r
<p class="whs2"> </p>\r
\r
<p class="whs3"># create and assign the \r
algorithm for 2D meshing with triangles</p>\r
\r
-<p class="whs2">algo = tria.Triangle()</p>\r
+<p class="whs2">algo2D = tria.Triangle()</p>\r
\r
<p class="whs2"> </p>\r
\r
<p class="whs3"># create and assign "LengthFromEdges" \r
- hypothesis to build triangles </p>\r
-\r
-<p class="whs3"># based on the length \r
- of the edges taken from the wire</p>\r
+ hypothesis to build triangles<span style="font-family: 'Times New Roman', serif;"> \r
+ based on the length of the edges taken from the wire</span></p>\r
\r
-<p class="whs2">algo.LengthFromEdges()</p>\r
+<p class="whs2">algo2D.LengthFromEdges()</p>\r
\r
<p class="whs2"> </p>\r
\r
\r
<h4><a name=bookmark7>Propagation</a></h4>\r
\r
-<p class="whs2"><span style="font-family: 'Lucida Console', monospace;">from \r
- geompy import *</span></p>\r
+<p class="whs2">from geompy import \r
+ *</p>\r
\r
<p class="whs2">import smesh</p>\r
\r
<p class="whs2"> </p>\r
\r
-<p class="whs3"># create vertices</p>\r
-\r
-<p class="whs2">Point111 = MakeVertex( \r
- 0, 0, 0)</p>\r
+<p class="whs3"># create a box</p>\r
\r
-<p class="whs2">Point211 = MakeVertex(10, \r
- 0, 0)</p>\r
+<p class="whs2">box = MakeBoxDXDYDZ(10., \r
+ 10., 10.)</p>\r
\r
-<p class="whs2">Point121 = MakeVertex( \r
- 0, 10, 0)</p>\r
+<p class="whs2">addToStudy(box, "Box")</p>\r
\r
-<p class="whs2">Point221 = MakeVertex(10, \r
- 10, 0)</p>\r
+<p class="whs2"> </p>\r
\r
-<p class="whs2">Point112 = MakeVertex( \r
- 0, 0, 10)</p>\r
+<p class="whs3"># get one edge of the \r
+ box to put local hypothesis on</p>\r
\r
-<p class="whs2">Point212 = MakeVertex(10, \r
- 0, 10)</p>\r
+<p class="whs2">p5 = MakeVertex(5., \r
+ 0., 0.)</p>\r
\r
-<p class="whs2">Point122 = MakeVertex( \r
- 0, 10, 10)</p>\r
+<p class="whs2">EdgeX = GetEdgeNearPoint(box, \r
+ p5)</p>\r
\r
-<p class="whs2">Point222 = MakeVertex(10, \r
- 10, 10)</p>\r
+<p class="whs2">addToStudyInFather(box, \r
+ EdgeX, "Edge [0,0,0 - 10,0,0]")</p>\r
\r
<p class="whs2"> </p>\r
\r
-<p class="whs3"># create edges</p>\r
+<p class="whs3"># create a hexahedral \r
+ mesh on the box</p>\r
\r
-<p class="whs2">EdgeX111 = MakeEdge(Point111, \r
- Point211)</p>\r
+<p class="whs2">hexa = smesh.Mesh(box, \r
+ "Box : hexahedrical mesh")</p>\r
+\r
+<p class="whs2"> </p>\r
\r
-<p class="whs2">EdgeX121 = MakeEdge(Point121, \r
- Point221)</p>\r
+<p class="whs3"># set global algorithms \r
+ and hypotheses</p>\r
\r
-<p class="whs2">EdgeX112 = MakeEdge(Point112, \r
- Point212)</p>\r
+<p class="whs2">algo1D = hexa.Segment()</p>\r
\r
-<p class="whs2">EdgeX122 = MakeEdge(Point122, \r
- Point222)</p>\r
+<p class="whs2">hexa.Quadrangle()</p>\r
\r
-<p class="whs2">EdgeY11 = MakeEdge(Point111, \r
- Point121)</p>\r
+<p class="whs2">hexa.Hexahedron()</p>\r
\r
-<p class="whs2">EdgeY21 = MakeEdge(Point211, \r
- Point221)</p>\r
+<p class="whs2">algo1D.NumberOfSegments(4)</p>\r
\r
-<p class="whs2">EdgeY12 = MakeEdge(Point112, \r
- Point122)</p>\r
+<p class="whs2"> </p>\r
\r
-<p class="whs2">EdgeY22 = MakeEdge(Point212, \r
- Point222)</p>\r
+<p class="whs3"># create a sub-mesh with \r
+ local 1D hypothesis and propagation</p>\r
\r
-<p class="whs2">EdgeZ111 = MakeEdge(Point111, \r
- Point112)</p>\r
+<p class="whs2">algo_local = hexa.Segment(EdgeX)</p>\r
\r
-<p class="whs2">EdgeZ211 = MakeEdge(Point211, \r
- Point212)</p>\r
+<p class="whs2"> </p>\r
\r
-<p class="whs2">EdgeZ121 = MakeEdge(Point121, \r
- Point122)</p>\r
+<p class="whs3"># define "Arithmetic1D" \r
+ hypothesis to cut an edge in several segments with increasing length</p>\r
\r
-<p class="whs2">EdgeZ221 = MakeEdge(Point221, \r
- Point222)</p>\r
+<p class="whs2">algo_local.Arithmetic1D(1, \r
+ 4)</p>\r
\r
<p class="whs2"> </p>\r
\r
-<p class="whs3"># create faces</p>\r
+<p class="whs3"># define "Propagation" \r
+ hypothesis that propagates all other 1D hypotheses</p>\r
\r
-<p class="whs2">FaceX11 = MakeQuad(EdgeY11, \r
- EdgeZ111, EdgeY12, EdgeZ121)</p>\r
+<p class="whs3"># from all edges on the \r
+ opposite side of a face in case of quadrangular faces</p>\r
\r
-<p class="whs2">FaceX21 = MakeQuad(EdgeY21, \r
- EdgeZ211, EdgeY22, EdgeZ221)</p>\r
+<p class="whs2">algo_local.Propagation()</p>\r
\r
-<p class="whs2">FaceY111 = MakeQuad(EdgeX111, \r
- EdgeZ111, EdgeX112, EdgeZ211)</p>\r
+<p class="whs2"> </p>\r
\r
-<p class="whs2">FaceY121 = MakeQuad(EdgeX121, \r
- EdgeZ121, EdgeX122, EdgeZ221)</p>\r
+<p class="whs3"># compute the mesh</p>\r
\r
-<p class="whs2">FaceZ11 = MakeQuad(EdgeX111, \r
- EdgeY11, EdgeX121, EdgeY21)</p>\r
+<p><span style="font-family: 'Lucida Console', monospace;">hexa.Compute()</span> \r
+ </p>\r
\r
-<p class="whs2">FaceZ12 = MakeQuad(EdgeX112, \r
- EdgeY12, EdgeX122, EdgeY22)</p>\r
+<h3><a name=bookmark8>Defining Meshing Algorithms</a></h3>\r
\r
-<p class="whs2"> </p>\r
+<p class="whs4">import geompy</p>\r
\r
-<p class="whs3"># create a solid</p>\r
+<p class="whs4">import smesh</p>\r
\r
-<p class="whs2">box = MakeHexa(FaceX11, \r
- FaceX21, FaceY111, FaceY121, FaceZ11, FaceZ12)</p>\r
+<p class="whs6"> </p>\r
\r
-<p class="whs2"> </p>\r
+<p class="whs6"># create a box</p>\r
\r
-<p class="whs3"># add in the study</p>\r
+<p class="whs4">box = geompy.MakeBoxDXDYDZ(10., \r
+ 10., 10.)</p>\r
\r
-<p class="whs2">box_id = addToStudy(box, \r
+<p class="whs4">geompy.addToStudy(box, \r
"Box")</p>\r
\r
-<p class="whs2"> </p>\r
+<p class="whs4"> </p>\r
\r
-<p class="whs3"># create a hexahedral \r
+<p class="whs6"># 1. Create a hexahedral \r
mesh on the box</p>\r
\r
-<p class="whs2">hexa = smesh.Mesh(box, \r
+<p class="whs4">hexa = smesh.Mesh(box, \r
"Box : hexahedrical mesh")</p>\r
\r
-<p class="whs2"> </p>\r
+<p class="whs6"> </p>\r
\r
-<p class="whs3"># create an 1D algorithm \r
+<p class="whs6"># create a Regular 1D algorithm \r
for edges</p>\r
\r
-<p class="whs2">algo = hexa.Segment()</p>\r
-\r
-<p class="whs2"> </p>\r
-\r
-<p class="whs3"># define "NumberOfSegments" \r
- hypothesis to cut an edge in a fixed number of segments</p>\r
+<p class="whs4">algo1D = hexa.Segment()</p>\r
\r
-<p class="whs2">algo.NumberOfSegments(4)</p>\r
-\r
-<p class="whs2"> </p>\r
-\r
-<p class="whs3"># create a quadrangle \r
- 2D algorithm for faces</p>\r
-\r
-<p class="whs2">hexa.Quadrangle()</p>\r
+<p class="whs6"> </p>\r
\r
-<p class="whs2"> </p>\r
+<p class="whs6"># create a quadrangle 2D \r
+ algorithm for faces</p>\r
\r
-<p class="whs3"># create a hexahedron \r
- 3D algorithm for solids</p>\r
+<p class="whs4">algo2D = hexa.Quadrangle()</p>\r
\r
-<p class="whs2">hexa.Hexahedron()</p>\r
-\r
-<p class="whs2"> </p>\r
+<p class="whs6"> </p>\r
\r
-<p class="whs3"># create a local hypothesis</p>\r
+<p class="whs6"># create a hexahedron 3D \r
+ algorithm for solids</p>\r
\r
-<p class="whs2">algo = hexa.Segment(EdgeX111)</p>\r
+<p class="whs4">algo3D = hexa.Hexahedron()</p>\r
\r
-<p class="whs2"> </p>\r
+<p class="whs6"> </p>\r
\r
-<p class="whs3"># define "Arithmetic1D" \r
- hypothesis to cut an edge<span style="font-family: 'Times New Roman', serif;"> \r
- in several segments with increasing length</span></p>\r
+<p class="whs6"># define hypotheses</p>\r
\r
-<p class="whs2">algo.Arithmetic1D(1, \r
+<p class="whs4">algo1D.Arithmetic1D(1, \r
4)</p>\r
\r
-<p class="whs2"> </p>\r
-\r
-<p class="whs3"># define "Propagation" \r
- hypothesis that propagates all other 1D hypotheses</p>\r
-\r
-<p class="whs3"># from all edges on the \r
- opposite side of a face in case of quadrangular faces</p>\r
-\r
-<p class="whs2">algo.Propagation()</p>\r
+<p class="whs6"> </p>\r
\r
-<p class="whs2"> </p>\r
+<p class="whs6"># compute the mesh</p>\r
\r
-<p class="whs3"># compute the mesh</p>\r
+<p class="whs4">hexa.Compute()</p>\r
\r
-<p class="whs2">hexa.Compute() </p>\r
+<p class="whs6"> </p>\r
\r
-<h3><a name=bookmark8>Defining Meshing Algorithms</a></h3>\r
+<p class="whs6"># 2. Create a tetrahedral \r
+ mesh on the box</p>\r
\r
-<p>Attention! This script was written using old approach, based on direct usage of SMESH idl interface. To be updated for version 3.2.1 to use <b>smesh</b> package.\r
-<br> \r
+<p class="whs4">tetra = smesh.Mesh(box, \r
+ "Box : tetrahedrical mesh")</p>\r
\r
-<p class="whs4"><span style="font-family: 'Lucida Console', monospace;">import \r
- salome</span></p>\r
-\r
-<p class="whs4">import StdMeshers</p>\r
+<p class="whs6"> </p>\r
\r
-<p class="whs4">import NETGENPlugin</p>\r
+<p class="whs6"># create a Regular 1D algorithm \r
+ for edges</p>\r
\r
-<p class="whs4"> </p>\r
+<p class="whs4">algo1D = tetra.Segment()</p>\r
\r
-<p class="whs4">smesh = salome.lcc.FindOrLoadComponent("FactoryServer", \r
- "SMESH")</p>\r
+<p class="whs6"> </p>\r
\r
-<p class="whs4">smeshgui = salome.ImportComponentGUI("SMESH")</p>\r
+<p class="whs6"># create a Mefisto 2D algorithm \r
+ for faces</p>\r
\r
-<p class="whs4">smeshgui.Init(salome.myStudyId);</p>\r
+<p class="whs4">algo2D = tetra.Triangle()</p>\r
\r
<p class="whs6"> </p>\r
\r
-<p class="whs6"># create algorithms</p>\r
-\r
-<p class="whs4">print "-------------------------- \r
- create Algorithms"</p>\r
+<p class="whs6"># create a Netgen 3D algorithm \r
+ for solids</p>\r
\r
-<p class="whs4">print "-------------------------- \r
- Regular_1D (Wire discretisation)"</p>\r
+<p class="whs4">algo3D = tetra.Tetrahedron(smesh.NETGEN)</p>\r
\r
-<p class="whs4">regular1D = smesh.CreateHypothesis("Regular_1D", \r
- "libStdMeshersEngine.so")</p>\r
+<p class="whs6"> </p>\r
\r
-<p class="whs4">smeshgui.SetName(salome.ObjectToID(regular1D), \r
- "Wire Discretisation")</p>\r
+<p class="whs6"># define hypotheses</p>\r
\r
-<p class="whs4"> </p>\r
+<p class="whs4">algo1D.Arithmetic1D(1, \r
+ 4)</p>\r
\r
-<p class="whs4">print "-------------------------- \r
- MEFISTO_2D (Triangle meshing algorithm)"</p>\r
+<p class="whs4">algo2D.LengthFromEdges()</p>\r
\r
-<p class="whs4">mefisto2D = smesh.CreateHypothesis("MEFISTO_2D", \r
- "libStdMeshersEngine.so")</p>\r
+<p class="whs6"> </p>\r
\r
-<p class="whs4">smeshgui.SetName(salome.ObjectToID(mefisto2D), \r
- "MEFISTO_2D")</p>\r
+<p class="whs6"># compute the mesh</p>\r
\r
-<p class="whs4"> </p>\r
+<p class="whs4">tetra.Compute()</p>\r
\r
-<p class="whs4">print "-------------------------- \r
- Quadrangle_2D (Quadrangle meshing algorithm)"</p>\r
+<p class="whs6"> </p>\r
\r
-<p class="whs4">quad2D = smesh.CreateHypothesis( \r
- "Quadrangle_2D", "libStdMeshersEngine.so" )</p>\r
+<p class="whs6"># 3. Create a tetrahedral \r
+ mesh on the box with NETGEN_2D3D algorithm</p>\r
\r
-<p class="whs4">smeshgui.SetName(salome.ObjectToID(quad2D), \r
- "Quadrangle_2D")</p>\r
+<p class="whs4">tetraN = smesh.Mesh(box, \r
+ "Box : tetrahedrical mesh by NETGEN_2D3D")</p>\r
\r
-<p class="whs4"> </p>\r
+<p class="whs6"> </p>\r
\r
-<p class="whs4">print "-------------------------- \r
- Hexa_3D (Hexahedron meshing algorithm)"</p>\r
+<p class="whs6"># create a Netgen_2D3D \r
+ algorithm for solids</p>\r
\r
-<p class="whs4">hexa3D = smesh.CreateHypothesis("Hexa_3D", \r
- "libStdMeshersEngine.so")</p>\r
+<p class="whs4">is3D = 1</p>\r
\r
-<p class="whs4">smeshgui.SetName(salome.ObjectToID(hexa3D), \r
- "HEXA_3D")</p>\r
+<p class="whs4">algo3D = tetraN.Netgen(is3D)</p>\r
\r
-<p class="whs4"> </p>\r
+<p class="whs6"> </p>\r
\r
-<p class="whs4">print "-------------------------- \r
- NETGEN_3D (Tetrahedron meshing algorithm)"</p>\r
+<p class="whs6"># define hypotheses</p>\r
\r
-<p class="whs4">netgen3D = smesh.CreateHypothesis("NETGEN_3D", \r
- "libNETGENEngine.so")</p>\r
+<p class="whs4">n23_params = algo3D.Parameters()</p>\r
\r
-<p class="whs4">smeshgui.SetName(salome.ObjectToID(netgen3D), \r
- "NETGEN_3D")</p>\r
+<p class="whs6"> </p>\r
\r
-<p class="whs4">salome.sg.updateObjBrowser(1)</p>\r
+<p class="whs6"># compute the mesh</p>\r
\r
-<p class="whs6"> </p>\r
+<p class="whs4">tetraN.Compute() \r
+ </p>\r
\r
<script type="text/javascript" language="javascript1.2">\r
<!--\r