1 /*---------------------------------------------------------------------------*\
3 \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
5 \\ / A nd | Copyright held by original author
7 -------------------------------------------------------------------------------
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
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
26 Foam::fileFormats::surfaceFormatsCore
29 A collection of helper functions for reading/writing surface formats.
34 \*---------------------------------------------------------------------------*/
36 #ifndef surfaceFormatsCore_H
37 #define surfaceFormatsCore_H
41 #include "labelList.H"
42 #include "surfZoneList.H"
43 #include "surfZoneIdentifierList.H"
45 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
50 // Forward declaration of friend functions and operators
58 /*---------------------------------------------------------------------------*\
59 Class surfaceFormatsCore Declaration
60 \*---------------------------------------------------------------------------*/
62 class surfaceFormatsCore
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
71 const Container& container,
72 const word& name = "zone0"
75 return List<surfZone>(1, surfZone(name, container.size(), 0, 0));
78 //- Read non-comment line
79 static string getLineNoComment(IFstream&);
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
95 const wordHashSet& available,
98 const word& functionName
101 //- Return the local file name (within time directory)
103 static fileName localMeshFileName(const word& surfName="");
105 //- Find instance with surfName
107 static fileName findMeshInstance(const Time&, const word& surfName="");
109 //- Find mesh file with surfName
111 static fileName findMeshFile(const Time&, const word& surfName="");
117 surfaceFormatsCore();
122 virtual ~surfaceFormatsCore();
126 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
128 } // End namespace fileFormats
129 } // End namespace Foam
131 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
135 // ************************************************************************* //