2010-08-26 14:22:03 +00:00
|
|
|
for (label i = 0; i < nTypes; i++)
|
2010-05-12 13:27:55 +00:00
|
|
|
{
|
|
|
|
wordList fieldNames = objects.names(fieldTypes[i]);
|
|
|
|
|
2010-08-26 14:22:03 +00:00
|
|
|
if (fieldTypes[i] == "volScalarField")
|
2010-05-12 13:27:55 +00:00
|
|
|
{
|
|
|
|
gmvFile << "variable" << nl;
|
|
|
|
}
|
2010-08-26 14:22:03 +00:00
|
|
|
for (label j=0; j < fieldNames.size(); j++)
|
2010-05-12 13:27:55 +00:00
|
|
|
{
|
2010-08-26 14:22:03 +00:00
|
|
|
|
2010-05-12 13:27:55 +00:00
|
|
|
word fieldName = fieldNames[j];
|
|
|
|
|
|
|
|
IOobject fieldObject
|
|
|
|
(
|
|
|
|
fieldName,
|
|
|
|
runTime.timeName(),
|
|
|
|
mesh,
|
|
|
|
IOobject::MUST_READ,
|
|
|
|
IOobject::NO_WRITE
|
|
|
|
);
|
2010-08-26 14:22:03 +00:00
|
|
|
|
|
|
|
if (fieldTypes[i] == "volScalarField")
|
2010-05-12 13:27:55 +00:00
|
|
|
{
|
|
|
|
volScalarField gmvScalarField(fieldObject, mesh);
|
|
|
|
gmvFile << fieldName << " 0" << nl;
|
|
|
|
for(label indx=0;indx<mesh.nCells();indx++)
|
|
|
|
{
|
|
|
|
gmvFile << gmvScalarField[indx] << " ";
|
|
|
|
}
|
|
|
|
gmvFile << nl;
|
|
|
|
}
|
2010-08-26 14:22:03 +00:00
|
|
|
|
|
|
|
if (fieldTypes[i] == "volVectorField")
|
2010-05-12 13:27:55 +00:00
|
|
|
{
|
|
|
|
if (fieldName == vComp)
|
|
|
|
{
|
|
|
|
volVectorField gmvVectorField(fieldObject, mesh);
|
|
|
|
gmvFile << "velocity 0" << nl;
|
2010-08-26 14:22:03 +00:00
|
|
|
for (label indx=0;indx<mesh.nCells();indx++)
|
2010-05-12 13:27:55 +00:00
|
|
|
{
|
|
|
|
gmvFile << gmvVectorField[indx].x() << " ";
|
|
|
|
}
|
2010-08-26 14:22:03 +00:00
|
|
|
for (label indx=0;indx<mesh.nCells();indx++)
|
2010-05-12 13:27:55 +00:00
|
|
|
{
|
|
|
|
gmvFile << gmvVectorField[indx].y() << " ";
|
|
|
|
}
|
2010-08-26 14:22:03 +00:00
|
|
|
for (label indx=0;indx<mesh.nCells();indx++)
|
2010-05-12 13:27:55 +00:00
|
|
|
{
|
|
|
|
gmvFile << gmvVectorField[indx].z() << " ";
|
|
|
|
}
|
|
|
|
gmvFile << nl;
|
|
|
|
}
|
|
|
|
}
|
2010-08-26 14:22:03 +00:00
|
|
|
|
|
|
|
if (fieldTypes[i] == "surfaceScalarField")
|
2010-05-12 13:27:55 +00:00
|
|
|
{
|
|
|
|
// ...
|
|
|
|
}
|
2010-08-26 14:22:03 +00:00
|
|
|
|
2010-05-12 13:27:55 +00:00
|
|
|
}
|
|
|
|
|
2010-08-26 14:22:03 +00:00
|
|
|
if (fieldTypes[i] == cloud::prefix)
|
2010-05-12 13:27:55 +00:00
|
|
|
{
|
|
|
|
IOobject lagrangianHeader
|
|
|
|
(
|
|
|
|
"positions",
|
|
|
|
runTime.timeName(),
|
2010-08-26 14:22:03 +00:00
|
|
|
cloud::prefix,
|
2010-05-12 13:27:55 +00:00
|
|
|
mesh,
|
|
|
|
IOobject::NO_READ
|
|
|
|
);
|
|
|
|
|
|
|
|
if (lagrangianHeader.headerOk())
|
|
|
|
{
|
|
|
|
Cloud<passiveParticle> particles(mesh);
|
2010-08-26 14:22:03 +00:00
|
|
|
|
|
|
|
IOobjectList objects(mesh, runTime.timeName(), cloud::prefix);
|
|
|
|
|
2010-05-12 13:27:55 +00:00
|
|
|
wordList lagrangianScalarNames = objects.names("scalarField");
|
|
|
|
wordList lagrangianVectorNames = objects.names("vectorField");
|
|
|
|
|
2010-08-26 14:22:03 +00:00
|
|
|
if (particles.size())
|
2010-05-12 13:27:55 +00:00
|
|
|
{
|
|
|
|
# include "gmvOutputLagrangian.H"
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2010-08-26 14:22:03 +00:00
|
|
|
if (fieldTypes[i] == "volScalarField")
|
2010-05-12 13:27:55 +00:00
|
|
|
{
|
|
|
|
gmvFile << "endvars" << nl;
|
|
|
|
}
|
|
|
|
}
|