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);
254 #ifndef NoConstructFromTmp 285 token firstToken(is);
294 else if (firstToken.
wordToken() ==
"nonuniform")
297 if (this->size() !=
s)
302 ) <<
"size " << this->size()
303 <<
" is not equal to the given value of " << s
312 ) <<
"expected keyword 'uniform' or 'nonuniform', found " 324 ) <<
"expected keyword 'uniform' or 'nonuniform', " 325 "assuming deprecated Field format from " 326 "Foam version 2.0." <<
endl;
338 ) <<
"expected keyword 'uniform' or 'nonuniform', found " 365 if (f.
size() != mapAddressing.
size())
374 label mapI = mapAddressing[i];
392 map(tmapF(), mapAddressing);
407 if (f.
size() != mapAddressing.
size())
412 if (mapWeights.
size() != mapAddressing.
size())
415 << mapWeights.
size() <<
" map size: " << mapAddressing.
size()
421 const labelList& localAddrs = mapAddressing[i];
422 const scalarList& localWeights = mapWeights[i];
428 f[i] += localWeights[j]*mapF[localAddrs[j]];
442 map(tmapF(), mapAddressing, mapWeights);
474 else if (!mapper.
direct())
483 this->transfer(newMapF);
514 map(tmapF(), mapper, applyFlip);
548 this->map(fCpy, mapper);
555 this->transfer(fCpy);
593 label mapI = mapAddressing[i];
610 rmap(tmapF(), mapAddressing);
629 f[mapAddressing[i]] += mapF[i]*mapWeights[i];
642 rmap(tmapF(), mapAddressing, mapWeights);
704 template<
class VSForm>
708 for (
direction i=0; i<VSForm::nComponents; i++)
710 vs[i] = this->operator[](start + i);
732 if (this->size() && contiguous<Type>())
738 if (this->
operator[](i) != this->
operator[](0))
748 os <<
"uniform " << this->operator[](0) << token::END_STATEMENT;
754 os << token::END_STATEMENT;
769 <<
"attempted assignment to self" 794 if (
this == &(rhs()))
797 <<
"attempted assignment to self" 820 template<
class Form,
class Cmpt, Foam::direction nCmpt>
827 #define COMPUTED_ASSIGNMENT(TYPE, op) \ 829 template<class Type> \ 830 void Foam::Field<Type>::operator op(const UList<TYPE>& f) \ 832 TFOR_ALL_F_OP_F(Type, *this, op, TYPE, f) \ 835 template<class Type> \ 836 void Foam::Field<Type>::operator op(const tmp<Field<TYPE>>& tf) \ 842 template<class Type> \ 843 void Foam::Field<Type>::operator op(const TYPE& t) \ 845 TFOR_ALL_F_OP_S(Type, *this, op, TYPE, t) \ 853 #undef COMPUTED_ASSIGNMENT 859 Foam::Ostream& Foam::operator<<(Ostream& os, const Field<Type>&
f)
861 os << static_cast<const List<Type>&>(
f);
867 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...
#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.
virtual const labelListList & addressing() const
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.
virtual bool direct() const =0
void writeEntry(const word &keyword, Ostream &os) const
Write the field as a dictionary entry.
virtual const scalarListList & weights() const
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.
virtual const labelUList & directAddressing() const
#define TFOR_ALL_F_OP_S(typeF, f, OP, typeS, s)
points setSize(newPointi)
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.
tmp< Field< Type > > clone() const
Clone.
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.
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.
virtual const mapDistributeBase & distributeMap() const
Class containing processor-to-processor mapping information.
An Ostream is an abstract base class for all output systems (streams, files, token lists...
virtual bool distributed() const
void operator=(const Field< Type > &)
Ostream & writeKeyword(const keyType &)
Write the keyword followed by an appropriate indentation.
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)
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.