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

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