This repository has been archived on 2023-11-20. You can view files and clone it, but cannot push or open issues or pull requests.
foam-extend4.1-coherent-io/applications/utilities/postProcessing/dataConversion/foamToGMV/gmvOutputLagrangian.H

114 lines
2 KiB
C++
Raw Normal View History

gmvFile << "tracers " << particles.size() << nl;
for
(
Cloud<passiveParticle>::iterator elmnt = particles.begin();
elmnt != particles.end();
++elmnt
)
{
gmvFile << elmnt().position().x() << " ";
}
gmvFile << nl;
for
(
Cloud<passiveParticle>::iterator elmnt = particles.begin();
elmnt != particles.end();
++elmnt
)
{
gmvFile << elmnt().position().y() << " ";
}
gmvFile << nl;
for
(
Cloud<passiveParticle>::iterator elmnt = particles.begin();
elmnt != particles.end();
++elmnt
)
{
gmvFile << elmnt().position().z() << " ";
}
gmvFile << nl;
forAll(lagrangianScalarNames, i)
{
word name = lagrangianScalarNames[i];
IOField<scalar> s
(
IOobject
(
name,
runTime.timeName(),
2010-08-26 14:22:03 +00:00
cloud::prefix,
mesh,
IOobject::MUST_READ,
IOobject::NO_WRITE
)
);
2010-08-26 14:22:03 +00:00
if (s.size())
{
gmvFile << name << nl;
2010-08-26 14:22:03 +00:00
for (label n = 0; n < s.size(); n++)
{
gmvFile << s[n] << token::SPACE;
}
gmvFile << nl;
}
}
forAll(lagrangianVectorNames, i)
{
word name = lagrangianVectorNames[i];
IOField<vector> v
(
IOobject
(
name,
runTime.timeName(),
2010-08-26 14:22:03 +00:00
cloud::prefix,
mesh,
IOobject::MUST_READ,
IOobject::NO_WRITE
)
);
2010-08-26 14:22:03 +00:00
if (v.size())
{
gmvFile << name + "x" << nl;
2010-08-26 14:22:03 +00:00
for (label n = 0; n < v.size(); n++)
{
gmvFile << v[n].x() << token::SPACE;
}
gmvFile << nl;
gmvFile << name + "y" << nl;
2010-08-26 14:22:03 +00:00
for (label n = 0; n < v.size(); n++)
{
gmvFile << v[n].y() << token::SPACE;
}
gmvFile << nl;
gmvFile << name + "z" << nl;
2010-08-26 14:22:03 +00:00
for (label n = 0; n < v.size(); n++)
{
gmvFile << v[n].z() << token::SPACE;
}
gmvFile << nl;
}
}
gmvFile << "endtrace"<< nl;