127 List<Type>(mapAddressing.size())
129 map(mapF, mapAddressing);
140 List<Type>(mapAddressing.size())
142 map(tmapF, mapAddressing);
154 List<Type>(mapAddressing.size())
156 map(mapF, mapAddressing, mapWeights);
170 map(tmapF, mapAddressing, mapWeights);
194 token firstToken(is);
196 if (firstToken.isWord())
198 if (firstToken.wordToken() ==
"uniform")
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 "
222 << firstToken.wordToken()
231 ) <<
"expected keyword 'uniform' or 'nonuniform', found "
255 if (
static_cast<const UList<Type>*
>(
this) == &mapF)
259 return tmapF.
valid() ? tmapF() : mapF;
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);
437 <<
"attempted assignment to self"
502 template<
class VSForm>
506 for (
direction i=0; i<VSForm::nComponents; i++)
508 vs[i] = this->operator[](start + i);
531 <<
"attempted assignment to self"
545 <<
"attempted assignment to self"
577 if (
this == &(rhs()))
580 <<
"attempted assignment to self"
603 template<
class Form,
class Cmpt, Foam::direction nCmpt>
610 #define COMPUTED_ASSIGNMENT(TYPE, op) \
612 template<class Type> \
613 void Foam::Field<Type>::operator op(const UList<TYPE>& f) \
615 TFOR_ALL_F_OP_F(Type, *this, op, TYPE, f) \
618 template<class Type> \
619 void Foam::Field<Type>::operator op(const tmp<Field<TYPE>>& tf) \
625 template<class Type> \
626 void Foam::Field<Type>::operator op(const TYPE& t) \
628 TFOR_ALL_F_OP_S(Type, *this, op, TYPE, t) \
636 #undef COMPUTED_ASSIGNMENT
644 bool uniform =
false;
646 if (
f.
size() && contiguous<Type>())
662 os <<
"uniform " <<
f[0];
677 os << static_cast<const List<Type>&>(
f);
High performance macro functions for Field<Type> algebra. These expand using either array element acc...
#define TFOR_ALL_F_OP_OP_F(typeF1, f1, OP1, OP2, typeF2, f2)
#define TFOR_ALL_F_OP_S(typeF, f, OP, typeS, s)
#define TFOR_ALL_F_OP_FUNC_S_S(typeF1, f1, OP, FUNC, typeS1, s1, typeS2, s2)
#define TFOR_ALL_F_OP_FUNC_S_F(typeF1, f1, OP, FUNC, typeS, s, typeF2, f2)
#define COMPUTED_ASSIGNMENT(TYPE, op)
#define forAll(list, i)
Loop across all elements in list.
Pre-declare SubField and related Field type.
tmp< Field< Type > > T() const
Return the field transpose (only defined for second rank tensors)
void operator=(const Field< Type > &)
pTraits< Type >::cmptType cmptType
Component type.
void replace(const direction, const UList< cmptType > &)
Replace a component field of the field.
tmp< Field< Type > > clone() const
Clone.
void reset(const Field< Type > &)
Reset the field values to the given field.
void negate()
Negate this field.
void map(const UList< Type > &mapF, const labelUList &mapAddressing)
1 to 1 map from the given field
void rmap(const UList< Type > &mapF, const labelUList &mapAddressing)
1 to 1 reverse-map from the given field
tmp< Field< cmptType > > component(const direction) const
Return a component field of the field.
VSForm block(const label start) const
static const char *const typeName
An Istream is an abstract base class for all input systems (streams, files, token lists etc)....
A 1D array of objects of type <T>, where the size of the vector is known and used for subscript bound...
void size(const label)
Override size to be inconsistent with allocated storage.
void clear()
Clear the list, i.e. set size to zero.
void operator=(const UList< T > &)
Assignment to UList operator. Takes linear time.
void setSize(const label)
Reset size of List.
An Ostream is an abstract base class for all output systems (streams, files, token lists,...
Pre-declare related SubField type.
A List with indirect addressing.
label size() const
Return the number of elements in the UList.
A list of keyword definitions, which are a keyword followed by any number of values (e....
ITstream & lookup(const word &, bool recursive=false, bool patternMatch=true) const
Find and return an entry data stream.
Reference counter for various OpenFOAM components.
A class for managing temporary objects.
bool valid() const
Is this temporary object valid,.
void clear() const
If object pointer points to valid object:
T & ref() const
Return non-const reference or generate a fatal error.
A token holds items read from Istream.
A class for handling words, derived from string.
A class representing the concept of 0 used to avoid unnecessary manipulations for objects that are kn...
Template function to specify if the data of a type are contiguous.
#define FatalIOErrorInFunction(ios)
Report an error message using Foam::FatalIOError.
#define FatalErrorInFunction
Report an error message using Foam::FatalError.
volScalarField sf(fieldObject, mesh)
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.name(), cloud::prefix, mesh, IOobject::MUST_READ, IOobject::NO_WRITE))
const dimensionedScalar c
Speed of light in a vacuum.
errorManipArg< error, int > exit(error &err, const int errNo=1)
List< label > labelList
A List of labels.
intWM_LABEL_SIZE_t label
A label is an int32_t or int64_t as specified by the pre-processor macro WM_LABEL_SIZE.
void component(FieldField< Field, typename FieldField< Field, Type >::cmptType > &sf, const FieldField< Field, Type > &f, const direction d)
errorManip< error > abort(error &err)
List< scalar > scalarList
A List of scalars.
void writeEntry(Ostream &os, const HashTable< T, Key, Hash > &ht)
Ostream & operator<<(Ostream &, const ensightPart &)
void T(FieldField< Field, Type > &f1, const FieldField< Field, Type > &f2)
points setSize(newPointi)