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