cellsToCells: Fix normalisation of matching and nearest methods
This commit is contained in:
@ -2,7 +2,7 @@
|
|||||||
========= |
|
========= |
|
||||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||||
\\ / O peration | Website: https://openfoam.org
|
\\ / O peration | Website: https://openfoam.org
|
||||||
\\ / A nd | Copyright (C) 2013-2024 OpenFOAM Foundation
|
\\ / A nd | Copyright (C) 2013-2025 OpenFOAM Foundation
|
||||||
\\/ M anipulation |
|
\\/ M anipulation |
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
License
|
License
|
||||||
@ -128,7 +128,6 @@ Foam::scalar Foam::cellsToCellss::matching::calculateAddressing
|
|||||||
DynamicList<label> srcSeeds(10);
|
DynamicList<label> srcSeeds(10);
|
||||||
|
|
||||||
const scalarField& srcVc = srcMesh.cellVolumes();
|
const scalarField& srcVc = srcMesh.cellVolumes();
|
||||||
const scalarField& tgtVc = tgtMesh.cellVolumes();
|
|
||||||
|
|
||||||
label srcCelli = srcSeedI;
|
label srcCelli = srcSeedI;
|
||||||
label tgtCelli = tgtSeedI;
|
label tgtCelli = tgtSeedI;
|
||||||
@ -162,13 +161,13 @@ Foam::scalar Foam::cellsToCellss::matching::calculateAddressing
|
|||||||
// transfer addressing into persistent storage
|
// transfer addressing into persistent storage
|
||||||
forAll(srcToTgtCellAddr, i)
|
forAll(srcToTgtCellAddr, i)
|
||||||
{
|
{
|
||||||
srcToTgtCellWght[i] = scalarList(srcToTgt[i].size(), srcVc[i]);
|
srcToTgtCellWght[i] = scalarList(srcToTgt[i].size(), scalar(1));
|
||||||
srcToTgtCellAddr[i].transfer(srcToTgt[i]);
|
srcToTgtCellAddr[i].transfer(srcToTgt[i]);
|
||||||
}
|
}
|
||||||
|
|
||||||
forAll(tgtToSrcCellAddr, 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]);
|
tgtToSrcCellAddr[i].transfer(tgtToSrc[i]);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -307,7 +306,6 @@ void Foam::cellsToCellss::matching::normalise
|
|||||||
{
|
{
|
||||||
srcToTgtAddr[srcCelli].resize(1);
|
srcToTgtAddr[srcCelli].resize(1);
|
||||||
srcToTgtWght[srcCelli].resize(1);
|
srcToTgtWght[srcCelli].resize(1);
|
||||||
srcToTgtWght[srcCelli][0] = 1;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -2,7 +2,7 @@
|
|||||||
========= |
|
========= |
|
||||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||||
\\ / O peration | Website: https://openfoam.org
|
\\ / O peration | Website: https://openfoam.org
|
||||||
\\ / A nd | Copyright (C) 2013-2023 OpenFOAM Foundation
|
\\ / A nd | Copyright (C) 2013-2025 OpenFOAM Foundation
|
||||||
\\/ M anipulation |
|
\\/ M anipulation |
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
License
|
License
|
||||||
@ -116,7 +116,6 @@ Foam::scalar Foam::cellsToCellss::nearest::calculateAddressing
|
|||||||
List<DynamicList<label>> tgtToSrc(tgtMesh.nCells());
|
List<DynamicList<label>> tgtToSrc(tgtMesh.nCells());
|
||||||
|
|
||||||
const scalarField& srcVc = srcMesh.cellVolumes();
|
const scalarField& srcVc = srcMesh.cellVolumes();
|
||||||
const scalarField& tgtVc = tgtMesh.cellVolumes();
|
|
||||||
|
|
||||||
{
|
{
|
||||||
label srcCelli = srcSeedI;
|
label srcCelli = srcSeedI;
|
||||||
@ -202,13 +201,13 @@ Foam::scalar Foam::cellsToCellss::nearest::calculateAddressing
|
|||||||
// transfer addressing into persistent storage
|
// transfer addressing into persistent storage
|
||||||
forAll(srcToTgtCellAddr, i)
|
forAll(srcToTgtCellAddr, i)
|
||||||
{
|
{
|
||||||
srcToTgtCellWght[i] = scalarList(srcToTgt[i].size(), srcVc[i]);
|
srcToTgtCellWght[i] = scalarList(srcToTgt[i].size(), scalar(1));
|
||||||
srcToTgtCellAddr[i].transfer(srcToTgt[i]);
|
srcToTgtCellAddr[i].transfer(srcToTgt[i]);
|
||||||
}
|
}
|
||||||
|
|
||||||
forAll(tgtToSrcCellAddr, 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]);
|
tgtToSrcCellAddr[i].transfer(tgtToSrc[i]);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -417,7 +416,6 @@ void Foam::cellsToCellss::nearest::normalise
|
|||||||
{
|
{
|
||||||
srcToTgtAddr[srcCelli].resize(1);
|
srcToTgtAddr[srcCelli].resize(1);
|
||||||
srcToTgtWght[srcCelli].resize(1);
|
srcToTgtWght[srcCelli].resize(1);
|
||||||
srcToTgtWght[srcCelli][0] = 1;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user