]> SALOME platform Git repositories - modules/smesh.git/commitdiff
Salome HOME
Just adding debug infos and removing printing infos for the debugging !!
authornadir <nadir>
Mon, 8 Dec 2003 13:17:01 +0000 (13:17 +0000)
committernadir <nadir>
Mon, 8 Dec 2003 13:17:01 +0000 (13:17 +0000)
src/SMESH/SMESH_MEFISTO_2D.cxx
src/SMESH/SMESH_NETGEN_3D.cxx
src/SMESH/SMESH_subMesh.cxx

index ffd212d06913aea4b8a9ec3f10b66b5933e79ca3..88257be18d64506ff72ceba9badfe4836d6a137f 100644 (file)
@@ -259,14 +259,15 @@ bool SMESH_MEFISTO_2D::Compute(SMESH_Mesh & aMesh, const TopoDS_Shape & aShape)
                nblf, nudslf, uvslf, nbpti, uvpti, nbst, uvst, nbt, nust, ierr);
 
        if (ierr == 0)
-       {
-               MESSAGE("... End Triangulation");
-               //SCRUTE(nbst);
-               //SCRUTE(nbt);
-               StoreResult(aMesh, nbst, uvst, nbt, nust, F,
+         {
+           MESSAGE("... End Triangulation Generated Triangle Number " << nbt);
+           MESSAGE("                                    Node Number " << nbst);
+           //SCRUTE(nbst);
+           //SCRUTE(nbt);
+           StoreResult(aMesh, nbst, uvst, nbt, nust, F,
                        faceIsForward, mefistoToDS);
-               isOk = true;
-       }
+           isOk = true;
+         }
        else
        {
                MESSAGE("Error in Triangulation");
index 2c9de3b88fe444508870557f79381f737346b343..a7fc6d04cbf5a869ba0a72f16412090c993c0331 100644 (file)
@@ -213,11 +213,11 @@ bool SMESH_NETGEN_3D::Compute(SMESH_Mesh& aMesh,
        {
          index++;
          const SMDS_MeshNode * node = iteratorNodes->next();
-         int nodeId = node->GetID();
-         double nodeX = node->X();
-         double nodeY = node->Y();
-         double nodeZ = node->Z();
-         MESSAGE("NODE -> ID = " << nodeId << " X = " << nodeX << " Y = " << nodeY << " Z = " << nodeZ);
+//       int nodeId = node->GetID();
+//       double nodeX = node->X();
+//       double nodeY = node->Y();
+//       double nodeZ = node->Z();
+//       MESSAGE("NODE -> ID = " << nodeId << " X = " << nodeX << " Y = " << nodeY << " Z = " << nodeZ);
        }
       delete iteratorNodes;
 
@@ -227,6 +227,7 @@ bool SMESH_NETGEN_3D::Compute(SMESH_Mesh& aMesh,
 
       SCRUTE(nbTria);
       index = 0;
+      int numberOfDegeneratedTriangle = 0;
       while(iteratorTriangle->more())
        {
          index++;
@@ -235,18 +236,58 @@ bool SMESH_NETGEN_3D::Compute(SMESH_Mesh& aMesh,
 
          SMDS_Iterator<const SMDS_MeshElement *> * triangleNodesIt = triangle->nodesIterator();
 
-         int triangleNode1 = (triangleNodesIt->next())->GetID();
-         int triangleNode2 = (triangleNodesIt->next())->GetID();
-         int triangleNode3 = (triangleNodesIt->next())->GetID();
+         const SMDS_MeshNode * node1 = static_cast<const SMDS_MeshNode *>(triangleNodesIt->next());
+         double node1X = node1->X();
+         double node1Y = node1->Y();
+         double node1Z = node1->Z();
 
-         MESSAGE("TRIANGLE -> ID = " << triangleId << " N1 = " << triangleNode1 << " N2 = " << triangleNode2 << " N3 = " << triangleNode3);
+         const SMDS_MeshNode * node2 = static_cast<const SMDS_MeshNode *>(triangleNodesIt->next());
+         double node2X = node2->X();
+         double node2Y = node2->Y();
+         double node2Z = node2->Z();
 
+         const SMDS_MeshNode * node3 = static_cast<const SMDS_MeshNode *>(triangleNodesIt->next());
+         double node3X = node3->X();
+         double node3Y = node3->Y();
+         double node3Z = node3->Z();
+
+         int triangleNode1 = node1->GetID();
+         int triangleNode2 = node2->GetID();
+         int triangleNode3 = node3->GetID();
+
+         // Compute the triangle surface
+
+         double vect1 = ((node2Y - node1Y)*(node3Z - node1Z) - (node2Z - node1Z)*(node3Y - node1Y));
+         double vect2 = - ((node2X - node1X)*(node3Z - node1Z) - (node2Z - node1Z)*(node3X - node1X));
+         double vect3 = ((node2X - node1X)*(node3Y - node1Y) - (node2Y - node1Y)*(node3X - node1X));
+         double epsilon = 1.0e-6;
+
+         bool triangleIsDegenerated = ((abs(vect1)<epsilon) && (abs(vect2)<epsilon) && (abs(vect3)<epsilon));
+
+         if (triangleIsDegenerated)
+           {
+//           MESSAGE("TRIANGLE -> ID = " << triangleId << " N1 = " << triangleNode1 << " N2 = " << triangleNode2 << " N3 = " << triangleNode3 << " is degenerated");
+//           MESSAGE("NODE -> ID = " << triangleNode1 << " X = " << node1X << " Y = " << node1Y << " Z = " << node1Z);
+//           MESSAGE("NODE -> ID = " << triangleNode2 << " X = " << node2X << " Y = " << node2Y << " Z = " << node2Z);
+//           MESSAGE("NODE -> ID = " << triangleNode3 << " X = " << node3X << " Y = " << node3Y << " Z = " << node3Z);
+             numberOfDegeneratedTriangle++;
+           }
+         else
+           {
+//           MESSAGE("TRIANGLE -> ID = " << triangleId << " N1 = " << triangleNode1 << " N2 = " << triangleNode2 << " N3 = " << triangleNode3 << " is normal");
+           }
        }
+
       delete iteratorTriangle;
 
+      if (numberOfDegeneratedTriangle > 0)
+       MESSAGE("WARNING THERE IS(ARE) " << numberOfDegeneratedTriangle << " degenerated triangle on this face");
+
       SCRUTE(index);
     }
 
+
+
   SCRUTE(NbTotOfTria);
   SCRUTE(NbTotOfNodesFaces);
 
@@ -305,12 +346,12 @@ bool SMESH_NETGEN_3D::Compute(SMESH_Mesh& aMesh,
       while(iteratorNodes->more())
        {
          index++;
-         const SMDS_MeshNode * node = iteratorNodes->next();
-         int nodeId = node->GetID();
-         double nodeX = node->X();
-         double nodeY = node->Y();
-         double nodeZ = node->Z();
-         MESSAGE("NODE -> ID = " << nodeId << " X = " << nodeX << " Y = " << nodeY << " Z = " << nodeZ);
+         const SMDS_MeshNode * node = iteratorNodes->next();
+//       int nodeId = node->GetID();
+//       double nodeX = node->X();
+//       double nodeY = node->Y();
+//       double nodeZ = node->Z();
+//       MESSAGE("NODE -> ID = " << nodeId << " X = " << nodeX << " Y = " << nodeY << " Z = " << nodeZ);
        }
       delete iteratorNodes;
 
@@ -361,12 +402,12 @@ bool SMESH_NETGEN_3D::Compute(SMESH_Mesh& aMesh,
       while(iteratorNodes->more())
        {
          index++;
-         const SMDS_MeshNode * node = iteratorNodes->next();
-         int nodeId = node->GetID();
-         double nodeX = node->X();
-         double nodeY = node->Y();
-         double nodeZ = node->Z();
-         MESSAGE("NODE -> ID = " << nodeId << " X = " << nodeX << " Y = " << nodeY << " Z = " << nodeZ);
+         const SMDS_MeshNode * node = iteratorNodes->next();
+//       int nodeId = node->GetID();
+//       double nodeX = node->X();
+//       double nodeY = node->Y();
+//       double nodeZ = node->Z();
+//       MESSAGE("NODE -> ID = " << nodeId << " X = " << nodeX << " Y = " << nodeY << " Z = " << nodeZ);
        }
       delete iteratorNodes;
 
@@ -455,7 +496,7 @@ bool SMESH_NETGEN_3D::Compute(SMESH_Mesh& aMesh,
              double nodeX = node->X();
              double nodeY = node->Y();
              double nodeZ = node->Z();
-             MESSAGE("NODE -> ID = " << nodeId << " X = " << nodeX << " Y = " << nodeY << " Z = " << nodeZ);
+//           MESSAGE("NODE -> ID = " << nodeId << " X = " << nodeX << " Y = " << nodeY << " Z = " << nodeZ);
              listNodeCoresNetgenSmesh[indexNodes] = nodeId;
              int index = indexNodes*spaceDimension;
              Netgen_Coordinates[index] = nodeX;
@@ -481,7 +522,7 @@ bool SMESH_NETGEN_3D::Compute(SMESH_Mesh& aMesh,
              double nodeX = node->X();
              double nodeY = node->Y();
              double nodeZ = node->Z();
-             MESSAGE("NODE -> ID = " << nodeId << " X = " << nodeX << " Y = " << nodeY << " Z = " << nodeZ);
+//           MESSAGE("NODE -> ID = " << nodeId << " X = " << nodeX << " Y = " << nodeY << " Z = " << nodeZ);
              listNodeCoresNetgenSmesh[indexNodes] = node->GetID();
              int index = indexNodes*spaceDimension;
              Netgen_Coordinates[index] = node->X();
@@ -507,7 +548,7 @@ bool SMESH_NETGEN_3D::Compute(SMESH_Mesh& aMesh,
              double nodeX = node->X();
              double nodeY = node->Y();
              double nodeZ = node->Z();
-             MESSAGE("NODE -> ID = " << nodeId << " X = " << nodeX << " Y = " << nodeY << " Z = " << nodeZ);
+//           MESSAGE("NODE -> ID = " << nodeId << " X = " << nodeX << " Y = " << nodeY << " Z = " << nodeZ);
              listNodeCoresNetgenSmesh[indexNodes] = nodeId;
              int index = indexNodes*spaceDimension;
              Netgen_Coordinates[index] = nodeX;
@@ -563,7 +604,7 @@ bool SMESH_NETGEN_3D::Compute(SMESH_Mesh& aMesh,
                  int triangleNode2 = (triangleNodesIt->next())->GetID();
                  int triangleNode3 = (triangleNodesIt->next())->GetID();
 
-                 MESSAGE("TRIANGLE -> ID = " << triangleId << " N1 = " << triangleNode1 << " N2 = " << triangleNode2 << " N3 = " << triangleNode3);
+//               MESSAGE("TRIANGLE -> ID = " << triangleId << " N1 = " << triangleNode1 << " N2 = " << triangleNode2 << " N3 = " << triangleNode3);
 
                  int N1New = 0;
                  int N2New = 0;
@@ -609,7 +650,7 @@ bool SMESH_NETGEN_3D::Compute(SMESH_Mesh& aMesh,
                  int triangleNode3 = (triangleNodesIt->next())->GetID();
                  int triangleNode2 = (triangleNodesIt->next())->GetID();
 
-                 MESSAGE("TRIANGLE -> ID = " << triangleId << " N1 = " << triangleNode1 << " N2 = " << triangleNode2 << " N3 = " << triangleNode3);
+//               MESSAGE("TRIANGLE -> ID = " << triangleId << " N1 = " << triangleNode1 << " N2 = " << triangleNode2 << " N3 = " << triangleNode3);
 
                  int N1New = 0;
                  int N2New = 0;
@@ -939,7 +980,7 @@ bool SMESH_NETGEN_3D::Compute(SMESH_Mesh& aMesh,
            double nodeX = node->X();
            double nodeY = node->Y();
            double nodeZ = node->Z();
-           MESSAGE("NODE -> ID = " << nodeId << " X = " << nodeX << " Y = " << nodeY << " Z = " << nodeZ);
+//         MESSAGE("NODE -> ID = " << nodeId << " X = " << nodeX << " Y = " << nodeY << " Z = " << nodeZ);
          }
        delete iteratorNodes;
 
@@ -963,7 +1004,7 @@ bool SMESH_NETGEN_3D::Compute(SMESH_Mesh& aMesh,
            int tetraNode3 = (tetraNodesIt->next())->GetID();
            int tetraNode4 = (tetraNodesIt->next())->GetID();
 
-           MESSAGE("TETRAHEDRON -> ID = " << tetraId << " N1 = " << tetraNode1 << " N2 = " << tetraNode2 << " N3 = " << tetraNode3 << " N4 = " << tetraNode4);
+//         MESSAGE("TETRAHEDRON -> ID = " << tetraId << " N1 = " << tetraNode1 << " N2 = " << tetraNode2 << " N3 = " << tetraNode3 << " N4 = " << tetraNode4);
 
          }
        delete iteratorTetra;
index 9fae1d7ab48b777bd7e9a0081cb717b059fb4526..2e6799ed22b80a7348e8c5f73bfc0dde843632ae 100644 (file)
@@ -249,12 +249,60 @@ bool SMESH_subMesh::SubMeshesComputed() throw(SALOME_Exception)
        for (itsub = subMeshes.begin(); itsub != subMeshes.end(); itsub++)
        {
                SMESH_subMesh *sm = (*itsub).second;
+
+               const TopoDS_Shape & ss = sm->GetSubShape();
+               int type = ss.ShapeType();
 //       SCRUTE(sm->GetId());
 //       SCRUTE(sm->GetComputeState());
                bool computeOk = (sm->GetComputeState() == COMPUTE_OK);
                if (!computeOk)
                {
                        subMeshesComputed = false;
+
+                       switch (type)
+                         {
+                         case TopAbs_COMPOUND:
+                           {
+                             MESSAGE("The not computed sub mesh is a COMPOUND");
+                             break;
+                           }
+                         case TopAbs_COMPSOLID:
+                           {
+                             MESSAGE("The not computed sub mesh is a COMPSOLID");
+                             break;
+                           }
+                         case TopAbs_SHELL:
+                           {
+                             MESSAGE("The not computed sub mesh is a SHEL");
+                             break;
+                           }
+                         case TopAbs_WIRE:
+                           {
+                             MESSAGE("The not computed sub mesh is a WIRE");
+                             break;
+                           }
+                         case TopAbs_SOLID:
+                           {
+                             MESSAGE("The not computed sub mesh is a SOLID");
+                             break;
+                           }
+                         case TopAbs_FACE:
+                           {
+                             MESSAGE("The not computed sub mesh is a FACE");
+                             break;
+                           }
+                         case TopAbs_EDGE:
+                           {
+                             MESSAGE("The not computed sub mesh is a EDGE");
+                             break;
+                           }
+                         default:
+                           {
+                             MESSAGE("The not computed sub mesh is of unknown type");
+                             break;
+                           }
+                         }
+
                        SCRUTE(sm->GetId());
                        break;
                }