![]() |
|
00001 /*---------------------------------------------------------------------------*\ 00002 ========= | 00003 \\ / F ield | OpenFOAM: The Open Source CFD Toolbox 00004 \\ / O peration | 00005 \\ / A nd | Copyright (C) 1991-2005 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 TimeState 00027 00028 Description 00029 00030 SourceFiles 00031 TimeState.C 00032 00033 \*---------------------------------------------------------------------------*/ 00034 00035 #ifndef TimeState_H 00036 #define TimeState_H 00037 00038 #include "dimensionedScalar.H" 00039 00040 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // 00041 00042 namespace Foam 00043 { 00044 00045 /*---------------------------------------------------------------------------*\ 00046 Class TimeState Declaration 00047 \*---------------------------------------------------------------------------*/ 00048 00049 00050 class TimeState 00051 : 00052 public dimensionedScalar 00053 { 00054 00055 protected: 00056 00057 label timeIndex_; 00058 scalar deltaT_; 00059 scalar deltaTSave_; 00060 scalar deltaT0_; 00061 bool deltaTchanged_; 00062 00063 label outputTimeIndex_; 00064 bool outputTime_; 00065 00066 00067 public: 00068 00069 // Constructors 00070 00071 TimeState(); 00072 00073 00074 // Destructor 00075 00076 //- Virtual destructor 00077 virtual ~TimeState(); 00078 00079 00080 // Member functions 00081 00082 // Access 00083 00084 //- Convert the user-time (e.g. CA deg) to real-time (s). 00085 virtual scalar userTimeToTime(const scalar theta) const; 00086 00087 //- Convert the real-time (s) into user-time (e.g. CA deg) 00088 virtual scalar timeToUserTime(const scalar t) const; 00089 00090 //- Return current time value 00091 virtual scalar timeOutputValue() const; 00092 00093 //- Return current time index 00094 virtual label timeIndex() const; 00095 00096 //- Return time step 00097 virtual dimensionedScalar deltaT() const; 00098 00099 //- Return old time step 00100 virtual dimensionedScalar deltaT0() const; 00101 00102 00103 // Check 00104 00105 //- Return true if this is an output time 00106 virtual bool outputTime() const; 00107 }; 00108 00109 00110 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // 00111 00112 } // End namespace Foam 00113 00114 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // 00115 00116 #endif 00117 00118 // ************************************************************************* //