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

surfaceFormatsCore.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::surfaceFormatsCore
00027 
00028 Description
00029     A collection of helper functions for reading/writing surface formats.
00030 
00031 SourceFiles
00032     surfaceFormatsCore.C
00033 
00034 \*---------------------------------------------------------------------------*/
00035 
00036 #ifndef surfaceFormatsCore_H
00037 #define surfaceFormatsCore_H
00038 
00039 #include "Map.H"
00040 #include "HashSet.H"
00041 #include "labelList.H"
00042 #include "surfZoneList.H"
00043 #include "surfZoneIdentifierList.H"
00044 
00045 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
00046 
00047 namespace Foam
00048 {
00049 
00050 // Forward declaration of friend functions and operators
00051 
00052 class IFstream;
00053 class Time;
00054 
00055 namespace fileFormats
00056 {
00057 
00058 /*---------------------------------------------------------------------------*\
00059                      Class surfaceFormatsCore Declaration
00060 \*---------------------------------------------------------------------------*/
00061 
00062 class surfaceFormatsCore
00063 {
00064 protected:
00065 
00066         //- Return a list with a single entry,
00067         //  the size corresponds to that of the container
00068         template<class Container>
00069         static List<surfZone> oneZone
00070         (
00071             const Container& container,
00072             const word& name = "zone0"
00073         )
00074         {
00075             return List<surfZone>(1, surfZone(name, container.size(), 0, 0));
00076         }
00077 
00078         //- Read non-comment line
00079         static string getLineNoComment(IFstream&);
00080 
00081 
00082 public:
00083 
00084     // Static Data
00085 
00086         //- The file extension corresponding to 'native' surface format
00087         //  Normally "ofs" (mnemonic: OF = OpenFOAM, S = Surface)
00088         static word nativeExt;
00089 
00090 
00091     // Static Member Functions
00092 
00093         static bool checkSupport
00094         (
00095             const wordHashSet& available,
00096             const word& ext,
00097             const bool verbose,
00098             const word& functionName
00099         );
00100 
00101         //- Return the local file name (within time directory)
00102         //  NEEDS FIXING
00103         static fileName localMeshFileName(const word& surfName="");
00104 
00105         //- Find instance with surfName
00106         //  NEEDS FIXING
00107         static fileName findMeshInstance(const Time&, const word& surfName="");
00108 
00109         //- Find mesh file with surfName
00110         //  NEEDS FIXING
00111         static fileName findMeshFile(const Time&, const word& surfName="");
00112 
00113 
00114     // Constructors
00115 
00116         //- Construct null
00117         surfaceFormatsCore();
00118 
00119 
00120     // Destructor
00121 
00122         virtual ~surfaceFormatsCore();
00123 };
00124 
00125 
00126 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
00127 
00128 } // End namespace fileFormats
00129 } // End namespace Foam
00130 
00131 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
00132 
00133 #endif
00134 
00135 // ************************************************************************* //
Copyright © 2000-2009 OpenCFD Ltd