FieldFieldFunctions.C
Go to the documentation of this file.
1 /*---------------------------------------------------------------------------*\
2  ========= |
3  \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
4  \\ / O peration |
5  \\ / A nd | Copyright (C) 2011-2015 OpenFOAM Foundation
6  \\/ M anipulation |
7 -------------------------------------------------------------------------------
8 License
9  This file is part of OpenFOAM.
10 
11  OpenFOAM is free software: you can redistribute it and/or modify it
12  under the terms of the GNU General Public License as published by
13  the Free Software Foundation, either version 3 of the License, or
14  (at your option) any later version.
15 
16  OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
17  ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
18  FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
19  for more details.
20 
21  You should have received a copy of the GNU General Public License
22  along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
23 
24 \*---------------------------------------------------------------------------*/
25 
26 #include "PstreamReduceOps.H"
28 
29 #define TEMPLATE template<template<class> class Field, class Type>
30 #include "FieldFieldFunctionsM.C"
31 
32 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
33 
34 namespace Foam
35 {
36 
37 /* * * * * * * * * * * * * * * * Global functions * * * * * * * * * * * * * */
38 
39 template<template<class> class Field, class Type>
40 void component
41 (
43  const FieldField<Field, Type>& f,
44  const direction d
45 )
46 {
47  forAll(sf, i)
48  {
49  component(sf[i], f[i], d);
50  }
51 }
52 
53 
54 template<template<class> class Field, class Type>
56 {
57  forAll(f1, i)
58  {
59  T(f1[i], f2[i]);
60  }
61 }
62 
63 
64 template<template<class> class Field, class Type, int r>
65 void pow
66 (
68  const FieldField<Field, Type>& vf
69 )
70 {
71  forAll(f, i)
72  {
73  pow(f[i], vf[i]);
74  }
75 }
76 
77 template<template<class> class Field, class Type, int r>
79 pow
80 (
82 )
83 {
84  typedef typename powProduct<Type, r>::type powProductType;
86  (
88  );
89  pow<Type, r>(tRes(), f);
90  return tRes;
91 }
92 
93 template<template<class> class Field, class Type, int r>
95 pow
96 (
98 )
99 {
100  typedef typename powProduct<Type, r>::type powProductType;
102  (
104  );
105  pow<Type, r>(tRes(), tf());
107  return tRes;
108 }
109 
110 
111 template<template<class> class Field, class Type>
112 void sqr
113 (
115  const FieldField<Field, Type>& vf
116 )
117 {
118  forAll(f, i)
119  {
120  sqr(f[i], vf[i]);
121  }
122 }
123 
124 template<template<class> class Field, class Type>
127 {
128  typedef typename outerProduct<Type, Type>::type outerProductType;
130  (
132  );
133  sqr(tRes(), f);
134  return tRes;
135 }
136 
137 template<template<class> class Field, class Type>
140 {
141  typedef typename outerProduct<Type, Type>::type outerProductType;
143  (
145  );
146  sqr(tRes(), tf());
148  return tRes;
149 }
150 
151 
152 template<template<class> class Field, class Type>
154 {
155  forAll(sf, i)
156  {
157  magSqr(sf[i], f[i]);
158  }
159 }
160 
161 template<template<class> class Field, class Type>
163 {
165  (
167  );
168 
169  magSqr(tRes(), f);
170  return tRes;
171 }
172 
173 template<template<class> class Field, class Type>
175 {
177  (
179  );
180 
181  magSqr(tRes(), tf());
183  return tRes;
184 }
185 
186 
187 template<template<class> class Field, class Type>
189 {
190  forAll(sf, i)
191  {
192  mag(sf[i], f[i]);
193  }
194 }
195 
196 template<template<class> class Field, class Type>
198 {
200  (
202  );
203 
204  mag(tRes(), f);
205  return tRes;
206 }
207 
208 template<template<class> class Field, class Type>
210 {
212  (
214  );
215 
216  mag(tRes(), tf());
218  return tRes;
219 }
220 
221 
222 template<template<class> class Field, class Type>
223 void cmptMax
224 (
226  const FieldField<Field, Type>& f
227 )
228 {
229  forAll(cf, i)
230  {
231  cmptMax(cf[i], f[i]);
232  }
233 }
234 
235 template<template<class> class Field, class Type>
237 (
238  const FieldField<Field, Type>& f
239 )
240 {
241  typedef typename FieldField<Field, Type>::cmptType cmptType;
243  (
245  );
246  cmptMax(tRes(), f);
247  return tRes;
248 }
249 
250 template<template<class> class Field, class Type>
252 (
254 )
255 {
256  typedef typename FieldField<Field, Type>::cmptType cmptType;
258  (
260  );
261  cmptMax(tRes(), tf());
263  return tRes;
264 }
265 
266 
267 template<template<class> class Field, class Type>
268 void cmptMin
269 (
271  const FieldField<Field, Type>& f
272 )
273 {
274  forAll(cf, i)
275  {
276  cmptMin(cf[i], f[i]);
277  }
278 }
279 
280 template<template<class> class Field, class Type>
282 (
283  const FieldField<Field, Type>& f
284 )
285 {
286  typedef typename FieldField<Field, Type>::cmptType cmptType;
288  (
290  );
291  cmptMin(tRes(), f);
292  return tRes;
293 }
294 
295 template<template<class> class Field, class Type>
297 (
299 )
300 {
301  typedef typename FieldField<Field, Type>::cmptType cmptType;
303  (
305  );
306  cmptMin(tRes(), tf());
308  return tRes;
309 }
310 
311 
312 template<template<class> class Field, class Type>
313 void cmptAv
314 (
316  const FieldField<Field, Type>& f
317 )
318 {
319  forAll(cf, i)
320  {
321  cmptAv(cf[i], f[i]);
322  }
323 }
324 
325 template<template<class> class Field, class Type>
327 (
328  const FieldField<Field, Type>& f
329 )
330 {
331  typedef typename FieldField<Field, Type>::cmptType cmptType;
333  (
335  );
336  cmptAv(tRes(), f);
337  return tRes;
338 }
339 
340 template<template<class> class Field, class Type>
342 (
344 )
345 {
346  typedef typename FieldField<Field, Type>::cmptType cmptType;
348  (
350  );
351  cmptAv(tRes(), tf());
353  return tRes;
354 }
355 
356 
357 template<template<class> class Field, class Type>
358 void cmptMag
359 (
361  const FieldField<Field, Type>& f
362 )
363 {
364  forAll(cf, i)
365  {
366  cmptMag(cf[i], f[i]);
367  }
368 }
369 
370 template<template<class> class Field, class Type>
372 (
373  const FieldField<Field, Type>& f
374 )
375 {
377  (
379  );
380  cmptMag(tRes(), f);
381  return tRes;
382 }
383 
384 template<template<class> class Field, class Type>
386 (
388 )
389 {
391  (
393  );
394  cmptMag(tRes(), tf());
396  return tRes;
397 }
398 
399 
400 #define TMP_UNARY_FUNCTION(returnType, func) \
401  \
402 template<template<class> class Field, class Type> \
403 returnType func(const tmp<FieldField<Field, Type> >& tf1) \
404 { \
405  returnType res = func(tf1()); \
406  tf1.clear(); \
407  return res; \
408 }
409 
410 template<template<class> class Field, class Type>
412 {
413  label i = 0;
414  while (i < f.size() && !f[i].size()) i++;
415 
416  if (i < f.size())
417  {
418  Type Max(max(f[i]));
419 
420  for (label j=i+1; j<f.size(); j++)
421  {
422  if (f[j].size())
423  {
424  Max = max(max(f[j]), Max);
425  }
426  }
427 
428  return Max;
429  }
430  else
431  {
432  return pTraits<Type>::min;
433  }
434 }
435 
437 
438 template<template<class> class Field, class Type>
439 Type min(const FieldField<Field, Type>& f)
440 {
441  label i = 0;
442  while (i < f.size() && !f[i].size()) i++;
443 
444  if (i < f.size())
445  {
446  label i = 0;
447  while (!f[i].size()) i++;
448 
449  Type Min(min(f[i]));
450 
451  for (label j=i+1; j<f.size(); j++)
452  {
453  if (f[j].size())
454  {
455  Min = min(min(f[j]), Min);
456  }
457  }
458 
459  return Min;
460  }
461  else
462  {
463  return pTraits<Type>::max;
464  }
465 }
466 
468 
469 template<template<class> class Field, class Type>
470 Type sum(const FieldField<Field, Type>& f)
471 {
472  if (f.size())
473  {
474  Type Sum = pTraits<Type>::zero;
475 
476  forAll(f, i)
477  {
478  Sum += sum(f[i]);
479  }
480 
481  return Sum;
482  }
483  else
484  {
485  return pTraits<Type>::zero;
486  }
487 }
488 
490 
491 template<template<class> class Field, class Type>
492 scalar sumMag(const FieldField<Field, Type>& f)
493 {
494  if (f.size())
495  {
496  scalar SumMag = 0.0;
497 
498  forAll(f, i)
499  {
500  SumMag += sumMag(f[i]);
501  }
502 
503  return SumMag;
504  }
505  else
506  {
507  return 0.0;
508  }
509 }
510 
511 TMP_UNARY_FUNCTION(scalar, sumMag)
512 
513 template<template<class> class Field, class Type>
514 Type average(const FieldField<Field, Type>& f)
515 {
516  if (f.size())
517  {
518  label n = 0;
519 
520  forAll(f, i)
521  {
522  n += f[i].size();
523  }
524 
525  if (n == 0)
526  {
527  WarningIn("average(const FieldField<Field, Type>&) const")
528  << "empty fieldField, returning zero" << endl;
529 
530  return pTraits<Type>::zero;
531  }
532 
533  Type avrg = sum(f)/n;
534 
535  return avrg;
536  }
537  else
538  {
539  WarningIn("average(const FieldField<Field, Type>&) const")
540  << "empty fieldField, returning zero" << endl;
541 
542  return pTraits<Type>::zero;
543  }
544 }
545 
547 
548 
549 #include "PstreamReduceOps.H"
550 
551 #define G_UNARY_FUNCTION(returnType, gFunc, func, rFunc) \
552  \
553 template<template<class> class Field, class Type> \
554 returnType gFunc(const FieldField<Field, Type>& f) \
555 { \
556  returnType res = func(f); \
557  reduce(res, rFunc##Op<Type>()); \
558  return res; \
559 } \
560 TMP_UNARY_FUNCTION(returnType, gFunc)
561 
563 G_UNARY_FUNCTION(Type, gMin, min, min)
564 G_UNARY_FUNCTION(Type, gSum, sum, sum)
565 G_UNARY_FUNCTION(scalar, gSumMag, sumMag, sum)
566 
567 #undef G_UNARY_FUNCTION
568 
569 
570 template<template<class> class Field, class Type>
572 {
573  label n = 0;
574 
575  forAll(f, i)
576  {
577  n += f[i].size();
578  }
579 
580  reduce(n, sumOp<label>());
581 
582  if (n > 0)
583  {
584  Type avrg = gSum(f)/n;
585 
586  return avrg;
587  }
588  else
589  {
590  WarningIn("gAverage(const FieldField<Field, Type>&) const")
591  << "empty fieldField, returning zero" << endl;
592 
593  return pTraits<Type>::zero;
594  }
595 }
596 
598 
599 #undef TMP_UNARY_FUNCTION
600 
601 
602 BINARY_FUNCTION(Type, Type, Type, max)
603 BINARY_FUNCTION(Type, Type, Type, min)
604 BINARY_FUNCTION(Type, Type, Type, cmptMultiply)
605 BINARY_FUNCTION(Type, Type, Type, cmptDivide)
606 
607 BINARY_TYPE_FUNCTION(Type, Type, Type, max)
608 BINARY_TYPE_FUNCTION(Type, Type, Type, min)
609 BINARY_TYPE_FUNCTION(Type, Type, Type, cmptMultiply)
610 BINARY_TYPE_FUNCTION(Type, Type, Type, cmptDivide)
611 
612 
613 /* * * * * * * * * * * * * * * * Global operators * * * * * * * * * * * * * */
614 
615 UNARY_OPERATOR(Type, Type, -, negate)
616 
617 BINARY_OPERATOR(Type, Type, scalar, *, multiply)
618 BINARY_OPERATOR(Type, scalar, Type, *, multiply)
619 BINARY_OPERATOR(Type, Type, scalar, /, divide)
620 
621 BINARY_TYPE_OPERATOR_SF(Type, scalar, Type, *, multiply)
622 BINARY_TYPE_OPERATOR_FS(Type, Type, scalar, *, multiply)
623 
624 BINARY_TYPE_OPERATOR_FS(Type, Type, scalar, /, divide)
625 
626 
627 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
628 
629 #define PRODUCT_OPERATOR(product, op, opFunc) \
630  \
631 template \
632 < \
633  template<class> class Field1, \
634  template<class> class Field2, \
635  class Type1, \
636  class Type2 \
637 > \
638 void opFunc \
639 ( \
640  FieldField<Field1, typename product<Type1, Type2>::type>& f, \
641  const FieldField<Field1, Type1>& f1, \
642  const FieldField<Field2, Type2>& f2 \
643 ) \
644 { \
645  forAll(f, i) \
646  { \
647  opFunc(f[i], f1[i], f2[i]); \
648  } \
649 } \
650  \
651 template \
652 < \
653  template<class> class Field1, \
654  template<class> class Field2, \
655  class Type1, \
656  class Type2 \
657 > \
658 tmp<FieldField<Field1, typename product<Type1, Type2>::type> > \
659 operator op \
660 ( \
661  const FieldField<Field1, Type1>& f1, \
662  const FieldField<Field2, Type2>& f2 \
663 ) \
664 { \
665  typedef typename product<Type1, Type2>::type productType; \
666  tmp<FieldField<Field1, productType> > tRes \
667  ( \
668  FieldField<Field1, productType>::NewCalculatedType(f1) \
669  ); \
670  opFunc(tRes(), f1, f2); \
671  return tRes; \
672 } \
673  \
674 template<template<class> class Field, class Type1, class Type2> \
675 tmp<FieldField<Field, typename product<Type1, Type2>::type> > \
676 operator op \
677 ( \
678  const FieldField<Field, Type1>& f1, \
679  const tmp<FieldField<Field, Type2> >& tf2 \
680 ) \
681 { \
682  typedef typename product<Type1, Type2>::type productType; \
683  tmp<FieldField<Field, productType> > tRes \
684  ( \
685  reuseTmpFieldField<Field, productType, Type2>::New(tf2) \
686  ); \
687  opFunc(tRes(), f1, tf2()); \
688  reuseTmpFieldField<Field, productType, Type2>::clear(tf2); \
689  return tRes; \
690 } \
691  \
692 template \
693 < \
694  template<class> class Field1, \
695  template<class> class Field2, \
696  class Type1, \
697  class Type2 \
698 > \
699 tmp<FieldField<Field, typename product<Type1, Type2>::type> > \
700 operator op \
701 ( \
702  const FieldField<Field1, Type1>& f1, \
703  const tmp<FieldField<Field2, Type2> >& tf2 \
704 ) \
705 { \
706  typedef typename product<Type1, Type2>::type productType; \
707  tmp<FieldField<Field1, productType> > tRes \
708  ( \
709  FieldField<Field1, productType>::NewCalculatedType(f1) \
710  ); \
711  opFunc(tRes(), f1, tf2()); \
712  tf2.clear(); \
713  return tRes; \
714 } \
715  \
716 template \
717 < \
718  template<class> class Field1, \
719  template<class> class Field2, \
720  class Type1, \
721  class Type2 \
722 > \
723 tmp<FieldField<Field1, typename product<Type1, Type2>::type> > \
724 operator op \
725 ( \
726  const tmp<FieldField<Field1, Type1> >& tf1, \
727  const FieldField<Field2, Type2>& f2 \
728 ) \
729 { \
730  typedef typename product<Type1, Type2>::type productType; \
731  tmp<FieldField<Field1, productType> > tRes \
732  ( \
733  reuseTmpFieldField<Field1, productType, Type1>::New(tf1) \
734  ); \
735  opFunc(tRes(), tf1(), f2); \
736  reuseTmpFieldField<Field1, productType, Type1>::clear(tf1); \
737  return tRes; \
738 } \
739  \
740 template \
741 < \
742  template<class> class Field1, \
743  template<class> class Field2, \
744  class Type1, \
745  class Type2 \
746 > \
747 tmp<FieldField<Field1, typename product<Type1, Type2>::type> > \
748 operator op \
749 ( \
750  const tmp<FieldField<Field1, Type1> >& tf1, \
751  const tmp<FieldField<Field2, Type2> >& tf2 \
752 ) \
753 { \
754  typedef typename product<Type1, Type2>::type productType; \
755  tmp<FieldField<Field1, productType> > tRes \
756  ( \
757  reuseTmpTmpFieldField<Field1, productType, Type1, Type1, Type2>::New \
758  (tf1, tf2) \
759  ); \
760  opFunc(tRes(), tf1(), tf2()); \
761  reuseTmpTmpFieldField<Field1, productType, Type1, Type1, Type2>::clear \
762  (tf1, tf2); \
763  return tRes; \
764 } \
765  \
766 template \
767 <template<class> class Field, class Type, class Form, class Cmpt, int nCmpt> \
768 void opFunc \
769 ( \
770  FieldField<Field, typename product<Type, Form>::type>& f, \
771  const FieldField<Field, Type>& f1, \
772  const VectorSpace<Form,Cmpt,nCmpt>& vs \
773 ) \
774 { \
775  forAll(f, i) \
776  { \
777  opFunc(f[i], f1[i], vs); \
778  } \
779 } \
780  \
781 template \
782 <template<class> class Field, class Type, class Form, class Cmpt, int nCmpt> \
783 tmp<FieldField<Field, typename product<Type, Form>::type> > \
784 operator op \
785 ( \
786  const FieldField<Field, Type>& f1, \
787  const VectorSpace<Form,Cmpt,nCmpt>& vs \
788 ) \
789 { \
790  typedef typename product<Type, Form>::type productType; \
791  tmp<FieldField<Field, productType> > tRes \
792  ( \
793  FieldField<Field, productType>::NewCalculatedType(f1) \
794  ); \
795  opFunc(tRes(), f1, static_cast<const Form&>(vs)); \
796  return tRes; \
797 } \
798  \
799 template \
800 <template<class> class Field, class Type, class Form, class Cmpt, int nCmpt> \
801 tmp<FieldField<Field, typename product<Type, Form>::type> > \
802 operator op \
803 ( \
804  const tmp<FieldField<Field, Type> >& tf1, \
805  const VectorSpace<Form,Cmpt,nCmpt>& vs \
806 ) \
807 { \
808  typedef typename product<Type, Form>::type productType; \
809  tmp<FieldField<Field, productType> > tRes \
810  ( \
811  reuseTmpFieldField<Field, productType, Type>::New(tf1) \
812  ); \
813  opFunc(tRes(), tf1(), static_cast<const Form&>(vs)); \
814  reuseTmpFieldField<Field, productType, Type>::clear(tf1); \
815  return tRes; \
816 } \
817  \
818 template \
819 <template<class> class Field, class Form, class Cmpt, int nCmpt, class Type> \
820 void opFunc \
821 ( \
822  FieldField<Field, typename product<Form, Type>::type>& f, \
823  const VectorSpace<Form,Cmpt,nCmpt>& vs, \
824  const FieldField<Field, Type>& f1 \
825 ) \
826 { \
827  forAll(f, i) \
828  { \
829  opFunc(f[i], vs, f1[i]); \
830  } \
831 } \
832  \
833 template \
834 <template<class> class Field, class Form, class Cmpt, int nCmpt, class Type> \
835 tmp<FieldField<Field, typename product<Form, Type>::type> > \
836 operator op \
837 ( \
838  const VectorSpace<Form,Cmpt,nCmpt>& vs, \
839  const FieldField<Field, Type>& f1 \
840 ) \
841 { \
842  typedef typename product<Form, Type>::type productType; \
843  tmp<FieldField<Field, productType> > tRes \
844  ( \
845  FieldField<Field, productType>::NewCalculatedType(f1) \
846  ); \
847  opFunc(tRes(), static_cast<const Form&>(vs), f1); \
848  return tRes; \
849 } \
850  \
851 template \
852 <template<class> class Field, class Form, class Cmpt, int nCmpt, class Type> \
853 tmp<FieldField<Field, typename product<Form, Type>::type> > \
854 operator op \
855 ( \
856  const VectorSpace<Form,Cmpt,nCmpt>& vs, \
857  const tmp<FieldField<Field, Type> >& tf1 \
858 ) \
859 { \
860  typedef typename product<Form, Type>::type productType; \
861  tmp<FieldField<Field, productType> > tRes \
862  ( \
863  reuseTmpFieldField<Field, productType, Type>::New(tf1) \
864  ); \
865  opFunc(tRes(), static_cast<const Form&>(vs), tf1()); \
866  reuseTmpFieldField<Field, productType, Type>::clear(tf1); \
867  return tRes; \
868 }
869 
872 
877 
878 #undef PRODUCT_OPERATOR
879 
880 
881 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
882 
883 } // End namespace Foam
884 
885 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
886 
887 #include "undefFieldFunctionsM.H"
888 
889 // ************************************************************************* //
void reduce(const List< UPstream::commsStruct > &comms, T &Value, const BinaryOp &bop, const int tag, const label comm)
void outer(FieldField< Field1, typename outerProduct< Type1, Type2 >::type > &f, const FieldField< Field1, Type1 > &f1, const FieldField< Field2, Type2 > &f2)
dimensioned< Type > average(const DimensionedField< Type, GeoMesh > &df)
#define BINARY_TYPE_OPERATOR_SF(ReturnType, Type1, Type2, Op, OpName, OpFunc)
unsigned char direction
Definition: direction.H:43
#define BINARY_TYPE_OPERATOR_FS(ReturnType, Type1, Type2, Op, OpName, OpFunc)
label size() const
Return the number of elements in the PtrList.
Generic field type.
Definition: FieldField.H:51
dimensionedScalar pow(const dimensionedScalar &ds, const dimensionedScalar &expt)
#define TMP_UNARY_FUNCTION(returnType, func)
#define PRODUCT_OPERATOR(product, op, opFunc)
dimensioned< scalar > mag(const dimensioned< Type > &)
labelList f(nPoints)
#define BINARY_TYPE_FUNCTION(ReturnType, Type1, Type2, Func)
void T(FieldField< Field, Type > &f1, const FieldField< Field, Type > &f2)
void negate(FieldField< Field, Type > &res, const FieldField< Field, Type > &f)
dimensioned< scalar > magSqr(const dimensioned< Type > &)
scalar f1
Definition: createFields.H:28
void cmptMax(FieldField< Field, typename FieldField< Field, Type >::cmptType > &cf, const FieldField< Field, Type > &f)
intWM_LABEL_SIZE_t label
A label is an int32_t or int64_t as specified by the pre-processor macro WM_LABEL_SIZE.
Definition: label.H:59
#define UNARY_OPERATOR(ReturnType, Type1, Op, OpFunc, Dfunc)
dimensioned< scalar > sumMag(const DimensionedField< Type, GeoMesh > &df)
void cmptMin(FieldField< Field, typename FieldField< Field, Type >::cmptType > &cf, const FieldField< Field, Type > &f)
volScalarField sf(fieldObject, mesh)
Namespace for OpenFOAM.
#define G_UNARY_FUNCTION(returnType, gFunc, func, rFunc)
Type gSum(const FieldField< Field, Type > &f)
typeOfRank< typename pTraits< arg1 >::cmptType, int(pTraits< arg1 >::rank)+int(pTraits< arg2 >::rank) >::type type
Definition: products.H:72
label n
void dot(FieldField< Field1, typename innerProduct< Type1, Type2 >::type > &f, const FieldField< Field1, Type1 > &f1, const FieldField< Field2, Type2 > &f2)
Ostream & endl(Ostream &os)
Add newline and flush stream.
Definition: Ostream.H:251
#define WarningIn(functionName)
Report a warning using Foam::Warning.
dimensioned< Type > cmptDivide(const dimensioned< Type > &, const dimensioned< Type > &)
void component(FieldField< Field, typename FieldField< Field, Type >::cmptType > &sf, const FieldField< Field, Type > &f, const direction d)
static void clear(const tmp< FieldField< Field, Type1 > > &tf1)
dimensioned< Type > max(const dimensioned< Type > &, const dimensioned< Type > &)
pTraits< Type >::cmptType cmptType
Component type.
Definition: FieldField.H:82
#define forAll(list, i)
Definition: UList.H:421
dimensioned< Type > sum(const DimensionedField< Type, GeoMesh > &df)
Pre-declare SubField and related Field type.
Definition: Field.H:57
const tensorField & tf
void multiply(FieldField< Field, Type > &f, const FieldField< Field, Type > &f1, const FieldField< Field, scalar > &f2)
Traits class for primitives.
Definition: pTraits.H:50
dimensioned< Type > cmptMultiply(const dimensioned< Type > &, const dimensioned< Type > &)
Type gAverage(const FieldField< Field, Type > &f)
#define BINARY_FUNCTION(ReturnType, Type1, Type2, Func)
void cmptMag(FieldField< Field, Type > &cf, const FieldField< Field, Type > &f)
#define BINARY_OPERATOR(ReturnType, Type1, Type2, Op, OpName, OpFunc)
void subtract(FieldField< Field1, typename typeOfSum< Type1, Type2 >::type > &f, const FieldField< Field1, Type1 > &f1, const FieldField< Field2, Type2 > &f2)
void dotdot(FieldField< Field1, typename scalarProduct< Type1, Type2 >::type > &f, const FieldField< Field1, Type1 > &f1, const FieldField< Field2, Type2 > &f2)
tmp< DimensionedField< typename DimensionedField< Type, GeoMesh >::cmptType, GeoMesh >> cmptAv(const DimensionedField< Type, GeoMesh > &df)
dimensionedSymmTensor sqr(const dimensionedVector &dv)
dimensioned< Type > min(const dimensioned< Type > &, const dimensioned< Type > &)
void cross(FieldField< Field1, typename crossProduct< Type1, Type2 >::type > &f, const FieldField< Field1, Type1 > &f1, const FieldField< Field2, Type2 > &f2)
Type gMax(const FieldField< Field, Type > &f)
void add(FieldField< Field1, typename typeOfSum< Type1, Type2 >::type > &f, const FieldField< Field1, Type1 > &f1, const FieldField< Field2, Type2 > &f2)
A class for managing temporary objects.
Definition: PtrList.H:118
symmTypeOfRank< typename pTraits< arg1 >::cmptType, arg2 *int(pTraits< arg1 >::rank) >::type type
Definition: products.H:118
void divide(FieldField< Field, Type > &f, const FieldField< Field, Type > &f1, const FieldField< Field, scalar > &f2)