cellsToCells: Fix normalisation of matching and nearest methods

This commit is contained in:
Will Bainbridge
2025-02-04 17:44:38 +00:00
parent 3538462d50
commit 86e126a7bc
2 changed files with 6 additions and 10 deletions

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | Website: https://openfoam.org
\\ / A nd | Copyright (C) 2013-2024 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2013-2025 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -128,7 +128,6 @@ Foam::scalar Foam::cellsToCellss::matching::calculateAddressing
DynamicList<label> srcSeeds(10);
const scalarField& srcVc = srcMesh.cellVolumes();
const scalarField& tgtVc = tgtMesh.cellVolumes();
label srcCelli = srcSeedI;
label tgtCelli = tgtSeedI;
@ -162,13 +161,13 @@ Foam::scalar Foam::cellsToCellss::matching::calculateAddressing
// transfer addressing into persistent storage
forAll(srcToTgtCellAddr, i)
{
srcToTgtCellWght[i] = scalarList(srcToTgt[i].size(), srcVc[i]);
srcToTgtCellWght[i] = scalarList(srcToTgt[i].size(), scalar(1));
srcToTgtCellAddr[i].transfer(srcToTgt[i]);
}
forAll(tgtToSrcCellAddr, i)
{
tgtToSrcCellWght[i] = scalarList(tgtToSrc[i].size(), tgtVc[i]);
tgtToSrcCellWght[i] = scalarList(tgtToSrc[i].size(), scalar(1));
tgtToSrcCellAddr[i].transfer(tgtToSrc[i]);
}
@ -307,7 +306,6 @@ void Foam::cellsToCellss::matching::normalise
{
srcToTgtAddr[srcCelli].resize(1);
srcToTgtWght[srcCelli].resize(1);
srcToTgtWght[srcCelli][0] = 1;
}
}
}

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | Website: https://openfoam.org
\\ / A nd | Copyright (C) 2013-2023 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2013-2025 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -116,7 +116,6 @@ Foam::scalar Foam::cellsToCellss::nearest::calculateAddressing
List<DynamicList<label>> tgtToSrc(tgtMesh.nCells());
const scalarField& srcVc = srcMesh.cellVolumes();
const scalarField& tgtVc = tgtMesh.cellVolumes();
{
label srcCelli = srcSeedI;
@ -202,13 +201,13 @@ Foam::scalar Foam::cellsToCellss::nearest::calculateAddressing
// transfer addressing into persistent storage
forAll(srcToTgtCellAddr, i)
{
srcToTgtCellWght[i] = scalarList(srcToTgt[i].size(), srcVc[i]);
srcToTgtCellWght[i] = scalarList(srcToTgt[i].size(), scalar(1));
srcToTgtCellAddr[i].transfer(srcToTgt[i]);
}
forAll(tgtToSrcCellAddr, i)
{
tgtToSrcCellWght[i] = scalarList(tgtToSrc[i].size(), tgtVc[i]);
tgtToSrcCellWght[i] = scalarList(tgtToSrc[i].size(), scalar(1));
tgtToSrcCellAddr[i].transfer(tgtToSrc[i]);
}
@ -417,7 +416,6 @@ void Foam::cellsToCellss::nearest::normalise
{
srcToTgtAddr[srcCelli].resize(1);
srcToTgtWght[srcCelli].resize(1);
srcToTgtWght[srcCelli][0] = 1;
}
}
}