initial commit for version 1.6.x patch release
[OpenFOAM-1.6.x.git] / src / surfMesh / surfaceFormats / ftr / FTRsurfaceFormat.H
blob767bf19707e11f862cb54cda49f08af05c1bc5bb
1 /*---------------------------------------------------------------------------*\
2   =========                 |
3   \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox
4    \\    /   O peration     |
5     \\  /    A nd           | Copyright (C) 1991-2009 OpenCFD Ltd.
6      \\/     M anipulation  |
7 -------------------------------------------------------------------------------
8 License
9     This file is part of OpenFOAM.
11     OpenFOAM is free software; you can redistribute it and/or modify it
12     under the terms of the GNU General Public License as published by the
13     Free Software Foundation; either version 2 of the License, or (at your
14     option) any later version.
16     OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
17     ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
18     FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
19     for more details.
21     You should have received a copy of the GNU General Public License
22     along with OpenFOAM; if not, write to the Free Software Foundation,
23     Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
25 Class
26     Foam::fileFormats::FTRsurfaceFormat
28 Description
29     Reading of the (now deprecated and infrequently used)
30     Foam Trisurface Format.
32 SourceFiles
33     FTRsurfaceFormat.C
35 \*---------------------------------------------------------------------------*/
37 #ifndef FTRsurfaceFormat_H
38 #define FTRsurfaceFormat_H
40 #include "IFstream.H"
41 #include "MeshedSurface.H"
42 #include "UnsortedMeshedSurface.H"
44 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
46 namespace Foam
48 namespace fileFormats
51 /*---------------------------------------------------------------------------*\
52                       Class FTRsurfaceFormat Declaration
53 \*---------------------------------------------------------------------------*/
55 template<class Face>
56 class FTRsurfaceFormat
58     public UnsortedMeshedSurface<Face>
60     // Private classes
62         //- read compatibility for ftr patch definitions
63         class ftrPatch
64         {
65             //- Name of patch
66             word name_;
68             //- Type of patch (ignored since it is usually "empty")
69             word type_;
71         public:
73             const word& name() const
74             {
75                 return name_;
76             }
78             friend Istream& operator>>(Istream& is, ftrPatch& p)
79             {
80                 is >> p.name_ >> p.type_;
81                 return is;
82             }
83         };
86     // Private Member Functions
88         //- Disallow default bitwise copy construct
89         FTRsurfaceFormat(const FTRsurfaceFormat<Face>&);
91         //- Disallow default bitwise assignment
92         void operator=(const FTRsurfaceFormat<Face>&);
95 public:
97     // Constructors
99         //- Construct from file name
100         FTRsurfaceFormat(const fileName&);
103     // Selectors
105         //- Read file and return surface
106         static autoPtr<UnsortedMeshedSurface<Face> > New(const fileName& name)
107         {
108             return autoPtr<UnsortedMeshedSurface<Face> >
109             (
110                 new FTRsurfaceFormat<Face>(name)
111             );
112         }
115     // Destructor
117         virtual ~FTRsurfaceFormat()
118         {}
121     // Member Functions
123         //- Read from file
124         virtual bool read(const fileName&);
128 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
130 } // End namespace fileFormats
131 } // End namespace Foam
133 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
135 #ifdef NoRepository
136 #   include "FTRsurfaceFormat.C"
137 #endif
139 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
141 #endif
143 // ************************************************************************* //