mirror of
https://github.com/OpenFOAM/OpenFOAM-6.git
synced 2025-12-08 06:57:46 +00:00
postProcess.H: clear the object owned by the mesh objectRegistry
at the end of each time processed to ensure all fields are updated for each time. Resolves bug-report https://bugs.openfoam.org/view.php?id=2997
This commit is contained in:
@ -155,6 +155,9 @@ if (argList::postProcess(argc, argv))
|
|||||||
Warning<< err << endl;
|
Warning<< err << endl;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Clear the objects owned by the mesh
|
||||||
|
mesh.objectRegistry::clear();
|
||||||
|
|
||||||
Info<< endl;
|
Info<< endl;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -2,7 +2,7 @@
|
|||||||
========= |
|
========= |
|
||||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||||
\\ / O peration |
|
\\ / O peration |
|
||||||
\\ / A nd | Copyright (C) 2011-2017 OpenFOAM Foundation
|
\\ / A nd | Copyright (C) 2011-2018 OpenFOAM Foundation
|
||||||
\\/ M anipulation |
|
\\/ M anipulation |
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
License
|
License
|
||||||
@ -92,21 +92,7 @@ Foam::objectRegistry::objectRegistry
|
|||||||
|
|
||||||
Foam::objectRegistry::~objectRegistry()
|
Foam::objectRegistry::~objectRegistry()
|
||||||
{
|
{
|
||||||
List<regIOobject*> myObjects(size());
|
clear();
|
||||||
label nMyObjects = 0;
|
|
||||||
|
|
||||||
for (iterator iter = begin(); iter != end(); ++iter)
|
|
||||||
{
|
|
||||||
if (iter()->ownedByRegistry())
|
|
||||||
{
|
|
||||||
myObjects[nMyObjects++] = iter();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
for (label i=0; i < nMyObjects; i++)
|
|
||||||
{
|
|
||||||
checkOut(*myObjects[i]);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -284,6 +270,26 @@ bool Foam::objectRegistry::checkOut(regIOobject& io) const
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void Foam::objectRegistry::clear()
|
||||||
|
{
|
||||||
|
List<regIOobject*> myObjects(size());
|
||||||
|
label nMyObjects = 0;
|
||||||
|
|
||||||
|
for (iterator iter = begin(); iter != end(); ++iter)
|
||||||
|
{
|
||||||
|
if (iter()->ownedByRegistry())
|
||||||
|
{
|
||||||
|
myObjects[nMyObjects++] = iter();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
for (label i=0; i < nMyObjects; i++)
|
||||||
|
{
|
||||||
|
checkOut(*myObjects[i]);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
void Foam::objectRegistry::rename(const word& newName)
|
void Foam::objectRegistry::rename(const word& newName)
|
||||||
{
|
{
|
||||||
regIOobject::rename(newName);
|
regIOobject::rename(newName);
|
||||||
|
|||||||
@ -2,7 +2,7 @@
|
|||||||
========= |
|
========= |
|
||||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||||
\\ / O peration |
|
\\ / O peration |
|
||||||
\\ / A nd | Copyright (C) 2011-2017 OpenFOAM Foundation
|
\\ / A nd | Copyright (C) 2011-2018 OpenFOAM Foundation
|
||||||
\\/ M anipulation |
|
\\/ M anipulation |
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
License
|
License
|
||||||
@ -199,6 +199,10 @@ public:
|
|||||||
//- Remove an regIOobject from registry
|
//- Remove an regIOobject from registry
|
||||||
bool checkOut(regIOobject&) const;
|
bool checkOut(regIOobject&) const;
|
||||||
|
|
||||||
|
//- Remove all regIOobject owned by the registry
|
||||||
|
void clear();
|
||||||
|
|
||||||
|
|
||||||
// Reading
|
// Reading
|
||||||
|
|
||||||
//- Return true if any of the object's files have been modified
|
//- Return true if any of the object's files have been modified
|
||||||
|
|||||||
Reference in New Issue
Block a user