diff --git a/Mesh/DivideAndConquer.cpp b/Mesh/DivideAndConquer.cpp index 183da42e308f63ecb092614783e0d151181a85e6..d23a3c773f48821db71c464a3fb7acc5baad46d6 100644 --- a/Mesh/DivideAndConquer.cpp +++ b/Mesh/DivideAndConquer.cpp @@ -535,6 +535,7 @@ void DocRecord::voronoiCell(PointNumero pt, std::vector<SPoint2> &pts) const { if (!_adjacencies){ Msg::Error("No adjacencies were created"); + return; } const int n = _adjacencies[pt].t_length; for(int j = 0; j < n; j++) { diff --git a/Mesh/Field.cpp b/Mesh/Field.cpp index 6b55d146de7cb6b202b08d9368f8697fae59bc96..f6f5f3c19fcd79e282f329d6428623721cdf46b4 100644 --- a/Mesh/Field.cpp +++ b/Mesh/Field.cpp @@ -1246,8 +1246,11 @@ class PostViewField : public Field // of finding an element if(!octree->searchTensorWithTol(x, y, z, l, 0, 0, 0.05)) Msg::Info("No tensor element found containing point (%g,%g,%g)", x, y, z); - if(l <= 0 && crop_negative_values) - for(int i = 0; i < 9; i++) l[i] = MAX_LC; + if(crop_negative_values){ + for(int i = 0; i < 9; i++){ + if(l[i] <= 0) l[i] = MAX_LC; + } + } metr(0, 0) = l[0]; metr(0, 1) = l[1]; metr(0, 2) = l[2];