Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
10
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Open sidebar
Development
OpenFOAM-plus
Commits
7dc44ae0
Commit
7dc44ae0
authored
Feb 01, 2019
by
Andrew Heather
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'feature-fieldLimits' into 'develop'
Add minMax and clip field functions See merge request
!230
parents
6cdb80b2
27981d42
Changes
27
Hide whitespace changes
Inline
Side-by-side
Showing
27 changed files
with
1000 additions
and
220 deletions
+1000
-220
applications/solvers/combustion/XiFoam/XiDyMFoam/XiDyMFoam.C
applications/solvers/combustion/XiFoam/XiDyMFoam/XiDyMFoam.C
+2
-2
applications/solvers/compressible/sonicFoam/sonicDyMFoam/sonicDyMFoam.C
...olvers/compressible/sonicFoam/sonicDyMFoam/sonicDyMFoam.C
+2
-2
applications/solvers/heatTransfer/buoyantSimpleFoam/pEqn.H
applications/solvers/heatTransfer/buoyantSimpleFoam/pEqn.H
+1
-1
applications/solvers/lagrangian/sprayFoam/pEqn.H
applications/solvers/lagrangian/sprayFoam/pEqn.H
+1
-2
applications/solvers/lagrangian/sprayFoam/sprayDyMFoam/pEqn.H
...ications/solvers/lagrangian/sprayFoam/sprayDyMFoam/pEqn.H
+1
-2
applications/solvers/multiphase/reactingEulerFoam/reactingMultiphaseEulerFoam/multiphaseSystem/multiphaseSystem.C
...ngMultiphaseEulerFoam/multiphaseSystem/multiphaseSystem.C
+1
-1
applications/solvers/multiphase/reactingEulerFoam/reactingTwoPhaseEulerFoam/twoPhaseSystem/twoPhaseSystem.C
...reactingTwoPhaseEulerFoam/twoPhaseSystem/twoPhaseSystem.C
+1
-1
applications/test/minMax1/Test-minMax1.C
applications/test/minMax1/Test-minMax1.C
+23
-4
applications/test/minMax2/Make/files
applications/test/minMax2/Make/files
+3
-0
applications/test/minMax2/Make/options
applications/test/minMax2/Make/options
+7
-0
applications/test/minMax2/Test-minMax2.C
applications/test/minMax2/Test-minMax2.C
+146
-0
src/OpenFOAM/dimensionedTypes/dimensionedMinMax/dimensionedMinMax.H
...AM/dimensionedTypes/dimensionedMinMax/dimensionedMinMax.H
+167
-0
src/OpenFOAM/dimensionedTypes/dimensionedMinMax/dimensionedMinMaxTemplates.C
...ionedTypes/dimensionedMinMax/dimensionedMinMaxTemplates.C
+67
-0
src/OpenFOAM/dimensionedTypes/dimensionedTypes.H
src/OpenFOAM/dimensionedTypes/dimensionedTypes.H
+1
-0
src/OpenFOAM/fields/DimensionedFields/DimensionedField/DimensionedFieldFunctions.C
...sionedFields/DimensionedField/DimensionedFieldFunctions.C
+5
-0
src/OpenFOAM/fields/DimensionedFields/DimensionedField/DimensionedFieldFunctions.H
...sionedFields/DimensionedField/DimensionedFieldFunctions.H
+6
-1
src/OpenFOAM/fields/FieldFields/FieldField/FieldFieldFunctions.C
...nFOAM/fields/FieldFields/FieldField/FieldFieldFunctions.C
+37
-1
src/OpenFOAM/fields/FieldFields/FieldField/FieldFieldFunctions.H
...nFOAM/fields/FieldFields/FieldField/FieldFieldFunctions.H
+19
-1
src/OpenFOAM/fields/Fields/Field/FieldFunctions.C
src/OpenFOAM/fields/Fields/Field/FieldFunctions.C
+25
-30
src/OpenFOAM/fields/Fields/Field/FieldFunctions.H
src/OpenFOAM/fields/Fields/Field/FieldFunctions.H
+18
-1
src/OpenFOAM/fields/GeometricFields/GeometricField/GeometricField.C
...AM/fields/GeometricFields/GeometricField/GeometricField.C
+35
-13
src/OpenFOAM/fields/GeometricFields/GeometricField/GeometricField.H
...AM/fields/GeometricFields/GeometricField/GeometricField.H
+16
-4
src/OpenFOAM/fields/GeometricFields/GeometricField/GeometricFieldFunctions.C
.../GeometricFields/GeometricField/GeometricFieldFunctions.C
+3
-1
src/OpenFOAM/fields/GeometricFields/GeometricField/GeometricFieldFunctions.H
.../GeometricFields/GeometricField/GeometricFieldFunctions.H
+5
-1
src/OpenFOAM/primitives/ranges/MinMax/MinMax.H
src/OpenFOAM/primitives/ranges/MinMax/MinMax.H
+13
-142
src/OpenFOAM/primitives/ranges/MinMax/MinMaxI.H
src/OpenFOAM/primitives/ranges/MinMax/MinMaxI.H
+18
-10
src/OpenFOAM/primitives/ranges/MinMax/MinMaxOps.H
src/OpenFOAM/primitives/ranges/MinMax/MinMaxOps.H
+377
-0
No files found.
applications/solvers/combustion/XiFoam/XiDyMFoam/XiDyMFoam.C
View file @
7dc44ae0
...
...
@@ -141,8 +141,8 @@ int main(int argc, char *argv[])
}
#include "rhoEqn.H"
Info
<<
"rho
Eqn max/min :
"
<<
max
(
rho
).
value
()
<<
" "
<<
min
(
rho
).
value
()
<<
endl
;
Info
<<
"rho
min/max : "
<<
min
(
rho
).
value
()
<<
"
"
<<
max
(
rho
).
value
()
<<
endl
;
// --- Pressure-velocity PIMPLE corrector loop
while
(
pimple
.
loop
())
...
...
applications/solvers/compressible/sonicFoam/sonicDyMFoam/sonicDyMFoam.C
View file @
7dc44ae0
...
...
@@ -121,8 +121,8 @@ int main(int argc, char *argv[])
}
#include "rhoEqn.H"
Info
<<
"rho
Eqn max/min :
"
<<
max
(
rho
).
value
()
<<
" "
<<
min
(
rho
).
value
()
<<
endl
;
Info
<<
"rho
min/max : "
<<
min
(
rho
).
value
()
<<
"
"
<<
max
(
rho
).
value
()
<<
endl
;
// --- Pressure-velocity PIMPLE corrector loop
while
(
pimple
.
loop
())
...
...
applications/solvers/heatTransfer/buoyantSimpleFoam/pEqn.H
View file @
7dc44ae0
...
...
@@ -79,6 +79,6 @@
rho
=
thermo
.
rho
();
rho
.
relax
();
Info
<<
"rho m
ax/min
: "
<<
m
ax
(
rho
).
value
()
<<
" "
<<
m
in
(
rho
).
value
()
Info
<<
"rho m
in/max
: "
<<
m
in
(
rho
).
value
()
<<
" "
<<
m
ax
(
rho
).
value
()
<<
endl
;
}
applications/solvers/lagrangian/sprayFoam/pEqn.H
View file @
7dc44ae0
...
...
@@ -97,8 +97,7 @@ rho = thermo.rho();
rho
=
max
(
rho
,
rhoMin
);
rho
=
min
(
rho
,
rhoMax
);
rho
.
relax
();
Info
<<
"rho max/min : "
<<
max
(
rho
).
value
()
<<
" "
<<
min
(
rho
).
value
()
<<
endl
;
Info
<<
"rho min/max : "
<<
min
(
rho
).
value
()
<<
" "
<<
max
(
rho
).
value
()
<<
endl
;
U
=
HbyA
-
rAU
*
fvc
::
grad
(
p
);
U
.
correctBoundaryConditions
();
...
...
applications/solvers/lagrangian/sprayFoam/sprayDyMFoam/pEqn.H
View file @
7dc44ae0
...
...
@@ -97,8 +97,7 @@ rho = thermo.rho();
rho
=
max
(
rho
,
rhoMin
);
rho
=
min
(
rho
,
rhoMax
);
rho
.
relax
();
Info
<<
"rho max/min : "
<<
max
(
rho
).
value
()
<<
" "
<<
min
(
rho
).
value
()
<<
endl
;
Info
<<
"rho min/max : "
<<
min
(
rho
).
value
()
<<
" "
<<
max
(
rho
).
value
()
<<
endl
;
U
=
HbyA
-
rAU
*
fvc
::
grad
(
p
);
U
.
correctBoundaryConditions
();
...
...
applications/solvers/multiphase/reactingEulerFoam/reactingMultiphaseEulerFoam/multiphaseSystem/multiphaseSystem.C
View file @
7dc44ae0
...
...
@@ -692,7 +692,7 @@ void Foam::multiphaseSystem::solve()
phase
.
alphaRhoPhi
()
=
fvc
::
interpolate
(
phase
.
rho
())
*
phase
.
alphaPhi
();
// Ensure the phase-fractions are bounded
phase
.
maxMin
(
0
,
1
);
phase
.
clip
(
0
,
1
);
}
calcAlphas
();
...
...
applications/solvers/multiphase/reactingEulerFoam/reactingTwoPhaseEulerFoam/twoPhaseSystem/twoPhaseSystem.C
View file @
7dc44ae0
...
...
@@ -403,7 +403,7 @@ void Foam::twoPhaseSystem::solve()
<<
endl
;
// Ensure the phase-fractions are bounded
alpha1
.
maxMin
(
0
,
1
);
alpha1
.
clip
(
0
,
1
);
// Update the phase-fraction of the other phase
alpha2
=
scalar
(
1
)
-
alpha1
;
...
...
applications/test/minMax1/Test-minMax1.C
View file @
7dc44ae0
...
...
@@ -138,7 +138,23 @@ int main(int argc, char *argv[])
minmax1
+=
values1
;
Pout
<<
"range: "
<<
minmax1
<<
endl
;
Info
<<
"Reduced: "
<<
returnReduce
(
minmax1
,
plusOp
<
scalarMinMax
>
())
<<
nl
;
Info
<<
"Reduced: "
<<
returnReduce
(
minmax1
,
minMaxOp
<
scalar
>
())
<<
nl
;
// Info<< "gMinMax: "<< gMinMax(values1v) << nl;
vectorField
values1v
(
ListOps
::
create
<
vector
>
(
values1
,
[](
const
scalar
s
)
{
return
vector
(
s
,
2
*
s
,
-
2
*
s
);
}
)
);
Info
<<
"gMinMax: "
<<
gMinMax
(
values1v
)
<<
nl
;
Info
<<
"gMinMaxMag: "
<<
gMinMaxMag
(
values1v
)
<<
nl
;
{
MinMax
<
scalar
>
limiter
(
10
,
200
);
...
...
@@ -159,13 +175,14 @@ int main(int argc, char *argv[])
Info
<<
"clipped : "
<<
val
<<
" = "
<<
clip
(
val
,
limiter
)
<<
nl
;
}
Info
<<
nl
<<
"inplace clip"
<<
nl
;
Info
<<
nl
<<
"test clip(Field) with limiter: "
<<
limiter
<<
nl
;
Info
<<
"clipped : "
<<
clip
(
values1
,
limiter
)
<<
nl
;
scalarField
values2
(
values1
);
Info
<<
"before: "
<<
flatOutput
(
values2
)
<<
nl
;
Info
<<
nl
<<
"inplace clip"
<<
nl
;
Info
<<
"before
:
"
<<
flatOutput
(
values2
)
<<
nl
;
Info
<<
"before "
<<
flatOutput
(
values2
)
<<
nl
;
for
(
scalar
&
val
:
values2
)
{
...
...
@@ -176,7 +193,9 @@ int main(int argc, char *argv[])
Info
<<
nl
<<
"For list: "
<<
flatOutput
(
values1
)
<<
nl
<<
" minMax : "
<<
minMax
(
values1
)
<<
nl
<<
" minMaxMag : "
<<
minMaxMag
(
values1
)
<<
nl
;
<<
" minMaxMag : "
<<
minMaxMag
(
values1
)
<<
" = "
<<
mag
(
minMaxMag
(
vector
(
1
,
2
,
3
)))
<<
nl
;
}
...
...
applications/test/minMax2/Make/files
0 → 100644
View file @
7dc44ae0
Test-minMax2.C
EXE = $(FOAM_USER_APPBIN)/Test-minMax2
applications/test/minMax2/Make/options
0 → 100644
View file @
7dc44ae0
EXE_INC = \
-I$(LIB_SRC)/finiteVolume/lnInclude \
-I$(LIB_SRC)/meshTools/lnInclude
EXE_LIBS = \
-lfiniteVolume \
-lmeshTools
applications/test/minMax2/Test-minMax2.C
0 → 100644
View file @
7dc44ae0
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2019 OpenCFD Ltd.
\\/ M anipulation |
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
OpenFOAM is free software: you can redistribute it and/or modify it
under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
for more details.
You should have received a copy of the GNU General Public License
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
Description
Test minMax
\*---------------------------------------------------------------------------*/
#include "fvCFD.H"
#include "Time.H"
#include "BitOps.H"
#include "HashOps.H"
#include "ListOps.H"
#include "scalarField.H"
#include "MinMax.H"
#include "dimensionedScalar.H"
#include "dimensionedMinMax.H"
using
namespace
Foam
;
template
<
class
T
>
Ostream
&
printInfo
(
const
MinMax
<
T
>&
range
)
{
Info
<<
range
<<
" valid="
<<
range
.
valid
();
return
Info
;
}
dimensionedScalarMinMax
rhoLimit
(
const
dictionary
&
dict
)
{
Info
<<
"From "
<<
dict
;
dimensionedScalarMinMax
range
=
makeDimensionedMinMax
<
scalar
>
(
"rhoLimit"
,
dimDensity
,
scalarMinMax
{
Zero
,
GREAT
},
dict
,
"rhoMin"
,
"rhoMax"
);
Info
<<
"=> "
<<
range
<<
nl
;
return
range
;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
// Main program:
int
main
(
int
argc
,
char
*
argv
[])
{
argList
::
noCheckProcessorDirectories
();
#include "setRootCase.H"
Info
<<
"Test min/max "
<<
nl
;
{
scalarMinMax
range1
(
10
,
20
);
scalarMinMax
range2
(
40
,
50
);
Info
<<
range1
<<
" + "
<<
range2
<<
" = "
<<
(
range1
+
range2
)
<<
nl
;
}
{
Info
<<
"Dimensioned range : "
<<
dimensioned
<
scalarMinMax
>
(
"velrange"
,
dimVelocity
,
{
1
,
20
})
<<
nl
;
dimensioned
<
scalarMinMax
>
range1
(
"a"
,
dimVelocity
,
{
10
,
20
});
dimensioned
<
scalarMinMax
>
range2
(
"b"
,
dimVelocity
,
{
40
,
50
});
Info
<<
"Dimensioned range : "
<<
(
range1
+
range2
)
<<
endl
;
}
{
Info
<<
nl
<<
"makeDimensionedMinMax:"
<<
nl
<<
nl
;
Info
<<
makeDimensionedMinMax
<
scalar
>
(
"rhoa"
,
dimDensity
,
1
,
20
)
<<
nl
;
{
dimensionedScalar
minval
(
"min"
,
dimDensity
,
0
.
3
);
dimensionedScalar
maxval
(
"max"
,
dimDensity
,
0
.
5
);
Info
<<
makeDimensionedMinMax
<
scalar
>
(
minval
,
maxval
)
<<
nl
;
Info
<<
makeDimensionedMinMax
<
scalar
>
(
"rhob"
,
minval
,
maxval
)
<<
nl
;
}
{
dictionary
dict1
,
dict2
,
dict3
,
dict4
;
dict1
.
add
(
"rhoMin"
,
dimensionedScalar
(
""
,
dimDensity
,
0
.
1
));
dict2
.
add
(
"rhoMax"
,
dimensionedScalar
(
""
,
dimDensity
,
20
));
dict3
.
add
(
"rhoMin"
,
dimensionedScalar
(
""
,
dimDensity
,
0
.
3
));
dict3
.
add
(
"rhoMax"
,
dimensionedScalar
(
""
,
dimDensity
,
30
));
dict4
.
add
(
"rhoLimit"
,
dimensionedScalarMinMax
(
""
,
dimDensity
,
scalarMinMax
(
0
.
4
,
40
))
);
rhoLimit
(
dict1
);
rhoLimit
(
dict2
);
rhoLimit
(
dict3
);
rhoLimit
(
dict4
);
}
}
return
0
;
}
// ************************************************************************* //
src/OpenFOAM/dimensionedTypes/dimensionedMinMax/dimensionedMinMax.H
0 → 100644
View file @
7dc44ae0
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2019 OpenCFD Ltd.
\\/ M anipulation |
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
OpenFOAM is free software: you can redistribute it and/or modify it
under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
for more details.
You should have received a copy of the GNU General Public License
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
Typedef
Foam::dimensionedScalarMinMax
Description
A dimensioned scalarMinMix (MinMax for scalar quantities).
Typedef
Foam::dimensionedMinMax\<T\>
Description
A templated type alias for dimensioned\<MinMax\<T\>\>
SourceFiles
dimensionedMinMaxTemplates.C
\*---------------------------------------------------------------------------*/
#ifndef dimensionedMinMax_H
#define dimensionedMinMax_H
#include "dimensionedType.H"
#include "MinMax.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
namespace
Foam
{
// General alias
template
<
class
T
>
using
dimensionedMinMax
=
dimensioned
<
MinMax
<
T
>>
;
// Common typedefs
typedef
dimensioned
<
scalarMinMax
>
dimensionedScalarMinMax
;
// * * * * * * * * * * * * * * * Global Functions * * * * * * * * * * * * * //
//- Make a dimensionedMinMax from all components
template
<
class
T
>
inline
dimensioned
<
MinMax
<
T
>>
makeDimensionedMinMax
(
const
word
&
name
,
const
dimensionSet
&
dims
,
const
T
&
minVal
,
const
T
&
maxVal
)
{
return
dimensioned
<
MinMax
<
T
>>
(
name
,
dims
,
MinMax
<
T
>
(
minVal
,
maxVal
));
}
//- Create a dimensionless "minmax"
template
<
class
T
>
inline
dimensioned
<
MinMax
<
T
>>
makeDimensionedMinMax
(
const
T
&
minVal
,
const
T
&
maxVal
)
{
return
dimensioned
<
MinMax
<
T
>>
(
"minmax"
,
dimensionSet
(),
MinMax
<
T
>
(
minVal
,
maxVal
)
);
}
//- Combine two dimensioned types into a dimensionedMinMax with specified name
template
<
class
T
>
inline
dimensioned
<
MinMax
<
T
>>
makeDimensionedMinMax
(
const
word
&
name
,
const
dimensioned
<
T
>&
minVal
,
const
dimensioned
<
T
>&
maxVal
)
{
// Dimension check when (dimensionSet::debug)
return
dimensioned
<
MinMax
<
T
>>
(
name
,
(
minVal
.
dimensions
()
+
maxVal
.
dimensions
()),
MinMax
<
T
>
(
minVal
.
value
(),
maxVal
.
value
())
);
}
//- Combine two dimensioned types into a dimensionedMinMax "minmax"
template
<
class
T
>
inline
dimensioned
<
MinMax
<
T
>>
makeDimensionedMinMax
(
const
dimensioned
<
T
>&
minVal
,
const
dimensioned
<
T
>&
maxVal
)
{
return
makeDimensionedMinMax
(
"minmax"
,
minVal
,
maxVal
);
}
//- Construct from components (name, dimensions, value) with an optional
//- dictionary override that can also \e zip together different sub-entries.
//
// The dictionary override can specify separate min/max dictionary entries.
// For example,
// \verbatim
// rhoMin 0.3;
// rhoMax 2.0;
// \endverbatim
//
// Construct as following:
//
// \verbatim
// makeDimensionedMinMax<scalar>
// (
// "rhoMinMax", dimDensity, {Zero, GREAT}, dict, "rhoMin", "rhoMax"
// );
// \endverbatim
template
<
class
T
>
dimensioned
<
MinMax
<
T
>>
makeDimensionedMinMax
(
const
word
&
name
,
const
dimensionSet
&
dims
,
const
MinMax
<
T
>&
values
,
const
dictionary
&
dict
,
const
word
&
minName
,
const
word
&
maxName
);
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
}
// End namespace Foam
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#ifdef NoRepository
#include "dimensionedMinMaxTemplates.C"
#endif
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#endif
// ************************************************************************* //
src/OpenFOAM/dimensionedTypes/dimensionedMinMax/dimensionedMinMaxTemplates.C
0 → 100644
View file @
7dc44ae0
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2019 OpenCFD Ltd.
\\/ M anipulation |
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
OpenFOAM is free software: you can redistribute it and/or modify it
under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
for more details.
You should have received a copy of the GNU General Public License
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
\*---------------------------------------------------------------------------*/
#include "dimensionedMinMax.H"
#include "dictionary.H"
// * * * * * * * * * * * * * * * Global Functions * * * * * * * * * * * * * //
template
<
class
T
>
Foam
::
dimensioned
<
Foam
::
MinMax
<
T
>>
Foam
::
makeDimensionedMinMax
(
const
word
&
name
,
const
dimensionSet
&
dims
,
const
MinMax
<
T
>&
values
,
const
dictionary
&
dict
,
const
word
&
minName
,
const
word
&
maxName
)
{
// Normal construction with optional entry
dimensioned
<
MinMax
<
T
>>
range
(
name
,
dims
,
values
,
dict
);
// Optional min specification
if
(
!
minName
.
empty
())
{
dimensioned
<
T
>
minVal
(
minName
,
dims
,
values
.
min
(),
dict
);
range
.
dimensions
()
+=
minVal
.
dimensions
();
range
.
value
().
min
()
=
minVal
.
value
();
}
// Optional max specification
if
(
!
maxName
.
empty
())
{
dimensioned
<
T
>
maxVal
(
maxName
,
dims
,
values
.
max
(),
dict
);
range
.
dimensions
()
+=
maxVal
.
dimensions
();
range
.
value
().
max
()
=
maxVal
.
value
();
}
return
range
;
}
// ************************************************************************* //
src/OpenFOAM/dimensionedTypes/dimensionedTypes.H
View file @
7dc44ae0
...
...
@@ -33,6 +33,7 @@ License
#include "dimensionedSphericalTensor.H"
#include "dimensionedSymmTensor.H"
#include "dimensionedTensor.H"
#include "dimensionedMinMax.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
...
...
src/OpenFOAM/fields/DimensionedFields/DimensionedField/DimensionedFieldFunctions.C
View file @
7dc44ae0
...
...
@@ -325,6 +325,9 @@ UNARY_REDUCTION_FUNCTION(Type, sum, gSum)
UNARY_REDUCTION_FUNCTION
(
scalar
,
sumMag
,
gSumMag
)
UNARY_REDUCTION_FUNCTION
(
Type
,
average
,
gAverage
)
UNARY_REDUCTION_FUNCTION
(
MinMax
<
Type
>
,
minMax
,
gMinMax
)
UNARY_REDUCTION_FUNCTION
(
scalarMinMax
,
minMaxMag
,
gMinMaxMag
)
#undef UNARY_REDUCTION_FUNCTION
...
...
@@ -338,6 +341,8 @@ BINARY_TYPE_FUNCTION(Type, Type, Type, min)
BINARY_TYPE_FUNCTION
(
Type
,
Type
,
Type
,
cmptMultiply
)
BINARY_TYPE_FUNCTION
(
Type
,
Type
,
Type
,
cmptDivide
)
BINARY_TYPE_FUNCTION_FS
(
Type
,
Type
,
MinMax
<
Type
>
,
clip
)
// * * * * * * * * * * * * * * * Global operators * * * * * * * * * * * * * //
...
...
src/OpenFOAM/fields/DimensionedFields/DimensionedField/DimensionedFieldFunctions.H
View file @
7dc44ae0
...
...
@@ -3,7 +3,7 @@
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation
\\/ M anipulation |
\\/ M anipulation |
Copyright (C) 2019 OpenCFD Ltd.
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
...
...
@@ -119,6 +119,9 @@ UNARY_REDUCTION_FUNCTION(Type, sum, gSum)
UNARY_REDUCTION_FUNCTION
(
scalar
,
sumMag
,
gSumMag
)
UNARY_REDUCTION_FUNCTION
(
Type
,
average
,
gAverage
)
UNARY_REDUCTION_FUNCTION
(
MinMax
<
Type
>
,
minMax
,
gMinMax
)
UNARY_REDUCTION_FUNCTION
(
scalarMinMax
,
minMaxMag
,
gMinMaxMag
)
#undef UNARY_REDUCTION_FUNCTION
...
...
@@ -132,6 +135,8 @@ BINARY_TYPE_FUNCTION(Type, Type, Type, min)
BINARY_TYPE_FUNCTION
(
Type
,
Type
,
Type
,
cmptMultiply
)
BINARY_TYPE_FUNCTION
(
Type
,
Type
,
Type
,
cmptDivide
)
BINARY_TYPE_FUNCTION_FS
(
Type
,
Type
,
MinMax
<
Type
>
,
clip
)
// * * * * * * * * * * * * * * * Global operators * * * * * * * * * * * * * //
...
...
src/OpenFOAM/fields/FieldFields/FieldField/FieldFieldFunctions.C
View file @
7dc44ae0
...
...
@@ -3,7 +3,7 @@
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation
\\/ M anipulation |
\\/ M anipulation |
Copyright (C) 2019 OpenCFD Ltd.
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
...
...
@@ -521,6 +521,37 @@ Type average(const FieldField<Field, Type>& f)
TMP_UNARY_FUNCTION
(
Type
,
average
)