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

FTRsurfaceFormat.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-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 Class
00025     Foam::fileFormats::FTRsurfaceFormat
00026 
00027 Description
00028     Reading of the (now deprecated and infrequently used)
00029     Foam Trisurface Format.
00030 
00031 SourceFiles
00032     FTRsurfaceFormat.C
00033 
00034 \*---------------------------------------------------------------------------*/
00035 
00036 #ifndef FTRsurfaceFormat_H
00037 #define FTRsurfaceFormat_H
00038 
00039 #include <OpenFOAM/IFstream.H>
00040 #include <surfMesh/MeshedSurface.H>
00041 #include <surfMesh/UnsortedMeshedSurface.H>
00042 
00043 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
00044 
00045 namespace Foam
00046 {
00047 namespace fileFormats
00048 {
00049 
00050 /*---------------------------------------------------------------------------*\
00051                       Class FTRsurfaceFormat Declaration
00052 \*---------------------------------------------------------------------------*/
00053 
00054 template<class Face>
00055 class FTRsurfaceFormat
00056 :
00057     public UnsortedMeshedSurface<Face>
00058 {
00059     // Private classes
00060 
00061         //- read compatibility for ftr patch definitions
00062         class ftrPatch
00063         {
00064             //- Name of patch
00065             word name_;
00066 
00067             //- Type of patch (ignored since it is usually "empty")
00068             word type_;
00069 
00070         public:
00071 
00072             const word& name() const
00073             {
00074                 return name_;
00075             }
00076 
00077             friend Istream& operator>>(Istream& is, ftrPatch& p)
00078             {
00079                 is >> p.name_ >> p.type_;
00080                 return is;
00081             }
00082         };
00083 
00084 
00085     // Private Member Functions
00086 
00087         //- Disallow default bitwise copy construct
00088         FTRsurfaceFormat(const FTRsurfaceFormat<Face>&);
00089 
00090         //- Disallow default bitwise assignment
00091         void operator=(const FTRsurfaceFormat<Face>&);
00092 
00093 
00094 public:
00095 
00096     // Constructors
00097 
00098         //- Construct from file name
00099         FTRsurfaceFormat(const fileName&);
00100 
00101 
00102     // Selectors
00103 
00104         //- Read file and return surface
00105         static autoPtr<UnsortedMeshedSurface<Face> > New(const fileName& name)
00106         {
00107             return autoPtr<UnsortedMeshedSurface<Face> >
00108             (
00109                 new FTRsurfaceFormat<Face>(name)
00110             );
00111         }
00112 
00113 
00114     // Destructor
00115 
00116         virtual ~FTRsurfaceFormat()
00117         {}
00118 
00119 
00120     // Member Functions
00121 
00122         //- Read from file
00123         virtual bool read(const fileName&);
00124 };
00125 
00126 
00127 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
00128 
00129 } // End namespace fileFormats
00130 } // End namespace Foam
00131 
00132 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
00133 
00134 #ifdef NoRepository
00135 #   include "FTRsurfaceFormat.C"
00136 #endif
00137 
00138 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
00139 
00140 #endif
00141 
00142 // ************************ vim: set sw=4 sts=4 et: ************************ //
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines