1 # Convert mesh to/from quadratic
6 # create sphere of radius 100
8 Sphere = geompy.MakeSphereR( 100 )
9 geompy.addToStudy( Sphere, "Sphere" )
11 # create simple trihedral mesh
13 Mesh = smesh.Mesh(Sphere)
14 Regular_1D = Mesh.Segment()
15 Nb_Segments = Regular_1D.NumberOfSegments(5)
16 MEFISTO_2D = Mesh.Triangle()
17 Tetrahedron = Mesh.Tetrahedron()
21 isDone = Mesh.Compute()
23 # convert to quadratic
24 # theForce3d = 1; this results in the medium node lying at the
25 # middle of the line segments connecting start and end node of a mesh
28 Mesh.ConvertToQuadratic( theForce3d=1 )
30 # revert back to the non-quadratic mesh
32 Mesh.ConvertFromQuadratic()
34 # convert to quadratic
35 # theForce3d = 0; this results in the medium node lying at the
36 # geometrical edge from which the mesh element is built
38 Mesh.ConvertToQuadratic( theForce3d=0 )
40 # to convert not the whole mesh but a sub-mesh, provide it as
41 # an additional argument to the functions:
42 # Mesh.ConvertToQuadratic( 0, subMesh )
43 # Mesh.ConvertFromQuadratic( subMesh )
45 # Note that the mesh becomes non-conformal at conversion of sub-mesh.