1 <!DOCTYPE HTML PUBLIC "HTML 4.01 Transitional">
4 <meta http-equiv="Content-Type" content="text/html">
5 <title>Geometry module in SALOME environnement </title>
9 <h1>SMESH starting tutorial</h1>
11 <h2>2D meshing with MEFISTO</h2>
15 <p><i>Before following this tutorial you need to create or import a geometry.
16 Please refere to the GEOM module documentation to do so.</i></p>
18 <p>Now we have to load SMESH component. To do so : </p>
20 <li>click on the SMESH icon or on 'SMESH' into the combo box of resources
24 <p><i>SMESH is used to mesh edges, faces and volums each one thanks to a
25 specialised algorithm. To mesh an entity which degree is n, one must have all
26 its lower degree entities meshed. For instance, to mesh a face requires a
27 previous meshing of all its edges. In the example MEFISTO meshes faces, and
28 Regular_1D meshes edges. MEFISTO doesn't check how edges are meshed. The only
29 test it does is to verify that edges are meshed before starting its work.
30 MEFISTO requires an hypothesis : maximum area of triangles. Regular_1D
31 requires one hypothesis among two: number of segments per edge <u>or</u>
32 length of segment.</i> </p>
34 <p>The entire operation is done by :</p>
36 <li>init a mesh object associated to a geometrical object</li>
37 <li>choosing an <u>algorithm</u> for meshing faces, here MEFISTO is
39 <li>choosing an <u>algorithm</u> for meshing edges, here Regular1d is
41 <li>creating <u>hypothesis</u> of calculation. We need to inform :
43 <li>the number of segments per edge</li>
44 <li>the maximum area per triangle of meshing</li>
47 <li>setting or attaching algorithm and hypothesis to the object loaded</li>
48 <li>launching computation</li>
49 <li>displaying the result in the best mode.</li>
51 <img alt="" src="SMESHOverview.png">
55 <p>Below are explained those 6 steps precisely : </p>
57 <li><p><u>init a mesh object associated to a geometrical object :</u></p>
58 <p><img src="MeshInit.png"></p>
60 <li>In the menu bar on the top, find the <u>Mesh</u> menu and click on
62 <li>Then in the dialog box select the topology into Geometry field of
63 ObjectBrowser or Viewer, give a name an click on Ok.</li>
64 <li>The topology is now known inside SMESH component.</li>
67 <li><p>define algorithms for meshing : </p>
68 <p><img src="SelectAlgorithms.png"></p>
70 <li>In the menu bar, find <u>Hypothesis</u>, <u>Algorithm</u> then
71 click on <u>Mefisto.</u></li>
72 <li>Do the same to load 'Regular1D'.</li>
73 <li>Remember, Regular1D is needed for edge meshing.</li>
76 <li><p>define <u>hypothesis</u> of calculation :<br>
77 In the menu bar, find <u>Hypothesis</u> then Hypothesis and click on
78 Segments. Then in the dialog box give a name for <u>hypothesis</u> and a
79 value that is the number of segments per edge. Enter 7 segments for
81 Do the same for 'Max. Element Area' argument that is the maximum surface
82 of triangles builded during meshing. Enter 2500 here.</p>
84 <li><p>Attach previous arguments (hypothesis) and algorithm to the
86 Select the object in the Object Browser then using pop up menu (right
88 'Set algorithm' and 'Set Hypothesis' into specialized dialog boxes.<br>
89 You can also find these methods in the menu 'Hypothesis'.</p>
91 <li><p>Selecting the mesh object before, start computation in the pop up
92 menu; click on 'Compute'.</p>
94 <li><p>Update the display using '<i>Update'</i> if necessary.<br>
95 Note : in <i>Preferencies</i> / <i>Mesh</i> menu there is an
96 option to have an automatic update of the display after operations that
97 modify it such as Compute, adding nodes… If this option is not
98 setted user must make an update of the display manually.<br>
100 You may also adjust the display '<i>Properties' / 'Display Mode</i>' has
101 you prefer ; shading, wireframe or shrink,<br>
102 and adjust color and size attributs in a specific dialog box shown
104 <p><img src="SetColor.png"></p>
108 <h3>Final result of meshing</h3>
110 <p>At this final step you can observe the result of 2D meshing of faces by
113 <p>Note : it is possible to change an hypothesis by mean the pop up then
114 <i>Edit</i> and finally compute again.</p>
116 <p><img src="MeshResult.png"></p>
118 <h2>Meshing with global and local hypothesis</h2>
122 <p><i>We would now make a mesh as before but with a local modification of
123 parameter (hypothesis) on an edge. We first have to explode the initial
124 topology in GEOMETRY component. This operation will give us access to sub
125 shapes edges of geom.brep.</i></p>
127 <li><p>import or create a geometry as before</p>
129 <li><p>call 'Explode' method found in 'New Entity' on the menu bar ;
130 (remember the tip about Automatic/Store !) </p>
131 <p><img src="SubShapesSelection.png"></p>
133 <li><p>select the main object, choose 'Edge' in the combo box and click on
135 <u>Note</u> : do not click on 'select sub shape' at anytime. This
136 function is used with OCC viewer for individual sub shape selection not
137 yet available with VTK.<br>
139 Now the object browser contents all edges as sub shapes of the main
140 topology. Select the first edge <i>Edge_ 1</i> and display only it.
141 Use the pop up 'Display only' mode for this.<br>
142 You may also rename the edge to remember it for future meshing.<br>
143 <i>Our scope : apply a local hypothesis on this edge.<br>
146 <li><p>The job is now finished for GEOMETRY component.</p>
148 <li><p>Load SMESH component and use menus 'Mesh' and 'Init' to load the
149 topology into SMESH as before.<br>
150 (Already defined if you have kept the previous study.)</p>
152 <li><p>Define algorithms Regular_1D and Mefisto using menus 'Hypothesis'
155 <li><p>Define hypothesis 'Segments' = 7 and 'Max. Element Area' = 2500.
156 (Already defined if…) </p>
158 <li><p>Define another hypothesis 'Local length' = 100 to be used only as
159 local parameter for the edge.</p>
161 <li><p>Now we have to attach algorithms and hypothesis to topologies, the
162 global and the sub shape edge.<br>
163 For the main topology, select it and use 'Set algorithms' and 'Set
164 Hypothesis' and attach :<br>
165 hypothesis 'Segments' = 7 and 'Max. Element Area' = 2500.</p>
167 <li><p>To set a local parameter of meshing on the edge we do :<br>
168 click on 'Mesh' menu then 'Add Sub Mesh'. On the dialog box select the
169 main object then sub object edge from Object Browser and GEOMETRY field.
170 Give it a local name; for example <i>myEdge</i> or anyone.</p>
171 <p><img src="SubMeshContruction.png"></p>
173 <li><p>Set the algorithm used for edge meshing. Here use Regular_ 1D.
176 <li><p>Set a local hypothesis to the edge. Use 'Local length' = 100.</p>
178 <li><p>'<i>Compute'</i> (and '<i>Update'</i> display if necessary see
179 before) the main mesh object. This will compute also the edge sub
181 Do not forget to activate the display mode Wireframe,
182 Shading or Shrink; see in pop up menu '<i>Properties'</i>,
183 '<i>Display mode'</i>… </p>
185 <li><p>Move the point of view to watch the edge meshed with a local
186 hypothesis 'Local length' = 100. </p>
190 <h3>The result of second meshing</h3>
192 <p>As we see below, the effect produced by setting a local hypothesis setted
193 on the edge <i>Edge_ 1.</i></p>
195 <p align="left">Compare to another edge that have the same physical
198 <p><img src="MeshResult2.png"></p>
200 <h2>Using PYTHON interpretor to import an example script</h2>
201 It is easy to import an example of meshing procedure using PYTHON interpretor
204 <li>Load SMESH component with VTK viewer.</li>
205 <li>Just type <i>'import geomMesh.py'</i> in the textual window of
207 <li>Validate with the <i>Enter</i> key.</li>
208 <li>You just have to run 'Compute' then choose a display mode to see the
211 This imported example is very similar to the last exercice. It uses a local
212 hypothesis on an edge too.
214 <p><img src="ImportResult.png"></p>
216 <h2>Control features</h2>
218 <p>Test now a control function of area for mesh resulting triangles.</p>
220 <p>Find <i>Control</i> on the menu bar then <i>Cells</i> and <i>Area</i>. The
221 image below displays areas with a color depending on its value in the scalar
222 bar shown on the left.<br>
223 Scalar bar general parameters are setted in <i>Preferencies</i> /
224 <i>Mesh</i> / <i>Scalar Bar</i>.</p>
226 <p>Specific range parameters are changed with the pop up menu.</p>
228 <p><img src="ControlFeature.png"></p>