diff --git a/src/finiteVolume/interpolation/volPointInterpolation/pointConstraints.C b/src/finiteVolume/interpolation/volPointInterpolation/pointConstraints.C index 0aba8151470a62c15c1e79ec8b9149d3952ad031..efbbaa7140f2d834bc40dfef4e1c1947b53f989e 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<emptyPointPatch>(pbm[patchi]) && !pbm[patchi].coupled()) + const auto* fpp = isA<facePointPatch>(pbm[patchi]); + if + ( + fpp + && !isA<emptyPointPatch>(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<emptyPointPatch>(pbm[patchi]) && !pbm[patchi].coupled()) + const auto* fpp = isA<facePointPatch>(pbm[patchi]); + if + ( + fpp + && !isA<emptyPointPatch>(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<emptyPointPatch>(pbm[patchi]) && !pbm[patchi].coupled()) + const auto* fpp = isA<facePointPatch>(pbm[patchi]); + if + ( + fpp + && !isA<emptyPointPatch>(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)