X-Git-Url: http://git.salome-platform.org/gitweb/?a=blobdiff_plain;f=doc%2Fsalome%2Fgui%2FSMESH%2Finput%2Ftui_defining_hypotheses.doc;h=bd399115b18c9c4badf5cbb08f50e92918a8ce5b;hb=eeed6dd569b3ba682202a9bb87562001ae5446ad;hp=1581e7c2fbb4f495a4d0719af05e136de7ec1cf5;hpb=d8f644ca3d4ce62f2ef41d4aacb52f5bb1221df3;p=modules%2Fsmesh.git diff --git a/doc/salome/gui/SMESH/input/tui_defining_hypotheses.doc b/doc/salome/gui/SMESH/input/tui_defining_hypotheses.doc index 1581e7c2f..bd399115b 100644 --- a/doc/salome/gui/SMESH/input/tui_defining_hypotheses.doc +++ b/doc/salome/gui/SMESH/input/tui_defining_hypotheses.doc @@ -2,11 +2,48 @@ \page tui_defining_hypotheses_page Defining Hypotheses and Algorithms +This page provides example codes of \ref tui_defining_meshing_algos +"defining algorithms" and hypotheses. + +
+

Defining 1D Hypotheses


\anchor tui_1d_arithmetic -

1D Arithmetic

+

Arithmetic 1D

\code import geompy @@ -231,7 +268,7 @@ tetra = smesh.Mesh(cyl, "Cylinder : tetrahedrical mesh") # assign algorithms algo1D = tetra.Segment() algo2D = tetra.Triangle() -algo3D = tetra.Tetrahedron(smesh.NETGEN) +algo3D = tetra.Tetrahedron() # assign 1D and 2D hypotheses algo1D.NumberOfSegments(7) @@ -363,8 +400,8 @@ algo1D = tetra.Segment() # create a Mefisto 2D algorithm for faces algo2D = tetra.Triangle() -# create a Netgen 3D algorithm for solids -algo3D = tetra.Tetrahedron(smesh.NETGEN) +# create a 3D algorithm for solids +algo3D = tetra.Tetrahedron() # define hypotheses algo1D.Arithmetic1D(1, 4) @@ -373,17 +410,6 @@ algo2D.LengthFromEdges() # compute the mesh tetra.Compute() -# 3. Create a tetrahedral mesh on the box with NETGEN_2D3D algorithm -tetraN = smesh.Mesh(box, "Box : tetrahedrical mesh by NETGEN_2D3D") - -# create a Netgen_2D3D algorithm for solids -algo3D = tetraN.Tetrahedron(smesh.FULL_NETGEN) - -# define hypotheses -n23_params = algo3D.Parameters() - -# compute the mesh -tetraN.Compute() \endcode
@@ -468,6 +494,40 @@ src_mesh.TranslateObject( src_mesh, MakeDirStruct( 210, 0, 0 ), Copy=False) \endcode +

Projection 1D2D

+ +\code +# Project triangles from one meshed face to another mesh on the same box + +from smesh import * + +# Prepare geometry + +# Create a box +box = geompy.MakeBoxDXDYDZ(100, 100, 100) + +# Get geom faces to mesh with triangles in the 1ts and 2nd meshes +faces = geompy.SubShapeAll(box, geompy.ShapeType["FACE"]) +# 2 adjacent faces of the box +Face_1 = faces[2] +Face_2 = faces[0] + +geompy.addToStudy( box, 'box' ) +geompy.addToStudyInFather( box, Face_1, 'Face_1' ) +geompy.addToStudyInFather( box, Face_2, 'Face_2' ) + +# Make the source mesh with Netgem2D +src_mesh = Mesh(Face_1, "Source mesh") +src_mesh.Segment().NumberOfSegments(15) +src_mesh.Triangle() +src_mesh.Compute() + +# Mesh the target mesh using the algoritm Projection1D2D +tgt_mesh = smesh.Mesh(Face_2, "Target mesh") +tgt_mesh.Projection1D2D().SourceFace(Face_1,src_mesh) +tgt_mesh.Compute() +\endcode +
\anchor tui_fixed_points @@ -673,10 +733,49 @@ import2hyp.SetCopySourceMesh(True,True) tgtMesh.Compute() \endcode -\n Other meshing algorithms: +\anchor tui_viscous_layers +

Viscous layers construction

+ +\code +from smesh import * +SetCurrentStudy(salome.myStudy) + +X = geompy.MakeVectorDXDYDZ( 1,0,0 ) +O = geompy.MakeVertex( 100,50,50 ) +plane = geompy.MakePlane( O, X, 200 ) # plane YZ + +box = geompy.MakeBoxDXDYDZ(200,100,100) + +shape = geompy.MakeHalfPartition( box, plane ) + +faces = geompy.SubShapeAllSorted(shape, geompy.ShapeType["FACE"]) +face1 = faces[1] +ignoreFaces = [ faces[0], faces[-1]] + +geompy.addToStudy( shape, "shape" ) +geompy.addToStudyInFather( shape, face1, "face1") + + +mesh = Mesh(shape, "CFD") + +mesh.Segment().NumberOfSegments( 4 ) + +mesh.Triangle() +mesh.Quadrangle(face1) +mesh.Compute() +algo3D = mesh.Tetrahedron() + +thickness = 20 +numberOfLayers = 10 +stretchFactor = 1.5 +layersHyp = algo3D.ViscousLayers(thickness,numberOfLayers,stretchFactor,ignoreFaces) + +mesh.Compute() + +mesh.MakeGroup("Tetras",VOLUME,FT_ElemGeomType,"=",Geom_TETRA) +mesh.MakeGroup("Pyras",VOLUME,FT_ElemGeomType,"=",Geom_PYRAMID) +mesh.MakeGroup("Prims",VOLUME,FT_ElemGeomType,"=",Geom_PENTA) + +\endcode - */