From: eap Date: Wed, 16 Mar 2016 16:59:08 +0000 (+0300) Subject: IPAL53051: 3D Extrusion fails X-Git-Tag: V7_8_0a2~4^2~14 X-Git-Url: http://git.salome-platform.org/gitweb/?p=modules%2Fsmesh.git;a=commitdiff_plain;h=a695ce3aeecb27a023e248ccb9433d62916308cd IPAL53051: 3D Extrusion fails + minor doc modifs --- diff --git a/doc/salome/examples/creating_meshes_ex02.py b/doc/salome/examples/creating_meshes_ex02.py index fe9f72f08..3980d4d74 100644 --- a/doc/salome/examples/creating_meshes_ex02.py +++ b/doc/salome/examples/creating_meshes_ex02.py @@ -1,4 +1,4 @@ -# Construction of a Submesh +# Construction of a Sub-mesh import salome salome.salome_init() @@ -20,27 +20,31 @@ EdgeX = geompy.GetEdgeNearPoint(box, p5) geompy.addToStudyInFather(box, EdgeX, "Edge [0,0,0 - 10,0,0]") # create a hexahedral mesh on the box -quadra = smesh.Mesh(box, "Box : quadrangle 2D mesh") +mesh = smesh.Mesh(box, "Box : hexahedral 3D mesh") -# create a regular 1D algorithm for the faces -algo1D = quadra.Segment() +# create a Regular_1D algorithm for discretization of edges +algo1D = mesh.Segment() # define "NumberOfSegments" hypothesis to cut # all the edges in a fixed number of segments algo1D.NumberOfSegments(4) # create a quadrangle 2D algorithm for the faces -quadra.Quadrangle() +mesh.Quadrangle() -# construct a submesh on the edge with a local hypothesis -algo_local = quadra.Segment(EdgeX) +# construct a sub-mesh on the edge with a local Regular_1D algorithm +algo_local = mesh.Segment(EdgeX) -# define "Arithmetic1D" hypothesis to cut the edge in several segments with increasing arithmetic length +# define "Arithmetic1D" hypothesis to cut EdgeX in several segments with length arithmetically +# increasing from 1.0 to 4.0 algo_local.Arithmetic1D(1, 4) -# define "Propagation" hypothesis that propagates all other hypotheses -# on all edges of the opposite side in case of quadrangular faces +# define "Propagation" hypothesis that propagates algo_local and "Arithmetic1D" hypothesis +# on all parallel edges of the box algo_local.Propagation() +# assign a hexahedral algorithm +mesh.Hexahedron() + # compute the mesh -quadra.Compute() +mesh.Compute() diff --git a/doc/salome/examples/creating_meshes_ex03.py b/doc/salome/examples/creating_meshes_ex03.py index 7cf85b786..8687b8971 100644 --- a/doc/salome/examples/creating_meshes_ex03.py +++ b/doc/salome/examples/creating_meshes_ex03.py @@ -1,4 +1,4 @@ -# Change priority of submeshes in Mesh +# Change priority of sub-meshes in Mesh import salome salome.salome_init() @@ -16,47 +16,44 @@ Box_1 = geompy.MakeBoxDXDYDZ(200, 200, 200) # create Mesh object on Box shape Mesh_1 = smesh.Mesh(Box_1) -# assign mesh algorithms +# assign mesh algorithms and hypotheses Regular_1D = Mesh_1.Segment() Nb_Segments_1 = Regular_1D.NumberOfSegments(20) -Nb_Segments_1.SetDistrType( 0 ) MEFISTO_2D = Mesh_1.Triangle() Max_Element_Area_1 = MEFISTO_2D.MaxElementArea(1200) Tetrahedron = Mesh_1.Tetrahedron() Max_Element_Volume_1 = Tetrahedron.MaxElementVolume(40000) -# create submesh and assign algorithms on Face_1 +# create sub-mesh and assign algorithms on Face_1 Regular_1D_1 = Mesh_1.Segment(geom=Face_1) Nb_Segments_2 = Regular_1D_1.NumberOfSegments(4) -Nb_Segments_2.SetDistrType( 0 ) MEFISTO_2D_1 = Mesh_1.Triangle(algo=smeshBuilder.MEFISTO,geom=Face_1) -Length_From_Edges_2D = MEFISTO_2D_1.LengthFromEdges() SubMesh_1 = MEFISTO_2D_1.GetSubMesh() -# create submesh and assign algorithms on Face_2 +# create sub-mesh and assign algorithms on Face_2 Regular_1D_2 = Mesh_1.Segment(geom=Face_2) Nb_Segments_3 = Regular_1D_2.NumberOfSegments(8) -Nb_Segments_3.SetDistrType( 0 ) MEFISTO_2D_2 = Mesh_1.Triangle(algo=smeshBuilder.MEFISTO,geom=Face_2) -Length_From_Edges_2D_1 = MEFISTO_2D_2.LengthFromEdges() SubMesh_2 = MEFISTO_2D_2.GetSubMesh() -# create submesh and assign algorithms on Face_3 +# create sub-mesh and assign algorithms on Face_3 Regular_1D_3 = Mesh_1.Segment(geom=Face_3) Nb_Segments_4 = Regular_1D_3.NumberOfSegments(12) -Nb_Segments_4.SetDistrType( 0 ) MEFISTO_2D_3 = Mesh_1.Triangle(algo=smeshBuilder.MEFISTO,geom=Face_3) -Length_From_Edges_2D_2 = MEFISTO_2D_3.LengthFromEdges() SubMesh_3 = MEFISTO_2D_3.GetSubMesh() -# check exisiting submesh priority order +# check exisiting sub-mesh priority order [ [ SubMesh_1, SubMesh_3, SubMesh_2 ] ] = Mesh_1.GetMeshOrder() -# set new submesh order +isDone = Mesh_1.Compute() +print "Nb elements at initial order of sub-meshes:", Mesh_1.NbElements() + +# set new sub-mesh order isDone = Mesh_1.SetMeshOrder( [ [ SubMesh_1, SubMesh_2, SubMesh_3 ] ]) # compute mesh isDone = Mesh_1.Compute() +print "Nb elements at new order of sub-meshes:", Mesh_1.NbElements() -# clear mesh result and compute with other submesh order -Mesh_1.Clear() +# compute with other sub-mesh order isDone = Mesh_1.SetMeshOrder( [ [ SubMesh_2, SubMesh_1, SubMesh_3 ] ]) isDone = Mesh_1.Compute() +print "Nb elements at another order of sub-meshes:", Mesh_1.NbElements() diff --git a/doc/salome/gui/SMESH/images/prism_needs_hyps.png b/doc/salome/gui/SMESH/images/prism_needs_hyps.png index 8c567809d..d56d43099 100644 Binary files a/doc/salome/gui/SMESH/images/prism_needs_hyps.png and b/doc/salome/gui/SMESH/images/prism_needs_hyps.png differ diff --git a/doc/salome/gui/SMESH/input/prism_3d_algo.doc b/doc/salome/gui/SMESH/input/prism_3d_algo.doc index d377b549f..71ba2a912 100644 --- a/doc/salome/gui/SMESH/input/prism_3d_algo.doc +++ b/doc/salome/gui/SMESH/input/prism_3d_algo.doc @@ -41,7 +41,8 @@ The \b Global algorithms and hypotheses to be chosen at
  • 1D algorithm and hypothesis that will be applied for meshing (logically) vertical edges of the prism (which connect the top and the base faces of the prism). In the sample picture above these are - "Regular_1D" algorithm and "Nb. Segments_1" hypothesis.
  • + "Regular_1D" algorithm and "Nb. Segments" hypothesis named "Vertical + Nb. Segments". The \b Local algorithms and hypotheses to be chosen at @@ -51,9 +52,9 @@ The \b Local algorithms and hypotheses to be chosen at meshing the top and the base prism 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, "BLSURF" algorithm meshes - "Face_1" base surface with triangles. (1D algorithm is not - assigned as "BLSURF" does not require divided edges to create a 2D mesh.) + 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 diff --git a/doc/salome/gui/SMESH/input/quad_ijk_algo.doc b/doc/salome/gui/SMESH/input/quad_ijk_algo.doc index 1ba49dd83..90e7eea94 100644 --- a/doc/salome/gui/SMESH/input/quad_ijk_algo.doc +++ b/doc/salome/gui/SMESH/input/quad_ijk_algo.doc @@ -20,8 +20,8 @@ The algorithm treats any face as quadrangle. If a face is bound by more than four edges, four most sharp vertices are considered as corners of the quadrangle and all edges between these vertices are treated as quadrangle sides. In the case of three edges, the vertex -specified by the user is considered as a degenerated side of the -quadrangle. +specified by the user is considered as a fourth degenerated side of the +quadrangle. \image html quad_meshes.png "Algorithm generates a structured mesh on complex faces provided that edges are properly discretized" diff --git a/src/StdMeshers/StdMeshers_Prism_3D.cxx b/src/StdMeshers/StdMeshers_Prism_3D.cxx index d2413b564..5c0a5af0f 100644 --- a/src/StdMeshers/StdMeshers_Prism_3D.cxx +++ b/src/StdMeshers/StdMeshers_Prism_3D.cxx @@ -1330,7 +1330,7 @@ bool StdMeshers_Prism_3D::compute(const Prism_3D::TPrismTopo& thePrism) // update state of sub-meshes (mostly in order to erase improper errors) SMESH_subMesh* sm = myHelper->GetMesh()->GetSubMesh( thePrism.myShape3D ); - SMESH_subMeshIteratorPtr smIt = sm->getDependsOnIterator(/*includeSelf=*/false); + SMESH_subMeshIteratorPtr smIt = sm->getDependsOnIterator(/*includeSelf=*/true); while ( smIt->more() ) { sm = smIt->next(); diff --git a/src/StdMeshers/StdMeshers_ProjectionUtils.cxx b/src/StdMeshers/StdMeshers_ProjectionUtils.cxx index 51a639869..06aa33a57 100644 --- a/src/StdMeshers/StdMeshers_ProjectionUtils.cxx +++ b/src/StdMeshers/StdMeshers_ProjectionUtils.cxx @@ -1868,7 +1868,7 @@ StdMeshers_ProjectionUtils::GetPropagationEdge( SMESH_Mesh* aMes int prevChainSize = aChain.Extent(); if ( aChain.Add(anOppE) > prevChainSize ) { // ... anOppE is not in aChain // Add found edge to the chain oriented so that to - // have it co-directed with a forward MainEdge + // have it co-directed with a fromEdge TopAbs_Orientation ori = anE.Orientation(); if ( anOppE.Orientation() == fourEdges[found].Orientation() ) ori = TopAbs::Reverse( ori ); @@ -1931,7 +1931,7 @@ FindMatchingNodesOnFaces( const TopoDS_Face& face1, helper1.SetSubShape( face1 ); helper2.SetSubShape( face2 ); - if ( helper1.HasSeam() != helper2.HasSeam() ) + if ( helper1.HasRealSeam() != helper2.HasRealSeam() ) RETURN_BAD_RESULT("Different faces' geometry"); // Data to call SMESH_MeshEditor::FindMatchingNodes(): diff --git a/src/StdMeshers/StdMeshers_Projection_2D.cxx b/src/StdMeshers/StdMeshers_Projection_2D.cxx index 66c893628..648510c94 100644 --- a/src/StdMeshers/StdMeshers_Projection_2D.cxx +++ b/src/StdMeshers/StdMeshers_Projection_2D.cxx @@ -821,8 +821,8 @@ namespace { // find trsf const int totNbSeg = 50; vector< gp_XY > srcPnts, tgtPnts; - srcPnts.resize( totNbSeg ); - tgtPnts.resize( totNbSeg ); + srcPnts.reserve( totNbSeg ); + tgtPnts.reserve( totNbSeg ); for ( size_t iW = 0; iW < srcWires.size(); ++iW ) { const double minSegLen = srcWires[iW]->Length() / totNbSeg; @@ -1392,10 +1392,19 @@ bool StdMeshers_Projection_2D::Compute(SMESH_Mesh& theMesh, const TopoDS_Shape& } } } - else if ( nbEdgesInWires.front() == 1 ) + else if ( nbEdgesInWires.front() == 1 ) // a sole edge in a wire { - // TODO::Compare orientation of curves in a sole edge - //RETURN_BAD_RESULT("Not implemented case"); + TopoDS_Edge srcE1 = srcEdges.front(), tgtE1 = tgtEdges.front(); + for ( size_t iW = 0; iW < srcWires.size(); ++iW ) + { + StdMeshers_FaceSidePtr srcWire = srcWires[iW]; + for ( int iE = 0; iE < srcWire->NbEdges(); ++iE ) + if ( srcE1.IsSame( srcWire->Edge( iE ))) + { + reverse = ( tgtE1.Orientation() != tgtWires[iW]->Edge( iE ).Orientation() ); + break; + } + } } else {