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) 2004-2010, 2019 OpenCFD Ltd.
6  \\/ M anipulation |
7 -------------------------------------------------------------------------------
8  | Copyright (C) 2011-2016 OpenFOAM Foundation
9 -------------------------------------------------------------------------------
10 License
11  This file is part of OpenFOAM.
12 
13  OpenFOAM is free software: you can redistribute it and/or modify it
14  under the terms of the GNU General Public License as published by
15  the Free Software Foundation, either version 3 of the License, or
16  (at your option) any later version.
17 
18  OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
19  ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
20  FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
21  for more details.
22 
23  You should have received a copy of the GNU General Public License
24  along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
25 
26 \*---------------------------------------------------------------------------*/
27 
28 #include "PstreamReduceOps.H"
30 
31 #define TEMPLATE template<template<class> class Field, class Type>
32 #include "FieldFieldFunctionsM.C"
33 
34 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
35 
36 namespace Foam
37 {
38 
39 /* * * * * * * * * * * * * * * * Global functions * * * * * * * * * * * * * */
40 
41 template<template<class> class Field, class Type>
42 void component
43 (
46  const direction d
47 )
48 {
49  forAll(sf, i)
50  {
51  component(sf[i], f[i], d);
52  }
53 }
54 
55 
56 template<template<class> class Field, class Type>
58 {
59  forAll(f1, i)
60  {
61  T(f1[i], f2[i]);
62  }
63 }
64 
65 
66 template<template<class> class Field, class Type, direction r>
67 void pow
68 (
70  const FieldField<Field, Type>& vf
71 )
72 {
73  forAll(f, i)
74  {
75  pow(f[i], vf[i]);
76  }
77 }
78 
79 template<template<class> class Field, class Type, direction r>
81 pow
82 (
84 )
85 {
86  typedef typename powProduct<Type, r>::type powProductType;
87 
88  auto tres
89  (
91  );
92 
93  pow<Type, r>(tres.ref(), f);
94  return tres;
95 }
96 
97 template<template<class> class Field, class Type, direction r>
99 pow
100 (
102 )
103 {
104  typedef typename powProduct<Type, r>::type powProductType;
105 
106  auto tres
107  (
109  );
110 
111  pow<Type, r>(tres.ref(), tf());
112  tf.clear();
113  return tres;
114 }
115 
116 
117 template<template<class> class Field, class Type>
118 void sqr
119 (
121  const FieldField<Field, Type>& vf
122 )
123 {
124  forAll(f, i)
125  {
126  sqr(f[i], vf[i]);
127  }
128 }
129 
130 template<template<class> class Field, class Type>
133 {
134  typedef typename outerProduct<Type, Type>::type outerProductType;
136  (
138  );
139  sqr(tres.ref(), f);
140  return tres;
141 }
142 
143 template<template<class> class Field, class Type>
146 {
147  typedef typename outerProduct<Type, Type>::type outerProductType;
148 
149  auto tres
150  (
152  );
153 
154  sqr(tres.ref(), tf());
155  tf.clear();
156  return tres;
157 }
158 
159 
160 template<template<class> class Field, class Type>
161 void magSqr
162 (
163  FieldField<Field, typename typeOfMag<Type>::type>& sf,
165 )
166 {
167  forAll(sf, i)
168  {
169  magSqr(sf[i], f[i]);
170  }
171 }
172 
173 template<template<class> class Field, class Type>
176 {
177  typedef typename typeOfMag<Type>::type magType;
178 
179  auto tres
180  (
182  );
183 
184  magSqr(tres.ref(), f);
185  return tres;
186 }
187 
188 template<template<class> class Field, class Type>
191 {
192  typedef typename typeOfMag<Type>::type magType;
193 
194  auto tres
195  (
197  );
198 
199  magSqr(tres.ref(), tf());
200  tf.clear();
201  return tres;
202 }
203 
204 
205 template<template<class> class Field, class Type>
206 void mag
207 (
208  FieldField<Field, typename typeOfMag<Type>::type>& sf,
210 )
211 {
212  forAll(sf, i)
213  {
214  mag(sf[i], f[i]);
215  }
216 }
217 
218 template<template<class> class Field, class Type>
221 {
222  typedef typename typeOfMag<Type>::type magType;
223 
224  auto tres
225  (
227  );
228 
229  mag(tres.ref(), f);
230  return tres;
231 }
232 
233 template<template<class> class Field, class Type>
236 {
237  typedef typename typeOfMag<Type>::type magType;
238 
239  auto tres
240  (
242  );
243 
244  mag(tres.ref(), tf());
245  tf.clear();
246  return tres;
247 }
248 
249 
250 template<template<class> class Field, class Type>
251 void cmptMax
252 (
255 )
256 {
257  forAll(cf, i)
258  {
259  cmptMax(cf[i], f[i]);
260  }
261 }
262 
263 template<template<class> class Field, class Type>
264 tmp<FieldField<Field, typename FieldField<Field, Type>::cmptType>> cmptMax
265 (
267 )
268 {
269  typedef typename FieldField<Field, Type>::cmptType cmptType;
270 
271  auto tres
272  (
274  );
275 
276  cmptMax(tres.ref(), f);
277  return tres;
278 }
279 
280 template<template<class> class Field, class Type>
281 tmp<FieldField<Field, typename FieldField<Field, Type>::cmptType>> cmptMax
282 (
283  const tmp<FieldField<Field, Type>>& tf
284 )
285 {
286  typedef typename FieldField<Field, Type>::cmptType cmptType;
287 
288  auto tres
289  (
291  );
292 
293  cmptMax(tres.ref(), tf());
294  tf.clear();
295  return tres;
296 }
297 
298 
299 template<template<class> class Field, class Type>
300 void cmptMin
301 (
304 )
305 {
306  forAll(cf, i)
307  {
308  cmptMin(cf[i], f[i]);
309  }
310 }
311 
312 template<template<class> class Field, class Type>
313 tmp<FieldField<Field, typename FieldField<Field, Type>::cmptType>> cmptMin
314 (
316 )
317 {
318  typedef typename FieldField<Field, Type>::cmptType cmptType;
319 
320  auto tres
321  (
323  );
324 
325  cmptMin(tres.ref(), f);
326  return tres;
327 }
328 
329 template<template<class> class Field, class Type>
330 tmp<FieldField<Field, typename FieldField<Field, Type>::cmptType>> cmptMin
331 (
332  const tmp<FieldField<Field, Type>>& tf
333 )
334 {
335  typedef typename FieldField<Field, Type>::cmptType cmptType;
336 
337  auto tres
338  (
340  );
341 
342  cmptMin(tres.ref(), tf());
343  tf.clear();
344  return tres;
345 }
346 
347 
348 template<template<class> class Field, class Type>
349 void cmptAv
350 (
353 )
354 {
355  forAll(cf, i)
356  {
357  cmptAv(cf[i], f[i]);
358  }
359 }
360 
361 template<template<class> class Field, class Type>
362 tmp<FieldField<Field, typename FieldField<Field, Type>::cmptType>> cmptAv
363 (
365 )
366 {
367  typedef typename FieldField<Field, Type>::cmptType cmptType;
368 
369  auto tres
370  (
372  );
373 
374  cmptAv(tres.ref(), f);
375  return tres;
376 }
377 
378 template<template<class> class Field, class Type>
379 tmp<FieldField<Field, typename FieldField<Field, Type>::cmptType>> cmptAv
380 (
381  const tmp<FieldField<Field, Type>>& tf
382 )
383 {
384  typedef typename FieldField<Field, Type>::cmptType cmptType;
385 
386  auto tres
387  (
389  );
390 
391  cmptAv(tres.ref(), tf());
392  tf.clear();
393  return tres;
394 }
395 
396 
397 template<template<class> class Field, class Type>
398 void cmptMag
399 (
402 )
403 {
404  forAll(cf, i)
405  {
406  cmptMag(cf[i], f[i]);
407  }
408 }
409 
410 template<template<class> class Field, class Type>
411 tmp<FieldField<Field, Type>> cmptMag
412 (
414 )
415 {
416  auto tres
417  (
419  );
420 
421  cmptMag(tres.ref(), f);
422  return tres;
423 }
424 
425 template<template<class> class Field, class Type>
426 tmp<FieldField<Field, Type>> cmptMag
427 (
428  const tmp<FieldField<Field, Type>>& tf
429 )
430 {
431  tmp<FieldField<Field, Type>> tres(New(tf));
432  cmptMag(tres.ref(), tf());
433  tf.clear();
434  return tres;
435 }
436 
437 
438 #define TMP_UNARY_FUNCTION(returnType, func) \
439  \
440 template<template<class> class Field, class Type> \
441 returnType func(const tmp<FieldField<Field, Type>>& tf1) \
442 { \
443  returnType res = func(tf1()); \
444  tf1.clear(); \
445  return res; \
446 }
447 
448 template<template<class> class Field, class Type>
450 {
451  Type result = pTraits<Type>::min;
452 
453  forAll(f, i)
454  {
455  if (f[i].size())
456  {
457  result = max(max(f[i]), result);
458  }
459 
460  }
461 
462  return result;
463 }
464 
466 
467 
468 template<template<class> class Field, class Type>
470 {
471  Type result = pTraits<Type>::max;
472 
473  forAll(f, i)
474  {
475  if (f[i].size())
476  {
477  result = min(min(f[i]), result);
478  }
479  }
480 
481  return result;
482 }
483 
485 
486 
487 template<template<class> class Field, class Type>
489 {
490  Type Sum = Zero;
491 
492  forAll(f, i)
493  {
494  Sum += sum(f[i]);
495  }
496 
497  return Sum;
498 }
499 
501 
502 template<template<class> class Field, class Type>
504 {
505  typedef typename typeOfMag<Type>::type magType;
506 
507  magType result = Zero;
508 
509  forAll(f, i)
510  {
511  result += sumMag(f[i]);
512  }
513 
514  return result;
515 }
516 
518 
519 template<template<class> class Field, class Type>
521 {
522  if (f.size())
523  {
524  label n = 0;
525 
526  forAll(f, i)
527  {
528  n += f[i].size();
529  }
530 
531  if (n)
532  {
533  Type avrg = sum(f)/n;
534 
535  return avrg;
536  }
537  }
538 
540  << "empty fieldField, returning zero" << endl;
541 
542  return Zero;
543 }
544 
546 
547 
548 template<template<class> class Field, class Type>
550 {
551  MinMax<Type> result;
552 
553  forAll(f, i)
554  {
555  result += minMax(f[i]);
556  }
557 
558  return result;
559 }
560 
562 
563 template<template<class> class Field, class Type>
565 {
566  scalarMinMax result;
567 
568  forAll(f, i)
569  {
570  result += minMaxMag(f[i]);
571  }
572 
573  return result;
574 }
575 
577 
578 
579 // With reduction on ReturnType
580 #define G_UNARY_FUNCTION(ReturnType, gFunc, func, rFunc) \
581  \
582 template<template<class> class Field, class Type> \
583 ReturnType gFunc(const FieldField<Field, Type>& f) \
584 { \
585  ReturnType res = func(f); \
586  reduce(res, rFunc##Op<ReturnType>()); \
587  return res; \
588 } \
589 TMP_UNARY_FUNCTION(ReturnType, gFunc)
590 
596 
598 
599 #undef G_UNARY_FUNCTION
600 
601 
602 template<template<class> class Field, class Type>
604 {
605  label n = 0;
606 
607  forAll(f, i)
608  {
609  n += f[i].size();
610  }
611 
612  reduce(n, sumOp<label>());
613 
614  if (n)
615  {
616  Type avrg = gSum(f)/n;
617 
618  return avrg;
619  }
620 
622  << "empty fieldField, returning zero" << endl;
623 
624  return Zero;
625 }
626 
628 
629 #undef TMP_UNARY_FUNCTION
630 
631 
632 BINARY_FUNCTION(Type, Type, Type, max)
633 BINARY_FUNCTION(Type, Type, Type, min)
634 BINARY_FUNCTION(Type, Type, Type, cmptMultiply)
635 BINARY_FUNCTION(Type, Type, Type, cmptDivide)
636 
637 BINARY_TYPE_FUNCTION(Type, Type, Type, max)
638 BINARY_TYPE_FUNCTION(Type, Type, Type, min)
639 BINARY_TYPE_FUNCTION(Type, Type, Type, cmptMultiply)
640 BINARY_TYPE_FUNCTION(Type, Type, Type, cmptDivide)
641 
643 
644 
645 /* * * * * * * * * * * * * * * * Global operators * * * * * * * * * * * * * */
646 
647 UNARY_OPERATOR(Type, Type, -, negate)
648 
649 BINARY_OPERATOR(Type, Type, scalar, *, multiply)
650 BINARY_OPERATOR(Type, scalar, Type, *, multiply)
651 BINARY_OPERATOR(Type, Type, scalar, /, divide)
652 
653 BINARY_TYPE_OPERATOR_SF(Type, scalar, Type, *, multiply)
654 BINARY_TYPE_OPERATOR_FS(Type, Type, scalar, *, multiply)
655 
656 BINARY_TYPE_OPERATOR_FS(Type, Type, scalar, /, divide)
657 
658 
659 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
660 
661 #define PRODUCT_OPERATOR(product, op, opFunc) \
662  \
663 template \
664 < \
665  template<class> class Field1, \
666  template<class> class Field2, \
667  class Type1, \
668  class Type2 \
669 > \
670 void opFunc \
671 ( \
672  FieldField<Field1, typename product<Type1, Type2>::type>& f, \
673  const FieldField<Field1, Type1>& f1, \
674  const FieldField<Field2, Type2>& f2 \
675 ) \
676 { \
677  forAll(f, i) \
678  { \
679  opFunc(f[i], f1[i], f2[i]); \
680  } \
681 } \
682  \
683 template \
684 < \
685  template<class> class Field1, \
686  template<class> class Field2, \
687  class Type1, \
688  class Type2 \
689 > \
690 tmp<FieldField<Field1, typename product<Type1, Type2>::type>> \
691 operator op \
692 ( \
693  const FieldField<Field1, Type1>& f1, \
694  const FieldField<Field2, Type2>& f2 \
695 ) \
696 { \
697  typedef typename product<Type1, Type2>::type productType; \
698  tmp<FieldField<Field1, productType>> tres \
699  ( \
700  FieldField<Field1, productType>::NewCalculatedType(f1) \
701  ); \
702  opFunc(tres.ref(), f1, f2); \
703  return tres; \
704 } \
705  \
706 template<template<class> class Field, class Type1, class Type2> \
707 tmp<FieldField<Field, typename product<Type1, Type2>::type>> \
708 operator op \
709 ( \
710  const FieldField<Field, Type1>& f1, \
711  const tmp<FieldField<Field, Type2>>& tf2 \
712 ) \
713 { \
714  typedef typename product<Type1, Type2>::type productType; \
715  tmp<FieldField<Field, productType>> tres \
716  ( \
717  reuseTmpFieldField<Field, productType, Type2>::New(tf2) \
718  ); \
719  opFunc(tres.ref(), f1, tf2()); \
720  tf2.clear(); \
721  return tres; \
722 } \
723  \
724 template \
725 < \
726  template<class> class Field1, \
727  template<class> class Field2, \
728  class Type1, \
729  class Type2 \
730 > \
731 tmp<FieldField<Field, typename product<Type1, Type2>::type>> \
732 operator op \
733 ( \
734  const FieldField<Field1, Type1>& f1, \
735  const tmp<FieldField<Field2, Type2>>& tf2 \
736 ) \
737 { \
738  typedef typename product<Type1, Type2>::type productType; \
739  tmp<FieldField<Field1, productType>> tres \
740  ( \
741  FieldField<Field1, productType>::NewCalculatedType(f1) \
742  ); \
743  opFunc(tres.ref(), f1, tf2()); \
744  tf2.clear(); \
745  return tres; \
746 } \
747  \
748 template \
749 < \
750  template<class> class Field1, \
751  template<class> class Field2, \
752  class Type1, \
753  class Type2 \
754 > \
755 tmp<FieldField<Field1, typename product<Type1, Type2>::type>> \
756 operator op \
757 ( \
758  const tmp<FieldField<Field1, Type1>>& tf1, \
759  const FieldField<Field2, Type2>& f2 \
760 ) \
761 { \
762  typedef typename product<Type1, Type2>::type productType; \
763  tmp<FieldField<Field1, productType>> tres \
764  ( \
765  reuseTmpFieldField<Field1, productType, Type1>::New(tf1) \
766  ); \
767  opFunc(tres.ref(), tf1(), f2); \
768  tf1.clear(); \
769  return tres; \
770 } \
771  \
772 template \
773 < \
774  template<class> class Field1, \
775  template<class> class Field2, \
776  class Type1, \
777  class Type2 \
778 > \
779 tmp<FieldField<Field1, typename product<Type1, Type2>::type>> \
780 operator op \
781 ( \
782  const tmp<FieldField<Field1, Type1>>& tf1, \
783  const tmp<FieldField<Field2, Type2>>& tf2 \
784 ) \
785 { \
786  typedef typename product<Type1, Type2>::type productType; \
787  tmp<FieldField<Field1, productType>> tres \
788  ( \
789  reuseTmpTmpFieldField<Field1, productType, Type1, Type1, Type2>::New \
790  (tf1, tf2) \
791  ); \
792  opFunc(tres.ref(), tf1(), tf2()); \
793  tf1.clear(); \
794  tf2.clear(); \
795  return tres; \
796 } \
797  \
798 template \
799 < \
800  template<class> class Field, \
801  class Type, \
802  class Form, \
803  class Cmpt, \
804  direction nCmpt \
805 > \
806 void opFunc \
807 ( \
808  FieldField<Field, typename product<Type, Form>::type>& f, \
809  const FieldField<Field, Type>& f1, \
810  const VectorSpace<Form,Cmpt,nCmpt>& vs \
811 ) \
812 { \
813  forAll(f, i) \
814  { \
815  opFunc(f[i], f1[i], vs); \
816  } \
817 } \
818  \
819 template \
820 < \
821  template<class> class Field, \
822  class Type, \
823  class Form, \
824  class Cmpt, \
825  direction nCmpt \
826 > \
827 tmp<FieldField<Field, typename product<Type, Form>::type>> \
828 operator op \
829 ( \
830  const FieldField<Field, Type>& f1, \
831  const VectorSpace<Form,Cmpt,nCmpt>& vs \
832 ) \
833 { \
834  typedef typename product<Type, Form>::type productType; \
835  tmp<FieldField<Field, productType>> tres \
836  ( \
837  FieldField<Field, productType>::NewCalculatedType(f1) \
838  ); \
839  opFunc(tres.ref(), f1, static_cast<const Form&>(vs)); \
840  return tres; \
841 } \
842  \
843 template \
844 < \
845  template<class> class Field, \
846  class Type, \
847  class Form, \
848  class Cmpt, \
849  direction nCmpt \
850 > \
851 tmp<FieldField<Field, typename product<Type, Form>::type>> \
852 operator op \
853 ( \
854  const tmp<FieldField<Field, Type>>& tf1, \
855  const VectorSpace<Form,Cmpt,nCmpt>& vs \
856 ) \
857 { \
858  typedef typename product<Type, Form>::type productType; \
859  tmp<FieldField<Field, productType>> tres \
860  ( \
861  reuseTmpFieldField<Field, productType, Type>::New(tf1) \
862  ); \
863  opFunc(tres.ref(), tf1(), static_cast<const Form&>(vs)); \
864  tf1.clear(); \
865  return tres; \
866 } \
867  \
868 template \
869 < \
870  template<class> class Field, \
871  class Type, \
872  class Form, \
873  class Cmpt, \
874  direction nCmpt \
875 > \
876 void opFunc \
877 ( \
878  FieldField<Field, typename product<Form, Type>::type>& f, \
879  const VectorSpace<Form,Cmpt,nCmpt>& vs, \
880  const FieldField<Field, Type>& f1 \
881 ) \
882 { \
883  forAll(f, i) \
884  { \
885  opFunc(f[i], vs, f1[i]); \
886  } \
887 } \
888  \
889 template \
890 < \
891  template<class> class Field, \
892  class Type, \
893  class Form, \
894  class Cmpt, \
895  direction nCmpt \
896 > \
897 tmp<FieldField<Field, typename product<Form, Type>::type>> \
898 operator op \
899 ( \
900  const VectorSpace<Form,Cmpt,nCmpt>& vs, \
901  const FieldField<Field, Type>& f1 \
902 ) \
903 { \
904  typedef typename product<Form, Type>::type productType; \
905  tmp<FieldField<Field, productType>> tres \
906  ( \
907  FieldField<Field, productType>::NewCalculatedType(f1) \
908  ); \
909  opFunc(tres.ref(), static_cast<const Form&>(vs), f1); \
910  return tres; \
911 } \
912  \
913 template \
914 < \
915  template<class> class Field, \
916  class Type, \
917  class Form, \
918  class Cmpt, \
919  direction nCmpt \
920 > \
921 tmp<FieldField<Field, typename product<Form, Type>::type>> \
922 operator op \
923 ( \
924  const VectorSpace<Form,Cmpt,nCmpt>& vs, \
925  const tmp<FieldField<Field, Type>>& tf1 \
926 ) \
927 { \
928  typedef typename product<Form, Type>::type productType; \
929  tmp<FieldField<Field, productType>> tres \
930  ( \
931  reuseTmpFieldField<Field, productType, Type>::New(tf1) \
932  ); \
933  opFunc(tres.ref(), static_cast<const Form&>(vs), tf1()); \
934  tf1.clear(); \
935  return tres; \
936 }
937 
940 
945 
946 #undef PRODUCT_OPERATOR
947 
948 
949 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
950 
951 } // End namespace Foam
952 
953 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
954 
955 #include "undefFieldFunctionsM.H"
956 
957 // ************************************************************************* //
BINARY_TYPE_OPERATOR_SF
#define BINARY_TYPE_OPERATOR_SF(ReturnType, Type1, Type2, Op, OpName, OpFunc)
Definition: DimensionedFieldFunctionsM.C:521
BINARY_OPERATOR
#define BINARY_OPERATOR(ReturnType, Type1, Type2, Op, OpName, OpFunc)
Definition: DimensionedFieldFunctionsM.C:411
Foam::subtract
void subtract(FieldField< Field1, typename typeOfSum< Type1, Type2 >::type > &f, const FieldField< Field1, Type1 > &f1, const FieldField< Field2, Type2 > &f2)
Definition: FieldFieldFunctions.C:939
Foam::gSumMag
typeOfMag< Type >::type gSumMag(const FieldField< Field, Type > &f)
Definition: FieldFieldFunctions.C:597
Foam::component
void component(FieldField< Field, typename FieldField< Field, Type >::cmptType > &sf, const FieldField< Field, Type > &f, const direction d)
Definition: FieldFieldFunctions.C:43
Foam::FieldField
A field of fields is a PtrList of fields with reference counting.
Definition: FieldField.H:53
Foam::cmptMultiply
dimensioned< Type > cmptMultiply(const dimensioned< Type > &, const dimensioned< Type > &)
Foam::tmp
A class for managing temporary objects.
Definition: PtrList.H:58
Foam::Zero
static constexpr const zero Zero
Definition: zero.H:124
Foam::gAverage
Type gAverage(const FieldField< Field, Type > &f)
Definition: FieldFieldFunctions.C:603
Foam::innerProduct
Definition: products.H:129
Foam::outerProduct::type
typeOfRank< typename pTraits< arg1 >::cmptType, direction(pTraits< arg1 >::rank)+direction(pTraits< arg2 >::rank) >::type type
Definition: products.H:102
Foam::minMax
dimensioned< MinMax< Type > > minMax(const DimensionedField< Type, GeoMesh > &df)
Definition: DimensionedFieldFunctions.C:328
Foam::dot
void dot(FieldField< Field1, typename innerProduct< Type1, Type2 >::type > &f, const FieldField< Field1, Type1 > &f1, const FieldField< Field2, Type2 > &f2)
Definition: FieldFieldFunctions.C:943
Foam::crossProduct
Definition: products.H:117
G_UNARY_FUNCTION
#define G_UNARY_FUNCTION(ReturnType, gFunc, func, rFunc)
Definition: FieldFieldFunctions.C:580
undefFieldFunctionsM.H
Foam::sumMag
dimensioned< typename typeOfMag< Type >::type > sumMag(const DimensionedField< Type, GeoMesh > &df)
Definition: DimensionedFieldFunctions.C:331
Foam::powProduct::type
symmTypeOfRank< typename pTraits< arg1 >::cmptType, arg2 *direction(pTraits< arg1 >::rank) >::type type
Definition: products.H:158
Foam::gMinMaxMag
scalarMinMax gMinMaxMag(const FieldField< Field, Type > &f)
Definition: FieldFieldFunctions.C:595
Foam::endl
Ostream & endl(Ostream &os)
Add newline and flush stream.
Definition: Ostream.H:325
Foam::gSum
Type gSum(const FieldField< Field, Type > &f)
Definition: FieldFieldFunctions.C:593
BINARY_FUNCTION
#define BINARY_FUNCTION(ReturnType, Type1, Type2, Func)
Definition: DimensionedFieldFunctionsM.C:140
Foam::sumOp
Definition: ops.H:210
forAll
#define forAll(list, i)
Loop across all elements in list.
Definition: stdFoam.H:302
Foam::magSqr
dimensioned< typename typeOfMag< Type >::type > magSqr(const dimensioned< Type > &dt)
Foam::divide
void divide(FieldField< Field, Type > &f, const FieldField< Field, Type > &f1, const FieldField< Field, scalar > &f2)
Foam::cmptMin
void cmptMin(FieldField< Field, typename FieldField< Field, Type >::cmptType > &cf, const FieldField< Field, Type > &f)
Definition: FieldFieldFunctions.C:301
Foam::cmptMag
void cmptMag(FieldField< Field, Type > &cf, const FieldField< Field, Type > &f)
Definition: FieldFieldFunctions.C:399
Foam::cmptMax
void cmptMax(FieldField< Field, typename FieldField< Field, Type >::cmptType > &cf, const FieldField< Field, Type > &f)
Definition: FieldFieldFunctions.C:252
n
label n
Definition: TABSMDCalcMethod2.H:31
BINARY_TYPE_FUNCTION_FS
#define BINARY_TYPE_FUNCTION_FS(ReturnType, Type1, Type2, Func)
Definition: DimensionedFieldFunctionsM.C:328
Foam::reduce
void reduce(const List< UPstream::commsStruct > &comms, T &Value, const BinaryOp &bop, const int tag, const label comm)
Definition: PstreamReduceOps.H:50
Foam::scalarProduct
Definition: products.H:141
Foam::tmp::ref
T & ref() const
Definition: tmpI.H:257
Foam::typeOfSum
Definition: products.H:85
Foam::label
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:61
TMP_UNARY_FUNCTION
#define TMP_UNARY_FUNCTION(returnType, func)
Definition: FieldFieldFunctions.C:438
Foam::Field
Generic templated field type.
Definition: Field.H:62
Foam::T
void T(FieldField< Field, Type > &f1, const FieldField< Field, Type > &f2)
Definition: FieldFieldFunctions.C:57
Foam::cmptAv
tmp< DimensionedField< typename DimensionedField< Type, GeoMesh >::cmptType, GeoMesh >> cmptAv(const DimensionedField< Type, GeoMesh > &df)
Definition: DimensionedFieldFunctions.C:245
Foam::pow
dimensionedScalar pow(const dimensionedScalar &ds, const dimensionedScalar &expt)
Definition: dimensionedScalar.C:74
FieldFieldFunctionsM.C
Foam::typeOfMag
The magnitude type for given argument.
Definition: products.H:76
Foam::negate
void negate(FieldField< Field, Type > &res, const FieldField< Field, Type > &f)
Foam::minMaxMag
dimensioned< scalarMinMax > minMaxMag(const DimensionedField< Type, GeoMesh > &df)
Definition: DimensionedFieldFunctions.C:329
Foam::add
void add(FieldField< Field1, typename typeOfSum< Type1, Type2 >::type > &f, const FieldField< Field1, Type1 > &f1, const FieldField< Field2, Type2 > &f2)
Definition: FieldFieldFunctions.C:938
Foam
Namespace for OpenFOAM.
Definition: atmBoundaryLayer.C:32
FieldFieldReuseFunctions.H
BINARY_TYPE_FUNCTION
#define BINARY_TYPE_FUNCTION(ReturnType, Type1, Type2, Func)
Definition: DimensionedFieldFunctionsM.C:404
PstreamReduceOps.H
Inter-processor communication reduction functions.
Foam::New
tmp< DimensionedField< TypeR, GeoMesh > > New(const tmp< DimensionedField< TypeR, GeoMesh >> &tdf1, const word &name, const dimensionSet &dimensions)
Global function forwards to reuseTmpDimensionedField::New.
Definition: DimensionedFieldReuseFunctions.H:104
Foam::max
dimensioned< Type > max(const dimensioned< Type > &, const dimensioned< Type > &)
Foam::cmptDivide
dimensioned< Type > cmptDivide(const dimensioned< Type > &, const dimensioned< Type > &)
Foam::FieldField::cmptType
pTraits< Type >::cmptType cmptType
Component type.
Definition: FieldField.H:84
Foam::sqr
dimensionedSymmTensor sqr(const dimensionedVector &dv)
Definition: dimensionedSymmTensor.C:51
Foam::clip
dimensionSet clip(const dimensionSet &ds1, const dimensionSet &ds2)
Definition: dimensionSet.C:269
Foam::reuseTmpFieldField
Definition: FieldFieldReuseFunctions.H:39
UNARY_OPERATOR
#define UNARY_OPERATOR(ReturnType, Type1, Op, OpFunc, Dfunc)
Definition: DimensionedFieldFunctionsM.C:86
f
labelList f(nPoints)
Foam::pTraits
Traits class for primitives.
Definition: pTraits.H:52
Foam::mag
dimensioned< typename typeOfMag< Type >::type > mag(const dimensioned< Type > &dt)
Foam::type
fileName::Type type(const fileName &name, const bool followLink=true)
Return the file type: DIRECTORY or FILE, normally following symbolic links.
Definition: MSwindows.C:570
PRODUCT_OPERATOR
#define PRODUCT_OPERATOR(product, op, opFunc)
Definition: FieldFieldFunctions.C:661
Foam::outer
void outer(FieldField< Field1, typename outerProduct< Type1, Type2 >::type > &f, const FieldField< Field1, Type1 > &f1, const FieldField< Field2, Type2 > &f2)
Definition: FieldFieldFunctions.C:941
Foam::sum
dimensioned< Type > sum(const DimensionedField< Type, GeoMesh > &df)
Definition: DimensionedFieldFunctions.C:326
Foam::direction
uint8_t direction
Definition: direction.H:47
Foam::roots::type
type
Types of root.
Definition: Roots.H:54
Foam::gMin
Type gMin(const FieldField< Field, Type > &f)
Definition: FieldFieldFunctions.C:592
BINARY_TYPE_OPERATOR_FS
#define BINARY_TYPE_OPERATOR_FS(ReturnType, Type1, Type2, Op, OpName, OpFunc)
Definition: DimensionedFieldFunctionsM.C:598
Foam::multiply
void multiply(FieldField< Field, Type > &f, const FieldField< Field, Type > &f1, const FieldField< Field, scalar > &f2)
Foam::cross
void cross(FieldField< Field1, typename crossProduct< Type1, Type2 >::type > &f, const FieldField< Field1, Type1 > &f1, const FieldField< Field2, Type2 > &f2)
Definition: FieldFieldFunctions.C:942
Foam::min
dimensioned< Type > min(const dimensioned< Type > &, const dimensioned< Type > &)
WarningInFunction
#define WarningInFunction
Report a warning using Foam::Warning.
Definition: messageStream.H:289
Foam::typeOfMag::type
pTraits< typename pTraits< arg1 >::cmptType >::magType type
Definition: products.H:80
Foam::MinMax
A min/max value pair with additional methods. In addition to conveniently storing values,...
Definition: labelRange.H:51
Foam::outerProduct
Definition: products.H:94
Foam::gMax
Type gMax(const FieldField< Field, Type > &f)
Definition: FieldFieldFunctions.C:591
Foam::average
dimensioned< Type > average(const DimensionedField< Type, GeoMesh > &df)
Definition: DimensionedFieldFunctions.C:327
Foam::gMinMax
MinMax< Type > gMinMax(const FieldField< Field, Type > &f)
Definition: FieldFieldFunctions.C:594
Foam::dotdot
void dotdot(FieldField< Field1, typename scalarProduct< Type1, Type2 >::type > &f, const FieldField< Field1, Type1 > &f1, const FieldField< Field2, Type2 > &f2)
Definition: FieldFieldFunctions.C:944