diff --git a/src/finiteVolume/interpolation/volPointInterpolation/pointConstraints.C b/src/finiteVolume/interpolation/volPointInterpolation/pointConstraints.C index 0aba815147..efbbaa7140 100644 --- a/src/finiteVolume/interpolation/volPointInterpolation/pointConstraints.C +++ b/src/finiteVolume/interpolation/volPointInterpolation/pointConstraints.C @@ -56,8 +56,6 @@ void Foam::pointConstraints::makePatchPatchAddressing() const polyMesh& mesh = pMesh(); const pointBoundaryMesh& pbm = pMesh.boundary(); - const polyBoundaryMesh& bm = mesh.boundaryMesh(); - // first count the total number of patch-patch points @@ -65,9 +63,15 @@ void Foam::pointConstraints::makePatchPatchAddressing() forAll(pbm, patchi) { - if (!isA(pbm[patchi]) && !pbm[patchi].coupled()) + const auto* fpp = isA(pbm[patchi]); + if + ( + fpp + && !isA(pbm[patchi]) + && !pbm[patchi].coupled() + ) { - const labelList& bp = bm[patchi].boundaryPoints(); + const labelList& bp = fpp->patch().boundaryPoints(); nPatchPatchPoints += bp.size(); @@ -103,9 +107,15 @@ void Foam::pointConstraints::makePatchPatchAddressing() forAll(pbm, patchi) { - if (!isA(pbm[patchi]) && !pbm[patchi].coupled()) + const auto* fpp = isA(pbm[patchi]); + if + ( + fpp + && !isA(pbm[patchi]) + && !pbm[patchi].coupled() + ) { - const labelList& bp = bm[patchi].boundaryPoints(); + const labelList& bp = fpp->patch().boundaryPoints(); const labelList& meshPoints = pbm[patchi].meshPoints(); forAll(bp, pointi) @@ -163,9 +173,15 @@ void Foam::pointConstraints::makePatchPatchAddressing() // Copy from patchPatch constraints into coupledConstraints. forAll(pbm, patchi) { - if (!isA(pbm[patchi]) && !pbm[patchi].coupled()) + const auto* fpp = isA(pbm[patchi]); + if + ( + fpp + && !isA(pbm[patchi]) + && !pbm[patchi].coupled() + ) { - const labelList& bp = bm[patchi].boundaryPoints(); + const labelList& bp = fpp->patch().boundaryPoints(); const labelList& meshPoints = pbm[patchi].meshPoints(); forAll(bp, pointi)