IntegrationScheme.H
Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031
00032
00033
00034
00035
00036
00037 #ifndef IntegrationScheme_H
00038 #define IntegrationScheme_H
00039
00040 #include "autoPtr.H"
00041 #include "runTimeSelectionTables.H"
00042 #include "dictionary.H"
00043
00044
00045
00046 namespace Foam
00047 {
00048
00049
00050
00051
00052
00053 template<class Type>
00054 class IntegrationScheme
00055 {
00056
00057 public:
00058
00059
00060 class integrationResult
00061 {
00062
00063 Type value_;
00064
00065
00066 Type average_;
00067
00068
00069 public:
00070
00071
00072 integrationResult()
00073 :
00074 value_(pTraits<Type>::zero),
00075 average_(pTraits<Type>::zero)
00076 {}
00077
00078
00079
00080
00081
00082
00083
00084 Type value() const
00085 {
00086 return value_;
00087 }
00088
00089
00090 Type average() const
00091 {
00092 return average_;
00093 }
00094
00095
00096
00097
00098
00099 Type& value()
00100 {
00101 return value_;
00102 }
00103
00104
00105 Type& average()
00106 {
00107 return average_;
00108 }
00109 };
00110
00111
00112 private:
00113
00114
00115
00116
00117 const word& phiName_;
00118
00119
00120 const dictionary& dict_;
00121
00122
00123
00124
00125
00126 IntegrationScheme(const IntegrationScheme&);
00127
00128
00129 void operator=(const IntegrationScheme&);
00130
00131
00132 public:
00133
00134
00135 TypeName("IntegrationScheme");
00136
00137
00138
00139
00140 declareRunTimeSelectionTable
00141 (
00142 autoPtr,
00143 IntegrationScheme,
00144 dictionary,
00145 (
00146 const word& phiName,
00147 const dictionary& dict
00148 ),
00149 (phiName, dict)
00150 );
00151
00152
00153
00154
00155
00156 IntegrationScheme(const word& phiName, const dictionary& dict);
00157
00158
00159
00160
00161
00162 static autoPtr<IntegrationScheme> New
00163 (
00164 const word& phiName,
00165 const dictionary& dict
00166 );
00167
00168
00169
00170 virtual ~IntegrationScheme();
00171
00172
00173
00174
00175
00176 virtual integrationResult integrate
00177 (
00178 const Type phi,
00179 const scalar dt,
00180 const Type alpha,
00181 const scalar beta
00182 ) const = 0;
00183 };
00184
00185
00186
00187
00188 }
00189
00190
00191
00192 #define makeIntegrationScheme(Type) \
00193 \
00194 defineNamedTemplateTypeNameAndDebug(IntegrationScheme<Type>, 0); \
00195 \
00196 defineTemplateRunTimeSelectionTable \
00197 ( \
00198 IntegrationScheme<Type>, \
00199 dictionary \
00200 );
00201
00202
00203 #define makeIntegrationSchemeType(SS, Type) \
00204 \
00205 defineNamedTemplateTypeNameAndDebug(SS<Type>, 0); \
00206 \
00207 IntegrationScheme<Type>::adddictionaryConstructorToTable<SS<Type> > \
00208 add##SS##Type##ConstructorToTable_;
00209
00210
00211
00212
00213 #ifdef NoRepository
00214 # include "IntegrationScheme.C"
00215 #endif
00216
00217
00218
00219 #endif
00220
00221
00222
Copyright © 2000-2009 OpenCFD Ltd