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::ensightParts 00026 00027 Description 00028 A collection of several ensightPart elements 00029 00030 SourceFiles 00031 ensightParts.C 00032 ensightPartsI.H 00033 00034 \*---------------------------------------------------------------------------*/ 00035 00036 #ifndef ensightParts_H 00037 #define ensightParts_H 00038 00039 #include "ensightPart.H" 00040 #include "ensightPartFaces.H" 00041 #include "ensightPartCells.H" 00042 #include <finiteVolume/volFields.H> 00043 00044 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // 00045 00046 namespace Foam 00047 { 00048 00049 /*---------------------------------------------------------------------------*\ 00050 Class ensightParts Declaration 00051 \*---------------------------------------------------------------------------*/ 00052 00053 class ensightParts 00054 { 00055 // Private Data 00056 00057 //- list of parts 00058 PtrList<ensightPart> partsList_; 00059 00060 // Private Member Functions 00061 00062 //- Disallow default bitwise copy construct 00063 ensightParts(const ensightParts&); 00064 00065 //- Disallow default bitwise assignment 00066 void operator=(const ensightParts&); 00067 00068 00069 public: 00070 00071 // Constructors 00072 00073 //- Construct from polyMesh 00074 ensightParts(const polyMesh&); 00075 00076 //- Construct from IOobject 00077 ensightParts(const IOobject&); 00078 00079 00080 //- Destructor 00081 ~ensightParts(); 00082 00083 00084 // Member functions 00085 00086 //- clear old information and construct anew from polyMesh 00087 void recalculate(const polyMesh&); 00088 00089 //- renumber elements 00090 void renumber 00091 ( 00092 const labelList& origCellId, 00093 const labelList& origFaceId 00094 ); 00095 00096 //- number of parts 00097 label size() const 00098 { 00099 return partsList_.size(); 00100 } 00101 00102 //- write the geometry 00103 void writeGeometry(ensightGeoFile&) const; 00104 00105 //- write summary information about the objects 00106 bool writeSummary(Ostream&) const; 00107 00108 //- write the lists 00109 void writeData(Ostream&) const; 00110 00111 //- write scalar field 00112 void writeScalarField 00113 ( 00114 ensightFile&, 00115 const List<scalar>& field, 00116 bool useFaceData = false 00117 ) const; 00118 00119 //- write vector field components 00120 void writeVectorField 00121 ( 00122 ensightFile&, 00123 const List<scalar>& field0, 00124 const List<scalar>& field1, 00125 const List<scalar>& field2, 00126 bool useFaceData = false 00127 ) const; 00128 00129 00130 //- write generalized field components 00131 template <class Type> 00132 void writeField 00133 ( 00134 ensightFile&, 00135 const GeometricField<Type, fvPatchField, volMesh>& 00136 ) const; 00137 00138 00139 // Friend Operators 00140 00141 friend ensightGeoFile& operator<< 00142 ( 00143 ensightGeoFile&, 00144 const ensightParts& 00145 ); 00146 }; 00147 00148 00149 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // 00150 00151 } // End namespace Foam 00152 00153 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // 00154 00155 #ifdef NoRepository 00156 # include "ensightPartsI.H" 00157 #endif 00158 00159 #endif 00160 00161 // ************************ vim: set sw=4 sts=4 et: ************************ //