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 Namespace 00025 Foam::calcTypes 00026 00027 Description 00028 Namespace for post-processing calculation functions 00029 00030 00031 Class 00032 Foam::calcType 00033 00034 Description 00035 Base class for post-processing calculation functions 00036 00037 SourceFiles 00038 calcType.C 00039 00040 \*---------------------------------------------------------------------------*/ 00041 00042 #ifndef calcType_H 00043 #define calcType_H 00044 00045 #include <OpenFOAM/autoPtr.H> 00046 #include <OpenFOAM/runTimeSelectionTables.H> 00047 00048 #include <finiteVolume/fvCFD.H> 00049 00050 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // 00051 00052 namespace Foam 00053 { 00054 00055 /*---------------------------------------------------------------------------*\ 00056 Class calcType Declaration 00057 \*---------------------------------------------------------------------------*/ 00058 00059 class calcType 00060 { 00061 // Private Member Functions 00062 00063 //- Disallow default bitwise copy construct 00064 calcType(const calcType&); 00065 00066 //- Disallow default bitwise assignment 00067 void operator=(const calcType&); 00068 00069 00070 protected: 00071 00072 // Protected member functions 00073 00074 // Calculation routines 00075 00076 //- Initialise - typically setting static variables, 00077 // e.g. command line arguments 00078 virtual void init(); 00079 00080 //- Pre-time loop calculations 00081 virtual void preCalc 00082 ( 00083 const argList& args, 00084 const Time& runTime, 00085 const fvMesh& mesh 00086 ); 00087 00088 //- Time loop calculations 00089 virtual void calc 00090 ( 00091 const argList& args, 00092 const Time& runTime, 00093 const fvMesh& mesh 00094 ); 00095 00096 //- Post-time loop calculations 00097 virtual void postCalc 00098 ( 00099 const argList& args, 00100 const Time& runTime, 00101 const fvMesh& mesh 00102 ); 00103 00104 00105 public: 00106 00107 //- Runtime type information 00108 TypeName("calcType"); 00109 00110 00111 // Declare runtime constructor selection table 00112 00113 declareRunTimeSelectionTable 00114 ( 00115 autoPtr, 00116 calcType, 00117 dictionary, 00118 (), 00119 () 00120 ); 00121 00122 00123 // Constructors 00124 00125 //- Construct null 00126 calcType(); 00127 00128 00129 // Selectors 00130 00131 static autoPtr<calcType> New(const word& calcTypeName); 00132 00133 00134 // Destructor 00135 00136 virtual ~calcType(); 00137 00138 00139 // Member Functions 00140 00141 // Calculation routines - wrapped by exception handling loop 00142 00143 //- Initialise - typically setting static variables, 00144 // e.g. command line arguments 00145 void tryInit(); 00146 00147 //- Pre-time loop calculations 00148 void tryPreCalc 00149 ( 00150 const argList& args, 00151 const Time& runTime, 00152 const fvMesh& mesh 00153 ); 00154 00155 //- Time loop calculations 00156 void tryCalc 00157 ( 00158 const argList& args, 00159 const Time& runTime, 00160 const fvMesh& mesh 00161 ); 00162 00163 //- Post-time loop calculations 00164 void tryPostCalc 00165 ( 00166 const argList& args, 00167 const Time& runTime, 00168 const fvMesh& mesh 00169 ); 00170 }; 00171 00172 00173 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // 00174 00175 } // End namespace Foam 00176 00177 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // 00178 00179 #endif 00180 00181 // ************************ vim: set sw=4 sts=4 et: ************************ //