131 map(mapF, mapAddressing);
144 map(tmapF, mapAddressing);
158 map(mapF, mapAddressing, mapWeights);
172 map(tmapF, mapAddressing, mapWeights);
196 token firstToken(is);
205 else if (firstToken.
wordToken() ==
"nonuniform")
208 if (this->size() !=
s)
213 ) <<
"size " << this->size()
214 <<
" is not equal to the given value of " << s
223 ) <<
"expected keyword 'uniform' or 'nonuniform', found " 235 ) <<
"expected keyword 'uniform' or 'nonuniform', " 236 "assuming deprecated Field format from " 237 "Foam version 2.0." <<
endl;
249 ) <<
"expected keyword 'uniform' or 'nonuniform', found " 274 if (
static_cast<const UList<Type>*
>(
this) == &mapF)
278 return tmapF.valid() ? tmapF() : mapF;
294 if (f.
size() != mapAddressing.
size())
303 const label mapi = mapAddressing[i];
321 map(tmapF(), mapAddressing);
334 if (mapWeights.
size() != mapAddressing.
size())
337 << mapWeights.
size() <<
" map size: " << mapAddressing.
size()
346 if (this->size() != mapAddressing.
size())
353 const labelList& localAddrs = mapAddressing[i];
354 const scalarList& localWeights = mapWeights[i];
360 f[i] += localWeights[j]*mapF[localAddrs[j]];
374 map(tmapF(), mapAddressing, mapWeights);
393 const label mapi = mapAddressing[i];
410 rmap(tmapF(), mapAddressing);
432 f[mapAddressing[i]] += mapF[i]*mapWeights[i];
445 rmap(tmapF(), mapAddressing, mapWeights);
507 template<
class VSForm>
511 for (
direction i=0; i<VSForm::nComponents; i++)
513 vs[i] = this->operator[](start + i);
536 <<
"attempted assignment to self" 550 <<
"attempted assignment to self" 582 if (
this == &(rhs()))
585 <<
"attempted assignment to self" 608 template<
class Form,
class Cmpt, Foam::direction nCmpt>
615 #define COMPUTED_ASSIGNMENT(TYPE, op) \ 617 template<class Type> \ 618 void Foam::Field<Type>::operator op(const UList<TYPE>& f) \ 620 TFOR_ALL_F_OP_F(Type, *this, op, TYPE, f) \ 623 template<class Type> \ 624 void Foam::Field<Type>::operator op(const tmp<Field<TYPE>>& tf) \ 630 template<class Type> \ 631 void Foam::Field<Type>::operator op(const TYPE& t) \ 633 TFOR_ALL_F_OP_S(Type, *this, op, TYPE, t) \ 641 #undef COMPUTED_ASSIGNMENT 651 if (f.
size() && contiguous<Type>())
667 os <<
"uniform " << f[0];
680 Foam::Ostream& Foam::operator<<(Ostream& os, const Field<Type>&
f)
682 os << static_cast<const List<Type>&>(
f);
688 Foam::Ostream& Foam::operator<<(Ostream& os, const tmp<Field<Type>>&
tf)
#define forAll(list, i)
Loop across all elements in list.
intWM_LABEL_SIZE_t label
A label is an int32_t or int64_t as specified by the pre-processor macro WM_LABEL_SIZE.
errorManipArg< error, int > exit(error &err, const int errNo=1)
Reference counter for various OpenFOAM components.
A list of keyword definitions, which are a keyword followed by any number of values (e...
#define COMPUTED_ASSIGNMENT(TYPE, op)
#define FatalErrorInFunction
Report an error message using Foam::FatalError.
static const char *const typeName
void negate()
Negate this field.
A 1D array of objects of type <T>, where the size of the vector is known and used for subscript bound...
T & ref() const
Return non-const reference or generate a fatal error.
InfoProxy< token > info() const
Return info proxy.
#define TFOR_ALL_F_OP_OP_F(typeF1, f1, OP1, OP2, typeF2, f2)
const word & wordToken() const
An Istream is an abstract base class for all input systems (streams, files, token lists etc)...
pTraits< Foam::Vector2D >::cmptType cmptType
Component type.
void size(const label)
Override size to be inconsistent with allocated storage.
A token holds items read from Istream.
void putBack(const token &)
Put back token.
Ostream & endl(Ostream &os)
Add newline and flush stream.
Template function to specify if the data of a type are contiguous.
versionNumber version() const
Return the stream version.
Pre-declare related SubField type.
void replace(const direction, const UList< cmptType > &)
Replace a component field of the field.
#define TFOR_ALL_F_OP_S(typeF, f, OP, typeS, s)
points setSize(newPointi)
gmvFile<< "tracers "<< particles.size()<< nl;forAllConstIter(Cloud< passiveParticle >, particles, iter){ gmvFile<< iter().position().x()<< " ";}gmvFile<< nl;forAllConstIter(Cloud< passiveParticle >, particles, iter){ gmvFile<< iter().position().y()<< " ";}gmvFile<< nl;forAllConstIter(Cloud< passiveParticle >, particles, iter){ gmvFile<< iter().position().z()<< " ";}gmvFile<< nl;forAll(lagrangianScalarNames, i){ word name=lagrangianScalarNames[i];IOField< scalar > s(IOobject(name, runTime.timeName(), cloud::prefix, mesh, IOobject::MUST_READ, IOobject::NO_WRITE))
Pre-declare SubField and related Field type.
A class for handling words, derived from string.
tmp< Field< Type > > clone() const
Clone.
VSForm block(const label start) const
errorManip< error > abort(error &err)
#define TFOR_ALL_F_OP_FUNC_S_S(typeF1, f1, OP, FUNC, typeS1, s1, typeS2, s2)
void map(const UList< Type > &mapF, const labelUList &mapAddressing)
1 to 1 map from the given field
tmp< Field< cmptType > > component(const direction) const
Return a component field of the field.
An Ostream is an abstract base class for all output systems (streams, files, token lists...
void operator=(const Field< Type > &)
void writeEntry(Ostream &os, const HashTable< T, Key, Hash > &ht)
#define TFOR_ALL_F_OP_FUNC_S_F(typeF1, f1, OP, FUNC, typeS, s, typeF2, f2)
void setSize(const label)
Reset size of List.
void rmap(const UList< Type > &mapF, const labelUList &mapAddressing)
1 to 1 reverse-map from the given field
#define FatalIOErrorInFunction(ios)
Report an error message using Foam::FatalIOError.
A List with indirect addressing.
tmp< Field< Type > > T() const
Return the field transpose (only defined for second rank tensors)
A class representing the concept of 0 used to avoid unnecessary manipulations for objects that are kn...
#define IOWarningInFunction(ios)
Report an IO warning using Foam::Warning.
A class for managing temporary objects.
label size() const
Return the number of elements in the UList.
High performance macro functions for Field<Type> algebra. These expand using either array element acc...
void component(FieldField< Field, typename FieldField< Field, Type >::cmptType > &sf, const FieldField< Field, Type > &f, const direction d)
ITstream & lookup(const word &, bool recursive=false, bool patternMatch=true) const
Find and return an entry data stream.