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::surfaceWriter 00026 00027 Description 00028 00029 SourceFiles 00030 surfaceWriter.C 00031 00032 \*---------------------------------------------------------------------------*/ 00033 00034 #ifndef surfaceWriter_H 00035 #define surfaceWriter_H 00036 00037 #include <OpenFOAM/Field.H> 00038 #include <OpenFOAM/typeInfo.H> 00039 #include <OpenFOAM/autoPtr.H> 00040 #include <OpenFOAM/pointField.H> 00041 #include <OpenFOAM/faceList.H> 00042 #include <OpenFOAM/fileName.H> 00043 00044 #include <OpenFOAM/runTimeSelectionTables.H> 00045 00046 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // 00047 00048 namespace Foam 00049 { 00050 00051 // Forward declaration of friend functions and operators 00052 00053 template<class Type> class surfaceWriter; 00054 template<class Type> class nullSurfaceWriter; 00055 template<class Type> class proxySurfaceWriter; 00056 00057 /*---------------------------------------------------------------------------*\ 00058 Class surfaceWriter Declaration 00059 \*---------------------------------------------------------------------------*/ 00060 00061 template<class Type> 00062 class surfaceWriter 00063 { 00064 //- friendship between writer data types 00065 template<class Type2> friend class surfaceWriter; 00066 00067 public: 00068 00069 //- Runtime type information 00070 TypeName("surfaceWriter"); 00071 00072 // Declare run-time constructor selection table 00073 00074 declareRunTimeSelectionTable 00075 ( 00076 autoPtr, 00077 surfaceWriter, 00078 word, 00079 (), 00080 () 00081 ); 00082 00083 00084 // Selectors 00085 00086 //- Return a reference to the selected surfaceWriter 00087 static autoPtr<surfaceWriter> New(const word& writeFormat); 00088 00089 00090 // Constructors 00091 00092 //- Construct null 00093 surfaceWriter(); 00094 00095 00096 // Destructor 00097 00098 virtual ~surfaceWriter(); 00099 00100 00101 // Member Functions 00102 00103 //- Return true if the surface format supports separate files 00104 virtual bool separateFiles() 00105 { 00106 return false; 00107 } 00108 00109 00110 //- Writes single surface geometry to file. 00111 virtual void write 00112 ( 00113 const fileName& outputDir, // <root>/<case>/surface/TIME 00114 const fileName& surfaceName, // name of surface 00115 const pointField& points, 00116 const faceList& faces, 00117 const bool verbose = false 00118 ) const 00119 {} 00120 00121 00122 //- Writes single surface to file. Either one value per vertex or 00123 // one value per face (detected by values.size()==faces.size()) 00124 virtual void write 00125 ( 00126 const fileName& outputDir, // <root>/<case>/surface/TIME 00127 const fileName& surfaceName, // name of surface 00128 const pointField& points, 00129 const faceList& faces, 00130 const fileName& fieldName, // name of field 00131 const Field<Type>& values, 00132 const bool verbose = false 00133 ) const = 0; 00134 }; 00135 00136 00137 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // 00138 00139 } // End namespace Foam 00140 00141 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // 00142 00143 #ifdef NoRepository 00144 # include "surfaceWriter.C" 00145 #endif 00146 00147 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // 00148 00149 #endif 00150 00151 // ************************ vim: set sw=4 sts=4 et: ************************ //