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
8f92fa01
Commit
8f92fa01
authored
Feb 11, 2019
by
Mark OLESEN
Committed by
Andrew Heather
Feb 11, 2019
Browse files
ENH: write/clear on all components (issue
#1199
)
- use registry checkOut for removeRegisteredObject function object
parent
f6d462a2
Changes
4
Hide whitespace changes
Inline
Side-by-side
src/functionObjects/field/components/components.C
View file @
8f92fa01
...
...
@@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd |
\\ / A nd |
Copyright (C) 2019 OpenCFD Ltd.
\\/ M anipulation |
-------------------------------------------------------------------------------
| Copyright (C) 2016 OpenFOAM Foundation
...
...
@@ -68,37 +68,31 @@ Foam::functionObjects::components::components
{}
// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
Foam
::
functionObjects
::
components
::~
components
()
{}
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
bool
Foam
::
functionObjects
::
components
::
write
()
{
bool
written
=
true
;
bool
ok
=
true
;
for
All
(
resultNames_
,
i
)
for
(
const
word
&
result
:
resultNames_
)
{
written
=
written
&&
writeObject
(
result
Names_
[
i
])
;
ok
=
writeObject
(
result
)
&&
ok
;
}
return
written
;
return
ok
;
}
bool
Foam
::
functionObjects
::
components
::
clear
()
{
bool
cleared
=
true
;
bool
ok
=
true
;
for
All
(
resultNames_
,
i
)
for
(
const
word
&
result
:
resultNames_
)
{
cleared
=
cleared
&&
clearObject
(
result
Names_
[
i
])
;
ok
=
clearObject
(
result
)
&&
ok
;
}
return
cleared
;
return
ok
;
}
...
...
src/functionObjects/field/components/components.H
View file @
8f92fa01
...
...
@@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd |
\\ / A nd |
Copyright (C) 2019 OpenCFD Ltd.
\\/ M anipulation |
-------------------------------------------------------------------------------
| Copyright (C) 2016 OpenFOAM Foundation
...
...
@@ -103,7 +103,7 @@ public:
//- Destructor
virtual
~
components
();
virtual
~
components
()
=
default
;
// Member Functions
...
...
src/functionObjects/utilities/removeRegisteredObject/removeRegisteredObject.C
View file @
8f92fa01
...
...
@@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2015-201
6
OpenCFD Ltd.
\\ / A nd | Copyright (C) 2015-201
9
OpenCFD Ltd.
\\/ M anipulation |
-------------------------------------------------------------------------------
| Copyright (C) 2013-2016 OpenFOAM Foundation
...
...
@@ -64,12 +64,6 @@ Foam::functionObjects::removeRegisteredObject::removeRegisteredObject
}
// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
Foam
::
functionObjects
::
removeRegisteredObject
::~
removeRegisteredObject
()
{}
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
bool
Foam
::
functionObjects
::
removeRegisteredObject
::
read
(
const
dictionary
&
dict
)
...
...
@@ -86,7 +80,7 @@ bool Foam::functionObjects::removeRegisteredObject::execute()
{
for
(
const
word
&
objName
:
objectNames_
)
{
regIOobject
*
ptr
=
get
Object
Ptr
<
regIOobject
>
(
objName
);
regIOobject
*
ptr
=
find
Object
<
regIOobject
>
(
objName
);
if
(
ptr
&&
ptr
->
ownedByRegistry
())
{
...
...
@@ -94,8 +88,7 @@ bool Foam::functionObjects::removeRegisteredObject::execute()
<<
" removing object "
<<
ptr
->
name
()
<<
nl
<<
endl
;
ptr
->
release
();
delete
ptr
;
ptr
->
checkOut
();
}
}
...
...
src/functionObjects/utilities/removeRegisteredObject/removeRegisteredObject.H
View file @
8f92fa01
...
...
@@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2015-2016 OpenCFD Ltd.
\\ / A nd | Copyright (C) 2015-2016
, 2019
OpenCFD Ltd.
\\/ M anipulation |
-------------------------------------------------------------------------------
| Copyright (C) 2013-2016 OpenFOAM Foundation
...
...
@@ -80,7 +80,7 @@ class removeRegisteredObject
:
public
regionFunctionObject
{
// Private
d
ata
// Private
D
ata
//- Names of objects to control
wordList
objectNames_
;
...
...
@@ -113,13 +113,13 @@ public:
//- Destructor
virtual
~
removeRegisteredObject
();
virtual
~
removeRegisteredObject
()
=
default
;
// Member Functions
//- Read the removeRegisteredObject data
virtual
bool
read
(
const
dictionary
&
);
virtual
bool
read
(
const
dictionary
&
dict
);
//- Remove the registered objects
virtual
bool
execute
();
...
...
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