Skip to content
Snippets Groups Projects
Commit def4e2b7 authored by Mark OLESEN's avatar Mark OLESEN Committed by Andrew Heather
Browse files

STYLE: remove unneeded regIOobject release (#1276)

- changed for 1906 to have a regIOobject always cleanup its
  objectRegistry entry. No need to explicitly 'release' ownership
  for this to now happen.

- doxygen formatting for MeshObject
parent 1b7b9eab
Branches
Tags
No related merge requests found
......@@ -101,16 +101,6 @@ bool Foam::MeshObject<Mesh, MeshObjectType, Type>::Delete(const Mesh& mesh)
}
template<class Mesh, template<class> class MeshObjectType, class Type>
Foam::MeshObject<Mesh, MeshObjectType, Type>::~MeshObject()
{
// We should not do a 'release' at this point since that will upset
// the destructor of regIOobject itself (which gets called after this).
// However this is only a problem for Time-based MeshObject.
MeshObjectType<Mesh>::release();
}
template<class Mesh>
void Foam::meshObject::movePoints(objectRegistry& obr)
{
......
......@@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2018 OpenCFD Ltd.
\\ / A nd | Copyright (C) 2018-2019 OpenCFD Ltd.
\\/ M anipulation |
-------------------------------------------------------------------------------
| Copyright (C) 2011-2016 OpenFOAM Foundation
......@@ -100,6 +100,7 @@ public:
// Constructors
//- Construct on Mesh type
explicit MeshObject(const Mesh& mesh);
// Selectors
......@@ -110,7 +111,7 @@ public:
//- Destructor
virtual ~MeshObject();
virtual ~MeshObject() = default;
//- Static destructor
static bool Delete(const Mesh& mesh);
......@@ -123,7 +124,7 @@ public:
return mesh_;
}
virtual bool writeData(Foam::Ostream&) const
virtual bool writeData(Ostream& os) const
{
return true;
}
......@@ -145,29 +146,31 @@ public:
// Constructors
//- Construct from name and instance on registry
meshObject(const word& typeName, const objectRegistry& obr);
// Static member functions
// Static Member Functions
template<class Mesh>
static void movePoints(objectRegistry&);
static void movePoints(objectRegistry& obr);
template<class Mesh>
static void updateMesh(objectRegistry&, const mapPolyMesh&);
static void updateMesh(objectRegistry& obr, const mapPolyMesh& mpm);
template<class Mesh, template<class> class MeshObjectType>
static void clear(objectRegistry&);
static void clear(objectRegistry& obr);
//- Clear all meshObject derived from FromType up to (but not including)
// ToType. Used to clear e.g. all non-updateable meshObjects
//- Clear all meshObject derived from FromType up to
//- (but not including) ToType.
// Used to clear e.g. all non-updateable meshObjects
template
<
class Mesh,
template<class> class FromType,
template<class> class ToType
>
static void clearUpto(objectRegistry&);
static void clearUpto(objectRegistry& obr);
};
......@@ -182,6 +185,7 @@ class TopologicalMeshObject
{
public:
//- Construct from name and instance on registry
TopologicalMeshObject(const word& typeName, const objectRegistry& obr)
:
meshObject(typeName, obr)
......@@ -200,6 +204,7 @@ class GeometricMeshObject
{
public:
//- Construct from name and instance on registry
GeometricMeshObject(const word& typeName, const objectRegistry& obr)
:
TopologicalMeshObject<Mesh>(typeName, obr)
......@@ -218,6 +223,7 @@ class MoveableMeshObject
{
public:
//- Construct from name and instance on registry
MoveableMeshObject(const word& typeName, const objectRegistry& obr)
:
GeometricMeshObject<Mesh>(typeName, obr)
......@@ -238,6 +244,7 @@ class UpdateableMeshObject
{
public:
//- Construct from name and instance on registry
UpdateableMeshObject(const word& typeName, const objectRegistry& obr)
:
MoveableMeshObject<Mesh>(typeName, obr)
......
......@@ -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) 2013 OpenFOAM Foundation
......
......@@ -100,7 +100,6 @@ Foam::fv::gradScheme<Type>::grad
if (pgGrad && pgGrad->ownedByRegistry())
{
solution::cachePrintMessage("Deleting", name, vsf);
pgGrad->release();
delete pgGrad;
}
......@@ -125,7 +124,6 @@ Foam::fv::gradScheme<Type>::grad
else
{
solution::cachePrintMessage("Updating", name, vsf);
pgGrad->release();
delete pgGrad;
pgGrad = calcGrad(vsf, name).ptr();
......
......@@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2016 OpenCFD Ltd.
\\ / A nd | Copyright (C) 2016-2019 OpenCFD Ltd.
\\/ M anipulation |
-------------------------------------------------------------------------------
| Copyright (C) 2011-2017 OpenFOAM Foundation
......@@ -435,7 +435,6 @@ Foam::volPointInterpolation::interpolate
if (pfPtr && pfPtr->ownedByRegistry())
{
solution::cachePrintMessage("Deleting", name, vf);
pfPtr->release();
delete pfPtr;
}
......@@ -533,7 +532,6 @@ Foam::volPointInterpolation::interpolate
if (pfPtr && pfPtr->ownedByRegistry())
{
solution::cachePrintMessage("Deleting", name, vf);
pfPtr->release();
delete pfPtr;
}
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment