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

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