Go to the documentation of this file.
46 map(mapF, mapAddressing);
59 map(tmapF, mapAddressing);
73 map(mapF, mapAddressing, mapWeights);
87 map(tmapF, mapAddressing, mapWeights);
101 map(mapF, mapper, applyFlip);
110 const Type& defaultValue,
116 map(mapF, mapper, applyFlip);
131 map(mapF, mapper, applyFlip);
145 map(tmapF, mapper, applyFlip);
154 const Type& defaultValue,
160 map(tmapF, mapper, applyFlip);
175 map(tmapF, mapper, applyFlip);
192 token firstToken(is);
201 else if (firstToken.
wordToken() ==
"nonuniform")
204 label currentSize = this->size();
205 if (currentSize != len)
207 if (len < currentSize && allowConstructFromLargerSize)
211 <<
"Sizes do not match. "
212 <<
"Re-sizing " << currentSize
213 <<
" entries to " << len
223 <<
"size " << this->size()
224 <<
" is not equal to the given value of " << len
232 <<
"Expected keyword 'uniform' or 'nonuniform', found "
240 <<
"Expected keyword 'uniform' or 'nonuniform', found "
241 << firstToken.
info() <<
nl
259 if (
f.size() != mapAddressing.
size())
261 f.setSize(mapAddressing.
size());
268 const label mapI = mapAddressing[i];
286 map(tmapF(), mapAddressing);
301 if (
f.size() != mapAddressing.size())
303 f.setSize(mapAddressing.size());
306 if (mapWeights.size() != mapAddressing.size())
309 << mapWeights.size() <<
" map size: " << mapAddressing.size()
315 const labelList& localAddrs = mapAddressing[i];
316 const scalarList& localWeights = mapWeights[i];
322 f[i] += localWeights[j]*mapF[localAddrs[j]];
336 map(tmapF(), mapAddressing, mapWeights);
368 else if (!mapper.
direct())
377 this->transfer(newMapF);
408 map(tmapF(), mapper, applyFlip);
442 this->map(fCpy, mapper);
449 this->transfer(fCpy);
487 label mapI = mapAddressing[i];
504 rmap(tmapF(), mapAddressing);
523 f[mapAddressing[i]] += mapF[i]*mapWeights[i];
536 rmap(tmapF(), mapAddressing, mapWeights);
598 template<
class VSForm>
602 for (
direction i=0; i<VSForm::nComponents; i++)
604 vs[i] = this->operator[](start + i);
632 os <<
word(
"uniform") << token::SPACE << this->first();
636 os <<
word(
"nonuniform") << token::SPACE;
640 os << token::END_STATEMENT <<
nl;
661 if (
this == &(rhs()))
671 template<
class Form,
class Cmpt, Foam::direction nCmpt>
678 #define COMPUTED_ASSIGNMENT(TYPE, op) \
680 template<class Type> \
681 void Foam::Field<Type>::operator op(const UList<TYPE>& f) \
683 TFOR_ALL_F_OP_F(Type, *this, op, TYPE, f) \
686 template<class Type> \
687 void Foam::Field<Type>::operator op(const tmp<Field<TYPE>>& tf) \
693 template<class Type> \
694 void Foam::Field<Type>::operator op(const TYPE& t) \
696 TFOR_ALL_F_OP_S(Type, *this, op, TYPE, t) \
704 #undef COMPUTED_ASSIGNMENT
712 os << static_cast<const List<Type>&>(
f);
points setSize(newPointi)
void component(FieldField< Field, typename FieldField< Field, Type >::cmptType > &sf, const FieldField< Field, Type > &f, const direction d)
A class for handling words, derived from Foam::string.
A class for managing temporary objects.
void autoMap(const FieldMapper &map, const bool applyFlip=true)
Map from self.
static constexpr const zero Zero
Global zero (0)
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.
High performance macro functions for Field<Type> algebra. These expand using either array element acc...
virtual label size() const =0
virtual const scalarListList & weights() const
#define TFOR_ALL_F_OP_FUNC_S_S(typeF1, f1, OP, FUNC, typeS1, s1, typeS2, s2)
Abstract base class to hold the Field mapping addressing and weights.
Ostream & endl(Ostream &os)
Add newline and flush stream.
A token holds an item read from Istream.
virtual bool direct() const =0
constexpr Field() noexcept
Construct null.
#define TFOR_ALL_F_OP_S(typeF, f, OP, typeS, s)
#define forAll(list, i)
Loop across all elements in list.
void map(const UList< Type > &mapF, const labelUList &mapAddressing)
1 to 1 map from the given field
Ostream & operator<<(Ostream &, const boundaryPatch &p)
Write boundaryPatch as dictionary entries (without surrounding braces)
pTraits< Foam::Vector2D >::cmptType cmptType
Component type.
Generic templated field type.
InfoProxy< token > info() const
Return info proxy for printing token information to a stream.
An input stream of tokens.
tmp< Field< Type > > T() const
Return the field transpose (only defined for second rank tensors)
void replace(const direction, const UList< cmptType > &)
Replace a component field of the field.
bool notNull(const T *ptr)
True if ptr is not a pointer (of type T) to the nullObject.
void rmap(const UList< Type > &mapF, const labelUList &mapAddressing)
1 to 1 reverse-map from the given field
A list of keyword definitions, which are a keyword followed by a number of values (eg,...
void negate()
Negate this field (negative).
bool isWord() const
Token is WORD or DIRECTIVE word.
virtual const labelUList & directAddressing() const
virtual Ostream & writeKeyword(const keyType &kw)
Write the keyword followed by an appropriate indentation.
errorManip< error > abort(error &err)
tmp< Field< cmptType > > component(const direction) const
Return a component field of the field.
const word & wordToken() const
Return const reference to the word contents.
void operator=(const Field< Type > &)
Copy assignment.
errorManipArg< error, int > exit(error &err, const int errNo=1)
void writeEntry(const word &keyword, Ostream &os) const
Write the field as a dictionary entry.
tmp< DimensionedField< TypeR, GeoMesh > > New(const tmp< DimensionedField< TypeR, GeoMesh >> &tdf1, const word &name, const dimensionSet &dimensions)
Global function forwards to reuseTmpDimensionedField::New.
#define FatalErrorInFunction
Report an error message using Foam::FatalError.
virtual const labelListList & addressing() const
#define TFOR_ALL_F_OP_FUNC_S_F(typeF1, f1, OP, FUNC, typeS, s, typeF2, f2)
VSForm block(const label start) const
const dimensionedScalar c
Speed of light in a vacuum.
Class containing processor-to-processor mapping information.
void size(const label n) noexcept
Override size to be inconsistent with allocated storage.
bool isNull(const T *ptr)
True if ptr is a pointer (of type T) to the nullObject.
#define FatalIOErrorInFunction(ios)
Report an error message using Foam::FatalIOError.
An Ostream is an abstract base class for all output systems (streams, files, token lists,...
#define IOWarningInFunction(ios)
Report an IO warning using Foam::Warning.
#define TFOR_ALL_F_OP_OP_F(typeF1, f1, OP1, OP2, typeF2, f2)
virtual const mapDistributeBase & distributeMap() const
virtual bool distributed() const
#define COMPUTED_ASSIGNMENT(TYPE, op)
A template class to specify that a data type can be considered as being contiguous in memory.
Pass through value. Should never be specialized.