129 map(mapF, mapAddressing);
142 map(tmapF, mapAddressing);
156 map(mapF, mapAddressing, mapWeights);
170 map(tmapF, mapAddressing, mapWeights);
194 token firstToken(is);
203 else if (firstToken.
wordToken() ==
"nonuniform")
206 if (this->size() !=
s)
211 ) <<
"size " << this->size()
212 <<
" is not equal to the given value of " << s
221 ) <<
"expected keyword 'uniform' or 'nonuniform', found " 231 ) <<
"expected keyword 'uniform' or 'nonuniform', found " 255 if (
static_cast<const UList<Type>*
>(
this) == &mapF)
259 return tmapF.valid() ? tmapF() : mapF;
275 if (f.
size() != mapAddressing.
size())
284 const label mapi = mapAddressing[i];
302 map(tmapF(), mapAddressing);
315 if (mapWeights.
size() != mapAddressing.
size())
318 << mapWeights.
size() <<
" map size: " << mapAddressing.
size()
327 if (this->size() != mapAddressing.
size())
334 const labelList& localAddrs = mapAddressing[i];
335 const scalarList& localWeights = mapWeights[i];
341 f[i] += localWeights[j]*mapF[localAddrs[j]];
355 map(tmapF(), mapAddressing, mapWeights);
374 const label mapi = mapAddressing[i];
391 rmap(tmapF(), mapAddressing);
413 f[mapAddressing[i]] += mapF[i]*mapWeights[i];
426 rmap(tmapF(), mapAddressing, mapWeights);
488 template<
class VSForm>
492 for (
direction i=0; i<VSForm::nComponents; i++)
494 vs[i] = this->operator[](start + i);
517 <<
"attempted assignment to self" 531 <<
"attempted assignment to self" 563 if (
this == &(rhs()))
566 <<
"attempted assignment to self" 589 template<
class Form,
class Cmpt, Foam::direction nCmpt>
596 #define COMPUTED_ASSIGNMENT(TYPE, op) \ 598 template<class Type> \ 599 void Foam::Field<Type>::operator op(const UList<TYPE>& f) \ 601 TFOR_ALL_F_OP_F(Type, *this, op, TYPE, f) \ 604 template<class Type> \ 605 void Foam::Field<Type>::operator op(const tmp<Field<TYPE>>& tf) \ 611 template<class Type> \ 612 void Foam::Field<Type>::operator op(const TYPE& t) \ 614 TFOR_ALL_F_OP_S(Type, *this, op, TYPE, t) \ 622 #undef COMPUTED_ASSIGNMENT 632 if (f.
size() && contiguous<Type>())
648 os <<
"uniform " << f[0];
661 Foam::Ostream& Foam::operator<<(Ostream& os, const Field<Type>&
f)
663 os << static_cast<const List<Type>&>(
f);
669 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< PointType >::cmptType cmptType
Component type.
void size(const label)
Override size to be inconsistent with allocated storage.
A token holds items read from Istream.
Template function to specify if the data of a type are contiguous.
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...
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.