OpenFOAM logo
The Open Source CFD Toolbox
  Source Guide OpenCFD Solutions Contact OpenFOAM

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-2009 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 the
00013     Free Software Foundation; either version 2 of the License, or (at your
00014     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, write to the Free Software Foundation,
00023     Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
00024 
00025 Application
00026     patchSummary
00027 
00028 Description
00029     Writes fields and boundary condition info for each patch at each requested
00030     time instance.
00031 
00032 \*---------------------------------------------------------------------------*/
00033 
00034 #include "fvCFD.H"
00035 #include "volFields.H"
00036 #include "IOobjectList.H"
00037 #include "patchSummaryTemplates.H"
00038 
00039 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
00040 
00041 int main(int argc, char *argv[])
00042 {
00043     timeSelector::addOptions();
00044 
00045 #   include "addRegionOption.H"
00046 #   include "setRootCase.H"
00047 #   include "createTime.H"
00048 
00049     instantList timeDirs = timeSelector::select0(runTime, args);
00050 
00051 #   include "createNamedMesh.H"
00052 
00053     forAll(timeDirs, timeI)
00054     {
00055         runTime.setTime(timeDirs[timeI], timeI);
00056 
00057         Info<< "Time = " << runTime.timeName() << nl << endl;
00058 
00059         const IOobjectList fieldObjs(mesh, runTime.timeName());
00060         const wordList objNames = fieldObjs.names();
00061 
00062         PtrList<volScalarField> vsf(objNames.size());
00063         PtrList<volVectorField> vvf(objNames.size());
00064         PtrList<volSphericalTensorField> vsptf(objNames.size());
00065         PtrList<volSymmTensorField> vsytf(objNames.size());
00066         PtrList<volTensorField> vtf(objNames.size());
00067 
00068         Info<< "Valid fields:" << endl;
00069 
00070         forAll(objNames, objI)
00071         {
00072             IOobject obj
00073             (
00074                 objNames[objI],
00075                 runTime.timeName(),
00076                 mesh,
00077                 IOobject::MUST_READ
00078             );
00079 
00080             if (obj.headerOk())
00081             {
00082                 addToFieldList<scalar>(vsf, obj, objI, mesh);
00083                 addToFieldList<vector>(vvf, obj, objI, mesh);
00084                 addToFieldList<sphericalTensor>(vsptf, obj, objI, mesh);
00085                 addToFieldList<symmTensor>(vsytf, obj, objI, mesh);
00086                 addToFieldList<tensor>(vtf, obj, objI, mesh);
00087             }
00088         }
00089 
00090         Info<< endl;
00091 
00092         const polyBoundaryMesh& bm = mesh.boundaryMesh();
00093         forAll(bm, patchI)
00094         {
00095             Info<< bm[patchI].type() << ": " << bm[patchI].name() << nl;
00096             outputFieldList<scalar>(vsf, patchI);
00097             outputFieldList<vector>(vvf, patchI);
00098             outputFieldList<sphericalTensor>(vsptf, patchI);
00099             outputFieldList<symmTensor>(vsytf, patchI);
00100             outputFieldList<tensor>(vtf, patchI);
00101             Info << endl;
00102         }
00103     }
00104 
00105     Info << "End\n" << endl;
00106 
00107     return 0;
00108 }
00109 
00110 
00111 // ************************************************************************* //
Copyright © 2000-2009 OpenCFD Ltd