38 template<
template<
class>
class Field,
class Type1,
class Type2>
41 const FieldField<Field, Type1>& f1,
42 const FieldField<Field, Type2>& f2,
46 if (f1.size() != f2.size())
49 <<
" FieldField<" << pTraits<Type1>::typeName
50 <<
"> f1(" << f1.size() <<
')' 51 <<
" and FieldField<" << pTraits<Type2>::typeName
52 <<
"> f2(" << f2.size() <<
')' 53 <<
endl <<
" for operation " << op
58 template<
template<
class>
class Field,
class Type1,
class Type2,
class Type3>
61 const FieldField<Field, Type1>& f1,
62 const FieldField<Field, Type2>& f2,
63 const FieldField<Field, Type3>& f3,
67 if (f1.size() != f2.size() || f1.size() != f3.size())
70 <<
" FieldField<" << pTraits<Type1>::typeName
71 <<
"> f1(" << f1.size() <<
')' 72 <<
", FieldField<" <<pTraits<Type2>::typeName
73 <<
"> f2(" << f2.size() <<
')' 74 <<
" and FieldField<"<<pTraits<Type3>::typeName
75 <<
"> f3("<<f3.size() <<
')' 76 <<
endl <<
" for operation " << op
83 template<
template<
class>
class Field,
class Type1,
class Type2>
86 const FieldField<Field, Type1>&,
92 template<
template<
class>
class Field,
class Type1,
class Type2,
class Type3>
95 const FieldField<Field, Type1>&,
96 const FieldField<Field, Type2>&,
97 const FieldField<Field, Type3>&,
107 template<
template<
class>
class Field,
class Type>
114 template<
template<
class>
class Field,
class Type>
121 template<
template<
class>
class Field,
class Type>
137 template<
template<
class>
class Field,
class Type>
144 template<
template<
class>
class Field,
class Type>
151 template<
template<
class>
class Field,
class Type>
158 template<
template<
class>
class Field,
class Type>
165 template<
template<
class>
class Field,
class Type>
172 template<
template<
class>
class Field,
class Type>
181 template<
template<
class>
class Field,
class Type>
188 template<
template<
class>
class Field,
class Type>
195 template<
template<
class>
class Field,
class Type>
196 template<
class Type2>
202 const label len =
ff.size();
205 auto& result = tresult.ref();
207 for (label i=0; i<len; ++i)
218 template<
template<
class>
class Field,
class Type>
223 this->operator[](i).negate();
228 template<
template<
class>
class Field,
class Type>
229 void FieldField<Field, Type>::normalise()
233 this->operator[](i).normalise();
238 template<
template<
class>
class Field,
class Type>
239 tmp<FieldField<Field, typename FieldField<Field, Type>::cmptType>>
248 Field,
typename FieldField<Field, Type>::cmptType
249 >::NewCalculatedType(*
this);
257 template<
template<
class>
class Field,
class Type>
266 this->operator[](i).replace(d, sf[i]);
271 template<
template<
class>
class Field,
class Type>
272 void FieldField<Field, Type>::replace
280 this->operator[](i).replace(d,
s);
285 template<
template<
class>
class Field,
class Type>
291 for (
auto&
ff : *
this)
298 template<
template<
class>
class Field,
class Type>
299 void FieldField<Field, Type>::clamp_max
304 for (
auto&
ff : *
this)
311 template<
template<
class>
class Field,
class Type>
312 void FieldField<Field, Type>::clamp_range
320 for (
auto&
ff : *
this)
327 template<
template<
class>
class Field,
class Type>
328 void FieldField<Field, Type>::clamp_range
330 const MinMax<Type>&
range 335 for (
auto&
ff : *
this)
342 template<
template<
class>
class Field,
class Type>
347 FieldField<Field, Type>::NewCalculatedType(*
this)
357 template<
template<
class>
class Field,
class Type>
360 return this->operator[](index.
first())[index.
second()];
364 template<
template<
class>
class Field,
class Type>
367 return this->operator[](index.
first())[index.
second()];
371 template<
template<
class>
class Field,
class Type>
383 this->operator[](i) =
ff[i];
388 template<
template<
class>
class Field,
class Type>
389 void FieldField<Field, Type>::operator=(FieldField<Field, Type>&&
ff)
396 PtrList<Field<Type>>::transfer(
ff);
400 template<
template<
class>
class Field,
class Type>
401 void FieldField<Field, Type>::operator=(
const tmp<FieldField>& tf)
404 if (
this == &(tf.cref()))
414 auto* tptr = tf.ptr();
420 template<
template<
class>
class Field,
class Type>
425 this->operator[](i) = val;
430 template<
template<
class>
class Field,
class Type>
431 void FieldField<Field, Type>::operator=(
const Foam::zero)
440 #define COMPUTED_ASSIGNMENT(TYPE, op) \ 442 template<template<class> class Field, class Type> \ 443 void FieldField<Field, Type>::operator op(const FieldField<Field, TYPE>& f) \ 447 this->operator[](i) op f[i]; \ 451 template<template<class> class Field, class Type> \ 452 void FieldField<Field, Type>::operator op \ 454 const tmp<FieldField<Field, TYPE>>& tf \ 461 template<template<class> class Field, class Type> \ 462 void FieldField<Field, Type>::operator op(const TYPE& t) \ 466 this->operator[](i) op t; \ 475 #undef COMPUTED_ASSIGNMENT 480 template<
template<
class>
class Field,
class Type>
481 Ostream& operator<<(Ostream& os, const FieldField<Field, Type>&
f)
483 os << static_cast<const PtrList<Field<Type>>&>(
f);
488 template<
template<
class>
class Field,
class Type>
489 Ostream& operator<<(Ostream& os, const tmp<FieldField<Field, Type>>& tf)
const T & first() const noexcept
Access the first element.
error FatalError
Error stream (stdout output on all processes), with additional 'FOAM FATAL ERROR' header text and sta...
#define COMPUTED_ASSIGNMENT(TYPE, op)
#define FatalErrorInFunction
Report an error message using Foam::FatalError.
Y [inertIndex] clamp_min(0)
An Istream is an abstract base class for all input systems (streams, files, token lists etc)...
Ostream & endl(Ostream &os)
Add newline and flush stream.
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.
string upper(const std::string &s)
Return string copy transformed with std::toupper on each character.
A field of fields is a PtrList of fields with reference counting.
#define forAll(list, i)
Loop across all elements in list.
fileName::Type type(const fileName &name, const bool followLink=true)
Return the file type: DIRECTORY or FILE, normally following symbolic links.
Generic templated field type.
void checkFields(const FieldField< Field, Type1 > &, const FieldField< Field, Type2 > &, const char *op)
A class for handling words, derived from Foam::string.
void negate(DimensionedField< Type, GeoMesh > &result, const DimensionedField< Type, GeoMesh > &f1)
errorManip< error > abort(error &err)
An Ostream is an abstract base class for all output systems (streams, files, token lists...
OBJstream os(runTime.globalPath()/outputName)
string lower(const std::string &s)
Return string copy transformed with std::tolower on each character.
A list of pointers to objects of type <T>, with allocation/deallocation management of the pointers...
constexpr FieldField() noexcept
Construct null.
A class representing the concept of 0 (zero) that can be used to avoid manipulating objects known to ...
void clear() const noexcept
If object pointer points to valid object: delete object and set pointer to nullptr.
A class for managing temporary objects.
const T & second() const noexcept
Access the second element.
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))
void component(FieldField< Field, typename FieldField< Field, Type >::cmptType > &sf, const FieldField< Field, Type > &f, const direction d)
const FieldField< fvPatchField, Type > & ff(const FieldField< fvPatchField, Type > &bf)