128 List<Type>(mapAddressing.size())
130 map(mapF, mapAddressing);
141 List<Type>(mapAddressing.size())
143 map(tmapF, mapAddressing);
155 List<Type>(mapAddressing.size())
157 map(mapF, mapAddressing, mapWeights);
171 map(tmapF, mapAddressing, mapWeights);
208 token firstToken(is);
212 const bool haveUnits =
units.readIfPresent(keyword,
dict, is);
223 else if (firstToken.
wordToken() ==
"nonuniform")
227 if (this->size() !=
s)
230 <<
"size " << this->size()
231 <<
" is not equal to the given value of " <<
s
238 <<
"expected keyword 'uniform' or 'nonuniform', found "
246 <<
"expected keyword 'uniform' or 'nonuniform', found "
252 if (!haveUnits && !is.
eof())
258 units.makeStandard(*
this);
283 return tmapF.
valid() ? tmapF() : mapF;
308 const label mapi = mapAddressing[i];
326 map(tmapF(), mapAddressing);
339 if (mapWeights.
size() != mapAddressing.
size())
342 << mapWeights.
size() <<
" map size: " << mapAddressing.
size()
351 if (this->size() != mapAddressing.
size())
358 const labelList& localAddrs = mapAddressing[i];
359 const scalarList& localWeights = mapWeights[i];
365 f[i] += localWeights[j]*mapF[localAddrs[j]];
379 map(tmapF(), mapAddressing, mapWeights);
398 const label mapi = mapAddressing[i];
415 rmap(tmapF(), mapAddressing);
437 f[mapAddressing[i]] += mapF[i]*mapWeights[i];
450 rmap(tmapF(), mapAddressing, mapWeights);
461 <<
"attempted assignment to self"
526 template<
class VSForm>
530 for (
direction i=0; i<VSForm::nComponents; i++)
532 vs[i] = this->operator[](start + i);
555 <<
"attempted assignment to self"
569 <<
"attempted assignment to self"
601 if (
this == &(rhs()))
604 <<
"attempted assignment to self"
627 template<
class Form,
class Cmpt, Foam::direction nCmpt>
634 #define COMPUTED_ASSIGNMENT(TYPE, op) \
636 template<class Type> \
637 void Foam::Field<Type>::operator op(const UList<TYPE>& f) \
639 TFOR_ALL_F_OP_F(Type, *this, op, TYPE, f) \
642 template<class Type> \
643 void Foam::Field<Type>::operator op(const tmp<Field<TYPE>>& tf) \
649 template<class Type> \
650 void Foam::Field<Type>::operator op(const TYPE& t) \
652 TFOR_ALL_F_OP_S(Type, *this, op, TYPE, t) \
660 #undef COMPUTED_ASSIGNMENT
668 bool uniform =
false;
670 if (
f.
size() && contiguous<Type>())
686 os <<
"uniform " <<
f[0];
701 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
bool eof() const
Return true if end of input seen.
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.
InfoProxy< token > info() const
Return info proxy.
const word & wordToken() const
Unit conversion structure. Contains the associated dimensions and the multiplier with which to conver...
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)
intWM_LABEL_SIZE_t label
A label is an int32_t or int64_t as specified by the pre-processor macro WM_LABEL_SIZE.
const unitConversion unitAny
void component(FieldField< Field, typename FieldField< Field, Type >::cmptType > &sf, const FieldField< Field, Type > &f, const direction d)
errorManip< error > abort(error &err)
const HashTable< unitConversion > & units()
Get the table of unit conversions.
void writeEntry(Ostream &os, const HashTable< T, Key, Hash > &ht)
Ostream & operator<<(Ostream &os, const fvConstraints &constraints)
void T(FieldField< Field, Type > &f1, const FieldField< Field, Type > &f2)
points setSize(newPointi)