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
00038
00039
00040
00041
00042 #ifndef Field_H
00043 #define Field_H
00044
00045 #include "tmp.H"
00046 #include "direction.H"
00047 #include "VectorSpace.H"
00048 #include "scalarList.H"
00049 #include "labelList.H"
00050
00051
00052
00053 namespace Foam
00054 {
00055
00056
00057
00058 template<class Type>
00059 class Field;
00060
00061
00062 template<class Type>
00063 class SubField;
00064
00065 template<class Type>
00066 Ostream& operator<<(Ostream&, const Field<Type>&);
00067
00068 template<class Type>
00069 Ostream& operator<<(Ostream&, const tmp<Field<Type> >&);
00070
00071 class FieldMapper;
00072 class dictionary;
00073
00074
00075
00076
00077
00078 template<class Type>
00079 class Field
00080 :
00081 public refCount,
00082 public List<Type>
00083 {
00084
00085 public:
00086
00087
00088 typedef typename pTraits<Type>::cmptType cmptType;
00089
00090
00091 typedef SubField<Type> subField;
00092
00093
00094
00095
00096 static const char* const typeName;
00097
00098
00099
00100
00101
00102
00103 Field();
00104
00105
00106
00107 explicit Field(const label);
00108
00109
00110 Field(const label, const Type&);
00111
00112
00113 explicit Field(const UList<Type>&);
00114
00115
00116 Field
00117 (
00118 const UList<Type>& mapF,
00119 const labelList& mapAddressing
00120 );
00121
00122
00123 Field
00124 (
00125 const tmp<Field<Type> >& tmapF,
00126 const labelList& mapAddressing
00127 );
00128
00129
00130 Field
00131 (
00132 const UList<Type>& mapF,
00133 const labelListList& mapAddressing,
00134 const scalarListList& weights
00135 );
00136
00137
00138 Field
00139 (
00140 const tmp<Field<Type> >& tmapF,
00141 const labelListList& mapAddressing,
00142 const scalarListList& weights
00143 );
00144
00145
00146 Field
00147 (
00148 const UList<Type>& mapF,
00149 const FieldMapper& map
00150 );
00151
00152
00153 Field
00154 (
00155 const tmp<Field<Type> >& tmapF,
00156 const FieldMapper& map
00157 );
00158
00159
00160 Field(const Field<Type>&);
00161
00162
00163 Field(Field<Type>&, bool reUse);
00164
00165
00166 Field(const typename Field<Type>::subField&);
00167
00168
00169 # ifdef ConstructFromTmp
00170 Field(const tmp<Field<Type> >&);
00171 # endif
00172
00173
00174 Field(Istream&);
00175
00176
00177 Field(const word& keyword, const dictionary& dict, const label size);
00178
00179
00180 tmp<Field<Type> > clone() const;
00181
00182
00183
00184 template<class Type2>
00185 static tmp<Field<Type> > NewCalculatedType(const Field<Type2>& f)
00186 {
00187 return tmp<Field<Type> >(new Field<Type>(f.size()));
00188 }
00189
00190
00191
00192
00193
00194 static Field<Type>& null();
00195
00196
00197
00198 void map
00199 (
00200 const UList<Type>& mapF,
00201 const labelList& mapAddressing
00202 );
00203
00204
00205 void map
00206 (
00207 const tmp<Field<Type> >& tmapF,
00208 const labelList& mapAddressing
00209 );
00210
00211
00212 void map
00213 (
00214 const UList<Type>& mapF,
00215 const labelListList& mapAddressing,
00216 const scalarListList& weights
00217 );
00218
00219
00220 void map
00221 (
00222 const tmp<Field<Type> >& tmapF,
00223 const labelListList& mapAddressing,
00224 const scalarListList& weights
00225 );
00226
00227
00228 void map
00229 (
00230 const UList<Type>& mapF,
00231 const FieldMapper& map
00232 );
00233
00234
00235 void map
00236 (
00237 const tmp<Field<Type> >& tmapF,
00238 const FieldMapper& map
00239 );
00240
00241
00242 void autoMap
00243 (
00244 const FieldMapper& map
00245 );
00246
00247
00248 void rmap
00249 (
00250 const UList<Type>& mapF,
00251 const labelList& mapAddressing
00252 );
00253
00254
00255 void rmap
00256 (
00257 const tmp<Field<Type> >& tmapF,
00258 const labelList& mapAddressing
00259 );
00260
00261
00262 void rmap
00263 (
00264 const UList<Type>& mapF,
00265 const labelList& mapAddressing,
00266 const scalarList& weights
00267 );
00268
00269
00270 void rmap
00271 (
00272 const tmp<Field<Type> >& tmapF,
00273 const labelList& mapAddressing,
00274 const scalarList& weights
00275 );
00276
00277
00278 void negate();
00279
00280
00281 tmp<Field<cmptType> > component(const direction) const;
00282
00283
00284 void replace(const direction, const UList<cmptType>&);
00285
00286
00287 void replace(const direction, const tmp<Field<cmptType> >&);
00288
00289
00290 void replace(const direction, const cmptType&);
00291
00292
00293 tmp<Field<Type> > T() const;
00294
00295
00296 void writeEntry(const word& keyword, Ostream& os) const;
00297
00298
00299
00300
00301 void operator=(const Field<Type>&);
00302 void operator=(const UList<Type>&);
00303 void operator=(const SubField<Type>&);
00304 void operator=(const tmp<Field<Type> >&);
00305 void operator=(const Type&);
00306
00307 template<class Form, class Cmpt, int nCmpt>
00308 void operator=(const VectorSpace<Form,Cmpt,nCmpt>&);
00309
00310 void operator+=(const UList<Type>&);
00311 void operator+=(const tmp<Field<Type> >&);
00312
00313 void operator-=(const UList<Type>&);
00314 void operator-=(const tmp<Field<Type> >&);
00315
00316 void operator*=(const UList<scalar>&);
00317 void operator*=(const tmp<Field<scalar> >&);
00318
00319 void operator/=(const UList<scalar>&);
00320 void operator/=(const tmp<Field<scalar> >&);
00321
00322 void operator+=(const Type&);
00323 void operator-=(const Type&);
00324
00325 void operator*=(const scalar&);
00326 void operator/=(const scalar&);
00327
00328
00329
00330
00331 friend Ostream& operator<< <Type>(Ostream&, const Field<Type>&);
00332 friend Ostream& operator<< <Type>(Ostream&, const tmp<Field<Type> >&);
00333 };
00334
00335
00336
00337
00338 }
00339
00340
00341
00342 #include "FieldFunctions.H"
00343
00344 #ifdef NoRepository
00345 # include "Field.C"
00346 #endif
00347
00348
00349
00350 #endif
00351
00352
Copyright © 2000-2007 OpenCFD Ltd