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

OFSsurfaceFormat.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::OFSsurfaceFormat
00026 
00027 Description
00028     Provide a means of reading/writing the single-file OpenFOAM surface format.
00029 
00030 Note
00031    This class provides more methods than the regular surface format interface.x
00032 
00033 SourceFiles
00034     OFSsurfaceFormat.C
00035 
00036 \*---------------------------------------------------------------------------*/
00037 
00038 #ifndef OFSsurfaceFormat_H
00039 #define OFSsurfaceFormat_H
00040 
00041 #include <OpenFOAM/Ostream.H>
00042 #include <OpenFOAM/OFstream.H>
00043 #include <surfMesh/MeshedSurface.H>
00044 #include <surfMesh/MeshedSurfaceProxy.H>
00045 #include <surfMesh/UnsortedMeshedSurface.H>
00046 #include "OFSsurfaceFormatCore.H"
00047 
00048 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
00049 
00050 namespace Foam
00051 {
00052 namespace fileFormats
00053 {
00054 
00055 /*---------------------------------------------------------------------------*\
00056                       Class OFSsurfaceFormat Declaration
00057 \*---------------------------------------------------------------------------*/
00058 
00059 template<class Face>
00060 class OFSsurfaceFormat
00061 :
00062     public MeshedSurface<Face>,
00063     public OFSsurfaceFormatCore
00064 {
00065     // Private Member Functions
00066 
00067         //- Disallow default bitwise copy construct
00068         OFSsurfaceFormat(const OFSsurfaceFormat<Face>&);
00069 
00070         //- Disallow default bitwise assignment
00071         void operator=(const OFSsurfaceFormat<Face>&);
00072 
00073 
00074 public:
00075 
00076     // Constructors
00077 
00078         //- Construct from file name
00079         OFSsurfaceFormat(const fileName&);
00080 
00081 
00082     // Selectors
00083 
00084         //- Read file and return surface
00085         static autoPtr<MeshedSurface<Face> > New(const fileName& name)
00086         {
00087             return autoPtr<MeshedSurface<Face> >
00088             (
00089                 new OFSsurfaceFormat<Face>(name)
00090             );
00091         }
00092 
00093 
00094     // Destructor
00095 
00096         virtual ~OFSsurfaceFormat()
00097         {}
00098 
00099 
00100 
00101     // Member Functions
00102 
00103         //- Read surface mesh components
00104         static bool read
00105         (
00106             Istream&,
00107             pointField&,
00108             List<Face>&,
00109             List<surfZone>&
00110         );
00111 
00112         //- Read MeshedSurface
00113         static bool read
00114         (
00115             Istream&,
00116             MeshedSurface<Face>&
00117         );
00118 
00119         //- Read UnsortedMeshedSurface
00120         //  The output is sorted by zones
00121         static bool read
00122         (
00123             Istream&,
00124             UnsortedMeshedSurface<Face>&
00125         );
00126 
00127         //- Write surface mesh components by proxy
00128         static void write(const fileName&, const MeshedSurfaceProxy<Face>&);
00129 
00130         //- Read from file
00131         virtual bool read(const fileName&);
00132 
00133         //- Write object
00134         virtual void write(const fileName& name) const
00135         {
00136             write(name, MeshedSurfaceProxy<Face>(*this));
00137         }
00138 };
00139 
00140 
00141 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
00142 
00143 } // End namespace fileFormats
00144 } // End namespace Foam
00145 
00146 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
00147 
00148 #ifdef NoRepository
00149 #   include "OFSsurfaceFormat.C"
00150 #endif
00151 
00152 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
00153 
00154 #endif
00155 
00156 // ************************ vim: set sw=4 sts=4 et: ************************ //
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines