Salome HOME
0020743: EDF 1271 SMESH : Create a mesh from a group / export, FindElementByPoint...
authoreap <eap@opencascade.com>
Tue, 14 Jun 2011 14:19:21 +0000 (14:19 +0000)
committereap <eap@opencascade.com>
Tue, 14 Jun 2011 14:19:21 +0000 (14:19 +0000)
doc/salome/gui/SMESH/input/find_element_by_point.doc
doc/salome/gui/SMESH/input/importing_exporting_meshes.doc
doc/salome/gui/SMESH/input/tui_creating_meshes.doc
doc/salome/gui/SMESH/input/tui_viewing_meshes.doc

index fcdadea2946e5cda605c66ff73d1b2b856f61bac..f02a4435a12dd5239e80f953df65ce402f16f647 100644 (file)
@@ -7,7 +7,7 @@ belongs a certain point.
 
 <em>To find the elements:</em>
 <ol>
-<li>Select the mesh</li>
+<li>Select a mesh or a group</li>
 <li>Select from the Mesh menu or from the context menu the Find
 Element by Point item.
 
index dbf96ab89298a8cfff706ead2c62088ddfab3dc4..cdedf8d33b6dbe276ad194beb0116365e7cce74b 100644 (file)
@@ -3,8 +3,8 @@
 \page importing_exporting_meshes_page Importing and exporting meshes
 
 \n In MESH there is a functionality allowing importation/exportation
-of meshes from \b MED, \b UNV (I-DEAS 10), \b DAT (Nastran) and STL
-format files.
+of meshes from/to \b MED, \b UNV (I-DEAS 10), \b DAT (Nastran) and STL
+format files. You can also export a group as a whole mesh.
 
 
 <em>To import a mesh:</em>
@@ -21,7 +21,7 @@ importation. It is possible to select multiple files to be imported all at once.
 
 \image html meshimportmesh.png
 
-<em>To export a mesh:</em>
+<em>To export a mesh or a group:</em>
 
 <ol>
 <li>Select the object you wish to export.</li>
index bad32ebf42a901e87ec65b679b87057aee53ecd3..220e63c8a2b61e72ad03bfdf3fc2894e14a839b6 100644 (file)
@@ -231,6 +231,11 @@ tetra.Compute()
 
 # export the mesh in a MED file
 tetra.ExportMED("/tmp/meshMED.med", 0)
+
+# export a group in a MED file
+face = geompy.SubShapeAll( box, geompy.ShapeType["FACE"])[0] # a box side
+group = tetra.GroupOnGeom( face, "face group" ) # group of 2D elements on the <face>
+tetra.ExportMED("/tmp/groupMED.med", meshPart=group)
 \endcode
 
 <br>
@@ -270,7 +275,7 @@ fGroup = mesh.GroupOnGeom( face, "2D on face")
 nGroup = mesh.GroupOnGeom( face, "nodes on face", NODE)
 subMesh = localAlgo.GetSubMesh()
 
-# make a new mesh by copying different part of the mesh
+# make a new mesh by copying different parts of the mesh
 
 # 1. copy the whole mesh
 newMesh = CopyMesh( mesh, "whole mesh copy")
index 7b2af8cb960d8d429e3a55ad68f2261ca0ba383f..6ef80bf1b05f9079283e7fe5aa432b0107900ead 100644 (file)
@@ -127,8 +127,12 @@ vols = mesh.FindElementsByPoint(x,y,z, SMESH.VOLUME )
 assert( len(vols) == 1)
 
 # Find 0D elements at the point
-edges = mesh.FindElementsByPoint(x,y,z, SMESH.ELEM0D )
-assert( len(edges) == 0)
+elems0d = mesh.FindElementsByPoint(x,y,z, SMESH.ELEM0D )
+assert( len(elems0d) == 0)
+
+# Find edges within a group
+group1D = mesh.MakeGroupByIds("1D", SMESH.EDGE, [1,2] )
+edges = mesh.FindElementsByPoint(x,y,z, SMESH.EDGE, group1D )
 
 \endcode