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-plus
Commits
b006d337
Commit
b006d337
authored
Jun 19, 2019
by
Andrew Heather
Browse files
ENH: Improved backwards compatibility for pressure FO
parent
45b0aed8
Changes
2
Hide whitespace changes
Inline
Side-by-side
src/functionObjects/field/pressure/pressure.C
View file @
b006d337
...
...
@@ -281,10 +281,17 @@ bool Foam::functionObjects::pressure::read(const dictionary& dict)
rhoInfInitialised_
=
true
;
}
if
(
dict
.
found
(
"calcTotal"
))
if
(
!
modeNames
.
readIfPresent
(
"mode"
,
dict
,
mode_
))
{
// Backwards compatibility - check for the presence of 'calcTotal'
if
(
dict
.
getCompat
<
bool
>
(
"mode"
,
{{
"calcTotal"
,
1812
}}))
// Backwards compatibility
// - check for the presence of 'calcTotal' and 'calcCoeff'
bool
calcTotal
=
dict
.
getOrDefaultCompat
<
bool
>
(
"mode"
,
{{
"calcTotal"
,
1812
}},
false
);
bool
calcCoeff
=
dict
.
getOrDefaultCompat
<
bool
>
(
"mode"
,
{{
"calcCoeff"
,
1812
}},
false
);
if
(
calcTotal
)
{
mode_
=
TOTAL
;
}
...
...
@@ -293,15 +300,11 @@ bool Foam::functionObjects::pressure::read(const dictionary& dict)
mode_
=
STATIC
;
}
if
(
dict
.
getCompat
<
bool
>
(
"mode"
,
{{
"calcCoeff"
,
1812
}})
)
if
(
calcCoeff
)
{
mode_
=
static_cast
<
mode
>
(
COEFF
|
mode_
);
}
}
else
{
mode_
=
modeNames
.
get
(
"mode"
,
dict
);
}
pRef_
=
dict
.
lookupOrDefault
<
scalar
>
(
"pRef"
,
0
);
...
...
src/functionObjects/field/pressure/pressure.H
View file @
b006d337
...
...
@@ -82,8 +82,7 @@ Usage
type pressure;
libs ("libfieldFunctionObjects.so");
...
calcTotal no;
calcCoeff yes;
mode staticCoeff;
}
\endverbatim
...
...
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