From ccce2cc7e5def1b3089e917c6f352881888ada06 Mon Sep 17 00:00:00 2001 From: Christophe Bourcier Date: Fri, 2 Aug 2019 11:43:44 +0200 Subject: [PATCH] Fix wrong order of points in joinQuad that made an error when testing Bielle.xls We keep the order of points from python scripts to keep compatibility with existing scripts --- doc/tui_prism_join_quad.rst | 18 ++++++++---------- src/HEXABLOCK/HexElements_check.cxx | 2 +- .../HEXABLOCKGUI_DocumentModel.cxx | 16 ++++++++++++---- .../HEXABLOCKGUI_DocumentPanel.cxx | 8 ++++---- 4 files changed, 25 insertions(+), 19 deletions(-) diff --git a/doc/tui_prism_join_quad.rst b/doc/tui_prism_join_quad.rst index 6d2bebc..c30689e 100644 --- a/doc/tui_prism_join_quad.rst +++ b/doc/tui_prism_join_quad.rst @@ -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` diff --git a/src/HEXABLOCK/HexElements_check.cxx b/src/HEXABLOCK/HexElements_check.cxx index 8e7378f..fc4a36f 100644 --- a/src/HEXABLOCK/HexElements_check.cxx +++ b/src/HEXABLOCK/HexElements_check.cxx @@ -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 diff --git a/src/HEXABLOCKGUI/HEXABLOCKGUI_DocumentModel.cxx b/src/HEXABLOCKGUI/HEXABLOCKGUI_DocumentModel.cxx index 11fece5..b778b18 100644 --- a/src/HEXABLOCKGUI/HEXABLOCKGUI_DocumentModel.cxx +++ b/src/HEXABLOCKGUI/HEXABLOCKGUI_DocumentModel.cxx @@ -2944,7 +2944,9 @@ QModelIndex DocumentModel::joinQuadUni(QModelIndex& istart, QModelIndex& idest, HEXA_NS::Vertex* hv3 = getHexaPtr(iv3); HEXA_NS::Vertex* hv4 = getHexaPtr(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(iva2); HEXA_NS::Vertex* hvb2 = getHexaPtr(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(iv3); HEXA_NS::Vertex* hv4 = getHexaPtr(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(iva2); HEXA_NS::Vertex* hvb2 = getHexaPtr(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; diff --git a/src/HEXABLOCKGUI/HEXABLOCKGUI_DocumentPanel.cxx b/src/HEXABLOCKGUI/HEXABLOCKGUI_DocumentPanel.cxx index 38e5d7e..083d5d6 100644 --- a/src/HEXABLOCKGUI/HEXABLOCKGUI_DocumentPanel.cxx +++ b/src/HEXABLOCKGUI/HEXABLOCKGUI_DocumentPanel.cxx @@ -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 heights; -- 2.39.2