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

STARCDsurfaceFormat.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::STARCDsurfaceFormat
00026 
00027 Description
00028     Read/write the surface shells from pro-STAR vrt/cel files.
00029 
00030 Note
00031     Uses the extension @a .inp (input) to denote the format.
00032 
00033 See Also
00034     Foam::meshReaders::STARCD
00035 
00036 SourceFiles
00037     STARCDsurfaceFormat.C
00038 
00039 \*---------------------------------------------------------------------------*/
00040 
00041 #ifndef STARCDsurfaceFormat_H
00042 #define STARCDsurfaceFormat_H
00043 
00044 #include <surfMesh/MeshedSurface.H>
00045 #include <surfMesh/MeshedSurfaceProxy.H>
00046 #include <surfMesh/UnsortedMeshedSurface.H>
00047 #include "STARCDsurfaceFormatCore.H"
00048 
00049 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
00050 
00051 namespace Foam
00052 {
00053 namespace fileFormats
00054 {
00055 
00056 /*---------------------------------------------------------------------------*\
00057                      Class STARCDsurfaceFormat Declaration
00058 \*---------------------------------------------------------------------------*/
00059 
00060 template<class Face>
00061 class STARCDsurfaceFormat
00062 :
00063     public MeshedSurface<Face>,
00064     public STARCDsurfaceFormatCore
00065 {
00066     // Private Data
00067 
00068         //- STAR-CD identifier for shell shapes (2d elements)
00069         static const int starcdShellShape_ = 3;
00070 
00071         //- STAR-CD identifier for shell type (shells vs. baffles)
00072         static const int starcdShellType_  = 4;
00073 
00074 
00075     // Private Member Functions
00076 
00077         static inline void writeShell
00078         (
00079             Ostream&,
00080             const Face&,
00081             const label cellId,
00082             const label cellTableId
00083         );
00084 
00085         //- Disallow default bitwise copy construct
00086         STARCDsurfaceFormat(const STARCDsurfaceFormat<Face>&);
00087 
00088         //- Disallow default bitwise assignment
00089         void operator=(const STARCDsurfaceFormat<Face>&);
00090 
00091 
00092 public:
00093 
00094     // Constructors
00095 
00096         //- Construct from file name
00097         STARCDsurfaceFormat(const fileName&);
00098 
00099 
00100     // Selectors
00101 
00102         //- Read file and return surface
00103         static autoPtr<MeshedSurface<Face> > New(const fileName& name)
00104         {
00105             return autoPtr<MeshedSurface<Face> >
00106             (
00107                 new STARCDsurfaceFormat<Face>(name)
00108             );
00109         }
00110 
00111 
00112     //- Destructor
00113     virtual ~STARCDsurfaceFormat()
00114     {}
00115 
00116 
00117     // Member Functions
00118 
00119         //- Write surface mesh components by proxy
00120         static void write(const fileName&, const MeshedSurfaceProxy<Face>&);
00121 
00122         //- Read from file
00123         virtual bool read(const fileName&);
00124 
00125         //- Write object
00126         virtual void write(const fileName& name) const
00127         {
00128             write(name, MeshedSurfaceProxy<Face>(*this));
00129         }
00130 };
00131 
00132 
00133 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
00134 
00135 } // End namespace fileFormats
00136 } // End namespace Foam
00137 
00138 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
00139 
00140 #ifdef NoRepository
00141 #   include "STARCDsurfaceFormat.C"
00142 #endif
00143 
00144 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
00145 
00146 #endif
00147 
00148 // ************************ vim: set sw=4 sts=4 et: ************************ //
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines