particle: Removed polyMesh reference

This reference represents unnecessary storage. The mesh can be obtained
from tracking data or passed to the particle evolution functions by
argument.

In addition, removing the mesh reference makes it possible to construct
as particle from an Istream without the need for an iNew class. This
simplifies stream-based transfer, and makes it possible for particles to
be communicated by a polyDistributionMap.
This commit is contained in:
Will Bainbridge
2022-09-20 08:45:34 +01:00
parent 3719f7d9de
commit 4c223b8aee
110 changed files with 787 additions and 1152 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) 2011-2018 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011-2022 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -189,7 +189,13 @@ void mapLagrangian(const meshToMesh0& meshToMesh0Interp)
);
passiveParticle& newP = newPtr();
newP.track(iter().position() - newP.position(), 0);
newP.track
(
meshTarget,
iter().position(meshSource)
- newP.position(meshTarget),
0
);
if (!newP.onFace())
{
@ -228,7 +234,11 @@ void mapLagrangian(const meshToMesh0& meshToMesh0Interp)
if (unmappedSource.found(sourceParticleI))
{
label targetCell =
findCell(targetParcels, iter().position());
findCell
(
targetParcels,
iter().position(meshSource)
);
if (targetCell >= 0)
{
@ -239,7 +249,7 @@ void mapLagrangian(const meshToMesh0& meshToMesh0Interp)
new passiveParticle
(
meshTarget,
iter().position(),
iter().position(meshSource),
targetCell
)
);

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | Website: https://openfoam.org
\\ / A nd | Copyright (C) 2011-2018 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011-2022 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -178,7 +178,13 @@ void mapLagrangian(const meshToMesh& interp)
);
passiveParticle& newP = newPtr();
newP.track(iter().position() - newP.position(), 0);
newP.track
(
meshTarget,
iter().position(meshSource)
- newP.position(meshTarget),
0
);
if (!newP.onFace())
{
@ -217,7 +223,11 @@ void mapLagrangian(const meshToMesh& interp)
if (unmappedSource.found(sourceParticleI))
{
label targetCell =
findCell(targetParcels, iter().position());
findCell
(
targetParcels,
iter().position(meshSource)
);
if (targetCell >= 0)
{
@ -228,7 +238,7 @@ void mapLagrangian(const meshToMesh& interp)
new passiveParticle
(
meshTarget,
iter().position(),
iter().position(meshSource),
targetCell
)
);