Salome HOME
"viscous layer 3d around foil"
[modules/smesh.git] / src / SMESH / SMESH_MeshEditor.cxx
index f1be17ded67725d6cf9560e10038938a16274e83..842b177507e10c3f190e4a1d626a26ca6c4a1bff 100644 (file)
@@ -658,7 +658,7 @@ bool SMESH_MeshEditor::InverseDiag (const SMDS_MeshElement * theTria1,
 
     // put nodes in array and find out indices of the same ones
     const SMDS_MeshNode* aNodes [6];
-    int sameInd [] = { 0, 0, 0, 0, 0, 0 };
+    int sameInd [] = { -1, -1, -1, -1, -1, -1 };
     int i = 0;
     SMDS_ElemIteratorPtr it = theTria1->nodesIterator();
     while ( it->more() ) {
@@ -684,15 +684,15 @@ bool SMESH_MeshEditor::InverseDiag (const SMDS_MeshElement * theTria1,
     }
 
     // find indices of 1,2 and of A,B in theTria1
-    int iA = 0, iB = 0, i1 = 0, i2 = 0;
+    int iA = -1, iB = 0, i1 = 0, i2 = 0;
     for ( i = 0; i < 6; i++ ) {
-      if ( sameInd [ i ] == 0 ) {
+      if ( sameInd [ i ] == -1 ) {
         if ( i < 3 ) i1 = i;
         else         i2 = i;
       }
       else if (i < 3) {
-        if ( iA ) iB = i;
-        else      iA = i;
+        if ( iA >= 0) iB = i;
+        else          iA = i;
       }
     }
     // nodes 1 and 2 should not be the same
@@ -5463,7 +5463,7 @@ SMESH_MeshEditor::MakeExtrElements(TIDSortedElemSet&                 theElements
   for( ; itPP != fullList.end(); itPP++) {
     aPPs.push_back( *itPP );
     if ( theHasAngles && itAngles != theAngles.end() )
-      aPPs.back().SetAngle( *itAngles );
+      aPPs.back().SetAngle( *itAngles++ );
   }
 
   TNodeOfNodeListMap   mapNewNodes;
@@ -9931,8 +9931,8 @@ bool SMESH_MeshEditor::AffectedElemGroupsInRegion( const TIDSortedElemSet& theEl
     // --- iterates on elements to be replicated and get elements by back references from their nodes
 
     TIDSortedElemSet::const_iterator elemItr = theElems.begin();
-    int ielem = 1;
-    for ( ;  elemItr != theElems.end(); ++elemItr )
+    int ielem;
+    for ( ielem=1;  elemItr != theElems.end(); ++elemItr )
     {
       SMDS_MeshElement* anElem = (SMDS_MeshElement*)*elemItr;
       if (!anElem || (anElem->GetType() != SMDSAbs_Face))
@@ -10034,8 +10034,8 @@ bool SMESH_MeshEditor::AffectedElemGroupsInRegion( const TIDSortedElemSet& theEl
 
     // iterates on indicated elements and get elements by back references from their nodes
     TIDSortedElemSet::const_iterator elemItr = theElems.begin();
-    int ielem = 1;
-    for ( ;  elemItr != theElems.end(); ++elemItr )
+    int ielem;
+    for ( ielem = 1;  elemItr != theElems.end(); ++elemItr )
     {
       MESSAGE("element " << ielem++);
       SMDS_MeshElement* anElem = (SMDS_MeshElement*)*elemItr;