@@ -173,16 +173,21 @@ void CInterpolator::ReconstructBoundary(unsigned long val_zone, int val_marker){
173173
174174 unsigned long iVertex, kVertex ;
175175
176- unsigned long *uptr, nVertex, iDim, nDim, iPoint;
176+ unsigned long *uptr, nVertex, nElems, iDim, nDim, iPoint;
177177
178178 unsigned long nGlobalLinkedNodes, nLocalVertex, nLocalLinkedNodes;
179179
180180 nDim = geom->GetnDim ();
181181
182- if ( val_marker != -1 )
182+ /* --- If this zone has no parts of the marker, it will not participate
183+ * in the first part of this function (collection). ---*/
184+ if ( val_marker != -1 ){
183185 nVertex = geom->GetnVertex ( val_marker );
184- else
186+ nElems = geom->GetnElem_Bound (val_marker);
187+ } else {
185188 nVertex = 0 ;
189+ nElems = 0 ;
190+ }
186191
187192 /* --- Get the number of domain vertices on the marker, and a mapping
188193 * (iVertex) -> (iLocalVertex, non-domain points being ignored). ---*/
@@ -220,7 +225,7 @@ void CInterpolator::ReconstructBoundary(unsigned long val_zone, int val_marker){
220225 }
221226
222227 /* --- Define the neighbors map. ---*/
223- for (unsigned long iElem=0 ; iElem < geom-> nElem_Bound [val_marker] ; iElem++){
228+ for (unsigned long iElem=0 ; iElem < nElems ; iElem++){
224229 CPrimalGrid* elem = geom->bound [val_marker][iElem];
225230 for (unsigned short iNode=0 ; iNode<elem->GetnNodes (); iNode++){
226231 iPoint = elem->GetNode (iNode);
0 commit comments