Skip to content
Snippets Groups Projects
Commit 0c541cba authored by Christophe Geuzaine's avatar Christophe Geuzaine
Browse files

fix logic to avoid negative array index

parent 4f304430
No related branches found
No related tags found
No related merge requests found
...@@ -66,9 +66,10 @@ void ExtrudeParams::Extrude(int iLayer, int iElemLayer, ...@@ -66,9 +66,10 @@ void ExtrudeParams::Extrude(int iLayer, int iElemLayer,
// Trevor Strickler (this definitely relies on fixing lateral boundary // Trevor Strickler (this definitely relies on fixing lateral boundary
// extruded surfaces if mesh.ScaleLast is changed by ReplaceDuplicates. This // extruded surfaces if mesh.ScaleLast is changed by ReplaceDuplicates. This
// is done in BoundaryLayers.cpp right now. // is done in BoundaryLayers.cpp right now.
if(geo.Type == BOUNDARY_LAYER && calcLayerScaleFactor[mesh.BoundaryLayerIndex] && if(geo.Type == BOUNDARY_LAYER && iLayer == mesh.NbLayer-1 &&
iLayer == mesh.NbLayer-1 && mesh.BoundaryLayerIndex >= 0 && mesh.BoundaryLayerIndex >= 0 && mesh.BoundaryLayerIndex <= 1 &&
mesh.BoundaryLayerIndex <= 1 && normals[mesh.BoundaryLayerIndex]){ calcLayerScaleFactor[mesh.BoundaryLayerIndex] &&
normals[mesh.BoundaryLayerIndex]){
double scale = 1.0; double scale = 1.0;
normals[mesh.BoundaryLayerIndex]->get_scale(x, y, z, &scale); normals[mesh.BoundaryLayerIndex]->get_scale(x, y, z, &scale);
if(fabs(scale-1.0) <= xyzv::eps) if(fabs(scale-1.0) <= xyzv::eps)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment