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

IOPosition.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) 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 Class
00026     Foam::IOPosition
00027 
00028 Description
00029     Helper IO class to read and write particle positions
00030 
00031 SourceFiles
00032     IOPosition.C
00033 
00034 \*---------------------------------------------------------------------------*/
00035 
00036 #ifndef IOPosition_H
00037 #define IOPosition_H
00038 
00039 #include "regIOobject.H"
00040 
00041 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
00042 
00043 namespace Foam
00044 {
00045 
00046 /*---------------------------------------------------------------------------*\
00047                          Class IOPosition Declaration
00048 \*---------------------------------------------------------------------------*/
00049 
00050 template<class ParticleType>
00051 class IOPosition
00052 :
00053     public regIOobject
00054 {
00055 
00056     // Private data
00057 
00058         //- Reference to the cloud
00059         const Cloud<ParticleType>& cloud_;
00060 
00061 
00062     // Private member functions
00063 
00064         //- Read particle properties dictionary
00065         void readParticleProperties();
00066 
00067         //- Write particle properties dictionary
00068         void writeParticleProperties() const;
00069 
00070 
00071 public:
00072 
00073     // Static data
00074 
00075         //- Runtime type name information. Use cloud type.
00076         virtual const word& type() const
00077         {
00078             return cloud_.type();
00079         }
00080 
00081         //- Name of particle properties dictionary
00082         static word particlePropertiesName;
00083 
00084 
00085     // Constructors
00086 
00087         //- Construct from cloud
00088         IOPosition(const Cloud<ParticleType>&);
00089 
00090 
00091     // Member functions
00092 
00093         virtual void readData(Cloud<ParticleType>& c, bool checkClass);
00094 
00095         virtual bool write() const;
00096 
00097         virtual bool writeData(Ostream& os) const;
00098 };
00099 
00100 
00101 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
00102 
00103 } // End namespace Foam
00104 
00105 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
00106 
00107 #ifdef NoRepository
00108 #   include "IOPosition.C"
00109 #endif
00110 
00111 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
00112 
00113 #endif
00114 
00115 // ************************************************************************* //
Copyright © 2000-2009 OpenCFD Ltd