mirror of
https://develop.openfoam.com/Development/openfoam.git
synced 2025-11-28 03:28:01 +00:00
STYLE: check autoPtr as plain bool instead of valid()
- cleaner code, more similarity with unique_ptr
Now
if (ptr)
if (!ptr)
instead
if (ptr.valid())
if (!ptr.valid())
This commit is contained in:
@ -6,7 +6,7 @@
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
Copyright (C) 2011-2016 OpenFOAM Foundation
|
||||
Copyright (C) 2019 OpenCFD Ltd.
|
||||
Copyright (C) 2019-2020 OpenCFD Ltd.
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
This file is part of OpenFOAM.
|
||||
@ -334,7 +334,7 @@ bool Foam::domainDecomposition::writeDecomposition(const bool decomposeSets)
|
||||
|
||||
autoPtr<polyMesh> procMeshPtr;
|
||||
|
||||
if (facesInstancePointsPtr_.valid())
|
||||
if (facesInstancePointsPtr_)
|
||||
{
|
||||
// Construct mesh from facesInstance.
|
||||
pointField facesInstancePoints
|
||||
@ -738,7 +738,7 @@ bool Foam::domainDecomposition::writeDecomposition(const bool decomposeSets)
|
||||
procMesh.write();
|
||||
|
||||
// Write points if pointsInstance differing from facesInstance
|
||||
if (facesInstancePointsPtr_.valid())
|
||||
if (facesInstancePointsPtr_)
|
||||
{
|
||||
pointIOField pointsInstancePoints
|
||||
(
|
||||
|
||||
@ -672,9 +672,9 @@ void readFields
|
||||
// Load field (but not oldTime)
|
||||
readField(io, mesh, i, fields);
|
||||
// Create zero sized field and send
|
||||
if (subsetterPtr.valid())
|
||||
if (subsetterPtr)
|
||||
{
|
||||
tmp<GeoField> tsubfld = subsetterPtr().interpolate(fields[i]);
|
||||
tmp<GeoField> tsubfld = subsetterPtr->interpolate(fields[i]);
|
||||
|
||||
// Send to all processors that don't have a mesh
|
||||
for (label procI = 1; procI < Pstream::nProcs(); ++procI)
|
||||
@ -1803,7 +1803,7 @@ void reconstructLagrangian
|
||||
|
||||
if (cloudNames.size())
|
||||
{
|
||||
if (!lagrangianReconstructorPtr.valid())
|
||||
if (!lagrangianReconstructorPtr)
|
||||
{
|
||||
lagrangianReconstructorPtr.reset
|
||||
(
|
||||
@ -2116,7 +2116,7 @@ void redistributeLagrangian
|
||||
{
|
||||
if (clouds.size())
|
||||
{
|
||||
if (!lagrangianReconstructorPtr.valid())
|
||||
if (!lagrangianReconstructorPtr)
|
||||
{
|
||||
lagrangianReconstructorPtr.reset
|
||||
(
|
||||
@ -2804,7 +2804,7 @@ int main(int argc, char *argv[])
|
||||
Info<< " Detected topology change;"
|
||||
<< " reconstructing addressing" << nl << endl;
|
||||
|
||||
if (baseMeshPtr.valid())
|
||||
if (baseMeshPtr)
|
||||
{
|
||||
// Cannot do a baseMesh::readUpdate() since not all
|
||||
// processors will have mesh files. So instead just
|
||||
|
||||
Reference in New Issue
Block a user