initial commit for version 1.6.x patch release
[OpenFOAM-1.6.x.git] / src / surfMesh / surfaceFormats / surfaceFormatsCore.H
blob83a2203b9d522fb1097ad28f919705cd1adb2f0e
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::surfaceFormatsCore
28 Description
29     A collection of helper functions for reading/writing surface formats.
31 SourceFiles
32     surfaceFormatsCore.C
34 \*---------------------------------------------------------------------------*/
36 #ifndef surfaceFormatsCore_H
37 #define surfaceFormatsCore_H
39 #include "Map.H"
40 #include "HashSet.H"
41 #include "labelList.H"
42 #include "surfZoneList.H"
43 #include "surfZoneIdentifierList.H"
45 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
47 namespace Foam
50 // Forward declaration of friend functions and operators
52 class IFstream;
53 class Time;
55 namespace fileFormats
58 /*---------------------------------------------------------------------------*\
59                      Class surfaceFormatsCore Declaration
60 \*---------------------------------------------------------------------------*/
62 class surfaceFormatsCore
64 protected:
66         //- Return a list with a single entry,
67         //  the size corresponds to that of the container
68         template<class Container>
69         static List<surfZone> oneZone
70         (
71             const Container& container,
72             const word& name = "zone0"
73         )
74         {
75             return List<surfZone>(1, surfZone(name, container.size(), 0, 0));
76         }
78         //- Read non-comment line
79         static string getLineNoComment(IFstream&);
82 public:
84     // Static Data
86         //- The file extension corresponding to 'native' surface format
87         //  Normally "ofs" (mnemonic: OF = OpenFOAM, S = Surface)
88         static word nativeExt;
91     // Static Member Functions
93         static bool checkSupport
94         (
95             const wordHashSet& available,
96             const word& ext,
97             const bool verbose,
98             const word& functionName
99         );
101         //- Return the local file name (within time directory)
102         //  NEEDS FIXING
103         static fileName localMeshFileName(const word& surfName="");
105         //- Find instance with surfName
106         //  NEEDS FIXING
107         static fileName findMeshInstance(const Time&, const word& surfName="");
109         //- Find mesh file with surfName
110         //  NEEDS FIXING
111         static fileName findMeshFile(const Time&, const word& surfName="");
114     // Constructors
116         //- Construct null
117         surfaceFormatsCore();
120     // Destructor
122         virtual ~surfaceFormatsCore();
126 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
128 } // End namespace fileFormats
129 } // End namespace Foam
131 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
133 #endif
135 // ************************************************************************* //