From 89c8187135864523ffc9e04daeb22727c451a3ab Mon Sep 17 00:00:00 2001 From: Will Bainbridge Date: Wed, 8 Nov 2023 11:50:41 +0000 Subject: [PATCH] decomposePar: Create nonConformalProcessorCyclic fields Previously this was creating simple processorCyclic fields on the nonConformalProcessorCyclic patches using a patchType override. The fact that this worked is an encouraging indication of the system's robustness, but it is more logical to create a field which directly corresponds to the underlying patch type. --- .../decomposePar/fvFieldDecomposerTemplates.C | 48 +++++++++++-------- 1 file changed, 27 insertions(+), 21 deletions(-) diff --git a/applications/utilities/parallelProcessing/decomposePar/fvFieldDecomposerTemplates.C b/applications/utilities/parallelProcessing/decomposePar/fvFieldDecomposerTemplates.C index e43b26eeb4..417bb0ff78 100644 --- a/applications/utilities/parallelProcessing/decomposePar/fvFieldDecomposerTemplates.C +++ b/applications/utilities/parallelProcessing/decomposePar/fvFieldDecomposerTemplates.C @@ -252,44 +252,50 @@ Foam::fvFieldDecomposer::decomposeVolField refCast(procPatch) .referPatch().nbrPatchID(); + // Use `fvPatchField::New` rather than + // `new processorCyclicFvPatchField` so that derivations + // (such as non-conformal processor cyclics) are constructed bf.set ( procPatchi, - new processorCyclicFvPatchField + fvPatchField::New ( + procPatch.type(), procPatch, - vf(), - mapCellToFace - ( - labelUList(), - completeMesh_.lduAddr().patchAddr - ( - nbrCompletePatchi - ), - field.primitiveField(), - faceProcAddressingBf_[proci][procPatchi] - ) + vf() ) ); + + bf[procPatchi] = + mapCellToFace + ( + labelUList(), + completeMesh_.lduAddr().patchAddr(nbrCompletePatchi), + field.primitiveField(), + faceProcAddressingBf_[proci][procPatchi] + ); } else if (isA(procPatch)) { bf.set ( procPatchi, - new processorFvPatchField + fvPatchField::New ( + procPatch.type(), procPatch, - vf(), - mapCellToFace - ( - completeMesh_.owner(), - completeMesh_.neighbour(), - field.primitiveField(), - faceProcAddressingBf_[proci][procPatchi] - ) + vf() ) ); + + bf[procPatchi] = + mapCellToFace + ( + completeMesh_.owner(), + completeMesh_.neighbour(), + field.primitiveField(), + faceProcAddressingBf_[proci][procPatchi] + ); } else {