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