Salome HOME
Fix wrong order of points in joinQuad that made an error when testing Bielle.xls V9_4_0a1 V9_4_0a2 V9_4_0b1
authorChristophe Bourcier <christophe.bourcier@cea.fr>
Fri, 2 Aug 2019 09:43:44 +0000 (11:43 +0200)
committerChristophe Bourcier <christophe.bourcier@cea.fr>
Fri, 2 Aug 2019 09:43:44 +0000 (11:43 +0200)
We keep the order of points from python scripts to keep compatibility with existing scripts

doc/tui_prism_join_quad.rst
src/HEXABLOCK/HexElements_check.cxx
src/HEXABLOCKGUI/HEXABLOCKGUI_DocumentModel.cxx
src/HEXABLOCKGUI/HEXABLOCKGUI_DocumentPanel.cxx

index 6d2bebcead4165d28ba443f9517455df3b11c04e..c30689ec623ea8f8622d56ba8c68fd643af59344 100644 (file)
@@ -113,22 +113,21 @@ The following data are required:
 
 - *quad*      : the quad to be joined and from which hexahedra will be created (one quad case).
 - *quads*     : the set of quadrangles to be joined and from which hexahedra will be created (multiple quad case).
-- *fromPointA*: a vertex belonging to the first quadrangle of the set of quadrangles.
-- *fromPointB*: a vertex, consecutive to previous Point a, belonging to the first quadrangle.
-    
 - *quadDest*  : a quadrangle from the set of targeted quadrangles.
+- *fromPointA*: a vertex belonging to the first quadrangle of the set of quadrangles.
 - *toPointA*  : the target vertex (in the target quadrangle) for *fromPointA*.
+- *fromPointB*: a vertex, consecutive to previous Point a, belonging to the first quadrangle.
 - *toPointB*  : the target vertex (in the target quadrangle) for *fromPointB*.
 
 - *nbLayers*  : number of layers of hexahedra issued from the operation.
 
 To join one quad to an other use the function **joinQuadUni**::
 
-       elts = doc.joinQuadUni(quad, quadDest, fromPointA, fromPointB, toPointA, toPointB, nbLayers)
+       elts = doc.joinQuadUni(quad, quadDest, fromPointA, toPointA, fromPointB, toPointB, nbLayers)
 
 To join a set of quads to another quad use the function **joinQuadsUni**::
 
-       elts = doc.joinQuadsUni(quads, quadDest, fromPointA, fromPointB, toPointA, toPointB, nbLayers)
+       elts = doc.joinQuadsUni(quads, quadDest, fromPointA, toPointA, fromPointB, toPointB, nbLayers)
 
 GUI command: :ref:`guijoinquadsuniform`
 
@@ -142,22 +141,21 @@ The following data are required:
 
 - *quad*      : the quad to be joined and from which hexahedra will be created (one quad case).
 - *quads*     : the set of quadrangles to be joined and from which hexahedra will be created (multiple quads case).
-- *fromPointA*: a vertex belonging to the first quadrangle of the set of quadrangles.
-- *fromPointB*: a vertex, consecutive to previous Point a, belonging to the first quadrangle.
-    
 - *quadDest*  : a quadrangle from the set of targeted quadrangles.
+- *fromPointA*: a vertex belonging to the first quadrangle of the set of quadrangles.
 - *toPointA*  : the target vertex (in the target quadrangle) for *fromPointA*.
+- *fromPointB*: a vertex, consecutive to previous Point a, belonging to the first quadrangle.
 - *toPointB*  : the target vertex (in the target quadrangle) for *fromPointB*.
 
 - *th*    : a list of heights to specify the size of each layer of hexahedra issued from the operation.
 
 To make a custom join of one quad to another use the function **joinQuad**::
 
-       elts = doc.joinQuad(quad, quadDest, fromPointA, fromPointB, toPointA, toPointB, th)
+       elts = doc.joinQuad(quad, quadDest, fromPointA, toPointA, fromPointB, toPointB, th)
        
 To make a custom join of a set of quads to another quad use the function **joinQuads**::
 
-       elts = doc.joinQuads(quads, quadDest, fromPointA, fromPointB, toPointA, toPointB, th)
+       elts = doc.joinQuads(quads, quadDest, fromPointA, toPointA, fromPointB, toPointB, th)
 
 GUI command: :ref:`guijoinquadscustom`
 
index 8e7378f7ddebb65f3d1b42473dd0b8a9734c06ae..fc4a36f4277b9ae31cfb4e54137bfe5437881ac3 100644 (file)
@@ -304,7 +304,7 @@ void Elements::checkSense (int nro, Vertex* v1, Vertex* v2, Quad* quad)
    cpchar where = nro < 4 ? "start" : "target";
    setError (HERR);
    Mess << "Arguments nr " << nro << " and " << nro+2 
-        << " : these vertices doenst define an edge of the "
+        << " : these vertices do not define an edge of the "
         << where << " quad";
 }
 // ======================================================== checkPhi
index 11fece565d73315b48af7dd0f405b414094b1cf6..b778b18651ff564bc849f33b8f66209988d92d7a 100644 (file)
@@ -2944,7 +2944,9 @@ QModelIndex DocumentModel::joinQuadUni(QModelIndex&  istart, QModelIndex& idest,
     HEXA_NS::Vertex* hv3 = getHexaPtr<HEXA_NS::Vertex*>(iv3);
     HEXA_NS::Vertex* hv4 = getHexaPtr<HEXA_NS::Vertex*>(iv4);
 
-    HEXA_NS::Elements* helts = _hexaDocument->joinQuadUni(hstart, hdest, hv1, hv2, hv3, hv4, nb);
+    // Be careful, the order of vertices is not the same in joinQuadUni of HexDocument_v6.cxx
+    // and corresponding python dump
+    HEXA_NS::Elements* helts = _hexaDocument->joinQuadUni(hstart, hdest, hv1, hv3, hv2, hv4, nb);
     if (BadElement(helts))
         return result;
 
@@ -2965,7 +2967,9 @@ QModelIndex DocumentModel::joinQuad(QModelIndex&  istart, QModelIndex& idest, QM
     HEXA_NS::Vertex* hva2 = getHexaPtr<HEXA_NS::Vertex*>(iva2);
     HEXA_NS::Vertex* hvb2 = getHexaPtr<HEXA_NS::Vertex*>(ivb2);
 
-    HEXA_NS::Elements* helts = _hexaDocument->joinQuad(hstart, hdest, hva1, hvb1, hva2, hvb2, tlen);
+    // Be careful, the order of vertices is not the same in joinQuadUni of HexDocument_v6.cxx
+    // and corresponding python dump
+    HEXA_NS::Elements* helts = _hexaDocument->joinQuad(hstart, hdest, hva1, hva2, hvb1, hvb2, tlen);
     if (BadElement(helts))
         return result;
 
@@ -2990,7 +2994,9 @@ QModelIndex DocumentModel::joinQuadsUni(QModelIndexList& istarts, QModelIndex& i
     HEXA_NS::Vertex* hv3 = getHexaPtr<HEXA_NS::Vertex*>(iv3);
     HEXA_NS::Vertex* hv4 = getHexaPtr<HEXA_NS::Vertex*>(iv4);
 
-    HEXA_NS::Elements* helts = _hexaDocument->joinQuadsUni(hstarts, hdest, hv1, hv2, hv3, hv4, nb);
+    // Be careful, the order of vertices is not the same in joinQuadUni of HexDocument_v6.cxx
+    // and corresponding python dump
+    HEXA_NS::Elements* helts = _hexaDocument->joinQuadsUni(hstarts, hdest, hv1, hv3, hv2, hv4, nb);
     if (BadElement(helts))
         return result;
 
@@ -3015,7 +3021,9 @@ QModelIndex DocumentModel::joinQuads(QModelIndexList& istarts, QModelIndex& ides
     HEXA_NS::Vertex* hva2 = getHexaPtr<HEXA_NS::Vertex*>(iva2);
     HEXA_NS::Vertex* hvb2 = getHexaPtr<HEXA_NS::Vertex*>(ivb2);
 
-    HEXA_NS::Elements* helts = _hexaDocument->joinQuads(hstarts, hdest, hva1, hvb1, hva2, hvb2, tlen);
+    // Be careful, the order of vertices is not the same in joinQuadUni of HexDocument_v6.cxx
+    // and corresponding python dump
+    HEXA_NS::Elements* helts = _hexaDocument->joinQuads(hstarts, hdest, hva1, hva2, hvb1, hvb2, tlen);
     if (BadElement(helts))
         return result;
 
index 38e5d7ed72475089656897dfd1b353c8efb575a7..083d5d692aba18197048344a6799dbaca9c01f6c 100644 (file)
@@ -3441,10 +3441,10 @@ bool JoinQuadDialog::apply(QModelIndex& result)
             iquads << iquad;
     }
     QModelIndex iquaddest = patternDataModel->mapToSource( _index[quad_dest_le] );
-    QModelIndex ivex0 = patternDataModel->mapToSource( _index[vex0_le] );
-    QModelIndex ivex1 = patternDataModel->mapToSource( _index[vex1_le] );
-    QModelIndex ivex2 = patternDataModel->mapToSource( _index[vex2_le] );
-    QModelIndex ivex3 = patternDataModel->mapToSource( _index[vex3_le] );
+    QModelIndex ivex0 = patternDataModel->mapToSource( _index[vex0_le] ); // from point a
+    QModelIndex ivex1 = patternDataModel->mapToSource( _index[vex1_le] ); // from point b
+    QModelIndex ivex2 = patternDataModel->mapToSource( _index[vex2_le] ); // to point a
+    QModelIndex ivex3 = patternDataModel->mapToSource( _index[vex3_le] ); // to point b
     double nb = nb_spb->value();
 
     vector<double> heights;