mirror of
https://develop.openfoam.com/Development/openfoam.git
synced 2025-11-28 03:28:01 +00:00
ENH: write/clear on all components (issue #1199)
- use registry checkOut for removeRegisteredObject function object
This commit is contained in:
committed by
Andrew Heather
parent
f6d462a246
commit
8f92fa016f
@ -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-2019 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 = getObjectPtr<regIOobject>(objName);
|
||||
regIOobject* ptr = findObject<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();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -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 data
|
||||
// Private Data
|
||||
|
||||
//- 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();
|
||||
|
||||
Reference in New Issue
Block a user