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

patchSummary.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     patchSummary
00026 
00027 Description
00028     Writes fields and boundary condition info for each patch at each requested
00029     time instance.
00030 
00031 Usage
00032 
00033     - patchSummary [OPTIONS]
00034 
00035     @param -noZero \n
00036     Ignore timestep 0.
00037 
00038     @param -constant \n
00039     Include the constant directory.
00040 
00041     @param -time <time>\n
00042     Apply only to specific time.
00043 
00044     @param -latestTime \n
00045     Only apply to latest time step.
00046 
00047     @param -case <dir>\n
00048     Case directory.
00049 
00050     @param -parallel \n
00051     Run in parallel.
00052 
00053     @param -help \n
00054     Display help message.
00055 
00056     @param -doc \n
00057     Display Doxygen API documentation page for this application.
00058 
00059     @param -srcDoc \n
00060     Display Doxygen source documentation page for this application.
00061 
00062 \*---------------------------------------------------------------------------*/
00063 
00064 #include <finiteVolume/fvCFD.H>
00065 #include <finiteVolume/volFields.H>
00066 #include <OpenFOAM/IOobjectList.H>
00067 #include "patchSummaryTemplates.H"
00068 
00069 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
00070 
00071 int main(int argc, char *argv[])
00072 {
00073     timeSelector::addOptions();
00074 
00075 #   include <OpenFOAM/addRegionOption.H>
00076 #   include <OpenFOAM/setRootCase.H>
00077 #   include <OpenFOAM/createTime.H>
00078 
00079     instantList timeDirs = timeSelector::select0(runTime, args);
00080 
00081 #   include <OpenFOAM/createNamedMesh.H>
00082 
00083     forAll(timeDirs, timeI)
00084     {
00085         runTime.setTime(timeDirs[timeI], timeI);
00086 
00087         Info<< "Time = " << runTime.timeName() << nl << endl;
00088 
00089         const IOobjectList fieldObjs(mesh, runTime.timeName());
00090         const wordList objNames = fieldObjs.names();
00091 
00092         PtrList<volScalarField> vsf(objNames.size());
00093         PtrList<volVectorField> vvf(objNames.size());
00094         PtrList<volSphericalTensorField> vsptf(objNames.size());
00095         PtrList<volSymmTensorField> vsytf(objNames.size());
00096         PtrList<volTensorField> vtf(objNames.size());
00097 
00098         Info<< "Valid fields:" << endl;
00099 
00100         forAll(objNames, objI)
00101         {
00102             IOobject obj
00103             (
00104                 objNames[objI],
00105                 runTime.timeName(),
00106                 mesh,
00107                 IOobject::MUST_READ
00108             );
00109 
00110             if (obj.headerOk())
00111             {
00112                 addToFieldList<scalar>(vsf, obj, objI, mesh);
00113                 addToFieldList<vector>(vvf, obj, objI, mesh);
00114                 addToFieldList<sphericalTensor>(vsptf, obj, objI, mesh);
00115                 addToFieldList<symmTensor>(vsytf, obj, objI, mesh);
00116                 addToFieldList<tensor>(vtf, obj, objI, mesh);
00117             }
00118         }
00119 
00120         Info<< endl;
00121 
00122         const polyBoundaryMesh& bm = mesh.boundaryMesh();
00123         forAll(bm, patchI)
00124         {
00125             Info<< bm[patchI].type() << ": " << bm[patchI].name() << nl;
00126             outputFieldList<scalar>(vsf, patchI);
00127             outputFieldList<vector>(vvf, patchI);
00128             outputFieldList<sphericalTensor>(vsptf, patchI);
00129             outputFieldList<symmTensor>(vsytf, patchI);
00130             outputFieldList<tensor>(vtf, patchI);
00131             Info << endl;
00132         }
00133     }
00134 
00135     Info << "End\n" << endl;
00136 
00137     return 0;
00138 }
00139 
00140 
00141 // ************************ vim: set sw=4 sts=4 et: ************************ //
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines