Skip to content
GitLab
Menu
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
acdfa681
Commit
acdfa681
authored
May 11, 2016
by
Henry Weller
Browse files
OutputFilterFunctionObject: Simplify construction
parent
81526524
Changes
2
Hide whitespace changes
Inline
Side-by-side
src/OpenFOAM/db/functionObjects/OutputFilterFunctionObject/OutputFilterFunctionObject.C
View file @
acdfa681
...
...
@@ -51,38 +51,6 @@ bool Foam::OutputFilterFunctionObject<OutputFilter>::active() const
}
template
<
class
OutputFilter
>
bool
Foam
::
OutputFilterFunctionObject
<
OutputFilter
>::
allocateFilter
()
{
if
(
dictName_
.
size
())
{
ptr_
.
reset
(
new
IOOutputFilter
<
OutputFilter
>
(
name
(),
time_
.
lookupObject
<
objectRegistry
>
(
regionName_
),
dictName_
)
);
}
else
{
ptr_
.
reset
(
new
OutputFilter
(
name
(),
time_
.
lookupObject
<
objectRegistry
>
(
regionName_
),
dict_
)
);
}
return
ptr_
.
valid
();
}
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
template
<
class
OutputFilter
>
...
...
@@ -108,7 +76,33 @@ Foam::OutputFilterFunctionObject<OutputFilter>::OutputFilterFunctionObject
evaluateControl_
(
t
,
dict
,
"evaluate"
)
{
readDict
();
if
(
!
allocateFilter
())
if
(
dictName_
.
size
())
{
ptr_
.
reset
(
new
IOOutputFilter
<
OutputFilter
>
(
name
,
time_
.
lookupObject
<
objectRegistry
>
(
regionName_
),
dictName_
)
);
}
else
{
ptr_
.
reset
(
new
OutputFilter
(
name
,
time_
.
lookupObject
<
objectRegistry
>
(
regionName_
),
dict_
)
);
}
if
(
!
ptr_
.
valid
())
{
FatalErrorInFunction
<<
"Cannot construct "
<<
OutputFilter
::
typeName
...
...
@@ -192,9 +186,9 @@ bool Foam::OutputFilterFunctionObject<OutputFilter>::adjustTimeStep()
scalar
nSteps
=
timeToNextWrite
/
deltaT
-
SMALL
;
// function
o
bjects modify deltaT
inside
nStepsToStartTimeChange
range
// NOTE: Potential problem if two function objects dump
inside the same
// interval
// function
O
bjects modify deltaT
within
nStepsToStartTimeChange
// NOTE: Potential problem
s arise
if two function objects dump
within
//
the same
interval
if
(
nSteps
<
nStepsToStartTimeChange_
)
{
label
nStepsToNextWrite
=
label
(
nSteps
)
+
1
;
...
...
src/OpenFOAM/db/functionObjects/OutputFilterFunctionObject/OutputFilterFunctionObject.H
View file @
acdfa681
...
...
@@ -103,10 +103,7 @@ class OutputFilterFunctionObject
//- Read relevant dictionary entries
void
readDict
();
//- Creates most of the data associated with this object.
bool
allocateFilter
();
//- Returns true if active (enabled and within time bounds)
//- Returns true if within time bounds
bool
active
()
const
;
//- Disallow default bitwise copy construct
...
...
@@ -158,9 +155,9 @@ public:
// Function object control
//- Called at each ++ or += of the time-loop.
forceWrite overrides
// the usual outputControl behaviour and
forces writing always
// (used in post-processing mode)
//- Called at each ++ or += of the time-loop.
//
forceWrite overrides
the usual outputControl behaviour and
//
forces writing
(used in post-processing mode)
virtual
bool
execute
(
const
bool
forceWrite
=
false
);
//- Called when Time::run() determines that the time-loop exits
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a 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