Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
Development
openfoam
Commits
7e86354f
Commit
7e86354f
authored
May 20, 2011
by
mattijs
Browse files
STYLE: writeRegisteredObject: remove unused switch
parent
ec1b7c01
Changes
2
Hide whitespace changes
Inline
Side-by-side
src/postProcessing/functionObjects/IO/writeRegisteredObject/writeRegisteredObject.C
View file @
7e86354f
...
...
@@ -44,7 +44,6 @@ Foam::writeRegisteredObject::writeRegisteredObject
:
name_
(
name
),
obr_
(
obr
),
active_
(
true
),
objectNames_
()
{
read
(
dict
);
...
...
@@ -61,10 +60,7 @@ Foam::writeRegisteredObject::~writeRegisteredObject()
void
Foam
::
writeRegisteredObject
::
read
(
const
dictionary
&
dict
)
{
if
(
active_
)
{
dict
.
lookup
(
"objectNames"
)
>>
objectNames_
;
}
dict
.
lookup
(
"objectNames"
)
>>
objectNames_
;
}
...
...
@@ -82,32 +78,29 @@ void Foam::writeRegisteredObject::end()
void
Foam
::
writeRegisteredObject
::
write
()
{
if
(
active_
)
forAll
(
objectNames_
,
i
)
{
forAll
(
objectNames_
,
i
)
if
(
obr_
.
foundObject
<
regIOobject
>
(
objectNames_
[
i
])
)
{
if
(
obr_
.
foundObject
<
regIOobject
>
(
objectNames_
[
i
]))
{
regIOobject
&
obj
=
const_cast
<
regIOobject
&>
(
obr_
.
lookupObject
<
regIOobject
>
(
objectNames_
[
i
])
);
// Switch off automatic writing to prevent double write
obj
.
writeOpt
()
=
IOobject
::
NO_WRITE
;
obj
.
write
();
}
else
{
WarningIn
regIOobject
&
obj
=
const_cast
<
regIOobject
&>
(
"Foam::writeRegisteredObject::read(const dictionary&)"
)
<<
"Object "
<<
objectNames_
[
i
]
<<
" not found in "
<<
"database. Available objects:"
<<
nl
<<
obr_
.
sortedToc
()
<<
endl
;
}
obr_
.
lookupObject
<
regIOobject
>
(
objectNames_
[
i
])
);
// Switch off automatic writing to prevent double write
obj
.
writeOpt
()
=
IOobject
::
NO_WRITE
;
obj
.
write
();
}
else
{
WarningIn
(
"Foam::writeRegisteredObject::read(const dictionary&)"
)
<<
"Object "
<<
objectNames_
[
i
]
<<
" not found in "
<<
"database. Available objects:"
<<
nl
<<
obr_
.
sortedToc
()
<<
endl
;
}
}
}
...
...
src/postProcessing/functionObjects/IO/writeRegisteredObject/writeRegisteredObject.H
View file @
7e86354f
...
...
@@ -65,10 +65,6 @@ protected:
const
objectRegistry
&
obr_
;
//- On/off switch
bool
active_
;
// Read from dictionary
//- Names of objects to control
...
...
Write
Preview
Markdown
is supported
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