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

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