From 131ded7390efc5172a382e6731b15d24b531963e Mon Sep 17 00:00:00 2001 From: eap Date: Fri, 7 Nov 2014 16:51:28 +0300 Subject: [PATCH] More info --- doc/salome/examples/CMakeLists.txt | 14 +++-- .../examples/a3DmeshOnModified2Dmesh.py | 62 +++++++++++++++++++ doc/salome/examples/prism_3d_algo.py | 11 +++- doc/salome/gui/SMESH/input/about_meshes.doc | 50 ++------------- .../gui/SMESH/input/basic_meshing_algos.doc | 4 +- .../gui/SMESH/input/constructing_meshes.doc | 28 ++++++++- .../gui/SMESH/input/modifying_meshes.doc | 5 ++ .../gui/SMESH/input/pattern_mapping.doc | 33 ++++++---- .../gui/SMESH/input/tui_creating_meshes.doc | 5 ++ 9 files changed, 141 insertions(+), 71 deletions(-) create mode 100644 doc/salome/examples/a3DmeshOnModified2Dmesh.py diff --git a/doc/salome/examples/CMakeLists.txt b/doc/salome/examples/CMakeLists.txt index 227764998..7aa063689 100644 --- a/doc/salome/examples/CMakeLists.txt +++ b/doc/salome/examples/CMakeLists.txt @@ -17,8 +17,10 @@ # See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com # +# examples that cant be used for testing because they use external mesher plug-ins SET(BAD_TESTS 3dmesh.py + a3DmeshOnModified2Dmesh.py creating_meshes_ex01.py creating_meshes_ex03.py creating_meshes_ex05.py @@ -39,14 +41,14 @@ SET(BAD_TESTS quality_controls_ex20.py quality_controls_ex21.py quality_controls_ex22.py - viewing_meshes_ex01.py -) + viewing_meshes_ex01.py + ) SET(GOOD_TESTS - cartesian_algo.py - creating_meshes_ex02.py - creating_meshes_ex04.py - creating_meshes_ex06.py + cartesian_algo.py + creating_meshes_ex02.py + creating_meshes_ex04.py + creating_meshes_ex06.py creating_meshes_ex07.py creating_meshes_ex08.py defining_hypotheses_ex01.py diff --git a/doc/salome/examples/a3DmeshOnModified2Dmesh.py b/doc/salome/examples/a3DmeshOnModified2Dmesh.py new file mode 100644 index 000000000..7fcdcaca8 --- /dev/null +++ b/doc/salome/examples/a3DmeshOnModified2Dmesh.py @@ -0,0 +1,62 @@ +import salome +salome.salome_init() + +from salome.geom import geomBuilder +geompy = geomBuilder.New(salome.myStudy) + +# This script demonstrates generation of 3D mesh basing on a modified 2D mesh +# +# Purpose is to get a tetrahedral mesh in a sphere cut by a cube. +# The requirement is to have a surface mesh on the cube comprised of +# triangles of exactly the same size arranged in a grid pattern. +# +# To fulfill this requirement we mesh the box using Quadrangle (Mapping) +# meshing algorithm, split quadrangles into triangles and then generate +# tetrahedrons. + + +# Make the geometry + +Box_1 = geompy.MakeBox(-100,-100,-100, 100, 100, 100) +Sphere_1 = geompy.MakeSphereR( 300 ) +Cut_1 = geompy.MakeCut(Sphere_1, Box_1, theName="Cut_1") +# get a spherical face +Sph_Face = geompy.ExtractShapes( Sphere_1, geompy.ShapeType["FACE"] )[0] + +# get the shape Sph_Face turned into during MakeCut() +Sph_Face = geompy.GetInPlace(Cut_1, Sph_Face, isNewImplementation=True, theName="Sphere_1") + + +# 1) Define a mesh with 1D and 2D meshers + +import SMESH +from salome.smesh import smeshBuilder +smesh = smeshBuilder.New(salome.myStudy) + +Mesh_1 = smesh.Mesh(Cut_1) + +# "global" meshers (assigned to Cut_1) that will be used for the box +Regular_1D = Mesh_1.Segment() +Local_Length_1 = Regular_1D.LocalLength(20) +Quadrangle_2D = Mesh_1.Quadrangle() + +# a "local" mesher (assigned to a sub-mesh on Sphere_1) to mesh the sphere +algo_2D = Mesh_1.Triangle( smeshBuilder.NETGEN_1D2D, Sph_Face ) +algo_2D.SetMaxSize( 70. ) +algo_2D.SetFineness( smeshBuilder.Moderate ) +algo_2D.SetMinSize( 7. ) + +# 2) Compute 2D mesh +isDone = Mesh_1.Compute() + +# 3) Split quadrangles into triangles +isDone = Mesh_1.SplitQuadObject( Mesh_1, Diag13=True ) + +# 4) Define a 3D mesher +Mesh_1.Tetrahedron() + +# 5) Compute 3D mesh +Mesh_1.Compute() + +if salome.sg.hasDesktop(): + salome.sg.updateObjBrowser(1) diff --git a/doc/salome/examples/prism_3d_algo.py b/doc/salome/examples/prism_3d_algo.py index df18d0fcb..7be0a29d3 100644 --- a/doc/salome/examples/prism_3d_algo.py +++ b/doc/salome/examples/prism_3d_algo.py @@ -1,9 +1,14 @@ # Use 3D extrusion meshing algorithm -import salome, smesh, SMESH, geompy - +import salome salome.salome_init() -smesh.SetCurrentStudy( salome.myStudy ) + +from salome.geom import geomBuilder +geompy = geomBuilder.New(salome.myStudy) + +import SMESH +from salome.smesh import smeshBuilder +smesh = smeshBuilder.New(salome.myStudy) OX = geompy.MakeVectorDXDYDZ(1,0,0) OY = geompy.MakeVectorDXDYDZ(0,1,0) diff --git a/doc/salome/gui/SMESH/input/about_meshes.doc b/doc/salome/gui/SMESH/input/about_meshes.doc index 870e5c182..65201ac64 100644 --- a/doc/salome/gui/SMESH/input/about_meshes.doc +++ b/doc/salome/gui/SMESH/input/about_meshes.doc @@ -7,10 +7,12 @@ a set of entities with a simple topology. It is possible to \subpage constructing_meshes_page "construct meshes" on the basis of geometrical shapes produced in the GEOM module. -It is also possible to -\subpage constructing_submeshes_page "construct mesh on a part of the geometrical object", -for example, a face, with different meshing parameters or using -another meshing algorithm. +Construction of \subpage constructing_submeshes_page "sub-meshes" +allows to mesh parts of the geometrical object, for example a face, +with different meshing parameters or using another meshing algorithm +than other parts. + +3D mesh can be generated basing on a 2D closed mesh. Several created meshes can be \subpage building_compounds_page "combined into another mesh". @@ -62,44 +64,4 @@ described in the following way: coordinates of the corresponding vertex. -

Connections

- -Each mesh entity bounds 0 or more mesh entities of higher -dimension. In the same way each mesh entity is bounded by 0 or more -mesh entities of lower dimension: - - - -You can notice that there are two types of connections: \b inverse and -\b direct connections. - -

Inverse connections

- -This relationship has a particularity that the order of bounded -entities has not a direct meaning. Also the number of bounded entities -is not fixed. - -\b Example: The edges surrounding a node. The 3rd edge has no more -sense that the 5th one. - -

Direct connections

- -This relationship has a particularity that the order of bounding -entities is meaningful. The number of bounding entities is fixed and -depends on the type of the entity (hexahedron, tetrahedron,?). - -\b Example: An edge is composed of two nodes. A face is composed of 3 -or 4 edges depending if we are dealing with triangles or quadrangles. - -The connections are not only restricted to entities of one dimension -higher or lower. For example some algorithms may be interested to -retrieve all the faces surrounding a node. - */ diff --git a/doc/salome/gui/SMESH/input/basic_meshing_algos.doc b/doc/salome/gui/SMESH/input/basic_meshing_algos.doc index ee632b282..977b505db 100644 --- a/doc/salome/gui/SMESH/input/basic_meshing_algos.doc +++ b/doc/salome/gui/SMESH/input/basic_meshing_algos.doc @@ -52,15 +52,15 @@ geometrical objects. There is also a number of more specific algorithms: \ref constructing_meshes_page "Constructing meshes" page describes in diff --git a/doc/salome/gui/SMESH/input/constructing_meshes.doc b/doc/salome/gui/SMESH/input/constructing_meshes.doc index 232d4f524..5d26cae6c 100644 --- a/doc/salome/gui/SMESH/input/constructing_meshes.doc +++ b/doc/salome/gui/SMESH/input/constructing_meshes.doc @@ -9,6 +9,7 @@
  • \ref preview_anchor "Previewing the mesh" (optional)
  • \ref submesh_order_anchor "Changing sub-mesh priority" (optional)
  • \ref compute_anchor "Computing the mesh"
  • +
  • \ref edit_anchor "Editing the mesh" (optional)
  • \anchor create_mesh_anchor @@ -357,8 +358,29 @@ computation reporting. There are the following possibilities: always show the information box, show only if an error occurs or never. By default, the information box is always shown after mesh computation operation. -

    - - +

    +\anchor edit_anchor +

    Editing the mesh

    + +It is possible to \ref modifying_meshes_page "edit the mesh" of +lower dimension before generation of mesh of higher dimension. + +For example you can generate 2D mesh, modify it using e.g. +\ref pattern_mapping_page, and then generate 3D mesh basing on the +modified 2D mesh. The workflow is following: +- Define 1D and 2D meshing algorithms. +- Compute the mesh. 2D mesh is generated. +- Apply \ref pattern_mapping_page. +- Define 3D meshing algorithms without modifying 1D and 2D algorithms +and hypotheses. +- Compute the mesh. 3D mesh is generated. + +\note Nodes and elements added \ref adding_nodes_and_elements_page +"manually" can't be used in this workflow because the manually created +entities are not attached to any geometry and thus (usually) can't be +found by a mesher paving some geometry. + +See Also a sample TUI Script demonstrates the possibility of +\ref tui_editing_while_meshing "Intermediate edition while meshing" */ diff --git a/doc/salome/gui/SMESH/input/modifying_meshes.doc b/doc/salome/gui/SMESH/input/modifying_meshes.doc index 1bd0cc919..f09ab21d4 100755 --- a/doc/salome/gui/SMESH/input/modifying_meshes.doc +++ b/doc/salome/gui/SMESH/input/modifying_meshes.doc @@ -51,6 +51,11 @@ or vice versa.
  • \subpage cut_mesh_by_plane_page "Cut a tetrahedron mesh by a plane".
  • +It is possible to \ref edit_anchor "modify the mesh" of lower +dimension before generation of mesh of higher dimension. + +


    + \note It is possible to use the variables defined in the SALOME \b NoteBook to specify the numerical parameters used for modification of any object. diff --git a/doc/salome/gui/SMESH/input/pattern_mapping.doc b/doc/salome/gui/SMESH/input/pattern_mapping.doc index ef7f8ba66..969b9fc5e 100644 --- a/doc/salome/gui/SMESH/input/pattern_mapping.doc +++ b/doc/salome/gui/SMESH/input/pattern_mapping.doc @@ -14,7 +14,7 @@ The smp file contains 4 sections: -# The first line indicates the total number of pattern nodes (N). -# The next N lines describe nodes coordinates. Each line contains 2 -node coordinates for a 2D pattern or 3 node cordinates for a 3D pattern. +node coordinates for a 2D pattern or 3 node coordinates for a 3D pattern. Note, that node coordinates of a 3D pattern can be defined only by relative values in range [0;1]. -# The key-points line contains the indices of the nodes to be mapped on geometrical vertices (for a 2D pattern only). Index n refers to the node described @@ -89,7 +89,7 @@ An example of a simple 3D pattern smp file:

    Application of pattern mapping

    -To apply pattern mapping to a geometrical object: +To apply pattern mapping to a geometrical object or mesh elements: From the \b Modification menu choose the Pattern Mapping item or click "Pattern mapping" button in the toolbar. @@ -113,16 +113,17 @@ created manually or generated automatically from an existing mesh or submesh.
  • \b Vertex to which the first key-point should be mapped;
  • + Alternatively, it is possible to select Refine selected mesh elements -checkbox and apply the pattern to +check-box and apply the pattern to +Additionally it is possible to: \n For a 3D pattern @@ -133,21 +134,27 @@ In this dialog you should specify: Alternatively, it is possible to select Refine selected mesh elements checkbox and apply the pattern to + Additionally it is possible to: + -\n Automatic Generation +
    +

    Automatic Generation

    -To generate a pattern automatically from an existing mesh or submesh, +To generate a pattern automatically from an existing mesh or sub-mesh, click \b New button. The following dialog box will appear: diff --git a/doc/salome/gui/SMESH/input/tui_creating_meshes.doc b/doc/salome/gui/SMESH/input/tui_creating_meshes.doc index f1b12e4c4..984616457 100644 --- a/doc/salome/gui/SMESH/input/tui_creating_meshes.doc +++ b/doc/salome/gui/SMESH/input/tui_creating_meshes.doc @@ -18,6 +18,11 @@

    Change priority of submeshes in Mesh

    \tui_script{creating_meshes_ex03.py} +
    +\anchor tui_editing_while_meshing +

    Intermediate edition while meshing

    +\tui_script{a3DmeshOnModified2Dmesh.py} +
    \anchor tui_editing_mesh

    Editing a mesh

    -- 2.39.2