From 0f9ed6f02c1e57730c871370ee2ec04a1f417593 Mon Sep 17 00:00:00 2001 From: eap Date: Fri, 8 Jul 2016 22:22:13 +0300 Subject: [PATCH] Minor doc changes + fix meshing progress (SMESH_subMesh.cxx) --- doc/salome/gui/SMESH/images/topo_equality.png | Bin 0 -> 2618 bytes .../SMESH/input/constructing_submeshes.doc | 14 ++++++- doc/salome/gui/SMESH/input/prism_3d_algo.doc | 36 ++++++++++++------ .../gui/SMESH/input/projection_algos.doc | 31 +++++++++++---- src/SMESH/SMESH_subMesh.cxx | 3 +- src/SMESHUtils/SMESH_MeshAlgos.cxx | 2 + 6 files changed, 65 insertions(+), 21 deletions(-) create mode 100644 doc/salome/gui/SMESH/images/topo_equality.png diff --git a/doc/salome/gui/SMESH/images/topo_equality.png b/doc/salome/gui/SMESH/images/topo_equality.png new file mode 100644 index 0000000000000000000000000000000000000000..119251a3151cc8c65c667272b71aa1d2c0c03fc8 GIT binary patch literal 2618 zcmZvecT^MB7spu@umY7K7zijbWEEs9G84oE2`jQ9L1vh;mrxLD*a9*VK&GOA%m4w@ zVhl8lgiU3|2*@->NB~8K*mzERdiwkIk2mf;_rCkiJNJFhC*1~SA#faUoP&cy0CE*< z$HBp=$=*Na<6_S?Evq#4!X0h~f%Eb4Q5UTj*d~9-Rp)Sa_%wT@bNc-B;UU{cgMdxp zF{K}A!wyt^iDL`uhTT$%;;-D2qKx@9&}N&rjlPYvIZGrib2OOfGE}z`{Kl$+{W<05n{)(Q5 znfzn?of^_E_y1W~p_5WZXU-<~LR9}Lgk#|6F&@}TgbV%PQWWPIxG^H}E7j*>8W`*q z5=HHg!@&e=+G0uH^Z`D51iDq-B-d>fyZcT1g0KTo3aj^7U3o7l5IWjo-RAjQgxk%; za}YY6n%OCmh27LMdpzE1Af@gt8x|!Qwc9A6ZmhNj;+0T;fBu`LUqkS_085d91;3qQ zP!?9^nDrmquB(jCtaq<@7d`8+Vwr%YlJt z|AaetdM<>LB4RPydi*Jkt7K#qEe@QivMYd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n$K8!I49gyhwE*G90fKaQ3PJ!V->tjb%% zh^2}Sr8!6qy~tTlpj-b6T(wKH9*)kHD$7h`5W43zs1KK&F@$o_Si6%itQsfB77J@va@=y>PwzofGC$Wd6{4Szzdys$}ID z`>c*CJORX#`|ONcZAZ5`@C+=0z;{r}D^7q8^(f|j86R$@_S%Xf&YP+
  • In Geometry module, via New Entity > Explode menu.
  • @@ -27,6 +31,8 @@ in one of the following ways:
      dialog showing \ref meshing_failed_anchor "meshing errors".
    +\section submesh_priority How hypotheses are selected among sub-meshes + Internally, definition of meshing parameters to apply for discretization of a certain sub-shape, for example an edge of a compound of solids, starts from searching an algorithm, 1D as for the @@ -62,6 +68,8 @@ an edge, the hypothesis assigned to a sub-shape with a lower ID will be used for meshing. You can \ref submesh_order_anchor "change" mutual priority of such concurrent sub-meshes. +\section submesh_definition How to construct a sub-mesh + \n Construction of a sub-mesh consists of:
    • Selecting a mesh which will encapsulate the sub-mesh
    • @@ -123,6 +131,8 @@ ID in Element ID field. with which the sub-shape will appear in the Object Browser (if not yet there). +\section submesh_tree Sub-mesh in the Object Browser + In the Object Browser the structure of the new sub-mesh will be displayed as follows: @@ -133,9 +143,9 @@ It contains:
    • a sub-mesh name (\a SubMeshFace1)
    • a reference to the geometrical object on the basis of which the sub-mesh has been constructed (Cylindrical Face_1);
    • -
    • Applied hypotheses folder containing the references to the +
    • Applied hypotheses folder containing references to hypotheses assigned to the sub-mesh;
    • -
    • Applied algorithms folder containing the references to the +
    • Applied algorithms folder containing references to algorithms assigned to the sub-mesh.
    diff --git a/doc/salome/gui/SMESH/input/prism_3d_algo.doc b/doc/salome/gui/SMESH/input/prism_3d_algo.doc index 71ba2a912..5f98399c7 100644 --- a/doc/salome/gui/SMESH/input/prism_3d_algo.doc +++ b/doc/salome/gui/SMESH/input/prism_3d_algo.doc @@ -49,21 +49,35 @@ The \b Local algorithms and hypotheses to be chosen at \ref constructing_submeshes_page "Construction of sub-meshes" are:
    • 1D and 2D algorithms and hypotheses that will be applied for - meshing the top and the base prism faces. These faces can be meshed + meshing the top and the base prism + \ref submesh_shape_section "faces". These faces can be meshed with any type of 2D elements: quadrangles, triangles, polygons or - their mix. It is enough to define a sub-mesh on either the top or the base - face. In the sample picture above, "NETGEN_1D2D" algorithm meshes - "bottom disk" face with triangles. (1D algorithm is not - assigned as "NETGEN_1D2D" does not require divided edges to create a 2D mesh.) + their mix. It is enough to define a sub-mesh on either the top or + the base face. In the sample picture above, "NETGEN_1D2D" + algorithm meshes "bottom disk" face with triangles. (1D algorithm + is not assigned as "NETGEN_1D2D" does not require divided edges to + create a 2D mesh.)
    • -
    • Optionally you can define a 1D sub-mesh on some vertical edges - of stacked prisms, which will override the global 1D hypothesis mentioned - above. In the Prism stacks picture, the - vertical division is not equidistant on the whole length because - a "Number Of Segments" hypothesis with Scale Factor=3 is assigned to - the highlighted edge. +
    • Optionally you can define a 1D sub-mesh on some vertical + \ref submesh_shape_section "edges" of stacked prisms, which will + override the global 1D hypothesis mentioned above. In the Prism + stacks picture, the vertical division is not equidistant on + the whole length because a "Number Of Segments" hypothesis with + Scale Factor=3 is assigned to the highlighted edge.
    +If 3D extrusion algorithm is assigned to a sub-mesh in a mesh +with multiple sub-meshes, the described above approach may not work as +expected. For example the bottom face may be meshed by other algorithm +before 3D extrusion have a chance to project a mesh from the +base face. This thing can happen with vertical edges as well. All +these can lead to either a meshing failure or to an incorrect meshing. + +In such a case, it's necessary to explicitly define algorithms +that 3D extrusion implicitly applies in a simple case: +- assign \ref projection_1D2D algorithm to the top face and +- assign a 1D algorithm to a group of all vertical edges. + \image html image157.gif "Prism with 3D extrusion meshing. Vertical division is different on neighbor edges because several local 1D hypotheses are assigned." \sa a sample TUI Script of diff --git a/doc/salome/gui/SMESH/input/projection_algos.doc b/doc/salome/gui/SMESH/input/projection_algos.doc index 4e5b6e90d..de11a7ee0 100644 --- a/doc/salome/gui/SMESH/input/projection_algos.doc +++ b/doc/salome/gui/SMESH/input/projection_algos.doc @@ -2,9 +2,20 @@ \page projection_algos_page Projection Algorithms -\n Projection algorithms allow to define the mesh of a geometrical +\tableofcontents + +Projection algorithms allow to define the mesh of a geometrical object by the projection of another already meshed geometrical object. +\note Source and target geometrical objects mush be topologically +equal, i.e. they must have same number of sub-shapes, connected to +corresponding counterparts. + +\image html topo_equality.png Topologically equal faces suitable for 2D projection. + + +\section projection_1D Projection 1D + Projection 1D algorithm allows to define the mesh of an edge (or group of edges) by the projection of another already meshed edge (or group of edges). @@ -34,6 +45,8 @@ vertices are specified, the edges in the group must be connected. The source and target groups must contain equal number of edges and they must form topologically equal structures. +\section projection_2D Projection 2D + \n Projection 2D algorithm allows to define the mesh of a face (or group of faces) by the projection of another already meshed face (or group of faces). This algorithm works only if all edges of the @@ -64,12 +77,16 @@ The groups of faces are suitable for this algorithm only if they contain an equal number of faces and form topologically equal structures. -\n Projection 1D-2D algorithm differs from Projection 2D -algorithm in one aspect: it generates mesh segments on edges of -the face according to the projected 2D elements; thus it does not -require the edges to be meshed by any other 1D algorithm; moreover it -does not allow to mesh edges of the face using another algorithm via -definition of sub-meshes. +\section projection_1D2D Projection 1D-2D + +\n Projection 1D-2D algorithm differs from +\ref projection_2D algorithm in one aspect: it generates mesh segments +on edges of the face according to the projected 2D elements; thus it +does not require the edges to be meshed by any other 1D algorithm; +moreover it does not allow to mesh edges of the face using another +algorithm via definition of sub-meshes. + +\section projection_3D Projection 3D \n Projection 3D algorithm allows to define the mesh of a shape by the projection of another already meshed shape. This algorithm works diff --git a/src/SMESH/SMESH_subMesh.cxx b/src/SMESH/SMESH_subMesh.cxx index 5bb8a34b3..128316dcf 100644 --- a/src/SMESH/SMESH_subMesh.cxx +++ b/src/SMESH/SMESH_subMesh.cxx @@ -2079,10 +2079,10 @@ TopoDS_Shape SMESH_subMesh::getCollection(SMESH_Gen * theGen, const TopoDS_Shape& S = subMesh->_subShape; if ( S.ShapeType() != this->_subShape.ShapeType() ) continue; - theSubs.push_back( subMesh ); if ( subMesh == this ) { aBuilder.Add( aCompound, S ); + theSubs.push_back( subMesh ); } else if ( subMesh->GetComputeState() == READY_TO_COMPUTE ) { @@ -2093,6 +2093,7 @@ TopoDS_Shape SMESH_subMesh::getCollection(SMESH_Gen * theGen, aBuilder.Add( aCompound, S ); if ( !subMesh->SubMeshesComputed() ) theSubComputed = false; + theSubs.push_back( subMesh ); } } } diff --git a/src/SMESHUtils/SMESH_MeshAlgos.cxx b/src/SMESHUtils/SMESH_MeshAlgos.cxx index aa702977d..e65e20114 100644 --- a/src/SMESHUtils/SMESH_MeshAlgos.cxx +++ b/src/SMESHUtils/SMESH_MeshAlgos.cxx @@ -1252,6 +1252,7 @@ bool SMESH_MeshAlgos::IsOut( const SMDS_MeshElement* element, const gp_Pnt& poin bool covexCorner = ( edgeNorm * edgeAdjacent * (rClosest==1. ? 1. : -1.)) < 0; return covexCorner ? (out || out2) : (out && out2); } + if ( element->GetType() == SMDSAbs_Edge ) // -------------------------------------------------- { // point is out of edge if it is NOT ON any straight part of edge @@ -1279,6 +1280,7 @@ bool SMESH_MeshAlgos::IsOut( const SMDS_MeshElement* element, const gp_Pnt& poin } return true; } + // Node or 0D element ------------------------------------------------------------------------- { gp_Vec n2p ( xyz[0], point ); -- 2.30.2