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