diff --git a/src/sampling/sampledSurface/isoSurface/isoSurfaceTemplates.C b/src/sampling/sampledSurface/isoSurface/isoSurfaceTemplates.C index d7903551c9c70d4508faacbb0b13fd1b41acdd2d..bddf6fedf21c5a621bb76bddabbb19a02c503fb6 100644 --- a/src/sampling/sampledSurface/isoSurface/isoSurfaceTemplates.C +++ b/src/sampling/sampledSurface/isoSurface/isoSurfaceTemplates.C @@ -96,11 +96,18 @@ Foam::isoSurface::adaptPatchFields sliceFld ) ); - sliceFld.boundaryField()[patchI] == - mesh.boundary()[patchI].patchInternalField - ( - sliceFld - ); + + // Note: cannot use patchInternalField since uses emptyFvPatch::size + // Do our own internalField instead. + const unallocLabelList& faceCells = + mesh.boundary()[patchI].patch().faceCells(); + + Field<Type>& pfld = sliceFld.boundaryField()[patchI]; + pfld.setSize(faceCells.size()); + forAll(faceCells, i) + { + pfld[i] = sliceFld[faceCells[i]]; + } } else if (isA<cyclicPolyPatch>(pp)) {