mirror of
https://develop.openfoam.com/Development/openfoam.git
synced 2025-11-28 03:28:01 +00:00
C++11: Replaced the C NULL with the safer C++11 nullptr
Requires gcc version 4.7 or higher
This commit is contained in:
@ -2,7 +2,7 @@
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation
|
||||
\\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
@ -58,10 +58,10 @@ vtkPV3FoamReader::vtkPV3FoamReader()
|
||||
|
||||
SetNumberOfInputPorts(0);
|
||||
|
||||
FileName = NULL;
|
||||
foamData_ = NULL;
|
||||
FileName = nullptr;
|
||||
foamData_ = nullptr;
|
||||
|
||||
output0_ = NULL;
|
||||
output0_ = nullptr;
|
||||
|
||||
#ifdef VTKPV3FOAM_DUALPORT
|
||||
// Add second output for the Lagrangian
|
||||
@ -217,7 +217,7 @@ int vtkPV3FoamReader::RequestInformation
|
||||
|
||||
// delete foamData and flag it as fatal error
|
||||
delete foamData_;
|
||||
foamData_ = NULL;
|
||||
foamData_ = nullptr;
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
@ -86,7 +86,7 @@ void Foam::vtkPV3Foam::reduceMemory()
|
||||
if (!reader_->GetCacheMesh())
|
||||
{
|
||||
delete meshPtr_;
|
||||
meshPtr_ = NULL;
|
||||
meshPtr_ = nullptr;
|
||||
}
|
||||
}
|
||||
|
||||
@ -226,8 +226,8 @@ Foam::vtkPV3Foam::vtkPV3Foam
|
||||
)
|
||||
:
|
||||
reader_(reader),
|
||||
dbPtr_(NULL),
|
||||
meshPtr_(NULL),
|
||||
dbPtr_(nullptr),
|
||||
meshPtr_(nullptr),
|
||||
meshRegion_(polyMesh::defaultRegion),
|
||||
meshDir_(polyMesh::meshSubDir),
|
||||
timeIndex_(-1),
|
||||
@ -347,7 +347,7 @@ void Foam::vtkPV3Foam::updateInfo()
|
||||
if (debug)
|
||||
{
|
||||
Info<< "<beg> Foam::vtkPV3Foam::updateInfo"
|
||||
<< " [meshPtr=" << (meshPtr_ ? "set" : "NULL") << "] timeIndex="
|
||||
<< " [meshPtr=" << (meshPtr_ ? "set" : "nullptr") << "] timeIndex="
|
||||
<< timeIndex_ << endl;
|
||||
}
|
||||
|
||||
@ -426,7 +426,7 @@ void Foam::vtkPV3Foam::updateFoamMesh()
|
||||
if (!reader_->GetCacheMesh())
|
||||
{
|
||||
delete meshPtr_;
|
||||
meshPtr_ = NULL;
|
||||
meshPtr_ = nullptr;
|
||||
}
|
||||
|
||||
// Check to see if the OpenFOAM mesh has been created
|
||||
@ -551,7 +551,7 @@ void Foam::vtkPV3Foam::CleanUp()
|
||||
double* Foam::vtkPV3Foam::findTimes(int& nTimeSteps)
|
||||
{
|
||||
int nTimes = 0;
|
||||
double* tsteps = NULL;
|
||||
double* tsteps = nullptr;
|
||||
|
||||
if (dbPtr_.valid())
|
||||
{
|
||||
|
||||
@ -2,7 +2,7 @@
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 2011-2013 OpenFOAM Foundation
|
||||
\\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
@ -190,7 +190,7 @@ void Foam::vtkPV3Foam::convertMeshPatches
|
||||
<< patchName << endl;
|
||||
}
|
||||
|
||||
vtkPolyData* vtkmesh = NULL;
|
||||
vtkPolyData* vtkmesh = nullptr;
|
||||
if (patchIds.size() == 1)
|
||||
{
|
||||
vtkmesh = patchVTKMesh(patchName, patches[patchIds.begin().key()]);
|
||||
|
||||
@ -2,7 +2,7 @@
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 2011-2013 OpenFOAM Foundation
|
||||
\\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
@ -45,7 +45,7 @@ vtkPolyData* Foam::vtkPV3Foam::lagrangianVTKMesh
|
||||
const word& cloudName
|
||||
)
|
||||
{
|
||||
vtkPolyData* vtkmesh = NULL;
|
||||
vtkPolyData* vtkmesh = nullptr;
|
||||
|
||||
if (debug)
|
||||
{
|
||||
|
||||
@ -228,7 +228,7 @@ void Foam::vtkPV3Foam::updateInfoPatches
|
||||
if (debug)
|
||||
{
|
||||
Info<< "<beg> Foam::vtkPV3Foam::updateInfoPatches"
|
||||
<< " [meshPtr=" << (meshPtr_ ? "set" : "NULL") << "]" << endl;
|
||||
<< " [meshPtr=" << (meshPtr_ ? "set" : "nullptr") << "]" << endl;
|
||||
}
|
||||
|
||||
|
||||
@ -476,7 +476,7 @@ void Foam::vtkPV3Foam::updateInfoZones
|
||||
if (debug)
|
||||
{
|
||||
Info<< "<beg> Foam::vtkPV3Foam::updateInfoZones"
|
||||
<< " [meshPtr=" << (meshPtr_ ? "set" : "NULL") << "]" << endl;
|
||||
<< " [meshPtr=" << (meshPtr_ ? "set" : "nullptr") << "]" << endl;
|
||||
}
|
||||
|
||||
wordList namesLst;
|
||||
|
||||
@ -41,7 +41,7 @@ void Foam::vtkPV3Foam::updateInfoFields
|
||||
{
|
||||
Info<< "<beg> Foam::vtkPV3Foam::updateInfoFields <"
|
||||
<< meshType::Mesh::typeName
|
||||
<< "> [meshPtr=" << (meshPtr_ ? "set" : "NULL") << "]"
|
||||
<< "> [meshPtr=" << (meshPtr_ ? "set" : "nullptr") << "]"
|
||||
<< endl;
|
||||
}
|
||||
|
||||
|
||||
@ -2,7 +2,7 @@
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 2011 OpenFOAM Foundation
|
||||
\\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
@ -56,8 +56,8 @@ vtkPV3blockMeshReader::vtkPV3blockMeshReader()
|
||||
|
||||
SetNumberOfInputPorts(0);
|
||||
|
||||
FileName = NULL;
|
||||
foamData_ = NULL;
|
||||
FileName = nullptr;
|
||||
foamData_ = nullptr;
|
||||
|
||||
ShowPointNumbers = 1;
|
||||
UpdateGUI = 0;
|
||||
@ -165,7 +165,7 @@ int vtkPV3blockMeshReader::RequestInformation
|
||||
//
|
||||
// // delete foamData and flag it as fatal error
|
||||
// delete foamData_;
|
||||
// foamData_ = NULL;
|
||||
// foamData_ = nullptr;
|
||||
// return 0;
|
||||
// }
|
||||
|
||||
|
||||
@ -66,7 +66,7 @@ void Foam::vtkPV3blockMesh::updateInfoBlocks
|
||||
if (debug)
|
||||
{
|
||||
Info<< "<beg> Foam::vtkPV3blockMesh::updateInfoBlocks"
|
||||
<< " [meshPtr=" << (meshPtr_ ? "set" : "NULL") << "]" << endl;
|
||||
<< " [meshPtr=" << (meshPtr_ ? "set" : "nullptr") << "]" << endl;
|
||||
}
|
||||
|
||||
arrayRangeBlocks_.reset( arraySelection->GetNumberOfArrays() );
|
||||
@ -109,7 +109,7 @@ void Foam::vtkPV3blockMesh::updateInfoEdges
|
||||
if (debug)
|
||||
{
|
||||
Info<< "<beg> Foam::vtkPV3blockMesh::updateInfoEdges"
|
||||
<< " [meshPtr=" << (meshPtr_ ? "set" : "NULL") << "]" << endl;
|
||||
<< " [meshPtr=" << (meshPtr_ ? "set" : "nullptr") << "]" << endl;
|
||||
}
|
||||
|
||||
arrayRangeEdges_.reset( arraySelection->GetNumberOfArrays() );
|
||||
@ -150,8 +150,8 @@ Foam::vtkPV3blockMesh::vtkPV3blockMesh
|
||||
)
|
||||
:
|
||||
reader_(reader),
|
||||
dbPtr_(NULL),
|
||||
meshPtr_(NULL),
|
||||
dbPtr_(nullptr),
|
||||
meshPtr_(nullptr),
|
||||
meshRegion_(polyMesh::defaultRegion),
|
||||
meshDir_(polyMesh::meshSubDir),
|
||||
arrayRangeBlocks_("block"),
|
||||
@ -269,7 +269,7 @@ void Foam::vtkPV3blockMesh::updateInfo()
|
||||
if (debug)
|
||||
{
|
||||
Info<< "<beg> Foam::vtkPV3blockMesh::updateInfo"
|
||||
<< " [meshPtr=" << (meshPtr_ ? "set" : "NULL") << "] " << endl;
|
||||
<< " [meshPtr=" << (meshPtr_ ? "set" : "nullptr") << "] " << endl;
|
||||
}
|
||||
|
||||
resetCounters();
|
||||
|
||||
@ -58,10 +58,10 @@ vtkPVFoamReader::vtkPVFoamReader()
|
||||
|
||||
SetNumberOfInputPorts(0);
|
||||
|
||||
FileName = NULL;
|
||||
foamData_ = NULL;
|
||||
FileName = nullptr;
|
||||
foamData_ = nullptr;
|
||||
|
||||
output0_ = NULL;
|
||||
output0_ = nullptr;
|
||||
|
||||
#ifdef VTKPVFOAM_DUALPORT
|
||||
// Add second output for the Lagrangian
|
||||
@ -217,7 +217,7 @@ int vtkPVFoamReader::RequestInformation
|
||||
|
||||
// delete foamData and flag it as fatal error
|
||||
delete foamData_;
|
||||
foamData_ = NULL;
|
||||
foamData_ = nullptr;
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
@ -86,7 +86,7 @@ void Foam::vtkPVFoam::reduceMemory()
|
||||
if (!reader_->GetCacheMesh())
|
||||
{
|
||||
delete meshPtr_;
|
||||
meshPtr_ = NULL;
|
||||
meshPtr_ = nullptr;
|
||||
}
|
||||
}
|
||||
|
||||
@ -226,8 +226,8 @@ Foam::vtkPVFoam::vtkPVFoam
|
||||
)
|
||||
:
|
||||
reader_(reader),
|
||||
dbPtr_(NULL),
|
||||
meshPtr_(NULL),
|
||||
dbPtr_(nullptr),
|
||||
meshPtr_(nullptr),
|
||||
meshRegion_(polyMesh::defaultRegion),
|
||||
meshDir_(polyMesh::meshSubDir),
|
||||
timeIndex_(-1),
|
||||
@ -347,7 +347,7 @@ void Foam::vtkPVFoam::updateInfo()
|
||||
if (debug)
|
||||
{
|
||||
Info<< "<beg> Foam::vtkPVFoam::updateInfo"
|
||||
<< " [meshPtr=" << (meshPtr_ ? "set" : "NULL") << "] timeIndex="
|
||||
<< " [meshPtr=" << (meshPtr_ ? "set" : "nullptr") << "] timeIndex="
|
||||
<< timeIndex_ << endl;
|
||||
}
|
||||
|
||||
@ -426,7 +426,7 @@ void Foam::vtkPVFoam::updateFoamMesh()
|
||||
if (!reader_->GetCacheMesh())
|
||||
{
|
||||
delete meshPtr_;
|
||||
meshPtr_ = NULL;
|
||||
meshPtr_ = nullptr;
|
||||
}
|
||||
|
||||
// Check to see if the OpenFOAM mesh has been created
|
||||
@ -551,7 +551,7 @@ void Foam::vtkPVFoam::CleanUp()
|
||||
double* Foam::vtkPVFoam::findTimes(int& nTimeSteps)
|
||||
{
|
||||
int nTimes = 0;
|
||||
double* tsteps = NULL;
|
||||
double* tsteps = nullptr;
|
||||
|
||||
if (dbPtr_.valid())
|
||||
{
|
||||
|
||||
@ -188,7 +188,7 @@ void Foam::vtkPVFoam::convertMeshPatches
|
||||
<< patchName << endl;
|
||||
}
|
||||
|
||||
vtkPolyData* vtkmesh = NULL;
|
||||
vtkPolyData* vtkmesh = nullptr;
|
||||
if (patchIds.size() == 1)
|
||||
{
|
||||
vtkmesh = patchVTKMesh(patchName, patches[patchIds.begin().key()]);
|
||||
|
||||
@ -45,7 +45,7 @@ vtkPolyData* Foam::vtkPVFoam::lagrangianVTKMesh
|
||||
const word& cloudName
|
||||
)
|
||||
{
|
||||
vtkPolyData* vtkmesh = NULL;
|
||||
vtkPolyData* vtkmesh = nullptr;
|
||||
|
||||
if (debug)
|
||||
{
|
||||
|
||||
@ -228,7 +228,7 @@ void Foam::vtkPVFoam::updateInfoPatches
|
||||
if (debug)
|
||||
{
|
||||
Info<< "<beg> Foam::vtkPVFoam::updateInfoPatches"
|
||||
<< " [meshPtr=" << (meshPtr_ ? "set" : "NULL") << "]" << endl;
|
||||
<< " [meshPtr=" << (meshPtr_ ? "set" : "nullptr") << "]" << endl;
|
||||
}
|
||||
|
||||
|
||||
@ -476,7 +476,7 @@ void Foam::vtkPVFoam::updateInfoZones
|
||||
if (debug)
|
||||
{
|
||||
Info<< "<beg> Foam::vtkPVFoam::updateInfoZones"
|
||||
<< " [meshPtr=" << (meshPtr_ ? "set" : "NULL") << "]" << endl;
|
||||
<< " [meshPtr=" << (meshPtr_ ? "set" : "nullptr") << "]" << endl;
|
||||
}
|
||||
|
||||
wordList namesLst;
|
||||
|
||||
@ -41,7 +41,7 @@ void Foam::vtkPVFoam::updateInfoFields
|
||||
{
|
||||
Info<< "<beg> Foam::vtkPVFoam::updateInfoFields <"
|
||||
<< meshType::Mesh::typeName
|
||||
<< "> [meshPtr=" << (meshPtr_ ? "set" : "NULL") << "]"
|
||||
<< "> [meshPtr=" << (meshPtr_ ? "set" : "nullptr") << "]"
|
||||
<< endl;
|
||||
}
|
||||
|
||||
|
||||
@ -56,8 +56,8 @@ vtkPVblockMeshReader::vtkPVblockMeshReader()
|
||||
|
||||
SetNumberOfInputPorts(0);
|
||||
|
||||
FileName = NULL;
|
||||
foamData_ = NULL;
|
||||
FileName = nullptr;
|
||||
foamData_ = nullptr;
|
||||
|
||||
ShowPointNumbers = 1;
|
||||
UpdateGUI = 0;
|
||||
@ -165,7 +165,7 @@ int vtkPVblockMeshReader::RequestInformation
|
||||
//
|
||||
// // delete foamData and flag it as fatal error
|
||||
// delete foamData_;
|
||||
// foamData_ = NULL;
|
||||
// foamData_ = nullptr;
|
||||
// return 0;
|
||||
// }
|
||||
|
||||
|
||||
@ -66,7 +66,7 @@ void Foam::vtkPVblockMesh::updateInfoBlocks
|
||||
if (debug)
|
||||
{
|
||||
Info<< "<beg> Foam::vtkPVblockMesh::updateInfoBlocks"
|
||||
<< " [meshPtr=" << (meshPtr_ ? "set" : "NULL") << "]" << endl;
|
||||
<< " [meshPtr=" << (meshPtr_ ? "set" : "nullptr") << "]" << endl;
|
||||
}
|
||||
|
||||
arrayRangeBlocks_.reset( arraySelection->GetNumberOfArrays() );
|
||||
@ -109,7 +109,7 @@ void Foam::vtkPVblockMesh::updateInfoEdges
|
||||
if (debug)
|
||||
{
|
||||
Info<< "<beg> Foam::vtkPVblockMesh::updateInfoEdges"
|
||||
<< " [meshPtr=" << (meshPtr_ ? "set" : "NULL") << "]" << endl;
|
||||
<< " [meshPtr=" << (meshPtr_ ? "set" : "nullptr") << "]" << endl;
|
||||
}
|
||||
|
||||
arrayRangeEdges_.reset( arraySelection->GetNumberOfArrays() );
|
||||
@ -150,8 +150,8 @@ Foam::vtkPVblockMesh::vtkPVblockMesh
|
||||
)
|
||||
:
|
||||
reader_(reader),
|
||||
dbPtr_(NULL),
|
||||
meshPtr_(NULL),
|
||||
dbPtr_(nullptr),
|
||||
meshPtr_(nullptr),
|
||||
meshRegion_(polyMesh::defaultRegion),
|
||||
meshDir_(polyMesh::meshSubDir),
|
||||
arrayRangeBlocks_("block"),
|
||||
@ -269,7 +269,7 @@ void Foam::vtkPVblockMesh::updateInfo()
|
||||
if (debug)
|
||||
{
|
||||
Info<< "<beg> Foam::vtkPVblockMesh::updateInfo"
|
||||
<< " [meshPtr=" << (meshPtr_ ? "set" : "NULL") << "] " << endl;
|
||||
<< " [meshPtr=" << (meshPtr_ ? "set" : "nullptr") << "] " << endl;
|
||||
}
|
||||
|
||||
resetCounters();
|
||||
|
||||
Reference in New Issue
Block a user