78 map(mapF, mapAddressing);
91 map(tmapF, mapAddressing);
105 map(mapF, mapAddressing, mapWeights);
119 map(tmapF, mapAddressing, mapWeights);
133 map(mapF, mapper, applyFlip);
142 const Type& defaultValue,
148 map(mapF, mapper, applyFlip);
163 map(mapF, mapper, applyFlip);
177 map(tmapF, mapper, applyFlip);
186 const Type& defaultValue,
192 map(tmapF, mapper, applyFlip);
207 map(tmapF, mapper, applyFlip);
247 #ifndef NoConstructFromTmp 278 token firstToken(is);
287 else if (firstToken.
wordToken() ==
"nonuniform")
290 if (this->
size() !=
s)
295 ) <<
"size " << this->
size()
296 <<
" is not equal to the given value of " << s
305 ) <<
"expected keyword 'uniform' or 'nonuniform', found " 317 ) <<
"expected keyword 'uniform' or 'nonuniform', " 318 "assuming deprecated Field format from " 319 "Foam version 2.0." <<
endl;
331 ) <<
"expected keyword 'uniform' or 'nonuniform', found " 358 if (f.
size() != mapAddressing.
size())
367 label mapI = mapAddressing[i];
385 map(tmapF(), mapAddressing);
400 if (f.
size() != mapAddressing.
size())
405 if (mapWeights.
size() != mapAddressing.
size())
408 << mapWeights.
size() <<
" map size: " << mapAddressing.
size()
414 const labelList& localAddrs = mapAddressing[i];
415 const scalarList& localWeights = mapWeights[i];
421 f[i] += localWeights[j]*mapF[localAddrs[j]];
435 map(tmapF(), mapAddressing, mapWeights);
467 else if (!mapper.
direct())
507 map(tmapF(), mapper, applyFlip);
541 this->
map(fCpy, mapper);
586 label mapI = mapAddressing[i];
603 rmap(tmapF(), mapAddressing);
622 f[mapAddressing[i]] += mapF[i]*mapWeights[i];
635 rmap(tmapF(), mapAddressing, mapWeights);
697 template<
class VSForm>
701 for (
direction i=0; i<VSForm::nComponents; i++)
725 if (this->
size() && contiguous<Type>())
731 if (this->
operator[](i) != this->
operator[](0))
762 <<
"attempted assignment to self" 787 if (
this == &(rhs()))
790 <<
"attempted assignment to self" 813 template<
class Form,
class Cmpt, Foam::direction nCmpt>
820 #define COMPUTED_ASSIGNMENT(TYPE, op) \ 822 template<class Type> \ 823 void Foam::Field<Type>::operator op(const UList<TYPE>& f) \ 825 TFOR_ALL_F_OP_F(Type, *this, op, TYPE, f) \ 828 template<class Type> \ 829 void Foam::Field<Type>::operator op(const tmp<Field<TYPE>>& tf) \ 835 template<class Type> \ 836 void Foam::Field<Type>::operator op(const TYPE& t) \ 838 TFOR_ALL_F_OP_S(Type, *this, op, TYPE, t) \ 846 #undef COMPUTED_ASSIGNMENT 852 Foam::Ostream& Foam::operator<<(Ostream& os, const Field<Type>&
f)
854 os << static_cast<const List<Type>&>(
f);
860 Foam::Ostream& Foam::operator<<(Ostream& os, const tmp<Field<Type>>&
tf)
A simple container for copying or transferring objects of type <T>.
#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...
Type & operator[](const label)
Return element of UList.
#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...
#define TFOR_ALL_F_OP_OP_F(typeF1, f1, OP1, OP2, typeF2, f2)
An Istream is an abstract base class for all input systems (streams, files, token lists etc)...
pTraits< Type >::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.
Traits class for primitives.
void writeEntry(const word &keyword, Ostream &os) const
Write the field as a dictionary entry.
virtual bool direct() const =0
virtual bool distributed() const
void writeEntry(Ostream &) const
Write the UList as a dictionary entry.
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)
tmp< Field< Type > > clone() const
Clone.
virtual const labelUList & directAddressing() const
virtual const labelListList & addressing() const
virtual label size() const =0
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))
bool isNull(const T &t)
Return true if t is a reference to the nullObject of type T.
Abstract base class to hold the Field mapping addressing and weights.
Pre-declare SubField and related Field type.
A class for handling words, derived from string.
VSForm block(const label start) const
static void distribute(const Pstream::commsTypes commsType, const List< labelPair > &schedule, const label constructSize, const labelListList &subMap, const bool subHasFlip, const labelListList &constructMap, const bool constructHasFlip, List< T > &, const negateOp &negOp, const int tag=UPstream::msgType())
Distribute data. Note:schedule only used for Pstream::scheduled.
versionNumber version() const
Return the stream version.
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
Class containing processor-to-processor mapping information.
An Ostream is an abstract base class for all output systems (streams, files, token lists...
tmp< Field< Type > > T() const
Return the field transpose (only defined for second rank tensors)
void operator=(const Field< Type > &)
tmp< Field< cmptType > > component(const direction) const
Return a component field of the field.
Ostream & writeKeyword(const keyType &)
Write the keyword followed by an appropriate indentation.
virtual const mapDistributeBase & distributeMap() const
label size() const
Return the number of elements in the UList.
void autoMap(const FieldMapper &map, const bool applyFlip=true)
Map from self.
bool notNull(const T &t)
Return true if t is not a reference to the nullObject of type T.
#define TFOR_ALL_F_OP_FUNC_S_F(typeF1, f1, OP, FUNC, typeS, s, typeF2, f2)
virtual const scalarListList & weights() const
void operator=(const UList< T > &)
Assignment from UList operator. Takes linear time.
label size() const
Return the number of elements in the UList.
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.
InfoProxy< token > info() const
Return info proxy.
const word & wordToken() const
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.
High performance macro functions for Field<Type> algebra. These expand using either array element acc...
T & ref() const
Return non-const reference or generate a fatal error.
void component(FieldField< Field, typename FieldField< Field, Type >::cmptType > &sf, const FieldField< Field, Type > &f, const direction d)
void transfer(List< Type > &)
Transfer the contents of the argument List into this list.
ITstream & lookup(const word &, bool recursive=false, bool patternMatch=true) const
Find and return an entry data stream.