mirror of
https://develop.openfoam.com/Development/openfoam.git
synced 2025-11-28 03:28:01 +00:00
ENH: use mapDistribute linear construct order in a few places
- simplifies code by avoiding code duplication: * parLagrangianDistributor * meshToMesh (processorLOD and AABBTree methods) BUG: inconsistent mapping when using processorLOD boxes (fixes #2932) - internally the processorLODs createMap() method used a 'localFirst' layout whereas a 'linear' order is what is actually expected for the meshToMesh mapping. This will cause of incorrect behaviour if using processorLOD instead of AABBTree. A dormant bug since processorLOD is not currently selectable.
This commit is contained in:
@ -846,8 +846,8 @@ Foam::meshToMesh::meshToMesh
|
||||
(
|
||||
const polyMesh& src,
|
||||
const polyMesh& tgt,
|
||||
const interpolationMethod& method,
|
||||
const procMapMethod& mapMethod,
|
||||
const interpolationMethod method,
|
||||
const procMapMethod mapMethod,
|
||||
bool interpAllPatches
|
||||
)
|
||||
:
|
||||
@ -884,7 +884,7 @@ Foam::meshToMesh::meshToMesh
|
||||
const polyMesh& tgt,
|
||||
const word& methodName,
|
||||
const word& AMIMethodName,
|
||||
const procMapMethod& mapMethod,
|
||||
const procMapMethod mapMethod,
|
||||
bool interpAllPatches
|
||||
)
|
||||
:
|
||||
@ -914,10 +914,10 @@ Foam::meshToMesh::meshToMesh
|
||||
(
|
||||
const polyMesh& src,
|
||||
const polyMesh& tgt,
|
||||
const interpolationMethod& method,
|
||||
const interpolationMethod method,
|
||||
const HashTable<word>& patchMap,
|
||||
const wordList& cuttingPatches,
|
||||
const procMapMethod& mapMethod,
|
||||
const procMapMethod mapMethod,
|
||||
const bool normalise
|
||||
)
|
||||
:
|
||||
@ -956,7 +956,7 @@ Foam::meshToMesh::meshToMesh
|
||||
const word& AMIMethodName, // boundary mapping
|
||||
const HashTable<word>& patchMap,
|
||||
const wordList& cuttingPatches,
|
||||
const procMapMethod& mapMethod,
|
||||
const procMapMethod mapMethod,
|
||||
const bool normalise
|
||||
)
|
||||
:
|
||||
|
||||
@ -6,7 +6,7 @@
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
Copyright (C) 2012-2016 OpenFOAM Foundation
|
||||
Copyright (C) 2015-2022 OpenCFD Ltd.
|
||||
Copyright (C) 2015-2023 OpenCFD Ltd.
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
This file is part of OpenFOAM.
|
||||
@ -315,8 +315,8 @@ public:
|
||||
(
|
||||
const polyMesh& src,
|
||||
const polyMesh& tgt,
|
||||
const interpolationMethod& method,
|
||||
const procMapMethod& mapMethod = procMapMethod::pmAABB,
|
||||
const interpolationMethod method,
|
||||
const procMapMethod mapMethod = procMapMethod::pmAABB,
|
||||
const bool interpAllPatches = true
|
||||
);
|
||||
|
||||
@ -327,7 +327,7 @@ public:
|
||||
const polyMesh& tgt,
|
||||
const word& methodName, // internal mapping
|
||||
const word& AMIMethodName, // boundary mapping
|
||||
const procMapMethod& mapMethod = procMapMethod::pmAABB,
|
||||
const procMapMethod mapMethod = procMapMethod::pmAABB,
|
||||
const bool interpAllPatches = true
|
||||
);
|
||||
|
||||
@ -336,10 +336,10 @@ public:
|
||||
(
|
||||
const polyMesh& src,
|
||||
const polyMesh& tgt,
|
||||
const interpolationMethod& method,
|
||||
const interpolationMethod method,
|
||||
const HashTable<word>& patchMap,
|
||||
const wordList& cuttingPatches,
|
||||
const procMapMethod& mapMethod = procMapMethod::pmAABB,
|
||||
const procMapMethod mapMethod = procMapMethod::pmAABB,
|
||||
const bool normalise = true
|
||||
);
|
||||
|
||||
@ -353,7 +353,7 @@ public:
|
||||
const word& AMIMethodName, // boundary mapping
|
||||
const HashTable<word>& patchMap,
|
||||
const wordList& cuttingPatches,
|
||||
const procMapMethod& mapMethod = procMapMethod::pmAABB,
|
||||
const procMapMethod mapMethod = procMapMethod::pmAABB,
|
||||
const bool normalise = true
|
||||
);
|
||||
|
||||
|
||||
@ -114,6 +114,11 @@ Foam::autoPtr<Foam::mapDistribute> Foam::meshToMesh::calcProcMap
|
||||
const polyMesh& tgt
|
||||
) const
|
||||
{
|
||||
// Uses linear construct order
|
||||
const
|
||||
mapDistributeBase::layoutTypes constructLayout =
|
||||
mapDistributeBase::layoutTypes::linear;
|
||||
|
||||
switch (procMapMethod_)
|
||||
{
|
||||
case procMapMethod::pmLOD:
|
||||
@ -139,7 +144,7 @@ Foam::autoPtr<Foam::mapDistribute> Foam::meshToMesh::calcProcMap
|
||||
src.nCells()
|
||||
);
|
||||
|
||||
return boxLOD.map();
|
||||
return boxLOD.map(constructLayout);
|
||||
break;
|
||||
}
|
||||
default:
|
||||
@ -232,25 +237,10 @@ Foam::autoPtr<Foam::mapDistribute> Foam::meshToMesh::calcProcMap
|
||||
}
|
||||
|
||||
|
||||
labelList recvSizes;
|
||||
Pstream::exchangeSizes(sendMap, recvSizes, UPstream::worldComm);
|
||||
|
||||
// Uses linear receive order
|
||||
labelListList constructMap(UPstream::nProcs());
|
||||
|
||||
label constructSize = 0;
|
||||
forAll(constructMap, proci)
|
||||
{
|
||||
const label len = recvSizes[proci];
|
||||
constructMap[proci] = identity(len, constructSize);
|
||||
constructSize += len;
|
||||
}
|
||||
|
||||
return autoPtr<mapDistribute>::New
|
||||
(
|
||||
constructSize,
|
||||
std::move(sendMap),
|
||||
std::move(constructMap)
|
||||
constructLayout,
|
||||
std::move(sendMap)
|
||||
);
|
||||
break;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user