38template<
template<
class>
class Field,
class Type1,
class Type2>
46 if (f1.size() != f2.size())
50 <<
"> f1(" << f1.size() <<
')'
52 <<
"> f2(" << f2.size() <<
')'
53 <<
endl <<
" for operation " << op
58template<
template<
class>
class Field,
class Type1,
class Type2,
class Type3>
67 if (f1.size() != f2.size() || f1.size() != f3.size())
71 <<
"> f1(" << f1.size() <<
')'
73 <<
"> f2(" << f2.size() <<
')'
75 <<
"> f3("<<f3.size() <<
')'
76 <<
endl <<
" for operation " << op
83template<
template<
class>
class Field,
class Type1,
class Type2>
92template<
template<
class>
class Field,
class Type1,
class Type2,
class Type3>
107template<
template<
class>
class Field,
class Type>
114template<
template<
class>
class Field,
class Type>
121template<
template<
class>
class Field,
class Type>
137template<
template<
class>
class Field,
class Type>
144template<
template<
class>
class Field,
class Type>
151template<
template<
class>
class Field,
class Type>
158template<
template<
class>
class Field,
class Type>
165template<
template<
class>
class Field,
class Type>
172template<
template<
class>
class Field,
class Type>
181template<
template<
class>
class Field,
class Type>
188template<
template<
class>
class Field,
class Type>
195template<
template<
class>
class Field,
class Type>
202 const label len = ff.size();
205 auto& result = tresult.ref();
207 for (label i=0; i<len; ++i)
218template<
template<
class>
class Field,
class Type>
228template<
template<
class>
class Field,
class Type>
238template<
template<
class>
class Field,
class Type>
257template<
template<
class>
class Field,
class Type>
271template<
template<
class>
class Field,
class Type>
285template<
template<
class>
class Field,
class Type>
291 for (
auto& ff : *
this)
298template<
template<
class>
class Field,
class Type>
304 for (
auto& ff : *
this)
311template<
template<
class>
class Field,
class Type>
314 const FieldField<Field, Type>& lower
317 const label loopLen = this->size();
319 for (label i = 0; i < loopLen; ++i)
321 (*this)[i].clamp_min(lower[i]);
326template<
template<
class>
class Field,
class Type>
329 const FieldField<Field, Type>& upper
332 const label loopLen = this->size();
334 for (label i = 0; i < loopLen; ++i)
336 (*this)[i].clamp_max(upper[i]);
341template<
template<
class>
class Field,
class Type>
350 for (
auto& ff : *
this)
352 ff.clamp_range(lower, upper);
357template<
template<
class>
class Field,
class Type>
360 const MinMax<Type>&
range
365 for (
auto& ff : *
this)
372template<
template<
class>
class Field,
class Type>
387template<
template<
class>
class Field,
class Type>
394template<
template<
class>
class Field,
class Type>
401template<
template<
class>
class Field,
class Type>
418template<
template<
class>
class Field,
class Type>
430template<
template<
class>
class Field,
class Type>
434 if (
this == &(tf.cref()))
444 auto* tptr = tf.ptr();
450template<
template<
class>
class Field,
class Type>
453 for (
auto& pfld : *
this)
460template<
template<
class>
class Field,
class Type>
463 for (
auto& pfld : *
this)
470#define COMPUTED_ASSIGNMENT(TYPE, op) \
472template<template<class> class Field, class Type> \
473void FieldField<Field, Type>::operator op(const FieldField<Field, TYPE>& f) \
477 this->operator[](i) op f[i]; \
481template<template<class> class Field, class Type> \
482void FieldField<Field, Type>::operator op \
484 const tmp<FieldField<Field, TYPE>>& tf \
491template<template<class> class Field, class Type> \
492void FieldField<Field, Type>::operator op(const TYPE& val) \
494 for (auto& pfld : *this) \
505#undef COMPUTED_ASSIGNMENT
510template<
template<
class>
class Field,
class Type>
518template<
template<
class>
class Field,
class Type>
519Ostream&
operator<<(Ostream&
os,
const tmp<FieldField<Field, Type>>& tf)
#define COMPUTED_ASSIGNMENT(TYPE, op)
A field of fields is a PtrList of fields with reference counting.
tmp< FieldField< Field, Type > > T() const
Return the field transpose (only defined for second rank tensors).
constexpr FieldField() noexcept
Construct null.
void clamp_range(const Type &lower, const Type &upper)
Clamp field values (in-place) to the specified range.
tmp< FieldField< Field, Type > > clone() const
Clone.
static tmp< FieldField< Field, Type > > NewCalculatedType(const FieldField< Field, Type2 > &ff)
Return a pointer to a new calculatedFvPatchFieldField created on.
const Type & operator[](const labelPair &index) const
Const access to a single field element via (fieldi, elemi).
void clamp_min(const Type &lower)
Impose lower (floor) clamp on the field values (in-place).
void replace(const direction, const FieldField< Field, cmptType > &)
Replace a component field of the field.
pTraits< Type >::cmptType cmptType
Component type.
void operator=(const FieldField< Field, Type > &)
Copy assignment.
void negate()
Negate this field. See notes in Field.
void clamp_max(const Type &upper)
Impose upper (ceiling) clamp on the field values (in-place).
void normalise()
Normalise this field. See notes in Field.
tmp< FieldField< Field, cmptType > > component(const direction) const
Return a component field of the field.
Generic templated field type that is much like a Foam::List except that it is expected to hold numeri...
static tmp< Field< Type > > NewCalculatedType(const Field< Type2 > &f)
Return a pointer to a new calculatedFvPatchFieldField created on freestore without setting patchField...
static autoPtr< Field< Type > > New(Istream &is)
Return a pointer to a new Field created on freestore.
An Istream is an abstract base class for all input systems (streams, files, token lists etc)....
void clear()
Clear the list, i.e. set size to zero.
A min/max value pair with additional methods. In addition to conveniently storing values,...
An Ostream is an abstract base class for all output systems (streams, files, token lists,...
const T & first() const noexcept
Access the first element.
const T & second() const noexcept
Access the second element.
A list of pointers to objects of type <T>, with allocation/deallocation management of the pointers....
void transfer(PtrList< Field< Type > > &list)
const Field< Type > * set(const label i) const
constexpr PtrList() noexcept
label size() const noexcept
A traits class, which is primarily used for primitives and vector-space.
A class for managing temporary objects.
const T & cref() const
Return const reference to the object or to the contents of a (non-null) managed pointer.
void clear() const noexcept
If object pointer points to valid object: delete object and set pointer to nullptr.
T * ptr() const
Return managed pointer for reuse, or clone() the object reference.
A class for handling words, derived from Foam::string.
A class representing the concept of 0 (zero) that can be used to avoid manipulating objects known to ...
#define FatalErrorInFunction
Report an error message using Foam::FatalError.
OBJstream os(runTime.globalPath()/outputName)
gmvFile<< "tracers "<< particles.size()<< nl;for(const passiveParticle &p :particles){ gmvFile<< p.position().x()<< " ";}gmvFile<< nl;for(const passiveParticle &p :particles){ gmvFile<< p.position().y()<< " ";}gmvFile<< nl;for(const passiveParticle &p :particles){ gmvFile<< p.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))
Pair< label > labelPair
A pair of labels.
tmp< DimensionedField< TypeR, GeoMesh > > New(const tmp< DimensionedField< TypeR, GeoMesh > > &tf1, const word &name, const dimensionSet &dimensions, const bool initCopy=false)
Global function forwards to reuseTmpDimensionedField::New.
void checkFields(const FieldField< Field, Type1 > &, const FieldField< Field, Type2 > &, const char *op)
void component(FieldField< Field, typename FieldField< Field, Type >::cmptType > &sf, const FieldField< Field, Type > &f, const direction d)
Ostream & operator<<(Ostream &, const boundaryPatch &p)
Write boundaryPatch as dictionary entries (without surrounding braces).
Ostream & endl(Ostream &os)
Add newline and flush stream.
errorManip< error > abort(error &err)
error FatalError
Error stream (stdout output on all processes), with additional 'FOAM FATAL ERROR' header text and sta...
void T(FieldField< Field, Type > &f1, const FieldField< Field, Type > &f2)
#define forAll(list, i)
Loop across all elements in list.