2013-02-12 20:37:44 +06:00
|
|
|
# Defining Meshing Algorithms
|
|
|
|
|
2013-04-04 13:08:19 +06:00
|
|
|
import salome
|
2021-08-12 14:38:10 +05:00
|
|
|
salome.salome_init_without_session()
|
2013-04-04 13:08:19 +06:00
|
|
|
import GEOM
|
|
|
|
from salome.geom import geomBuilder
|
2017-06-13 15:01:10 +05:00
|
|
|
geompy = geomBuilder.New()
|
2013-04-04 13:08:19 +06:00
|
|
|
|
|
|
|
import SMESH, SALOMEDS
|
|
|
|
from salome.smesh import smeshBuilder
|
2017-06-13 15:01:10 +05:00
|
|
|
smesh = smeshBuilder.New()
|
2013-02-12 20:37:44 +06:00
|
|
|
|
|
|
|
# create a box
|
|
|
|
box = geompy.MakeBoxDXDYDZ(10., 10., 10.)
|
|
|
|
geompy.addToStudy(box, "Box")
|
|
|
|
|
2016-03-21 17:03:25 +05:00
|
|
|
# Create a hexahedral mesh on the box
|
2013-02-12 20:37:44 +06:00
|
|
|
hexa = smesh.Mesh(box, "Box : hexahedrical mesh")
|
|
|
|
|
|
|
|
# create a Regular 1D algorithm for edges
|
|
|
|
algo1D = hexa.Segment()
|
|
|
|
|
|
|
|
# create a quadrangle 2D algorithm for faces
|
|
|
|
algo2D = hexa.Quadrangle()
|
|
|
|
|
|
|
|
# create a hexahedron 3D algorithm for solids
|
|
|
|
algo3D = hexa.Hexahedron()
|
|
|
|
|
|
|
|
# define hypotheses
|
|
|
|
algo1D.Arithmetic1D(1, 4)
|
|
|
|
|
|
|
|
# compute the mesh
|
|
|
|
hexa.Compute()
|
|
|
|
|
|
|
|
# 2. Create a tetrahedral mesh on the box
|
|
|
|
tetra = smesh.Mesh(box, "Box : tetrahedrical mesh")
|
|
|
|
|
|
|
|
# create a Regular 1D algorithm for edges
|
|
|
|
algo1D = tetra.Segment()
|
|
|
|
|
|
|
|
# create a Mefisto 2D algorithm for faces
|
|
|
|
algo2D = tetra.Triangle()
|
|
|
|
|
|
|
|
# create a 3D algorithm for solids
|
|
|
|
algo3D = tetra.Tetrahedron()
|
|
|
|
|
|
|
|
# define hypotheses
|
|
|
|
algo1D.Arithmetic1D(1, 4)
|
|
|
|
algo2D.LengthFromEdges()
|
|
|
|
|
|
|
|
# compute the mesh
|
|
|
|
tetra.Compute()
|