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

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