Field.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
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 inline static const Field<Type>& null()
00103 {
00104 return *reinterpret_cast< Field<Type>* >(0);
00105 }
00106
00107
00108
00109
00110
00111
00112 Field();
00113
00114
00115
00116 explicit Field(const label);
00117
00118
00119 Field(const label, const Type&);
00120
00121
00122 explicit Field(const UList<Type>&);
00123
00124
00125 explicit Field(const Xfer<List<Type> >&);
00126
00127
00128 Field
00129 (
00130 const UList<Type>& mapF,
00131 const labelList& mapAddressing
00132 );
00133
00134
00135 Field
00136 (
00137 const tmp<Field<Type> >& tmapF,
00138 const labelList& mapAddressing
00139 );
00140
00141
00142 Field
00143 (
00144 const UList<Type>& mapF,
00145 const labelListList& mapAddressing,
00146 const scalarListList& weights
00147 );
00148
00149
00150 Field
00151 (
00152 const tmp<Field<Type> >& tmapF,
00153 const labelListList& mapAddressing,
00154 const scalarListList& weights
00155 );
00156
00157
00158 Field
00159 (
00160 const UList<Type>& mapF,
00161 const FieldMapper& map
00162 );
00163
00164
00165 Field
00166 (
00167 const tmp<Field<Type> >& tmapF,
00168 const FieldMapper& map
00169 );
00170
00171
00172 Field(const Field<Type>&);
00173
00174
00175 Field(Field<Type>&, bool reUse);
00176
00177
00178 Field(const Xfer<Field<Type> >&);
00179
00180
00181 Field(const typename Field<Type>::subField&);
00182
00183
00184 # ifdef ConstructFromTmp
00185 Field(const tmp<Field<Type> >&);
00186 # endif
00187
00188
00189 Field(Istream&);
00190
00191
00192 Field(const word& keyword, const dictionary& dict, const label size);
00193
00194
00195 tmp<Field<Type> > clone() const;
00196
00197
00198
00199 template<class Type2>
00200 static tmp<Field<Type> > NewCalculatedType(const Field<Type2>& f)
00201 {
00202 return tmp<Field<Type> >(new Field<Type>(f.size()));
00203 }
00204
00205
00206
00207
00208
00209 void map
00210 (
00211 const UList<Type>& mapF,
00212 const labelList& mapAddressing
00213 );
00214
00215
00216 void map
00217 (
00218 const tmp<Field<Type> >& tmapF,
00219 const labelList& mapAddressing
00220 );
00221
00222
00223 void map
00224 (
00225 const UList<Type>& mapF,
00226 const labelListList& mapAddressing,
00227 const scalarListList& weights
00228 );
00229
00230
00231 void map
00232 (
00233 const tmp<Field<Type> >& tmapF,
00234 const labelListList& mapAddressing,
00235 const scalarListList& weights
00236 );
00237
00238
00239 void map
00240 (
00241 const UList<Type>& mapF,
00242 const FieldMapper& map
00243 );
00244
00245
00246 void map
00247 (
00248 const tmp<Field<Type> >& tmapF,
00249 const FieldMapper& map
00250 );
00251
00252
00253 void autoMap
00254 (
00255 const FieldMapper& map
00256 );
00257
00258
00259 void rmap
00260 (
00261 const UList<Type>& mapF,
00262 const labelList& mapAddressing
00263 );
00264
00265
00266 void rmap
00267 (
00268 const tmp<Field<Type> >& tmapF,
00269 const labelList& mapAddressing
00270 );
00271
00272
00273 void rmap
00274 (
00275 const UList<Type>& mapF,
00276 const labelList& mapAddressing,
00277 const scalarList& weights
00278 );
00279
00280
00281 void rmap
00282 (
00283 const tmp<Field<Type> >& tmapF,
00284 const labelList& mapAddressing,
00285 const scalarList& weights
00286 );
00287
00288
00289 void negate();
00290
00291
00292 tmp<Field<cmptType> > component(const direction) const;
00293
00294
00295 void replace(const direction, const UList<cmptType>&);
00296
00297
00298 void replace(const direction, const tmp<Field<cmptType> >&);
00299
00300
00301 void replace(const direction, const cmptType&);
00302
00303
00304 tmp<Field<Type> > T() const;
00305
00306
00307 void writeEntry(const word& keyword, Ostream& os) const;
00308
00309
00310
00311
00312 void operator=(const Field<Type>&);
00313 void operator=(const UList<Type>&);
00314 void operator=(const SubField<Type>&);
00315 void operator=(const tmp<Field<Type> >&);
00316 void operator=(const Type&);
00317
00318 template<class Form, class Cmpt, int nCmpt>
00319 void operator=(const VectorSpace<Form,Cmpt,nCmpt>&);
00320
00321 void operator+=(const UList<Type>&);
00322 void operator+=(const tmp<Field<Type> >&);
00323
00324 void operator-=(const UList<Type>&);
00325 void operator-=(const tmp<Field<Type> >&);
00326
00327 void operator*=(const UList<scalar>&);
00328 void operator*=(const tmp<Field<scalar> >&);
00329
00330 void operator/=(const UList<scalar>&);
00331 void operator/=(const tmp<Field<scalar> >&);
00332
00333 void operator+=(const Type&);
00334 void operator-=(const Type&);
00335
00336 void operator*=(const scalar&);
00337 void operator/=(const scalar&);
00338
00339
00340
00341
00342 friend Ostream& operator<< <Type>
00343 (Ostream&, const Field<Type>&);
00344
00345 friend Ostream& operator<< <Type>
00346 (Ostream&, const tmp<Field<Type> >&);
00347 };
00348
00349
00350
00351
00352 }
00353
00354
00355
00356 #include "FieldFunctions.H"
00357
00358 #ifdef NoRepository
00359 # include "Field.C"
00360 #endif
00361
00362
00363
00364 #endif
00365
00366
Copyright © 2000-2009 OpenCFD Ltd