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:
@ -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
|
||||
@ -84,7 +84,7 @@ void ensightParticlePositions
|
||||
// Output positions
|
||||
forAllConstIter(Cloud<passiveParticle>, parcels, elmnt)
|
||||
{
|
||||
const vector& p = elmnt().position();
|
||||
const vector& p = elmnt().position(mesh);
|
||||
|
||||
ensightFile
|
||||
<< setw(8) << ++nParcels
|
||||
|
||||
@ -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
|
||||
@ -123,7 +123,7 @@ void Foam::ensightParticlePositions
|
||||
|
||||
forAllConstIter(Cloud<passiveParticle>, parcels, elmnt)
|
||||
{
|
||||
const vector& p = elmnt().position();
|
||||
const vector& p = elmnt().position(mesh);
|
||||
|
||||
os.write(p.x());
|
||||
os.write(p.y());
|
||||
@ -136,7 +136,7 @@ void Foam::ensightParticlePositions
|
||||
|
||||
forAllConstIter(Cloud<passiveParticle>, parcels, elmnt)
|
||||
{
|
||||
const vector& p = elmnt().position();
|
||||
const vector& p = elmnt().position(mesh);
|
||||
|
||||
os.write(++nParcels, 8); // unusual width
|
||||
os.write(p.x());
|
||||
|
||||
@ -1,21 +1,23 @@
|
||||
gmvFile << "tracers " << particles.size() << nl;
|
||||
forAllConstIter(Cloud<passiveParticle>, particles, iter)
|
||||
{
|
||||
gmvFile << iter().position().x() << ' ';
|
||||
}
|
||||
gmvFile << nl;
|
||||
|
||||
forAllConstIter(Cloud<passiveParticle>, particles, iter)
|
||||
{
|
||||
gmvFile << iter().position().y() << ' ';
|
||||
}
|
||||
gmvFile << nl;
|
||||
pointField positions(particles.size());
|
||||
|
||||
forAllConstIter(Cloud<passiveParticle>, particles, iter)
|
||||
{
|
||||
gmvFile << iter().position().z() << ' ';
|
||||
label particlei = 0;
|
||||
forAllConstIter(Cloud<passiveParticle>, particles, iter)
|
||||
{
|
||||
positions[particlei ++] = iter().position(mesh);
|
||||
}
|
||||
|
||||
for (i = 0; i < pTraits<point>::nComponents; i ++)
|
||||
{
|
||||
forAll(positions, particlei)
|
||||
{
|
||||
gmvFile << component(positions[particlei], i) << ' ';
|
||||
}
|
||||
gmvFile << nl;
|
||||
}
|
||||
}
|
||||
gmvFile << nl;
|
||||
|
||||
forAll(lagrangianScalarNames, i)
|
||||
{
|
||||
@ -44,8 +46,6 @@ forAll(lagrangianScalarNames, i)
|
||||
}
|
||||
gmvFile << nl;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
forAll(lagrangianVectorNames, i)
|
||||
|
||||
@ -2,7 +2,7 @@
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration | Website: https://openfoam.org
|
||||
\\ / A nd | Copyright (C) 2011-2020 OpenFOAM Foundation
|
||||
\\ / A nd | Copyright (C) 2011-2022 OpenFOAM Foundation
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
@ -70,7 +70,7 @@ Foam::lagrangianWriter::lagrangianWriter
|
||||
DynamicList<floatScalar> partField(3*parcels.size());
|
||||
forAllConstIter(Cloud<passiveParticle>, parcels, elmnt)
|
||||
{
|
||||
vtkWriteOps::insert(elmnt().position(), partField);
|
||||
vtkWriteOps::insert(elmnt().position(mesh), partField);
|
||||
}
|
||||
vtkWriteOps::write(os_, binary_, partField);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user