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
a4cfc67f
Commit
a4cfc67f
authored
Nov 21, 2009
by
mattijs
Browse files
allow on-the-fly construction for e.g. having hundreds of cutting planes
parent
79ffe067
Changes
2
Hide whitespace changes
Inline
Side-by-side
src/OpenFOAM/db/functionObjects/OutputFilterFunctionObject/OutputFilterFunctionObject.C
View file @
a4cfc67f
...
...
@@ -37,8 +37,43 @@ void Foam::OutputFilterFunctionObject<OutputFilter>::readDict()
dict_
.
readIfPresent
(
"region"
,
regionName_
);
dict_
.
readIfPresent
(
"dictionary"
,
dictName_
);
dict_
.
readIfPresent
(
"enabled"
,
enabled_
);
dict_
.
readIfPresent
(
"storeFilter"
,
storeFilter_
);
}
template
<
class
OutputFilter
>
void
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_
)
);
}
}
template
<
class
OutputFilter
>
void
Foam
::
OutputFilterFunctionObject
<
OutputFilter
>::
destroyFilter
()
{
ptr_
.
reset
();
}
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
...
...
@@ -56,6 +91,7 @@ Foam::OutputFilterFunctionObject<OutputFilter>::OutputFilterFunctionObject
regionName_
(
polyMesh
::
defaultRegion
),
dictName_
(),
enabled_
(
true
),
storeFilter_
(
true
),
outputControl_
(
t
,
dict
)
{
readDict
();
...
...
@@ -83,32 +119,9 @@ bool Foam::OutputFilterFunctionObject<OutputFilter>::start()
{
readDict
();
if
(
enabled_
)
if
(
enabled_
&&
storeFilter_
)
{
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_
)
);
}
allocateFilter
();
}
return
true
;
...
...
@@ -120,12 +133,22 @@ bool Foam::OutputFilterFunctionObject<OutputFilter>::execute()
{
if
(
enabled_
)
{
if
(
!
storeFilter_
)
{
allocateFilter
();
}
ptr_
->
execute
();
if
(
enabled_
&&
outputControl_
.
output
())
{
ptr_
->
write
();
}
if
(
!
storeFilter_
)
{
destroyFilter
();
}
}
return
true
;
...
...
@@ -137,12 +160,22 @@ bool Foam::OutputFilterFunctionObject<OutputFilter>::end()
{
if
(
enabled_
)
{
if
(
!
storeFilter_
)
{
allocateFilter
();
}
ptr_
->
end
();
if
(
enabled_
&&
outputControl_
.
output
())
{
ptr_
->
write
();
}
if
(
!
storeFilter_
)
{
destroyFilter
();
}
}
return
true
;
...
...
src/OpenFOAM/db/functionObjects/OutputFilterFunctionObject/OutputFilterFunctionObject.H
View file @
a4cfc67f
...
...
@@ -78,6 +78,10 @@ class OutputFilterFunctionObject
//- Switch for the execution of the functionObject
bool
enabled_
;
//- Switch to store filter in between writes or use on-the-fly
// construction
bool
storeFilter_
;
//- Output controls
outputFilterOutputControl
outputControl_
;
...
...
@@ -89,6 +93,12 @@ class OutputFilterFunctionObject
//- Read relevant dictionary entries
void
readDict
();
//- Creates most of the data associated with this object.
void
allocateFilter
();
//- Destroys most of the data associated with this object.
void
destroyFilter
();
//- Disallow default bitwise copy construct
OutputFilterFunctionObject
(
const
OutputFilterFunctionObject
&
);
...
...
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