mirror of
https://develop.openfoam.com/Development/openfoam.git
synced 2025-12-28 03:37:59 +00:00
ENH: extend globalMeshData::calcCellCells handling
- add convenience forms for common combinations - avoid allocation for 1:1 identity agglomerations - support subsetting forms (avoids an intermediate fvMeshSubset) that also return the cellMap - refactored to eliminate code duplication between weighted and unweighted forms
This commit is contained in:
@ -6,7 +6,7 @@
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
Copyright (C) 2011-2017 OpenFOAM Foundation
|
||||
Copyright (C) 2017-2023 OpenCFD Ltd.
|
||||
Copyright (C) 2017-2024 OpenCFD Ltd.
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
This file is part of OpenFOAM.
|
||||
@ -383,9 +383,6 @@ void Foam::multiLevelDecomp::decompose
|
||||
{
|
||||
// Recurse
|
||||
|
||||
// Determine points per domain
|
||||
labelListList domainToPoints(invertOneToMany(nCurrDomains, dist));
|
||||
|
||||
// Extract processor+local index from point-point addressing
|
||||
if (debug && Pstream::master())
|
||||
{
|
||||
@ -510,7 +507,7 @@ void Foam::multiLevelDecomp::decompose
|
||||
// Count the number inbetween blocks of nNext size
|
||||
|
||||
label nPoints = 0;
|
||||
labelList nOutsideConnections(nCurrDomains, Zero);
|
||||
labelList nOutsideConnections(nCurrDomains, Foam::zero{});
|
||||
forAll(pointPoints, pointi)
|
||||
{
|
||||
if ((dist[pointi] / nNext) == blockI)
|
||||
@ -611,19 +608,19 @@ Foam::labelList Foam::multiLevelDecomp::decompose
|
||||
const scalarField& cWeights
|
||||
) const
|
||||
{
|
||||
labelList finalDecomp(cc.size(), Foam::zero{});
|
||||
labelList cellMap(Foam::identity(cc.size()));
|
||||
|
||||
CompactListList<label> cellCells;
|
||||
globalMeshData::calcCellCells
|
||||
(
|
||||
mesh,
|
||||
identity(cc.size()),
|
||||
cc.size(),
|
||||
true,
|
||||
cellMap,
|
||||
cellMap.size(),
|
||||
true, // Global mesh connectivity
|
||||
cellCells
|
||||
);
|
||||
|
||||
labelList finalDecomp(cc.size(), Foam::zero{});
|
||||
labelList cellMap(identity(cc.size()));
|
||||
|
||||
decompose
|
||||
(
|
||||
cellCells.unpack(),
|
||||
@ -648,7 +645,7 @@ Foam::labelList Foam::multiLevelDecomp::decompose
|
||||
) const
|
||||
{
|
||||
labelList finalDecomp(cc.size(), Foam::zero{});
|
||||
labelList cellMap(identity(cc.size()));
|
||||
labelList cellMap(Foam::identity(cc.size()));
|
||||
|
||||
decompose
|
||||
(
|
||||
@ -674,7 +671,7 @@ Foam::labelList Foam::multiLevelDecomp::decompose
|
||||
) const
|
||||
{
|
||||
labelList finalDecomp(cc.size(), Foam::zero{});
|
||||
labelList cellMap(identity(cc.size()));
|
||||
labelList cellMap(Foam::identity(cc.size()));
|
||||
|
||||
decompose
|
||||
(
|
||||
|
||||
Reference in New Issue
Block a user