00001 /*---------------------------------------------------------------------------*\ 00002 ========= | 00003 \\ / F ield | OpenFOAM: The Open Source CFD Toolbox 00004 \\ / O peration | 00005 \\ / A nd | Copyright (C) 2011-2011 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::partialWrite 00026 00027 Description 00028 Allows some fields/registered objects to be written more often than others. 00029 00030 Works in the opposite way: deletes at intermediate times all 00031 but selected fields. 00032 00033 SourceFiles 00034 partialWrite.C 00035 IOpartialWrite.H 00036 00037 \*---------------------------------------------------------------------------*/ 00038 00039 #ifndef partialWrite_H 00040 #define partialWrite_H 00041 00042 #include <OpenFOAM/pointFieldFwd.H> 00043 #include <OpenFOAM/HashSet.H> 00044 #include <OpenFOAM/DynamicList.H> 00045 #include <OpenFOAM/runTimeSelectionTables.H> 00046 00047 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // 00048 00049 namespace Foam 00050 { 00051 00052 // Forward declaration of classes 00053 class objectRegistry; 00054 class dictionary; 00055 class mapPolyMesh; 00056 00057 /*---------------------------------------------------------------------------*\ 00058 Class partialWrite Declaration 00059 \*---------------------------------------------------------------------------*/ 00060 00061 class partialWrite 00062 { 00063 protected: 00064 00065 // Private data 00066 00067 //- Name of this set of partialWrite 00068 word name_; 00069 00070 const objectRegistry& obr_; 00071 00072 00073 // Read from dictionary 00074 00075 //- Names of objects to dump always 00076 HashSet<word> objectNames_; 00077 00078 //- Write interval for restart dump 00079 label writeInterval_; 00080 00081 00082 //- Current dump instance. If reaches writeInterval do a full write. 00083 label writeInstance_; 00084 00085 00086 // Private Member Functions 00087 00088 //- Disallow default bitwise copy construct 00089 partialWrite(const partialWrite&); 00090 00091 //- Disallow default bitwise assignment 00092 void operator=(const partialWrite&); 00093 00094 00095 public: 00096 00097 //- Runtime type information 00098 TypeName("partialWrite"); 00099 00100 00101 // Constructors 00102 00103 //- Construct for given objectRegistry and dictionary. 00104 // Allow the possibility to load fields from files 00105 partialWrite 00106 ( 00107 const word& name, 00108 const objectRegistry&, 00109 const dictionary&, 00110 const bool loadFromFiles = false 00111 ); 00112 00113 00114 //- Destructor 00115 virtual ~partialWrite(); 00116 00117 00118 // Member Functions 00119 00120 //- Return name of the partialWrite 00121 virtual const word& name() const 00122 { 00123 return name_; 00124 } 00125 00126 //- Read the partialWrite data 00127 virtual void read(const dictionary&); 00128 00129 //- Execute, currently does nothing 00130 virtual void execute(); 00131 00132 //- Execute at the final time-loop, currently does nothing 00133 virtual void end(); 00134 00135 //- Write the partialWrite 00136 virtual void write(); 00137 00138 //- Update for changes of mesh 00139 virtual void updateMesh(const mapPolyMesh&) 00140 {} 00141 00142 //- Update for changes of mesh 00143 virtual void movePoints(const pointField&) 00144 {} 00145 }; 00146 00147 00148 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // 00149 00150 } // End namespace Foam 00151 00152 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // 00153 00154 #endif 00155 00156 // ************************ vim: set sw=4 sts=4 et: ************************ //