Commit e426bad6 authored by Mark Olesen's avatar Mark Olesen

STYLE: check autoPtr directly instead of using valid() method

parent 07cd1156
......@@ -5,7 +5,7 @@
\\ / A nd | www.openfoam.com
\\/ M anipulation |
-------------------------------------------------------------------------------
Copyright (C) 2018 OpenCFD Ltd.
Copyright (C) 2018-2020 OpenCFD Ltd.
Copyright (C) 2018 CINECA
-------------------------------------------------------------------------------
License
......@@ -203,9 +203,9 @@ bool Foam::functionObjects::catalystFunctionObject::read(const dictionary& dict)
osha1.reset();
osha1 << outputDir_ << scripts_;
if (adaptor_.valid() && oldDigest != osha1.digest())
if (adaptor_ && oldDigest != osha1.digest())
{
adaptor_().reset(outputDir_, scripts_);
adaptor_->reset(outputDir_, scripts_);
}
......@@ -278,10 +278,10 @@ bool Foam::functionObjects::catalystFunctionObject::execute()
sigFpe::ignore sigFpeHandling; //<- disable in local scope
if (!adaptor_.valid())
if (!adaptor_)
{
adaptor_.reset(new catalyst::coprocess());
adaptor_().reset(outputDir_, scripts_);
adaptor_->reset(outputDir_, scripts_);
}
catalyst::dataQuery dataq(time_);
......@@ -378,7 +378,7 @@ bool Foam::functionObjects::catalystFunctionObject::write()
bool Foam::functionObjects::catalystFunctionObject::end()
{
// Only here for extra feedback
if (log && adaptor_.valid())
if (log && adaptor_)
{
Info<< type() << ": Disconnecting ParaView Catalyst..." << nl;
}
......
......@@ -5,7 +5,7 @@
\\ / A nd | www.openfoam.com
\\/ M anipulation |
-------------------------------------------------------------------------------
Copyright (C) 2017-2019 OpenCFD Ltd.
Copyright (C) 2017-2020 OpenCFD Ltd.
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
......@@ -223,7 +223,7 @@ void Foam::vtk::fvMeshAdaptor::convertVolFieldInternal
vtuData.convertField(fld)
);
if (ptfPtr.valid())
if (ptfPtr)
{
dataset->GetPointData()->AddArray
(
......
......@@ -6,7 +6,7 @@
\\/ M anipulation |
-------------------------------------------------------------------------------
Copyright (C) 2011-2016 OpenFOAM Foundation
Copyright (C) 2017-2019 OpenCFD Ltd.
Copyright (C) 2017-2020 OpenCFD Ltd.
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
......@@ -560,7 +560,7 @@ void Foam::vtkPVblockMesh::PrintSelf(ostream& os, vtkIndent indent) const
<< (meshPtr_ ? meshPtr_->nCells() : 0) << "\n";
os << indent << "Number of available time steps: "
<< (dbPtr_.valid() ? dbPtr_().times().size() : 0) << endl;
<< (dbPtr_ ? dbPtr_->times().size() : 0) << endl;
#endif
}
......
......@@ -6,7 +6,7 @@
\\/ M anipulation |
-------------------------------------------------------------------------------
Copyright (C) 2011-2016 OpenFOAM Foundation
Copyright (C) 2017-2019 OpenCFD Ltd.
Copyright (C) 2017-2020 OpenCFD Ltd.
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
......@@ -713,7 +713,7 @@ std::vector<double> Foam::vtkPVFoam::findTimes(const bool skipZero) const
{
std::vector<double> times;
if (dbPtr_.valid())
if (dbPtr_)
{
const Time& runTime = dbPtr_();
// Get times list. Flush first to force refresh.
......@@ -948,7 +948,7 @@ void Foam::vtkPVFoam::PrintSelf(ostream& os, vtkIndent indent) const
<< (volMeshPtr_ ? volMeshPtr_->nCells() : 0) << "\n";
os << indent << "Number of available time steps: "
<< (dbPtr_.valid() ? dbPtr_().times().size() : 0) << "\n";
<< (dbPtr_ ? dbPtr_->times().size() : 0) << "\n";
os << indent << "mesh region: " << meshRegion_ << "\n";
}
......@@ -961,7 +961,7 @@ void Foam::vtkPVFoam::printInfo() const
<< "nPoints: " << (volMeshPtr_ ? volMeshPtr_->nPoints() : 0) << "\n"
<< "nCells: " << (volMeshPtr_ ? volMeshPtr_->nCells() : 0) << "\n"
<< "nTimes: "
<< (dbPtr_.valid() ? dbPtr_().times().size() : 0) << "\n";
<< (dbPtr_ ? dbPtr_->times().size() : 0) << "\n";
std::vector<double> times = this->findTimes(reader_->GetSkipZeroTime());
......
......@@ -5,7 +5,7 @@
\\ / A nd | www.openfoam.com
\\/ M anipulation |
-------------------------------------------------------------------------------
Copyright (C) 2017-2019 OpenCFD Ltd.
Copyright (C) 2017-2020 OpenCFD Ltd.
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
......@@ -421,7 +421,7 @@ void Foam::vtkPVFoam::convertVolFieldBlock
vtuData.convertField(fld)
);
if (ptfPtr.valid())
if (ptfPtr)
{
dataset->GetPointData()->AddArray
(
......
Markdown is supported
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