Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
openfoam
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Model registry
Analyze
Contributor analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Development
openfoam
Commits
49130c84
Commit
49130c84
authored
12 years ago
by
andy
Browse files
Options
Downloads
Patches
Plain Diff
ENH: Updated min/max function object to include boundary values
parent
459aa318
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/postProcessing/functionObjects/field/fieldMinMax/fieldMinMaxTemplates.C
+69
-22
69 additions, 22 deletions
.../functionObjects/field/fieldMinMax/fieldMinMaxTemplates.C
with
69 additions
and
22 deletions
src/postProcessing/functionObjects/field/fieldMinMax/fieldMinMaxTemplates.C
+
69
−
22
View file @
49130c84
...
...
@@ -45,31 +45,56 @@ void Foam::fieldMinMax::calcMinMaxFields
const
label
procI
=
Pstream
::
myProcNo
();
const
fieldType
&
field
=
obr_
.
lookupObject
<
fieldType
>
(
fieldName
);
const
fvMesh
&
mesh
=
field
.
mesh
();
const
volVectorField
::
GeometricBoundaryField
&
CfBoundary
=
mesh
.
C
().
boundaryField
();
switch
(
mode
)
{
case
mdMag
:
{
const
scalarField
magField
(
mag
(
field
));
const
volScalarField
magField
(
mag
(
field
));
const
volScalarField
::
GeometricBoundaryField
&
magFieldBoundary
=
magField
.
boundaryField
();
labelList
minIs
(
Pstream
::
nProcs
());
scalarList
minVs
(
Pstream
::
nProcs
());
List
<
vector
>
minCs
(
Pstream
::
nProcs
());
minIs
[
p
rocI
]
=
findMin
(
magField
);
minVs
[
procI
]
=
magField
[
min
Is
[
p
rocI
]
]
;
minCs
[
procI
]
=
field
.
mesh
().
C
()[
min
Is
[
p
rocI
]
]
;
label
minP
rocI
=
findMin
(
magField
);
minVs
[
procI
]
=
magField
[
min
P
rocI
];
minCs
[
procI
]
=
field
.
mesh
().
C
()[
min
P
rocI
];
Pstream
::
gatherList
(
minIs
);
Pstream
::
gatherList
(
minVs
);
Pstream
::
gatherList
(
minCs
);
labelList
maxIs
(
Pstream
::
nProcs
());
scalarList
maxVs
(
Pstream
::
nProcs
());
List
<
vector
>
maxCs
(
Pstream
::
nProcs
());
maxIs
[
procI
]
=
findMax
(
magField
);
maxVs
[
procI
]
=
magField
[
maxIs
[
procI
]];
maxCs
[
procI
]
=
field
.
mesh
().
C
()[
maxIs
[
procI
]];
label
maxProcI
=
findMax
(
magField
);
maxVs
[
procI
]
=
magField
[
maxProcI
];
maxCs
[
procI
]
=
field
.
mesh
().
C
()[
maxProcI
];
forAll
(
magFieldBoundary
,
patchI
)
{
const
scalarField
&
mfp
=
magFieldBoundary
[
patchI
];
const
vectorField
&
Cfp
=
CfBoundary
[
patchI
];
label
minPI
=
findMin
(
mfp
);
if
(
mfp
[
minPI
]
<
minVs
[
procI
])
{
minVs
[
procI
]
=
mfp
[
minPI
];
minCs
[
procI
]
=
Cfp
[
minPI
];
}
label
maxPI
=
findMax
(
mfp
);
if
(
mfp
[
maxPI
]
>
maxVs
[
procI
])
{
maxVs
[
procI
]
=
mfp
[
maxPI
];
maxCs
[
procI
]
=
Cfp
[
maxPI
];
}
}
Pstream
::
gatherList
(
minVs
);
Pstream
::
gatherList
(
minCs
);
Pstream
::
gatherList
(
maxIs
);
Pstream
::
gatherList
(
maxVs
);
Pstream
::
gatherList
(
maxCs
);
...
...
@@ -127,25 +152,47 @@ void Foam::fieldMinMax::calcMinMaxFields
}
case
mdCmpt
:
{
const
typename
fieldType
::
GeometricBoundaryField
&
fieldBoundary
=
field
.
boundaryField
();
List
<
Type
>
minVs
(
Pstream
::
nProcs
());
labelList
minIs
(
Pstream
::
nProcs
());
List
<
vector
>
minCs
(
Pstream
::
nProcs
());
minIs
[
p
rocI
]
=
findMin
(
field
);
minVs
[
procI
]
=
field
[
min
Is
[
p
rocI
]
]
;
minCs
[
procI
]
=
field
.
mesh
().
C
()[
min
Is
[
p
rocI
]
]
;
label
minP
rocI
=
findMin
(
field
);
minVs
[
procI
]
=
field
[
min
P
rocI
];
minCs
[
procI
]
=
field
.
mesh
().
C
()[
min
P
rocI
];
Pstream
::
gatherList
(
minIs
);
Pstream
::
gatherList
(
minVs
);
Pstream
::
gatherList
(
minCs
);
List
<
Type
>
maxVs
(
Pstream
::
nProcs
());
labelList
maxIs
(
Pstream
::
nProcs
());
List
<
vector
>
maxCs
(
Pstream
::
nProcs
());
maxIs
[
procI
]
=
findMax
(
field
);
maxVs
[
procI
]
=
field
[
maxIs
[
procI
]];
maxCs
[
procI
]
=
field
.
mesh
().
C
()[
maxIs
[
procI
]];
label
maxProcI
=
findMax
(
field
);
maxVs
[
procI
]
=
field
[
maxProcI
];
maxCs
[
procI
]
=
field
.
mesh
().
C
()[
maxProcI
];
forAll
(
fieldBoundary
,
patchI
)
{
const
Field
<
Type
>&
fp
=
fieldBoundary
[
patchI
];
const
vectorField
&
Cfp
=
CfBoundary
[
patchI
];
label
minPI
=
findMin
(
fp
);
if
(
fp
[
minPI
]
<
minVs
[
procI
])
{
minVs
[
procI
]
=
fp
[
minPI
];
minCs
[
procI
]
=
Cfp
[
minPI
];
}
label
maxPI
=
findMax
(
fp
);
if
(
fp
[
maxPI
]
>
maxVs
[
procI
])
{
maxVs
[
procI
]
=
fp
[
maxPI
];
maxCs
[
procI
]
=
Cfp
[
maxPI
];
}
}
Pstream
::
gatherList
(
minVs
);
Pstream
::
gatherList
(
minCs
);
Pstream
::
gatherList
(
maxIs
);
Pstream
::
gatherList
(
maxVs
);
Pstream
::
gatherList
(
maxCs
);
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment