From 9b35b2fefc9c5f6b1c5146ab82955a00045098e5 Mon Sep 17 00:00:00 2001 From: benoit128 Date: Mon, 16 Dec 2024 13:09:38 +0100 Subject: [PATCH] CPlot: corr. displayActivePoint --- Cassiopee/CPlot/CPlot/Display/displayActivePoint.cpp | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/Cassiopee/CPlot/CPlot/Display/displayActivePoint.cpp b/Cassiopee/CPlot/CPlot/Display/displayActivePoint.cpp index f520852e3..0b8b70763 100644 --- a/Cassiopee/CPlot/CPlot/Display/displayActivePoint.cpp +++ b/Cassiopee/CPlot/CPlot/Display/displayActivePoint.cpp @@ -352,17 +352,21 @@ void Data::displayActivePoint() E_Int ncon = ptrState->activePointL; E_Int* connect = z->connect[ncon]; E_Int net = z->nec[ncon]; - + E_Int eltType = z->eltType[ncon]; E_Int ind1, ind2; double dx, dy, dz, h; bool is1D = false; if (eltType == 1) is1D = true; + if (ne >= net || ne < 0) is1D = false; // force + if (is1D) { h = 0.; ind1 = connect[ne]; - ind2 = connect[ne+net]; + if (ne+1 < net) ind2 = connect[ne+1]; + else if (ne-1 >= 0) ind2 = connect[ne-1]; + else ind2 = ind1; dx = z->x[ind2] - z->x[ind1]; h += dx*dx; dy = z->y[ind2] - z->y[ind1];