diff --git a/src/parallel/decompose/faDecompose/faFieldDecomposer.C b/src/parallel/decompose/faDecompose/faFieldDecomposer.C index f0966dfe47a7565a28b1a56cb6cec35798ead540..6c6bc6a73b4cecb1b7e1e8c859db6512617745b0 100644 --- a/src/parallel/decompose/faDecompose/faFieldDecomposer.C +++ b/src/parallel/decompose/faDecompose/faFieldDecomposer.C @@ -293,7 +293,7 @@ void Foam::faFieldDecomposer::reset new processorEdgePatchFieldDecomposer ( procMesh_.boundary()[patchi].size(), - static_cast<const labelUList&>(localPatchSlice) + localPatchSlice ) ); } @@ -309,6 +309,15 @@ void Foam::faFieldDecomposer::reset(const faMesh& completeMesh) processorAreaPatchFieldDecomposerPtrs_.resize(nMappers); processorEdgePatchFieldDecomposerPtrs_.resize(nMappers); + // Create weightings now - needed for proper parallel synchronization + (void)completeMesh.weights(); + + // faPatches don't have their own start() - so these are invariant + const labelList completePatchStarts + ( + completeMesh.boundary().patchStarts() + ); + forAll(boundaryAddressing_, patchi) { const label oldPatchi = boundaryAddressing_[patchi]; @@ -324,7 +333,7 @@ void Foam::faFieldDecomposer::reset(const faMesh& completeMesh) ( completeMesh.boundary()[oldPatchi].size(), localPatchSlice, - completeMesh.boundary()[oldPatchi].start() + completePatchStarts[oldPatchi] ) ); } @@ -346,7 +355,7 @@ void Foam::faFieldDecomposer::reset(const faMesh& completeMesh) new processorEdgePatchFieldDecomposer ( procMesh_.boundary()[patchi].size(), - static_cast<const labelUList&>(localPatchSlice) + localPatchSlice ) ); } diff --git a/src/parallel/decompose/faDecompose/faFieldDecomposerFields.C b/src/parallel/decompose/faDecompose/faFieldDecomposerFields.C index 1b7eaea40f260387e5584a03cceab28d0af9af35..0b73aa7619450936fc468d9cecb35d45e32f0bde 100644 --- a/src/parallel/decompose/faDecompose/faFieldDecomposerFields.C +++ b/src/parallel/decompose/faDecompose/faFieldDecomposerFields.C @@ -219,9 +219,9 @@ void Foam::faFieldDecomposer::decomposeFields const PtrList<GeoField>& fields ) const { - forAll(fields, fieldI) + forAll(fields, fieldi) { - decomposeField(fields[fieldI])().write(); + decomposeField(fields[fieldi])().write(); } } diff --git a/src/parallel/reconstruct/faReconstruct/faMeshReconstructor.C b/src/parallel/reconstruct/faReconstruct/faMeshReconstructor.C index 67e41128620ba747ca2a9bc47ae4333359dd8572..c3b6330a2d2fe6d6ec92ff0e6ecd8d4cc41fa133 100644 --- a/src/parallel/reconstruct/faReconstruct/faMeshReconstructor.C +++ b/src/parallel/reconstruct/faReconstruct/faMeshReconstructor.C @@ -517,7 +517,13 @@ void Foam::faMeshReconstructor::createMesh() ); } + // Serial mesh - no parallel communication + + const bool oldParRun = Pstream::parRun(false); + completeMesh.addFaPatches(completePatches); + + Pstream::parRun(oldParRun); // Restore parallel state }