db7fac3f24
git-svn-id: https://openfoam-extend.svn.sourceforge.net/svnroot/openfoam-extend/trunk/Core/OpenFOAM-1.5-dev@1731 e4e07f05-0c2f-0410-a05a-b8ba57e0c909
134 lines
2.2 KiB
C
134 lines
2.2 KiB
C
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(),
|
|
"lagrangian",
|
|
mesh,
|
|
IOobject::MUST_READ,
|
|
IOobject::NO_WRITE
|
|
)
|
|
);
|
|
|
|
if (s.size() != 0)
|
|
{
|
|
gmvFile << name << nl;
|
|
|
|
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(),
|
|
"lagrangian",
|
|
mesh,
|
|
IOobject::MUST_READ,
|
|
IOobject::NO_WRITE
|
|
)
|
|
);
|
|
|
|
if (v.size() != 0)
|
|
{
|
|
gmvFile << name + "x" << nl;
|
|
|
|
for
|
|
(
|
|
label n = 0;
|
|
n < v.size();
|
|
n++
|
|
)
|
|
{
|
|
gmvFile << v[n].x() << token::SPACE;
|
|
}
|
|
gmvFile << nl;
|
|
|
|
gmvFile << name + "y" << nl;
|
|
|
|
for
|
|
(
|
|
label n = 0;
|
|
n < v.size();
|
|
n++
|
|
)
|
|
{
|
|
gmvFile << v[n].y() << token::SPACE;
|
|
}
|
|
gmvFile << nl;
|
|
|
|
gmvFile << name + "z" << nl;
|
|
|
|
for
|
|
(
|
|
label n = 0;
|
|
n < v.size();
|
|
n++
|
|
)
|
|
{
|
|
gmvFile << v[n].z() << token::SPACE;
|
|
}
|
|
gmvFile << nl;
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
gmvFile << "endtrace"<< nl;
|