FreeFOAM The Cross-Platform CFD Toolkit
Hosted by SourceForge:
Get FreeFOAM at SourceForge.net.
            Fast, secure and Free Open Source software downloads

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