UniformFieldI.H
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) 2013 OpenFOAM Foundation
9  Copyright (C) 2020 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 "UniformField.H"
30 
31 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
32 
33 namespace Foam
34 {
35 
36 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
37 
38 template<class Type>
39 inline UniformField<Type> min
40 (
41  const UniformField<Type>& a,
42  const UniformField<Type>& b
43 )
44 {
45  return UniformField<Type>(min(a.value(), b.value()));
46 }
47 
48 
49 template<class Type, class OtherType>
50 inline OtherType min(const UniformField<Type>& u, const OtherType& o)
51 {
52  return min(u.value(), o);
53 }
54 
55 
56 template<class Type, class OtherType>
57 inline OtherType min(const OtherType& o, const UniformField<Type>& u)
58 {
59  return min(o, u.value());
60 }
61 
62 
63 template<class Type>
64 inline UniformField<Type> max
65 (
66  const UniformField<Type>& a,
67  const UniformField<Type>& b
68 )
69 {
70  return UniformField<Type>(max(a.value(), b.value()));
71 }
72 
73 
74 template<class Type, class OtherType>
75 inline OtherType max(const UniformField<Type>& u, const OtherType& o)
76 {
77  return max(u.value(), o);
78 }
79 
80 
81 template<class Type, class OtherType>
82 inline OtherType max(const OtherType& o, const UniformField<Type>& u)
83 {
84  return max(o, u.value());
85 }
86 
87 
88 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
89 
90 } // End namespace Foam
91 
92 // ************************************************************************* //
Foam::dimensioned::value
const Type & value() const
Return const reference to value.
Definition: dimensionedType.C:434
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::UniformField
A class representing the concept of a uniform field which stores only the single value and providing ...
Definition: UniformField.H:51
Foam::constant::physicoChemical::b
const dimensionedScalar b
Wien displacement law constant: default SI units: [m.K].
Definition: createFields.H:27
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
Foam
Namespace for OpenFOAM.
Definition: atmBoundaryLayer.C:33
Foam::UniformList< Type >::value
const Type & value() const noexcept
Return the value.
Definition: UniformList.H:81
UniformField.H