diff --git a/applications/solvers/compressible/steadyUniversalFoam/createThermo.H b/applications/solvers/compressible/steadyUniversalFoam/createThermo.H index 1c9e0c7f6..5d5c88af1 100644 --- a/applications/solvers/compressible/steadyUniversalFoam/createThermo.H +++ b/applications/solvers/compressible/steadyUniversalFoam/createThermo.H @@ -1,11 +1,11 @@ Info<< "Reading thermophysical properties\n" << endl; - volScalarField* pPtr = NULL; - volScalarField* hPtr = NULL; - const volScalarField* TPtr = NULL; + volScalarField* pPtr = nullptr; + volScalarField* hPtr = nullptr; + const volScalarField* TPtr = nullptr; - volScalarField* psisPtr = NULL; - basicThermo* thermoPtr = NULL; + volScalarField* psisPtr = nullptr; + basicThermo* thermoPtr = nullptr; Switch compressible; diff --git a/applications/solvers/compressible/steadyUniversalMRFFoam/createThermo.H b/applications/solvers/compressible/steadyUniversalMRFFoam/createThermo.H index 1c9e0c7f6..5d5c88af1 100644 --- a/applications/solvers/compressible/steadyUniversalMRFFoam/createThermo.H +++ b/applications/solvers/compressible/steadyUniversalMRFFoam/createThermo.H @@ -1,11 +1,11 @@ Info<< "Reading thermophysical properties\n" << endl; - volScalarField* pPtr = NULL; - volScalarField* hPtr = NULL; - const volScalarField* TPtr = NULL; + volScalarField* pPtr = nullptr; + volScalarField* hPtr = nullptr; + const volScalarField* TPtr = nullptr; - volScalarField* psisPtr = NULL; - basicThermo* thermoPtr = NULL; + volScalarField* psisPtr = nullptr; + basicThermo* thermoPtr = nullptr; Switch compressible; diff --git a/applications/solvers/multiphase/multiphaseInterFoam/multiphaseMixture/phase/phase.C b/applications/solvers/multiphase/multiphaseInterFoam/multiphaseMixture/phase/phase.C index cf813edc5..9126bedcb 100644 --- a/applications/solvers/multiphase/multiphaseInterFoam/multiphaseMixture/phase/phase.C +++ b/applications/solvers/multiphase/multiphaseInterFoam/multiphaseMixture/phase/phase.C @@ -59,7 +59,7 @@ Foam::phase::phase Foam::autoPtr Foam::phase::clone() const { notImplemented("phase::clone() const"); - return autoPtr(NULL); + return autoPtr(nullptr); } diff --git a/applications/solvers/multiphase/porousInterFoam/alphaEqn.H b/applications/solvers/multiphase/porousInterFoam/alphaEqn.H index 2d8b15c6f..82fb63a36 100644 --- a/applications/solvers/multiphase/porousInterFoam/alphaEqn.H +++ b/applications/solvers/multiphase/porousInterFoam/alphaEqn.H @@ -11,7 +11,7 @@ IOobject::NO_WRITE ), mesh, - dimensionedScalar("NULL", dimless, 1.0), + dimensionedScalar("nullptr", dimless, 1.0), "zeroGradient" ); diff --git a/applications/solvers/multiphase/porousInterFoam/createPorousZones.H b/applications/solvers/multiphase/porousInterFoam/createPorousZones.H index a386cec4f..4ff283ae2 100644 --- a/applications/solvers/multiphase/porousInterFoam/createPorousZones.H +++ b/applications/solvers/multiphase/porousInterFoam/createPorousZones.H @@ -12,7 +12,7 @@ IOobject::NO_WRITE ), mesh, - dimensionedScalar("NULL", dimless, 1.0), + dimensionedScalar("nullptr", dimless, 1.0), "zeroGradient" ); diff --git a/applications/solvers/solidMechanics/deprecatedSolvers/materialModels/fvPatchFields/cohesiveLaw/cohesiveLawFvPatchVectorField.C b/applications/solvers/solidMechanics/deprecatedSolvers/materialModels/fvPatchFields/cohesiveLaw/cohesiveLawFvPatchVectorField.C index 72e96d3c8..51f0fd8e5 100644 --- a/applications/solvers/solidMechanics/deprecatedSolvers/materialModels/fvPatchFields/cohesiveLaw/cohesiveLawFvPatchVectorField.C +++ b/applications/solvers/solidMechanics/deprecatedSolvers/materialModels/fvPatchFields/cohesiveLaw/cohesiveLawFvPatchVectorField.C @@ -44,7 +44,7 @@ cohesiveLawFvPatchVectorField::cohesiveLawFvPatchVectorField ) : fixedGradientFvPatchVectorField(p, iF), - cohesiveLawPtr_(NULL), + cohesiveLawPtr_(nullptr), relaxationFactor_(1.0), traction_(p.size(), vector::zero) {} @@ -131,10 +131,10 @@ void cohesiveLawFvPatchVectorField::autoMap const fvPatchFieldMapper& m ) { - if (cohesiveLawPtr_ == NULL) + if (cohesiveLawPtr_ == nullptr) { FatalErrorIn("cohesiveFvPatchVectorField::autoMap") - << "NULL cohesive law" + << "nullptr cohesive law" << abort(FatalError); } diff --git a/applications/solvers/solidMechanics/deprecatedSolvers/materialModels/fvPatchFields/cohesiveZone/cohesiveZoneFvPatchVectorField.C b/applications/solvers/solidMechanics/deprecatedSolvers/materialModels/fvPatchFields/cohesiveZone/cohesiveZoneFvPatchVectorField.C index 07d2ca4e3..ccbfe4a75 100644 --- a/applications/solvers/solidMechanics/deprecatedSolvers/materialModels/fvPatchFields/cohesiveZone/cohesiveZoneFvPatchVectorField.C +++ b/applications/solvers/solidMechanics/deprecatedSolvers/materialModels/fvPatchFields/cohesiveZone/cohesiveZoneFvPatchVectorField.C @@ -53,7 +53,7 @@ cohesiveZoneFvPatchVectorField::cohesiveZoneFvPatchVectorField directionMixedFvPatchVectorField(p, iF), UName_("undefined"), rheologyName_("undefined"), - cohesiveLawPtr_(NULL), + cohesiveLawPtr_(nullptr), relaxationFactor_(1.0) {} @@ -161,10 +161,10 @@ void cohesiveZoneFvPatchVectorField::autoMap const fvPatchFieldMapper& m ) { - if (cohesiveLawPtr_ == NULL) + if (cohesiveLawPtr_ == nullptr) { FatalErrorIn("cohesiveZoneFvPatchVectorField::autoMap") - << "NULL cohesive law" + << "nullptr cohesive law" << abort(FatalError); } diff --git a/applications/solvers/solidMechanics/deprecatedSolvers/solidDisplacementFoam/createFields.H b/applications/solvers/solidMechanics/deprecatedSolvers/solidDisplacementFoam/createFields.H index ff3cd1450..c80f5f7f0 100644 --- a/applications/solvers/solidMechanics/deprecatedSolvers/solidDisplacementFoam/createFields.H +++ b/applications/solvers/solidMechanics/deprecatedSolvers/solidDisplacementFoam/createFields.H @@ -13,7 +13,7 @@ volVectorField D ); -autoPtr Tptr(NULL); +autoPtr Tptr(nullptr); if (thermalStress) { diff --git a/applications/solvers/solidMechanics/deprecatedSolvers/stressedFoam/createFields.H b/applications/solvers/solidMechanics/deprecatedSolvers/stressedFoam/createFields.H index 396f09b1c..cacefe469 100644 --- a/applications/solvers/solidMechanics/deprecatedSolvers/stressedFoam/createFields.H +++ b/applications/solvers/solidMechanics/deprecatedSolvers/stressedFoam/createFields.H @@ -13,7 +13,7 @@ ); - volScalarField* Tptr = NULL; + volScalarField* Tptr = nullptr; if (thermalStress) { diff --git a/applications/solvers/solidMechanics/elasticAcpSolidFoam/createCrack.H b/applications/solvers/solidMechanics/elasticAcpSolidFoam/createCrack.H index 9fb081ca7..cf773551f 100644 --- a/applications/solvers/solidMechanics/elasticAcpSolidFoam/createCrack.H +++ b/applications/solvers/solidMechanics/elasticAcpSolidFoam/createCrack.H @@ -1,7 +1,7 @@ label cohesivePatchID = -1; - solidCohesiveFvPatchVectorField* cohesivePatchUPtr = NULL; - solidCohesiveFixedModeMixFvPatchVectorField* cohesivePatchUFixedModePtr = NULL; + solidCohesiveFvPatchVectorField* cohesivePatchUPtr = nullptr; + solidCohesiveFixedModeMixFvPatchVectorField* cohesivePatchUFixedModePtr = nullptr; forAll (U.boundaryField(), patchI) { diff --git a/applications/solvers/solidMechanics/elasticAcpSolidFoam/createHistory.H b/applications/solvers/solidMechanics/elasticAcpSolidFoam/createHistory.H index d0ce420af..550bb0d4a 100644 --- a/applications/solvers/solidMechanics/elasticAcpSolidFoam/createHistory.H +++ b/applications/solvers/solidMechanics/elasticAcpSolidFoam/createHistory.H @@ -1,4 +1,4 @@ -OFstream* filePtr(NULL); +OFstream* filePtr(nullptr); word historyPatchName(mesh.solutionDict().subDict("solidMechanics").lookup("historyPatch")); label historyPatchID = mesh.boundaryMesh().findPatchID(historyPatchName); if(historyPatchID == -1) diff --git a/applications/solvers/solidMechanics/elasticIncrAcpSolidFoam/createCrack.H b/applications/solvers/solidMechanics/elasticIncrAcpSolidFoam/createCrack.H index ffbd5a14c..4001c170c 100644 --- a/applications/solvers/solidMechanics/elasticIncrAcpSolidFoam/createCrack.H +++ b/applications/solvers/solidMechanics/elasticIncrAcpSolidFoam/createCrack.H @@ -1,7 +1,7 @@ label cohesivePatchID = -1; - solidCohesiveFvPatchVectorField* cohesivePatchDUPtr = NULL; - solidCohesiveFixedModeMixFvPatchVectorField* cohesivePatchDUFixedModePtr = NULL; + solidCohesiveFvPatchVectorField* cohesivePatchDUPtr = nullptr; + solidCohesiveFixedModeMixFvPatchVectorField* cohesivePatchDUFixedModePtr = nullptr; forAll (DU.boundaryField(), patchI) { diff --git a/applications/solvers/solidMechanics/elasticIncrAcpSolidFoam/createHistory.H b/applications/solvers/solidMechanics/elasticIncrAcpSolidFoam/createHistory.H index 2f9f88b8c..3b1ba72f0 100644 --- a/applications/solvers/solidMechanics/elasticIncrAcpSolidFoam/createHistory.H +++ b/applications/solvers/solidMechanics/elasticIncrAcpSolidFoam/createHistory.H @@ -1,4 +1,4 @@ -OFstream * filePtr(NULL); +OFstream * filePtr(nullptr); word historyPatchName(mesh.solutionDict().subDict("solidMechanics").lookup("historyPatch")); label historyPatchID = mesh.boundaryMesh().findPatchID(historyPatchName); if(historyPatchID == -1) diff --git a/applications/solvers/solidMechanics/elasticIncrSolidFoam/createSolidInterface.H b/applications/solvers/solidMechanics/elasticIncrSolidFoam/createSolidInterface.H index 78d5fd2fb..db09f798d 100644 --- a/applications/solvers/solidMechanics/elasticIncrSolidFoam/createSolidInterface.H +++ b/applications/solvers/solidMechanics/elasticIncrSolidFoam/createSolidInterface.H @@ -1,6 +1,6 @@ Switch solidInterfaceCorr(false); -solidInterface* solidInterfacePtr(NULL); +solidInterface* solidInterfacePtr(nullptr); { const dictionary& stressControl = diff --git a/applications/solvers/solidMechanics/elasticNonLinTLSolidFoam/createForceDisplacementFile.H b/applications/solvers/solidMechanics/elasticNonLinTLSolidFoam/createForceDisplacementFile.H index 549b2040a..87cbe6062 100644 --- a/applications/solvers/solidMechanics/elasticNonLinTLSolidFoam/createForceDisplacementFile.H +++ b/applications/solvers/solidMechanics/elasticNonLinTLSolidFoam/createForceDisplacementFile.H @@ -1,4 +1,4 @@ -OFstream * filePtr(NULL); +OFstream * filePtr(nullptr); if(Pstream::master()) { diff --git a/applications/solvers/solidMechanics/elasticNonLinTLSolidFoam/createSolidInterfaceNonLin.H b/applications/solvers/solidMechanics/elasticNonLinTLSolidFoam/createSolidInterfaceNonLin.H index 322a7e7b0..a51d3482e 100644 --- a/applications/solvers/solidMechanics/elasticNonLinTLSolidFoam/createSolidInterfaceNonLin.H +++ b/applications/solvers/solidMechanics/elasticNonLinTLSolidFoam/createSolidInterfaceNonLin.H @@ -1,6 +1,6 @@ bool solidInterfaceCorr = rheology.solidInterfaceActive(); -solidInterface* solidInterfacePtr(NULL); +solidInterface* solidInterfacePtr(nullptr); if(solidInterfaceCorr) { diff --git a/applications/solvers/solidMechanics/elasticNonLinULSolidFoam/createForceDisplacementFile.H b/applications/solvers/solidMechanics/elasticNonLinULSolidFoam/createForceDisplacementFile.H index 549b2040a..87cbe6062 100644 --- a/applications/solvers/solidMechanics/elasticNonLinULSolidFoam/createForceDisplacementFile.H +++ b/applications/solvers/solidMechanics/elasticNonLinULSolidFoam/createForceDisplacementFile.H @@ -1,4 +1,4 @@ -OFstream * filePtr(NULL); +OFstream * filePtr(nullptr); if(Pstream::master()) { diff --git a/applications/solvers/solidMechanics/elasticNonLinULSolidFoam/createSolidInterface.H b/applications/solvers/solidMechanics/elasticNonLinULSolidFoam/createSolidInterface.H index 7e3e97b7a..15d03d66c 100644 --- a/applications/solvers/solidMechanics/elasticNonLinULSolidFoam/createSolidInterface.H +++ b/applications/solvers/solidMechanics/elasticNonLinULSolidFoam/createSolidInterface.H @@ -1,6 +1,6 @@ Switch solidInterfaceCorr(false); -solidInterface* solidInterfacePtr(NULL); +solidInterface* solidInterfacePtr(nullptr); { const dictionary& stressControl = diff --git a/applications/solvers/solidMechanics/elasticNonLinULSolidFoam/createSolidInterfaceNonLin.H b/applications/solvers/solidMechanics/elasticNonLinULSolidFoam/createSolidInterfaceNonLin.H index 30837e416..180c390df 100644 --- a/applications/solvers/solidMechanics/elasticNonLinULSolidFoam/createSolidInterfaceNonLin.H +++ b/applications/solvers/solidMechanics/elasticNonLinULSolidFoam/createSolidInterfaceNonLin.H @@ -1,6 +1,6 @@ bool solidInterfaceCorr = rheology.solidInterfaceActive(); -solidInterface* solidInterfacePtr(NULL); +solidInterface* solidInterfacePtr(nullptr); if(solidInterfaceCorr) { diff --git a/applications/solvers/solidMechanics/elasticOrthoAcpSolidFoam/createCrack.H b/applications/solvers/solidMechanics/elasticOrthoAcpSolidFoam/createCrack.H index 9fb081ca7..cf773551f 100644 --- a/applications/solvers/solidMechanics/elasticOrthoAcpSolidFoam/createCrack.H +++ b/applications/solvers/solidMechanics/elasticOrthoAcpSolidFoam/createCrack.H @@ -1,7 +1,7 @@ label cohesivePatchID = -1; - solidCohesiveFvPatchVectorField* cohesivePatchUPtr = NULL; - solidCohesiveFixedModeMixFvPatchVectorField* cohesivePatchUFixedModePtr = NULL; + solidCohesiveFvPatchVectorField* cohesivePatchUPtr = nullptr; + solidCohesiveFixedModeMixFvPatchVectorField* cohesivePatchUFixedModePtr = nullptr; forAll (U.boundaryField(), patchI) { diff --git a/applications/solvers/solidMechanics/elasticOrthoAcpSolidFoam/createHistory.H b/applications/solvers/solidMechanics/elasticOrthoAcpSolidFoam/createHistory.H index d0ce420af..550bb0d4a 100644 --- a/applications/solvers/solidMechanics/elasticOrthoAcpSolidFoam/createHistory.H +++ b/applications/solvers/solidMechanics/elasticOrthoAcpSolidFoam/createHistory.H @@ -1,4 +1,4 @@ -OFstream* filePtr(NULL); +OFstream* filePtr(nullptr); word historyPatchName(mesh.solutionDict().subDict("solidMechanics").lookup("historyPatch")); label historyPatchID = mesh.boundaryMesh().findPatchID(historyPatchName); if(historyPatchID == -1) diff --git a/applications/solvers/solidMechanics/elasticOrthoNonLinULSolidFoam/createForceDisplacementFile.H b/applications/solvers/solidMechanics/elasticOrthoNonLinULSolidFoam/createForceDisplacementFile.H index 549b2040a..87cbe6062 100644 --- a/applications/solvers/solidMechanics/elasticOrthoNonLinULSolidFoam/createForceDisplacementFile.H +++ b/applications/solvers/solidMechanics/elasticOrthoNonLinULSolidFoam/createForceDisplacementFile.H @@ -1,4 +1,4 @@ -OFstream * filePtr(NULL); +OFstream * filePtr(nullptr); if(Pstream::master()) { diff --git a/applications/solvers/solidMechanics/elasticOrthoNonLinULSolidFoam/elasticOrthoNonLinULSolidFoam.C b/applications/solvers/solidMechanics/elasticOrthoNonLinULSolidFoam/elasticOrthoNonLinULSolidFoam.C index 5afe016ba..143086191 100644 --- a/applications/solvers/solidMechanics/elasticOrthoNonLinULSolidFoam/elasticOrthoNonLinULSolidFoam.C +++ b/applications/solvers/solidMechanics/elasticOrthoNonLinULSolidFoam/elasticOrthoNonLinULSolidFoam.C @@ -84,7 +84,7 @@ int main(int argc, char *argv[]) //- div(sigmaOld) should be zero but I will include //- it to make sure errors don't accumulate - volVectorField* oldErrorPtr = NULL; + volVectorField* oldErrorPtr = nullptr; if (ensureTotalEquilibrium) { oldErrorPtr = new volVectorField diff --git a/applications/solvers/solidMechanics/elasticOrthoSolidFoam/createHistory.H b/applications/solvers/solidMechanics/elasticOrthoSolidFoam/createHistory.H index d0ce420af..550bb0d4a 100644 --- a/applications/solvers/solidMechanics/elasticOrthoSolidFoam/createHistory.H +++ b/applications/solvers/solidMechanics/elasticOrthoSolidFoam/createHistory.H @@ -1,4 +1,4 @@ -OFstream* filePtr(NULL); +OFstream* filePtr(nullptr); word historyPatchName(mesh.solutionDict().subDict("solidMechanics").lookup("historyPatch")); label historyPatchID = mesh.boundaryMesh().findPatchID(historyPatchName); if(historyPatchID == -1) diff --git a/applications/solvers/solidMechanics/elasticPlasticNonLinTLSolidFoam/createHistory.H b/applications/solvers/solidMechanics/elasticPlasticNonLinTLSolidFoam/createHistory.H index 1a07d5965..d3c1ec612 100644 --- a/applications/solvers/solidMechanics/elasticPlasticNonLinTLSolidFoam/createHistory.H +++ b/applications/solvers/solidMechanics/elasticPlasticNonLinTLSolidFoam/createHistory.H @@ -1,5 +1,5 @@ -OFstream* forceFilePtr(NULL); -OFstream* stressFilePtr(NULL); +OFstream* forceFilePtr(nullptr); +OFstream* stressFilePtr(nullptr); word historyPatchName(mesh.solutionDict().subDict("solidMechanics").lookup("historyPatch")); label historyPatchID = mesh.boundaryMesh().findPatchID(historyPatchName); if(historyPatchID == -1) diff --git a/applications/solvers/solidMechanics/elasticPlasticNonLinULSolidFoam/createForceDisplacementFile.H b/applications/solvers/solidMechanics/elasticPlasticNonLinULSolidFoam/createForceDisplacementFile.H index 549b2040a..87cbe6062 100644 --- a/applications/solvers/solidMechanics/elasticPlasticNonLinULSolidFoam/createForceDisplacementFile.H +++ b/applications/solvers/solidMechanics/elasticPlasticNonLinULSolidFoam/createForceDisplacementFile.H @@ -1,4 +1,4 @@ -OFstream * filePtr(NULL); +OFstream * filePtr(nullptr); if(Pstream::master()) { diff --git a/applications/solvers/solidMechanics/elasticPlasticNonLinULSolidFoam/createHistory.H b/applications/solvers/solidMechanics/elasticPlasticNonLinULSolidFoam/createHistory.H index 2bbe32088..5c9d7f063 100644 --- a/applications/solvers/solidMechanics/elasticPlasticNonLinULSolidFoam/createHistory.H +++ b/applications/solvers/solidMechanics/elasticPlasticNonLinULSolidFoam/createHistory.H @@ -1,5 +1,5 @@ -OFstream* forceFilePtr(NULL); -OFstream* stressFilePtr(NULL); +OFstream* forceFilePtr(nullptr); +OFstream* stressFilePtr(nullptr); word historyPatchName(mesh.solutionDict().subDict("solidMechanics").lookup("historyPatch")); label historyPatchID = mesh.boundaryMesh().findPatchID(historyPatchName); if(historyPatchID == -1) diff --git a/applications/solvers/solidMechanics/elasticPlasticNonLinULSolidFoam/createSolidInterface.H b/applications/solvers/solidMechanics/elasticPlasticNonLinULSolidFoam/createSolidInterface.H index 7e3e97b7a..15d03d66c 100644 --- a/applications/solvers/solidMechanics/elasticPlasticNonLinULSolidFoam/createSolidInterface.H +++ b/applications/solvers/solidMechanics/elasticPlasticNonLinULSolidFoam/createSolidInterface.H @@ -1,6 +1,6 @@ Switch solidInterfaceCorr(false); -solidInterface* solidInterfacePtr(NULL); +solidInterface* solidInterfacePtr(nullptr); { const dictionary& stressControl = diff --git a/applications/solvers/solidMechanics/elasticPlasticNonLinULSolidFoam/createSolidInterfaceNonLin.H b/applications/solvers/solidMechanics/elasticPlasticNonLinULSolidFoam/createSolidInterfaceNonLin.H index f6262e91a..f8b5d6364 100644 --- a/applications/solvers/solidMechanics/elasticPlasticNonLinULSolidFoam/createSolidInterfaceNonLin.H +++ b/applications/solvers/solidMechanics/elasticPlasticNonLinULSolidFoam/createSolidInterfaceNonLin.H @@ -1,6 +1,6 @@ Switch solidInterfaceCorr(false); -solidInterfaceNonLin* solidInterfacePtr(NULL); +solidInterfaceNonLin* solidInterfacePtr(nullptr); { const dictionary& stressControl = diff --git a/applications/solvers/solidMechanics/elasticPlasticSolidFoam/createHistory.H b/applications/solvers/solidMechanics/elasticPlasticSolidFoam/createHistory.H index 56f3623a3..682a41eef 100644 --- a/applications/solvers/solidMechanics/elasticPlasticSolidFoam/createHistory.H +++ b/applications/solvers/solidMechanics/elasticPlasticSolidFoam/createHistory.H @@ -1,5 +1,5 @@ -OFstream* forceFilePtr(NULL); -OFstream* stressFilePtr(NULL); +OFstream* forceFilePtr(nullptr); +OFstream* stressFilePtr(nullptr); word historyPatchName(mesh.solutionDict().subDict("solidMechanics").lookup("historyPatch")); label historyPatchID = mesh.boundaryMesh().findPatchID(historyPatchName); if(historyPatchID == -1) diff --git a/applications/solvers/solidMechanics/elasticPlasticSolidFoam/createSolidInterface.H b/applications/solvers/solidMechanics/elasticPlasticSolidFoam/createSolidInterface.H index 78d5fd2fb..db09f798d 100644 --- a/applications/solvers/solidMechanics/elasticPlasticSolidFoam/createSolidInterface.H +++ b/applications/solvers/solidMechanics/elasticPlasticSolidFoam/createSolidInterface.H @@ -1,6 +1,6 @@ Switch solidInterfaceCorr(false); -solidInterface* solidInterfacePtr(NULL); +solidInterface* solidInterfacePtr(nullptr); { const dictionary& stressControl = diff --git a/applications/solvers/solidMechanics/elasticSolidFoam/createHistory.H b/applications/solvers/solidMechanics/elasticSolidFoam/createHistory.H index c1a05c873..7b620e332 100644 --- a/applications/solvers/solidMechanics/elasticSolidFoam/createHistory.H +++ b/applications/solvers/solidMechanics/elasticSolidFoam/createHistory.H @@ -1,4 +1,4 @@ -OFstream* filePtr(NULL); +OFstream* filePtr(nullptr); word historyPatchName(mesh.solutionDict().subDict("solidMechanics").lookup("historyPatch")); label historyPatchID = mesh.boundaryMesh().findPatchID(historyPatchName); if(historyPatchID == -1) diff --git a/applications/solvers/solidMechanics/elasticSolidFoam/createSolidInterface.H b/applications/solvers/solidMechanics/elasticSolidFoam/createSolidInterface.H index 249670d5a..e174ed31b 100644 --- a/applications/solvers/solidMechanics/elasticSolidFoam/createSolidInterface.H +++ b/applications/solvers/solidMechanics/elasticSolidFoam/createSolidInterface.H @@ -1,6 +1,6 @@ Switch solidInterfaceCorr(false); -solidInterface* solidInterfacePtr(NULL); +solidInterface* solidInterfacePtr(nullptr); { const dictionary& stressControl = diff --git a/applications/solvers/solidMechanics/elasticSolidFoam/elasticSolidFoam.C b/applications/solvers/solidMechanics/elasticSolidFoam/elasticSolidFoam.C index a84c489fe..0bd8e3254 100644 --- a/applications/solvers/solidMechanics/elasticSolidFoam/elasticSolidFoam.C +++ b/applications/solvers/solidMechanics/elasticSolidFoam/elasticSolidFoam.C @@ -62,7 +62,7 @@ int main(int argc, char *argv[]) Info<< "\nStarting time loop\n" << endl; - while(runTime.loop()) + while (runTime.loop()) { Info<< "Time = " << runTime.timeName() << nl << endl; @@ -147,7 +147,6 @@ int main(int argc, char *argv[]) || ( solverPerf.initialResidual() > convergenceTolerance - //relativeResidual > convergenceTolerance && iCorr < nCorr ) ); diff --git a/applications/solvers/solidMechanics/icoFsiElasticNonLinULSolidFoam/createZoneToZoneInterpolators.H b/applications/solvers/solidMechanics/icoFsiElasticNonLinULSolidFoam/createZoneToZoneInterpolators.H index fa666a5b9..7ba2c7da3 100644 --- a/applications/solvers/solidMechanics/icoFsiElasticNonLinULSolidFoam/createZoneToZoneInterpolators.H +++ b/applications/solvers/solidMechanics/icoFsiElasticNonLinULSolidFoam/createZoneToZoneInterpolators.H @@ -1,6 +1,6 @@ -zoneToZoneInterpolation* interpolatorFluidSolidPtr = NULL; -zoneToZoneInterpolation* interpolatorSolidFluidPtr = NULL; +zoneToZoneInterpolation* interpolatorFluidSolidPtr = nullptr; +zoneToZoneInterpolation* interpolatorSolidFluidPtr = nullptr; if(!interpolatorFluidSolidPtr || !interpolatorSolidFluidPtr) diff --git a/applications/solvers/solidMechanics/icoFsiElasticNonLinULSolidFoam/readCouplingProperties.H b/applications/solvers/solidMechanics/icoFsiElasticNonLinULSolidFoam/readCouplingProperties.H index f07a7969f..9900781c7 100644 --- a/applications/solvers/solidMechanics/icoFsiElasticNonLinULSolidFoam/readCouplingProperties.H +++ b/applications/solvers/solidMechanics/icoFsiElasticNonLinULSolidFoam/readCouplingProperties.H @@ -125,7 +125,7 @@ IOobject::MUST_READ ); - vectorField* accumulatedFluidInterfaceDisplacementPtr = NULL; + vectorField* accumulatedFluidInterfaceDisplacementPtr = nullptr; if(accumulatedFluidInterfaceDisplacementHeader.headerOk()) { diff --git a/applications/solvers/solidMechanics/utilities/patchStressIntegrate/patchStressIntegrate.C b/applications/solvers/solidMechanics/utilities/patchStressIntegrate/patchStressIntegrate.C index 381c0b776..dc79c7519 100644 --- a/applications/solvers/solidMechanics/utilities/patchStressIntegrate/patchStressIntegrate.C +++ b/applications/solvers/solidMechanics/utilities/patchStressIntegrate/patchStressIntegrate.C @@ -95,8 +95,8 @@ int main(int argc, char *argv[]) Info<< nl; // gradU needed for nonLinear - volTensorField* gradUPtr = NULL; - volSymmTensorField* sigmaCauchyPtr = NULL; + volTensorField* gradUPtr = nullptr; + volSymmTensorField* sigmaCauchyPtr = nullptr; if (nonLinear) { gradUPtr = new volTensorField diff --git a/applications/solvers/solidMechanics/utilities/surfaceTractions/surfaceTractions.C b/applications/solvers/solidMechanics/utilities/surfaceTractions/surfaceTractions.C index 7cea9e8f4..759dd0eca 100644 --- a/applications/solvers/solidMechanics/utilities/surfaceTractions/surfaceTractions.C +++ b/applications/solvers/solidMechanics/utilities/surfaceTractions/surfaceTractions.C @@ -123,7 +123,7 @@ int main(int argc, char *argv[]) dimensionedVector("zero", dimForce/dimArea, vector::zero) ); - volTensorField* gradUPtr = NULL; + volTensorField* gradUPtr = nullptr; if (nonLinear) { gradUPtr = new volTensorField diff --git a/applications/solvers/solidMechanics/viscoElasticSolidFoam/createHistory.H b/applications/solvers/solidMechanics/viscoElasticSolidFoam/createHistory.H index 038387383..86a983ce4 100644 --- a/applications/solvers/solidMechanics/viscoElasticSolidFoam/createHistory.H +++ b/applications/solvers/solidMechanics/viscoElasticSolidFoam/createHistory.H @@ -1,5 +1,5 @@ -OFstream* forceFilePtr(NULL); -// OFstream* stressFilePtr(NULL); +OFstream* forceFilePtr(nullptr); +// OFstream* stressFilePtr(nullptr); word historyPatchName(mesh.solutionDict().subDict("solidMechanics").lookup("historyPatch")); label historyPatchID = mesh.boundaryMesh().findPatchID(historyPatchName); if(historyPatchID == -1) diff --git a/applications/solvers/surfaceTracking/bubbleInterTrackFoam/createFields.H b/applications/solvers/surfaceTracking/bubbleInterTrackFoam/createFields.H index a14fdb66f..2b66088ec 100644 --- a/applications/solvers/surfaceTracking/bubbleInterTrackFoam/createFields.H +++ b/applications/solvers/surfaceTracking/bubbleInterTrackFoam/createFields.H @@ -50,7 +50,7 @@ volScalarField rho freeSurface interface(mesh, rho, U, p, phi); -volScalarField* fluidIndicatorPtr = NULL; +volScalarField* fluidIndicatorPtr = nullptr; if(Pstream::parRun()) { diff --git a/applications/solvers/surfaceTracking/bubbleInterTrackFoam/createSurfactantConcentrationField.H b/applications/solvers/surfaceTracking/bubbleInterTrackFoam/createSurfactantConcentrationField.H index 8ac7bb897..bd20d48c6 100644 --- a/applications/solvers/surfaceTracking/bubbleInterTrackFoam/createSurfactantConcentrationField.H +++ b/applications/solvers/surfaceTracking/bubbleInterTrackFoam/createSurfactantConcentrationField.H @@ -1,7 +1,7 @@ // Volume surfactant concentration -volScalarField* CPtr = NULL; +volScalarField* CPtr = nullptr; if(!interface.cleanInterface() && interface.surfactant().soluble()) { diff --git a/applications/solvers/surfaceTracking/freeSurface/correctedFvPatchFields/correctedFvPatchField/correctedFvPatchField.C b/applications/solvers/surfaceTracking/freeSurface/correctedFvPatchFields/correctedFvPatchField/correctedFvPatchField.C index 6aceff44c..13cd87dfc 100644 --- a/applications/solvers/surfaceTracking/freeSurface/correctedFvPatchFields/correctedFvPatchField/correctedFvPatchField.C +++ b/applications/solvers/surfaceTracking/freeSurface/correctedFvPatchFields/correctedFvPatchField/correctedFvPatchField.C @@ -56,7 +56,7 @@ correctedFvPatchField::correctedFvPatchField correctionVectors_(p.size(), vector::zero), corrVecGrad_(p.size(), pTraits::zero), nGradInternal_(p.size(), pTraits::zero), - patchSubMeshPtr_(NULL), + patchSubMeshPtr_(nullptr), subMeshPatchID_(-1) { updateCorrectionVectors(); @@ -75,7 +75,7 @@ correctedFvPatchField::correctedFvPatchField correctionVectors_(p.size(), vector::zero), corrVecGrad_(p.size(), pTraits::zero), nGradInternal_(p.size(), pTraits::zero), - patchSubMeshPtr_(NULL), + patchSubMeshPtr_(nullptr), subMeshPatchID_(-1) { @@ -95,7 +95,7 @@ correctedFvPatchField::correctedFvPatchField correctionVectors_(p.size(), vector::zero), corrVecGrad_(p.size(), pTraits::zero), nGradInternal_(p.size(), pTraits::zero), - patchSubMeshPtr_(NULL), + patchSubMeshPtr_(nullptr), subMeshPatchID_(-1) { updateCorrectionVectors(); @@ -121,7 +121,7 @@ correctedFvPatchField::correctedFvPatchField correctionVectors_(ptf.correctionVectors_, mapper), corrVecGrad_(ptf.corrVecGrad_, mapper), nGradInternal_(ptf.nGradInternal_, mapper), - patchSubMeshPtr_(NULL), + patchSubMeshPtr_(nullptr), subMeshPatchID_(-1) { updateCorrectionVectors(); @@ -139,7 +139,7 @@ correctedFvPatchField::correctedFvPatchField correctionVectors_(ptf.correctionVectors_), corrVecGrad_(ptf.corrVecGrad_), nGradInternal_(ptf.nGradInternal_), - patchSubMeshPtr_(NULL), + patchSubMeshPtr_(nullptr), subMeshPatchID_(-1) { updateCorrectionVectors(); diff --git a/applications/solvers/surfaceTracking/freeSurface/freeSurface.C b/applications/solvers/surfaceTracking/freeSurface/freeSurface.C index 16644a583..b3909cb54 100644 --- a/applications/solvers/surfaceTracking/freeSurface/freeSurface.C +++ b/applications/solvers/surfaceTracking/freeSurface/freeSurface.C @@ -162,20 +162,20 @@ freeSurface::freeSurface readInt(this->lookup("nFreeSurfaceCorrectors")) ), smoothing_(false), - interpolatorABPtr_(NULL), - interpolatorBAPtr_(NULL), - controlPointsPtr_(NULL), - motionPointsMaskPtr_(NULL), - pointsDisplacementDirPtr_(NULL), - facesDisplacementDirPtr_(NULL), - totalDisplacementPtr_(NULL), - aMeshPtr_(NULL), - UsPtr_(NULL), - phisPtr_(NULL), - surfactConcPtr_(NULL), - surfaceTensionPtr_(NULL), - surfactantPtr_(NULL), - fluidIndicatorPtr_(NULL) + interpolatorABPtr_(nullptr), + interpolatorBAPtr_(nullptr), + controlPointsPtr_(nullptr), + motionPointsMaskPtr_(nullptr), + pointsDisplacementDirPtr_(nullptr), + facesDisplacementDirPtr_(nullptr), + totalDisplacementPtr_(nullptr), + aMeshPtr_(nullptr), + UsPtr_(nullptr), + phisPtr_(nullptr), + surfactConcPtr_(nullptr), + surfaceTensionPtr_(nullptr), + surfactantPtr_(nullptr), + fluidIndicatorPtr_(nullptr) { //Read motion direction if (!normalMotionDir_) diff --git a/applications/solvers/surfaceTracking/freeSurface/functionObjects/bubbleHistory/bubbleHistory.C b/applications/solvers/surfaceTracking/freeSurface/functionObjects/bubbleHistory/bubbleHistory.C index 1090c1e00..aee1104a1 100644 --- a/applications/solvers/surfaceTracking/freeSurface/functionObjects/bubbleHistory/bubbleHistory.C +++ b/applications/solvers/surfaceTracking/freeSurface/functionObjects/bubbleHistory/bubbleHistory.C @@ -64,7 +64,7 @@ Foam::bubbleHistory::bubbleHistory time_(t), regionName_(polyMesh::defaultRegion), V0_(SMALL), - historyFilePtr_(NULL) + historyFilePtr_(nullptr) { if (dict.found("region")) { diff --git a/applications/solvers/surfaceTracking/freeSurface/functionObjects/sloshingHistory/sloshingHistory.C b/applications/solvers/surfaceTracking/freeSurface/functionObjects/sloshingHistory/sloshingHistory.C index 4094a5edf..338157a2c 100644 --- a/applications/solvers/surfaceTracking/freeSurface/functionObjects/sloshingHistory/sloshingHistory.C +++ b/applications/solvers/surfaceTracking/freeSurface/functionObjects/sloshingHistory/sloshingHistory.C @@ -63,7 +63,7 @@ Foam::sloshingHistory::sloshingHistory name_(name), time_(t), regionName_(polyMesh::defaultRegion), - historyFilePtr_(NULL), + historyFilePtr_(nullptr), freeSurfacePatchID_(-1), leftPointID_(-1), rightPointID_(-1) diff --git a/applications/solvers/surfaceTracking/interTrackFoam/createFields.H b/applications/solvers/surfaceTracking/interTrackFoam/createFields.H index 55b55a63f..a1277e9d3 100644 --- a/applications/solvers/surfaceTracking/interTrackFoam/createFields.H +++ b/applications/solvers/surfaceTracking/interTrackFoam/createFields.H @@ -50,7 +50,7 @@ volScalarField rho freeSurface interface(mesh, rho, U, p, phi); -volScalarField* fluidIndicatorPtr = NULL; +volScalarField* fluidIndicatorPtr = nullptr; if(Pstream::parRun()) { diff --git a/applications/utilities/mesh/advanced/autoRefineMesh/autoRefineMesh.C b/applications/utilities/mesh/advanced/autoRefineMesh/autoRefineMesh.C index 6aaeee195..4c7fcccd3 100644 --- a/applications/utilities/mesh/advanced/autoRefineMesh/autoRefineMesh.C +++ b/applications/utilities/mesh/advanced/autoRefineMesh/autoRefineMesh.C @@ -665,7 +665,7 @@ int main(int argc, char *argv[]) ); // corrector for mesh motion - twoDPointCorrector* correct2DPtr = NULL; + twoDPointCorrector* correct2DPtr = nullptr; if (motionObj.headerOk()) { diff --git a/applications/utilities/mesh/advanced/selectCells/selectCells.C b/applications/utilities/mesh/advanced/selectCells/selectCells.C index 415f27582..cabf7df23 100644 --- a/applications/utilities/mesh/advanced/selectCells/selectCells.C +++ b/applications/utilities/mesh/advanced/selectCells/selectCells.C @@ -411,9 +411,9 @@ int main(int argc, char *argv[]) // Surface - autoPtr surf(NULL); + autoPtr surf(nullptr); // Search engine on surface. - autoPtr querySurf(NULL); + autoPtr querySurf(nullptr); if (useSurface) { diff --git a/applications/utilities/mesh/conversion/Optional/ccm26ToFoam/ccm26ToFoam.C b/applications/utilities/mesh/conversion/Optional/ccm26ToFoam/ccm26ToFoam.C index ef2e1e0a2..456a6e61f 100644 --- a/applications/utilities/mesh/conversion/Optional/ccm26ToFoam/ccm26ToFoam.C +++ b/applications/utilities/mesh/conversion/Optional/ccm26ToFoam/ccm26ToFoam.C @@ -185,7 +185,7 @@ void ReadVertices // any chunk. Normally this would be in a for loop. CCMIOSize nVertices; - CCMIOEntitySize(&err, vertices, &nVertices, NULL); + CCMIOEntitySize(&err, vertices, &nVertices, nullptr); List mapData(nVertices, 0); List verts(3*nVertices, 0); @@ -201,9 +201,9 @@ void ReadVertices CCMIOReadMap(&err, mapID, mapData.begin(), offset, offsetPlusSize); //CCMIOSize size; - //CCMIOEntityDescription(&err, vertices, &size, NULL); + //CCMIOEntityDescription(&err, vertices, &size, nullptr); //char *desc = new char[size + 1]; - //CCMIOEntityDescription(&err, vertices, NULL, desc); + //CCMIOEntityDescription(&err, vertices, nullptr, desc); //Pout<< "label: '" << desc << "'" << endl; //delete [] desc; @@ -239,7 +239,7 @@ void ReadProblem int i = 0; while ( - CCMIONextEntity(NULL, problem, kCCMIOCellType, &i, &next) + CCMIONextEntity(nullptr, problem, kCCMIOCellType, &i, &next) == kCCMIONoErr ) { @@ -251,10 +251,10 @@ void ReadProblem // an array to get the name because we do not know how long the // string is yet. Many parameters to CCMIO functions that // return - // data can be NULL if that data is not needed.) + // data can be nullptr if that data is not needed.) if ( - CCMIOReadOptstr(NULL, next, "MaterialType", &size, NULL) + CCMIOReadOptstr(nullptr, next, "MaterialType", &size, nullptr) == kCCMIONoErr ) { @@ -277,7 +277,7 @@ void ReadProblem int k = 0; while ( - CCMIONextEntity(NULL, problem, kCCMIOBoundaryRegion, &k, &boundary) + CCMIONextEntity(nullptr, problem, kCCMIOBoundaryRegion, &k, &boundary) == kCCMIONoErr ) { @@ -289,7 +289,7 @@ void ReadProblem int prostarI = -1; if ( - CCMIOReadOpti(NULL, boundary, "ProstarRegionNumber", &prostarI) + CCMIOReadOpti(nullptr, boundary, "ProstarRegionNumber", &prostarI) == kCCMIONoErr ) { @@ -315,12 +315,12 @@ void ReadProblem int size; if ( - CCMIOReadOptstr(NULL, boundary, "BoundaryType", &size, NULL) + CCMIOReadOptstr(nullptr, boundary, "BoundaryType", &size, nullptr) == kCCMIONoErr ) { char* s = new char[size + 1]; - CCMIOReadOptstr(NULL, boundary, "BoundaryType", &size, s); + CCMIOReadOptstr(nullptr, boundary, "BoundaryType", &size, s); s[size] = '\0'; foamPatchTypes[foamPatchI] = string::validate(string(s)); delete [] s; @@ -337,12 +337,12 @@ void ReadProblem if ( - CCMIOReadOptstr(NULL, boundary, "BoundaryName", &size, NULL) + CCMIOReadOptstr(nullptr, boundary, "BoundaryName", &size, nullptr) == kCCMIONoErr ) { char* name = new char[size + 1]; - CCMIOReadOptstr(NULL, boundary, "BoundaryName", &size, name); + CCMIOReadOptstr(nullptr, boundary, "BoundaryName", &size, name); name[size] = '\0'; foamPatchNames[foamPatchI] = string::validate(string(name)); @@ -351,12 +351,12 @@ void ReadProblem } else if ( - CCMIOReadOptstr(NULL, boundary, "Label", &size, NULL) + CCMIOReadOptstr(nullptr, boundary, "Label", &size, nullptr) == kCCMIONoErr ) { char* name = new char[size + 1]; - CCMIOReadOptstr(NULL, boundary, "Label", &size, name); + CCMIOReadOptstr(nullptr, boundary, "Label", &size, name); name[size] = '\0'; foamPatchNames[foamPatchI] = string::validate(string(name)); @@ -405,7 +405,7 @@ void ReadCells CCMIOID id; CCMIOGetEntity(&err, topology, kCCMIOCells, 0, &id); CCMIOSize nCells; - CCMIOEntitySize(&err, id, &nCells, NULL); + CCMIOEntitySize(&err, id, &nCells, nullptr); std::vector mapData(nCells); std::vector cellType(nCells); @@ -429,7 +429,7 @@ void ReadCells CCMIOGetEntity(&err, topology, kCCMIOInternalFaces, 0, &id); CCMIOSize nInternalFaces; - CCMIOEntitySize(&err, id, &nInternalFaces, NULL); + CCMIOEntitySize(&err, id, &nInternalFaces, nullptr); Pout<< "nInternalFaces:" << nInternalFaces << endl; // Determine patch sizes before reading internal faces @@ -437,12 +437,12 @@ void ReadCells int index = 0; while ( - CCMIONextEntity(NULL, topology, kCCMIOBoundaryFaces, &index, &id) + CCMIONextEntity(nullptr, topology, kCCMIOBoundaryFaces, &index, &id) == kCCMIONoErr ) { CCMIOSize size; - CCMIOEntitySize(&err, id, &size, NULL); + CCMIOEntitySize(&err, id, &size, nullptr); Pout<< "Read kCCMIOBoundaryFaces entry with " << size << " faces." << endl; @@ -461,10 +461,10 @@ void ReadCells mapData.resize(nInternalFaces); CCMIOGetEntity(&err, topology, kCCMIOInternalFaces, 0, &id); CCMIOSize size; - CCMIOReadFaces(&err, id, kCCMIOInternalFaces, NULL, &size, NULL, + CCMIOReadFaces(&err, id, kCCMIOInternalFaces, nullptr, &size, nullptr, kCCMIOStart, kCCMIOEnd); std::vector faces(size); - CCMIOReadFaces(&err, id, kCCMIOInternalFaces, &mapID, NULL, &faces[0], + CCMIOReadFaces(&err, id, kCCMIOInternalFaces, &mapID, nullptr, &faces[0], kCCMIOStart, kCCMIOEnd); std::vector faceCells(2*nInternalFaces); CCMIOReadFaceCells(&err, id, kCCMIOInternalFaces, &faceCells[0], @@ -501,19 +501,19 @@ void ReadCells label regionI = 0; while ( - CCMIONextEntity(NULL, topology, kCCMIOBoundaryFaces, &index, &id) + CCMIONextEntity(nullptr, topology, kCCMIOBoundaryFaces, &index, &id) == kCCMIONoErr ) { CCMIOSize nFaces; - CCMIOEntitySize(&err, id, &nFaces, NULL); + CCMIOEntitySize(&err, id, &nFaces, nullptr); mapData.resize(nFaces); faceCells.resize(nFaces); - CCMIOReadFaces(&err, id, kCCMIOBoundaryFaces, NULL, &size, NULL, + CCMIOReadFaces(&err, id, kCCMIOBoundaryFaces, nullptr, &size, nullptr, kCCMIOStart, kCCMIOEnd); faces.resize(size); - CCMIOReadFaces(&err, id, kCCMIOBoundaryFaces, &mapID, NULL, &faces[0], + CCMIOReadFaces(&err, id, kCCMIOBoundaryFaces, &mapID, nullptr, &faces[0], kCCMIOStart, kCCMIOEnd); CCMIOReadFaceCells(&err, id, kCCMIOBoundaryFaces, &faceCells[0], kCCMIOStart, kCCMIOEnd); @@ -524,7 +524,7 @@ void ReadCells int prostarI; if ( - CCMIOReadOpti(NULL, id, "ProstarRegionNumber", &prostarI) + CCMIOReadOpti(nullptr, id, "ProstarRegionNumber", &prostarI) == kCCMIONoErr ) { @@ -634,11 +634,11 @@ int main(int argc, char *argv[]) } // Open the file. Because we did not initialize 'err' we need to pass - // in NULL (which always means kCCMIONoErr) and then assign the return + // in nullptr (which always means kCCMIONoErr) and then assign the return // value to 'err'.). CCMIOID root; CCMIOError err = - CCMIOOpenFile(NULL, ccmFile.c_str(), kCCMIORead, &root); + CCMIOOpenFile(nullptr, ccmFile.c_str(), kCCMIORead, &root); // We are going to assume that we have a state with a known name. // We could instead use CCMIONextEntity() to walk through all the @@ -649,9 +649,9 @@ int main(int argc, char *argv[]) CheckError(err, "Error opening state"); unsigned int size; - CCMIOEntityDescription(&err, state, &size, NULL); + CCMIOEntityDescription(&err, state, &size, nullptr); char *desc = new char[size + 1]; - CCMIOEntityDescription(&err, state, NULL, desc); + CCMIOEntityDescription(&err, state, nullptr, desc); Pout<< "Reading state '" << kDefaultState << "' (" << desc << ")" << endl; delete [] desc; @@ -668,7 +668,7 @@ int main(int argc, char *argv[]) processor, &vertices, &topology, - NULL, + nullptr, &solution ); @@ -682,8 +682,8 @@ int main(int argc, char *argv[]) processor, &vertices, &topology, - NULL, - NULL + nullptr, + nullptr ); if (err != kCCMIONoErr) { diff --git a/applications/utilities/mesh/conversion/cfx4ToFoam/block.H b/applications/utilities/mesh/conversion/cfx4ToFoam/block.H index 8a68abdbd..0a2e8b644 100644 --- a/applications/utilities/mesh/conversion/cfx4ToFoam/block.H +++ b/applications/utilities/mesh/conversion/cfx4ToFoam/block.H @@ -97,7 +97,7 @@ public: autoPtr clone() const { notImplemented("block::clone()"); - return autoPtr(NULL); + return autoPtr(nullptr); } // Destructor diff --git a/applications/utilities/mesh/conversion/fluentMeshToFoam/extrudedQuadCellShape.C b/applications/utilities/mesh/conversion/fluentMeshToFoam/extrudedQuadCellShape.C index 19034450a..9a962128c 100644 --- a/applications/utilities/mesh/conversion/fluentMeshToFoam/extrudedQuadCellShape.C +++ b/applications/utilities/mesh/conversion/fluentMeshToFoam/extrudedQuadCellShape.C @@ -47,7 +47,7 @@ cellShape extrudedQuadCellShape faceList& frontAndBackFaces ) { - const static cellModel* hexModelPtr_ = NULL; + const static cellModel* hexModelPtr_ = nullptr; if (!hexModelPtr_) { diff --git a/applications/utilities/mesh/conversion/fluentMeshToFoam/extrudedTriangleCellShape.C b/applications/utilities/mesh/conversion/fluentMeshToFoam/extrudedTriangleCellShape.C index 28fb110ae..55b83a45e 100644 --- a/applications/utilities/mesh/conversion/fluentMeshToFoam/extrudedTriangleCellShape.C +++ b/applications/utilities/mesh/conversion/fluentMeshToFoam/extrudedTriangleCellShape.C @@ -48,7 +48,7 @@ cellShape extrudedTriangleCellShape faceList& frontAndBackFaces ) { - const static cellModel* prismModelPtr_ = NULL; + const static cellModel* prismModelPtr_ = nullptr; if (!prismModelPtr_) { diff --git a/applications/utilities/mesh/conversion/sammToFoam/sammMesh.C b/applications/utilities/mesh/conversion/sammToFoam/sammMesh.C index 9ad83b576..726d57fe0 100644 --- a/applications/utilities/mesh/conversion/sammToFoam/sammMesh.C +++ b/applications/utilities/mesh/conversion/sammToFoam/sammMesh.C @@ -172,7 +172,7 @@ sammMesh::sammMesh cellPolys_(0), nInternalFaces_(0), polyBoundaryPatchStartIndices_(0), - pointCellsPtr_(NULL), + pointCellsPtr_(nullptr), isShapeMesh_(true) { // Fill in the lookup tables diff --git a/applications/utilities/mesh/conversion/star4ToFoam/star4ToFoam/meshReader.C b/applications/utilities/mesh/conversion/star4ToFoam/star4ToFoam/meshReader.C index 7a8dd2c82..ac15efd82 100644 --- a/applications/utilities/mesh/conversion/star4ToFoam/star4ToFoam/meshReader.C +++ b/applications/utilities/mesh/conversion/star4ToFoam/star4ToFoam/meshReader.C @@ -161,7 +161,7 @@ meshReader::meshReader cellFaces_(0), baffleFaces_(0), cellTableId_(0), - pointCellsPtr_(NULL) + pointCellsPtr_(nullptr) {} diff --git a/applications/utilities/mesh/conversion/star4ToFoam/star4ToFoam/starMeshReader.C b/applications/utilities/mesh/conversion/star4ToFoam/star4ToFoam/starMeshReader.C index 36636e022..2a5b3fe23 100644 --- a/applications/utilities/mesh/conversion/star4ToFoam/star4ToFoam/starMeshReader.C +++ b/applications/utilities/mesh/conversion/star4ToFoam/star4ToFoam/starMeshReader.C @@ -399,7 +399,7 @@ void starMeshReader::readCells } // determine the foam cell shape - const cellModel* curModelPtr = NULL; + const cellModel* curModelPtr = nullptr; // fluid/solid cells switch (shapeId) diff --git a/applications/utilities/mesh/conversion/starToFoam/starMesh.C b/applications/utilities/mesh/conversion/starToFoam/starMesh.C index b54471269..1ee79d663 100644 --- a/applications/utilities/mesh/conversion/starToFoam/starMesh.C +++ b/applications/utilities/mesh/conversion/starToFoam/starMesh.C @@ -249,7 +249,7 @@ starMesh::starMesh cellPolys_(0), nInternalFaces_(0), polyBoundaryPatchStartIndices_(0), - pointCellsPtr_(NULL), + pointCellsPtr_(nullptr), couples_(0), isShapeMesh_(true) { diff --git a/applications/utilities/mesh/generation/extrudeMesh/extrudeMesh.C b/applications/utilities/mesh/generation/extrudeMesh/extrudeMesh.C index b7a0f06be..f255331f7 100644 --- a/applications/utilities/mesh/generation/extrudeMesh/extrudeMesh.C +++ b/applications/utilities/mesh/generation/extrudeMesh/extrudeMesh.C @@ -59,7 +59,7 @@ int main(int argc, char *argv[]) # include "setRootCase.H" # include "createTimeExtruded.H" - autoPtr meshPtr(NULL); + autoPtr meshPtr(nullptr); IOdictionary dict ( diff --git a/applications/utilities/mesh/manipulation/cellSet/cellSet.C b/applications/utilities/mesh/manipulation/cellSet/cellSet.C index 92a533352..8431effa7 100644 --- a/applications/utilities/mesh/manipulation/cellSet/cellSet.C +++ b/applications/utilities/mesh/manipulation/cellSet/cellSet.C @@ -107,7 +107,7 @@ int main(int argc, char *argv[]) // Load set to work - autoPtr currentSetPtr(NULL); + autoPtr currentSetPtr(nullptr); IOobject::readOption r; if ((action == topoSetSource::NEW) || (action == topoSetSource::CLEAR)) diff --git a/applications/utilities/mesh/manipulation/faceSet/faceSet.C b/applications/utilities/mesh/manipulation/faceSet/faceSet.C index de29868fa..1b9ff14ca 100644 --- a/applications/utilities/mesh/manipulation/faceSet/faceSet.C +++ b/applications/utilities/mesh/manipulation/faceSet/faceSet.C @@ -107,7 +107,7 @@ int main(int argc, char *argv[]) // Load set to work - autoPtr currentSetPtr(NULL); + autoPtr currentSetPtr(nullptr); IOobject::readOption r; if ((action == topoSetSource::NEW) || (action == topoSetSource::CLEAR)) diff --git a/applications/utilities/mesh/manipulation/mirrorMesh/mirrorFvMesh.C b/applications/utilities/mesh/manipulation/mirrorMesh/mirrorFvMesh.C index 933996b61..e5e0657ca 100644 --- a/applications/utilities/mesh/manipulation/mirrorMesh/mirrorFvMesh.C +++ b/applications/utilities/mesh/manipulation/mirrorMesh/mirrorFvMesh.C @@ -43,7 +43,7 @@ Foam::mirrorFvMesh::mirrorFvMesh(const IOobject& io) IOobject::NO_WRITE ) ), - mirrorMeshPtr_(NULL) + mirrorMeshPtr_(nullptr) { plane mirrorPlane(mirrorMeshDict_); diff --git a/applications/utilities/mesh/manipulation/pointSet/pointSet.C b/applications/utilities/mesh/manipulation/pointSet/pointSet.C index f904ad986..b21887af6 100644 --- a/applications/utilities/mesh/manipulation/pointSet/pointSet.C +++ b/applications/utilities/mesh/manipulation/pointSet/pointSet.C @@ -107,7 +107,7 @@ int main(int argc, char *argv[]) // Load set to work - autoPtr currentSetPtr(NULL); + autoPtr currentSetPtr(nullptr); IOobject::readOption r; if ((action == topoSetSource::NEW) || (action == topoSetSource::CLEAR)) diff --git a/applications/utilities/mesh/manipulation/setSet/setSet.C b/applications/utilities/mesh/manipulation/setSet/setSet.C index a45220aa7..90a8b4572 100644 --- a/applications/utilities/mesh/manipulation/setSet/setSet.C +++ b/applications/utilities/mesh/manipulation/setSet/setSet.C @@ -768,7 +768,7 @@ int main(int argc, char *argv[]) - std::ifstream* fileStreamPtr(NULL); + std::ifstream* fileStreamPtr(nullptr); if (args.optionFound("batch")) { diff --git a/applications/utilities/parallelProcessing/decomposePar/decomposePar.C b/applications/utilities/parallelProcessing/decomposePar/decomposePar.C index 65217a9fd..8a2bb3ed8 100644 --- a/applications/utilities/parallelProcessing/decomposePar/decomposePar.C +++ b/applications/utilities/parallelProcessing/decomposePar/decomposePar.C @@ -384,7 +384,7 @@ int main(int argc, char *argv[]) // Construct the tetPoint fields // ~~~~~~~~~~~~~~~~~~~~~~~~~~ - tetPolyMesh* tetMeshPtr = NULL; + tetPolyMesh* tetMeshPtr = nullptr; PtrList tetPointScalarFields; PtrList tetPointVectorFields; @@ -491,7 +491,7 @@ int main(int argc, char *argv[]) new List*> ( mesh.nCells(), - static_cast*>(NULL) + static_cast*>(nullptr) ) ); @@ -895,7 +895,7 @@ int main(int argc, char *argv[]) if (tetMeshPtr) { delete tetMeshPtr; - tetMeshPtr = NULL; + tetMeshPtr = nullptr; } diff --git a/applications/utilities/postProcessing/dataConversion/foamToEnsight/ensightField.C b/applications/utilities/postProcessing/dataConversion/foamToEnsight/ensightField.C index 08c5ccefe..68d4ea9fd 100644 --- a/applications/utilities/postProcessing/dataConversion/foamToEnsight/ensightField.C +++ b/applications/utilities/postProcessing/dataConversion/foamToEnsight/ensightField.C @@ -430,7 +430,7 @@ void writePatchField word timeFile = prepend + itoa(timeIndex); - OFstream *ensightFilePtr = NULL; + OFstream *ensightFilePtr = nullptr; if (Pstream::master()) { if (timeIndex == 0) @@ -533,7 +533,7 @@ void ensightFieldAscii const labelList& hexes = meshCellSets.hexes; const labelList& polys = meshCellSets.polys; - OFstream *ensightFilePtr = NULL; + OFstream *ensightFilePtr = nullptr; if (Pstream::master()) { // set the filename of the ensight file @@ -708,7 +708,7 @@ void ensightFieldBinary const labelList& hexes = meshCellSets.hexes; const labelList& polys = meshCellSets.polys; - std::ofstream *ensightFilePtr = NULL; + std::ofstream *ensightFilePtr = nullptr; if (Pstream::master()) { // set the filename of the ensight file diff --git a/applications/utilities/postProcessing/dataConversion/foamToEnsight/ensightMesh.C b/applications/utilities/postProcessing/dataConversion/foamToEnsight/ensightMesh.C index 0608f9a73..946b5dd01 100644 --- a/applications/utilities/postProcessing/dataConversion/foamToEnsight/ensightMesh.C +++ b/applications/utilities/postProcessing/dataConversion/foamToEnsight/ensightMesh.C @@ -966,7 +966,7 @@ void Foam::ensightMesh::writeAllFacePrims { ensightGeometryFile << key << nl << setw(10) << nPrims << nl; - if (&prims != NULL) + if (&prims != nullptr) { writeFacePrims ( @@ -993,7 +993,7 @@ void Foam::ensightMesh::writeAllFacePrims } } } - else if (&prims != NULL) + else if (&prims != nullptr) { OPstream toMaster(Pstream::scheduled, Pstream::masterNo()); toMaster<< ensMap(patchFaces, prims); @@ -1053,7 +1053,7 @@ void Foam::ensightMesh::writeAllNSided // Number of points for each face if (Pstream::master()) { - if (&prims != NULL) + if (&prims != nullptr) { writeNSidedNPointsPerFace ( @@ -1078,7 +1078,7 @@ void Foam::ensightMesh::writeAllNSided } } } - else if (&prims != NULL) + else if (&prims != nullptr) { OPstream toMaster(Pstream::scheduled, Pstream::masterNo()); toMaster<< ensMap(patchFaces, prims); @@ -1087,7 +1087,7 @@ void Foam::ensightMesh::writeAllNSided // List of points id for each face if (Pstream::master()) { - if (&prims != NULL) + if (&prims != nullptr) { writeNSidedPoints ( @@ -1114,7 +1114,7 @@ void Foam::ensightMesh::writeAllNSided } } } - else if (&prims != NULL) + else if (&prims != nullptr) { OPstream toMaster(Pstream::scheduled, Pstream::masterNo()); toMaster<< ensMap(patchFaces, prims); @@ -1177,7 +1177,7 @@ void Foam::ensightMesh::writeAllNSidedBinary // Number of points for each face if (Pstream::master()) { - if (&prims != NULL) + if (&prims != nullptr) { writeNSidedNPointsPerFaceBinary ( @@ -1202,7 +1202,7 @@ void Foam::ensightMesh::writeAllNSidedBinary } } } - else if (&prims != NULL) + else if (&prims != nullptr) { OPstream toMaster(Pstream::scheduled, Pstream::masterNo()); toMaster<< ensMap(patchFaces, prims); @@ -1211,7 +1211,7 @@ void Foam::ensightMesh::writeAllNSidedBinary // List of points id for each face if (Pstream::master()) { - if (&prims != NULL) + if (&prims != nullptr) { writeNSidedPointsBinary ( @@ -1238,7 +1238,7 @@ void Foam::ensightMesh::writeAllNSidedBinary } } } - else if (&prims != NULL) + else if (&prims != nullptr) { OPstream toMaster(Pstream::scheduled, Pstream::masterNo()); toMaster<< ensMap(patchFaces, prims); @@ -1265,7 +1265,7 @@ void Foam::ensightMesh::writeAllFacePrimsBinary writeEnsDataBinary(key,ensightGeometryFile); writeEnsDataBinary(nPrims,ensightGeometryFile); - if (&prims != NULL) + if (&prims != nullptr) { writeFacePrimsBinary ( @@ -1292,7 +1292,7 @@ void Foam::ensightMesh::writeAllFacePrimsBinary } } } - else if (&prims != NULL) + else if (&prims != nullptr) { OPstream toMaster(Pstream::scheduled, Pstream::masterNo()); toMaster<< ensMap(patchFaces, prims); @@ -1346,7 +1346,7 @@ void Foam::ensightMesh::writeAscii // set the filename of the ensight file fileName ensightGeometryFileName = timeFile + "mesh"; - OFstream *ensightGeometryFilePtr = NULL; + OFstream *ensightGeometryFilePtr = nullptr; if (Pstream::master()) { ensightGeometryFilePtr = new OFstream @@ -1475,12 +1475,12 @@ void Foam::ensightMesh::writeAscii { const nFacePrimitives& nfp = nPatchPrims_.find(patchName)(); - const labelList *trisPtr = NULL; - const labelList *quadsPtr = NULL; - const labelList *polysPtr = NULL; + const labelList *trisPtr = nullptr; + const labelList *quadsPtr = nullptr; + const labelList *polysPtr = nullptr; - const pointField *patchPointsPtr = NULL; - const faceList *patchFacesPtr = NULL; + const pointField *patchPointsPtr = nullptr; + const faceList *patchFacesPtr = nullptr; if (mesh_.boundary()[patchi].size()) { @@ -1641,7 +1641,7 @@ void Foam::ensightMesh::writeBinary // set the filename of the ensight file fileName ensightGeometryFileName = timeFile + "mesh"; - std::ofstream *ensightGeometryFilePtr = NULL; + std::ofstream *ensightGeometryFilePtr = nullptr; if (Pstream::master()) { @@ -1763,12 +1763,12 @@ void Foam::ensightMesh::writeBinary { const nFacePrimitives& nfp = nPatchPrims_.find(patchName)(); - const labelList *trisPtr = NULL; - const labelList *quadsPtr = NULL; - const labelList *polysPtr = NULL; + const labelList *trisPtr = nullptr; + const labelList *quadsPtr = nullptr; + const labelList *polysPtr = nullptr; - const pointField *patchPointsPtr = NULL; - const faceList *patchFacesPtr = NULL; + const pointField *patchPointsPtr = nullptr; + const faceList *patchFacesPtr = nullptr; if (mesh_.boundary()[patchi].size()) { diff --git a/applications/utilities/postProcessing/dataConversion/foamToEnsight/foamToEnsight.C b/applications/utilities/postProcessing/dataConversion/foamToEnsight/foamToEnsight.C index 3d605a941..2ff32753a 100644 --- a/applications/utilities/postProcessing/dataConversion/foamToEnsight/foamToEnsight.C +++ b/applications/utilities/postProcessing/dataConversion/foamToEnsight/foamToEnsight.C @@ -150,7 +150,7 @@ int main(int argc, char *argv[]) const word prepend = args.globalCaseName() + '.'; - OFstream *ensightCaseFilePtr = NULL; + OFstream *ensightCaseFilePtr = nullptr; if (Pstream::master()) { fileName caseFileName = prepend + "case"; diff --git a/applications/utilities/postProcessing/dataConversion/foamToFieldview9/foamToFieldview9.C b/applications/utilities/postProcessing/dataConversion/foamToFieldview9/foamToFieldview9.C index 228219dbb..df4aae473 100644 --- a/applications/utilities/postProcessing/dataConversion/foamToFieldview9/foamToFieldview9.C +++ b/applications/utilities/postProcessing/dataConversion/foamToFieldview9/foamToFieldview9.C @@ -277,7 +277,7 @@ int main(int argc, char *argv[]) } // Current mesh. Start off from unloaded mesh. - autoPtr topoPtr(NULL); + autoPtr topoPtr(nullptr); label fieldViewTime = 0; @@ -410,7 +410,7 @@ int main(int argc, char *argv[]) writeInt(fvFile, volFieldNames.size()); forAll(volFieldNames, fieldI) { - if (volFieldPtrs[fieldI] == NULL) + if (volFieldPtrs[fieldI] == nullptr) { Info<< " dummy field for " << volFieldNames[fieldI].c_str() << endl; @@ -436,7 +436,7 @@ int main(int argc, char *argv[]) } forAll(surfFieldNames, fieldI) { - if (surfFieldPtrs[fieldI] == NULL) + if (surfFieldPtrs[fieldI] == nullptr) { Info<< " dummy surface field for " << surfFieldNames[fieldI].c_str() << endl; @@ -644,7 +644,7 @@ int main(int argc, char *argv[]) forAll(volFieldPtrs, fieldI) { - if (volFieldPtrs[fieldI] != NULL) + if (volFieldPtrs[fieldI] != nullptr) { const volScalarField& vField = *volFieldPtrs[fieldI]; @@ -689,7 +689,7 @@ int main(int argc, char *argv[]) forAll(volFieldPtrs, fieldI) { - if (volFieldPtrs[fieldI] != NULL) + if (volFieldPtrs[fieldI] != nullptr) { const volScalarField& vsf = *volFieldPtrs[fieldI]; @@ -730,7 +730,7 @@ int main(int argc, char *argv[]) // surfFields forAll(surfFieldPtrs, fieldI) { - if (surfFieldPtrs[fieldI] != NULL) + if (surfFieldPtrs[fieldI] != nullptr) { const surfaceScalarField& ssf = *surfFieldPtrs[fieldI]; @@ -778,7 +778,7 @@ int main(int argc, char *argv[]) writeInt(fvFile, FV_ARB_POLY_BNDRY_VARS); forAll(volFieldPtrs, fieldI) { - if (volFieldPtrs[fieldI] != NULL) + if (volFieldPtrs[fieldI] != nullptr) { const volScalarField& vsf = *volFieldPtrs[fieldI]; @@ -815,7 +815,7 @@ int main(int argc, char *argv[]) // surfFields forAll(surfFieldPtrs, fieldI) { - if (surfFieldPtrs[fieldI] != NULL) + if (surfFieldPtrs[fieldI] != nullptr) { const surfaceScalarField& ssf = *surfFieldPtrs[fieldI]; @@ -920,7 +920,7 @@ int main(int argc, char *argv[]) forAll(sprayScalarFieldPtrs, fieldI) { - if (sprayScalarFieldPtrs[fieldI] != NULL) + if (sprayScalarFieldPtrs[fieldI] != nullptr) { const IOField& sprayField = *sprayScalarFieldPtrs[fieldI]; @@ -937,7 +937,7 @@ int main(int argc, char *argv[]) } forAll(sprayVectorFieldPtrs, fieldI) { - if (sprayVectorFieldPtrs[fieldI] != NULL) + if (sprayVectorFieldPtrs[fieldI] != nullptr) { const IOField& sprayVectorField = *sprayVectorFieldPtrs[fieldI]; diff --git a/applications/utilities/postProcessing/dataConversion/foamToTecplot360/tecplotWriter.C b/applications/utilities/postProcessing/dataConversion/foamToTecplot360/tecplotWriter.C index 8affebe5f..6c56b4084 100644 --- a/applications/utilities/postProcessing/dataConversion/foamToTecplot360/tecplotWriter.C +++ b/applications/utilities/postProcessing/dataConversion/foamToTecplot360/tecplotWriter.C @@ -112,8 +112,8 @@ Pout<< "zoneName:" << zoneName - INTEGER4 *PassiveVarArray = NULL; - INTEGER4 *VarShareArray = NULL; + INTEGER4 *PassiveVarArray = nullptr; + INTEGER4 *VarShareArray = nullptr; INTEGER4 ShrConn = 0; INTEGER4 NumBConns = 0; /* No Boundary Connections */ @@ -192,8 +192,8 @@ Pout<< "zoneName:" << zoneName << endl; - INTEGER4 *PassiveVarArray = NULL; - INTEGER4 *VarShareArray = NULL; + INTEGER4 *PassiveVarArray = nullptr; + INTEGER4 *VarShareArray = nullptr; INTEGER4 ShrConn = 0; INTEGER4 NumBConns = 0; /* No Boundary Connections */ @@ -274,8 +274,8 @@ Pout<< "zoneName:" << zoneName << endl; - INTEGER4 *PassiveVarArray = NULL; - INTEGER4 *VarShareArray = NULL; + INTEGER4 *PassiveVarArray = nullptr; + INTEGER4 *VarShareArray = nullptr; INTEGER4 ShrConn = 0; @@ -374,9 +374,9 @@ void Foam::tecplotWriter::writeConnectivity(const fvMesh& mesh) const FaceNodes.begin(), /* The face nodes array */ FaceLeftElems.begin(), /* The left elements array */ FaceRightElems.begin(), /* The right elements array */ - NULL, /* No boundary connection counts */ - NULL, /* No boundary connection elements */ - NULL /* No boundary connection zones */ + nullptr, /* No boundary connection counts */ + nullptr, /* No boundary connection elements */ + nullptr /* No boundary connection zones */ ) ) { @@ -488,9 +488,9 @@ void Foam::tecplotWriter::writeConnectivity FaceNodes.begin(), /* The face nodes array */ FaceLeftElems.begin(), /* The left elements array */ FaceRightElems.begin(), /* The right elements array */ - NULL, /* No boundary connection counts */ - NULL, /* No boundary connection elements */ - NULL /* No boundary connection zones */ + nullptr, /* No boundary connection counts */ + nullptr, /* No boundary connection elements */ + nullptr /* No boundary connection zones */ ) ) { diff --git a/applications/utilities/postProcessing/dataConversion/smapToFoam/smapToFoam.C b/applications/utilities/postProcessing/dataConversion/smapToFoam/smapToFoam.C index d46a9d4a6..fb0e48fd4 100644 --- a/applications/utilities/postProcessing/dataConversion/smapToFoam/smapToFoam.C +++ b/applications/utilities/postProcessing/dataConversion/smapToFoam/smapToFoam.C @@ -204,14 +204,14 @@ int main(int argc, char *argv[]) sFields[i]->correctBoundaryConditions(); sFields[i]->write(); delete sFields[i]; - sFields[i] = NULL; + sFields[i] = nullptr; } else if (vFields[i]) { vFields[i]->correctBoundaryConditions(); vFields[i]->write(); delete vFields[i]; - vFields[i] = NULL; + vFields[i] = nullptr; } } diff --git a/applications/utilities/postProcessing/graphics/PVReaders/vtkPVFoam/vtkPVFoam.C b/applications/utilities/postProcessing/graphics/PVReaders/vtkPVFoam/vtkPVFoam.C index a9950b06c..218d22522 100644 --- a/applications/utilities/postProcessing/graphics/PVReaders/vtkPVFoam/vtkPVFoam.C +++ b/applications/utilities/postProcessing/graphics/PVReaders/vtkPVFoam/vtkPVFoam.C @@ -82,7 +82,7 @@ void Foam::vtkPVFoam::reduceMemory() if (!reader_->GetCacheMesh()) { delete meshPtr_; - meshPtr_ = NULL; + meshPtr_ = nullptr; } } @@ -222,8 +222,8 @@ Foam::vtkPVFoam::vtkPVFoam ) : reader_(reader), - dbPtr_(NULL), - meshPtr_(NULL), + dbPtr_(nullptr), + meshPtr_(nullptr), meshRegion_(polyMesh::defaultRegion), meshDir_(polyMesh::meshSubDir), timeIndex_(-1), @@ -343,7 +343,7 @@ void Foam::vtkPVFoam::updateInfo() if (debug) { Info<< " Foam::vtkPVFoam::updateInfo" - << " [meshPtr=" << (meshPtr_ ? "set" : "NULL") << "] timeIndex=" + << " [meshPtr=" << (meshPtr_ ? "set" : "nullptr") << "] timeIndex=" << timeIndex_ << endl; } @@ -412,7 +412,7 @@ void Foam::vtkPVFoam::updateFoamMesh() if (!reader_->GetCacheMesh()) { delete meshPtr_; - meshPtr_ = NULL; + meshPtr_ = nullptr; } // Check to see if the FOAM mesh has been created @@ -533,7 +533,7 @@ void Foam::vtkPVFoam::CleanUp() double* Foam::vtkPVFoam::findTimes(int& nTimeSteps) { int nTimes = 0; - double* tsteps = NULL; + double* tsteps = nullptr; if (dbPtr_.valid()) { diff --git a/applications/utilities/postProcessing/graphics/PVReaders/vtkPVFoam/vtkPVFoamMeshLagrangian.C b/applications/utilities/postProcessing/graphics/PVReaders/vtkPVFoam/vtkPVFoamMeshLagrangian.C index 9b26d7bd7..dbd284a69 100644 --- a/applications/utilities/postProcessing/graphics/PVReaders/vtkPVFoam/vtkPVFoamMeshLagrangian.C +++ b/applications/utilities/postProcessing/graphics/PVReaders/vtkPVFoam/vtkPVFoamMeshLagrangian.C @@ -47,7 +47,7 @@ vtkPolyData* Foam::vtkPVFoam::lagrangianVTKMesh const word& cloudName ) { - vtkPolyData* vtkmesh = NULL; + vtkPolyData* vtkmesh = nullptr; if (debug) { diff --git a/applications/utilities/postProcessing/graphics/PVReaders/vtkPVFoam/vtkPVFoamUpdateInfo.C b/applications/utilities/postProcessing/graphics/PVReaders/vtkPVFoam/vtkPVFoamUpdateInfo.C index b5ebf1f40..079411d0e 100644 --- a/applications/utilities/postProcessing/graphics/PVReaders/vtkPVFoam/vtkPVFoamUpdateInfo.C +++ b/applications/utilities/postProcessing/graphics/PVReaders/vtkPVFoam/vtkPVFoamUpdateInfo.C @@ -198,7 +198,7 @@ void Foam::vtkPVFoam::updateInfoPatches() if (debug) { Info<< " Foam::vtkPVFoam::updateInfoPatches" - << " [meshPtr=" << (meshPtr_ ? "set" : "NULL") << "]" << endl; + << " [meshPtr=" << (meshPtr_ ? "set" : "nullptr") << "]" << endl; } vtkDataArraySelection* partSelection = reader_->GetPartSelection(); @@ -292,7 +292,7 @@ void Foam::vtkPVFoam::updateInfoZones() if (debug) { Info<< " Foam::vtkPVFoam::updateInfoZones" - << " [meshPtr=" << (meshPtr_ ? "set" : "NULL") << "]" << endl; + << " [meshPtr=" << (meshPtr_ ? "set" : "nullptr") << "]" << endl; } vtkDataArraySelection* partSelection = reader_->GetPartSelection(); diff --git a/applications/utilities/postProcessing/graphics/PVReaders/vtkPVFoam/vtkPVFoamUpdateInfoFields.H b/applications/utilities/postProcessing/graphics/PVReaders/vtkPVFoam/vtkPVFoamUpdateInfoFields.H index 0c2184781..67cbf923c 100644 --- a/applications/utilities/postProcessing/graphics/PVReaders/vtkPVFoam/vtkPVFoamUpdateInfoFields.H +++ b/applications/utilities/postProcessing/graphics/PVReaders/vtkPVFoam/vtkPVFoamUpdateInfoFields.H @@ -41,7 +41,7 @@ void Foam::vtkPVFoam::updateInfoFields { Info<< " Foam::vtkPVFoam::updateInfoFields <" << meshType::Mesh::typeName - << "> [meshPtr=" << (meshPtr_ ? "set" : "NULL") << "]" + << "> [meshPtr=" << (meshPtr_ ? "set" : "nullptr") << "]" << endl; } diff --git a/applications/utilities/postProcessing/graphics/ensightFoamReader/USERD_set_filenames.H b/applications/utilities/postProcessing/graphics/ensightFoamReader/USERD_set_filenames.H index 712ce53b8..41b5567cb 100644 --- a/applications/utilities/postProcessing/graphics/ensightFoamReader/USERD_set_filenames.H +++ b/applications/utilities/postProcessing/graphics/ensightFoamReader/USERD_set_filenames.H @@ -10,7 +10,7 @@ int USERD_set_filenames ) { #ifdef ENSIGHTDEBUG - Info << "Entering: USERD_set_filenames" << endl << flush; + Info<< "Entering: USERD_set_filenames" << endl << flush; #endif char tmp[100]; @@ -28,7 +28,7 @@ int USERD_set_filenames // remove the last '/' from rootDir if (the_path[lRoot-1] == '/') { - the_path[lRoot-1] = (char)NULL; + the_path[lRoot-1] = '\0'; } else { @@ -99,7 +99,7 @@ int USERD_set_filenames label nVar = 0; wordList scalars = objects.names(scalarName); - for (label n=0; n lagrangian(*meshPtr); + Cloud lagrangian(*meshPtr, cloud::defaultName); n++; - if (lagrangian.size()) + if (lagrangian.size() > 0) { lagrangianNamesFound = true; } @@ -171,20 +171,19 @@ int USERD_set_filenames false ); + if (sprayHeader.headerOk()) { Info << "[Found lagrangian]" << endl; delete sprayPtr; - sprayPtr = new Cloud(*meshPtr); + sprayPtr = new Cloud(*meshPtr, cloud::defaultName); IOobjectList objects(*meshPtr, runTime.timeName(), cloud::prefix); - lagrangianScalarNames = - (const wordList&)objects.names(sprayScalarFieldName); - lagrangianVectorNames = - (const wordList&)objects.names(sprayVectorFieldName); + lagrangianScalarNames = objects.names(sprayScalarFieldName); + lagrangianVectorNames = objects.names(sprayVectorFieldName); isSpray[fieldNames.size()] = true; @@ -201,9 +200,8 @@ int USERD_set_filenames Numparts_available = Num_unstructured_parts + Num_structured_parts + nPatches; #ifdef ENSIGHTDEBUG - Info << "Leaving: USERD_set_filenames" << endl << flush; + Info<< "Leaving: USERD_set_filenames" << endl << flush; #endif return Z_OK; } - diff --git a/applications/utilities/postProcessing/graphics/fieldview9Reader/readerDatabase.C b/applications/utilities/postProcessing/graphics/fieldview9Reader/readerDatabase.C index 0bb8c2796..ed15a9a2b 100644 --- a/applications/utilities/postProcessing/graphics/fieldview9Reader/readerDatabase.C +++ b/applications/utilities/postProcessing/graphics/fieldview9Reader/readerDatabase.C @@ -84,8 +84,8 @@ void Foam::readerDatabase::getPolyHedra() Foam::readerDatabase::readerDatabase() : fieldviewNames_(10), - runTimePtr_(NULL), - meshPtr_(NULL), + runTimePtr_(nullptr), + meshPtr_(nullptr), setName_(""), polys_(), volScalarNames_(), diff --git a/applications/utilities/postProcessing/graphics/newEnsightFoamReader/USERD_set_filenames.H b/applications/utilities/postProcessing/graphics/newEnsightFoamReader/USERD_set_filenames.H index 14959b29d..d631bed89 100644 --- a/applications/utilities/postProcessing/graphics/newEnsightFoamReader/USERD_set_filenames.H +++ b/applications/utilities/postProcessing/graphics/newEnsightFoamReader/USERD_set_filenames.H @@ -10,7 +10,7 @@ int USERD_set_filenames ) { #ifdef ENSIGHTDEBUG - Info << "Entering: USERD_set_filenames" << endl << flush; + Info<< "Entering: USERD_set_filenames" << endl << flush; #endif char tmp[100]; @@ -28,7 +28,7 @@ int USERD_set_filenames // remove the last '/' from rootDir if (the_path[lRoot-1] == '/') { - the_path[lRoot-1] = (char)NULL; + the_path[lRoot-1] = '\0'; } else { @@ -54,7 +54,6 @@ int USERD_set_filenames return Z_ERR; } - // construct the global pointers to the database and mesh delete meshPtr; @@ -80,7 +79,7 @@ int USERD_set_filenames ); // set the available number of time-steps - TimeList = (const instantList&)Foam::Time::findTimes(rootDir/caseDir); + TimeList = Foam::Time::findTimes(rootDir/caseDir); Num_time_steps = TimeList.size() - 1; @@ -88,10 +87,10 @@ int USERD_set_filenames // set the number of fields and store their names // a valid field must exist for all time-steps - runTime.setTime(TimeList[TimeList.size()-1], TimeList.size()-1); + runTime.setTime(TimeList.last(), TimeList.size() - 1); IOobjectList objects(*meshPtr, runTime.timeName()); - fieldNames = (const wordList&)objects.names(); + fieldNames = objects.names(); // because of the spray being a 'field' ... // get the availabe number of variables and @@ -100,7 +99,7 @@ int USERD_set_filenames label nVar = 0; wordList scalars = objects.names(scalarName); - for (label n=0; n lagrangian(*meshPtr); + Cloud lagrangian(*meshPtr, cloud::defaultName); n++; - if (lagrangian.size()>0) + if (lagrangian.size() > 0) { lagrangianNamesFound = true; } @@ -179,14 +178,12 @@ int USERD_set_filenames delete sprayPtr; - sprayPtr = new Cloud(*meshPtr); + sprayPtr = new Cloud(*meshPtr, cloud::defaultName); - IOobjectList objects(*meshPtr, runTime.timeName(), "lagrangian"); + IOobjectList objects(*meshPtr, runTime.timeName(), cloud::prefix); - lagrangianScalarNames = - (const wordList&)objects.names(sprayScalarFieldName); - lagrangianVectorNames = - (const wordList&)objects.names(sprayVectorFieldName); + lagrangianScalarNames = objects.names(sprayScalarFieldName); + lagrangianVectorNames = objects.names(sprayVectorFieldName); isSpray[fieldNames.size()] = true; @@ -281,7 +278,7 @@ int USERD_set_filenames ); } - if(secondMeshPtr) + if (secondMeshPtr) { Num_unstructured_parts += 1; @@ -443,9 +440,8 @@ int USERD_set_filenames #ifdef ENSIGHTDEBUG - Info << "Leaving: USERD_set_filenames" << endl << flush; + Info<< "Leaving: USERD_set_filenames" << endl << flush; #endif return Z_OK; } - diff --git a/applications/utilities/surface/surfaceCoarsen/bunnylod/progmesh.C b/applications/utilities/surface/surfaceCoarsen/bunnylod/progmesh.C index ec29fd02f..d393e7e7d 100644 --- a/applications/utilities/surface/surfaceCoarsen/bunnylod/progmesh.C +++ b/applications/utilities/surface/surfaceCoarsen/bunnylod/progmesh.C @@ -197,12 +197,12 @@ void ComputeEdgeCostAtVertex(Vertex *v) { // cost (in member variable objdist). if(v->neighbor.num==0) { // v doesn't have neighbors so it costs nothing to collapse - v->collapse=NULL; + v->collapse=nullptr; v->objdist=-0.01f; return; } v->objdist = 1000000; - v->collapse=NULL; + v->collapse=nullptr; // search all neighboring edges for "least cost" edge for(int i=0;ineighbor.num;i++) { float dist; diff --git a/applications/utilities/surface/surfaceCoarsen/bunnylod/winmain.C b/applications/utilities/surface/surfaceCoarsen/bunnylod/winmain.C index f9b960093..a051a8503 100644 --- a/applications/utilities/surface/surfaceCoarsen/bunnylod/winmain.C +++ b/applications/utilities/surface/surfaceCoarsen/bunnylod/winmain.C @@ -271,33 +271,33 @@ HWND CreateOpenGLWindow(char* title) /* only register the window class once - use hInstance as a flag. */ if (!hInstance) { - hInstance = GetModuleHandle(NULL); + hInstance = GetModuleHandle(nullptr); wc.style = CS_OWNDC; wc.lpfnWndProc = (WNDPROC)WindowProc; wc.cbClsExtra = 0; wc.cbWndExtra = 0; wc.hInstance = hInstance; - wc.hIcon = LoadIcon(NULL, IDI_WINLOGO); - wc.hCursor = LoadCursor(NULL, IDC_ARROW); - wc.hbrBackground = NULL; - wc.lpszMenuName = NULL; + wc.hIcon = LoadIcon(nullptr, IDI_WINLOGO); + wc.hCursor = LoadCursor(nullptr, IDC_ARROW); + wc.hbrBackground = nullptr; + wc.lpszMenuName = nullptr; wc.lpszClassName = "OpenGL"; if (!RegisterClass(&wc)) { - MessageBox(NULL, "RegisterClass() failed: " + MessageBox(nullptr, "RegisterClass() failed: " "Cannot register window class.", "Error", MB_OK); - return NULL; + return nullptr; } } hWnd = CreateWindow("OpenGL", title, WS_OVERLAPPEDWINDOW | WS_CLIPSIBLINGS | WS_CLIPCHILDREN, - 0,0,Width,Height, NULL, NULL, hInstance, NULL); + 0,0,Width,Height, nullptr, nullptr, hInstance, nullptr); - if (hWnd == NULL) { - MessageBox(NULL, "CreateWindow() failed: Cannot create a window.", + if (hWnd == nullptr) { + MessageBox(nullptr, "CreateWindow() failed: Cannot create a window.", "Error", MB_OK); - return NULL; + return nullptr; } hDC = GetDC(hWnd); @@ -314,13 +314,13 @@ HWND CreateOpenGLWindow(char* title) pf = ChoosePixelFormat(hDC, &pfd); if (pf == 0) { - MessageBox(NULL, "ChoosePixelFormat() failed: " + MessageBox(nullptr, "ChoosePixelFormat() failed: " "Cannot find a suitable pixel format.", "Error", MB_OK); return 0; } if (SetPixelFormat(hDC, pf, &pfd) == FALSE) { - MessageBox(NULL, "SetPixelFormat() failed: " + MessageBox(nullptr, "SetPixelFormat() failed: " "Cannot set format specified.", "Error", MB_OK); return 0; } @@ -406,7 +406,7 @@ int APIENTRY WinMain(HINSTANCE hCurrentInst, HINSTANCE hPreviousInst, CalcFPSDeltaT(); hWnd = CreateOpenGLWindow("bunnylod by Stan Melax"); - if (hWnd == NULL) exit(1); + if (hWnd == nullptr) exit(1); hDC = GetDC(hWnd); hRC = wglCreateContext(hDC); @@ -435,7 +435,7 @@ int APIENTRY WinMain(HINSTANCE hCurrentInst, HINSTANCE hPreviousInst, } quit: - wglMakeCurrent(NULL, NULL); + wglMakeCurrent(nullptr, nullptr); ReleaseDC(hDC, hWnd); wglDeleteContext(hRC); DestroyWindow(hWnd); diff --git a/applications/utilities/surface/surfaceToPatch/boundaryMesh.C b/applications/utilities/surface/surfaceToPatch/boundaryMesh.C index 74c4a5847..845d32c9a 100644 --- a/applications/utilities/surface/surfaceToPatch/boundaryMesh.C +++ b/applications/utilities/surface/surfaceToPatch/boundaryMesh.C @@ -434,7 +434,7 @@ void Foam::boundaryMesh::markZone // Null constructor Foam::boundaryMesh::boundaryMesh() : - meshPtr_(NULL), + meshPtr_(nullptr), patches_(), meshFace_(), featurePoints_(), @@ -460,7 +460,7 @@ void Foam::boundaryMesh::clearOut() { delete meshPtr_; - meshPtr_ = NULL; + meshPtr_ = nullptr; } } diff --git a/src/OSspecific/MSWindows/MSwindows.C b/src/OSspecific/MSWindows/MSwindows.C index 96474a78e..5a3761095 100644 --- a/src/OSspecific/MSWindows/MSwindows.C +++ b/src/OSspecific/MSWindows/MSwindows.C @@ -96,11 +96,11 @@ std::string MSwindows::getLastError() FORMAT_MESSAGE_ALLOCATE_BUFFER | FORMAT_MESSAGE_FROM_SYSTEM | FORMAT_MESSAGE_IGNORE_INSERTS, - NULL, + nullptr, dw, MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT), (LPTSTR) &lpMsgBuf, - 0, NULL ); + 0, nullptr ); lpDisplayBuf = LocalAlloc(LMEM_ZEROINIT, (lstrlen(static_cast(lpMsgBuf))+40)*sizeof(TCHAR)); @@ -343,7 +343,7 @@ std::string toUnixPath(const std::string & path) bool env(const word& envName) { const DWORD actualBufferSize = - ::GetEnvironmentVariable(envName.c_str(), NULL, 0); + ::GetEnvironmentVariable(envName.c_str(), nullptr, 0); const bool envExists = (0 < actualBufferSize); return envExists; @@ -355,7 +355,7 @@ string getEnv(const word& envName) std::string envAsString; const DWORD actualBufferSize = - ::GetEnvironmentVariable(envName.c_str(), NULL, 0); + ::GetEnvironmentVariable(envName.c_str(), nullptr, 0); if (0 < actualBufferSize) { @@ -461,7 +461,7 @@ fileName cwd() string currentDirectory; const DWORD actualBufferSize = - ::GetCurrentDirectory(0, NULL); + ::GetCurrentDirectory(0, nullptr); if (0 < actualBufferSize) { @@ -704,7 +704,7 @@ bool mkDir(const fileName& pathName, const mode_t mode) } - bool success = ::CreateDirectory(pathName.c_str(), NULL); + bool success = ::CreateDirectory(pathName.c_str(), nullptr); if (success) { @@ -1294,7 +1294,7 @@ void* dlOpen(const fileName& libName, const bool check) void* handle = ::LoadLibrary(winLibName.c_str()); - if (NULL == handle) + if (nullptr == handle) { // Assumes libName = name winLibName = "lib"; @@ -1304,7 +1304,7 @@ void* dlOpen(const fileName& libName, const bool check) handle = ::LoadLibrary(winLibName.c_str()); } - if (NULL != handle) + if (nullptr != handle) { getLoadedLibs()[handle] = libName; } @@ -1357,7 +1357,7 @@ void* dlSym(void* handle, const std::string& symbol) // get address of symbol void* fun = (void*) ::GetProcAddress(static_cast(handle), symbol.c_str()); - if (NULL == fun) + if (nullptr == fun) { WarningIn("dlSym(void*, const std::string&)") << "Cannot lookup symbol " << symbol << " : " << MSwindows::getLastError() @@ -1381,7 +1381,7 @@ bool dlSymFound(void* handle, const std::string& symbol) // get address of symbol void* fun = (void*) ::GetProcAddress(static_cast(handle), symbol.c_str()); - return (NULL != fun); + return (nullptr != fun); } else { diff --git a/src/OSspecific/MSWindows/clockTime/clockTime.C b/src/OSspecific/MSWindows/clockTime/clockTime.C index 8881a06d1..a22a9bf40 100644 --- a/src/OSspecific/MSWindows/clockTime/clockTime.C +++ b/src/OSspecific/MSWindows/clockTime/clockTime.C @@ -39,7 +39,7 @@ namespace Foam void clockTime::getTime(struct timeval& t) { - gettimeofday(&t, NULL); + gettimeofday(&t, nullptr); } diff --git a/src/OSspecific/MSWindows/multiThreader/multiThreader.C b/src/OSspecific/MSWindows/multiThreader/multiThreader.C index f298f8de5..2dc2f7aef 100644 --- a/src/OSspecific/MSWindows/multiThreader/multiThreader.C +++ b/src/OSspecific/MSWindows/multiThreader/multiThreader.C @@ -51,7 +51,7 @@ bool rwMutex::debug = false; multiThreader::multiThreader(int numThreads) : maxQueueSize_(10), - poolInfo_(NULL) + poolInfo_(nullptr) { if (numThreads > 0) { @@ -126,7 +126,7 @@ rwMutex::rwMutex() Conditional::Conditional() { - if (pthread_cond_init(&condition_, NULL)) + if (pthread_cond_init(&condition_, nullptr)) { FatalErrorIn("multiThreader::Conditional::Conditional()") << "Unable to initialize condition" @@ -190,8 +190,8 @@ void multiThreader::initializeThreadPool() poolInfo_->numThreads = numThreads_; poolInfo_->queueSize = 0; poolInfo_->threads = new pthread_t[numThreads_]; - poolInfo_->head = NULL; - poolInfo_->tail = NULL; + poolInfo_->head = nullptr; + poolInfo_->tail = nullptr; // Initialize flags poolInfo_->queueClosed = false; @@ -265,7 +265,7 @@ threadReturnType multiThreader::poolThread(void *arg) if (poolInfo->shutDown) { poolInfo->queueLock.unlock(); - pthread_exit(NULL); + pthread_exit(nullptr); } // Pick an item off the queue, and get to work @@ -273,7 +273,7 @@ threadReturnType multiThreader::poolThread(void *arg) poolInfo->queueSize--; if (poolInfo->queueSize == 0) { - poolInfo->head = poolInfo->tail = NULL; + poolInfo->head = poolInfo->tail = nullptr; } else { @@ -355,7 +355,7 @@ void multiThreader::addToWorkQueue workQueueItem *newWorkItem = new workQueueItem; newWorkItem->function = tFunction; newWorkItem->arg = arg; - newWorkItem->next = NULL; + newWorkItem->next = nullptr; // Add new work structure to the queue if (poolInfo_->queueSize == 0) @@ -412,7 +412,7 @@ void multiThreader::destroyThreadPool() // Wait for all workers to exit for(int i=0; i < numThreads_; i++) { - if (pthread_join(poolInfo_->threads[i],NULL)) + if (pthread_join(poolInfo_->threads[i],nullptr)) { FatalErrorIn("multiThreader::destroyThreadPool()") << "pthread_join failed." @@ -427,7 +427,7 @@ void multiThreader::destroyThreadPool() delete [] poolInfo_->threads; workQueueItem *currentNode; - while(poolInfo_->head != NULL) + while(poolInfo_->head != nullptr) { currentNode = poolInfo_->head->next; poolInfo_->head = poolInfo_->head->next; diff --git a/src/OSspecific/MSWindows/multiThreader/multiThreader.H b/src/OSspecific/MSWindows/multiThreader/multiThreader.H index b27f3d583..db1306f25 100644 --- a/src/OSspecific/MSWindows/multiThreader/multiThreader.H +++ b/src/OSspecific/MSWindows/multiThreader/multiThreader.H @@ -65,7 +65,7 @@ extern "C" typedef void *(*threadFunctionType)(void *); #define threadReturnType void * -#define threadReturnValue NULL +#define threadReturnValue nullptr // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // diff --git a/src/OSspecific/MSWindows/multiThreader/threadHandlerI.H b/src/OSspecific/MSWindows/multiThreader/threadHandlerI.H index d175f5087..1327d628b 100644 --- a/src/OSspecific/MSWindows/multiThreader/threadHandlerI.H +++ b/src/OSspecific/MSWindows/multiThreader/threadHandlerI.H @@ -57,7 +57,7 @@ threadHandler::~threadHandler() // to avoid multiple deallocations. forAll(argList_, indexI) { - argList_[indexI] = NULL; + argList_[indexI] = nullptr; } } @@ -79,7 +79,7 @@ inline void threadHandler::setSize const label size ) { - argList_.setSize(size, NULL); + argList_.setSize(size, nullptr); } diff --git a/src/OSspecific/MSWindows/printStack.C b/src/OSspecific/MSWindows/printStack.C index 5da36505c..5b30a8da6 100644 --- a/src/OSspecific/MSWindows/printStack.C +++ b/src/OSspecific/MSWindows/printStack.C @@ -58,7 +58,7 @@ string pOpen(const string &cmd, label line=0) char* s = fgets(buffer, MAX-1, cmdPipe); - if (s == NULL) + if (s == nullptr) { #ifdef darwin // workaround for the Python-Script @@ -392,7 +392,7 @@ void error::printStack(Ostream& os) char* cplusNamePtr = abi::__cxa_demangle ( cName.c_str(), - NULL, // have it malloc itself + nullptr, // have it malloc itself 0, &status ); diff --git a/src/OSspecific/MSWindows/regExp.C b/src/OSspecific/MSWindows/regExp.C index a5b9cf72d..6fbc0d2c8 100644 --- a/src/OSspecific/MSWindows/regExp.C +++ b/src/OSspecific/MSWindows/regExp.C @@ -76,7 +76,7 @@ void Foam::regExp::set(const char* pattern, const bool ignoreCase) const { clear(); - // avoid NULL pointer and zero-length patterns + // avoid nullptr pointer and zero-length patterns if (pattern && *pattern) { int cflags = EXTENDED; diff --git a/src/OSspecific/MSWindows/timer.C b/src/OSspecific/MSWindows/timer.C index f37b25528..6ef8c78d1 100644 --- a/src/OSspecific/MSWindows/timer.C +++ b/src/OSspecific/MSWindows/timer.C @@ -44,7 +44,7 @@ jmp_buf Foam::timer::envAlarm; __p_sig_fn_t Foam::timer::oldAction_ = SIG_DFL; -static HANDLE hTimer_ = NULL; +static HANDLE hTimer_ = nullptr; // * * * * * * * * * * * * * Static Member Functions * * * * * * * * * * * * // @@ -78,7 +78,7 @@ Foam::timer::timer(const unsigned int newTimeOut) if (newTimeOut > 0) { // Is singleton since handler is static function - if( NULL != hTimer_ ) + if( nullptr != hTimer_ ) { FatalErrorIn ( @@ -110,15 +110,15 @@ Foam::timer::timer(const unsigned int newTimeOut) const bool success = ::CreateTimerQueueTimer(&hTimer_, - NULL, + nullptr, (WAITORTIMERCALLBACK)timerExpired, - NULL , + nullptr , newTimeOut * 1000, 0, 0); if (!success) { - hTimer_ = NULL; + hTimer_ = nullptr; FatalErrorIn ( "Foam::timer::timer(const unsigned int)" @@ -138,8 +138,8 @@ Foam::timer::~timer() { // Reset timer const bool timerSuccess = - ::DeleteTimerQueueTimer(NULL, hTimer_, NULL); - hTimer_ = NULL; + ::DeleteTimerQueueTimer(nullptr, hTimer_, nullptr); + hTimer_ = nullptr; if (!timerSuccess) { diff --git a/src/OSspecific/POSIX/POSIX.C b/src/OSspecific/POSIX/POSIX.C index 67ed48a4f..53743a50c 100644 --- a/src/OSspecific/POSIX/POSIX.C +++ b/src/OSspecific/POSIX/POSIX.C @@ -82,7 +82,7 @@ pid_t Foam::pgid() bool Foam::env(const word& envName) { - return getenv(envName.c_str()) != NULL; + return getenv(envName.c_str()) != nullptr; } @@ -158,7 +158,7 @@ Foam::string Foam::userName() { struct passwd* pw = getpwuid(getuid()); - if (pw != NULL) + if (pw != nullptr) { return pw->pw_name; } @@ -179,7 +179,7 @@ Foam::fileName Foam::home() { char* env = getenv("HOME"); - if (env != NULL) + if (env != nullptr) { return fileName(env); } @@ -187,7 +187,7 @@ Foam::fileName Foam::home() { struct passwd* pw = getpwuid(getuid()); - if (pw != NULL) + if (pw != nullptr) { return pw->pw_dir; } @@ -211,7 +211,7 @@ Foam::fileName Foam::home(const string& userName) { char* env = getenv("HOME"); - if (env != NULL) + if (env != nullptr) { return fileName(env); } @@ -219,7 +219,7 @@ Foam::fileName Foam::home(const string& userName) pw = getpwuid(getuid()); } - if (pw != NULL) + if (pw != nullptr) { return pw->pw_dir; } @@ -670,7 +670,7 @@ Foam::fileNameList Foam::readDir label nEntries = 0; // Attempt to open directory and set the structure pointer - if ((source = opendir(directory.c_str())) == NULL) + if ((source = opendir(directory.c_str())) == nullptr) { dirEntries.setSize(0); @@ -683,7 +683,7 @@ Foam::fileNameList Foam::readDir else { // Read and parse all the entries in the directory - while ((list = readdir(source)) != NULL) + while ((list = readdir(source)) != nullptr) { fileName fName(list->d_name); @@ -976,7 +976,7 @@ bool Foam::rmDir(const fileName& directory) struct dirent *list; // Attempt to open directory and set the structure pointer - if ((source = opendir(directory.c_str())) == NULL) + if ((source = opendir(directory.c_str())) == nullptr) { WarningInFunction << "cannot open directory " << directory << endl; @@ -986,7 +986,7 @@ bool Foam::rmDir(const fileName& directory) else { // Read and parse all the entries in the directory - while ((list = readdir(source)) != NULL) + while ((list = readdir(source)) != nullptr) { fileName fName(list->d_name); @@ -1074,7 +1074,7 @@ bool Foam::ping struct sockaddr_in destAddr; // will hold the destination addr u_int addr; - if ((hostPtr = gethostbyname(destName.c_str())) == NULL) + if ((hostPtr = gethostbyname(destName.c_str())) == nullptr) { FatalErrorIn ( diff --git a/src/OSspecific/POSIX/clockTime/clockTime.C b/src/OSspecific/POSIX/clockTime/clockTime.C index 8881a06d1..a22a9bf40 100644 --- a/src/OSspecific/POSIX/clockTime/clockTime.C +++ b/src/OSspecific/POSIX/clockTime/clockTime.C @@ -39,7 +39,7 @@ namespace Foam void clockTime::getTime(struct timeval& t) { - gettimeofday(&t, NULL); + gettimeofday(&t, nullptr); } diff --git a/src/OSspecific/POSIX/fileMonitor.C b/src/OSspecific/POSIX/fileMonitor.C index 98f34ee45..755a9c274 100644 --- a/src/OSspecific/POSIX/fileMonitor.C +++ b/src/OSspecific/POSIX/fileMonitor.C @@ -313,8 +313,8 @@ void Foam::fileMonitor::checkFiles() const ( watcher_->inotifyFd_+1, // num filedescriptors in fdSet &fdSet, // fdSet with only inotifyFd - NULL, // No writefds - NULL, // No errorfds + nullptr, // No writefds + nullptr, // No errorfds &zeroTimeout // eNo timeout ); diff --git a/src/OSspecific/POSIX/multiThreader/multiThreader.C b/src/OSspecific/POSIX/multiThreader/multiThreader.C index 3204dd4e0..29439e2c8 100644 --- a/src/OSspecific/POSIX/multiThreader/multiThreader.C +++ b/src/OSspecific/POSIX/multiThreader/multiThreader.C @@ -51,7 +51,7 @@ bool rwMutex::debug = false; multiThreader::multiThreader(int numThreads) : maxQueueSize_(10), - poolInfo_(NULL) + poolInfo_(nullptr) { if (numThreads > 0) { @@ -133,7 +133,7 @@ rwMutex::rwMutex() Conditional::Conditional() { - if (pthread_cond_init(&condition_, NULL)) + if (pthread_cond_init(&condition_, nullptr)) { FatalErrorIn("multiThreader::Conditional::Conditional()") << "Unable to initialize condition" @@ -197,8 +197,8 @@ void multiThreader::initializeThreadPool() poolInfo_->numThreads = numThreads_; poolInfo_->queueSize = 0; poolInfo_->threads = new pthread_t[numThreads_]; - poolInfo_->head = NULL; - poolInfo_->tail = NULL; + poolInfo_->head = nullptr; + poolInfo_->tail = nullptr; // Initialize flags poolInfo_->queueClosed = false; @@ -272,7 +272,7 @@ threadReturnType multiThreader::poolThread(void *arg) if (poolInfo->shutDown) { poolInfo->queueLock.unlock(); - pthread_exit(NULL); + pthread_exit(nullptr); } // Pick an item off the queue, and get to work @@ -280,7 +280,7 @@ threadReturnType multiThreader::poolThread(void *arg) poolInfo->queueSize--; if (poolInfo->queueSize == 0) { - poolInfo->head = poolInfo->tail = NULL; + poolInfo->head = poolInfo->tail = nullptr; } else { @@ -362,7 +362,7 @@ void multiThreader::addToWorkQueue workQueueItem *newWorkItem = new workQueueItem; newWorkItem->function = tFunction; newWorkItem->arg = arg; - newWorkItem->next = NULL; + newWorkItem->next = nullptr; // Add new work structure to the queue if (poolInfo_->queueSize == 0) @@ -419,7 +419,7 @@ void multiThreader::destroyThreadPool() // Wait for all workers to exit for(int i=0; i < numThreads_; i++) { - if (pthread_join(poolInfo_->threads[i],NULL)) + if (pthread_join(poolInfo_->threads[i],nullptr)) { FatalErrorIn("multiThreader::destroyThreadPool()") << "pthread_join failed." @@ -434,7 +434,7 @@ void multiThreader::destroyThreadPool() delete [] poolInfo_->threads; workQueueItem *currentNode; - while(poolInfo_->head != NULL) + while(poolInfo_->head != nullptr) { currentNode = poolInfo_->head->next; poolInfo_->head = poolInfo_->head->next; diff --git a/src/OSspecific/POSIX/multiThreader/multiThreader.H b/src/OSspecific/POSIX/multiThreader/multiThreader.H index b27f3d583..db1306f25 100644 --- a/src/OSspecific/POSIX/multiThreader/multiThreader.H +++ b/src/OSspecific/POSIX/multiThreader/multiThreader.H @@ -65,7 +65,7 @@ extern "C" typedef void *(*threadFunctionType)(void *); #define threadReturnType void * -#define threadReturnValue NULL +#define threadReturnValue nullptr // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // diff --git a/src/OSspecific/POSIX/multiThreader/threadHandlerI.H b/src/OSspecific/POSIX/multiThreader/threadHandlerI.H index d175f5087..1327d628b 100644 --- a/src/OSspecific/POSIX/multiThreader/threadHandlerI.H +++ b/src/OSspecific/POSIX/multiThreader/threadHandlerI.H @@ -57,7 +57,7 @@ threadHandler::~threadHandler() // to avoid multiple deallocations. forAll(argList_, indexI) { - argList_[indexI] = NULL; + argList_[indexI] = nullptr; } } @@ -79,7 +79,7 @@ inline void threadHandler::setSize const label size ) { - argList_.setSize(size, NULL); + argList_.setSize(size, nullptr); } diff --git a/src/OSspecific/POSIX/printStack.C b/src/OSspecific/POSIX/printStack.C index 7537c8d92..e38d4e899 100644 --- a/src/OSspecific/POSIX/printStack.C +++ b/src/OSspecific/POSIX/printStack.C @@ -61,7 +61,7 @@ string pOpen(const string &cmd, label line=0) char* s = fgets(buffer, MAX-1, cmdPipe); - if (s == NULL) + if (s == nullptr) { #ifdef darwin // workaround for the Python-Script @@ -346,7 +346,7 @@ void error::printStack(Ostream& os) char* cplusNamePtr = abi::__cxa_demangle ( cName.c_str(), - NULL, // have it malloc itself + nullptr, // have it malloc itself 0, &status ); diff --git a/src/OSspecific/POSIX/regExp.C b/src/OSspecific/POSIX/regExp.C index 5b04a7208..8cfbae2ee 100644 --- a/src/OSspecific/POSIX/regExp.C +++ b/src/OSspecific/POSIX/regExp.C @@ -119,7 +119,7 @@ void Foam::regExp::set(const char* pattern, const bool ignoreCase) const { clear(); - // Avoid NULL pointer and zero-length patterns + // Avoid nullptr pointer and zero-length patterns if (pattern && *pattern) { int cflags = REG_EXTENDED; diff --git a/src/OSspecific/POSIX/signals/sigFpe.C b/src/OSspecific/POSIX/signals/sigFpe.C index aba0027cc..6b48544ec 100644 --- a/src/OSspecific/POSIX/signals/sigFpe.C +++ b/src/OSspecific/POSIX/signals/sigFpe.C @@ -99,7 +99,7 @@ void* Foam::sigFpe::mallocNan(size_t size) #elif defined(__APPLE__) -void *(*Foam::sigFpe::system_malloc_)(malloc_zone_t *zone, size_t size)=NULL; +void *(*Foam::sigFpe::system_malloc_)(malloc_zone_t *zone, size_t size)=nullptr; void* Foam::sigFpe::nan_malloc_(malloc_zone_t *zone, size_t size) { @@ -135,7 +135,7 @@ void* Foam::sigFpe::nan_malloc_(malloc_zone_t *zone, size_t size) void Foam::sigFpe::sigHandler(int) { // Reset old handling - if (sigaction(SIGFPE, &oldAction_, NULL) < 0) + if (sigaction(SIGFPE, &oldAction_, nullptr) < 0) { FatalErrorIn ( @@ -159,7 +159,7 @@ void Foam::sigFpe::sigHandler(int) Foam::sigFpe::sigFpe() { - oldAction_.sa_handler = NULL; + oldAction_.sa_handler = nullptr; } @@ -171,7 +171,7 @@ Foam::sigFpe::~sigFpe() { # ifdef LINUX_GNUC // Reset signal - if (oldAction_.sa_handler && sigaction(SIGFPE, &oldAction_, NULL) < 0) + if (oldAction_.sa_handler && sigaction(SIGFPE, &oldAction_, nullptr) < 0) { FatalErrorIn ( @@ -256,7 +256,7 @@ void Foam::sigFpe::set(const bool verbose) | _EN_OVERFL, 0, _ABORT_ON_ERROR, - NULL + nullptr ); # elif defined(__APPLE__) @@ -305,7 +305,7 @@ void Foam::sigFpe::set(const bool verbose) # elif defined(__APPLE__) - if(system_malloc_!=NULL) { + if(system_malloc_!=nullptr) { FatalErrorIn("Foam__sigFpe::set") << "system_malloc_ already reset." << endl << "This should never happen" @@ -314,7 +314,7 @@ void Foam::sigFpe::set(const bool verbose) } malloc_zone_t *zone = malloc_default_zone(); - if(zone==NULL) { + if(zone==nullptr) { FatalErrorIn("Foam__sigFpe::set") << "Could not get malloc_default_zone()." << endl << "Seems like this version of Mac OS X doesn't support FOAM_SETNAN" diff --git a/src/OSspecific/POSIX/signals/sigInt.C b/src/OSspecific/POSIX/signals/sigInt.C index 95dc4215d..21ef8755d 100644 --- a/src/OSspecific/POSIX/signals/sigInt.C +++ b/src/OSspecific/POSIX/signals/sigInt.C @@ -38,7 +38,7 @@ struct sigaction Foam::sigInt::oldAction_; void Foam::sigInt::sigHandler(int) { // Reset old handling - if (sigaction(SIGINT, &oldAction_, NULL) < 0) + if (sigaction(SIGINT, &oldAction_, nullptr) < 0) { FatalErrorIn ( @@ -59,7 +59,7 @@ void Foam::sigInt::sigHandler(int) Foam::sigInt::sigInt() { - oldAction_.sa_handler = NULL; + oldAction_.sa_handler = nullptr; } @@ -68,7 +68,7 @@ Foam::sigInt::sigInt() Foam::sigInt::~sigInt() { // Reset old handling - if (sigaction(SIGINT, &oldAction_, NULL) < 0) + if (sigaction(SIGINT, &oldAction_, nullptr) < 0) { FatalErrorIn ( diff --git a/src/OSspecific/POSIX/signals/sigQuit.C b/src/OSspecific/POSIX/signals/sigQuit.C index dc951e502..eb465ba79 100644 --- a/src/OSspecific/POSIX/signals/sigQuit.C +++ b/src/OSspecific/POSIX/signals/sigQuit.C @@ -38,7 +38,7 @@ struct sigaction Foam::sigQuit::oldAction_; void Foam::sigQuit::sigHandler(int) { // Reset old handling - if (sigaction(SIGQUIT, &oldAction_, NULL) < 0) + if (sigaction(SIGQUIT, &oldAction_, nullptr) < 0) { FatalErrorIn ( @@ -61,7 +61,7 @@ void Foam::sigQuit::sigHandler(int) Foam::sigQuit::sigQuit() { - oldAction_.sa_handler = NULL; + oldAction_.sa_handler = nullptr; } @@ -70,7 +70,7 @@ Foam::sigQuit::sigQuit() Foam::sigQuit::~sigQuit() { // Reset old handling - if (oldAction_.sa_handler && sigaction(SIGQUIT, &oldAction_, NULL) < 0) + if (oldAction_.sa_handler && sigaction(SIGQUIT, &oldAction_, nullptr) < 0) { FatalErrorIn ( diff --git a/src/OSspecific/POSIX/signals/sigSegv.C b/src/OSspecific/POSIX/signals/sigSegv.C index b38a7c301..9dadf0ec5 100644 --- a/src/OSspecific/POSIX/signals/sigSegv.C +++ b/src/OSspecific/POSIX/signals/sigSegv.C @@ -37,7 +37,7 @@ struct sigaction Foam::sigSegv::oldAction_; void Foam::sigSegv::sigHandler(int) { // Reset old handling - if (sigaction(SIGSEGV, &oldAction_, NULL) < 0) + if (sigaction(SIGSEGV, &oldAction_, nullptr) < 0) { FatalErrorIn ( @@ -60,7 +60,7 @@ void Foam::sigSegv::sigHandler(int) Foam::sigSegv::sigSegv() { - oldAction_.sa_handler = NULL; + oldAction_.sa_handler = nullptr; } @@ -69,7 +69,7 @@ Foam::sigSegv::sigSegv() Foam::sigSegv::~sigSegv() { // Reset old handling - if (sigaction(SIGSEGV, &oldAction_, NULL) < 0) + if (sigaction(SIGSEGV, &oldAction_, nullptr) < 0) { FatalErrorIn ( diff --git a/src/OSspecific/POSIX/timer.C b/src/OSspecific/POSIX/timer.C index a4e97f982..7fab15fbf 100644 --- a/src/OSspecific/POSIX/timer.C +++ b/src/OSspecific/POSIX/timer.C @@ -125,7 +125,7 @@ Foam::timer::~timer() oldTimeOut_ = 0; // Restore signal handler - if (sigaction(SIGALRM, &oldAction_, NULL) < 0) + if (sigaction(SIGALRM, &oldAction_, nullptr) < 0) { FatalErrorIn ( diff --git a/src/POD/PODOrthoNormalBase/PODOrthoNormalBase.C b/src/POD/PODOrthoNormalBase/PODOrthoNormalBase.C index 2959477eb..e009d1a61 100644 --- a/src/POD/PODOrthoNormalBase/PODOrthoNormalBase.C +++ b/src/POD/PODOrthoNormalBase/PODOrthoNormalBase.C @@ -225,7 +225,7 @@ Foam::PODOrthoNormalBase::PODOrthoNormalBase ) : orthoFields_(), - interpolationCoeffsPtr_(NULL) + interpolationCoeffsPtr_(nullptr) { calcOrthoBase(snapshots, accuracy); } diff --git a/src/POD/scalarTransportPOD/scalarTransportPOD.C b/src/POD/scalarTransportPOD/scalarTransportPOD.C index d089ee8ce..7fe0c5d39 100644 --- a/src/POD/scalarTransportPOD/scalarTransportPOD.C +++ b/src/POD/scalarTransportPOD/scalarTransportPOD.C @@ -180,7 +180,7 @@ void Foam::scalarTransportPOD::calcDerivativeCoeffs() const instantList Times = runTime.times(); - volVectorField* Uptr = NULL; + volVectorField* Uptr = nullptr; forAll (Times, i) { @@ -259,9 +259,9 @@ Foam::scalarTransportPOD::scalarTransportPOD PODODE(mesh, dict), phiName_(dict.lookup("field")), coeffs_(), - derivativeMatrixPtr_(NULL), - orthoBasePtr_(NULL), - fieldPtr_(NULL) + derivativeMatrixPtr_(nullptr), + orthoBasePtr_(nullptr), + fieldPtr_(nullptr) { // Grab coefficients from the first snapshot of the ortho-normal base coeffs_.setSize(orthoBase().baseSize()); diff --git a/src/conjugateHeatTransfer/fvPatchFields/externalRadiation/externalRadiationSource/externalRadiationSource.H b/src/conjugateHeatTransfer/fvPatchFields/externalRadiation/externalRadiationSource/externalRadiationSource.H index ce4f8aebc..5fe8f2498 100644 --- a/src/conjugateHeatTransfer/fvPatchFields/externalRadiation/externalRadiationSource/externalRadiationSource.H +++ b/src/conjugateHeatTransfer/fvPatchFields/externalRadiation/externalRadiationSource/externalRadiationSource.H @@ -98,7 +98,7 @@ public: virtual autoPtr clone() const { notImplemented("autoPt clone() const"); - return autoPtr(NULL); + return autoPtr(nullptr); return autoPtr ( @@ -136,7 +136,7 @@ public: type() +"::q(const scalarField& Tw) const" ); - return tmp(NULL); + return tmp(nullptr); }; diff --git a/src/conversion/meshReader/meshReader.C b/src/conversion/meshReader/meshReader.C index 0a3d8705c..25ae7f40d 100644 --- a/src/conversion/meshReader/meshReader.C +++ b/src/conversion/meshReader/meshReader.C @@ -197,7 +197,7 @@ Foam::meshReader::meshReader const scalar scaleFactor ) : - pointCellsPtr_(NULL), + pointCellsPtr_(nullptr), nInternalFaces_(0), patchStarts_(0), patchSizes_(0), diff --git a/src/conversion/meshReader/starcd/STARCDMeshReader.C b/src/conversion/meshReader/starcd/STARCDMeshReader.C index 49022df6a..d84e4e678 100644 --- a/src/conversion/meshReader/starcd/STARCDMeshReader.C +++ b/src/conversion/meshReader/starcd/STARCDMeshReader.C @@ -412,7 +412,7 @@ void Foam::meshReaders::STARCD::readCells(const fileName& inputName) } // determine the foam cell shape - const cellModel* curModelPtr = NULL; + const cellModel* curModelPtr = nullptr; // fluid/solid cells switch (shapeId) diff --git a/src/coupledMatrix/coupledFvMatrices/coupledFvScalarMatrix/coupledFvScalarMatrix.C b/src/coupledMatrix/coupledFvMatrices/coupledFvScalarMatrix/coupledFvScalarMatrix.C index edb8a8385..71b15db32 100644 --- a/src/coupledMatrix/coupledFvMatrices/coupledFvScalarMatrix/coupledFvScalarMatrix.C +++ b/src/coupledMatrix/coupledFvMatrices/coupledFvScalarMatrix/coupledFvScalarMatrix.C @@ -134,7 +134,7 @@ coupledSolverPerformance coupledFvMatrix::solve // HR 17.2.2013 forAll (matrices, rowI) { - psi.set(rowI, NULL).ptr(); + psi.set(rowI, nullptr).ptr(); } return solverPerf; diff --git a/src/coupledMatrix/coupledLduSolver/coupledLduSolver/coupledLduSolver.C b/src/coupledMatrix/coupledLduSolver/coupledLduSolver/coupledLduSolver.C index 4ba718585..55b120f1d 100644 --- a/src/coupledMatrix/coupledLduSolver/coupledLduSolver/coupledLduSolver.C +++ b/src/coupledMatrix/coupledLduSolver/coupledLduSolver/coupledLduSolver.C @@ -178,7 +178,7 @@ autoPtr coupledLduSolver::New "no diagonal or off-diagonal coefficient" << exit(FatalError); - return autoPtr(NULL); + return autoPtr(nullptr); } } diff --git a/src/decompositionMethods/decomposeReconstruct/decomposeTools/finiteArea/faFieldDecomposer.C b/src/decompositionMethods/decomposeReconstruct/decomposeTools/finiteArea/faFieldDecomposer.C index 15baac542..1655c6e46 100644 --- a/src/decompositionMethods/decomposeReconstruct/decomposeTools/finiteArea/faFieldDecomposer.C +++ b/src/decompositionMethods/decomposeReconstruct/decomposeTools/finiteArea/faFieldDecomposer.C @@ -145,17 +145,17 @@ faFieldDecomposer::faFieldDecomposer patchFieldDecomposerPtrs_ ( procMesh_.boundary().size(), - static_cast(NULL) + static_cast(nullptr) ), processorAreaPatchFieldDecomposerPtrs_ ( procMesh_.boundary().size(), - static_cast(NULL) + static_cast(nullptr) ), processorEdgePatchFieldDecomposerPtrs_ ( procMesh_.boundary().size(), - static_cast(NULL) + static_cast(nullptr) ) { forAll (boundaryAddressing_, patchi) diff --git a/src/decompositionMethods/decomposeReconstruct/decomposeTools/finiteArea/faMeshDecomposition.C b/src/decompositionMethods/decomposeReconstruct/decomposeTools/finiteArea/faMeshDecomposition.C index 0565ab0a5..52adb575d 100644 --- a/src/decompositionMethods/decomposeReconstruct/decomposeTools/finiteArea/faMeshDecomposition.C +++ b/src/decompositionMethods/decomposeReconstruct/decomposeTools/finiteArea/faMeshDecomposition.C @@ -1239,7 +1239,7 @@ bool faMeshDecomposition::writeDecomposition() ( curPatchSizes.size() + curProcessorPatchSizes.size(), - reinterpret_cast(NULL) + reinterpret_cast(0) ); label nPatches = 0; diff --git a/src/decompositionMethods/decomposeReconstruct/decomposeTools/finiteVolume/fvFieldDecomposer.C b/src/decompositionMethods/decomposeReconstruct/decomposeTools/finiteVolume/fvFieldDecomposer.C index 3b4c880a8..8d171fd75 100644 --- a/src/decompositionMethods/decomposeReconstruct/decomposeTools/finiteVolume/fvFieldDecomposer.C +++ b/src/decompositionMethods/decomposeReconstruct/decomposeTools/finiteVolume/fvFieldDecomposer.C @@ -143,17 +143,17 @@ fvFieldDecomposer::fvFieldDecomposer patchFieldDecomposerPtrs_ ( procMesh_.boundary().size(), - static_cast(NULL) + static_cast(nullptr) ), processorVolPatchFieldDecomposerPtrs_ ( procMesh_.boundary().size(), - static_cast(NULL) + static_cast(nullptr) ), processorSurfacePatchFieldDecomposerPtrs_ ( procMesh_.boundary().size(), - static_cast(NULL) + static_cast(nullptr) ) { // HR 25.06.18: Weights cannot be used for mappings diff --git a/src/decompositionMethods/decomposeReconstruct/decomposeTools/point/pointFieldDecomposer.C b/src/decompositionMethods/decomposeReconstruct/decomposeTools/point/pointFieldDecomposer.C index 1d4ab41b9..9c1f9da78 100644 --- a/src/decompositionMethods/decomposeReconstruct/decomposeTools/point/pointFieldDecomposer.C +++ b/src/decompositionMethods/decomposeReconstruct/decomposeTools/point/pointFieldDecomposer.C @@ -94,7 +94,7 @@ pointFieldDecomposer::pointFieldDecomposer patchFieldDecomposerPtrs_ ( procMesh_.boundary().size(), - static_cast(NULL) + static_cast(nullptr) ) { forAll (boundaryAddressing_, patchi) diff --git a/src/decompositionMethods/decomposeReconstruct/decomposeTools/tetFiniteElement/tetPointFieldDecomposer.C b/src/decompositionMethods/decomposeReconstruct/decomposeTools/tetFiniteElement/tetPointFieldDecomposer.C index 00e1de2ab..4bf44bab1 100644 --- a/src/decompositionMethods/decomposeReconstruct/decomposeTools/tetFiniteElement/tetPointFieldDecomposer.C +++ b/src/decompositionMethods/decomposeReconstruct/decomposeTools/tetFiniteElement/tetPointFieldDecomposer.C @@ -172,9 +172,9 @@ tetPointFieldDecomposer::tetPointFieldDecomposer patchFieldDecompPtrs_ ( processorMesh_.boundary().size(), - reinterpret_cast(NULL) + reinterpret_cast(0) ), - directAddressingPtr_(NULL) + directAddressingPtr_(nullptr) { // Set the patch field decomposers for all non-processor patch fields forAll (boundaryAddressing_, patchI) @@ -200,10 +200,10 @@ tetPointFieldDecomposer::~tetPointFieldDecomposer() { forAll (patchFieldDecompPtrs_, patchI) { - if (patchFieldDecompPtrs_[patchI] != NULL) + if (patchFieldDecompPtrs_[patchI] != nullptr) { delete(patchFieldDecompPtrs_[patchI]); - patchFieldDecompPtrs_[patchI] = NULL; + patchFieldDecompPtrs_[patchI] = nullptr; } } } diff --git a/src/decompositionMethods/decomposeReconstruct/decomposeTools/tetFiniteElement/tetPointFieldDecomposer.H b/src/decompositionMethods/decomposeReconstruct/decomposeTools/tetFiniteElement/tetPointFieldDecomposer.H index 0db24e9ce..58ac2ec30 100644 --- a/src/decompositionMethods/decomposeReconstruct/decomposeTools/tetFiniteElement/tetPointFieldDecomposer.H +++ b/src/decompositionMethods/decomposeReconstruct/decomposeTools/tetFiniteElement/tetPointFieldDecomposer.H @@ -115,7 +115,7 @@ public: ), sizeBeforeMapping_(sourcePatch.size()), directAddressing_(directAddr), - directPatchAddressingPtr_(NULL) + directPatchAddressingPtr_(nullptr) {} diff --git a/src/decompositionMethods/decomposeReconstruct/reconstructTools/finiteVolume/processorMeshesRebuild.C b/src/decompositionMethods/decomposeReconstruct/reconstructTools/finiteVolume/processorMeshesRebuild.C index fbe520e7b..e099977f8 100644 --- a/src/decompositionMethods/decomposeReconstruct/reconstructTools/finiteVolume/processorMeshesRebuild.C +++ b/src/decompositionMethods/decomposeReconstruct/reconstructTools/finiteVolume/processorMeshesRebuild.C @@ -1588,7 +1588,9 @@ Foam::processorMeshesReconstructor::reconstructMesh(const Time& db) xferCopy(reconPoints), xferCopy(reconFaces), xferCopy(reconOwner), - xferCopy(reconNeighbour) + xferCopy(reconNeighbour), + true + // false // Do not sync par ) ); fvMesh& globalMesh = globalMeshPtr(); @@ -1597,7 +1599,7 @@ Foam::processorMeshesReconstructor::reconstructMesh(const Time& db) // patches, it is sufficient to rebuilt the patches only from the first // valid processor // Note: - List reconPatches(nReconPatches, NULL); + List reconPatches(nReconPatches, nullptr); forAll (meshes_, procI) { @@ -1617,7 +1619,7 @@ Foam::processorMeshesReconstructor::reconstructMesh(const Time& db) )(); // Check if the patch has already been set - if (reconPatches[pnIndex] == NULL) + if (reconPatches[pnIndex] == nullptr) { // Patch not set: clone it // Note: watch indices: setting pnIndex from patchI @@ -1664,7 +1666,7 @@ Foam::processorMeshesReconstructor::reconstructMesh(const Time& db) // Check the list and fill in the missing slots forAll (reconPatches, patchI) { - if (reconPatches[patchI] == NULL) + if (reconPatches[patchI] == nullptr) { // Patch not set. Check its type FatalErrorIn diff --git a/src/decompositionMethods/metisDecomp/metisDecomp.C b/src/decompositionMethods/metisDecomp/metisDecomp.C index 8facb21b9..caad36a32 100644 --- a/src/decompositionMethods/metisDecomp/metisDecomp.C +++ b/src/decompositionMethods/metisDecomp/metisDecomp.C @@ -209,8 +209,8 @@ Foam::label Foam::metisDecomp::decompose int edgeCut = 0; // Vertex weight info - int* vwgtPtr = NULL; - int* adjwgtPtr = NULL; + int* vwgtPtr = nullptr; + int* adjwgtPtr = nullptr; if (cellWeights.size()) { @@ -232,11 +232,11 @@ Foam::label Foam::metisDecomp::decompose const_cast&>(xadj).begin(), // indexing into adjncy const_cast&>(adjncy).begin(), // neighbour info vwgtPtr, // vertexweights - NULL, + nullptr, adjwgtPtr, // no edgeweights &nProcs, processorWeights.begin(), - NULL, + nullptr, options, &edgeCut, finalDecomp.begin() @@ -251,11 +251,11 @@ Foam::label Foam::metisDecomp::decompose const_cast&>(xadj).begin(), // indexing into adjncy const_cast&>(adjncy).begin(), // neighbour info vwgtPtr, // vertexweights - NULL, + nullptr, adjwgtPtr, // no edgeweights &nProcs, processorWeights.begin(), - NULL, + nullptr, options, &edgeCut, finalDecomp.begin() diff --git a/src/decompositionMethods/parMetisDecomp/parMetisDecomp.C b/src/decompositionMethods/parMetisDecomp/parMetisDecomp.C index 8a3f9fc9c..5984d791a 100644 --- a/src/decompositionMethods/parMetisDecomp/parMetisDecomp.C +++ b/src/decompositionMethods/parMetisDecomp/parMetisDecomp.C @@ -249,8 +249,8 @@ Foam::label Foam::parMetisDecomp::decompose // Weight info int wgtFlag = 0; - int* vwgtPtr = NULL; - int* adjwgtPtr = NULL; + int* vwgtPtr = nullptr; + int* adjwgtPtr = nullptr; if (cellWeights.size()) { diff --git a/src/decompositionMethods/scotchDecomp/scotchDecomp/scotchDecomp.C b/src/decompositionMethods/scotchDecomp/scotchDecomp/scotchDecomp.C index 09f13bd9d..50a2b15cd 100644 --- a/src/decompositionMethods/scotchDecomp/scotchDecomp/scotchDecomp.C +++ b/src/decompositionMethods/scotchDecomp/scotchDecomp/scotchDecomp.C @@ -297,10 +297,10 @@ Foam::label Foam::scotchDecomp::decompose xadj.begin(), // verttab, start index per cell into adjncy &xadj[1], // vendtab, end index ,, velotab.begin(), // velotab, vertex weights - NULL, // vlbltab + nullptr, // vlbltab adjncy.size(), // edgenbr, number of arcs adjncy.begin(), // edgetab - NULL // edlotab, edge weights + nullptr // edlotab, edge weights ), "SCOTCH_graphBuild" ); @@ -346,7 +346,7 @@ Foam::label Foam::scotchDecomp::decompose //SCOTCH_Mapping mapdat; - //SCOTCH_graphMapInit(&grafdat, &mapdat, &archdat, NULL); + //SCOTCH_graphMapInit(&grafdat, &mapdat, &archdat, nullptr); //SCOTCH_graphMapCompute(&grafdat, &mapdat, &stradat); /* Perform mapping */ //SCOTCH_graphMapExit(&grafdat, &mapdat); diff --git a/src/dynamicMesh/dynamicFvMesh/fvMeshAdder/fvMeshAdderTemplates.C b/src/dynamicMesh/dynamicFvMesh/fvMeshAdder/fvMeshAdderTemplates.C index 64cb6eaed..48e0ce073 100644 --- a/src/dynamicMesh/dynamicFvMesh/fvMeshAdder/fvMeshAdderTemplates.C +++ b/src/dynamicMesh/dynamicFvMesh/fvMeshAdder/fvMeshAdderTemplates.C @@ -132,7 +132,7 @@ void Foam::fvMeshAdder::MapVolField newPatchI++ ) { - fld.boundaryField().set(newPatchI, NULL); + fld.boundaryField().set(newPatchI, nullptr); } @@ -457,7 +457,7 @@ void Foam::fvMeshAdder::MapSurfaceField newPatchI++ ) { - fld.boundaryField().set(newPatchI, NULL); + fld.boundaryField().set(newPatchI, nullptr); } diff --git a/src/dynamicMesh/dynamicFvMesh/fvMeshDistribute/CompactListList_devI.H b/src/dynamicMesh/dynamicFvMesh/fvMeshDistribute/CompactListList_devI.H index ba8c329d4..c7715db68 100644 --- a/src/dynamicMesh/dynamicFvMesh/fvMeshDistribute/CompactListList_devI.H +++ b/src/dynamicMesh/dynamicFvMesh/fvMeshDistribute/CompactListList_devI.H @@ -223,7 +223,7 @@ inline Foam::UList Foam::CompactListList_dev::operator[] ) { label start = offsets_[i]; - return UList((m_.size() ? &m_[start] : NULL), offsets_[i+1] - start); + return UList((m_.size() ? &m_[start] : nullptr), offsets_[i+1] - start); } @@ -237,7 +237,7 @@ Foam::CompactListList_dev::operator[] label start = offsets_[i]; return UList ( - (m_.size() ? const_cast(&m_[start]) : NULL), + (m_.size() ? const_cast(&m_[start]) : nullptr), offsets_[i+1] - start ); } diff --git a/src/dynamicMesh/dynamicFvMesh/fvMeshDistribute/fvMeshDistribute.C b/src/dynamicMesh/dynamicFvMesh/fvMeshDistribute/fvMeshDistribute.C index f084d27fb..560dc979a 100644 --- a/src/dynamicMesh/dynamicFvMesh/fvMeshDistribute/fvMeshDistribute.C +++ b/src/dynamicMesh/dynamicFvMesh/fvMeshDistribute/fvMeshDistribute.C @@ -576,7 +576,7 @@ Foam::autoPtr Foam::fvMeshDistribute::mergeSharedPoints if (returnReduce(pointToMaster.size(), sumOp