mirror of
https://git.salome-platform.org/gitpub/modules/smesh.git
synced 2025-01-13 02:00:34 +05:00
add two salome tests for penta18
This commit is contained in:
parent
0cba9cf88f
commit
8a7a11a6fb
43
doc/salome/examples/create_penta_biquad.py
Normal file
43
doc/salome/examples/create_penta_biquad.py
Normal file
@ -0,0 +1,43 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
|
||||
import sys
|
||||
import salome
|
||||
|
||||
salome.salome_init()
|
||||
theStudy = salome.myStudy
|
||||
|
||||
import SMESH, SALOMEDS
|
||||
from salome.smesh import smeshBuilder
|
||||
|
||||
smesh = smeshBuilder.New(theStudy)
|
||||
unPentaBiQuad = smesh.Mesh()
|
||||
nodeID = unPentaBiQuad.AddNode( 0, 0, 0 )
|
||||
nodeID = unPentaBiQuad.AddNode( 10, 0, 0 )
|
||||
nodeID = unPentaBiQuad.AddNode( 0, 10, 0 )
|
||||
nodeID = unPentaBiQuad.AddNode( 0, 0, 10 )
|
||||
nodeID = unPentaBiQuad.AddNode( 10, 0, 10 )
|
||||
nodeID = unPentaBiQuad.AddNode( 0, 10, 10 )
|
||||
nodeID = unPentaBiQuad.AddNode( 5, 0, 0 )
|
||||
nodeID = unPentaBiQuad.AddNode( 7, 7, 0 )
|
||||
nodeID = unPentaBiQuad.AddNode( 0, 5, 0 )
|
||||
nodeID = unPentaBiQuad.AddNode( 5, 0, 10 )
|
||||
nodeID = unPentaBiQuad.AddNode( 7, 7, 10 )
|
||||
nodeID = unPentaBiQuad.AddNode( 0, 5, 10 )
|
||||
nodeID = unPentaBiQuad.AddNode( 0, 0, 5 )
|
||||
nodeID = unPentaBiQuad.AddNode( 10, 0, 5 )
|
||||
nodeID = unPentaBiQuad.AddNode( 0, 10, 5 )
|
||||
nodeID = unPentaBiQuad.AddNode( 5, -1, 5 )
|
||||
nodeID = unPentaBiQuad.AddNode( 8, 8, 5 )
|
||||
nodeID = unPentaBiQuad.AddNode( -1, 5, 5 )
|
||||
volID = unPentaBiQuad.AddVolume( [ 4, 5, 6, 1, 2, 3, 10, 11, 12, 7, 8, 9, 13, 14, 15, 16, 17, 18 ] )
|
||||
|
||||
infos = unPentaBiQuad.GetMeshInfo()
|
||||
print "Number of biquadratic pentahedrons:", infos[SMESH.Entity_BiQuad_Penta]
|
||||
if (infos[SMESH.Entity_BiQuad_Penta] != 1):
|
||||
raise RuntimeError("Bad number of biquadratic pentahedrons: should be 1")
|
||||
|
||||
## Set names of Mesh objects
|
||||
smesh.SetName(unPentaBiQuad.GetMesh(), 'unPentaBiQuad')
|
||||
|
||||
if salome.sg.hasDesktop():
|
||||
salome.sg.updateObjBrowser(True)
|
55
doc/salome/examples/extrusion_penta_biquad.py
Normal file
55
doc/salome/examples/extrusion_penta_biquad.py
Normal file
@ -0,0 +1,55 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
|
||||
import sys
|
||||
import salome
|
||||
|
||||
salome.salome_init()
|
||||
theStudy = salome.myStudy
|
||||
|
||||
import GEOM
|
||||
from salome.geom import geomBuilder
|
||||
import math
|
||||
import SALOMEDS
|
||||
|
||||
geompy = geomBuilder.New(theStudy)
|
||||
|
||||
O = geompy.MakeVertex(0, 0, 0)
|
||||
OX = geompy.MakeVectorDXDYDZ(1, 0, 0)
|
||||
OY = geompy.MakeVectorDXDYDZ(0, 1, 0)
|
||||
OZ = geompy.MakeVectorDXDYDZ(0, 0, 1)
|
||||
Divided_Disk_1 = geompy.MakeDividedDisk(100, 1, GEOM.SQUARE)
|
||||
geompy.addToStudy( O, 'O' )
|
||||
geompy.addToStudy( OX, 'OX' )
|
||||
geompy.addToStudy( OY, 'OY' )
|
||||
geompy.addToStudy( OZ, 'OZ' )
|
||||
geompy.addToStudy( Divided_Disk_1, 'Divided Disk_1' )
|
||||
|
||||
import SMESH, SALOMEDS
|
||||
from salome.smesh import smeshBuilder
|
||||
|
||||
smesh = smeshBuilder.New(theStudy)
|
||||
aFilterManager = smesh.CreateFilterManager()
|
||||
Mesh_1 = smesh.Mesh(Divided_Disk_1)
|
||||
Regular_1D = Mesh_1.Segment()
|
||||
Number_of_Segments_1 = Regular_1D.NumberOfSegments(6)
|
||||
Quadrangle_2D = Mesh_1.Quadrangle(algo=smeshBuilder.QUADRANGLE)
|
||||
isDone = Mesh_1.Compute()
|
||||
aMaxElementLength2D0x5d7fdf0 = aFilterManager.CreateMaxElementLength2D()
|
||||
isDone = Mesh_1.QuadToTriObject( Mesh_1, )
|
||||
Mesh_1.ExtrusionSweepObjects( [ Mesh_1 ], [ Mesh_1 ], [ Mesh_1 ], [ 0, 0, 50 ], 3, 1 )
|
||||
Mesh_1.ConvertToQuadratic(0, Mesh_1,True)
|
||||
|
||||
infos = Mesh_1.GetMeshInfo()
|
||||
print "Number of biquadratic pentahedrons:", infos[SMESH.Entity_BiQuad_Penta]
|
||||
if (infos[SMESH.Entity_BiQuad_Penta] != 1080):
|
||||
raise RuntimeError("Bad number of biquadratic pentahedrons: should be 1080")
|
||||
|
||||
## Set names of Mesh objects
|
||||
smesh.SetName(Regular_1D.GetAlgorithm(), 'Regular_1D')
|
||||
smesh.SetName(Quadrangle_2D.GetAlgorithm(), 'Quadrangle_2D')
|
||||
smesh.SetName(Number_of_Segments_1, 'Number of Segments_1')
|
||||
smesh.SetName(Mesh_1.GetMesh(), 'Mesh_1')
|
||||
|
||||
|
||||
if salome.sg.hasDesktop():
|
||||
salome.sg.updateObjBrowser(True)
|
@ -46,6 +46,7 @@ SET(BAD_TESTS
|
||||
|
||||
SET(GOOD_TESTS
|
||||
cartesian_algo.py
|
||||
create_penta_biquad.py
|
||||
creating_meshes_ex02.py
|
||||
creating_meshes_ex04.py
|
||||
creating_meshes_ex06.py
|
||||
@ -66,6 +67,7 @@ SET(GOOD_TESTS
|
||||
defining_hypotheses_ex15.py
|
||||
defining_hypotheses_ex16.py
|
||||
defining_hypotheses_adaptive1d.py
|
||||
extrusion_penta_biquad.py
|
||||
filters_ex01.py
|
||||
filters_ex03.py
|
||||
filters_ex04.py
|
||||
|
Loading…
Reference in New Issue
Block a user