Skip to content
GitLab
Explore
Sign in
Register
This is an archived project. Repository and other project resources are read-only.
Commits on Source (1)
COMP: update for removal of minMaxOp - now uses sumOp
· 35301ec0
Mark OLESEN
authored
Feb 27, 2025
35301ec0
Hide whitespace changes
Inline
Side-by-side
src/runTimePostProcessing/fieldVisualisationBase.C
View file @
35301ec0
...
...
@@ -5,7 +5,7 @@
\\ / A nd | www.openfoam.com
\\/ M anipulation |
-------------------------------------------------------------------------------
Copyright (C) 2015-202
1
OpenCFD Ltd.
Copyright (C) 2015-202
5
OpenCFD Ltd.
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
...
...
@@ -105,7 +105,7 @@ queryFieldSummary
{
queried
.
nComponents_
=
array
->
GetNumberOfComponents
();
queried
.
association_
|=
FieldAssociation
::
CELL_DATA
;
queried
.
range
_
+=
vtk
::
Tools
::
rangeOf
(
array
);
queried
.
bounds
_
+=
vtk
::
Tools
::
rangeOf
(
array
);
}
array
=
vtkDataArray
::
SafeDownCast
...
...
@@ -117,7 +117,7 @@ queryFieldSummary
{
queried
.
nComponents_
=
array
->
GetNumberOfComponents
();
queried
.
association_
|=
FieldAssociation
::
POINT_DATA
;
queried
.
range
_
+=
vtk
::
Tools
::
rangeOf
(
array
);
queried
.
bounds
_
+=
vtk
::
Tools
::
rangeOf
(
array
);
}
}
...
...
@@ -163,7 +163,7 @@ queryFieldSummary
}
queried
.
association_
|=
local
.
association_
;
queried
.
range
_
+=
local
.
range
_
;
queried
.
bounds
_
+=
local
.
bounds
_
;
}
}
...
...
@@ -360,11 +360,11 @@ void Foam::functionObjects::runTimePostPro::fieldVisualisationBase::addMagField
void
Foam
::
functionObjects
::
runTimePostPro
::
fieldVisualisationBase
::
fieldSummary
::
reduce
()
{
if
(
Pstream
::
parRun
())
if
(
U
Pstream
::
parRun
())
{
Foam
::
reduce
(
nComponents_
,
maxOp
<
int
>
());
Foam
::
reduce
(
association_
,
bitOrOp
<
unsigned
>
());
Foam
::
reduce
(
range_
,
minMax
Op
<
scalar
>
());
Foam
::
reduce
(
bounds_
,
sum
Op
<
scalar
MinMax
>
());
}
}
...
...
@@ -378,9 +378,10 @@ Foam::Ostream& Foam::operator<<
>&
proxy
)
{
os
<<
"nComponents:"
<<
proxy
.
t_
.
nComponents_
<<
" association:"
<<
label
(
proxy
.
t_
.
association_
)
<<
" min/max:"
<<
proxy
.
t_
.
range_
;
const
auto
&
summary
=
*
proxy
;
os
<<
"nComponents:"
<<
summary
.
nComponents_
<<
" association:"
<<
int
(
summary
.
association_
)
<<
" min/max:"
<<
summary
.
bounds_
;
return
os
;
}
...
...
@@ -633,11 +634,7 @@ addGlyphs
if
(
maxGlyphLength
>
0
)
{
// Using range from the data:
// glyph->SetRange
// (
// scaleFieldInfo.range_.first(),
// scaleFieldInfo.range_.second()
// );
// glyph->SetRange(scaleFieldInfo.min(), scaleFieldInfo.max());
// Set range according to user-supplied limits
glyph
->
ClampingOn
();
...
...
@@ -678,11 +675,7 @@ addGlyphs
{
// Set range according data limits
glyph
->
ClampingOn
();
glyph
->
SetRange
(
scaleFieldInfo
.
range_
.
first
(),
scaleFieldInfo
.
range_
.
second
()
);
glyph
->
SetRange
(
scaleFieldInfo
.
min
(),
scaleFieldInfo
.
max
());
glyph
->
SetScaleFactor
(
maxGlyphLength
);
}
else
...
...
src/runTimePostProcessing/fieldVisualisationBase.H
View file @
35301ec0
...
...
@@ -5,7 +5,7 @@
\\ / A nd | www.openfoam.com
\\/ M anipulation |
-------------------------------------------------------------------------------
Copyright (C) 2015-202
0
OpenCFD Ltd.
Copyright (C) 2015-202
5
OpenCFD Ltd.
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
...
...
@@ -145,43 +145,40 @@ public:
{
int
nComponents_
;
unsigned
association_
;
scalarMinMax
range
_
;
scalarMinMax
bounds
_
;
//- Default construct
fieldSummary
()
:
nComponents_
(
0
),
association_
(
0u
),
range
_
()
bounds
_
()
{}
//- Parallel reduction. A no-op if Pstream::parRun() is false
void
reduce
();
//- True if nComponents_ == 1
bool
isScalar
()
const
{
return
nComponents_
==
1
;
}
bool
isScalar
()
const
noexcept
{
return
nComponents_
==
1
;
}
//- True if nComponents_ == 3
bool
isVector
()
const
{
return
nComponents_
==
3
;
}
bool
isVector
()
const
noexcept
{
return
nComponents_
==
3
;
}
//- True if association_ is non-zero
bool
exists
()
const
{
return
association_
;
}
bool
exists
()
const
noexcept
{
return
association_
;
}
//- True if there is a POINT_DATA association
bool
hasPointData
()
const
bool
hasPointData
()
const
noexcept
{
return
(
association_
&
FieldAssociation
::
POINT_DATA
);
}
//- The minimum value in the field summary
scalar
min
()
const
noexcept
{
return
bounds_
.
min
();
}
//- The maximum value in the field summary
scalar
max
()
const
noexcept
{
return
bounds_
.
max
();
}
InfoProxy
<
fieldSummary
>
info
()
const
{
return
InfoProxy
<
fieldSummary
>
(
*
this
);
...
...