Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
Development
openfoam
Commits
de673f3b
Commit
de673f3b
authored
Feb 11, 2019
by
Mark OLESEN
Committed by
Andrew Heather
Feb 11, 2019
Browse files
STYLE: consolidate 'clear' when initialising surfaceFieldValue
parent
e6937f60
Changes
2
Hide whitespace changes
Inline
Side-by-side
src/functionObjects/field/fieldValues/surfaceFieldValue/surfaceFieldValue.C
View file @
de673f3b
...
...
@@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2017-201
8
OpenCFD Ltd.
\\ / A nd | Copyright (C) 2017-201
9
OpenCFD Ltd.
\\/ M anipulation |
-------------------------------------------------------------------------------
| Copyright (C) 2011-2017 OpenFOAM Foundation
...
...
@@ -434,7 +434,7 @@ combineSurfaceGeometry
Foam
::
scalar
Foam
::
functionObjects
::
fieldValues
::
surfaceFieldValue
::
totalArea
()
const
{
scalar
totalArea
;
scalar
totalArea
=
0
;
if
(
regionType_
==
stSurface
)
{
...
...
@@ -488,37 +488,34 @@ void Foam::functionObjects::fieldValues::surfaceFieldValue::initialise
{
dict
.
readEntry
(
"name"
,
regionName_
);
totalArea_
=
0
;
nFaces_
=
0
;
faceId_
.
clear
();
facePatchId_
.
clear
();
faceFlip_
.
clear
();
surfacePtr_
.
clear
();
surfaceWriterPtr_
.
clear
();
switch
(
regionType_
)
{
case
stFaceZone
:
{
setFaceZoneFaces
();
surfacePtr_
.
clear
();
break
;
}
case
stPatch
:
{
setPatchFaces
();
surfacePtr_
.
clear
();
break
;
}
case
stSurface
:
{
const
surfMesh
&
s
=
dynamicCast
<
const
surfMesh
>
(
obr
());
nFaces_
=
returnReduce
(
s
.
size
(),
sumOp
<
label
>
());
faceId_
.
clear
();
facePatchId_
.
clear
();
faceFlip_
.
clear
();
surfacePtr_
.
clear
();
break
;
}
case
stSampledSurface
:
{
faceId_
.
clear
();
facePatchId_
.
clear
();
faceFlip_
.
clear
();
surfacePtr_
=
sampledSurface
::
New
(
name
(),
...
...
@@ -614,8 +611,6 @@ void Foam::functionObjects::fieldValues::surfaceFieldValue::initialise
fields_
.
append
(
orientedFields
);
}
surfaceWriterPtr_
.
clear
();
if
(
writeFields_
)
{
const
word
surfaceFormat
(
dict
.
get
<
word
>
(
"surfaceFormat"
));
...
...
@@ -916,6 +911,7 @@ Foam::functionObjects::fieldValues::surfaceFieldValue::surfaceFieldValue
)
),
weightFieldName_
(
"none"
),
totalArea_
(
0
),
writeArea_
(
dict
.
lookupOrDefault
(
"writeArea"
,
false
)),
nFaces_
(
0
),
faceId_
(),
...
...
@@ -948,6 +944,7 @@ Foam::functionObjects::fieldValues::surfaceFieldValue::surfaceFieldValue
)
),
weightFieldName_
(
"none"
),
totalArea_
(
0
),
writeArea_
(
dict
.
lookupOrDefault
(
"writeArea"
,
false
)),
nFaces_
(
0
),
faceId_
(),
...
...
@@ -959,12 +956,6 @@ Foam::functionObjects::fieldValues::surfaceFieldValue::surfaceFieldValue
}
// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
Foam
::
functionObjects
::
fieldValues
::
surfaceFieldValue
::~
surfaceFieldValue
()
{}
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
bool
Foam
::
functionObjects
::
fieldValues
::
surfaceFieldValue
::
read
...
...
src/functionObjects/field/fieldValues/surfaceFieldValue/surfaceFieldValue.H
View file @
de673f3b
...
...
@@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2015-201
7
OpenCFD Ltd.
\\ / A nd | Copyright (C) 2015-201
9
OpenCFD Ltd.
\\/ M anipulation |
-------------------------------------------------------------------------------
| Copyright (C) 2011-2017 OpenFOAM Foundation
...
...
@@ -84,22 +84,22 @@ Usage
log | write data to standard output | no | no
writeFields | Write the region field values | yes |
writeArea | Write the area of the surfaceFieldValue | no |
surfaceFormat |
o
utput value format | no |
regionType |
f
ace regionType: see below | yes |
name |
n
ame of face regionType if required | no |
operation |
o
peration to perform | yes |
postOperation |
p
ost-operation to perform | no | none
weightField |
n
ame of field to apply weighting | no |
scaleFactor |
s
cale factor | no | 1
fields |
l
ist of fields to operate on | yes |
surfaceFormat |
O
utput value format | no |
regionType |
F
ace regionType: see below | yes |
name |
N
ame of face regionType if required | no |
operation |
O
peration to perform | yes |
postOperation |
P
ost-operation to perform | no | none
weightField |
N
ame of field to apply weighting | no |
scaleFactor |
S
cale factor | no | 1
fields |
L
ist of fields to operate on | yes |
\endtable
Where \c regionType is defined by
\plaintable
faceZone |
r
equires a \b name entry to specify the faceZone
patch |
r
equires a \b name entry to specify the patch
surface |
r
equires a \b name entry to specify the surfMesh
sampledSurface |
r
equires a \b sampledSurfaceDict sub-dictionary
faceZone |
R
equires a \b name entry to specify the faceZone
patch |
R
equires a \b name entry to specify the patch
surface |
R
equires a \b name entry to specify the surfMesh
sampledSurface |
R
equires a \b sampledSurfaceDict sub-dictionary
\endplaintable
The \c operation is one of:
...
...
@@ -373,7 +373,7 @@ protected:
boolList
faceFlip_
;
//-
Underlying
sampledSurface (if operating on sampledSurface)
//-
The
sampledSurface (if operating on sampledSurface)
autoPtr
<
sampledSurface
>
surfacePtr_
;
//- Surface writer
...
...
@@ -527,7 +527,7 @@ public:
//- Destructor
virtual
~
surfaceFieldValue
();
virtual
~
surfaceFieldValue
()
=
default
;
// Public Member Functions
...
...
Write
Preview
Supports
Markdown
0%
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!
Cancel
Please
register
or
sign in
to comment