Salome HOME
Rebase abn/configuration on the top of the master abn/configuration
authorrnv <rnv@opencascade.com>
Tue, 26 Jul 2016 07:55:58 +0000 (10:55 +0300)
committerrnv <rnv@opencascade.com>
Tue, 26 Jul 2016 07:55:58 +0000 (10:55 +0300)
13 files changed:
CMakeLists.txt
doc/salome/gui/SMESH/CMakeLists.txt
doc/salome/gui/SMESH/images/topo_equality.png [new file with mode: 0644]
doc/salome/gui/SMESH/input/constructing_submeshes.doc
doc/salome/gui/SMESH/input/prism_3d_algo.doc
doc/salome/gui/SMESH/input/projection_algos.doc
src/DriverMED/DriverMED_W_SMESHDS_Mesh.cxx
src/OBJECT/SMESH_DeviceActor.cxx
src/SMESH/SMESH_subMesh.cxx
src/SMESHUtils/SMESH_MeshAlgos.cxx
src/Tools/YamsPlug/monViewText.py
src/Tools/YamsPlug/yamsplug_plugin.py
src/Tools/smesh_plugins.py

index 490c0e00878465dc01cf356c332fdb633ac8805b..d7648c9035183d053b7e7ae23bb6cc4206c016dc 100755 (executable)
@@ -21,6 +21,9 @@ PROJECT(SalomeSMESH C CXX)
 
 # Ensure a proper linker behavior:
 CMAKE_POLICY(SET CMP0003 NEW)
+IF(WIN32)
+  CMAKE_POLICY(SET CMP0020 OLD) # disable automatic linking to qtmain.lib 
+ENDIF(WIN32)
 
 # Versioning
 # ===========
index 2060a5b09344f003a52d196e3ec34999cffe1151..9479329a00f6cf4b6c0f8747c0b30b0b47e8bbe1 100644 (file)
@@ -48,8 +48,6 @@ ADD_CUSTOM_TARGET(usr_docs ${CMAKE_COMMAND} -E make_directory tmp1
   WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}
 )
 
-#ADD_DEPENDENCIES(usr_docs html_docs)
-
 INSTALL(CODE "EXECUTE_PROCESS(COMMAND \"${CMAKE_COMMAND}\" --build ${PROJECT_BINARY_DIR} --target usr_docs)")
 INSTALL(DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/SMESH DESTINATION ${SALOME_INSTALL_DOC}/gui)
 INSTALL(FILES images/head.png DESTINATION ${SALOME_INSTALL_DOC}/gui/SMESH)
diff --git a/doc/salome/gui/SMESH/images/topo_equality.png b/doc/salome/gui/SMESH/images/topo_equality.png
new file mode 100644 (file)
index 0000000..119251a
Binary files /dev/null and b/doc/salome/gui/SMESH/images/topo_equality.png differ
index 43f99e5c599e71976cd33d0a38dfb9377b32dd54..04000e58245f439f018e8a105d88d6b4e3d8341c 100644 (file)
@@ -2,6 +2,8 @@
 
 \page constructing_submeshes_page Constructing sub-meshes
 
+\tableofcontents
+
 By purpose, the sub-mesh is an object used to assign to a sub-shape
 different meshing parameters than those assigned to the main shape.
 
@@ -14,6 +16,8 @@ Creation of a sub-mesh allows to control individually meshing of a
 certain sub-shape, thus to get a locally coarser or finer mesh, to get
 elements of different types in the same mesh, etc.
 
+\section submesh_shape_section How to get a sub-shape for sub-mesh construction
+
 A sub-shape to create a sub-mesh on should be retrieved from the main shape
 in one of the following ways: <ul>
 <li> In Geometry module, via <em>New Entity > Explode</em> menu.</li>
@@ -27,6 +31,8 @@ in one of the following ways: <ul>
       dialog showing \ref meshing_failed_anchor "meshing errors".</li> 
 </ul>
 
+\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:
 <ul>
 <li>Selecting a mesh which will encapsulate the sub-mesh</li>
@@ -123,6 +131,8 @@ ID in <b> Element ID</b> 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:
 <li>a sub-mesh name (\a SubMeshFace1)
 <li>a reference to the geometrical object on the basis of which the
   sub-mesh has been constructed (<em>Cylindrical Face_1</em>);</li>
-<li><em>Applied hypotheses</em> folder containing the references to the
+<li><em>Applied hypotheses</em> folder containing references to
 hypotheses assigned to the sub-mesh;</li>
-<li><em>Applied algorithms</em> folder containing the references to the
+<li><em>Applied algorithms</em> folder containing references to
 algorithms assigned to the sub-mesh.</li>
 </ul>
 
index 71ba2a9125d6d26b4fbd0807a2597e8f8ecb2b38..5f98399c76ce6601f0b0b78cd5ff38b6b0738057 100644 (file)
@@ -49,21 +49,35 @@ The \b Local algorithms and hypotheses to be chosen at
 \ref constructing_submeshes_page "Construction of sub-meshes" are:
 <ul>
   <li> 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.)
   </li>
-  <li> 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 <b>Prism stacks</b> 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. 
+  <li> 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 <b>Prism
+    stacks</b> 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.
 </li></ul>
 
+If <em>3D extrusion</em> 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 <em>3D extrusion</em> 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 <em>3D extrusion</em> 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
index 4e5b6e90d4e0ed7932631fb04d1682de30b2b277..de11a7ee0e17db89daa865ab09ecd8561e6005fb 100644 (file)
@@ -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
+
 <b>Projection 1D</b> 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 <b>Projection 2D</b> 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 <b>Projection 1D-2D</b> algorithm differs from <b>Projection 2D</b>
-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 <b>Projection 1D-2D</b> 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 <b>Projection 3D</b> algorithm allows to define the mesh of a shape by
 the projection of another already meshed shape.  This algorithm works
index f279c08c8f0452e244f19391a1a3c3284a2a7fcc..f31f262c03438b16bd4bcd561a227484f13ab973 100644 (file)
@@ -60,7 +60,7 @@ DriverMED_W_SMESHDS_Mesh::DriverMED_W_SMESHDS_Mesh():
   myDoGroupOfVolumes (false),
   myDoGroupOf0DElems(false),
   myDoGroupOfBalls(false),
-  myAutoDimension(true),
+  myAutoDimension(false),
   myAddODOnVertices(false)
 {}
 
@@ -331,13 +331,22 @@ Driver_Mesh::Status DriverMED_W_SMESHDS_Mesh::Perform()
     }
 
     // Mesh dimension definition
+
+    TInt aMeshDimension = 0;
+    if ( myMesh->NbEdges() > 0 )
+      aMeshDimension = 1;
+    if ( myMesh->NbFaces() > 0 )
+      aMeshDimension = 2;
+    if ( myMesh->NbVolumes() > 0 )
+      aMeshDimension = 3;
+
     TInt aSpaceDimension = 3;
     TCoordHelperPtr aCoordHelperPtr;
     {
       bool anIsXDimension = false;
       bool anIsYDimension = false;
       bool anIsZDimension = false;
-      if ( myAutoDimension )
+      if ( myAutoDimension && aMeshDimension < 3 )
       {
         SMDS_NodeIteratorPtr aNodesIter = myMesh->nodesIterator();
         double aBounds[6];
@@ -380,7 +389,7 @@ Driver_Mesh::Status DriverMED_W_SMESHDS_Mesh::Perform()
         anIsXDimension = (aBounds[1] - aBounds[0]) + abs(aBounds[1]) + abs(aBounds[0]) > EPS;
         anIsYDimension = (aBounds[3] - aBounds[2]) + abs(aBounds[3]) + abs(aBounds[2]) > EPS;
         anIsZDimension = (aBounds[5] - aBounds[4]) + abs(aBounds[5]) + abs(aBounds[4]) > EPS;
-        aSpaceDimension = anIsXDimension + anIsYDimension + anIsZDimension;
+        aSpaceDimension = Max( aMeshDimension, anIsXDimension + anIsYDimension + anIsZDimension );
         if ( !aSpaceDimension )
           aSpaceDimension = 3;
         // PAL16857(SMESH not conform to the MED convention):
@@ -420,13 +429,6 @@ Driver_Mesh::Status DriverMED_W_SMESHDS_Mesh::Perform()
         break;
       }
     }
-    TInt aMeshDimension = 0;
-    if ( myMesh->NbEdges() > 0 )
-      aMeshDimension = 1;
-    if ( myMesh->NbFaces() > 0 )
-      aMeshDimension = 2;
-    if ( myMesh->NbVolumes() > 0 )
-      aMeshDimension = 3;
     
     MED::PWrapper myMed = CrWrapper(myFile,myMedVersion);
     PMeshInfo aMeshInfo = myMed->CrMeshInfo(aMeshDimension,aSpaceDimension,aMeshName);
index 4520d93273d8de3912bc104d4cb2673795b42168..f9195f19f98ba7899856aac42ee7d7e0bf1f1528 100644 (file)
@@ -142,7 +142,7 @@ SMESH_DeviceActor
   if(MYDEBUG) MESSAGE("~SMESH_DeviceActor - "<<this);
 
   myMapper->Delete();
-
+  myPlaneCollection->Delete();
   myProperty->Delete();
 
   myExtractGeometry->Delete();
index 5bb8a34b38ee33a051faa7636d8ab1e23c0c4c52..128316dcf55c87817dbf3e556cb61bf02a660d35 100644 (file)
@@ -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 );
       }
     }
   }
index 1776f3dd4f4227e4e7658b819572f742819ab786..e65e20114c42723fd8ec3ff435c115a73205332c 100644 (file)
@@ -906,8 +906,9 @@ TopAbs_State SMESH_ElementSearcherImpl::GetPointState(const gp_Pnt& point)
       }
       else if ( ! intersection.IsParallel() && intersection.NbPoints() > 0 )
       {
+        double tol = 1e-4 * Sqrt( fNorm.Modulus() );
         gp_Pnt intersectionPoint = intersection.Point(1);
-        if ( !SMESH_MeshAlgos::IsOut( *face, intersectionPoint, tolerance ))
+        if ( !SMESH_MeshAlgos::IsOut( *face, intersectionPoint, tol ))
           u2inters.insert(make_pair( intersection.ParamOnConic(1), TInters( *face, fNorm )));
       }
     }
@@ -1133,14 +1134,11 @@ bool SMESH_MeshAlgos::IsOut( const SMDS_MeshElement* element, const gp_Pnt& poin
 
   // get ordered nodes
 
-  vector< SMESH_TNodeXYZ > xyz;
+  vector< SMESH_TNodeXYZ > xyz; xyz.reserve( element->NbNodes()+1 );
 
   SMDS_ElemIteratorPtr nodeIt = element->interlacedNodesElemIterator();
-  while ( nodeIt->more() )
-  {
-    SMESH_TNodeXYZ node = nodeIt->next();
-    xyz.push_back( node );
-  }
+  for ( int i = 0; nodeIt->more(); ++i )
+    xyz.push_back( SMESH_TNodeXYZ( nodeIt->next() ));
 
   int i, nbNodes = (int) xyz.size(); // central node of biquadratic is missing
 
@@ -1171,8 +1169,23 @@ bool SMESH_MeshAlgos::IsOut( const SMDS_MeshElement* element, const gp_Pnt& poin
 
     // check if the point lays on face plane
     gp_Vec n2p( xyz[0], point );
-    if ( fabs( n2p * faceNorm ) > tol )
-      return true; // not on face plane
+    double dot = n2p * faceNorm;
+    if ( Abs( dot ) > tol ) // not on face plane
+    {
+      bool isOut = true;
+      if ( nbNodes > 3 ) // maybe the face is not planar
+      {
+        double elemThick = 0;
+        for ( i = 1; i < nbNodes; ++i )
+        {
+          gp_Vec n2n( xyz[0], xyz[i] );
+          elemThick = Max( elemThick, Abs( n2n * faceNorm ));
+        }
+        isOut = Abs( dot ) > elemThick + tol;
+      }
+      if ( isOut )
+        return isOut;
+    }
 
     // check if point is out of face boundary:
     // define it by closest transition of a ray point->infinity through face boundary
@@ -1184,7 +1197,7 @@ bool SMESH_MeshAlgos::IsOut( const SMDS_MeshElement* element, const gp_Pnt& poin
     normSize = plnNorm.Magnitude();
     if ( normSize <= tol ) return false; // point coincides with the first node
     plnNorm /= normSize;
-    // for each node of the face, compute its signed distance to the plane
+    // for each node of the face, compute its signed distance to the cutting plane
     vector<double> dist( nbNodes + 1);
     for ( i = 0; i < nbNodes; ++i )
     {
@@ -1194,12 +1207,12 @@ bool SMESH_MeshAlgos::IsOut( const SMDS_MeshElement* element, const gp_Pnt& poin
     dist.back() = dist.front();
     // find the closest intersection
     int    iClosest = -1;
-    double rClosest = 0, distClosest = 1e100;;
+    double rClosest = 0, distClosest = 1e100;
     gp_Pnt pClosest;
     for ( i = 0; i < nbNodes; ++i )
     {
       double r;
-      if ( fabs( dist[i]) < tol )
+      if ( fabs( dist[i] ) < tol )
         r = 0.;
       else if ( fabs( dist[i+1]) < tol )
         r = 1.;
@@ -1208,17 +1221,14 @@ bool SMESH_MeshAlgos::IsOut( const SMDS_MeshElement* element, const gp_Pnt& poin
       else
         continue; // no intersection
       gp_Pnt pInt = xyz[i] * (1.-r) + xyz[i+1] * r;
-      gp_Vec p2int ( point, pInt);
-      if ( p2int * ray > -tol ) // right half-space
+      gp_Vec p2int( point, pInt);
+      double intDist = p2int.SquareMagnitude();
+      if ( intDist < distClosest )
       {
-        double intDist = p2int.SquareMagnitude();
-        if ( intDist < distClosest )
-        {
-          iClosest = i;
-          rClosest = r;
-          pClosest = pInt;
-          distClosest = intDist;
-        }
+        iClosest = i;
+        rClosest = r;
+        pClosest = pInt;
+        distClosest = intDist;
       }
     }
     if ( iClosest < 0 )
@@ -1242,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
@@ -1269,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 );
index 426467ef4351d3380656ef528ee70de52fc34016..45115e68dfdcac3239f33184f93351e92fb1e196 100644 (file)
@@ -108,7 +108,7 @@ class MonViewText(Ui_ViewExe, QDialog):
 
     def readFromStdOut(self) :
         a=self.monExe.readAllStandardOutput()
-        aa=unicode(a.data(),len(a))
+        aa=unicode(a.data())
         self.TB_Exe.append(aa)
         if "END_OF_MGSurfOpt" in aa:
           self.parent().enregistreResultat()
index 292bbe985d223b6f943cbb62302655030b51c7a5..20eea53c69511b767ef3f6a63d4e6275f25983fb 100755 (executable)
@@ -37,7 +37,7 @@ def YamsLct(context):
       os.environ['DISTENE_LICENSE_FILE']
   except:
       QMessageBox.warning(None,"Products","""\
-Distene's product MeshGem SurfOpt (formerly Yams) is not installed.
+Distene's product MeshGem SurfOpt is not installed.
 required environment variable:
 DISTENE_LICENSE_FILE='.../dlim8.var.sh'""")
       return
index 52a886f3c8bfc48b6d9d1806e765da66cffdb1ae..3c81d72fa64e98559c8ec7cfc85c354440c5f0da 100644 (file)
@@ -42,11 +42,11 @@ except:
 
 try:
   from yamsplug_plugin import YamsLct
-  salome_pluginsmanager.AddFunction('ReMesh with MGSurfOpt ( formerly Yams )',
+  salome_pluginsmanager.AddFunction('ReMesh with MGSurfOpt',
                                     'Run Yams',
                                     YamsLct)
 except:
-  salome_pluginsmanager.logger.info('ERROR: MGSurfOpt (Yams) plug-in is unavailable')
+  salome_pluginsmanager.logger.info('ERROR: MGSurfOpt plug-in is unavailable')
   pass
 
 try: