mirror of
https://develop.openfoam.com/Development/openfoam.git
synced 2025-11-28 03:28:01 +00:00
ENH: rationalize some globalIndex gather routines
- replace gatherValues() with listGatherValues(), which returns the gathered values instead of passing by argument. This makes it less fragile and more convenient. Naming as per Pstream::listGatherValues(), but still retaining the original parameter order. - rename inplace 'gather' variant as 'gatherInplace' for clarity. - changed signature of lowest-level globalIndex::gather routines from List<Type> to UList<Type> for the output and removed any resizing. This means that the caller is responsible for ensuring that the receiving field is adequately sized (on master). This change allows potential reuse of 'work' arrays etc. The only code change for using this low-level gather was in GAMGAgglomeration.
This commit is contained in:
@ -238,8 +238,7 @@ void Foam::functionObjects::AMIWeights::writeWeightField
|
||||
);
|
||||
|
||||
// Collect field
|
||||
scalarField mergedWeights;
|
||||
globalFaces().gather(weightSum, mergedWeights);
|
||||
scalarField mergedWeights = globalFaces().gather(weightSum);
|
||||
|
||||
const bool isACMI = isA<cyclicACMIPolyPatch>(cpp);
|
||||
|
||||
@ -248,7 +247,7 @@ void Foam::functionObjects::AMIWeights::writeWeightField
|
||||
{
|
||||
const cyclicACMIPolyPatch& pp = refCast<const cyclicACMIPolyPatch>(cpp);
|
||||
|
||||
globalFaces().gather(pp.mask(), mergedMask);
|
||||
mergedMask = globalFaces().gather(pp.mask());
|
||||
}
|
||||
|
||||
if (Pstream::master())
|
||||
|
||||
Reference in New Issue
Block a user