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

PatchPostProcessing.H

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) 2008-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 Class
00026     Foam::PatchPostProcessing
00027 
00028 Description
00029     Standard post-processing
00030 
00031 SourceFiles
00032     PatchPostProcessing.C
00033 
00034 \*---------------------------------------------------------------------------*/
00035 
00036 #ifndef PatchPostProcessing_H
00037 #define PatchPostProcessing_H
00038 
00039 #include "PostProcessingModel.H"
00040 
00041 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
00042 
00043 namespace Foam
00044 {
00045 
00046 /*---------------------------------------------------------------------------*\
00047                     Class PatchPostProcessing Declaration
00048 \*---------------------------------------------------------------------------*/
00049 
00050 template<class CloudType>
00051 class PatchPostProcessing
00052 :
00053     public PostProcessingModel<CloudType>
00054 {
00055     // Private data
00056 
00057         typedef typename CloudType::parcelType parcelType;
00058 
00059         //- Reference to the mesh
00060         const polyMesh& mesh_;
00061 
00062         //- Maximum number of parcels to store
00063         label maxStoredParcels_;
00064 
00065         //- List of patch names
00066         wordList patchNames_;
00067 
00068         //- List of parcel data per patch
00069         List<DynamicList<autoPtr<parcelType> > > patchData_;
00070 
00071         //- Mapping from local to global patch ids
00072         labelList patchIds_;
00073 
00074 
00075     // Private member functions
00076 
00077         //- Returns local patchI if patch is in patchIds_ list
00078         label applyToPatch(const label globalPatchI) const;
00079 
00080 
00081 protected:
00082 
00083     // Protected member functions
00084 
00085         //- Write post-processing info
00086         void write();
00087 
00088 
00089 public:
00090 
00091     //- Runtime type information
00092     TypeName("PatchPostProcessing");
00093 
00094 
00095     // Constructors
00096 
00097         //- Construct from dictionary
00098         PatchPostProcessing(const dictionary& dict, CloudType& owner);
00099 
00100 
00101     //- Destructor
00102     virtual ~PatchPostProcessing();
00103 
00104 
00105     // Member Functions
00106 
00107         // Access
00108 
00109             //- Return const access to the mesh
00110             inline const polyMesh& mesh() const;
00111 
00112             //- Return maximum number of parcels to store per patch
00113             inline label maxStoredParcels() const;
00114 
00115             //- Return const access to the list of patch names
00116             inline const wordList& patchNames() const;
00117 
00118             //- Return const mapping from local to global patch ids
00119             inline const labelList& patchIds() const;
00120 
00121 
00122         // Evaluation
00123 
00124             //- Flag to indicate whether model activates post-processing model
00125             virtual bool active() const;
00126 
00127             //- Gather post-processing info on patch
00128             virtual void postPatch
00129             (
00130                 const parcelType& p,
00131                 const label patchI
00132             );
00133 };
00134 
00135 
00136 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
00137 
00138 } // End namespace Foam
00139 
00140 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
00141 
00142 #include "PatchPostProcessingI.H"
00143 
00144 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
00145 
00146 #ifdef NoRepository
00147 #   include "PatchPostProcessing.C"
00148 #endif
00149 
00150 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
00151 
00152 #endif
00153 
00154 // ************************************************************************* //
Copyright © 2000-2009 OpenCFD Ltd