DimensionedFieldFunctions.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-2025 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 
30 
31 #define TEMPLATE template<class Type, class GeoMesh>
33 
34 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
35 
36 namespace Foam
37 {
38 
39 // * * * * * * * * * * * * * * * Global Functions * * * * * * * * * * * * * //
40 
41 template<class Type, class GeoMesh, direction r>
43 pow
44 (
47 )
48 {
49  typedef typename powProduct<Type, r>::type resultType;
50 
51  auto tres =
53  (
54  f1,
55  "pow(" + f1.name() + ',' + Foam::name(r) + ')',
56  pow(f1.dimensions(), r)
57  );
58 
59  pow<Type, r, GeoMesh>(tres.ref().field(), f1.field());
60 
61  return tres;
62 }
63 
64 
65 template<class Type, class GeoMesh, direction r>
67 pow
68 (
69  const tmp<DimensionedField<Type, GeoMesh>>& tf1,
71 )
72 {
73  typedef typename powProduct<Type, r>::type resultType;
74 
75  const auto& f1 = tf1();
76 
77  auto tres =
79  (
80  tf1,
81  "pow(" + f1.name() + ',' + Foam::name(r) + ')',
82  pow(f1.dimensions(), r)
83  );
84 
85  pow<Type, r, GeoMesh>(tres.ref().field(), f1.field());
86 
87  tf1.clear();
88  return tres;
89 }
90 
91 
92 template<class Type, class GeoMesh>
94 sqr(const DimensionedField<Type, GeoMesh>& f1)
95 {
96  typedef typename outerProduct<Type, Type>::type resultType;
97 
98  auto tres =
100  (
101  f1,
102  "sqr(" + f1.name() + ')',
103  sqr(f1.dimensions())
104  );
105 
106  sqr(tres.ref().field(), f1.field());
107 
108  return tres;
109 }
110 
111 template<class Type, class GeoMesh>
113 sqr(const tmp<DimensionedField<Type, GeoMesh>>& tf1)
114 {
115  typedef typename outerProduct<Type, Type>::type resultType;
116 
117  const auto& f1 = tf1();
118 
119  auto tres =
121  (
122  tf1,
123  "sqr(" + f1.name() + ')',
124  sqr(f1.dimensions())
125  );
126 
127  sqr(tres.ref().field(), f1.field());
128 
129  tf1.clear();
130  return tres;
131 }
132 
133 
134 template<class Type, class GeoMesh>
136 magSqr(const DimensionedField<Type, GeoMesh>& f1)
137 {
138  typedef typename typeOfMag<Type>::type resultType;
139 
140  auto tres =
142  (
143  f1,
144  "magSqr(" + f1.name() + ')',
145  sqr(f1.dimensions())
146  );
147 
148  magSqr(tres.ref().field(), f1.field());
149 
150  return tres;
151 }
152 
153 template<class Type, class GeoMesh>
155 magSqr(const tmp<DimensionedField<Type, GeoMesh>>& tf1)
156 {
157  typedef typename typeOfMag<Type>::type resultType;
158 
159  const auto& f1 = tf1();
160 
161  auto tres =
163  (
164  tf1,
165  "magSqr(" + f1.name() + ')',
166  sqr(f1.dimensions())
167  );
168 
169  magSqr(tres.ref().field(), f1.field());
170 
171  tf1.clear();
172  return tres;
173 }
174 
175 
176 template<class Type, class GeoMesh>
178 mag(const DimensionedField<Type, GeoMesh>& f1)
179 {
180  typedef typename typeOfMag<Type>::type resultType;
181 
182  auto tres =
184  (
185  f1,
186  "mag(" + f1.name() + ')',
187  f1.dimensions()
188  );
189 
190  mag(tres.ref().field(), f1.field());
191 
192  return tres;
193 }
194 
195 template<class Type, class GeoMesh>
197 mag(const tmp<DimensionedField<Type, GeoMesh>>& tf1)
198 {
199  typedef typename typeOfMag<Type>::type resultType;
200 
201  const auto& f1 = tf1();
202 
203  auto tres =
205  (
206  tf1,
207  "mag(" + f1.name() + ')',
208  f1.dimensions()
209  );
210 
211  mag(tres.ref().field(), f1.field());
212 
213  tf1.clear();
214  return tres;
215 }
216 
217 
218 template<class Type, class GeoMesh>
220 <
222  <
224  >
225 >
227 {
228  typedef typename DimensionedField<Type, GeoMesh>::cmptType resultType;
229 
230  auto tres =
232  (
233  f1,
234  "cmptAv(" + f1.name() + ')',
235  f1.dimensions()
236  );
237 
238  cmptAv(tres.ref().field(), f1.field());
239 
240  return tres;
241 }
242 
243 
244 template<class Type, class GeoMesh>
246 <
248  <
250  >
251 >
253 {
254  typedef typename DimensionedField<Type, GeoMesh>::cmptType resultType;
255 
256  const auto& f1 = tf1();
257 
258  auto tres =
260  (
261  tf1,
262  "cmptAv(" + f1.name() + ')',
263  f1.dimensions()
264  );
265 
266  cmptAv(tres.ref().field(), f1.field());
267 
268  tf1.clear();
269  return tres;
270 }
271 
272 
273 #define UNARY_REDUCTION_FUNCTION(ReturnType, Func, gFunc) \
274  \
275 template<class Type, class GeoMesh> \
276 dimensioned<ReturnType> Func \
277 ( \
278  const DimensionedField<Type, GeoMesh>& f1, \
279  const label comm \
280 ) \
281 { \
282  return dimensioned<ReturnType> \
283  ( \
284  #Func "(" + f1.name() + ')', \
285  f1.dimensions(), \
286  gFunc(f1.field(), comm) \
287  ); \
288 } \
289  \
290 template<class Type, class GeoMesh> \
291 dimensioned<ReturnType> Func \
292 ( \
293  const tmp<DimensionedField<Type, GeoMesh>>& tf1, \
294  const label comm \
295 ) \
296 { \
297  dimensioned<ReturnType> res = Func(tf1(), comm); \
298  tf1.clear(); \
299  return res; \
300 }
301 
308 
310 
311 #undef UNARY_REDUCTION_FUNCTION
312 
313 
314 BINARY_FUNCTION(Type, Type, Type, max)
315 BINARY_FUNCTION(Type, Type, Type, min)
316 BINARY_FUNCTION(Type, Type, Type, cmptMultiply)
317 BINARY_FUNCTION(Type, Type, Type, cmptDivide)
318 
319 BINARY_TYPE_FUNCTION(Type, Type, Type, max)
320 BINARY_TYPE_FUNCTION(Type, Type, Type, min)
321 BINARY_TYPE_FUNCTION(Type, Type, Type, cmptMultiply)
322 BINARY_TYPE_FUNCTION(Type, Type, Type, cmptDivide)
323 
325 // ------------------------------------------------------------------------- //
326 
327 // Clamp Methods
328 
329 template<class Type, class GeoMesh>
330 void clamp
331 (
332  DimensionedField<Type, GeoMesh>& result,
333  const DimensionedField<Type, GeoMesh>& f1,
334  Foam::zero_one
335 )
336 {
338 
339  clamp(result.field(), f1.field(), range);
340  result.oriented() = f1.oriented();
341 }
342 
343 template<class Type, class GeoMesh>
344 tmp<DimensionedField<Type, GeoMesh>>
345 clamp
346 (
347  const DimensionedField<Type, GeoMesh>& f1,
349 )
350 {
351  auto tres =
353  (
354  f1,
355  "clamp01(" + f1.name() + ')',
356  f1.dimensions()
357  );
358 
359  clamp(tres.ref(), f1, Foam::zero_one{});
360 
361  return tres;
362 }
363 
364 
365 template<class Type, class GeoMesh>
366 tmp<DimensionedField<Type, GeoMesh>>
367 clamp
368 (
369  const tmp<DimensionedField<Type, GeoMesh>>& tf1,
371 )
372 {
373  const auto& f1 = tf1();
374 
375  auto tres =
377  (
378  tf1,
379  "clamp01(" + f1.name() + ')',
380  f1.dimensions()
381  );
382 
383  clamp(tres.field(), f1, Foam::zero_one{});
384 
385  tf1.clear();
386  return tres;
387 }
388 
389 BINARY_TYPE_FUNCTION_FS(Type, Type, MinMax<Type>, clamp)
390 
391 
392 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
393 
394 TERNARY_FUNCTION(Type, Type, Type, scalar, lerp)
395 TERNARY_TYPE_FUNCTION_FFS(Type, Type, Type, scalar, lerp)
396 
397 
398 // * * * * * * * * * * * * * * * Global Operators * * * * * * * * * * * * * //
399 
400 UNARY_OPERATOR(Type, Type, -, negate, transform)
401 
402 BINARY_OPERATOR(Type, Type, scalar, *, '*', multiply)
403 BINARY_OPERATOR(Type, scalar, Type, *, '*', multiply)
404 BINARY_OPERATOR(Type, Type, scalar, /, '|', divide)
405 
406 BINARY_TYPE_OPERATOR_SF(Type, scalar, Type, *, '*', multiply)
407 BINARY_TYPE_OPERATOR_FS(Type, Type, scalar, *, '*', multiply)
408 
409 BINARY_TYPE_OPERATOR_FS(Type, Type, scalar, /, '|', divide)
410 
411 
412 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
413 
414 #define PRODUCT_OPERATOR(product, Op, OpFunc) \
415  \
416 template<class Type1, class Type2, class GeoMesh> \
417 tmp<DimensionedField<typename product<Type1, Type2>::type, GeoMesh>> \
418 operator Op \
419 ( \
420  const DimensionedField<Type1, GeoMesh>& f1, \
421  const DimensionedField<Type2, GeoMesh>& f2 \
422 ) \
423 { \
424  typedef typename product<Type1, Type2>::type resultType; \
425  \
426  auto tres = \
427  reuseTmpDimensionedField<resultType, Type1, GeoMesh>::New \
428  ( \
429  f1, \
430  '(' + f1.name() + #Op + f2.name() + ')', \
431  (f1.dimensions() Op f2.dimensions()) \
432  ); \
433  \
434  Foam::OpFunc(tres.ref().field(), f1.field(), f2.field()); \
435  \
436  return tres; \
437 } \
438  \
439  \
440 template<class Type1, class Type2, class GeoMesh> \
441 tmp<DimensionedField<typename product<Type1, Type2>::type, GeoMesh>> \
442 operator Op \
443 ( \
444  const DimensionedField<Type1, GeoMesh>& f1, \
445  const tmp<DimensionedField<Type2, GeoMesh>>& tf2 \
446 ) \
447 { \
448  typedef typename product<Type1, Type2>::type resultType; \
449  \
450  const auto& f2 = tf2(); \
451  \
452  auto tres = \
453  reuseTmpDimensionedField<resultType, Type2, GeoMesh>::New \
454  ( \
455  tf2, \
456  '(' + f1.name() + #Op + f2.name() + ')', \
457  (f1.dimensions() Op f2.dimensions()) \
458  ); \
459  \
460  Foam::OpFunc(tres.ref().field(), f1.field(), f2.field()); \
461  \
462  tf2.clear(); \
463  return tres; \
464 } \
465  \
466  \
467 template<class Type1, class Type2, class GeoMesh> \
468 tmp<DimensionedField<typename product<Type1, Type2>::type, GeoMesh>> \
469 operator Op \
470 ( \
471  const tmp<DimensionedField<Type1, GeoMesh>>& tf1, \
472  const DimensionedField<Type2, GeoMesh>& f2 \
473 ) \
474 { \
475  typedef typename product<Type1, Type2>::type resultType; \
476  \
477  const auto& f1 = tf1(); \
478  \
479  auto tres = \
480  reuseTmpDimensionedField<resultType, Type1, GeoMesh>::New \
481  ( \
482  tf1, \
483  '(' + f1.name() + #Op + f2.name() + ')', \
484  (f1.dimensions() Op f2.dimensions()) \
485  ); \
486  \
487  Foam::OpFunc(tres.ref().field(), f1.field(), f2.field()); \
488  \
489  tf1.clear(); \
490  return tres; \
491 } \
492  \
493  \
494 template<class Type1, class Type2, class GeoMesh> \
495 tmp<DimensionedField<typename product<Type1, Type2>::type, GeoMesh>> \
496 operator Op \
497 ( \
498  const tmp<DimensionedField<Type1, GeoMesh>>& tf1, \
499  const tmp<DimensionedField<Type2, GeoMesh>>& tf2 \
500 ) \
501 { \
502  typedef typename product<Type1, Type2>::type resultType; \
503  \
504  const auto& f1 = tf1(); \
505  const auto& f2 = tf2(); \
506  \
507  auto tres = \
508  reuseTmpTmpDimensionedField \
509  <resultType, Type1, Type1, Type2, GeoMesh>::New \
510  ( \
511  tf1, \
512  tf2, \
513  '(' + f1.name() + #Op + f2.name() + ')', \
514  (f1.dimensions() Op f2.dimensions()) \
515  ); \
516  \
517  Foam::OpFunc(tres.ref().field(), f1.field(), f2.field()); \
518  \
519  tf1.clear(); \
520  tf2.clear(); \
521  return tres; \
522 } \
523  \
524  \
525 template<class Form, class Type, class GeoMesh> \
526 tmp<DimensionedField<typename product<Type, Form>::type, GeoMesh>> \
527 operator Op \
528 ( \
529  const DimensionedField<Type, GeoMesh>& f1, \
530  const dimensioned<Form>& dvs \
531 ) \
532 { \
533  typedef typename product<Type, Form>::type resultType; \
534  \
535  auto tres = \
536  reuseTmpDimensionedField<resultType, Type, GeoMesh>::New \
537  ( \
538  f1, \
539  '(' + f1.name() + #Op + dvs.name() + ')', \
540  (f1.dimensions() Op dvs.dimensions()) \
541  ); \
542  \
543  Foam::OpFunc(tres.ref().field(), f1.field(), dvs.value()); \
544  \
545  return tres; \
546 } \
547  \
548  \
549 template<class Form, class Cmpt, direction nCmpt, class Type, class GeoMesh> \
550 tmp<DimensionedField<typename product<Form, Type>::type, GeoMesh>> \
551 operator Op \
552 ( \
553  const DimensionedField<Type, GeoMesh>& f1, \
554  const VectorSpace<Form,Cmpt,nCmpt>& vs \
555 ) \
556 { \
557  return f1 Op dimensioned<Form>(static_cast<const Form&>(vs)); \
558 } \
559  \
560  \
561 template<class Form, class Type, class GeoMesh> \
562 tmp<DimensionedField<typename product<Type, Form>::type, GeoMesh>> \
563 operator Op \
564 ( \
565  const tmp<DimensionedField<Type, GeoMesh>>& tf1, \
566  const dimensioned<Form>& dvs \
567 ) \
568 { \
569  typedef typename product<Type, Form>::type resultType; \
570  \
571  const auto& f1 = tf1(); \
572  \
573  auto tres = \
574  reuseTmpDimensionedField<resultType, Type, GeoMesh>::New \
575  ( \
576  tf1, \
577  '(' + f1.name() + #Op + dvs.name() + ')', \
578  (f1.dimensions() Op dvs.dimensions()) \
579  ); \
580  \
581  Foam::OpFunc(tres.ref().field(), f1.field(), dvs.value()); \
582  \
583  tf1.clear(); \
584  return tres; \
585 } \
586  \
587  \
588 template<class Form, class Cmpt, direction nCmpt, class Type, class GeoMesh> \
589 tmp<DimensionedField<typename product<Form, Type>::type, GeoMesh>> \
590 operator Op \
591 ( \
592  const tmp<DimensionedField<Type, GeoMesh>>& tf1, \
593  const VectorSpace<Form,Cmpt,nCmpt>& vs \
594 ) \
595 { \
596  return tf1 Op dimensioned<Form>(static_cast<const Form&>(vs)); \
597 } \
598  \
599  \
600 template<class Form, class Type, class GeoMesh> \
601 tmp<DimensionedField<typename product<Form, Type>::type, GeoMesh>> \
602 operator Op \
603 ( \
604  const dimensioned<Form>& dvs, \
605  const DimensionedField<Type, GeoMesh>& f2 \
606 ) \
607 { \
608  typedef typename product<Form, Type>::type resultType; \
609  \
610  auto tres = \
611  reuseTmpDimensionedField<resultType, Type, GeoMesh>::New \
612  ( \
613  f2, \
614  '(' + dvs.name() + #Op + f2.name() + ')', \
615  (dvs.dimensions() Op f2.dimensions()) \
616  ); \
617  \
618  Foam::OpFunc(tres.ref().field(), dvs.value(), f2.field()); \
619  \
620  return tres; \
621 } \
622  \
623  \
624 template<class Form, class Cmpt, direction nCmpt, class Type, class GeoMesh> \
625 tmp<DimensionedField<typename product<Form, Type>::type, GeoMesh>> \
626 operator Op \
627 ( \
628  const VectorSpace<Form,Cmpt,nCmpt>& vs, \
629  const DimensionedField<Type, GeoMesh>& f2 \
630 ) \
631 { \
632  return dimensioned<Form>(static_cast<const Form&>(vs)) Op f2; \
633 } \
634  \
635  \
636 template<class Form, class Type, class GeoMesh> \
637 tmp<DimensionedField<typename product<Form, Type>::type, GeoMesh>> \
638 operator Op \
639 ( \
640  const dimensioned<Form>& dvs, \
641  const tmp<DimensionedField<Type, GeoMesh>>& tf2 \
642 ) \
643 { \
644  typedef typename product<Form, Type>::type resultType; \
645  \
646  const auto& f2 = tf2(); \
647  \
648  auto tres = \
649  reuseTmpDimensionedField<resultType, Type, GeoMesh>::New \
650  ( \
651  tf2, \
652  '(' + dvs.name() + #Op + f2.name() + ')', \
653  (dvs.dimensions() Op f2.dimensions()) \
654  ); \
655  \
656  Foam::OpFunc(tres.ref().field(), dvs.value(), f2.field()); \
657  \
658  tf2.clear(); \
659  return tres; \
660 } \
661  \
662  \
663 template<class Form, class Cmpt, direction nCmpt, class Type, class GeoMesh> \
664 tmp<DimensionedField<typename product<Form, Type>::type, GeoMesh>> \
665 operator Op \
666 ( \
667  const VectorSpace<Form,Cmpt,nCmpt>& vs, \
668  const tmp<DimensionedField<Type, GeoMesh>>& tf2 \
669 ) \
670 { \
671  return dimensioned<Form>(static_cast<const Form&>(vs)) Op tf2; \
672 }
677 
682 
683 #undef PRODUCT_OPERATOR
684 
685 
686 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
687 
688 } // End namespace Foam
689 
690 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
691 
692 #include "undefFieldFunctionsM.H"
693 
694 // ************************************************************************* //
#define BINARY_OPERATOR(ReturnType, Type1, Type2, Op, OpName, OpFunc)
type
Types of root.
Definition: Roots.H:52
void divide(DimensionedField< Type, GeoMesh > &result, const DimensionedField< Type, GeoMesh > &f1, const DimensionedField< scalar, GeoMesh > &f2)
tmp< DimensionedField< typename DimensionedField< Type, GeoMesh >::cmptType, GeoMesh >> cmptAv(const DimensionedField< Type, GeoMesh > &f1)
dimensioned< typename typeOfMag< Type >::type > mag(const dimensioned< Type > &dt)
Type gMin(const FieldField< Field, Type > &f)
const word & name() const noexcept
Return the object name.
Definition: IOobjectI.H:195
label max(const labelHashSet &set, label maxValue=labelMin)
Find the max value in labelHashSet, optionally limited by second argument.
Definition: hashSets.C:40
dimensionedSymmTensor sqr(const dimensionedVector &dv)
A min/max value pair with additional methods. In addition to conveniently storing values...
Definition: HashSet.H:72
#define BINARY_TYPE_OPERATOR_SF(ReturnType, Type1, Type2, Op, OpName, OpFunc)
#define UNARY_REDUCTION_FUNCTION(ReturnType, Func, gFunc)
#define BINARY_TYPE_OPERATOR_FS(ReturnType, Type1, Type2, Op, OpName, OpFunc)
void cross(FieldField< Field1, typename crossProduct< Type1, Type2 >::type > &f, const FieldField< Field1, Type1 > &f1, const FieldField< Field2, Type2 > &f2)
typeOfRank< typename pTraits< arg1 >::cmptType, direction(pTraits< arg1 >::rank)+direction(pTraits< arg2 >::rank) >::type type
Definition: products.H:118
#define BINARY_TYPE_FUNCTION(ReturnType, Type1, Type2, Func)
Field< Type >::cmptType cmptType
Component type of the field elements.
void dotdot(FieldField< Field1, typename scalarProduct< Type1, Type2 >::type > &f, const FieldField< Field1, Type1 > &f1, const FieldField< Field2, Type2 > &f2)
void subtract(FieldField< Field1, typename typeOfSum< Type1, Type2 >::type > &f, const FieldField< Field1, Type1 > &f1, const FieldField< Field2, Type2 > &f2)
dimensioned< Type > sum(const DimensionedField< Type, GeoMesh > &f1, const label comm)
void outer(FieldField< Field1, typename outerProduct< Type1, Type2 >::type > &f, const FieldField< Field1, Type1 > &f1, const FieldField< Field2, Type2 > &f2)
scalar range
void dot(FieldField< Field1, typename innerProduct< Type1, Type2 >::type > &f, const FieldField< Field1, Type1 > &f1, const FieldField< Field2, Type2 > &f2)
#define PRODUCT_OPERATOR(product, Op, OpFunc)
dimensioned< Type > cmptDivide(const dimensioned< Type > &, const dimensioned< Type > &)
MinMax< label > minMax(const labelHashSet &set)
Find the min/max values of labelHashSet.
Definition: hashSets.C:54
#define BINARY_FUNCTION(ReturnType, Type1, Type2, Func)
dimensioned< Type > average(const DimensionedField< Type, GeoMesh > &f1, const label comm)
dimensioned< scalarMinMax > minMaxMag(const DimensionedField< Type, GeoMesh > &f1, const label comm)
Type gSum(const FieldField< Field, Type > &f)
word name(const expressions::valueTypeCode typeCode)
A word representation of a valueTypeCode. Empty for expressions::valueTypeCode::INVALID.
Definition: exprTraits.C:127
#define BINARY_TYPE_FUNCTION_FS(ReturnType, Type1, Type2, Func)
MinMax< Type > gMinMax(const FieldField< Field, Type > &f)
void negate(DimensionedField< Type, GeoMesh > &result, const DimensionedField< Type, GeoMesh > &f1)
label min(const labelHashSet &set, label minValue=labelMax)
Find the min value in labelHashSet, optionally limited by second argument.
Definition: hashSets.C:26
static tmp< DimensionedField< TypeR, GeoMesh > > New(const DimensionedField< Type1, GeoMesh > &f1, const word &name, const dimensionSet &dimensions)
Pass-through to New DimensionedField.
dimensioned< Type > cmptMultiply(const dimensioned< Type > &, const dimensioned< Type > &)
void add(FieldField< Field1, typename typeOfSum< Type1, Type2 >::type > &f, const FieldField< Field1, Type1 > &f1, const FieldField< Field2, Type2 > &f2)
refinementData transform(const tensor &, const refinementData val)
No-op rotational transform for base types.
Type gAverage(const FieldField< Field, Type > &f, const label comm)
The global arithmetic average of a FieldField.
Type gMax(const FieldField< Field, Type > &f)
scalarMinMax gMinMaxMag(const FieldField< Field, Type > &f)
dimensioned< Type > lerp(const dimensioned< Type > &a, const dimensioned< Type > &b, const scalar t)
const dimensionSet & dimensions() const noexcept
Return dimensions.
typeOfMag< Type >::type gSumMag(const FieldField< Field, Type > &f)
Represents 0/1 range or concept. Used for tagged dispatch or clamping.
Definition: pTraits.H:51
symmTypeOfRank< typename pTraits< arg1 >::cmptType, arg2 *direction(pTraits< arg1 >::rank) >::type type
Definition: products.H:176
dimensioned< typename typeOfMag< Type >::type > sumMag(const DimensionedField< Type, GeoMesh > &f1, const label comm)
dimensionedScalar pow(const dimensionedScalar &ds, const dimensionedScalar &expt)
void clear()
Clear exponents - resets to be dimensionless.
Definition: dimensionSet.C:136
const Field< Type > & field() const noexcept
Return const-reference to the primitive field values.
Field with dimensions and associated with geometry type GeoMesh which is used to size the field and a...
#define UNARY_OPERATOR(ReturnType, Type1, Op, OpFunc, Dfunc)
#define TERNARY_TYPE_FUNCTION_FFS(ReturnType, Type1, Type2, Type3, Func)
Generic mesh wrapper used by volMesh, surfaceMesh, pointMesh etc.
Definition: GeoMesh.H:45
A class for managing temporary objects.
Definition: HashPtrTable.H:50
void multiply(DimensionedField< Type, GeoMesh > &result, const DimensionedField< Type, GeoMesh > &f1, const DimensionedField< scalar, GeoMesh > &f2)
#define TERNARY_FUNCTION(ReturnType, Type1, Type2, Type3, Func)
dimensioned< typename typeOfMag< Type >::type > magSqr(const dimensioned< Type > &dt)
Namespace for OpenFOAM.
dimensionSet clamp(const dimensionSet &a, const dimensionSet &range)
Definition: dimensionSet.C:271
pTraits< typename pTraits< arg1 >::cmptType >::magType type
Definition: products.H:96