From: mkr You can get information about your mesh, change its presentation parameters
+ and access to other useful functionalities by right-clicking on it in
+ the Object Browser. Then the
+ following pop-up menu appears: The Update button refreshes the presentation of your mesh in the Object
+ Browser, applying all recent changes. By clicking on Standard Mesh Infos
+ and Advanced Mesh
+ Infos you can learn the Mesh
+ Infos. Via Numbering
+ you can
+ display the ID numbers of all meshing elements or nodes composing your
+ mesh in the viewer. Via Display Mode, Display
+ Entity, Colors
+ / Size, and Transparency
+ you can change the way of presentation of your mesh. In the Clipping menu you can create
+ cross-sections of the selected objects. Quality Controls are described in
+ the next chapter. By clicking on Display Only
+ you hide all other objects. The Erase button deletes the
+ selected object from the session. Using the Change background
+ button you can set the background color. By default it is black. See Also
+ a sample TUI Script of a Viewing Mesh Infos
+ operation. This mesh quality criterion resembles to the Aspect ratio
+ criterion, however, it is also applied to 3D mesh elements: tetrahedrons,
+ pentahedrons, hexahedrons, etc. There are 2 simple formulas to evaluate directly the value of quality
+ Qk for simplex in 2D and 3D. The formulas are : For triangle : where : For tetrahedron : where : To calculate Sk , it is needed to sum the area of each of the 3 faces
+ with the formula given with the triangle. For the other types of element like quadrangle, pentahedron and hexahedron
+ the formula is the following : Where Qi are the quality of all the possible simplex (of same dimension
+ as the element) that compose the element. See Also
+ a sample TUI Script of an Aspect
+ Ratio quality control operation. This mesh quality control highlights borders of faces
+ consisting of edges belonging to several faces. The amount of faces is
+ specified by user. In this picture the borders at multi-connection are displayed in white. See Also
+ a sample TUI Script of a Borders
+ at Multi-Connection quality control operation. This mesh quality control highlights borders of elements
+ of mesh, consisting of edges belonging to several elements of mesh. See Also
+ a sample TUI Script of a Borders
+ at Multi-Connection quality control operation. Using this menu you can create cross-section views (clipping planes)
+ of your mesh. To start, click on the New button. Now you can define the parameters of your cross-section: Orientation
+ (X-Y, X-Z
+ or Y-Z); Distance between the
+ opposite extremities of the object, if
+ it is set to 0.5 the object is split in two halves; and Rotation
+ (in angle degrees) around X (Y to Z)
+ and around Y (X to Z).
+ If the Show preview button is
+ on, you can see the clipping plane in the Object
+ window. If the
+ Auto Apply button is on, you can preview
+ the cross-section in the Object window To get
+ a new object from Clipping, click
+ Ok. import salome import geompy import StdMeshers smesh = salome.lcc.FindOrLoadComponent("FactoryServer",
+ "SMESH") smeshgui = salome.ImportComponentGUI("SMESH") smeshgui.Init(salome.myStudyId); # create a box box = geompy.MakeBox(0.,
+ 0., 0., 100., 200., 300.) # add box to the study idbox = geompy.addToStudy(box,
+ "box") # create a hypothesis print "--------------------------
+ create Hypothesis" print "--------------------------
+ NumberOfSegments" numberOfSegments
+ = 7 hypNbSeg = smesh.CreateHypothesis("NumberOfSegments",
+ "libStdMeshersEngine.so") hypNbSeg.SetNumberOfSegments(numberOfSegments) print hypNbSeg.GetName() print hypNbSeg.GetId() print hypNbSeg.GetNumberOfSegments() smeshgui.SetName(salome.ObjectToID(hypNbSeg),
+ "NumberOfSegments_10") print "--------------------------
+ MaxElementArea" maxElementArea =
+ 800 hypArea = smesh.CreateHypothesis("MaxElementArea",
+ "libStdMeshersEngine.so") hypArea.SetMaxElementArea(maxElementArea) print hypArea.GetName() print hypArea.GetId() print hypArea.GetMaxElementArea() smeshgui.SetName(salome.ObjectToID(hypArea),
+ "MaxElementArea_500") print "--------------------------
+ MaxElementVolume" maxElementVolume
+ = 900 hypVolume = smesh.CreateHypothesis("MaxElementVolume",
+ "libStdMeshersEngine.so") hypVolume.SetMaxElementVolume(maxElementVolume) print hypVolume.GetName() print hypVolume.GetId() print hypVolume.GetMaxElementVolume() smeshgui.SetName(salome.ObjectToID(hypVolume),
+ "MaxElementVolume_500") # create algorithms print "--------------------------
+ create Algorithms" print "--------------------------
+ Regular_1D" regular1D = smesh.CreateHypothesis("Regular_1D",
+ "libStdMeshersEngine.so") smeshgui.SetName(salome.ObjectToID(regular1D),
+ "Wire Discretisation") print "--------------------------
+ MEFISTO_2D" mefisto2D = smesh.CreateHypothesis("MEFISTO_2D",
+ "libStdMeshersEngine.so") smeshgui.SetName(salome.ObjectToID(mefisto2D),
+ "MEFISTO_2D") # initialize a mesh with
+ the box mesh = smesh.CreateMesh(box) smeshgui.SetName(salome.ObjectToID(mesh),
+ "MeshBox") # add the hypothesis to
+ the box print "--------------------------
+ add hypothesis to the box" mesh.AddHypothesis(box,hypNbSeg) mesh.AddHypothesis(box,hypArea) mesh.AddHypothesis(box,hypVolume) mesh.AddHypothesis(box,regular1D) mesh.AddHypothesis(box,mefisto2D) # compute the mesh print "--------------------------
+ compute the mesh of the box" ret = smesh.Compute(mesh,box) print ret if ret == 0: print
+ "probleme when computing the mesh" salome.sg.updateObjBrowser(1) from
+ geompy import * import smesh # create vertices Point111 = MakeVertex( 0, 0,
+ 0) Point211 = MakeVertex(10, 0,
+ 0) Point121 = MakeVertex( 0, 10, 0) Point221 = MakeVertex(10, 10, 0) Point112 = MakeVertex( 0, 0,
+ 10) Point212 = MakeVertex(10, 0,
+ 10) Point122 = MakeVertex( 0, 10, 10) Point222 = MakeVertex(10, 10, 10) # create edges EdgeX111 = MakeEdge(Point111, Point211) EdgeX121 = MakeEdge(Point121, Point221) EdgeX112 = MakeEdge(Point112, Point212) EdgeX122 = MakeEdge(Point122, Point222) EdgeY11 = MakeEdge(Point111, Point121) EdgeY21 = MakeEdge(Point211, Point221) EdgeY12 = MakeEdge(Point112, Point122) EdgeY22 = MakeEdge(Point212, Point222) EdgeZ111 = MakeEdge(Point111, Point112) EdgeZ211 = MakeEdge(Point211, Point212) EdgeZ121 = MakeEdge(Point121, Point122) EdgeZ221 = MakeEdge(Point221, Point222) # create faces FaceX11 = MakeQuad(EdgeY11, EdgeZ111,
+ EdgeY12, EdgeZ121) FaceX21 = MakeQuad(EdgeY21, EdgeZ211,
+ EdgeY22, EdgeZ221) FaceY111 = MakeQuad(EdgeX111, EdgeZ111,
+ EdgeX112, EdgeZ211) FaceY121 = MakeQuad(EdgeX121, EdgeZ121,
+ EdgeX122, EdgeZ221) FaceZ11 = MakeQuad(EdgeX111, EdgeY11,
+ EdgeX121, EdgeY21) FaceZ12 = MakeQuad(EdgeX112, EdgeY12,
+ EdgeX122, EdgeY22) # create a solid Block = MakeHexa(FaceX11, FaceX21, FaceY111,
+ FaceY121, FaceZ11, FaceZ12) # create a compound box = MakeCompound([Block]) # add in the study box_id = addToStudy(box, "Box compound") # create hexahedral mesh
+ on the box hexa = smesh.Mesh(box, "Box compound
+ : hexahedrical mesh") algo = hexa.Segment() # define "NumberOfSegments"
+ hypothesis to cut the edge in a fixed number of segments algo.NumberOfSegments(4) # creates a quadrangle
+ 2D algorithm for the faces hexa.Quadrangle() # construct a submesh with
+ a local hypothesis algo = hexa.Segment(EdgeX111) # define "Arithmetic1D"
+ hypothesis to cut an edge in several segments with increasing arithmetic
+ length algo.Arithmetic1D(1, 4) # define "Propagation"
+ hypothesis that propagates all other hypothesis on all edges on the opposite
+ side in case of quadrangular faces algo.Propagation() # compute the mesh hexa.Compute() ) import
+ salome import geompy import SMESH import StdMeshers smesh = salome.lcc.FindOrLoadComponent("FactoryServer",
+ "SMESH") smesh.SetCurrentStudy(salome.myStudy) box =
+ geompy.MakeBox(0., 0., 0., 20., 20., 20.) idbox = geompy.addToStudy(box, "box") subShapeList = geompy.SubShapeAll(box,
+ geompy.ShapeType["EDGE"]) edge =
+ subShapeList[0] name =
+ geompy.SubShapeName(edge, box) idedge = geompy.addToStudyInFather(box,
+ edge, name) box =
+ salome.IDToObject(idbox) edge = salome.IDToObject(idedge) hyp1 = smesh.CreateHypothesis("NumberOfSegments",
+ "libStdMeshersEngine.so") hyp1.SetNumberOfSegments(3) hyp2 = smesh.CreateHypothesis("MaxElementArea",
+ "libStdMeshersEngine.so") hyp2.SetMaxElementArea(10) hyp3 = smesh.CreateHypothesis("Arithmetic1D",
+ "libStdMeshersEngine.so") hyp3.SetLength(1,1) hyp3.SetLength(6,0) hyp4 = smesh.CreateHypothesis("Propagation",
+ "libStdMeshersEngine.so") algo1 = smesh.CreateHypothesis("Regular_1D",
+ "libStdMeshersEngine.so") algo2 = smesh.CreateHypothesis("MEFISTO_2D",
+ "libStdMeshersEngine.so") mesh = smesh.CreateMesh(box) mesh.AddHypothesis(box,hyp1) mesh.AddHypothesis(box,hyp2) mesh.AddHypothesis(box,algo1) mesh.AddHypothesis(box,algo2) mesh.AddHypothesis(edge,hyp3) mesh.AddHypothesis(edge,hyp4) mesh.AddHypothesis(edge,algo1) smesh.Compute(mesh,box) salome.sg.updateObjBrowser(1) # remove a hypothesis mesh.RemoveHypothesis(edge,hyp4) smesh.Compute(mesh,box) salome.sg.updateObjBrowser(1) # change the value
+ of the hypothesis hyp2.SetMaxElementArea(2) mesh.AddHypothesis(box,hyp2) smesh.Compute(mesh,box) salome.sg.updateObjBrowser(1) import
+ salome import geompy import StdMeshers smesh = salome.lcc.FindOrLoadComponent("FactoryServer",
+ "SMESH") smeshgui = salome.ImportComponentGUI("SMESH") smeshgui.Init(salome.myStudyId); # create a box box = geompy.MakeBox(0.,
+ 0., 0., 100., 200., 300.) # add the box to the study idbox = geompy.addToStudy(box,
+ "box") # create a hypothesis print "--------------------------
+ create Hypothesis" print "--------------------------
+ NumberOfSegments" numberOfSegments
+ = 7 hypNbSeg = smesh.CreateHypothesis("NumberOfSegments",
+ "libStdMeshersEngine.so") hypNbSeg.SetNumberOfSegments(numberOfSegments) print hypNbSeg.GetName() print hypNbSeg.GetId() print hypNbSeg.GetNumberOfSegments() smeshgui.SetName(salome.ObjectToID(hypNbSeg),
+ "NumberOfSegments_10") print "--------------------------
+ MaxElementArea" maxElementArea =
+ 800 hypArea = smesh.CreateHypothesis("MaxElementArea",
+ "libStdMeshersEngine.so") hypArea.SetMaxElementArea(maxElementArea) print hypArea.GetName() print hypArea.GetId() print hypArea.GetMaxElementArea() smeshgui.SetName(salome.ObjectToID(hypArea),
+ "MaxElementArea_500") print "--------------------------
+ MaxElementVolume" maxElementVolume
+ = 900 hypVolume = smesh.CreateHypothesis("MaxElementVolume",
+ "libStdMeshersEngine.so") hypVolume.SetMaxElementVolume(maxElementVolume) print hypVolume.GetName() print hypVolume.GetId() print hypVolume.GetMaxElementVolume() smeshgui.SetName(salome.ObjectToID(hypVolume),
+ "MaxElementVolume_500") # create algorithms print "--------------------------
+ create Algorithms" print "--------------------------
+ Regular_1D" regular1D = smesh.CreateHypothesis("Regular_1D",
+ "libStdMeshersEngine.so") smeshgui.SetName(salome.ObjectToID(regular1D),
+ "Wire Discretisation") print "--------------------------
+ MEFISTO_2D" mefisto2D = smesh.CreateHypothesis("MEFISTO_2D",
+ "libStdMeshersEngine.so") smeshgui.SetName(salome.ObjectToID(mefisto2D),
+ "MEFISTO_2D") # initialize a mesh with
+ the box mesh = smesh.CreateMesh(box) smeshgui.SetName(salome.ObjectToID(mesh),
+ "MeshBox") # add the hypothesis to
+ the box print "--------------------------
+ add hypothesis to the box" mesh.AddHypothesis(box,hypNbSeg) mesh.AddHypothesis(box,hypArea) mesh.AddHypothesis(box,hypVolume) mesh.AddHypothesis(box,regular1D) mesh.AddHypothesis(box,mefisto2D) # compute the mesh print "--------------------------
+ compute the mesh of the box" ret = smesh.Compute(mesh,box) print ret if ret == 0: print
+ "probleme when computing the mesh" salome.sg.updateObjBrowser(1) mesh.ExportMED("/tmp/meshMED.med",0) from geompy import
+ * import smesh # create vertices Point111 = MakeVertex(
+ 0, 0, 0) Point211 = MakeVertex(10,
+ 0, 0) Point121 = MakeVertex(
+ 0, 10, 0) Point221 = MakeVertex(10,
+ 10, 0) Point112 = MakeVertex(
+ 0, 0, 10) Point212 = MakeVertex(10,
+ 0, 10) Point122 = MakeVertex(
+ 0, 10, 10) Point222 = MakeVertex(10,
+ 10, 10) # create edges EdgeX111 = MakeEdge(Point111,
+ Point211) EdgeX121 = MakeEdge(Point121,
+ Point221) EdgeX112 = MakeEdge(Point112,
+ Point212) EdgeX122 = MakeEdge(Point122,
+ Point222) EdgeY11 = MakeEdge(Point111,
+ Point121) EdgeY21 = MakeEdge(Point211,
+ Point221) EdgeY12 = MakeEdge(Point112,
+ Point122) EdgeY22 = MakeEdge(Point212,
+ Point222) EdgeZ111 = MakeEdge(Point111,
+ Point112) EdgeZ211 = MakeEdge(Point211,
+ Point212) EdgeZ121 = MakeEdge(Point121,
+ Point122) EdgeZ221 = MakeEdge(Point221,
+ Point222) # create faces FaceX11 = MakeQuad(EdgeY11,
+ EdgeZ111, EdgeY12, EdgeZ121) FaceX21 = MakeQuad(EdgeY21,
+ EdgeZ211, EdgeY22, EdgeZ221) FaceY111 = MakeQuad(EdgeX111,
+ EdgeZ111, EdgeX112, EdgeZ211) FaceY121 = MakeQuad(EdgeX121,
+ EdgeZ121, EdgeX122, EdgeZ221) FaceZ11 = MakeQuad(EdgeX111,
+ EdgeY11, EdgeX121, EdgeY21) FaceZ12 = MakeQuad(EdgeX112,
+ EdgeY12, EdgeX122, EdgeY22) # create a solid Block = MakeHexa(FaceX11,
+ FaceX21, FaceY111, FaceY121, FaceZ11, FaceZ12) # create a compound box = MakeCompound([Block]) # add in the study box_id = addToStudy(box,
+ "Box compound") # create a hexahedral mesh on the box hexa = smesh.Mesh(box,
+ "Box compound : hexahedrical mesh") algo = hexa.Segment() # define "NumberOfSegments" hypothesis to cut an edge in a
+ fixed number of segments algo.NumberOfSegments(4) # create a quadrangle 2D algorithm for faces hexa.Quadrangle() # create a hexahedron 3D algorithm for solids hexa.Hexahedron() # create a local hypothesis algo = hexa.Segment(EdgeX111) # define "Arithmetic1D" hypothesis to cut an edge in several
+ segments with arithmetic length increasing algo.Arithmetic1D(1,
+ 4) # define "Propagation" hypothesis that propagates all other
+ hypothesis on all edges on the opposite side in case of quadrangular faces algo.Propagation() # compute the mesh hexa.Compute() import smesh import geompy import salome gg = salome.ImportComponentGUI("GEOM") # create vertices px =
+ geompy.MakeVertex(100., 0. ,
+ 0. ) py =
+ geompy.MakeVertex(0. ,
+ 100., 0. ) pz =
+ geompy.MakeVertex(0. ,
+ 0. , 100.) # create a vector from
+ two points vxy = geompy.MakeVector(px,
+ py) # create an arc from
+ three points arc = geompy.MakeArc(py,
+ pz, px) # create a wire wire = geompy.MakeWire([vxy,
+ arc]) isPlanarFace = 1 # create a face from
+ the wire face1 = geompy.MakeFace(wire,
+ isPlanarFace) # add objects in the
+ study id_face1 = geompy.addToStudy(face1,"Face1") # display faces gg.createAndDisplayGO(id_face1) gg.setDisplayMode(id_face1,1) gg.setTransparency(id_face1,0.2) # create hexahedral mesh hexa = smesh.Mesh(face1,
+ "Face compound : hexahedrical mesh") algo = hexa.Triangle() # define "MaxElementArea"
+ hypothesis to be applied to
+ each triangle algo.MaxElementArea(30) # create a quadrangle
+ 2D algorithm for faces hexa.Quadrangle() # create a local hypothesis algo = hexa.Segment(wire) # define "NumberOfSegments"
+ hypothesis to cut an edge in a fixed number of segments algo.NumberOfSegments(6) # define "Deflection1D"
+ hypothesis algo.Deflection1D(1) # compute the mesh hexa.Compute() from geompy import
+ * import smesh # create vertices Point111 = MakeVertex(
+ 0, 0, 0) Point211 = MakeVertex(10,
+ 0, 0) Point121 = MakeVertex(
+ 0, 10, 0) Point221 = MakeVertex(10,
+ 10, 0) Point112 = MakeVertex(
+ 0, 0, 10) Point212 = MakeVertex(10,
+ 0, 10) Point122 = MakeVertex(
+ 0, 10, 10) Point222 = MakeVertex(10,
+ 10, 10) # create edges EdgeX111 = MakeEdge(Point111,
+ Point211) EdgeX121 = MakeEdge(Point121,
+ Point221) EdgeX112 = MakeEdge(Point112,
+ Point212) EdgeX122 = MakeEdge(Point122,
+ Point222) EdgeY11 = MakeEdge(Point111,
+ Point121) EdgeY21 = MakeEdge(Point211,
+ Point221) EdgeY12 = MakeEdge(Point112,
+ Point122) EdgeY22 = MakeEdge(Point212,
+ Point222) EdgeZ111 = MakeEdge(Point111,
+ Point112) EdgeZ211 = MakeEdge(Point211,
+ Point212) EdgeZ121 = MakeEdge(Point121,
+ Point122) EdgeZ221 = MakeEdge(Point221,
+ Point222) # create faces FaceX11 = MakeQuad(EdgeY11,
+ EdgeZ111, EdgeY12, EdgeZ121) FaceX21 = MakeQuad(EdgeY21,
+ EdgeZ211, EdgeY22, EdgeZ221) FaceY111 = MakeQuad(EdgeX111,
+ EdgeZ111, EdgeX112, EdgeZ211) FaceY121 = MakeQuad(EdgeX121,
+ EdgeZ121, EdgeX122, EdgeZ221) FaceZ11 = MakeQuad(EdgeX111,
+ EdgeY11, EdgeX121, EdgeY21) FaceZ12 = MakeQuad(EdgeX112,
+ EdgeY12, EdgeX122, EdgeY22) # create a solid Block = MakeHexa(FaceX11,
+ FaceX21, FaceY111, FaceY121, FaceZ11, FaceZ12) # create a compound box = MakeCompound([Block]) # add in the study box_id = addToStudy(box,
+ "Box compound") # create a hexahedral mesh on the box hexa = smesh.Mesh(box,
+ "Box compound : hexahedrical mesh") algo = hexa.Segment() # define "NumberOfSegments" hypothesis to cut an edge in a
+ fixed number of segments algo.NumberOfSegments(4) # create a quadrangle 2D algorithm for faces hexa.Quadrangle() # create a hexahedron 3D algorithm for solids hexa.Hexahedron() # create a local hypothesis algo = hexa.Segment(EdgeX111) # define "StartEndLength" hypothesis to cut an edge in several
+ segments with increasing geometric length algo.StartEndLength(1,
+ 6) # define "Propagation" hypothesis that propagates all other
+ hypothesis on all edges on the opposite side in case of quadrangular faces algo.Propagation() # compute the mesh hexa.Compute() from geompy import
+ * import smesh # create vertices Point111 = MakeVertex(
+ 0, 0, 0) Point211 = MakeVertex(10,
+ 0, 0) Point121 = MakeVertex(
+ 0, 10, 0) Point221 = MakeVertex(10,
+ 10, 0) Point112 = MakeVertex(
+ 0, 0, 10) Point212 = MakeVertex(10,
+ 0, 10) Point122 = MakeVertex(
+ 0, 10, 10) Point222 = MakeVertex(10,
+ 10, 10) # create edges EdgeX111 = MakeEdge(Point111,
+ Point211) EdgeX121 = MakeEdge(Point121,
+ Point221) EdgeX112 = MakeEdge(Point112,
+ Point212) EdgeX122 = MakeEdge(Point122,
+ Point222) EdgeY11 = MakeEdge(Point111,
+ Point121) EdgeY21 = MakeEdge(Point211,
+ Point221) EdgeY12 = MakeEdge(Point112,
+ Point122) EdgeY22 = MakeEdge(Point212,
+ Point222) EdgeZ111 = MakeEdge(Point111,
+ Point112) EdgeZ211 = MakeEdge(Point211,
+ Point212) EdgeZ121 = MakeEdge(Point121,
+ Point122) EdgeZ221 = MakeEdge(Point221,
+ Point222) # create faces FaceX11 = MakeQuad(EdgeY11,
+ EdgeZ111, EdgeY12, EdgeZ121) FaceX21 = MakeQuad(EdgeY21,
+ EdgeZ211, EdgeY22, EdgeZ221) FaceY111 = MakeQuad(EdgeX111,
+ EdgeZ111, EdgeX112, EdgeZ211) FaceY121 = MakeQuad(EdgeX121,
+ EdgeZ121, EdgeX122, EdgeZ221) FaceZ11 = MakeQuad(EdgeX111,
+ EdgeY11, EdgeX121, EdgeY21) FaceZ12 = MakeQuad(EdgeX112,
+ EdgeY12, EdgeX122, EdgeY22) # create a solid Block = MakeHexa(FaceX11,
+ FaceX21, FaceY111, FaceY121, FaceZ11, FaceZ12) # create a compound box = MakeCompound([Block]) # add in the study box_id = addToStudy(box,
+ "Box compound") # create a hexahedral
+ mesh on the box hexa = smesh.Mesh(box,
+ "Box compound : hexahedrical mesh") algo = hexa.Segment() # define "NumberOfSegments"
+ hypothesis to cut an edge in a fixed number of segments algo.NumberOfSegments(4) # create a quadrangle
+ 2D algorithm for faces hexa.Quadrangle() # create a hexahedron
+ 3D algorithm for solids hexa.Hexahedron() # create a local hypothesis algo = hexa.Segment(EdgeX111) # define "LocalLength"
+ hypothesis to cut an edge in several segments with the same length algo.LocalLength(2) # define "Propagation"
+ hypothesis that propagates all other hypothesis on all edges on
+ the opposite side in case of quadrangular faces algo.Propagation() # compute the mesh hexa.Compute() import smesh import geompy import salome gg = salome.ImportComponentGUI("GEOM") # create vertices px =
+ geompy.MakeVertex(100., 0. ,
+ 0. ) py =
+ geompy.MakeVertex(0. ,
+ 100., 0. ) pz =
+ geompy.MakeVertex(0. ,
+ 0. , 100.) # create a vector from
+ two points vxy = geompy.MakeVector(px,
+ py) # create an arc from three
+ points arc = geompy.MakeArc(py,
+ pz, px) # create a wire wire = geompy.MakeWire([vxy,
+ arc]) isPlanarFace = 1 # create a face from the
+ wire face1 = geompy.MakeFace(wire,
+ isPlanarFace) # add objects in the study id_face1 = geompy.addToStudy(face1,"Face1") # display faces gg.createAndDisplayGO(id_face1) gg.setDisplayMode(id_face1,1) gg.setTransparency(id_face1,0.2) # create a hexahedral mesh hexa = smesh.Mesh(face1,
+ "Face compound : hexahedrical mesh") algo = hexa.Triangle() # define "MaxElementArea"
+ hypothesis to be applied to each triangle algo.MaxElementArea(7) # create a quadrangle 2D
+ algorithm for faces hexa.Quadrangle() # create a local hypothesis algo = hexa.Segment(wire) # define "NumberOfSegments"
+ hypothesis to cut an edge in a fixed number of segments algo.NumberOfSegments(10) # compute the mesh hexa.Compute() import
+ salome import geompy import StdMeshers smesh = salome.lcc.FindOrLoadComponent("FactoryServer",
+ "SMESH") smeshgui = salome.ImportComponentGUI("SMESH") smeshgui.Init(salome.myStudyId); # create a box box = geompy.MakeCylinderRH(30,
+ 50) #MakeBox(0., 0., 0., 100., 200., 300.) # add the box to the
+ study idbox = geompy.addToStudy(box,
+ "box") # create vertices px =
+ geompy.MakeVertex(100., 0. ,
+ 0. ) py =
+ geompy.MakeVertex(0. ,
+ 100., 0. ) pz =
+ geompy.MakeVertex(0. ,
+ 0. , 100.) # create a vector from
+ two points vxy = geompy.MakeVector(px,
+ py) # create an arc from
+ three points arc = geompy.MakeArc(py,
+ pz, px) # create a wire wire = geompy.MakeWire([vxy,
+ arc]) isPlanarFace = 1 # create a face from
+ the wire #face1 box = geompy.MakeFace(wire,
+ isPlanarFace) # add objects in the
+ study id_face1 = geompy.addToStudy(box,"Face1") #geompy.addToStudy(face1,"Face1") # display faces gg.createAndDisplayGO(id_face1) gg.setDisplayMode(id_face1,1) gg.setTransparency(id_face1,0.2) # create a hypothesis print "--------------------------
+ create Hypothesis" print "--------------------------
+ NumberOfSegments" numberOfSegments
+ = 7 hypNbSeg = smesh.CreateHypothesis("NumberOfSegments",
+ "libStdMeshersEngine.so") hypNbSeg.SetNumberOfSegments(numberOfSegments) print hypNbSeg.GetName() print hypNbSeg.GetId() print hypNbSeg.GetNumberOfSegments() smeshgui.SetName(salome.ObjectToID(hypNbSeg),
+ "NumberOfSegments_10") print "--------------------------
+ MaxElementArea" maxElementArea =
+ 800 hypArea = smesh.CreateHypothesis("MaxElementArea",
+ "libStdMeshersEngine.so") hypArea.SetMaxElementArea(maxElementArea) print hypArea.GetName() print hypArea.GetId() print hypArea.GetMaxElementArea() smeshgui.SetName(salome.ObjectToID(hypArea),
+ "MaxElementArea_800") print "--------------------------
+ MaxElementVolume" maxElementVolume
+ = 900 hypVolume = smesh.CreateHypothesis("MaxElementVolume",
+ "libStdMeshersEngine.so") hypVolume.SetMaxElementVolume(maxElementVolume) print hypVolume.GetName() print hypVolume.GetId() print hypVolume.GetMaxElementVolume() smeshgui.SetName(salome.ObjectToID(hypVolume),
+ "MaxElementVolume_900") # create algorithms print "--------------------------
+ create Algorithms" print "--------------------------
+ Regular_1D" regular1D = smesh.CreateHypothesis("Regular_1D",
+ "libStdMeshersEngine.so") smeshgui.SetName(salome.ObjectToID(regular1D),
+ "Wire Discretisation") print "--------------------------
+ MEFISTO_2D" mefisto2D = smesh.CreateHypothesis("MEFISTO_2D",
+ "libStdMeshersEngine.so") smeshgui.SetName(salome.ObjectToID(mefisto2D),
+ "MEFISTO_2D") #print "--------------------------
+ Hexa_3D (Hexahedron meshing algorithm)" hexa3D = smesh.CreateHypothesis("Hexa_3D",
+ "libStdMeshersEngine.so") smeshgui.SetName(salome.ObjectToID(hexa3D),
+ "HEXA_3D") # initialize a mesh
+ with the box mesh = smesh.CreateMesh(box) smeshgui.SetName(salome.ObjectToID(mesh),
+ "MeshBox") # add a hypothesis
+ to the box print "--------------------------
+ add hypothesis to the box" mesh.AddHypothesis(box,hypNbSeg) mesh.AddHypothesis(box,hypArea) mesh.AddHypothesis(box,hypVolume) mesh.AddHypothesis(box,regular1D) mesh.AddHypothesis(box,mefisto2D) mesh.AddHypothesis(box,hexa3D) # compute the mesh print "--------------------------
+ compute the mesh of the box" ret = smesh.Compute(mesh,box) print ret if ret == 0: print
+ "probleme when computing the mesh" salome.sg.updateObjBrowser(1) import smesh import geompy import salome gg = salome.ImportComponentGUI("GEOM") # create sketchers sketcher1 = geompy.MakeSketcher("Sketcher:F
+ 0 0:TT 70 0:TT 70 70:TT 0 70:WW") sketcher2 = geompy.MakeSketcher("Sketcher:F
+ 20 20:TT 50 20:TT 50 50:TT 20 50:WW") isPlanarFace = 1 # create faces from two wires face1 = geompy.MakeFaces([sketcher1,
+ sketcher2],isPlanarFace) # add objects in the study id_face1 = geompy.addToStudy(face1,"Face1") # display faces gg.createAndDisplayGO(id_face1) gg.setDisplayMode(id_face1,1) gg.setTransparency(id_face1,0.2) # create a mesh hexa = smesh.Mesh(face1,
+ "Face : triangle 2D mesh") algo = hexa.Triangle() # define "MaxElementArea" hypothesis to be applied to each
+ triangle algo.MaxElementArea(30) # define "LengthFromEdges" hypothesis to build triangles based
+ on the length of the edges taken from the wire algo.LengthFromEdges() # create local hypothesis algo = hexa.Segment() # define "NumberOfSegments" hypothesis to cut an edge in a
+ fixed number of segments algo.NumberOfSegments(2) # compute the mesh hexa.Compute() from geompy import
+ * import smesh # create vertices Point111 = MakeVertex(
+ 0, 0, 0) Point211 = MakeVertex(10,
+ 0, 0) Point121 = MakeVertex(
+ 0, 10, 0) Point221 = MakeVertex(10,
+ 10, 0) Point112 = MakeVertex(
+ 0, 0, 10) Point212 = MakeVertex(10,
+ 0, 10) Point122 = MakeVertex(
+ 0, 10, 10) Point222 = MakeVertex(10,
+ 10, 10) # create edges EdgeX111 = MakeEdge(Point111,
+ Point211) EdgeX121 = MakeEdge(Point121,
+ Point221) EdgeX112 = MakeEdge(Point112,
+ Point212) EdgeX122 = MakeEdge(Point122,
+ Point222) EdgeY11 = MakeEdge(Point111,
+ Point121) EdgeY21 = MakeEdge(Point211,
+ Point221) EdgeY12 = MakeEdge(Point112,
+ Point122) EdgeY22 = MakeEdge(Point212,
+ Point222) EdgeZ111 = MakeEdge(Point111,
+ Point112) EdgeZ211 = MakeEdge(Point211,
+ Point212) EdgeZ121 = MakeEdge(Point121,
+ Point122) EdgeZ221 = MakeEdge(Point221,
+ Point222) # create faces FaceX11 = MakeQuad(EdgeY11,
+ EdgeZ111, EdgeY12, EdgeZ121) FaceX21 = MakeQuad(EdgeY21,
+ EdgeZ211, EdgeY22, EdgeZ221) FaceY111 = MakeQuad(EdgeX111,
+ EdgeZ111, EdgeX112, EdgeZ211) FaceY121 = MakeQuad(EdgeX121,
+ EdgeZ121, EdgeX122, EdgeZ221) FaceZ11 = MakeQuad(EdgeX111,
+ EdgeY11, EdgeX121, EdgeY21) FaceZ12 = MakeQuad(EdgeX112,
+ EdgeY12, EdgeX122, EdgeY22) # create a solid Block = MakeHexa(FaceX11,
+ FaceX21, FaceY111, FaceY121, FaceZ11, FaceZ12) # create a compound box = MakeCompound([Block]) # add in the study box_id = addToStudy(box,
+ "Box compound") # create a hexahedral
+ mesh on the box hexa = smesh.Mesh(box,
+ "Box compound : hexahedrical mesh") algo = hexa.Segment() # define "NumberOfSegments"
+ hypothesis to cut an edge in a fixed number of segments algo.NumberOfSegments(4) # create a quadrangle
+ 2D algorithm for faces hexa.Quadrangle() # create a hexahedron
+ 3D algorithm for solids hexa.Hexahedron() # create a local hypothesis algo = hexa.Segment(EdgeX111) #
+ define "Arithmetic1D" hypothesis to cut an edge in several segments
+ with arithmetic length increasing algo.Arithmetic1D(1,
+ 4) # define "Propagation"
+ hypothesis that propagatea all other hypothesis on all edges on the opposite
+ side in case of quadrangular faces algo.Propagation() # compute the mesh hexa.Compute() import
+ salome import StdMeshers import NETGENPlugin smesh = salome.lcc.FindOrLoadComponent("FactoryServer",
+ "SMESH") smeshgui = salome.ImportComponentGUI("SMESH") smeshgui.Init(salome.myStudyId); # create algorithms print "--------------------------
+ create Algorithms" print "--------------------------
+ Regular_1D (Wire discretisation)" regular1D = smesh.CreateHypothesis("Regular_1D",
+ "libStdMeshersEngine.so") smeshgui.SetName(salome.ObjectToID(regular1D),
+ "Wire Discretisation") print "--------------------------
+ MEFISTO_2D (Triangle meshing algorithm)" mefisto2D = smesh.CreateHypothesis("MEFISTO_2D",
+ "libStdMeshersEngine.so") smeshgui.SetName(salome.ObjectToID(mefisto2D),
+ "MEFISTO_2D") print "--------------------------
+ Quadrangle_2D (Quadrangle meshing algorithm)" quad2D = smesh.CreateHypothesis(
+ "Quadrangle_2D", "libStdMeshersEngine.so" ) smeshgui.SetName(salome.ObjectToID(quad2D),
+ "Quadrangle_2D") print "--------------------------
+ Hexa_3D (Hexahedron meshing algorithm)" hexa3D = smesh.CreateHypothesis("Hexa_3D",
+ "libStdMeshersEngine.so") smeshgui.SetName(salome.ObjectToID(hexa3D),
+ "HEXA_3D") print "--------------------------
+ NETGEN_3D (Tetrahedron meshing algorithm)" netgen3D = smesh.CreateHypothesis("NETGEN_3D",
+ "libNETGENEngine.so") smeshgui.SetName(salome.ObjectToID(netgen3D),
+ "NETGEN_3D") salome.sg.updateObjBrowser(1) In this submenu you can choose to display only faces, only edges, or both. 1. From the Modification
menu choose the Extrusion item
or click button in the toolbar. The following dialog box
- shall appear:About viewing meshes
+
+Aspect ratio 3D
+
+
+
+Borders at multi-connection
+
+Borders at multi-connection 2D
+
+Clipping
+
+Creating Meshes
+
+Construction of a Mesh
+
+Construction of a Submesh
+
+Editing of a mesh
+
+Export of a Mesh
+
+Defining Hypotheses and Algorithms
+
+Defining 1D Hypotheses
+
+
+
+Deflection 1D and Number of Segments
+
+Start and End Length
+
+Average Length
+
+Defining 2D and 3D hypotheses
+
+Maximum Element Area
+
+Maximum Element Volume
+
+Defining Additional Hypotheses
+
+Length from Edges
+
+Propagation
+
+Defining Meshing Algorithms
+
+Display Entity
+
+Extrusion
@@ -122,11 +95,11 @@ else
- +
@@ -157,7 +130,6 @@ else
-