3 \page tui_defining_hypotheses_page Defining Hypotheses and Algorithms
5 This page provides example codes of \ref tui_defining_meshing_algos
6 "defining algorithms" and hypotheses.
8 <li>Wire discretisation 1D algorithm
10 <li>\ref tui_1d_arithmetic "Arithmetic 1D" hypothesis</li>
11 <li>\ref tui_deflection_1d "Deflection 1D and Number of Segments" hypotheses</li>
12 <li>\ref tui_start_and_end_length "Start and End Length" hypotheses</li>
13 <li>\ref tui_average_length "Local Length"</li>
14 <li>\ref tui_propagation "Propagation" additional hypothesis </li>
15 <li>\ref tui_fixed_points "Fixed Points 1D" hypothesis</li>
18 <li>Triangle (Mefisto) 2D algorithm
20 <li>\ref tui_max_element_area "Max Element Area" hypothesis </li>
21 <li>\ref tui_length_from_edges "Length from Edges"
25 <li>Tetrahedron (Netgen) 3D algorithm
27 <li> \ref tui_max_element_volume "Max. Element Volume"hypothesis </li>
28 <li> \ref tui_viscous_layers "Viscous layers"</li>
31 <li>\ref tui_projection "Projection Algorithms"</li>
32 <li>\ref tui_radial_quadrangle "Radial Quadrangle 1D2D" algorithm</li>
33 <li>Quadrangle (Mapping) 2D algorithm
35 <li> \ref tui_quadrangle_parameters "Quadrangle Parameters" hypothesis </li>
38 <li>\ref tui_import "Use Existing Elements" algorithm</li>
42 <h2>Defining 1D Hypotheses</h2>
45 \anchor tui_1d_arithmetic
46 <h3>Arithmetic 1D</h3>
53 box = geompy.MakeBoxDXDYDZ(10., 10., 10.)
54 geompy.addToStudy(box, "Box")
56 # create a hexahedral mesh on the box
57 hexa = smesh.Mesh(box, "Box : hexahedrical mesh")
59 # create a Regular 1D algorithm for edges
60 algo1D = hexa.Segment()
62 # optionally reverse node distribution on certain edges
63 allEdges = geompy.SubShapeAllSortedIDs( box, geompy.ShapeType["EDGE"])
64 reversedEdges = [ allEdges[0], allEdges[4] ]
66 # define "Arithmetic1D" hypothesis to cut all edges in several segments with increasing arithmetic length
67 algo1D.Arithmetic1D(1, 4, reversedEdges)
69 # create a quadrangle 2D algorithm for faces
72 # create a hexahedron 3D algorithm for solids
80 \anchor tui_deflection_1d
81 <h3>Deflection 1D and Number of Segments</h3>
87 # create a face from arc and straight segment
88 px = geompy.MakeVertex(100., 0. , 0. )
89 py = geompy.MakeVertex(0. , 100., 0. )
90 pz = geompy.MakeVertex(0. , 0. , 100.)
92 exy = geompy.MakeEdge(px, py)
93 arc = geompy.MakeArc(py, pz, px)
95 wire = geompy.MakeWire([exy, arc])
98 face1 = geompy.MakeFace(wire, isPlanarFace)
99 geompy.addToStudy(face1,"Face1")
101 # get edges from the face
102 e_straight,e_arc = geompy.SubShapeAll(face1, geompy.ShapeType["EDGE"])
103 geompy.addToStudyInFather(face1, e_arc, "Arc Edge")
105 # create hexahedral mesh
106 hexa = smesh.Mesh(face1, "Face : triangle mesh")
108 # define "NumberOfSegments" hypothesis to cut a straight edge in a fixed number of segments
109 algo1D = hexa.Segment()
110 algo1D.NumberOfSegments(6)
112 # define "MaxElementArea" hypothesis
113 algo2D = hexa.Triangle()
114 algo2D.MaxElementArea(70.0)
116 # define a local "Deflection1D" hypothesis on the arc
117 algo_local = hexa.Segment(e_arc)
118 algo_local.Deflection1D(1.0)
125 \anchor tui_start_and_end_length
126 <h3>Start and End Length</h3>
133 box = MakeBoxDXDYDZ(10., 10., 10.)
134 addToStudy(box, "Box")
136 # get one edge of the box to put local hypothesis on
137 p5 = MakeVertex(5., 0., 0.)
138 EdgeX = GetEdgeNearPoint(box, p5)
139 addToStudyInFather(box, EdgeX, "Edge [0,0,0 - 10,0,0]")
141 # create a hexahedral mesh on the box
142 hexa = smesh.Mesh(box, "Box : hexahedrical mesh")
145 algo1D = hexa.Segment()
149 # define "NumberOfSegments" hypothesis to cut an edge in a fixed number of segments
150 algo1D.NumberOfSegments(4)
152 # create a local hypothesis
153 algo_local = hexa.Segment(EdgeX)
155 # define "StartEndLength" hypothesis to cut an edge in several segments with increasing geometric length
156 algo_local.StartEndLength(1, 6)
158 # define "Propagation" hypothesis that propagates all other hypothesis
159 # on all edges on the opposite side in case of quadrangular faces
160 algo_local.Propagation()
167 \anchor tui_average_length
168 <h3>Local Length</h3>
175 box = MakeBoxDXDYDZ(10., 10., 10.)
176 addToStudy(box, "Box")
178 # get one edge of the box to put local hypothesis on
179 p5 = MakeVertex(5., 0., 0.)
180 EdgeX = GetEdgeNearPoint(box, p5)
181 addToStudyInFather(box, EdgeX, "Edge [0,0,0 - 10,0,0]")
183 # create a hexahedral mesh on the box
184 hexa = smesh.Mesh(box, "Box : hexahedrical mesh")
187 algo1D = hexa.Segment()
191 # define "NumberOfSegments" hypothesis to cut all edges in a fixed number of segments
192 algo1D.NumberOfSegments(4)
195 algo_local = hexa.Segment(EdgeX)
197 # define "LocalLength" hypothesis to cut an edge in several segments with the same length
198 algo_local.LocalLength(2.)
200 # define "Propagation" hypothesis that propagates all other hypothesis
201 # on all edges on the opposite side in case of quadrangular faces
202 algo_local.Propagation()
208 <br><h2>Defining 2D and 3D hypotheses</h2>
211 \anchor tui_max_element_area
212 <h3>Maximum Element Area</h3>
220 px = geompy.MakeVertex(100., 0. , 0. )
221 py = geompy.MakeVertex(0. , 100., 0. )
222 pz = geompy.MakeVertex(0. , 0. , 100.)
224 vxy = geompy.MakeVector(px, py)
225 arc = geompy.MakeArc(py, pz, px)
226 wire = geompy.MakeWire([vxy, arc])
229 face = geompy.MakeFace(wire, isPlanarFace)
231 # add the face in the study
232 id_face = geompy.addToStudy(face, "Face to be meshed")
235 tria_mesh = smesh.Mesh(face, "Face : triangulation")
238 algo = tria_mesh.Segment()
239 algo.NumberOfSegments(20)
243 # assign triangulation algorithm
244 algo = tria_mesh.Triangle()
246 # apply "Max Element Area" hypothesis to each triangle
247 algo.MaxElementArea(100)
254 \anchor tui_max_element_volume
255 <h3>Maximum Element Volume</h3>
262 cyl = geompy.MakeCylinderRH(30., 50.)
263 geompy.addToStudy(cyl, "cyl")
265 # create a mesh on the cylinder
266 tetra = smesh.Mesh(cyl, "Cylinder : tetrahedrical mesh")
269 algo1D = tetra.Segment()
270 algo2D = tetra.Triangle()
271 algo3D = tetra.Tetrahedron()
273 # assign 1D and 2D hypotheses
274 algo1D.NumberOfSegments(7)
275 algo2D.MaxElementArea(150.)
277 # assign Max Element Volume hypothesis
278 algo3D.MaxElementVolume(200.)
281 ret = tetra.Compute()
283 print "probleme when computing the mesh"
285 print "Computation succeded"
289 \anchor tui_length_from_edges
290 <h3>Length from Edges</h3>
297 sketcher1 = geompy.MakeSketcher("Sketcher:F 0 0:TT 70 0:TT 70 70:TT 0 70:WW")
298 sketcher2 = geompy.MakeSketcher("Sketcher:F 20 20:TT 50 20:TT 50 50:TT 20 50:WW")
300 # create a face from two wires
302 face1 = geompy.MakeFaces([sketcher1, sketcher2], isPlanarFace)
303 geompy.addToStudy(face1, "Face1")
306 tria = smesh.Mesh(face1, "Face : triangle 2D mesh")
309 algo1D = tria.Segment()
310 algo1D.NumberOfSegments(2)
312 # create and assign the algorithm for 2D meshing with triangles
313 algo2D = tria.Triangle()
315 # create and assign "LengthFromEdges" hypothesis to build triangles based on the length of the edges taken from the wire
316 algo2D.LengthFromEdges()
322 <br><h2>Defining Additional Hypotheses</h2>
325 \anchor tui_propagation
333 box = MakeBoxDXDYDZ(10., 10., 10.)
334 addToStudy(box, "Box")
336 # get one edge of the box to put local hypothesis on
337 p5 = MakeVertex(5., 0., 0.)
338 EdgeX = GetEdgeNearPoint(box, p5)
339 addToStudyInFather(box, EdgeX, "Edge [0,0,0 - 10,0,0]")
341 # create a hexahedral mesh on the box
342 hexa = smesh.Mesh(box, "Box : hexahedrical mesh")
344 # set global algorithms and hypotheses
345 algo1D = hexa.Segment()
348 algo1D.NumberOfSegments(4)
350 # create a sub-mesh with local 1D hypothesis and propagation
351 algo_local = hexa.Segment(EdgeX)
353 # define "Arithmetic1D" hypothesis to cut an edge in several segments with increasing length
354 algo_local.Arithmetic1D(1, 4)
356 # define "Propagation" hypothesis that propagates all other 1D hypotheses
357 # from all edges on the opposite side of a face in case of quadrangular faces
358 algo_local.Propagation()
365 \anchor tui_defining_meshing_algos
366 <h2>Defining Meshing Algorithms</h2>
373 box = geompy.MakeBoxDXDYDZ(10., 10., 10.)
374 geompy.addToStudy(box, "Box")
376 # 1. Create a hexahedral mesh on the box
377 hexa = smesh.Mesh(box, "Box : hexahedrical mesh")
379 # create a Regular 1D algorithm for edges
380 algo1D = hexa.Segment()
382 # create a quadrangle 2D algorithm for faces
383 algo2D = hexa.Quadrangle()
385 # create a hexahedron 3D algorithm for solids
386 algo3D = hexa.Hexahedron()
389 algo1D.Arithmetic1D(1, 4)
394 # 2. Create a tetrahedral mesh on the box
395 tetra = smesh.Mesh(box, "Box : tetrahedrical mesh")
397 # create a Regular 1D algorithm for edges
398 algo1D = tetra.Segment()
400 # create a Mefisto 2D algorithm for faces
401 algo2D = tetra.Triangle()
403 # create a 3D algorithm for solids
404 algo3D = tetra.Tetrahedron()
407 algo1D.Arithmetic1D(1, 4)
408 algo2D.LengthFromEdges()
416 \anchor tui_projection
417 <h3>Projection Algorithms</h3>
420 # Project prisms from one meshed box to another mesh on the same box
426 # Create a parallelepiped
427 box = geompy.MakeBoxDXDYDZ(200, 100, 70)
428 geompy.addToStudy( box, "box" )
430 # Get geom faces to mesh with triangles in the 1ts and 2nd meshes
431 faces = geompy.SubShapeAll(box, geompy.ShapeType["FACE"])
432 # 2 adjacent faces of the box
435 # face opposite to f2
438 # Get vertices used to specify how to associate sides of faces at projection
439 [v1F1, v2F1] = geompy.SubShapeAll(f1, geompy.ShapeType["VERTEX"])[:2]
440 [v1F2, v2F2] = geompy.SubShapeAll(f2, geompy.ShapeType["VERTEX"])[:2]
441 geompy.addToStudyInFather( box, v1F1, "v1F1" )
442 geompy.addToStudyInFather( box, v2F1, "v2F1" )
443 geompy.addToStudyInFather( box, v1F2, "v1F2" )
444 geompy.addToStudyInFather( box, v2F2, "v2F2" )
446 # Make group of 3 edges of f1 and f2
447 edgesF1 = geompy.CreateGroup(f1, geompy.ShapeType["EDGE"])
448 geompy.UnionList( edgesF1, geompy.SubShapeAll(f1, geompy.ShapeType["EDGE"])[:3])
449 edgesF2 = geompy.CreateGroup(f2, geompy.ShapeType["EDGE"])
450 geompy.UnionList( edgesF2, geompy.SubShapeAll(f2, geompy.ShapeType["EDGE"])[:3])
451 geompy.addToStudyInFather( box, edgesF1, "edgesF1" )
452 geompy.addToStudyInFather( box, edgesF2, "edgesF2" )
455 # Make the source mesh with prisms
456 src_mesh = Mesh(box, "Source mesh")
457 src_mesh.Segment().NumberOfSegments(9,10)
458 src_mesh.Quadrangle()
459 src_mesh.Hexahedron()
460 src_mesh.Triangle(f1) # triangular sumbesh
464 # Mesh the box using projection algoritms
466 # Define the same global 1D and 2D hypotheses
467 tgt_mesh = Mesh(box, "Target mesh")
468 tgt_mesh.Segment().NumberOfSegments(9,10,UseExisting=True)
469 tgt_mesh.Quadrangle()
471 # Define Projection 1D algorithm to project 1d mesh elements from group edgesF2 to edgesF1
472 # It is actually not needed, just a demonstration
473 proj1D = tgt_mesh.Projection1D( edgesF1 )
474 # each vertex must be at the end of a connected group of edges (or a sole edge)
475 proj1D.SourceEdge( edgesF2, src_mesh, v2F1, v2F2 )
477 # Define 2D hypotheses to project triangles from f1 face of the source mesh to
478 # f2 face in the target mesh. Vertices specify how to associate sides of faces
479 proj2D = tgt_mesh.Projection2D( f2 )
480 proj2D.SourceFace( f1, src_mesh, v1F1, v1F2, v2F1, v2F2 )
482 # 2D hypotheses to project triangles from f2 of target mesh to the face opposite to f2.
483 # Association of face sides is default
484 proj2D = tgt_mesh.Projection2D( f2opp )
485 proj2D.SourceFace( f2 )
487 # 3D hypotheses to project prisms from the source to the target mesh
488 proj3D = tgt_mesh.Projection3D()
489 proj3D.SourceShape3D( box, src_mesh, v1F1, v1F2, v2F1, v2F2 )
492 # Move the source mesh to visualy compare the two meshes
493 src_mesh.TranslateObject( src_mesh, MakeDirStruct( 210, 0, 0 ), Copy=False)
497 <h3>Projection 1D2D</h3>
500 # Project triangles from one meshed face to another mesh on the same box
507 box = geompy.MakeBoxDXDYDZ(100, 100, 100)
509 # Get geom faces to mesh with triangles in the 1ts and 2nd meshes
510 faces = geompy.SubShapeAll(box, geompy.ShapeType["FACE"])
511 # 2 adjacent faces of the box
515 geompy.addToStudy( box, 'box' )
516 geompy.addToStudyInFather( box, Face_1, 'Face_1' )
517 geompy.addToStudyInFather( box, Face_2, 'Face_2' )
519 # Make the source mesh with Netgem2D
520 src_mesh = Mesh(Face_1, "Source mesh")
521 src_mesh.Segment().NumberOfSegments(15)
525 # Mesh the target mesh using the algoritm Projection1D2D
526 tgt_mesh = smesh.Mesh(Face_2, "Target mesh")
527 tgt_mesh.Projection1D2D().SourceFace(Face_1,src_mesh)
533 \anchor tui_fixed_points
535 <h2>1D Mesh with Fixed Points example</h2>
543 # Create face and explode it on edges
544 face = geompy.MakeFaceHW(100, 100, 1)
545 edges = geompy.SubShapeAllSorted(face, geompy.ShapeType["EDGE"])
546 geompy.addToStudy( face, "Face" )
548 # get the first edge from exploded result
549 edge1 = geompy.GetSubShapeID(face, edges[0])
551 # Define Mesh on previously created face
552 Mesh_1 = smesh.Mesh(face)
554 # Create Fixed Point 1D hypothesis and define parameters.
555 # Note: values greater than 1.0 and less than 0.0 are not taken into account;
556 # duplicated values are removed. Also, if not specified explicitly, values 0.0 and 1.0
557 # add added automatically.
558 # The number of segments should correspond to the number of points (NbSeg = NbPnt-1);
559 # extra values of segments splitting parameter are not taken into account,
560 # while missing values are considered to be equal to 1.
561 Fixed_points_1D_1 = smesh.CreateHypothesis('FixedPoints1D')
562 Fixed_points_1D_1.SetPoints( [ 1.1, 0.9, 0.5, 0.0, 0.5, -0.3 ] )
563 Fixed_points_1D_1.SetNbSegments( [ 3, 1, 2 ] )
564 Fixed_points_1D_1.SetReversedEdges( [edge1] )
566 # Add hypothesis to mesh and define 2D parameters
567 Mesh_1.AddHypothesis(Fixed_points_1D_1)
568 Regular_1D = Mesh_1.Segment()
569 Quadrangle_2D = Mesh_1.Quadrangle()
574 \anchor tui_radial_quadrangle
575 <h2> Radial Quadrangle 1D2D example </h2>
579 SetCurrentStudy(salome.myStudy)
581 # Create face from the wire and add to study
582 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])
583 geompy.addToStudy(Face,"Face")
584 edges = geompy.SubShapeAllSorted(Face, geompy.ShapeType["EDGE"])
585 circle, radius1, radius2 = edges
586 geompy.addToStudyInFather(Face, radius1,"radius1")
587 geompy.addToStudyInFather(Face, radius2,"radius2")
588 geompy.addToStudyInFather(Face, circle,"circle")
591 # Define geometry for mesh, and Radial Quadrange algorithm
592 mesh = smesh.Mesh(Face)
593 radial_Quad_algo = mesh.Quadrangle(algo=RADIAL_QUAD)
595 # The Radial Quadrange algorithm can work without any hypothesis
596 # In this case it uses "Default Nb of Segments" preferences parameter to discretize edges
599 # The Radial Quadrange uses global or local 1d hypotheses if it does
600 # not have its own hypotheses.
601 # Define global hypotheses to discretize radial edges and a local one for circular edge
602 global_Nb_Segments = mesh.Segment().NumberOfSegments(5)
603 local_Nb_Segments = mesh.Segment(circle).NumberOfSegments(10)
606 # Define own parameters of Radial Quadrange algorithm
607 radial_Quad_algo.NumberOfLayers( 4 )
611 \anchor tui_quadrangle_parameters
612 <h2>Quadrangle Parameters example 1 (meshing a face with 3 edges) </h2>
615 SetCurrentStudy(salome.myStudy)
617 # Get 1/4 part from the disk face.
618 Box_1 = geompy.MakeBoxDXDYDZ(100, 100, 100)
619 Disk_1 = geompy.MakeDiskR(100, 1)
620 Common_1 = geompy.MakeCommon(Disk_1, Box_1)
621 geompy.addToStudy( Disk_1, "Disk_1" )
622 geompy.addToStudy( Box_1, "Box_1" )
623 geompy.addToStudy( Common_1, "Common_1" )
625 # Set the Geometry for meshing
626 Mesh_1 = smesh.Mesh(Common_1)
629 # Define 1D hypothesis and compute the mesh
630 Regular_1D = Mesh_1.Segment()
631 Nb_Segments_1 = Regular_1D.NumberOfSegments(10)
632 Nb_Segments_1.SetDistrType( 0 )
634 # Create Quadrangle parameters and define the Base Vertex.
635 Quadrangle_2D = Mesh_1.Quadrangle().TriangleVertex( 8 )
640 <h2>Quadrangle Parameters example 2 (using different types) </h2>
646 # Make quadrangle face and explode it on edges.
647 Vertex_1 = geompy.MakeVertex(0, 0, 0)
648 Vertex_2 = geompy.MakeVertex(40, 0, 0)
649 Vertex_3 = geompy.MakeVertex(40, 30, 0)
650 Vertex_4 = geompy.MakeVertex(0, 30, 0)
651 Quadrangle_Face_1 = geompy.MakeQuad4Vertices(Vertex_1, Vertex_4, Vertex_3, Vertex_2)
652 [Edge_1,Edge_2,Edge_3,Edge_4] = geompy.SubShapeAllSorted(Quadrangle_Face_1, geompy.ShapeType["EDGE"])
653 geompy.addToStudy( Vertex_1, "Vertex_1" )
654 geompy.addToStudy( Vertex_2, "Vertex_2" )
655 geompy.addToStudy( Vertex_3, "Vertex_3" )
656 geompy.addToStudy( Vertex_4, "Vertex_4" )
657 geompy.addToStudy( Quadrangle_Face_1, "Quadrangle Face_1" )
658 geompy.addToStudyInFather( Quadrangle_Face_1, Edge_2, "Edge_2" )
660 # Set the Geometry for meshing
661 Mesh_1 = smesh.Mesh(Quadrangle_Face_1)
663 # Create Quadrangle parameters and
664 # define the Type as Quadrangle Preference
665 Quadrangle_Parameters_1 = smesh.CreateHypothesis('QuadrangleParams')
666 Quadrangle_Parameters_1.SetQuadType( StdMeshers.QUAD_QUADRANGLE_PREF )
668 # Define other hypotheses and algorithms
669 Regular_1D = Mesh_1.Segment()
670 Nb_Segments_1 = Regular_1D.NumberOfSegments(4)
671 Nb_Segments_1.SetDistrType( 0 )
672 status = Mesh_1.AddHypothesis(Quadrangle_Parameters_1)
673 Quadrangle_2D = Mesh_1.Quadrangle()
675 # Define submesh on one edge to provide different number of segments
676 Regular_1D_1 = Mesh_1.Segment(geom=Edge_2)
677 Nb_Segments_2 = Regular_1D_1.NumberOfSegments(10)
678 Nb_Segments_2.SetDistrType( 0 )
679 SubMesh_1 = Regular_1D_1.GetSubMesh()
681 # Compute mesh (with Quadrangle Preference type)
682 isDone = Mesh_1.Compute()
684 # Change type to Reduced and compute again
685 Quadrangle_Parameters_1.SetQuadType( StdMeshers.QUAD_REDUCED )
686 isDone = Mesh_1.Compute()
690 <h2>"Use Existing Elements" example </h2>
694 SetCurrentStudy(salome.myStudy)
696 # Make a patritioned box
698 box = geompy.MakeBoxDXDYDZ(100,100,100)
700 N = geompy.MakeVectorDXDYDZ( 1,0,0 )
701 O = geompy.MakeVertex( 50,0,0 )
702 plane = geompy.MakePlane( O, N, 200 ) # plane YOZ
704 shape2boxes = geompy.MakeHalfPartition( box, plane )
705 boxes = geompy.SubShapeAllSorted(shape2boxes, geompy.ShapeType["SOLID"])
707 geompy.addToStudy( boxes[0], "boxes[0]")
708 geompy.addToStudy( boxes[1], "boxes[1]")
709 midFace0 = geompy.SubShapeAllSorted(boxes[0], geompy.ShapeType["FACE"])[5]
710 geompy.addToStudyInFather( boxes[0], midFace0, "middle Face")
711 midFace1 = geompy.SubShapeAllSorted(boxes[1], geompy.ShapeType["FACE"])[0]
712 geompy.addToStudyInFather( boxes[1], midFace1, "middle Face")
714 # Mesh one of boxes with quadrangles. It is a source mesh
716 srcMesh = Mesh(boxes[0], "source mesh") # box coloser to CS origin
717 nSeg1 = srcMesh.Segment().NumberOfSegments(4)
720 srcFaceGroup = srcMesh.GroupOnGeom( midFace0, "src faces", FACE )
722 # Import faces from midFace0 to the target mesh
724 tgtMesh = Mesh(boxes[1], "target mesh")
725 importAlgo = tgtMesh.UseExisting2DElements(midFace1)
726 import2hyp = importAlgo.SourceFaces( [srcFaceGroup] )
727 tgtMesh.Segment().NumberOfSegments(3)
731 # Import the whole source mesh with groups
732 import2hyp.SetCopySourceMesh(True,True)
736 \anchor tui_viscous_layers
737 <h2>Viscous layers construction</h2>
741 SetCurrentStudy(salome.myStudy)
743 X = geompy.MakeVectorDXDYDZ( 1,0,0 )
744 O = geompy.MakeVertex( 100,50,50 )
745 plane = geompy.MakePlane( O, X, 200 ) # plane YZ
747 box = geompy.MakeBoxDXDYDZ(200,100,100)
749 shape = geompy.MakeHalfPartition( box, plane )
751 faces = geompy.SubShapeAllSorted(shape, geompy.ShapeType["FACE"])
753 ignoreFaces = [ faces[0], faces[-1]]
755 geompy.addToStudy( shape, "shape" )
756 geompy.addToStudyInFather( shape, face1, "face1")
759 mesh = Mesh(shape, "CFD")
761 mesh.Segment().NumberOfSegments( 4 )
764 mesh.Quadrangle(face1)
766 algo3D = mesh.Tetrahedron()
771 layersHyp = algo3D.ViscousLayers(thickness,numberOfLayers,stretchFactor,ignoreFaces)
775 mesh.MakeGroup("Tetras",VOLUME,FT_ElemGeomType,"=",Geom_TETRA)
776 mesh.MakeGroup("Pyras",VOLUME,FT_ElemGeomType,"=",Geom_PYRAMID)
777 mesh.MakeGroup("Prims",VOLUME,FT_ElemGeomType,"=",Geom_PENTA)