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

foamToGMV.C

Go to the documentation of this file.
00001 /*---------------------------------------------------------------------------*\
00002   =========                 |
00003   \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox
00004    \\    /   O peration     |
00005     \\  /    A nd           | Copyright (C) 1991-2010 OpenCFD Ltd.
00006      \\/     M anipulation  |
00007 -------------------------------------------------------------------------------
00008 License
00009     This file is part of OpenFOAM.
00010 
00011     OpenFOAM is free software: you can redistribute it and/or modify it
00012     under the terms of the GNU General Public License as published by
00013     the Free Software Foundation, either version 3 of the License, or
00014     (at your option) any later version.
00015 
00016     OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
00017     ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
00018     FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
00019     for more details.
00020 
00021     You should have received a copy of the GNU General Public License
00022     along with OpenFOAM.  If not, see <http://www.gnu.org/licenses/>.
00023 
00024 Application
00025     foamToGMV
00026 
00027 Description
00028     Translates foam output to GMV readable files.
00029 
00030     A free post-processor with available binaries from
00031     http://www-xdiv.lanl.gov/XCM/gmv/
00032 
00033 Usage
00034 
00035     - foamToGMV [OPTIONS]
00036 
00037     @param -case <dir>\n
00038     Case directory.
00039 
00040     @param -parallel \n
00041     Run in parallel.
00042 
00043     @param -help \n
00044     Display help message.
00045 
00046     @param -doc \n
00047     Display Doxygen API documentation page for this application.
00048 
00049     @param -srcDoc \n
00050     Display Doxygen source documentation page for this application.
00051 
00052 \*---------------------------------------------------------------------------*/
00053 
00054 #include <finiteVolume/fvCFD.H>
00055 #include <OpenFOAM/OFstream.H>
00056 #include <OpenFOAM/instantList.H>
00057 #include <OpenFOAM/IOobjectList.H>
00058 #include "itoa.H"
00059 #include <lagrangian/Cloud.H>
00060 #include <lagrangian/passiveParticle.H>
00061 
00062 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
00063 
00064 // Main program:
00065 
00066 int main(int argc, char *argv[])
00067 {
00068     const label nTypes = 4;
00069     const word fieldTypes[] =
00070     {
00071         "volScalarField",
00072         "volVectorField",
00073         "surfaceScalarField",
00074         cloud::prefix
00075     };
00076 
00077 #   include <OpenFOAM/setRootCase.H>
00078 
00079 #   include <OpenFOAM/createTime.H>
00080 #   include <OpenFOAM/createMesh.H>
00081 
00082 #   include "readConversionProperties.H"
00083 
00084     // get the available time-steps
00085     instantList TimeList = runTime.times();
00086     Info << TimeList << endl;
00087     label nTimes = TimeList.size();
00088 
00089     for(label n=1; n < nTimes; n++)
00090     {
00091         if (TimeList[n].value() > startTime)
00092         {
00093             Info << "Time = " << TimeList[n].value() << nl;
00094 
00095             // Set Time
00096             runTime.setTime(TimeList[n], n);
00097             word CurTime = runTime.timeName();
00098 
00099             IOobjectList objects(mesh, runTime.timeName());
00100 
00101 #           include "moveMesh.H"
00102 
00103             // set the filename of the GMV file
00104             fileName gmvFileName = "plotGMV." + itoa(n);
00105             OFstream gmvFile(args.rootPath()/args.caseName()/gmvFileName);
00106 
00107 #           include "gmvOutputHeader.H"
00108 #           include "gmvOutput.H"
00109 #           include "gmvOutputTail.H"
00110         }
00111     }
00112 
00113     Info<< "\nEnd\n" << endl;
00114 
00115     return 0;
00116 }
00117 
00118 
00119 // ************************ vim: set sw=4 sts=4 et: ************************ //
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines