FreeFOAM The Cross-Platform CFD Toolkit
Hosted by SourceForge:
Get FreeFOAM at SourceForge.net.
            Fast, secure and Free Open Source software downloads

gmvOutput.H

Go to the documentation of this file.
00001 for (label i=0; i < nTypes; i++)
00002 {
00003     wordList fieldNames = objects.names(fieldTypes[i]);
00004 
00005     if (fieldTypes[i] == "volScalarField")
00006     {
00007         gmvFile << "variable" << nl;
00008     }
00009     for (label j=0; j < fieldNames.size(); j++)
00010     {
00011 
00012         word fieldName = fieldNames[j];
00013 
00014         IOobject fieldObject
00015         (
00016             fieldName,
00017             runTime.timeName(),
00018             mesh,
00019             IOobject::MUST_READ,
00020             IOobject::NO_WRITE
00021         );
00022 
00023         if (fieldTypes[i] == "volScalarField")
00024         {
00025             volScalarField gmvScalarField(fieldObject, mesh);
00026             gmvFile << fieldName << " 0" << nl;
00027             for(label indx=0;indx<mesh.nCells();indx++)
00028             {
00029                 gmvFile << gmvScalarField[indx] << " ";
00030             }
00031             gmvFile << nl;
00032         }
00033 
00034         if (fieldTypes[i] == "volVectorField")
00035         {
00036             if (fieldName == vComp)
00037             {
00038                 volVectorField gmvVectorField(fieldObject, mesh);
00039                 gmvFile << "velocity 0" << nl;
00040                 for (label indx=0;indx<mesh.nCells();indx++)
00041                 {
00042                     gmvFile << gmvVectorField[indx].x() << " ";
00043                 }
00044                 for (label indx=0;indx<mesh.nCells();indx++)
00045                 {
00046                     gmvFile << gmvVectorField[indx].y() << " ";
00047                 }
00048                 for (label indx=0;indx<mesh.nCells();indx++)
00049                 {
00050                     gmvFile << gmvVectorField[indx].z() << " ";
00051                 }
00052                 gmvFile << nl;
00053             }
00054         }
00055 
00056         if (fieldTypes[i] == "surfaceScalarField")
00057         {
00058             // ...
00059         }
00060 
00061     }
00062 
00063     if (fieldTypes[i] == cloud::prefix)
00064     {
00065         IOobject lagrangianHeader
00066         (
00067             "positions",
00068             runTime.timeName(),
00069             cloud::prefix,
00070             mesh,
00071             IOobject::NO_READ
00072         );
00073 
00074         if (lagrangianHeader.headerOk())
00075         {
00076             Cloud<passiveParticle> particles(mesh);
00077 
00078             IOobjectList objects(mesh, runTime.timeName(), cloud::prefix);
00079 
00080             wordList lagrangianScalarNames = objects.names("scalarField");
00081             wordList lagrangianVectorNames = objects.names("vectorField");
00082 
00083             if (particles.size())
00084             {
00085 #               include "gmvOutputLagrangian.H"
00086             }
00087         }
00088     }
00089 
00090     if (fieldTypes[i] == "volScalarField")
00091     {
00092         gmvFile << "endvars" << nl;
00093     }
00094 }
00095 
00096 // ************************ vim: set sw=4 sts=4 et: ************************ //
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines