From 58f905ff70468ff822bbdfe58b06db899586bf1d Mon Sep 17 00:00:00 2001
From: Henry Weller <http://cfd.direct>
Date: Fri, 5 Aug 2016 17:19:38 +0100
Subject: [PATCH] C++11: Replaced the C NULL with the safer C++11 nullptr

Requires gcc version 4.7 or higher
---
 .../electromagnetics/mhdFoam/createPhiB.H     |   2 +-
 .../twoPhaseMixtureThermo.C                   |   6 +-
 .../phaseModel/phaseModel.C                   |   6 +-
 .../multiphaseSystem/phaseModel/phaseModel.C  |   2 +-
 .../multiphase/multiphaseEulerFoam/pEqn.H     |   2 +-
 .../multiphaseMixture/phase/phase.C           |   4 +-
 .../HeatTransferPhaseSystem.C                 |   4 +-
 .../MovingPhaseModel/MovingPhaseModel.C       |   2 +-
 .../phaseModel/phaseModel/phaseModel.C        |   6 +-
 .../phaseSystem/phaseSystemTemplates.C        |   2 +-
 .../IATE/IATEsources/IATEsource/IATEsource.H  |   4 +-
 .../IATE/IATEsources/IATEsource/IATEsource.H  |   4 +-
 .../solidDisplacementFoam/createFields.H      |   2 +-
 .../test/HashingSpeed/Test-HashingSpeed.C     |   6 +-
 applications/test/regex/Test-regex.C          |   2 +-
 .../advanced/autoRefineMesh/autoRefineMesh.C  |   2 +-
 .../mesh/advanced/selectCells/selectCells.C   |   4 +-
 .../Optional/ccm26ToFoam/ccm26ToFoam.C        | 104 ++++++++------
 .../fluentMeshToFoam/extrudedQuadCellShape.C  |   2 +-
 .../extrudedTriangleCellShape.C               |   2 +-
 .../unv/block_with_inlet_outlet.UNV           |  24 ++--
 .../mesh/conversion/sammToFoam/sammMesh.C     |   2 +-
 .../mesh/conversion/star3ToFoam/starMesh.C    |   4 +-
 .../extrudeToRegionMesh/extrudeToRegionMesh.C |   6 +-
 .../conformalVoronoiMesh.C                    |   2 +-
 .../conformalVoronoiMeshCalcDualMesh.C        |   2 +-
 .../searchableSurfaceFeatures.H               |   4 +-
 .../faceSelection/faceSelection.H             |   4 +-
 .../faceSelection/faceZoneSelection.H         |   4 +-
 .../searchableSurfaceSelection.H              |   4 +-
 .../manipulation/mirrorMesh/mirrorFvMesh.C    |   2 +-
 .../mesh/manipulation/setSet/setSet.C         |   2 +-
 .../decomposePar/decomposePar.C               |  20 +--
 .../decomposePar/domainDecomposition.C        |   2 +-
 .../decomposePar/pointFieldDecomposer.C       |   4 +-
 .../reconstructParMesh/reconstructParMesh.C   |   2 +-
 .../foamToEnsight/ensightField.C              |   6 +-
 .../foamToEnsight/ensightMesh.C               |   2 +-
 .../foamToEnsight/foamToEnsight.C             |   2 +-
 .../foamToEnsightParts/foamToEnsightParts.C   |   2 +-
 .../foamToTecplot360/tecplotWriter.C          |  24 ++--
 .../dataConversion/smapToFoam/smapToFoam.C    |   6 +-
 .../PV3FoamReader/vtkPV3FoamReader.cxx        |  10 +-
 .../PV3FoamReader/vtkPV3Foam/vtkPV3Foam.C     |  12 +-
 .../PV3FoamReader/vtkPV3Foam/vtkPV3FoamMesh.C |   4 +-
 .../vtkPV3Foam/vtkPV3FoamMeshLagrangian.C     |   4 +-
 .../vtkPV3Foam/vtkPV3FoamUpdateInfo.C         |   4 +-
 .../vtkPV3Foam/vtkPV3FoamUpdateInfoFields.H   |   2 +-
 .../vtkPV3blockMeshReader.cxx                 |   8 +-
 .../vtkPV3blockMesh/vtkPV3blockMesh.C         |  10 +-
 .../PVFoamReader/vtkPVFoamReader.cxx          |   8 +-
 .../PVFoamReader/vtkPVFoam/vtkPVFoam.C        |  12 +-
 .../PVFoamReader/vtkPVFoam/vtkPVFoamMesh.C    |   2 +-
 .../vtkPVFoam/vtkPVFoamMeshLagrangian.C       |   2 +-
 .../vtkPVFoam/vtkPVFoamUpdateInfo.C           |   4 +-
 .../vtkPVFoam/vtkPVFoamUpdateInfoFields.H     |   2 +-
 .../vtkPVblockMeshReader.cxx                  |   6 +-
 .../vtkPVblockMesh/vtkPVblockMesh.C           |  10 +-
 .../steadyParticleTracksTemplates.C           |   8 +-
 .../miscellaneous/pdfPlot/createFields.H      |   2 +-
 ...ateExternalCoupledPatchGeometryTemplates.C |   2 +-
 .../foamUpgradeCyclics/foamUpgradeCyclics.C   |   6 +-
 .../surface/surfaceCoarsen/bunnylod/list.h    |   2 +-
 .../surfaceCoarsen/bunnylod/progmesh.C        |   4 +-
 .../surface/surfaceCoarsen/bunnylod/winmain.C |  30 ++--
 src/OSspecific/POSIX/POSIX.C                  |  22 +--
 src/OSspecific/POSIX/fileMonitor.C            |   4 +-
 src/OSspecific/POSIX/printStack.C             |  12 +-
 src/OSspecific/POSIX/regExp.C                 |   4 +-
 src/OSspecific/POSIX/signals/sigFpe.C         |  14 +-
 src/OSspecific/POSIX/signals/sigInt.C         |   8 +-
 src/OSspecific/POSIX/signals/sigQuit.C        |   8 +-
 src/OSspecific/POSIX/signals/sigSegv.C        |   8 +-
 .../POSIX/signals/sigStopAtWriteNow.C         |   6 +-
 src/OSspecific/POSIX/signals/sigWriteNow.C    |   6 +-
 src/OSspecific/POSIX/timer.C                  |   2 +-
 .../DictionaryBase/DictionaryBase.C           |   6 +-
 .../DictionaryBase/DictionaryBase.H           |   6 +-
 .../HashTables/HashTable/HashTable.C          |  12 +-
 .../HashTables/HashTable/HashTableI.H         |   4 +-
 .../HashTables/HashTable/HashTableIO.C        |   4 +-
 .../linkTypes/DLListBase/DLListBase.H         |   4 +-
 .../linkTypes/DLListBase/DLListBaseI.H        |   4 +-
 .../linkTypes/SLListBase/SLListBase.H         |   4 +-
 .../linkTypes/SLListBase/SLListBaseI.H        |   4 +-
 src/OpenFOAM/containers/Lists/List/List.C     |  24 ++--
 src/OpenFOAM/containers/Lists/List/ListIO.C   |   2 +-
 .../containers/Lists/PtrList/PtrList.C        |   2 +-
 .../containers/Lists/PtrList/PtrList.H        |   4 +-
 .../containers/Lists/PtrList/PtrListI.H       |   2 +-
 .../containers/Lists/UPtrList/UPtrList.C      |   4 +-
 .../containers/Lists/UPtrList/UPtrList.H      |   2 +-
 .../containers/Lists/UPtrList/UPtrListI.H     |   2 +-
 src/OpenFOAM/db/IOobject/IOobject.C           |   4 +-
 src/OpenFOAM/db/IOobject/IOobject.H           |   4 +-
 src/OpenFOAM/db/IOobjectList/IOobjectList.C   |   2 +-
 src/OpenFOAM/db/IOobjectList/IOobjectList.H   |   4 +-
 src/OpenFOAM/db/IOstreams/Fstreams/IFstream.C |   2 +-
 src/OpenFOAM/db/IOstreams/Fstreams/OFstream.C |   2 +-
 src/OpenFOAM/db/IOstreams/token/token.H       |   2 +-
 src/OpenFOAM/db/IOstreams/token/tokenI.H      |   2 +-
 src/OpenFOAM/db/dictionary/dictionary.C       |  18 +--
 src/OpenFOAM/db/dictionary/dictionary.H       |   8 +-
 src/OpenFOAM/db/dictionary/dictionaryIO.C     |   2 +-
 src/OpenFOAM/db/dictionary/entry/entryIO.C    |   4 +-
 .../functionEntries/codeStream/codeStream.C   |   4 +-
 .../dlLibraryTable/dlLibraryTable.C           |   4 +-
 .../functionObject/functionObject.H           |   2 +-
 .../functionObjectList/functionObjectList.C   |   2 +-
 .../functionObjectList/functionObjectList.H   |   2 +-
 src/OpenFOAM/db/regIOobject/regIOobject.C     |  14 +-
 src/OpenFOAM/db/regIOobject/regIOobjectRead.C |   2 +-
 .../construction/runTimeSelectionTables.H     |   8 +-
 .../memberFunctionSelectionTables.H           |  10 +-
 src/OpenFOAM/dimensionSet/dimensionSets.C     |   8 +-
 .../fields/Fields/Field/FieldMapper.H         |   2 +-
 .../GeometricField/GeometricField.C           |  68 +++++-----
 .../SlicedGeometricField.C                    |   8 +-
 .../global/constants/dimensionedConstants.C   |   4 +-
 src/OpenFOAM/global/debug/debug.C             |  24 ++--
 .../interpolation2DTable.C                    |   4 +-
 .../interpolationTable/interpolationTable.C   |   4 +-
 .../PatchToPatchInterpolation.C               |  12 +-
 .../PrimitivePatchInterpolation.C             |   4 +-
 .../LUscalarMatrix/procLduInterface.H         |   2 +-
 .../matrices/LduMatrix/LduMatrix/LduMatrix.C  |  32 ++---
 .../LduMatrix/LduMatrix/LduMatrixOperations.C |   4 +-
 .../LduMatrix/LduMatrixPreconditioner.C       |   4 +-
 .../LduMatrix/LduMatrix/LduMatrixSmoother.C   |   7 +-
 .../LduMatrix/LduMatrix/LduMatrixSolver.C     |   5 +-
 src/OpenFOAM/matrices/Matrix/Matrix.C         |  14 +-
 src/OpenFOAM/matrices/Matrix/MatrixI.H        |   2 +-
 src/OpenFOAM/matrices/Matrix/MatrixIO.C       |   2 +-
 .../lduMatrix/lduAddressing/lduAddressing.H   |   8 +-
 .../matrices/lduMatrix/lduMatrix/lduMatrix.C  |  30 ++--
 .../lduMatrix/lduMatrix/lduMatrixOperations.C |   6 +-
 .../lduMatrix/lduMatrixPreconditioner.C       |   4 +-
 .../lduMatrix/lduMatrix/lduMatrixSmoother.C   |   4 +-
 .../lduMatrix/lduMatrix/lduMatrixSolver.C     |   4 +-
 .../lduMatrix/lduMatrix/lduMatrixTemplates.C  |   2 +-
 .../GAMGAgglomerateLduAddressing.C            |   8 +-
 .../GAMGAgglomeration/GAMGAgglomeration.C     |  14 +-
 src/OpenFOAM/memory/autoPtr/autoPtr.H         |  17 +--
 src/OpenFOAM/memory/autoPtr/autoPtrI.H        |   2 +-
 src/OpenFOAM/memory/tmp/tmp.H                 |   2 +-
 src/OpenFOAM/memory/tmpNrc/tmpNrc.H           |   2 +-
 src/OpenFOAM/meshes/lduMesh/lduMesh.C         |   2 +-
 .../meshShapes/cellMatcher/cellMatcher.C      |   2 +-
 .../meshShapes/cellMatcher/cellMatcherI.H     |   4 +-
 .../meshShapes/cellModeller/cellModeller.C    |   4 +-
 .../meshShapes/cellModeller/cellModeller.H    |   7 +-
 .../meshes/meshShapes/cellShape/cellShapeI.H  |   2 +-
 .../meshes/meshShapes/tetCell/tetCell.C       |   4 +-
 .../pointMesh/pointMeshMapper/pointMapper.C   |   8 +-
 .../pointMeshMapper/pointPatchMapper.C        |   6 +-
 .../polyMesh/globalMeshData/globalMeshData.C  |  10 +-
 .../mapPolyMesh/cellMapper/cellMapper.C       |   8 +-
 .../mapPolyMesh/faceMapper/faceMapper.C       |   8 +-
 src/OpenFOAM/meshes/polyMesh/polyMesh.C       |  24 ++--
 src/OpenFOAM/meshes/polyMesh/polyMesh.H       |   8 +-
 .../polyMesh/polyMeshCheck/polyMeshCheck.C    |   8 +-
 .../meshes/polyMesh/polyMeshFromShapeMesh.C   |  16 +--
 .../polyMeshTetDecomposition.H                |   4 +-
 .../constraint/cyclic/cyclicPolyPatch.C       |  24 ++--
 .../polyPatches/polyPatch/polyPatch.C         |  24 ++--
 .../meshes/polyMesh/zones/ZoneMesh/ZoneMesh.C |   6 +-
 .../meshes/polyMesh/zones/faceZone/faceZone.C |  40 +++---
 .../meshes/polyMesh/zones/zone/zone.C         |  10 +-
 .../PrimitivePatch/PrimitivePatch.C           | 128 +++++++++---------
 .../PrimitivePatch/PrimitivePatch.H           |   4 +-
 .../PrimitivePatch/PrimitivePatchClear.C      |   8 +-
 .../meshes/primitiveMesh/primitiveMesh.C      |  72 +++++-----
 .../meshes/primitiveMesh/primitiveMesh.H      |  32 ++---
 .../functions/TimeFunction1/TimeFunction1.C   |   2 +-
 src/OpenFOAM/primitives/ints/int32/int32IO.C  |   2 +-
 src/OpenFOAM/primitives/ints/int64/int64IO.C  |   2 +-
 .../primitives/ints/uint32/uint32IO.C         |   2 +-
 .../primitives/ints/uint64/uint64IO.C         |   2 +-
 .../primitives/strings/lists/hashedWordList.H |   2 +-
 .../primitives/strings/wordRe/wordRe.C        |   4 +-
 .../thermalBaffle1DFvPatchScalarField.C       |   2 +-
 .../phaseCompressible/LES/Niceno/NicenoKEqn.C |   2 +-
 .../LES/SmagorinskyZhang/SmagorinskyZhang.C   |   2 +-
 .../LES/continuousGasKEqn/continuousGasKEqn.C |   4 +-
 .../RAS/LaheyKEpsilon/LaheyKEpsilon.C         |   2 +-
 .../continuousGasKEpsilon.C                   |   4 +-
 .../RAS/kOmegaSSTSato/kOmegaSSTSato.C         |   2 +-
 .../RAS/mixtureKEpsilon/mixtureKEpsilon.C     |   2 +-
 .../singleStepCombustion.C                    |   2 +-
 src/conversion/meshReader/meshReader.C        |   4 +-
 .../meshReader/starcd/STARCDMeshReader.C      |   2 +-
 src/dynamicMesh/attachDetach/attachDetach.C   |   4 +-
 src/dynamicMesh/boundaryMesh/boundaryMesh.C   |   4 +-
 .../fvMeshAdder/fvMeshAdderTemplates.C        |   4 +-
 .../fvMeshDistribute/fvMeshDistribute.C       |   2 +-
 src/dynamicMesh/fvMeshSubset/fvMeshSubset.C   |   2 +-
 .../layerAdditionRemoval.C                    |   8 +-
 src/dynamicMesh/meshCut/cellCuts/cellCuts.C   |  12 +-
 .../meshCut/cellLooper/cellLooper.H           |   2 +-
 .../meshCut/directions/directions.H           |   2 +-
 .../multiDirRefinement/multiDirRefinement.C   |   2 +-
 .../undoableMeshCutter/undoableMeshCutter.C   |   8 +-
 src/dynamicMesh/meshCut/splitCell/splitCell.C |  12 +-
 .../polyMeshAdder/faceCoupleInfo.C            |   8 +-
 .../polyTopoChange/combineFaces.C             |   2 +-
 .../hexRef8/refinementHistory.C               |  12 +-
 .../polyTopoChanger/polyTopoChanger.C         |   4 +-
 .../repatchPolyTopoChanger.C                  |   4 +-
 .../enrichedPatch/enrichedPatch.C             |  18 +--
 .../slidingInterface/slidingInterface.C       |  52 +++----
 src/edgeMesh/edgeMesh.C                       |   8 +-
 src/edgeMesh/edgeMeshI.H                      |   4 +-
 src/edgeMesh/edgeMeshIO.C                     |   4 +-
 .../cfdTools/general/MRF/MRFZone.H            |   2 +-
 .../cfdTools/general/fvOptions/fvOption.H     |   2 +-
 .../basic/sliced/slicedFvPatchField.C         |   4 +-
 .../timeVaryingMappedFixedValueFvPatchField.C |  10 +-
 .../basic/sliced/slicedFvsPatchField.C        |   4 +-
 .../CoEulerDdtScheme/CoEulerDdtScheme.C       |   2 +-
 .../gradSchemes/gaussGrad/gaussGrad.H         |   2 +-
 .../laplacianScheme/laplacianScheme.H         |   4 +-
 .../orthogonalSnGrad/orthogonalSnGrad.C       |   2 +-
 .../snGradSchemes/snGradScheme/snGradScheme.H |   5 +-
 .../uncorrectedSnGrad/uncorrectedSnGrad.C     |   2 +-
 .../fvMatrices/fvMatrix/fvMatrix.C            |  10 +-
 .../solvers/MULES/IMULESTemplates.C           |   2 +-
 src/finiteVolume/fvMesh/fvMesh.C              |  84 ++++++------
 .../fvMesh/fvMeshMapper/fvPatchMapper.C       |   6 +-
 .../fvMesh/fvMeshMapper/fvSurfaceMapper.C     |   8 +-
 .../regionCoupled/regionCoupledFvPatch.C      |   4 +-
 .../regionCoupled/regionCoupledWallFvPatch.C  |   4 +-
 .../fvMesh/fvPatches/fvPatch/fvPatch.H        |   4 +-
 .../schemes/CoBlended/CoBlended.H             |   2 +-
 .../schemes/cellCoBlended/cellCoBlended.H     |   2 +-
 .../schemes/fixedBlended/fixedBlended.H       |   2 +-
 .../schemes/harmonic/harmonic.H               |   2 +-
 .../schemes/limiterBlended/limiterBlended.H   |   2 +-
 .../schemes/localBlended/localBlended.H       |   2 +-
 .../schemes/localMax/localMax.H               |   2 +-
 .../schemes/localMin/localMin.H               |   2 +-
 .../outletStabilised/outletStabilised.H       |   2 +-
 .../schemes/skewCorrected/skewCorrected.H     |   2 +-
 .../surfaceInterpolation.C                    |   8 +-
 .../surfaceInterpolationScheme.H              |   5 +-
 .../fieldValueDelta/fieldValueDelta.C         |   4 +-
 .../fieldValues/surfaceRegion/surfaceRegion.C |   4 +-
 .../pairPatchAgglomeration.C                  |   4 +-
 ...lacementComponentLaplacianFvMotionSolver.C |   4 +-
 ...velocityComponentLaplacianFvMotionSolver.C |   2 +-
 .../displacementSBRStressFvMotionSolver.C     |   2 +-
 .../displacementLaplacianFvMotionSolver.C     |   2 +-
 .../velocityLaplacianFvMotionSolver.C         |   2 +-
 ...surfaceDisplacementPointPatchVectorField.C |   2 +-
 ...aceSlipDisplacementPointPatchVectorField.C |   2 +-
 ...meVaryingMappedFixedValuePointPatchField.C |   6 +-
 .../fixedTemperatureConstraint.C              |   2 +-
 .../explicitPorositySource.C                  |   2 +-
 .../meanVelocityForce/meanVelocityForce.C     |   2 +-
 .../solidificationMeltingSource.C             |   2 +-
 .../interRegionExplicitPorositySource.C       |   2 +-
 .../interRegionHeatTransferModel.C            |   2 +-
 .../interRegionHeatTransferModelI.H           |   6 +-
 .../basic/InteractionLists/InteractionLists.C |   2 +-
 .../Templates/CollidingCloud/CollidingCloud.C |   4 +-
 .../Templates/KinematicCloud/KinematicCloud.C |  34 ++---
 .../clouds/Templates/MPPICCloud/MPPICCloud.C  |  12 +-
 .../Templates/ReactingCloud/ReactingCloud.C   |  14 +-
 .../ReactingMultiphaseCloud.C                 |  14 +-
 .../Templates/ThermoCloud/ThermoCloud.C       |  36 ++---
 .../ThermoParcel/ThermoParcelTrackingDataI.H  |   4 +-
 .../ParticleErosion/ParticleErosion.C         |   4 +-
 .../ParticleTracks/ParticleTracks.C           |   2 +-
 .../ParticleTrap/ParticleTrap.C               |   8 +-
 .../VoidFraction/VoidFraction.C               |   4 +-
 .../PairCollision/PairCollision.C             |   8 +-
 .../InflationInjection/InflationInjection.C   |   8 +-
 .../ParticleForces/Lift/LiftForce/LiftForce.C |   4 +-
 .../Paramagnetic/ParamagneticForce.C          |   2 +-
 .../PressureGradient/PressureGradientForce.C  |   4 +-
 .../Kinematic/ParticleForces/SRF/SRFForce.C   |   6 +-
 .../LocalInteraction/LocalInteraction.C       |   8 +-
 .../DampingModels/DampingModel/DampingModel.C |   2 +-
 .../DampingModels/Relaxation/Relaxation.C     |   8 +-
 .../IsotropyModel/IsotropyModel.C             |   2 +-
 .../MPPIC/PackingModels/Explicit/Explicit.C   |   6 +-
 .../MPPIC/PackingModels/Implicit/Implicit.C   |   4 +-
 .../PackingModels/PackingModel/PackingModel.C |   2 +-
 .../MPPIC/ParticleStressModels/Lun/Lun.C      |   2 +-
 .../molecule/moleculeCloud/moleculeCloud.C    |   8 +-
 .../pairPotential/basic/pairPotential.C       |   2 +-
 .../clouds/Templates/SprayCloud/SprayCloud.C  |  14 +-
 .../DispersionRASModel/DispersionRASModel.C   |   8 +-
 .../GradientDispersionRAS.C                   |   4 +-
 .../BrownianMotion/BrownianMotionForce.C      |   6 +-
 src/mesh/blockMesh/block/block.H              |   4 +-
 .../blockDescriptor/blockDescriptor.H         |   2 +-
 .../blockMesh/blockMesh/blockMeshTopology.C   |   2 +-
 src/mesh/blockMesh/curvedEdges/curvedEdge.C   |   2 +-
 .../refinementSurfaces/refinementSurfaces.C   |   2 +-
 .../AMIInterpolation/AMIInterpolation.C       |  20 +--
 .../cyclicACMIPointPatchField.C               |  16 +--
 .../cyclicAMIPointPatchField.C                |  16 +--
 .../cyclicAMIPolyPatch/cyclicAMIPolyPatch.C   |  20 +--
 src/meshTools/cellFeatures/cellFeatures.C     |   2 +-
 .../EulerCoordinateRotation.C                 |   8 +-
 .../STARCDCoordinateRotation.C                |   8 +-
 .../coordinateRotation/axesRotation.C         |   4 +-
 .../mappedPolyPatch/mappedPatchBase.C         |  48 +++----
 .../regionCoupledBase.C                       |  12 +-
 .../searchableSurface/searchableSurface.H     |   2 +-
 .../sets/topoSetSource/topoSetSource.C        |   2 +-
 .../sets/topoSetSource/topoSetSource.H        |   4 +-
 src/meshTools/sets/topoSets/topoSet.H         |   4 +-
 .../triSurfaceSearch/triSurfaceSearch.C       |   6 +-
 .../twoDPointCorrector/twoDPointCorrector.C   |   4 +-
 .../decompose/decompose/fvFieldDecomposer.C   |   8 +-
 .../refinementHistoryConstraint.C             |   4 +-
 .../decompose/metisDecomp/metisDecomp.C       |   8 +-
 .../decompose/ptscotchDecomp/ptscotchDecomp.C |   6 +-
 .../decompose/scotchDecomp/scotchDecomp.C     |   6 +-
 .../reconstruct/reconstruct/processorMeshes.C |  10 +-
 .../energyRegionCoupledFvPatchScalarField.C   |  20 +--
 .../pyrolysisModels/noPyrolysis/noPyrolysis.C |  12 +-
 .../pyrolysisModel/pyrolysisModel.H           |   2 +-
 .../regionModel/regionModel/regionModel.C     |  12 +-
 .../regionModel/regionModel1D/regionModel1D.C |   6 +-
 .../singleLayerRegion/singleLayerRegion.C     |   8 +-
 .../liquidFilmThermo/liquidFilmThermo.C       |   4 +-
 .../surfaceFilmModel/surfaceFilmModel.C       |   6 +-
 src/renumber/zoltanRenumber/zoltanRenumber.C  |   2 +-
 .../rigidBodyModel/rigidBodyModel.C           |   2 +-
 .../rigidBodyMotion/rigidBodyMotion.C         |   2 +-
 .../distributedWeightedFvPatchFieldMapper.H   |   4 +-
 src/sampling/meshToMesh/meshToMesh.C          |  16 +--
 src/sampling/meshToMesh/meshToMeshTemplates.C |   4 +-
 src/sampling/meshToMesh0/meshToMesh0.C        |  14 +-
 .../sampledSet/sampledSet/sampledSet.H        |   2 +-
 .../sampledSet/sampledSets/sampledSets.H      |   2 +-
 .../distanceSurface/distanceSurface.C         |  12 +-
 .../sampledSurface/isoSurface/isoSurface.C    |   2 +-
 .../isoSurface/isoSurfaceTemplates.C          |   2 +-
 .../isoSurface/sampledIsoSurface.C            |  10 +-
 .../isoSurface/sampledIsoSurfaceCell.C        |   4 +-
 .../sampledCuttingPlane/sampledCuttingPlane.C |   8 +-
 .../sampledSurface/sampledSurface.C           |  22 +--
 .../sampledSurface/sampledSurface.H           |   2 +-
 .../sampledSurfaces/sampledSurfaces.C         |   4 +-
 .../sampledThresholdCellFaces.C               |   2 +-
 .../sixDoFRigidBodyMotion.C                   |   2 +-
 src/surfMesh/surfZone/surfZone/surfZone.H     |   4 +-
 .../SLGThermo/SLGThermo/SLGThermo.C           |  12 +-
 .../SLGThermo/SLGThermo/SLGThermo.H           |   6 +-
 .../TDACChemistryModel/tabulation/ISAT/ISAT.C |  12 +-
 .../tabulation/ISAT/binaryNode/binaryNode.C   |  14 +-
 .../tabulation/ISAT/binaryTree/binaryTree.C   | 110 +++++++--------
 .../ISAT/chemPointISAT/chemPointISAT.H        |   2 +-
 .../liquidProperties/liquidProperties.C       |   2 +-
 .../solidProperties/solidPropertiesNew.C      |   2 +-
 .../radiationModel/radiationModel.C           |  20 +--
 .../submodels/sootModel/noSoot/noSoot.C       |   2 +-
 .../mixerFvMesh/mixerFvMesh.C                 |   2 +-
 .../tools/labelledTri/sortLabelledTri.H       |   4 +-
 src/triSurface/triSurface/triSurface.C        |  40 +++---
 363 files changed, 1470 insertions(+), 1418 deletions(-)

diff --git a/applications/solvers/electromagnetics/mhdFoam/createPhiB.H b/applications/solvers/electromagnetics/mhdFoam/createPhiB.H
index f79a80b8270..401917f555b 100644
--- a/applications/solvers/electromagnetics/mhdFoam/createPhiB.H
+++ b/applications/solvers/electromagnetics/mhdFoam/createPhiB.H
@@ -7,7 +7,7 @@ IOobject phiBHeader
 );
 
 
-surfaceScalarField* phiBPtr = NULL;
+surfaceScalarField* phiBPtr = nullptr;
 
 if (phiBHeader.headerOk())
 {
diff --git a/applications/solvers/multiphase/compressibleInterFoam/twoPhaseMixtureThermo/twoPhaseMixtureThermo.C b/applications/solvers/multiphase/compressibleInterFoam/twoPhaseMixtureThermo/twoPhaseMixtureThermo.C
index a3217a073bf..c713498ef6a 100644
--- a/applications/solvers/multiphase/compressibleInterFoam/twoPhaseMixtureThermo/twoPhaseMixtureThermo.C
+++ b/applications/solvers/multiphase/compressibleInterFoam/twoPhaseMixtureThermo/twoPhaseMixtureThermo.C
@@ -2,7 +2,7 @@
   =========                 |
   \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox
    \\    /   O peration     |
-    \\  /    A nd           | Copyright (C) 2013-2015 OpenFOAM Foundation
+    \\  /    A nd           | Copyright (C) 2013-2016 OpenFOAM Foundation
      \\/     M anipulation  |
 -------------------------------------------------------------------------------
 License
@@ -45,8 +45,8 @@ Foam::twoPhaseMixtureThermo::twoPhaseMixtureThermo
 :
     psiThermo(mesh, word::null),
     twoPhaseMixture(mesh, *this),
-    thermo1_(NULL),
-    thermo2_(NULL)
+    thermo1_(nullptr),
+    thermo2_(nullptr)
 {
     {
         volScalarField T1(IOobject::groupName("T", phase1Name()), T_);
diff --git a/applications/solvers/multiphase/compressibleMultiphaseInterFoam/multiphaseMixtureThermo/phaseModel/phaseModel.C b/applications/solvers/multiphase/compressibleMultiphaseInterFoam/multiphaseMixtureThermo/phaseModel/phaseModel.C
index 2d3a7b61638..c97a5a1382f 100644
--- a/applications/solvers/multiphase/compressibleMultiphaseInterFoam/multiphaseMixtureThermo/phaseModel/phaseModel.C
+++ b/applications/solvers/multiphase/compressibleMultiphaseInterFoam/multiphaseMixtureThermo/phaseModel/phaseModel.C
@@ -2,7 +2,7 @@
   =========                 |
   \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox
    \\    /   O peration     |
-    \\  /    A nd           | Copyright (C) 2013-2015 OpenFOAM Foundation
+    \\  /    A nd           | Copyright (C) 2013-2016 OpenFOAM Foundation
      \\/     M anipulation  |
 -------------------------------------------------------------------------------
 License
@@ -49,7 +49,7 @@ Foam::phaseModel::phaseModel
     name_(phaseName),
     p_(p),
     T_(T),
-    thermo_(NULL),
+    thermo_(nullptr),
     dgdt_
     (
         IOobject
@@ -81,7 +81,7 @@ Foam::phaseModel::phaseModel
 Foam::autoPtr<Foam::phaseModel> Foam::phaseModel::clone() const
 {
     NotImplemented;
-    return autoPtr<phaseModel>(NULL);
+    return autoPtr<phaseModel>(nullptr);
 }
 
 
diff --git a/applications/solvers/multiphase/multiphaseEulerFoam/multiphaseSystem/phaseModel/phaseModel.C b/applications/solvers/multiphase/multiphaseEulerFoam/multiphaseSystem/phaseModel/phaseModel.C
index 7929a9d1ad0..4392e62ac9b 100644
--- a/applications/solvers/multiphase/multiphaseEulerFoam/multiphaseSystem/phaseModel/phaseModel.C
+++ b/applications/solvers/multiphase/multiphaseEulerFoam/multiphaseSystem/phaseModel/phaseModel.C
@@ -203,7 +203,7 @@ Foam::phaseModel::~phaseModel()
 Foam::autoPtr<Foam::phaseModel> Foam::phaseModel::clone() const
 {
     NotImplemented;
-    return autoPtr<phaseModel>(NULL);
+    return autoPtr<phaseModel>(nullptr);
 }
 
 
diff --git a/applications/solvers/multiphase/multiphaseEulerFoam/pEqn.H b/applications/solvers/multiphase/multiphaseEulerFoam/pEqn.H
index af4905abc98..8e2d78cbec8 100644
--- a/applications/solvers/multiphase/multiphaseEulerFoam/pEqn.H
+++ b/applications/solvers/multiphase/multiphaseEulerFoam/pEqn.H
@@ -123,7 +123,7 @@
             ++dmIter, ++dcIter
         )
         {
-            const phaseModel *phase2Ptr = NULL;
+            const phaseModel *phase2Ptr = nullptr;
 
             if (&phase == &dmIter()->phase1())
             {
diff --git a/applications/solvers/multiphase/multiphaseInterFoam/multiphaseMixture/phase/phase.C b/applications/solvers/multiphase/multiphaseInterFoam/multiphaseMixture/phase/phase.C
index ae68ff1682d..5fc59061a4f 100644
--- a/applications/solvers/multiphase/multiphaseInterFoam/multiphaseMixture/phase/phase.C
+++ b/applications/solvers/multiphase/multiphaseInterFoam/multiphaseMixture/phase/phase.C
@@ -2,7 +2,7 @@
   =========                 |
   \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox
    \\    /   O peration     |
-    \\  /    A nd           | Copyright (C) 2011-2015 OpenFOAM Foundation
+    \\  /    A nd           | Copyright (C) 2011-2016 OpenFOAM Foundation
      \\/     M anipulation  |
 -------------------------------------------------------------------------------
 License
@@ -68,7 +68,7 @@ Foam::phase::phase
 Foam::autoPtr<Foam::phase> Foam::phase::clone() const
 {
     NotImplemented;
-    return autoPtr<phase>(NULL);
+    return autoPtr<phase>(nullptr);
 }
 
 
diff --git a/applications/solvers/multiphase/reactingEulerFoam/phaseSystems/PhaseSystems/HeatTransferPhaseSystem/HeatTransferPhaseSystem.C b/applications/solvers/multiphase/reactingEulerFoam/phaseSystems/PhaseSystems/HeatTransferPhaseSystem/HeatTransferPhaseSystem.C
index 07b41eb7710..9fee19e77fd 100644
--- a/applications/solvers/multiphase/reactingEulerFoam/phaseSystems/PhaseSystems/HeatTransferPhaseSystem/HeatTransferPhaseSystem.C
+++ b/applications/solvers/multiphase/reactingEulerFoam/phaseSystems/PhaseSystems/HeatTransferPhaseSystem/HeatTransferPhaseSystem.C
@@ -2,7 +2,7 @@
   =========                 |
   \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox
    \\    /   O peration     |
-    \\  /    A nd           | Copyright (C) 2015 OpenFOAM Foundation
+    \\  /    A nd           | Copyright (C) 2015-2016 OpenFOAM Foundation
      \\/     M anipulation  |
 -------------------------------------------------------------------------------
 License
@@ -102,7 +102,7 @@ Foam::HeatTransferPhaseSystem<BasePhaseSystem>::dmdt
     const Foam::phaseModel& phase
 ) const
 {
-    return tmp<volScalarField>(NULL);
+    return tmp<volScalarField>(nullptr);
 }
 
 
diff --git a/applications/solvers/multiphase/reactingEulerFoam/phaseSystems/phaseModel/MovingPhaseModel/MovingPhaseModel.C b/applications/solvers/multiphase/reactingEulerFoam/phaseSystems/phaseModel/MovingPhaseModel/MovingPhaseModel.C
index 4563f191b91..6e5aac34dd9 100644
--- a/applications/solvers/multiphase/reactingEulerFoam/phaseSystems/phaseModel/MovingPhaseModel/MovingPhaseModel.C
+++ b/applications/solvers/multiphase/reactingEulerFoam/phaseSystems/phaseModel/MovingPhaseModel/MovingPhaseModel.C
@@ -175,7 +175,7 @@ Foam::MovingPhaseModel<BasePhaseModel>::MovingPhaseModel
         fluid.mesh(),
         dimensionedVector("0", dimAcceleration, Zero)
     ),
-    divU_(NULL),
+    divU_(nullptr),
     turbulence_
     (
         phaseCompressibleTurbulenceModel::New
diff --git a/applications/solvers/multiphase/reactingEulerFoam/phaseSystems/phaseModel/phaseModel/phaseModel.C b/applications/solvers/multiphase/reactingEulerFoam/phaseSystems/phaseModel/phaseModel/phaseModel.C
index 8d73c1286ce..9fa7c0f5898 100644
--- a/applications/solvers/multiphase/reactingEulerFoam/phaseSystems/phaseModel/phaseModel/phaseModel.C
+++ b/applications/solvers/multiphase/reactingEulerFoam/phaseSystems/phaseModel/phaseModel/phaseModel.C
@@ -2,7 +2,7 @@
   =========                 |
   \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox
    \\    /   O peration     |
-    \\  /    A nd           | Copyright (C) 2015 OpenFOAM Foundation
+    \\  /    A nd           | Copyright (C) 2015-2016 OpenFOAM Foundation
      \\/     M anipulation  |
 -------------------------------------------------------------------------------
 License
@@ -77,7 +77,7 @@ Foam::phaseModel::phaseModel
 Foam::autoPtr<Foam::phaseModel> Foam::phaseModel::clone() const
 {
     NotImplemented;
-    return autoPtr<phaseModel>(NULL);
+    return autoPtr<phaseModel>(nullptr);
 }
 
 
@@ -168,7 +168,7 @@ bool Foam::phaseModel::compressible() const
 const Foam::tmp<Foam::volScalarField>& Foam::phaseModel::divU() const
 {
     NotImplemented;
-    static tmp<Foam::volScalarField> divU_(NULL);
+    static tmp<Foam::volScalarField> divU_(nullptr);
     return divU_;
 }
 
diff --git a/applications/solvers/multiphase/reactingEulerFoam/phaseSystems/phaseSystem/phaseSystemTemplates.C b/applications/solvers/multiphase/reactingEulerFoam/phaseSystems/phaseSystem/phaseSystemTemplates.C
index 3ab4a91ec5b..01f36c881c0 100644
--- a/applications/solvers/multiphase/reactingEulerFoam/phaseSystems/phaseSystem/phaseSystemTemplates.C
+++ b/applications/solvers/multiphase/reactingEulerFoam/phaseSystems/phaseSystem/phaseSystemTemplates.C
@@ -102,7 +102,7 @@ void Foam::phaseSystem::generatePairsAndSubModels
       : blendingMethods_["default"]
     );
 
-    autoPtr<modelType> noModel(NULL);
+    autoPtr<modelType> noModel(nullptr);
 
     forAllConstIter(typename modelTypeTable, tempModels, iter)
     {
diff --git a/applications/solvers/multiphase/reactingEulerFoam/reactingTwoPhaseEulerFoam/twoPhaseSystem/diameterModels/IATE/IATEsources/IATEsource/IATEsource.H b/applications/solvers/multiphase/reactingEulerFoam/reactingTwoPhaseEulerFoam/twoPhaseSystem/diameterModels/IATE/IATEsources/IATEsource/IATEsource.H
index b9f0f15af2b..5e135c16152 100644
--- a/applications/solvers/multiphase/reactingEulerFoam/reactingTwoPhaseEulerFoam/twoPhaseSystem/diameterModels/IATE/IATEsources/IATEsource/IATEsource.H
+++ b/applications/solvers/multiphase/reactingEulerFoam/reactingTwoPhaseEulerFoam/twoPhaseSystem/diameterModels/IATE/IATEsources/IATEsource/IATEsource.H
@@ -2,7 +2,7 @@
   =========                 |
   \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox
    \\    /   O peration     |
-    \\  /    A nd           | Copyright (C) 2013-2015 OpenFOAM Foundation
+    \\  /    A nd           | Copyright (C) 2013-2016 OpenFOAM Foundation
      \\/     M anipulation  |
 -------------------------------------------------------------------------------
 License
@@ -115,7 +115,7 @@ public:
         autoPtr<IATEsource> clone() const
         {
             NotImplemented;
-            return autoPtr<IATEsource>(NULL);
+            return autoPtr<IATEsource>(nullptr);
         }
 
 
diff --git a/applications/solvers/multiphase/twoPhaseEulerFoam/twoPhaseSystem/diameterModels/IATE/IATEsources/IATEsource/IATEsource.H b/applications/solvers/multiphase/twoPhaseEulerFoam/twoPhaseSystem/diameterModels/IATE/IATEsources/IATEsource/IATEsource.H
index fc2456871e9..c7655b9c342 100644
--- a/applications/solvers/multiphase/twoPhaseEulerFoam/twoPhaseSystem/diameterModels/IATE/IATEsources/IATEsource/IATEsource.H
+++ b/applications/solvers/multiphase/twoPhaseEulerFoam/twoPhaseSystem/diameterModels/IATE/IATEsources/IATEsource/IATEsource.H
@@ -2,7 +2,7 @@
   =========                 |
   \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox
    \\    /   O peration     |
-    \\  /    A nd           | Copyright (C) 2013-2015 OpenFOAM Foundation
+    \\  /    A nd           | Copyright (C) 2013-2016 OpenFOAM Foundation
      \\/     M anipulation  |
 -------------------------------------------------------------------------------
 License
@@ -114,7 +114,7 @@ public:
         autoPtr<IATEsource> clone() const
         {
             NotImplemented;
-            return autoPtr<IATEsource>(NULL);
+            return autoPtr<IATEsource>(nullptr);
         }
 
 
diff --git a/applications/solvers/stressAnalysis/solidDisplacementFoam/createFields.H b/applications/solvers/stressAnalysis/solidDisplacementFoam/createFields.H
index ffaada38796..fd97d416f90 100644
--- a/applications/solvers/stressAnalysis/solidDisplacementFoam/createFields.H
+++ b/applications/solvers/stressAnalysis/solidDisplacementFoam/createFields.H
@@ -16,7 +16,7 @@ volVectorField D
 );
 
 
-autoPtr<volScalarField> Tptr(NULL);
+autoPtr<volScalarField> Tptr(nullptr);
 
 if (thermalStress)
 {
diff --git a/applications/test/HashingSpeed/Test-HashingSpeed.C b/applications/test/HashingSpeed/Test-HashingSpeed.C
index 5937ad741e4..2d759ab99f5 100644
--- a/applications/test/HashingSpeed/Test-HashingSpeed.C
+++ b/applications/test/HashingSpeed/Test-HashingSpeed.C
@@ -943,7 +943,7 @@ uint32_t SuperFastHash (const char * data, int len)
 {
     uint32_t hash = 0;
 
-    if (len <= 0 || data == NULL) return 0;
+    if (len <= 0 || data == nullptr) return 0;
 
     unsigned rem = len & 3;
     len >>= 2;
@@ -1060,14 +1060,14 @@ struct tagtest {
         { 0.0, "hashLookup3\t", hashLookup3           },
         { 0.0, "hashLookup3Orig\t", hashLookup3Orig   },
         { 0.0, "SuperFastHash\t", SuperFastHash       },
-        { 0.0, NULL, NULL                             }
+        { 0.0, nullptr, nullptr                             }
 };
 
 int main () {
 int i, j;
     GenerateCRC32Table ();
 
-    for (j=0; tests[j].name != NULL; j++) {
+    for (j=0; tests[j].name != nullptr; j++) {
         for (i=0; i < 3; i++) {
             double res = test (tests[j].hash);
             if (tests[j].res == 0.0 || tests[j].res > res) tests[j].res = res;
diff --git a/applications/test/regex/Test-regex.C b/applications/test/regex/Test-regex.C
index 35fa73a2cc8..6f506f76594 100644
--- a/applications/test/regex/Test-regex.C
+++ b/applications/test/regex/Test-regex.C
@@ -81,7 +81,7 @@ int main(int argc, char *argv[])
     string me("Mark");
 
     // Handling of null strings
-    if (regExp(NULL).match(me))
+    if (regExp(nullptr).match(me))
     {
         Info<< "fail - matched: " << me << endl;
     }
diff --git a/applications/utilities/mesh/advanced/autoRefineMesh/autoRefineMesh.C b/applications/utilities/mesh/advanced/autoRefineMesh/autoRefineMesh.C
index d8eb8af676c..7f8cb092bb5 100644
--- a/applications/utilities/mesh/advanced/autoRefineMesh/autoRefineMesh.C
+++ b/applications/utilities/mesh/advanced/autoRefineMesh/autoRefineMesh.C
@@ -648,7 +648,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 176cb966b8c..b09742c3134 100644
--- a/applications/utilities/mesh/advanced/selectCells/selectCells.C
+++ b/applications/utilities/mesh/advanced/selectCells/selectCells.C
@@ -414,9 +414,9 @@ int main(int argc, char *argv[])
 
 
     // Surface
-    autoPtr<triSurface> surf(NULL);
+    autoPtr<triSurface> surf(nullptr);
     // Search engine on surface.
-    autoPtr<triSurfaceSearch> querySurf(NULL);
+    autoPtr<triSurfaceSearch> 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 d45222b50d7..854dea352b4 100644
--- a/applications/utilities/mesh/conversion/Optional/ccm26ToFoam/ccm26ToFoam.C
+++ b/applications/utilities/mesh/conversion/Optional/ccm26ToFoam/ccm26ToFoam.C
@@ -186,7 +186,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<int> mapData(nVertices, 0);
     List<float> verts(3*nVertices, 0);
@@ -205,9 +205,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;
 
@@ -243,7 +243,7 @@ void ReadProblem
     int i = 0;
     while
     (
-        CCMIONextEntity(NULL, problem, kCCMIOCellType, &i, &next)
+        CCMIONextEntity(nullptr, problem, kCCMIOCellType, &i, &next)
      == kCCMIONoErr
     )
     {
@@ -255,10 +255,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
         )
         {
@@ -280,7 +280,7 @@ void ReadProblem
     int k = 0;
     while
     (
-        CCMIONextEntity(NULL, problem, kCCMIOBoundaryRegion, &k, &boundary)
+        CCMIONextEntity(nullptr, problem, kCCMIOBoundaryRegion, &k, &boundary)
      == kCCMIONoErr
     )
     {
@@ -292,7 +292,7 @@ void ReadProblem
         int prostarI = -1;
         if
         (
-            CCMIOReadOpti(NULL, boundary, "ProstarRegionNumber", &prostarI)
+            CCMIOReadOpti(nullptr, boundary, "ProstarRegionNumber", &prostarI)
          == kCCMIONoErr
         )
         {
@@ -318,12 +318,18 @@ void ReadProblem
             int size;
             if
             (
-                CCMIOReadOptstr(NULL, boundary, "BoundaryType", &size, NULL)
-             == kCCMIONoErr
+                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<word>(string(s));
                 delete [] s;
@@ -340,12 +346,18 @@ void ReadProblem
 
             if
             (
-                CCMIOReadOptstr(NULL, boundary, "BoundaryName", &size, NULL)
-             == kCCMIONoErr
+                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<word>(string(name));
@@ -353,12 +365,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<word>(string(name));
@@ -407,7 +419,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<int> mapData(nCells);
     std::vector<int> cellType(nCells);
@@ -431,7 +443,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
@@ -439,12 +451,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;
@@ -463,10 +475,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<int> faces(size);
-    CCMIOReadFaces(&err, id, kCCMIOInternalFaces, &mapID, NULL, &faces[0],
+    CCMIOReadFaces(&err, id, kCCMIOInternalFaces, &mapID, nullptr, &faces[0],
                    kCCMIOStart, kCCMIOEnd);
     std::vector<int> faceCells(2*nInternalFaces);
     CCMIOReadFaceCells(&err, id, kCCMIOInternalFaces, &faceCells[0],
@@ -503,22 +515,38 @@ 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],
-                       kCCMIOStart, kCCMIOEnd);
-        CCMIOReadFaceCells(&err, id, kCCMIOBoundaryFaces, &faceCells[0],
-                           kCCMIOStart, kCCMIOEnd);
+        CCMIOReadFaces
+        (
+            &err,
+            id,
+            kCCMIOBoundaryFaces,
+            &mapID,
+            nullptr,
+            &faces[0],
+            kCCMIOStart,
+            kCCMIOEnd
+        );
+        CCMIOReadFaceCells
+        (
+            &err,
+            id,
+            kCCMIOBoundaryFaces,
+            &faceCells[0],
+            kCCMIOStart,
+            kCCMIOEnd
+        );
         CCMIOReadMap(&err, mapID, &mapData[0], kCCMIOStart, kCCMIOEnd);
         CheckError(err, "Error reading boundary faces");
 
@@ -526,7 +554,7 @@ void ReadCells
         int prostarI;
         if
         (
-            CCMIOReadOpti(NULL, id, "ProstarRegionNumber", &prostarI)
+            CCMIOReadOpti(nullptr, id, "ProstarRegionNumber", &prostarI)
          == kCCMIONoErr
         )
         {
@@ -639,12 +667,12 @@ 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
-        // value to 'err'.).
+        // in nullptr (which always means kCCMIONoErr) and then assign the
+        // return value to 'err'.).
         CCMIOID root;
         CCMIOError err = CCMIOOpenFile
         (
-            NULL,
+            nullptr,
             ccmFile.c_str(),
             kCCMIORead,
             &root
@@ -659,9 +687,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;
@@ -678,7 +706,7 @@ int main(int argc, char *argv[])
             processor,
             &vertices,
             &topology,
-            NULL,
+            nullptr,
             &solution
         );
 
@@ -692,8 +720,8 @@ int main(int argc, char *argv[])
                 processor,
                 &vertices,
                 &topology,
-                NULL,
-                NULL
+                nullptr,
+                nullptr
             );
             if (err != kCCMIONoErr)
             {
diff --git a/applications/utilities/mesh/conversion/fluentMeshToFoam/extrudedQuadCellShape.C b/applications/utilities/mesh/conversion/fluentMeshToFoam/extrudedQuadCellShape.C
index 013481821b5..457b555ad1e 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
 )
 {
-    static const cellModel* hexModelPtr_ = NULL;
+    static const cellModel* hexModelPtr_ = nullptr;
 
     if (!hexModelPtr_)
     {
diff --git a/applications/utilities/mesh/conversion/fluentMeshToFoam/extrudedTriangleCellShape.C b/applications/utilities/mesh/conversion/fluentMeshToFoam/extrudedTriangleCellShape.C
index e781a66f1f5..a2e0acf8ce0 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
 )
 {
-    static const cellModel* prismModelPtr_ = NULL;
+    static const cellModel* prismModelPtr_ = nullptr;
 
     if (!prismModelPtr_)
     {
diff --git a/applications/utilities/mesh/conversion/ideasUnvToFoam/unv/block_with_inlet_outlet.UNV b/applications/utilities/mesh/conversion/ideasUnvToFoam/unv/block_with_inlet_outlet.UNV
index 64a2dff2964..d62033b9cec 100644
--- a/applications/utilities/mesh/conversion/ideasUnvToFoam/unv/block_with_inlet_outlet.UNV
+++ b/applications/utilities/mesh/conversion/ideasUnvToFoam/unv/block_with_inlet_outlet.UNV
@@ -258,84 +258,84 @@ YIELD STRESS
          0  LINE(S) OF TEXT
 DIMENSIONS AND UNITS:
 PRESSURE                                PASCAL                                  
-NULL_PROPERTY
+nullptr_PROPERTY
 --------------------------------------------------------------------------------
 CONVECTIVE FILM COEFFICIENT
          1  VERSION NUMBER
          0  LINE(S) OF TEXT
 DIMENSIONS AND UNITS:
 CONVECTION COEFFICIENT                  J/M^2/K/SEC                             
-NULL_PROPERTY
+nullptr_PROPERTY
 --------------------------------------------------------------------------------
 THERMAL CAPACITY PER UNIT AREA
          1  VERSION NUMBER
          0  LINE(S) OF TEXT
 DIMENSIONS AND UNITS:
 THERMAL CAPACITY PER UNIT AREA          J/M^2/K                                 
-NULL_PROPERTY
+nullptr_PROPERTY
 --------------------------------------------------------------------------------
 SURFACE HEAT FLUX RATE
          1  VERSION NUMBER
          0  LINE(S) OF TEXT
 DIMENSIONS AND UNITS:
 HEAT FLUX PER UNIT AREA                 J/M^2/SEC                               
-NULL_PROPERTY
+nullptr_PROPERTY
 --------------------------------------------------------------------------------
 VISCOSITY
          1  VERSION NUMBER
          0  LINE(S) OF TEXT
 DIMENSIONS AND UNITS:
 VISCOSITY                               KG/M/SEC                                
-NULL_PROPERTY
+nullptr_PROPERTY
 --------------------------------------------------------------------------------
 COEFFICIENT OF FRICTION
          1  VERSION NUMBER
          0  LINE(S) OF TEXT
 DIMENSIONS AND UNITS:
 DIMENSIONLESS                           UNITLESS                                
-NULL_PROPERTY
+nullptr_PROPERTY
 --------------------------------------------------------------------------------
 AREA FACTOR
          1  VERSION NUMBER
          0  LINE(S) OF TEXT
 DIMENSIONS AND UNITS:
 DIMENSIONLESS                           UNITLESS                                
-NULL_PROPERTY
+nullptr_PROPERTY
 --------------------------------------------------------------------------------
 EMISSIVITY
          1  VERSION NUMBER
          0  LINE(S) OF TEXT
 DIMENSIONS AND UNITS:
 DIMENSIONLESS                           UNITLESS                                
-NULL_PROPERTY
+nullptr_PROPERTY
 --------------------------------------------------------------------------------
 ABSORPTIVITY
          1  VERSION NUMBER
          0  LINE(S) OF TEXT
 DIMENSIONS AND UNITS:
 DIMENSIONLESS                           UNITLESS                                
-NULL_PROPERTY
+nullptr_PROPERTY
 --------------------------------------------------------------------------------
 HEAT FLUX RATE
          1  VERSION NUMBER
          0  LINE(S) OF TEXT
 DIMENSIONS AND UNITS:
 HEAT FLUX PER UNIT LENGTH               J/M/SEC                                 
-NULL_PROPERTY
+nullptr_PROPERTY
 --------------------------------------------------------------------------------
 INTERACTION TERM FOR TSAI-WU
          1  VERSION NUMBER
          0  LINE(S) OF TEXT
 DIMENSIONS AND UNITS:
 DIMENSIONLESS                           UNITLESS                                
-NULL_PROPERTY
+nullptr_PROPERTY
 --------------------------------------------------------------------------------
 SWELLING COEFFICIENT
          1  VERSION NUMBER
          0  LINE(S) OF TEXT
 DIMENSIONS AND UNITS:
 DIMENSIONLESS                           UNITLESS                                
-NULL_PROPERTY
+nullptr_PROPERTY
 --------------------------------------------------------------------------------
 DEFAULT MATERIAL PROPERT(IES):
 MODULUS OF ELASTICITY                   VERSION :          1
diff --git a/applications/utilities/mesh/conversion/sammToFoam/sammMesh.C b/applications/utilities/mesh/conversion/sammToFoam/sammMesh.C
index 188d1d35a12..5b62de154a3 100644
--- a/applications/utilities/mesh/conversion/sammToFoam/sammMesh.C
+++ b/applications/utilities/mesh/conversion/sammToFoam/sammMesh.C
@@ -185,7 +185,7 @@ Foam::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/star3ToFoam/starMesh.C b/applications/utilities/mesh/conversion/star3ToFoam/starMesh.C
index 7f48b0518c3..898c0c8f1d3 100644
--- a/applications/utilities/mesh/conversion/star3ToFoam/starMesh.C
+++ b/applications/utilities/mesh/conversion/star3ToFoam/starMesh.C
@@ -2,7 +2,7 @@
   =========                 |
   \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox
    \\    /   O peration     |
-    \\  /    A nd           | Copyright (C) 2011-2015 OpenFOAM Foundation
+    \\  /    A nd           | Copyright (C) 2011-2016 OpenFOAM Foundation
      \\/     M anipulation  |
 -------------------------------------------------------------------------------
 License
@@ -255,7 +255,7 @@ Foam::starMesh::starMesh
     cellPolys_(0),
     nInternalFaces_(0),
     polyBoundaryPatchStartIndices_(0),
-    pointCellsPtr_(NULL),
+    pointCellsPtr_(nullptr),
     couples_(0),
     isShapeMesh_(true)
 {
diff --git a/applications/utilities/mesh/generation/extrude/extrudeToRegionMesh/extrudeToRegionMesh.C b/applications/utilities/mesh/generation/extrude/extrudeToRegionMesh/extrudeToRegionMesh.C
index a1f8fecf135..29969e66c8a 100644
--- a/applications/utilities/mesh/generation/extrude/extrudeToRegionMesh/extrudeToRegionMesh.C
+++ b/applications/utilities/mesh/generation/extrude/extrudeToRegionMesh/extrudeToRegionMesh.C
@@ -1177,7 +1177,11 @@ void setCouplingInfo
 {
     const polyBoundaryMesh& patches = mesh.boundaryMesh();
 
-    List<polyPatch*> newPatches(patches.size(), static_cast<polyPatch*>(NULL));
+    List<polyPatch*> newPatches
+    (
+        patches.size(),
+        static_cast<polyPatch*>(nullptr)
+    );
 
     forAll(zoneToPatch, zoneI)
     {
diff --git a/applications/utilities/mesh/generation/foamyMesh/conformalVoronoiMesh/conformalVoronoiMesh/conformalVoronoiMesh.C b/applications/utilities/mesh/generation/foamyMesh/conformalVoronoiMesh/conformalVoronoiMesh/conformalVoronoiMesh.C
index d764f08b5e4..d94dc425aa5 100644
--- a/applications/utilities/mesh/generation/foamyMesh/conformalVoronoiMesh/conformalVoronoiMesh/conformalVoronoiMesh.C
+++ b/applications/utilities/mesh/generation/foamyMesh/conformalVoronoiMesh/conformalVoronoiMesh/conformalVoronoiMesh.C
@@ -866,7 +866,7 @@ Foam::conformalVoronoiMesh::conformalVoronoiMesh
                 "backgroundMeshDecomposition"
             )
         )
-      : NULL
+      : nullptr
     ),
     cellShapeControl_
     (
diff --git a/applications/utilities/mesh/generation/foamyMesh/conformalVoronoiMesh/conformalVoronoiMesh/conformalVoronoiMeshCalcDualMesh.C b/applications/utilities/mesh/generation/foamyMesh/conformalVoronoiMesh/conformalVoronoiMesh/conformalVoronoiMeshCalcDualMesh.C
index 50553ec4c60..5a3f86f6ac9 100644
--- a/applications/utilities/mesh/generation/foamyMesh/conformalVoronoiMesh/conformalVoronoiMesh/conformalVoronoiMeshCalcDualMesh.C
+++ b/applications/utilities/mesh/generation/foamyMesh/conformalVoronoiMesh/conformalVoronoiMesh/conformalVoronoiMeshCalcDualMesh.C
@@ -1810,7 +1810,7 @@ void Foam::conformalVoronoiMesh::createFacesOwnerNeighbourAndPatches
                 }
 
                 // Error if startCell is null
-                if (startCell == NULL)
+                if (startCell == nullptr)
                 {
                     Pout<< "Start cell is null!" << endl;
                 }
diff --git a/applications/utilities/mesh/generation/foamyMesh/conformalVoronoiMesh/searchableSurfaceFeatures/searchableSurfaceFeatures.H b/applications/utilities/mesh/generation/foamyMesh/conformalVoronoiMesh/searchableSurfaceFeatures/searchableSurfaceFeatures.H
index e114d71021d..3b7335d6205 100644
--- a/applications/utilities/mesh/generation/foamyMesh/conformalVoronoiMesh/searchableSurfaceFeatures/searchableSurfaceFeatures.H
+++ b/applications/utilities/mesh/generation/foamyMesh/conformalVoronoiMesh/searchableSurfaceFeatures/searchableSurfaceFeatures.H
@@ -2,7 +2,7 @@
   =========                 |
   \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox
    \\    /   O peration     |
-    \\  /    A nd           | Copyright (C) 2013-2015 OpenFOAM Foundation
+    \\  /    A nd           | Copyright (C) 2013-2016 OpenFOAM Foundation
      \\/     M anipulation  |
 -------------------------------------------------------------------------------
 License
@@ -101,7 +101,7 @@ public:
         virtual autoPtr<searchableSurfaceFeatures> clone() const
         {
             NotImplemented;
-            return autoPtr<searchableSurfaceFeatures>(NULL);
+            return autoPtr<searchableSurfaceFeatures>(nullptr);
         }
 
 
diff --git a/applications/utilities/mesh/manipulation/createBaffles/faceSelection/faceSelection.H b/applications/utilities/mesh/manipulation/createBaffles/faceSelection/faceSelection.H
index 20cb82808f4..41eb0b63154 100644
--- a/applications/utilities/mesh/manipulation/createBaffles/faceSelection/faceSelection.H
+++ b/applications/utilities/mesh/manipulation/createBaffles/faceSelection/faceSelection.H
@@ -2,7 +2,7 @@
   =========                 |
   \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox
    \\    /   O peration     |
-    \\  /    A nd           | Copyright (C) 2012-2015 OpenFOAM Foundation
+    \\  /    A nd           | Copyright (C) 2012-2016 OpenFOAM Foundation
      \\/     M anipulation  |
 -------------------------------------------------------------------------------
 License
@@ -109,7 +109,7 @@ public:
         autoPtr<faceSelection> clone() const
         {
             NotImplemented;
-            return autoPtr<faceSelection>(NULL);
+            return autoPtr<faceSelection>(nullptr);
         }
 
 
diff --git a/applications/utilities/mesh/manipulation/createBaffles/faceSelection/faceZoneSelection.H b/applications/utilities/mesh/manipulation/createBaffles/faceSelection/faceZoneSelection.H
index 08a3abee31f..10b7f377ed2 100644
--- a/applications/utilities/mesh/manipulation/createBaffles/faceSelection/faceZoneSelection.H
+++ b/applications/utilities/mesh/manipulation/createBaffles/faceSelection/faceZoneSelection.H
@@ -2,7 +2,7 @@
   =========                 |
   \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox
    \\    /   O peration     |
-    \\  /    A nd           | Copyright (C) 2012-2015 OpenFOAM Foundation
+    \\  /    A nd           | Copyright (C) 2012-2016 OpenFOAM Foundation
      \\/     M anipulation  |
 -------------------------------------------------------------------------------
 License
@@ -86,7 +86,7 @@ public:
         autoPtr<faceSelection> clone() const
         {
             NotImplemented;
-            return autoPtr<faceSelection>(NULL);
+            return autoPtr<faceSelection>(nullptr);
         }
 
 
diff --git a/applications/utilities/mesh/manipulation/createBaffles/faceSelection/searchableSurfaceSelection.H b/applications/utilities/mesh/manipulation/createBaffles/faceSelection/searchableSurfaceSelection.H
index d5c04ae1ea3..30262ef8a98 100644
--- a/applications/utilities/mesh/manipulation/createBaffles/faceSelection/searchableSurfaceSelection.H
+++ b/applications/utilities/mesh/manipulation/createBaffles/faceSelection/searchableSurfaceSelection.H
@@ -2,7 +2,7 @@
   =========                 |
   \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox
    \\    /   O peration     |
-    \\  /    A nd           | Copyright (C) 2012-2015 OpenFOAM Foundation
+    \\  /    A nd           | Copyright (C) 2012-2016 OpenFOAM Foundation
      \\/     M anipulation  |
 -------------------------------------------------------------------------------
 License
@@ -79,7 +79,7 @@ public:
         autoPtr<faceSelection> clone() const
         {
             NotImplemented;
-            return autoPtr<faceSelection>(NULL);
+            return autoPtr<faceSelection>(nullptr);
         }
 
 
diff --git a/applications/utilities/mesh/manipulation/mirrorMesh/mirrorFvMesh.C b/applications/utilities/mesh/manipulation/mirrorMesh/mirrorFvMesh.C
index cfe65a5589b..afbf8f557e8 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/setSet/setSet.C b/applications/utilities/mesh/manipulation/setSet/setSet.C
index 0feb0c3b720..cda9ec12922 100644
--- a/applications/utilities/mesh/manipulation/setSet/setSet.C
+++ b/applications/utilities/mesh/manipulation/setSet/setSet.C
@@ -871,7 +871,7 @@ int main(int argc, char *argv[])
         // Main command read & execute loop
         // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 
-        autoPtr<IFstream> fileStreamPtr(NULL);
+        autoPtr<IFstream> fileStreamPtr(nullptr);
 
         if (batch)
         {
diff --git a/applications/utilities/parallelProcessing/decomposePar/decomposePar.C b/applications/utilities/parallelProcessing/decomposePar/decomposePar.C
index cb7b4b5e868..bc94782641e 100644
--- a/applications/utilities/parallelProcessing/decomposePar/decomposePar.C
+++ b/applications/utilities/parallelProcessing/decomposePar/decomposePar.C
@@ -680,7 +680,7 @@ int main(int argc, char *argv[])
                         new List<SLList<indexedParticle*>*>
                         (
                             mesh.nCells(),
-                            static_cast<SLList<indexedParticle*>*>(NULL)
+                            static_cast<SLList<indexedParticle*>*>(nullptr)
                         )
                     );
 
@@ -947,7 +947,7 @@ int main(int argc, char *argv[])
                     if (times.size() == 1)
                     {
                         // Clear cached decomposer
-                        fieldDecomposerList.set(proci, NULL);
+                        fieldDecomposerList.set(proci, nullptr);
                     }
                 }
 
@@ -978,7 +978,7 @@ int main(int argc, char *argv[])
 
                     if (times.size() == 1)
                     {
-                        dimFieldDecomposerList.set(proci, NULL);
+                        dimFieldDecomposerList.set(proci, nullptr);
                     }
                 }
 
@@ -1029,8 +1029,8 @@ int main(int argc, char *argv[])
 
                     if (times.size() == 1)
                     {
-                        pointProcAddressingList.set(proci, NULL);
-                        pointFieldDecomposerList.set(proci, NULL);
+                        pointProcAddressingList.set(proci, nullptr);
+                        pointFieldDecomposerList.set(proci, nullptr);
                     }
                 }
 
@@ -1133,11 +1133,11 @@ int main(int argc, char *argv[])
                 // times, otherwise it is just extra storage.
                 if (times.size() == 1)
                 {
-                    boundaryProcAddressingList.set(proci, NULL);
-                    cellProcAddressingList.set(proci, NULL);
-                    faceProcAddressingList.set(proci, NULL);
-                    procMeshList.set(proci, NULL);
-                    processorDbList.set(proci, NULL);
+                    boundaryProcAddressingList.set(proci, nullptr);
+                    cellProcAddressingList.set(proci, nullptr);
+                    faceProcAddressingList.set(proci, nullptr);
+                    procMeshList.set(proci, nullptr);
+                    processorDbList.set(proci, nullptr);
                 }
             }
         }
diff --git a/applications/utilities/parallelProcessing/decomposePar/domainDecomposition.C b/applications/utilities/parallelProcessing/decomposePar/domainDecomposition.C
index d54d25b3819..3cad0f554e3 100644
--- a/applications/utilities/parallelProcessing/decomposePar/domainDecomposition.C
+++ b/applications/utilities/parallelProcessing/decomposePar/domainDecomposition.C
@@ -88,7 +88,7 @@ Foam::domainDecomposition::domainDecomposition(const IOobject& io)
                 false
             )
         )
-      : NULL
+      : nullptr
     ),
     nProcs_
     (
diff --git a/applications/utilities/parallelProcessing/decomposePar/pointFieldDecomposer.C b/applications/utilities/parallelProcessing/decomposePar/pointFieldDecomposer.C
index 92b9a4c4e45..77fcd6211a7 100644
--- a/applications/utilities/parallelProcessing/decomposePar/pointFieldDecomposer.C
+++ b/applications/utilities/parallelProcessing/decomposePar/pointFieldDecomposer.C
@@ -2,7 +2,7 @@
   =========                 |
   \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox
    \\    /   O peration     |
-    \\  /    A nd           | Copyright (C) 2011-2015 OpenFOAM Foundation
+    \\  /    A nd           | Copyright (C) 2011-2016 OpenFOAM Foundation
      \\/     M anipulation  |
 -------------------------------------------------------------------------------
 License
@@ -89,7 +89,7 @@ Foam::pointFieldDecomposer::pointFieldDecomposer
     patchFieldDecomposerPtrs_
     (
         procMesh_.boundary().size(),
-        static_cast<patchFieldDecomposer*>(NULL)
+        static_cast<patchFieldDecomposer*>(nullptr)
     )
 {
     forAll(boundaryAddressing_, patchi)
diff --git a/applications/utilities/parallelProcessing/reconstructParMesh/reconstructParMesh.C b/applications/utilities/parallelProcessing/reconstructParMesh/reconstructParMesh.C
index fb3a22b74c7..6a97d2be575 100644
--- a/applications/utilities/parallelProcessing/reconstructParMesh/reconstructParMesh.C
+++ b/applications/utilities/parallelProcessing/reconstructParMesh/reconstructParMesh.C
@@ -227,7 +227,7 @@ autoPtr<mapPolyMesh> mergeSharedPoints
 
     if (returnReduce(pointToMaster.size(), sumOp<label>()) == 0)
     {
-        return autoPtr<mapPolyMesh>(NULL);
+        return autoPtr<mapPolyMesh>(nullptr);
     }
 
     polyTopoChange meshMod(mesh);
diff --git a/applications/utilities/postProcessing/dataConversion/foamToEnsight/ensightField.C b/applications/utilities/postProcessing/dataConversion/foamToEnsight/ensightField.C
index eaf5a99afef..2070b0a6219 100644
--- a/applications/utilities/postProcessing/dataConversion/foamToEnsight/ensightField.C
+++ b/applications/utilities/postProcessing/dataConversion/foamToEnsight/ensightField.C
@@ -216,7 +216,7 @@ void writePatchField
 
     word timeFile = prepend + itoa(timeIndex);
 
-    ensightStream* ensightFilePtr = NULL;
+    ensightStream* ensightFilePtr = nullptr;
     if (Pstream::master())
     {
         if (timeIndex == 0)
@@ -330,7 +330,7 @@ void ensightField
     const labelList& hexes = meshCellSets.hexes;
     const labelList& polys = meshCellSets.polys;
 
-    ensightStream* ensightFilePtr = NULL;
+    ensightStream* ensightFilePtr = nullptr;
     if (Pstream::master())
     {
         // set the filename of the ensight file
@@ -548,7 +548,7 @@ void ensightPointField
     const wordHashSet& faceZoneNames = eMesh.faceZoneNames();
 
 
-    ensightStream* ensightFilePtr = NULL;
+    ensightStream* 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 198c1d319c1..4d08207dd04 100644
--- a/applications/utilities/postProcessing/dataConversion/foamToEnsight/ensightMesh.C
+++ b/applications/utilities/postProcessing/dataConversion/foamToEnsight/ensightMesh.C
@@ -1041,7 +1041,7 @@ void Foam::ensightMesh::write
     // set the filename of the ensight file
     fileName ensightGeometryFileName = timeFile + "mesh";
 
-    ensightStream* ensightGeometryFilePtr = NULL;
+    ensightStream* ensightGeometryFilePtr = nullptr;
     if (Pstream::master())
     {
         if (binary_)
diff --git a/applications/utilities/postProcessing/dataConversion/foamToEnsight/foamToEnsight.C b/applications/utilities/postProcessing/dataConversion/foamToEnsight/foamToEnsight.C
index c3357c0d0db..3063f9ddb36 100644
--- a/applications/utilities/postProcessing/dataConversion/foamToEnsight/foamToEnsight.C
+++ b/applications/utilities/postProcessing/dataConversion/foamToEnsight/foamToEnsight.C
@@ -196,7 +196,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/foamToEnsightParts/foamToEnsightParts.C b/applications/utilities/postProcessing/dataConversion/foamToEnsightParts/foamToEnsightParts.C
index 4d88ebf1e18..3fd0a4f7233 100644
--- a/applications/utilities/postProcessing/dataConversion/foamToEnsightParts/foamToEnsightParts.C
+++ b/applications/utilities/postProcessing/dataConversion/foamToEnsightParts/foamToEnsightParts.C
@@ -381,7 +381,7 @@ int main(int argc, char *argv[])
 
             // check that the positions field is present for this time
             IOobject* positionPtr = cloudObjs.lookup(word("positions"));
-            if (positionPtr != NULL)
+            if (positionPtr != nullptr)
             {
                 ensightParticlePositions
                 (
diff --git a/applications/utilities/postProcessing/dataConversion/foamToTecplot360/tecplotWriter.C b/applications/utilities/postProcessing/dataConversion/foamToTecplot360/tecplotWriter.C
index abf25471b44..c6760b298a2 100644
--- a/applications/utilities/postProcessing/dataConversion/foamToTecplot360/tecplotWriter.C
+++ b/applications/utilities/postProcessing/dataConversion/foamToTecplot360/tecplotWriter.C
@@ -111,8 +111,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 */
@@ -191,8 +191,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 */
@@ -273,8 +273,8 @@ Pout<< "zoneName:" << zoneName
     << endl;
 
 
-    INTEGER4 *PassiveVarArray = NULL;
-    INTEGER4 *VarShareArray   = NULL;
+    INTEGER4 *PassiveVarArray = nullptr;
+    INTEGER4 *VarShareArray   = nullptr;
     INTEGER4  ShrConn         = 0;
 
 
@@ -373,9 +373,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 */
         )
     )
     {
@@ -487,9 +487,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 2b186d88bad..47b45d11e72 100644
--- a/applications/utilities/postProcessing/dataConversion/smapToFoam/smapToFoam.C
+++ b/applications/utilities/postProcessing/dataConversion/smapToFoam/smapToFoam.C
@@ -2,7 +2,7 @@
   =========                 |
   \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox
    \\    /   O peration     |
-    \\  /    A nd           | Copyright (C) 2011-2015 OpenFOAM Foundation
+    \\  /    A nd           | Copyright (C) 2011-2016 OpenFOAM Foundation
      \\/     M anipulation  |
 -------------------------------------------------------------------------------
 License
@@ -206,14 +206,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/PV3Readers/PV3FoamReader/PV3FoamReader/vtkPV3FoamReader.cxx b/applications/utilities/postProcessing/graphics/PV3Readers/PV3FoamReader/PV3FoamReader/vtkPV3FoamReader.cxx
index 27c3f63fe55..163b6378542 100644
--- a/applications/utilities/postProcessing/graphics/PV3Readers/PV3FoamReader/PV3FoamReader/vtkPV3FoamReader.cxx
+++ b/applications/utilities/postProcessing/graphics/PV3Readers/PV3FoamReader/PV3FoamReader/vtkPV3FoamReader.cxx
@@ -2,7 +2,7 @@
   =========                 |
   \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox
    \\    /   O peration     |
-    \\  /    A nd           | Copyright (C) 2011-2012 OpenFOAM Foundation
+    \\  /    A nd           | Copyright (C) 2011-2016 OpenFOAM Foundation
      \\/     M anipulation  |
 -------------------------------------------------------------------------------
 License
@@ -58,10 +58,10 @@ vtkPV3FoamReader::vtkPV3FoamReader()
 
     SetNumberOfInputPorts(0);
 
-    FileName  = NULL;
-    foamData_ = NULL;
+    FileName  = nullptr;
+    foamData_ = nullptr;
 
-    output0_  = NULL;
+    output0_  = nullptr;
 
 #ifdef VTKPV3FOAM_DUALPORT
     // Add second output for the Lagrangian
@@ -217,7 +217,7 @@ int vtkPV3FoamReader::RequestInformation
 
         // delete foamData and flag it as fatal error
         delete foamData_;
-        foamData_ = NULL;
+        foamData_ = nullptr;
         return 0;
     }
 
diff --git a/applications/utilities/postProcessing/graphics/PV3Readers/PV3FoamReader/vtkPV3Foam/vtkPV3Foam.C b/applications/utilities/postProcessing/graphics/PV3Readers/PV3FoamReader/vtkPV3Foam/vtkPV3Foam.C
index 4c212e0aa76..2e515111333 100644
--- a/applications/utilities/postProcessing/graphics/PV3Readers/PV3FoamReader/vtkPV3Foam/vtkPV3Foam.C
+++ b/applications/utilities/postProcessing/graphics/PV3Readers/PV3FoamReader/vtkPV3Foam/vtkPV3Foam.C
@@ -86,7 +86,7 @@ void Foam::vtkPV3Foam::reduceMemory()
     if (!reader_->GetCacheMesh())
     {
         delete meshPtr_;
-        meshPtr_ = NULL;
+        meshPtr_ = nullptr;
     }
 }
 
@@ -226,8 +226,8 @@ Foam::vtkPV3Foam::vtkPV3Foam
 )
 :
     reader_(reader),
-    dbPtr_(NULL),
-    meshPtr_(NULL),
+    dbPtr_(nullptr),
+    meshPtr_(nullptr),
     meshRegion_(polyMesh::defaultRegion),
     meshDir_(polyMesh::meshSubDir),
     timeIndex_(-1),
@@ -347,7 +347,7 @@ void Foam::vtkPV3Foam::updateInfo()
     if (debug)
     {
         Info<< "<beg> Foam::vtkPV3Foam::updateInfo"
-            << " [meshPtr=" << (meshPtr_ ? "set" : "NULL") << "] timeIndex="
+            << " [meshPtr=" << (meshPtr_ ? "set" : "nullptr") << "] timeIndex="
             << timeIndex_ << endl;
     }
 
@@ -426,7 +426,7 @@ void Foam::vtkPV3Foam::updateFoamMesh()
     if (!reader_->GetCacheMesh())
     {
         delete meshPtr_;
-        meshPtr_ = NULL;
+        meshPtr_ = nullptr;
     }
 
     // Check to see if the OpenFOAM mesh has been created
@@ -551,7 +551,7 @@ void Foam::vtkPV3Foam::CleanUp()
 double* Foam::vtkPV3Foam::findTimes(int& nTimeSteps)
 {
     int nTimes = 0;
-    double* tsteps = NULL;
+    double* tsteps = nullptr;
 
     if (dbPtr_.valid())
     {
diff --git a/applications/utilities/postProcessing/graphics/PV3Readers/PV3FoamReader/vtkPV3Foam/vtkPV3FoamMesh.C b/applications/utilities/postProcessing/graphics/PV3Readers/PV3FoamReader/vtkPV3Foam/vtkPV3FoamMesh.C
index bbb7072b22f..5ffcffbeb10 100644
--- a/applications/utilities/postProcessing/graphics/PV3Readers/PV3FoamReader/vtkPV3Foam/vtkPV3FoamMesh.C
+++ b/applications/utilities/postProcessing/graphics/PV3Readers/PV3FoamReader/vtkPV3Foam/vtkPV3FoamMesh.C
@@ -2,7 +2,7 @@
   =========                 |
   \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox
    \\    /   O peration     |
-    \\  /    A nd           | Copyright (C) 2011-2013 OpenFOAM Foundation
+    \\  /    A nd           | Copyright (C) 2011-2016 OpenFOAM Foundation
      \\/     M anipulation  |
 -------------------------------------------------------------------------------
 License
@@ -190,7 +190,7 @@ void Foam::vtkPV3Foam::convertMeshPatches
                 << patchName  << endl;
         }
 
-        vtkPolyData* vtkmesh = NULL;
+        vtkPolyData* vtkmesh = nullptr;
         if (patchIds.size() == 1)
         {
             vtkmesh = patchVTKMesh(patchName, patches[patchIds.begin().key()]);
diff --git a/applications/utilities/postProcessing/graphics/PV3Readers/PV3FoamReader/vtkPV3Foam/vtkPV3FoamMeshLagrangian.C b/applications/utilities/postProcessing/graphics/PV3Readers/PV3FoamReader/vtkPV3Foam/vtkPV3FoamMeshLagrangian.C
index d90a5162ded..9b112a21bbb 100644
--- a/applications/utilities/postProcessing/graphics/PV3Readers/PV3FoamReader/vtkPV3Foam/vtkPV3FoamMeshLagrangian.C
+++ b/applications/utilities/postProcessing/graphics/PV3Readers/PV3FoamReader/vtkPV3Foam/vtkPV3FoamMeshLagrangian.C
@@ -2,7 +2,7 @@
   =========                 |
   \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox
    \\    /   O peration     |
-    \\  /    A nd           | Copyright (C) 2011-2013 OpenFOAM Foundation
+    \\  /    A nd           | Copyright (C) 2011-2016 OpenFOAM Foundation
      \\/     M anipulation  |
 -------------------------------------------------------------------------------
 License
@@ -45,7 +45,7 @@ vtkPolyData* Foam::vtkPV3Foam::lagrangianVTKMesh
     const word& cloudName
 )
 {
-    vtkPolyData* vtkmesh = NULL;
+    vtkPolyData* vtkmesh = nullptr;
 
     if (debug)
     {
diff --git a/applications/utilities/postProcessing/graphics/PV3Readers/PV3FoamReader/vtkPV3Foam/vtkPV3FoamUpdateInfo.C b/applications/utilities/postProcessing/graphics/PV3Readers/PV3FoamReader/vtkPV3Foam/vtkPV3FoamUpdateInfo.C
index 52401be615e..1386bc84853 100644
--- a/applications/utilities/postProcessing/graphics/PV3Readers/PV3FoamReader/vtkPV3Foam/vtkPV3FoamUpdateInfo.C
+++ b/applications/utilities/postProcessing/graphics/PV3Readers/PV3FoamReader/vtkPV3Foam/vtkPV3FoamUpdateInfo.C
@@ -228,7 +228,7 @@ void Foam::vtkPV3Foam::updateInfoPatches
     if (debug)
     {
         Info<< "<beg> Foam::vtkPV3Foam::updateInfoPatches"
-            << " [meshPtr=" << (meshPtr_ ? "set" : "NULL") << "]" << endl;
+            << " [meshPtr=" << (meshPtr_ ? "set" : "nullptr") << "]" << endl;
     }
 
 
@@ -476,7 +476,7 @@ void Foam::vtkPV3Foam::updateInfoZones
     if (debug)
     {
         Info<< "<beg> Foam::vtkPV3Foam::updateInfoZones"
-            << " [meshPtr=" << (meshPtr_ ? "set" : "NULL") << "]" << endl;
+            << " [meshPtr=" << (meshPtr_ ? "set" : "nullptr") << "]" << endl;
     }
 
     wordList namesLst;
diff --git a/applications/utilities/postProcessing/graphics/PV3Readers/PV3FoamReader/vtkPV3Foam/vtkPV3FoamUpdateInfoFields.H b/applications/utilities/postProcessing/graphics/PV3Readers/PV3FoamReader/vtkPV3Foam/vtkPV3FoamUpdateInfoFields.H
index 02cf345d4ac..dd2c98c7240 100644
--- a/applications/utilities/postProcessing/graphics/PV3Readers/PV3FoamReader/vtkPV3Foam/vtkPV3FoamUpdateInfoFields.H
+++ b/applications/utilities/postProcessing/graphics/PV3Readers/PV3FoamReader/vtkPV3Foam/vtkPV3FoamUpdateInfoFields.H
@@ -41,7 +41,7 @@ void Foam::vtkPV3Foam::updateInfoFields
     {
         Info<< "<beg> Foam::vtkPV3Foam::updateInfoFields <"
             << meshType::Mesh::typeName
-            << "> [meshPtr=" << (meshPtr_ ? "set" : "NULL") << "]"
+            << "> [meshPtr=" << (meshPtr_ ? "set" : "nullptr") << "]"
             << endl;
     }
 
diff --git a/applications/utilities/postProcessing/graphics/PV3Readers/PV3blockMeshReader/PV3blockMeshReader/vtkPV3blockMeshReader.cxx b/applications/utilities/postProcessing/graphics/PV3Readers/PV3blockMeshReader/PV3blockMeshReader/vtkPV3blockMeshReader.cxx
index 9384b8a3ff9..707e055c636 100644
--- a/applications/utilities/postProcessing/graphics/PV3Readers/PV3blockMeshReader/PV3blockMeshReader/vtkPV3blockMeshReader.cxx
+++ b/applications/utilities/postProcessing/graphics/PV3Readers/PV3blockMeshReader/PV3blockMeshReader/vtkPV3blockMeshReader.cxx
@@ -2,7 +2,7 @@
   =========                 |
   \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox
    \\    /   O peration     |
-    \\  /    A nd           | Copyright (C) 2011 OpenFOAM Foundation
+    \\  /    A nd           | Copyright (C) 2011-2016 OpenFOAM Foundation
      \\/     M anipulation  |
 -------------------------------------------------------------------------------
 License
@@ -56,8 +56,8 @@ vtkPV3blockMeshReader::vtkPV3blockMeshReader()
 
     SetNumberOfInputPorts(0);
 
-    FileName  = NULL;
-    foamData_ = NULL;
+    FileName  = nullptr;
+    foamData_ = nullptr;
 
     ShowPointNumbers = 1;
     UpdateGUI = 0;
@@ -165,7 +165,7 @@ int vtkPV3blockMeshReader::RequestInformation
 //
 //        // delete foamData and flag it as fatal error
 //        delete foamData_;
-//        foamData_ = NULL;
+//        foamData_ = nullptr;
 //        return 0;
 //    }
 
diff --git a/applications/utilities/postProcessing/graphics/PV3Readers/PV3blockMeshReader/vtkPV3blockMesh/vtkPV3blockMesh.C b/applications/utilities/postProcessing/graphics/PV3Readers/PV3blockMeshReader/vtkPV3blockMesh/vtkPV3blockMesh.C
index 2401acc1cde..f79068826b5 100644
--- a/applications/utilities/postProcessing/graphics/PV3Readers/PV3blockMeshReader/vtkPV3blockMesh/vtkPV3blockMesh.C
+++ b/applications/utilities/postProcessing/graphics/PV3Readers/PV3blockMeshReader/vtkPV3blockMesh/vtkPV3blockMesh.C
@@ -66,7 +66,7 @@ void Foam::vtkPV3blockMesh::updateInfoBlocks
     if (debug)
     {
         Info<< "<beg> Foam::vtkPV3blockMesh::updateInfoBlocks"
-            << " [meshPtr=" << (meshPtr_ ? "set" : "NULL") << "]" << endl;
+            << " [meshPtr=" << (meshPtr_ ? "set" : "nullptr") << "]" << endl;
     }
 
     arrayRangeBlocks_.reset( arraySelection->GetNumberOfArrays() );
@@ -109,7 +109,7 @@ void Foam::vtkPV3blockMesh::updateInfoEdges
     if (debug)
     {
         Info<< "<beg> Foam::vtkPV3blockMesh::updateInfoEdges"
-            << " [meshPtr=" << (meshPtr_ ? "set" : "NULL") << "]" << endl;
+            << " [meshPtr=" << (meshPtr_ ? "set" : "nullptr") << "]" << endl;
     }
 
     arrayRangeEdges_.reset( arraySelection->GetNumberOfArrays() );
@@ -150,8 +150,8 @@ Foam::vtkPV3blockMesh::vtkPV3blockMesh
 )
 :
     reader_(reader),
-    dbPtr_(NULL),
-    meshPtr_(NULL),
+    dbPtr_(nullptr),
+    meshPtr_(nullptr),
     meshRegion_(polyMesh::defaultRegion),
     meshDir_(polyMesh::meshSubDir),
     arrayRangeBlocks_("block"),
@@ -269,7 +269,7 @@ void Foam::vtkPV3blockMesh::updateInfo()
     if (debug)
     {
         Info<< "<beg> Foam::vtkPV3blockMesh::updateInfo"
-            << " [meshPtr=" << (meshPtr_ ? "set" : "NULL") << "] " << endl;
+            << " [meshPtr=" << (meshPtr_ ? "set" : "nullptr") << "] " << endl;
     }
 
     resetCounters();
diff --git a/applications/utilities/postProcessing/graphics/PVReaders/PVFoamReader/PVFoamReader/vtkPVFoamReader.cxx b/applications/utilities/postProcessing/graphics/PVReaders/PVFoamReader/PVFoamReader/vtkPVFoamReader.cxx
index 03984210658..6b539c5a680 100644
--- a/applications/utilities/postProcessing/graphics/PVReaders/PVFoamReader/PVFoamReader/vtkPVFoamReader.cxx
+++ b/applications/utilities/postProcessing/graphics/PVReaders/PVFoamReader/PVFoamReader/vtkPVFoamReader.cxx
@@ -58,10 +58,10 @@ vtkPVFoamReader::vtkPVFoamReader()
 
     SetNumberOfInputPorts(0);
 
-    FileName  = NULL;
-    foamData_ = NULL;
+    FileName  = nullptr;
+    foamData_ = nullptr;
 
-    output0_  = NULL;
+    output0_  = nullptr;
 
 #ifdef VTKPVFOAM_DUALPORT
     // Add second output for the Lagrangian
@@ -217,7 +217,7 @@ int vtkPVFoamReader::RequestInformation
 
         // delete foamData and flag it as fatal error
         delete foamData_;
-        foamData_ = NULL;
+        foamData_ = nullptr;
         return 0;
     }
 
diff --git a/applications/utilities/postProcessing/graphics/PVReaders/PVFoamReader/vtkPVFoam/vtkPVFoam.C b/applications/utilities/postProcessing/graphics/PVReaders/PVFoamReader/vtkPVFoam/vtkPVFoam.C
index a23095e67e2..ccf64179249 100644
--- a/applications/utilities/postProcessing/graphics/PVReaders/PVFoamReader/vtkPVFoam/vtkPVFoam.C
+++ b/applications/utilities/postProcessing/graphics/PVReaders/PVFoamReader/vtkPVFoam/vtkPVFoam.C
@@ -86,7 +86,7 @@ void Foam::vtkPVFoam::reduceMemory()
     if (!reader_->GetCacheMesh())
     {
         delete meshPtr_;
-        meshPtr_ = NULL;
+        meshPtr_ = nullptr;
     }
 }
 
@@ -226,8 +226,8 @@ Foam::vtkPVFoam::vtkPVFoam
 )
 :
     reader_(reader),
-    dbPtr_(NULL),
-    meshPtr_(NULL),
+    dbPtr_(nullptr),
+    meshPtr_(nullptr),
     meshRegion_(polyMesh::defaultRegion),
     meshDir_(polyMesh::meshSubDir),
     timeIndex_(-1),
@@ -347,7 +347,7 @@ void Foam::vtkPVFoam::updateInfo()
     if (debug)
     {
         Info<< "<beg> Foam::vtkPVFoam::updateInfo"
-            << " [meshPtr=" << (meshPtr_ ? "set" : "NULL") << "] timeIndex="
+            << " [meshPtr=" << (meshPtr_ ? "set" : "nullptr") << "] timeIndex="
             << timeIndex_ << endl;
     }
 
@@ -426,7 +426,7 @@ void Foam::vtkPVFoam::updateFoamMesh()
     if (!reader_->GetCacheMesh())
     {
         delete meshPtr_;
-        meshPtr_ = NULL;
+        meshPtr_ = nullptr;
     }
 
     // Check to see if the OpenFOAM mesh has been created
@@ -551,7 +551,7 @@ void Foam::vtkPVFoam::CleanUp()
 double* Foam::vtkPVFoam::findTimes(int& nTimeSteps)
 {
     int nTimes = 0;
-    double* tsteps = NULL;
+    double* tsteps = nullptr;
 
     if (dbPtr_.valid())
     {
diff --git a/applications/utilities/postProcessing/graphics/PVReaders/PVFoamReader/vtkPVFoam/vtkPVFoamMesh.C b/applications/utilities/postProcessing/graphics/PVReaders/PVFoamReader/vtkPVFoam/vtkPVFoamMesh.C
index 8d1c9a7949f..d4aef5aa672 100644
--- a/applications/utilities/postProcessing/graphics/PVReaders/PVFoamReader/vtkPVFoam/vtkPVFoamMesh.C
+++ b/applications/utilities/postProcessing/graphics/PVReaders/PVFoamReader/vtkPVFoam/vtkPVFoamMesh.C
@@ -188,7 +188,7 @@ void Foam::vtkPVFoam::convertMeshPatches
                 << patchName << endl;
         }
 
-        vtkPolyData* vtkmesh = NULL;
+        vtkPolyData* vtkmesh = nullptr;
         if (patchIds.size() == 1)
         {
             vtkmesh = patchVTKMesh(patchName, patches[patchIds.begin().key()]);
diff --git a/applications/utilities/postProcessing/graphics/PVReaders/PVFoamReader/vtkPVFoam/vtkPVFoamMeshLagrangian.C b/applications/utilities/postProcessing/graphics/PVReaders/PVFoamReader/vtkPVFoam/vtkPVFoamMeshLagrangian.C
index 6ec01765309..fafbd0a28c5 100644
--- a/applications/utilities/postProcessing/graphics/PVReaders/PVFoamReader/vtkPVFoam/vtkPVFoamMeshLagrangian.C
+++ b/applications/utilities/postProcessing/graphics/PVReaders/PVFoamReader/vtkPVFoam/vtkPVFoamMeshLagrangian.C
@@ -45,7 +45,7 @@ vtkPolyData* Foam::vtkPVFoam::lagrangianVTKMesh
     const word& cloudName
 )
 {
-    vtkPolyData* vtkmesh = NULL;
+    vtkPolyData* vtkmesh = nullptr;
 
     if (debug)
     {
diff --git a/applications/utilities/postProcessing/graphics/PVReaders/PVFoamReader/vtkPVFoam/vtkPVFoamUpdateInfo.C b/applications/utilities/postProcessing/graphics/PVReaders/PVFoamReader/vtkPVFoam/vtkPVFoamUpdateInfo.C
index 9bf34f6bc31..5ff623b347b 100644
--- a/applications/utilities/postProcessing/graphics/PVReaders/PVFoamReader/vtkPVFoam/vtkPVFoamUpdateInfo.C
+++ b/applications/utilities/postProcessing/graphics/PVReaders/PVFoamReader/vtkPVFoam/vtkPVFoamUpdateInfo.C
@@ -228,7 +228,7 @@ void Foam::vtkPVFoam::updateInfoPatches
     if (debug)
     {
         Info<< "<beg> Foam::vtkPVFoam::updateInfoPatches"
-            << " [meshPtr=" << (meshPtr_ ? "set" : "NULL") << "]" << endl;
+            << " [meshPtr=" << (meshPtr_ ? "set" : "nullptr") << "]" << endl;
     }
 
 
@@ -476,7 +476,7 @@ void Foam::vtkPVFoam::updateInfoZones
     if (debug)
     {
         Info<< "<beg> Foam::vtkPVFoam::updateInfoZones"
-            << " [meshPtr=" << (meshPtr_ ? "set" : "NULL") << "]" << endl;
+            << " [meshPtr=" << (meshPtr_ ? "set" : "nullptr") << "]" << endl;
     }
 
     wordList namesLst;
diff --git a/applications/utilities/postProcessing/graphics/PVReaders/PVFoamReader/vtkPVFoam/vtkPVFoamUpdateInfoFields.H b/applications/utilities/postProcessing/graphics/PVReaders/PVFoamReader/vtkPVFoam/vtkPVFoamUpdateInfoFields.H
index 3fe08f1b102..3a29ca5da1a 100644
--- a/applications/utilities/postProcessing/graphics/PVReaders/PVFoamReader/vtkPVFoam/vtkPVFoamUpdateInfoFields.H
+++ b/applications/utilities/postProcessing/graphics/PVReaders/PVFoamReader/vtkPVFoam/vtkPVFoamUpdateInfoFields.H
@@ -41,7 +41,7 @@ void Foam::vtkPVFoam::updateInfoFields
     {
         Info<< "<beg> Foam::vtkPVFoam::updateInfoFields <"
             << meshType::Mesh::typeName
-            << "> [meshPtr=" << (meshPtr_ ? "set" : "NULL") << "]"
+            << "> [meshPtr=" << (meshPtr_ ? "set" : "nullptr") << "]"
             << endl;
     }
 
diff --git a/applications/utilities/postProcessing/graphics/PVReaders/PVblockMeshReader/PVblockMeshReader/vtkPVblockMeshReader.cxx b/applications/utilities/postProcessing/graphics/PVReaders/PVblockMeshReader/PVblockMeshReader/vtkPVblockMeshReader.cxx
index b6e3769c762..ce5b4a309af 100644
--- a/applications/utilities/postProcessing/graphics/PVReaders/PVblockMeshReader/PVblockMeshReader/vtkPVblockMeshReader.cxx
+++ b/applications/utilities/postProcessing/graphics/PVReaders/PVblockMeshReader/PVblockMeshReader/vtkPVblockMeshReader.cxx
@@ -56,8 +56,8 @@ vtkPVblockMeshReader::vtkPVblockMeshReader()
 
     SetNumberOfInputPorts(0);
 
-    FileName  = NULL;
-    foamData_ = NULL;
+    FileName  = nullptr;
+    foamData_ = nullptr;
 
     ShowPointNumbers = 1;
     UpdateGUI = 0;
@@ -165,7 +165,7 @@ int vtkPVblockMeshReader::RequestInformation
 //
 //        // delete foamData and flag it as fatal error
 //        delete foamData_;
-//        foamData_ = NULL;
+//        foamData_ = nullptr;
 //        return 0;
 //    }
 
diff --git a/applications/utilities/postProcessing/graphics/PVReaders/PVblockMeshReader/vtkPVblockMesh/vtkPVblockMesh.C b/applications/utilities/postProcessing/graphics/PVReaders/PVblockMeshReader/vtkPVblockMesh/vtkPVblockMesh.C
index 4b3608cece5..b855990c688 100644
--- a/applications/utilities/postProcessing/graphics/PVReaders/PVblockMeshReader/vtkPVblockMesh/vtkPVblockMesh.C
+++ b/applications/utilities/postProcessing/graphics/PVReaders/PVblockMeshReader/vtkPVblockMesh/vtkPVblockMesh.C
@@ -66,7 +66,7 @@ void Foam::vtkPVblockMesh::updateInfoBlocks
     if (debug)
     {
         Info<< "<beg> Foam::vtkPVblockMesh::updateInfoBlocks"
-            << " [meshPtr=" << (meshPtr_ ? "set" : "NULL") << "]" << endl;
+            << " [meshPtr=" << (meshPtr_ ? "set" : "nullptr") << "]" << endl;
     }
 
     arrayRangeBlocks_.reset( arraySelection->GetNumberOfArrays() );
@@ -109,7 +109,7 @@ void Foam::vtkPVblockMesh::updateInfoEdges
     if (debug)
     {
         Info<< "<beg> Foam::vtkPVblockMesh::updateInfoEdges"
-            << " [meshPtr=" << (meshPtr_ ? "set" : "NULL") << "]" << endl;
+            << " [meshPtr=" << (meshPtr_ ? "set" : "nullptr") << "]" << endl;
     }
 
     arrayRangeEdges_.reset( arraySelection->GetNumberOfArrays() );
@@ -150,8 +150,8 @@ Foam::vtkPVblockMesh::vtkPVblockMesh
 )
 :
     reader_(reader),
-    dbPtr_(NULL),
-    meshPtr_(NULL),
+    dbPtr_(nullptr),
+    meshPtr_(nullptr),
     meshRegion_(polyMesh::defaultRegion),
     meshDir_(polyMesh::meshSubDir),
     arrayRangeBlocks_("block"),
@@ -269,7 +269,7 @@ void Foam::vtkPVblockMesh::updateInfo()
     if (debug)
     {
         Info<< "<beg> Foam::vtkPVblockMesh::updateInfo"
-            << " [meshPtr=" << (meshPtr_ ? "set" : "NULL") << "] " << endl;
+            << " [meshPtr=" << (meshPtr_ ? "set" : "nullptr") << "] " << endl;
     }
 
     resetCounters();
diff --git a/applications/utilities/postProcessing/lagrangian/steadyParticleTracks/steadyParticleTracksTemplates.C b/applications/utilities/postProcessing/lagrangian/steadyParticleTracks/steadyParticleTracksTemplates.C
index 30cfd665904..0a47125fd40 100644
--- a/applications/utilities/postProcessing/lagrangian/steadyParticleTracks/steadyParticleTracksTemplates.C
+++ b/applications/utilities/postProcessing/lagrangian/steadyParticleTracks/steadyParticleTracksTemplates.C
@@ -32,7 +32,7 @@ bool Foam::fieldOk(const IOobjectList& cloudObjs, const word& name)
 {
     IOobjectList objects(cloudObjs.lookupClass(IOField<Type>::typeName));
 
-    return (objects.lookup(name) != NULL);
+    return (objects.lookup(name) != nullptr);
 }
 
 
@@ -46,7 +46,7 @@ Foam::tmp<Foam::Field<Type>> Foam::readParticleField
     IOobjectList objects(cloudObjs.lookupClass(IOField<Type>::typeName));
 
     const IOobject* obj = objects.lookup(name);
-    if (obj != NULL)
+    if (obj != nullptr)
     {
         IOField<Type> newField(*obj);
         return tmp<Field<Type>>(new Field<Type>(newField.xfer()));
@@ -73,7 +73,7 @@ void Foam::readFields
     forAll(fieldNames, j)
     {
         const IOobject* obj = objects.lookup(fieldNames[j]);
-        if (obj != NULL)
+        if (obj != nullptr)
         {
             Info<< "        reading field " << fieldNames[j] << endl;
             IOField<Type> newField(*obj);
@@ -158,7 +158,7 @@ void Foam::processFields
         forAll(userFieldNames, i)
         {
             IOobject* obj = objects.lookup(userFieldNames[i]);
-            if (obj != NULL)
+            if (obj != nullptr)
             {
                 fieldNames.append(obj->name());
             }
diff --git a/applications/utilities/postProcessing/miscellaneous/pdfPlot/createFields.H b/applications/utilities/postProcessing/miscellaneous/pdfPlot/createFields.H
index a269ef7448b..85ec143ca9a 100644
--- a/applications/utilities/postProcessing/miscellaneous/pdfPlot/createFields.H
+++ b/applications/utilities/postProcessing/miscellaneous/pdfPlot/createFields.H
@@ -34,7 +34,7 @@
     const scalar xMin = p->minValue();
     const scalar xMax = p->maxValue();
 
-    autoPtr<OFstream> filePtr(NULL);
+    autoPtr<OFstream> filePtr(nullptr);
     if (writeData)
     {
         fileName fName = pdfPath/(p->type() + ".data");
diff --git a/applications/utilities/preProcessing/createExternalCoupledPatchGeometry/createExternalCoupledPatchGeometryTemplates.C b/applications/utilities/preProcessing/createExternalCoupledPatchGeometry/createExternalCoupledPatchGeometryTemplates.C
index f57a7d07b7c..56331d718d7 100644
--- a/applications/utilities/preProcessing/createExternalCoupledPatchGeometry/createExternalCoupledPatchGeometryTemplates.C
+++ b/applications/utilities/preProcessing/createExternalCoupledPatchGeometry/createExternalCoupledPatchGeometryTemplates.C
@@ -49,7 +49,7 @@ void processField
 
     IOobjectList fieldObjbjects(objects.lookupClass(fieldType::typeName));
 
-    if (fieldObjbjects.lookup(fieldName) != NULL)
+    if (fieldObjbjects.lookup(fieldName) != nullptr)
     {
         fieldType vtf(*fieldObjbjects.lookup(fieldName), mesh);
         const typename fieldType::Boundary& bf =
diff --git a/applications/utilities/preProcessing/foamUpgradeCyclics/foamUpgradeCyclics.C b/applications/utilities/preProcessing/foamUpgradeCyclics/foamUpgradeCyclics.C
index a81446d8b88..de17c452066 100644
--- a/applications/utilities/preProcessing/foamUpgradeCyclics/foamUpgradeCyclics.C
+++ b/applications/utilities/preProcessing/foamUpgradeCyclics/foamUpgradeCyclics.C
@@ -133,7 +133,7 @@ void rewriteBoundary
 
             if (patchDict.found("neighbourPatch"))
             {
-                patches.set(patchi, oldPatches.set(patchi, NULL));
+                patches.set(patchi, oldPatches.set(patchi, nullptr));
                 oldToNew[patchi] = newPatchi++;
 
                 // Check if patches come from automatic conversion
@@ -181,7 +181,7 @@ void rewriteBoundary
                 const dictionary patchDict(patches[patchi].dict());
 
                 // Change entry on this side
-                patches.set(patchi, oldPatches.set(patchi, NULL));
+                patches.set(patchi, oldPatches.set(patchi, nullptr));
                 oldToNew[patchi] = newPatchi++;
                 dictionary& thisPatchDict = patches[patchi].dict();
                 thisPatchDict.add("neighbourPatch", nbrName);
@@ -226,7 +226,7 @@ void rewriteBoundary
         }
         else
         {
-            patches.set(patchi, oldPatches.set(patchi, NULL));
+            patches.set(patchi, oldPatches.set(patchi, nullptr));
             oldToNew[patchi] = newPatchi++;
         }
     }
diff --git a/applications/utilities/surface/surfaceCoarsen/bunnylod/list.h b/applications/utilities/surface/surfaceCoarsen/bunnylod/list.h
index 225496ef2fc..b7394b1cc31 100644
--- a/applications/utilities/surface/surfaceCoarsen/bunnylod/list.h
+++ b/applications/utilities/surface/surfaceCoarsen/bunnylod/list.h
@@ -34,7 +34,7 @@ template<class Type>
 List<Type>::List(int s){
         num=0;
         array_size = 0;
-        element = NULL;
+        element = nullptr;
         if(s) {
                 allocate(s);
         }
diff --git a/applications/utilities/surface/surfaceCoarsen/bunnylod/progmesh.C b/applications/utilities/surface/surfaceCoarsen/bunnylod/progmesh.C
index 64005c1648b..4925650491e 100644
--- a/applications/utilities/surface/surfaceCoarsen/bunnylod/progmesh.C
+++ b/applications/utilities/surface/surfaceCoarsen/bunnylod/progmesh.C
@@ -198,12 +198,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;i<v->neighbor.num;i++) {
                 float dist;
diff --git a/applications/utilities/surface/surfaceCoarsen/bunnylod/winmain.C b/applications/utilities/surface/surfaceCoarsen/bunnylod/winmain.C
index 721460cbf68..fd19db0a045 100644
--- a/applications/utilities/surface/surfaceCoarsen/bunnylod/winmain.C
+++ b/applications/utilities/surface/surfaceCoarsen/bunnylod/winmain.C
@@ -271,35 +271,35 @@ 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,
+    if (hWnd == nullptr) {
+                MessageBox(nullptr,
                            "CreateWindow() failed:  Cannot create a window.",
                            "Error", MB_OK);
-                return NULL;
+                return nullptr;
     }
 
     hDC = GetDC(hWnd);
@@ -318,14 +318,14 @@ 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;
     }
@@ -414,7 +414,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);
@@ -444,7 +444,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/src/OSspecific/POSIX/POSIX.C b/src/OSspecific/POSIX/POSIX.C
index aa76bd27784..da4bf887c9b 100644
--- a/src/OSspecific/POSIX/POSIX.C
+++ b/src/OSspecific/POSIX/POSIX.C
@@ -95,7 +95,7 @@ pid_t Foam::pgid()
 
 bool Foam::env(const word& envName)
 {
-    return ::getenv(envName.c_str()) != NULL;
+    return ::getenv(envName.c_str()) != nullptr;
 }
 
 
@@ -171,7 +171,7 @@ Foam::string Foam::userName()
 {
     struct passwd* pw = ::getpwuid(::getuid());
 
-    if (pw != NULL)
+    if (pw != nullptr)
     {
         return pw->pw_name;
     }
@@ -192,7 +192,7 @@ Foam::fileName Foam::home()
 {
     char* env = ::getenv("HOME");
 
-    if (env != NULL)
+    if (env != nullptr)
     {
         return fileName(env);
     }
@@ -200,7 +200,7 @@ Foam::fileName Foam::home()
     {
         struct passwd* pw = ::getpwuid(getuid());
 
-        if (pw != NULL)
+        if (pw != nullptr)
         {
             return pw->pw_dir;
         }
@@ -224,7 +224,7 @@ Foam::fileName Foam::home(const string& userName)
     {
         char* env = ::getenv("HOME");
 
-        if (env != NULL)
+        if (env != nullptr)
         {
             return fileName(env);
         }
@@ -232,7 +232,7 @@ Foam::fileName Foam::home(const string& userName)
         pw = ::getpwuid(::getuid());
     }
 
-    if (pw != NULL)
+    if (pw != nullptr)
     {
         return pw->pw_dir;
     }
@@ -551,7 +551,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);
 
@@ -564,7 +564,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);
 
@@ -849,7 +849,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;
@@ -859,7 +859,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);
 
@@ -945,7 +945,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)
     {
         FatalErrorInFunction
             << "gethostbyname error " << h_errno << " for host " << destName
diff --git a/src/OSspecific/POSIX/fileMonitor.C b/src/OSspecific/POSIX/fileMonitor.C
index 045ed5be497..d3f010f0939 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/printStack.C b/src/OSspecific/POSIX/printStack.C
index b3561ef5f51..660f82daebc 100644
--- a/src/OSspecific/POSIX/printStack.C
+++ b/src/OSspecific/POSIX/printStack.C
@@ -2,7 +2,7 @@
   =========                 |
   \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox
    \\    /   O peration     |
-    \\  /    A nd           | Copyright (C) 2011-2015 OpenFOAM Foundation
+    \\  /    A nd           | Copyright (C) 2011-2016 OpenFOAM Foundation
      \\/     M anipulation  |
 -------------------------------------------------------------------------------
 License
@@ -48,7 +48,7 @@ string pOpen(const string &cmd, label line=0)
 
     if (cmdPipe)
     {
-        char *buf = NULL;
+        char *buf = nullptr;
 
         // Read line number of lines
         for (label cnt = 0; cnt <= line; cnt++)
@@ -69,7 +69,7 @@ string pOpen(const string &cmd, label line=0)
             }
         }
 
-        if (buf != NULL)
+        if (buf != nullptr)
         {
             free(buf);
         }
@@ -163,7 +163,7 @@ word demangleSymbol(const char* sn)
     char* cxx_sname = abi::__cxa_demangle
     (
         sn,
-        NULL,
+        nullptr,
         0,
         &st
     );
@@ -227,13 +227,13 @@ void Foam::error::printStack(Ostream& os)
         int st = dladdr(callstack[i], info);
 
         os << '#' << label(i) << "  ";
-        if (st != 0 && info->dli_fname != NULL && info->dli_fname[0] != '\0')
+        if (st != 0 && info->dli_fname != nullptr && info->dli_fname[0] != '\0')
         {
             fname = absolutePath(info->dli_fname);
 
             os <<
             (
-                (info->dli_sname != NULL)
+                (info->dli_sname != nullptr)
               ? demangleSymbol(info->dli_sname)
               : "?"
             );
diff --git a/src/OSspecific/POSIX/regExp.C b/src/OSspecific/POSIX/regExp.C
index a7177dc048a..f2b6c7ecf6a 100644
--- a/src/OSspecific/POSIX/regExp.C
+++ b/src/OSspecific/POSIX/regExp.C
@@ -2,7 +2,7 @@
   =========                 |
   \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox
    \\    /   O peration     |
-    \\  /    A nd           | Copyright (C) 2011-2015 OpenFOAM Foundation
+    \\  /    A nd           | Copyright (C) 2011-2016 OpenFOAM Foundation
      \\/     M anipulation  |
 -------------------------------------------------------------------------------
 License
@@ -117,7 +117,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 0e3ab8acd63..848510361df 100644
--- a/src/OSspecific/POSIX/signals/sigFpe.C
+++ b/src/OSspecific/POSIX/signals/sigFpe.C
@@ -2,7 +2,7 @@
   =========                 |
   \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox
    \\    /   O peration     |
-    \\  /    A nd           | Copyright (C) 2011-2015 OpenFOAM Foundation
+    \\  /    A nd           | Copyright (C) 2011-2016 OpenFOAM Foundation
      \\/     M anipulation  |
 -------------------------------------------------------------------------------
 License
@@ -90,7 +90,7 @@ void* Foam::sigFpe::mallocNan(size_t size)
 void Foam::sigFpe::sigHandler(int)
 {
     // Reset old handling
-    if (sigaction(SIGFPE, &oldAction_, NULL) < 0)
+    if (sigaction(SIGFPE, &oldAction_, nullptr) < 0)
     {
         FatalErrorInFunction
             << "Cannot reset SIGFPE trapping"
@@ -112,7 +112,7 @@ void Foam::sigFpe::sigHandler(int)
 
 Foam::sigFpe::sigFpe()
 {
-    oldAction_.sa_handler = NULL;
+    oldAction_.sa_handler = nullptr;
 }
 
 
@@ -124,7 +124,11 @@ 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
+        )
         {
             FatalErrorInFunction
                 << "Cannot reset SIGFPE trapping"
@@ -199,7 +203,7 @@ void Foam::sigFpe::set(const bool verbose)
           | _EN_OVERFL,
             0,
             _ABORT_ON_ERROR,
-            NULL
+            nullptr
         );
         #endif
 
diff --git a/src/OSspecific/POSIX/signals/sigInt.C b/src/OSspecific/POSIX/signals/sigInt.C
index fee8d60887d..4feb986a103 100644
--- a/src/OSspecific/POSIX/signals/sigInt.C
+++ b/src/OSspecific/POSIX/signals/sigInt.C
@@ -2,7 +2,7 @@
   =========                 |
   \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox
    \\    /   O peration     |
-    \\  /    A nd           | Copyright (C) 2011-2015 OpenFOAM Foundation
+    \\  /    A nd           | Copyright (C) 2011-2016 OpenFOAM Foundation
      \\/     M anipulation  |
 -------------------------------------------------------------------------------
 License
@@ -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)
     {
         FatalErrorInFunction
             << "Cannot reset SIGINT trapping"
@@ -57,7 +57,7 @@ void Foam::sigInt::sigHandler(int)
 
 Foam::sigInt::sigInt()
 {
-    oldAction_.sa_handler = NULL;
+    oldAction_.sa_handler = nullptr;
 }
 
 
@@ -66,7 +66,7 @@ Foam::sigInt::sigInt()
 Foam::sigInt::~sigInt()
 {
     // Reset old handling
-    if (sigaction(SIGINT, &oldAction_, NULL) < 0)
+    if (sigaction(SIGINT, &oldAction_, nullptr) < 0)
     {
         FatalErrorInFunction
             << "Cannot reset SIGINT trapping"
diff --git a/src/OSspecific/POSIX/signals/sigQuit.C b/src/OSspecific/POSIX/signals/sigQuit.C
index f6ba64a8277..c079639dbd8 100644
--- a/src/OSspecific/POSIX/signals/sigQuit.C
+++ b/src/OSspecific/POSIX/signals/sigQuit.C
@@ -2,7 +2,7 @@
   =========                 |
   \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox
    \\    /   O peration     |
-    \\  /    A nd           | Copyright (C) 2011-2015 OpenFOAM Foundation
+    \\  /    A nd           | Copyright (C) 2011-2016 OpenFOAM Foundation
      \\/     M anipulation  |
 -------------------------------------------------------------------------------
 License
@@ -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)
     {
         FatalErrorInFunction
             << "Cannot reset SIGQUIT trapping"
@@ -59,7 +59,7 @@ void Foam::sigQuit::sigHandler(int)
 
 Foam::sigQuit::sigQuit()
 {
-    oldAction_.sa_handler = NULL;
+    oldAction_.sa_handler = nullptr;
 }
 
 
@@ -68,7 +68,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)
     {
         FatalErrorInFunction
             << "Cannot reset SIGQUIT trapping"
diff --git a/src/OSspecific/POSIX/signals/sigSegv.C b/src/OSspecific/POSIX/signals/sigSegv.C
index 3c0fc0fef5d..513af5de279 100644
--- a/src/OSspecific/POSIX/signals/sigSegv.C
+++ b/src/OSspecific/POSIX/signals/sigSegv.C
@@ -2,7 +2,7 @@
   =========                 |
   \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox
    \\    /   O peration     |
-    \\  /    A nd           | Copyright (C) 2011-2015 OpenFOAM Foundation
+    \\  /    A nd           | Copyright (C) 2011-2016 OpenFOAM Foundation
      \\/     M anipulation  |
 -------------------------------------------------------------------------------
 License
@@ -38,7 +38,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)
     {
         FatalErrorInFunction
             << "Cannot reset SIGSEGV trapping"
@@ -59,7 +59,7 @@ void Foam::sigSegv::sigHandler(int)
 
 Foam::sigSegv::sigSegv()
 {
-    oldAction_.sa_handler = NULL;
+    oldAction_.sa_handler = nullptr;
 }
 
 
@@ -68,7 +68,7 @@ Foam::sigSegv::sigSegv()
 Foam::sigSegv::~sigSegv()
 {
     // Reset old handling
-    if (sigaction(SIGSEGV, &oldAction_, NULL) < 0)
+    if (sigaction(SIGSEGV, &oldAction_, nullptr) < 0)
     {
         FatalErrorInFunction
             << "Cannot reset SIGSEGV trapping"
diff --git a/src/OSspecific/POSIX/signals/sigStopAtWriteNow.C b/src/OSspecific/POSIX/signals/sigStopAtWriteNow.C
index a601a24052b..97749284aba 100644
--- a/src/OSspecific/POSIX/signals/sigStopAtWriteNow.C
+++ b/src/OSspecific/POSIX/signals/sigStopAtWriteNow.C
@@ -67,7 +67,7 @@ addstopAtWriteNowSignalToOpt addstopAtWriteNowSignalToOpt_
 }
 
 
-static Foam::Time const* runTimePtr_ = NULL;
+static Foam::Time const* runTimePtr_ = nullptr;
 
 
 struct sigaction Foam::sigStopAtWriteNow::oldAction_;
@@ -78,7 +78,7 @@ struct sigaction Foam::sigStopAtWriteNow::oldAction_;
 void Foam::sigStopAtWriteNow::sigHandler(int)
 {
     // Reset old handling
-    if (sigaction(signal_, &oldAction_, NULL) < 0)
+    if (sigaction(signal_, &oldAction_, nullptr) < 0)
     {
         FatalErrorInFunction
             << "Cannot reset " << signal_ << " trapping"
@@ -123,7 +123,7 @@ Foam::sigStopAtWriteNow::~sigStopAtWriteNow()
     // Reset old handling
     if (signal_ > 0)
     {
-        if (sigaction(signal_, &oldAction_, NULL) < 0)
+        if (sigaction(signal_, &oldAction_, nullptr) < 0)
         {
             FatalErrorInFunction
                 << "Cannot reset " << signal_ << " trapping"
diff --git a/src/OSspecific/POSIX/signals/sigWriteNow.C b/src/OSspecific/POSIX/signals/sigWriteNow.C
index 2439b3feedd..9af0e28406d 100644
--- a/src/OSspecific/POSIX/signals/sigWriteNow.C
+++ b/src/OSspecific/POSIX/signals/sigWriteNow.C
@@ -2,7 +2,7 @@
   =========                 |
   \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox
    \\    /   O peration     |
-    \\  /    A nd           | Copyright (C) 2011-2015 OpenFOAM Foundation
+    \\  /    A nd           | Copyright (C) 2011-2016 OpenFOAM Foundation
      \\/     M anipulation  |
 -------------------------------------------------------------------------------
 License
@@ -65,7 +65,7 @@ addwriteNowSignalToOpt addwriteNowSignalToOpt_("writeNowSignal");
 }
 
 
-static Foam::Time* runTimePtr_ = NULL;
+static Foam::Time* runTimePtr_ = nullptr;
 
 
 struct sigaction Foam::sigWriteNow::oldAction_;
@@ -106,7 +106,7 @@ Foam::sigWriteNow::~sigWriteNow()
     // Reset old handling
     if (signal_ > 0)
     {
-        if (sigaction(signal_, &oldAction_, NULL) < 0)
+        if (sigaction(signal_, &oldAction_, nullptr) < 0)
         {
             FatalErrorInFunction
                 << "Cannot reset " << signal_ << " trapping"
diff --git a/src/OSspecific/POSIX/timer.C b/src/OSspecific/POSIX/timer.C
index d9c1bac05e6..864566dc299 100644
--- a/src/OSspecific/POSIX/timer.C
+++ b/src/OSspecific/POSIX/timer.C
@@ -118,7 +118,7 @@ Foam::timer::~timer()
         oldTimeOut_ = 0;
 
         // Restore signal handler
-        if (sigaction(SIGALRM, &oldAction_, NULL) < 0)
+        if (sigaction(SIGALRM, &oldAction_, nullptr) < 0)
         {
             FatalErrorInFunction
                 << "sigaction(SIGALRM) error"
diff --git a/src/OpenFOAM/containers/Dictionaries/DictionaryBase/DictionaryBase.C b/src/OpenFOAM/containers/Dictionaries/DictionaryBase/DictionaryBase.C
index 2d6149dd0b5..d54b7fb3900 100644
--- a/src/OpenFOAM/containers/Dictionaries/DictionaryBase/DictionaryBase.C
+++ b/src/OpenFOAM/containers/Dictionaries/DictionaryBase/DictionaryBase.C
@@ -109,7 +109,7 @@ const T* Foam::DictionaryBase<IDLListType, T>::lookupPtr
     }
     else
     {
-        return NULL;
+        return nullptr;
     }
 }
 
@@ -125,7 +125,7 @@ T* Foam::DictionaryBase<IDLListType, T>::lookupPtr(const word& keyword)
     }
     else
     {
-        return NULL;
+        return nullptr;
     }
 }
 
@@ -220,7 +220,7 @@ T* Foam::DictionaryBase<IDLListType, T>::remove(const word& keyword)
     }
     else
     {
-        return NULL;
+        return nullptr;
     }
 }
 
diff --git a/src/OpenFOAM/containers/Dictionaries/DictionaryBase/DictionaryBase.H b/src/OpenFOAM/containers/Dictionaries/DictionaryBase/DictionaryBase.H
index 8ba13836efa..f4d864d82c7 100644
--- a/src/OpenFOAM/containers/Dictionaries/DictionaryBase/DictionaryBase.H
+++ b/src/OpenFOAM/containers/Dictionaries/DictionaryBase/DictionaryBase.H
@@ -113,10 +113,10 @@ public:
             //- Search DictionaryBase for given keyword
             bool found(const word&) const;
 
-            //- Find and return an entry if present, otherwise return NULL
+            //- Find and return an entry if present, otherwise return nullptr
             const T* lookupPtr(const word&) const;
 
-            //- Find and return an entry if present, otherwise return NULL
+            //- Find and return an entry if present, otherwise return nullptr
             T* lookupPtr(const word&);
 
             //- Find and return entry
@@ -141,7 +141,7 @@ public:
             void append(const word&, T*);
 
             //- Remove and return entry specified by keyword.
-            //  Return NULL if the keyword was not found.
+            //  Return nullptr if the keyword was not found.
             T* remove(const word&);
 
             //- Clear the dictionary
diff --git a/src/OpenFOAM/containers/HashTables/HashTable/HashTable.C b/src/OpenFOAM/containers/HashTables/HashTable/HashTable.C
index 9755dc56c1c..f665e7ca71b 100644
--- a/src/OpenFOAM/containers/HashTables/HashTable/HashTable.C
+++ b/src/OpenFOAM/containers/HashTables/HashTable/HashTable.C
@@ -37,7 +37,7 @@ Foam::HashTable<T, Key, Hash>::HashTable(const label size)
     HashTableCore(),
     nElmts_(0),
     tableSize_(HashTableCore::canonicalSize(size)),
-    table_(NULL)
+    table_(nullptr)
 {
     if (tableSize_)
     {
@@ -57,7 +57,7 @@ Foam::HashTable<T, Key, Hash>::HashTable(const HashTable<T, Key, Hash>& ht)
     HashTableCore(),
     nElmts_(0),
     tableSize_(ht.tableSize_),
-    table_(NULL)
+    table_(nullptr)
 {
     if (tableSize_)
     {
@@ -84,7 +84,7 @@ Foam::HashTable<T, Key, Hash>::HashTable
     HashTableCore(),
     nElmts_(0),
     tableSize_(0),
-    table_(NULL)
+    table_(nullptr)
 {
     transfer(ht());
 }
@@ -304,7 +304,7 @@ bool Foam::HashTable<T, Key, Hash>::set
 template<class T, class Key, class Hash>
 bool Foam::HashTable<T, Key, Hash>::iteratorBase::erase()
 {
-    // Note: entryPtr_ is NULL for end(), so this catches that too
+    // Note: entryPtr_ is nullptr for end(), so this catches that too
     if (entryPtr_)
     {
         // Search element before entryPtr_
@@ -337,7 +337,7 @@ bool Foam::HashTable<T, Key, Hash>::iteratorBase::erase()
             hashTable_->table_[hashIndex_] = entryPtr_->next_;
             delete entryPtr_;
 
-            // Assign any non-NULL pointer value so it doesn't look
+            // Assign any non-nullptr pointer value so it doesn't look
             // like end()/cend()
             entryPtr_ = reinterpret_cast<hashedEntry*>(this);
 
@@ -519,7 +519,7 @@ void Foam::HashTable<T, Key, Hash>::transfer(HashTable<T, Key, Hash>& ht)
     ht.tableSize_ = 0;
 
     table_ = ht.table_;
-    ht.table_ = NULL;
+    ht.table_ = nullptr;
 
     nElmts_ = ht.nElmts_;
     ht.nElmts_ = 0;
diff --git a/src/OpenFOAM/containers/HashTables/HashTable/HashTableI.H b/src/OpenFOAM/containers/HashTables/HashTable/HashTableI.H
index 83c8a394c46..23034975852 100644
--- a/src/OpenFOAM/containers/HashTables/HashTable/HashTableI.H
+++ b/src/OpenFOAM/containers/HashTables/HashTable/HashTableI.H
@@ -181,7 +181,7 @@ inline Foam::HashTable<T, Key, Hash>::iteratorBase::iteratorBase
 {
     if (hashTable_->nElmts_)
     {
-        // find first non-NULL table entry
+        // find first non-nullptr table entry
         while
         (
             !(entryPtr_ = hashTable_->table_[hashIndex_])
@@ -235,7 +235,7 @@ Foam::HashTable<T, Key, Hash>::iteratorBase::increment()
     }
     // else
     // {
-    //     // if we reach here (entryPtr_ is NULL) it is already at the end()
+    //     // if we reach here (entryPtr_ is nullptr) it is already at the end()
     //     // we should probably stop
     // }
 
diff --git a/src/OpenFOAM/containers/HashTables/HashTable/HashTableIO.C b/src/OpenFOAM/containers/HashTables/HashTable/HashTableIO.C
index f56429ce5e2..280fc8a623b 100644
--- a/src/OpenFOAM/containers/HashTables/HashTable/HashTableIO.C
+++ b/src/OpenFOAM/containers/HashTables/HashTable/HashTableIO.C
@@ -2,7 +2,7 @@
   =========                 |
   \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox
    \\    /   O peration     |
-    \\  /    A nd           | Copyright (C) 2011-2015 OpenFOAM Foundation
+    \\  /    A nd           | Copyright (C) 2011-2016 OpenFOAM Foundation
      \\/     M anipulation  |
 -------------------------------------------------------------------------------
 License
@@ -35,7 +35,7 @@ Foam::HashTable<T, Key, Hash>::HashTable(Istream& is, const label size)
     HashTableCore(),
     nElmts_(0),
     tableSize_(HashTableCore::canonicalSize(size)),
-    table_(NULL)
+    table_(nullptr)
 {
     if (tableSize_)
     {
diff --git a/src/OpenFOAM/containers/LinkedLists/linkTypes/DLListBase/DLListBase.H b/src/OpenFOAM/containers/LinkedLists/linkTypes/DLListBase/DLListBase.H
index 0e7fc75aa80..3208c250a96 100644
--- a/src/OpenFOAM/containers/LinkedLists/linkTypes/DLListBase/DLListBase.H
+++ b/src/OpenFOAM/containers/LinkedLists/linkTypes/DLListBase/DLListBase.H
@@ -2,7 +2,7 @@
   =========                 |
   \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox
    \\    /   O peration     |
-    \\  /    A nd           | Copyright (C) 2011-2015 OpenFOAM Foundation
+    \\  /    A nd           | Copyright (C) 2011-2016 OpenFOAM Foundation
      \\/     M anipulation  |
 -------------------------------------------------------------------------------
 License
@@ -197,7 +197,7 @@ public:
 
             // Private Member Functions
 
-            //- Construct for a given SLListBase with NULL element and link.
+            //- Construct for a given SLListBase with nullptr element and link.
             //  Only used to create endIter
             inline iterator(DLListBase&);
 
diff --git a/src/OpenFOAM/containers/LinkedLists/linkTypes/DLListBase/DLListBaseI.H b/src/OpenFOAM/containers/LinkedLists/linkTypes/DLListBase/DLListBaseI.H
index c13482d30a2..91c0bc9ddbd 100644
--- a/src/OpenFOAM/containers/LinkedLists/linkTypes/DLListBase/DLListBaseI.H
+++ b/src/OpenFOAM/containers/LinkedLists/linkTypes/DLListBase/DLListBaseI.H
@@ -2,7 +2,7 @@
   =========                 |
   \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox
    \\    /   O peration     |
-    \\  /    A nd           | Copyright (C) 2011-2015 OpenFOAM Foundation
+    \\  /    A nd           | Copyright (C) 2011-2016 OpenFOAM Foundation
      \\/     M anipulation  |
 -------------------------------------------------------------------------------
 License
@@ -190,7 +190,7 @@ inline Foam::DLListBase::iterator::iterator(DLListBase& s, link* elmt)
 inline Foam::DLListBase::iterator::iterator(DLListBase& s)
 :
     curList_(s),
-    curElmt_(NULL),
+    curElmt_(nullptr),
     curLink_()
 {}
 
diff --git a/src/OpenFOAM/containers/LinkedLists/linkTypes/SLListBase/SLListBase.H b/src/OpenFOAM/containers/LinkedLists/linkTypes/SLListBase/SLListBase.H
index 57717c797d0..add64244557 100644
--- a/src/OpenFOAM/containers/LinkedLists/linkTypes/SLListBase/SLListBase.H
+++ b/src/OpenFOAM/containers/LinkedLists/linkTypes/SLListBase/SLListBase.H
@@ -2,7 +2,7 @@
   =========                 |
   \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox
    \\    /   O peration     |
-    \\  /    A nd           | Copyright (C) 2011-2015 OpenFOAM Foundation
+    \\  /    A nd           | Copyright (C) 2011-2016 OpenFOAM Foundation
      \\/     M anipulation  |
 -------------------------------------------------------------------------------
 License
@@ -179,7 +179,7 @@ public:
 
             // Private Member Functions
 
-            //- Construct for a given SLListBase with NULL element and link.
+            //- Construct for a given SLListBase with nullptr element and link.
             //  Only used to create endIter
             inline iterator(SLListBase&);
 
diff --git a/src/OpenFOAM/containers/LinkedLists/linkTypes/SLListBase/SLListBaseI.H b/src/OpenFOAM/containers/LinkedLists/linkTypes/SLListBase/SLListBaseI.H
index 21a2fa020cd..fc9b9f007c0 100644
--- a/src/OpenFOAM/containers/LinkedLists/linkTypes/SLListBase/SLListBaseI.H
+++ b/src/OpenFOAM/containers/LinkedLists/linkTypes/SLListBase/SLListBaseI.H
@@ -2,7 +2,7 @@
   =========                 |
   \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox
    \\    /   O peration     |
-    \\  /    A nd           | Copyright (C) 2011-2015 OpenFOAM Foundation
+    \\  /    A nd           | Copyright (C) 2011-2016 OpenFOAM Foundation
      \\/     M anipulation  |
 -------------------------------------------------------------------------------
 License
@@ -166,7 +166,7 @@ inline Foam::SLListBase::iterator::iterator(SLListBase& s, link* elmt)
 inline Foam::SLListBase::iterator::iterator(SLListBase& s)
 :
     curList_(s),
-    curElmt_(NULL),
+    curElmt_(nullptr),
     curLink_()
 {}
 
diff --git a/src/OpenFOAM/containers/Lists/List/List.C b/src/OpenFOAM/containers/Lists/List/List.C
index 8a5637845fc..c86017245b3 100644
--- a/src/OpenFOAM/containers/Lists/List/List.C
+++ b/src/OpenFOAM/containers/Lists/List/List.C
@@ -55,7 +55,7 @@ template<class T>
 template<class InputIterator>
 Foam::List<T>::List(InputIterator first, InputIterator last, const label s)
 :
-    UList<T>(NULL, s)
+    UList<T>(nullptr, s)
 {
     if (this->size_)
     {
@@ -75,7 +75,7 @@ Foam::List<T>::List(InputIterator first, InputIterator last, const label s)
 template<class T>
 Foam::List<T>::List(const label s)
 :
-    UList<T>(NULL, s)
+    UList<T>(nullptr, s)
 {
     if (this->size_ < 0)
     {
@@ -94,7 +94,7 @@ Foam::List<T>::List(const label s)
 template<class T>
 Foam::List<T>::List(const label s, const T& a)
 :
-    UList<T>(NULL, s)
+    UList<T>(nullptr, s)
 {
     if (this->size_ < 0)
     {
@@ -118,7 +118,7 @@ Foam::List<T>::List(const label s, const T& a)
 template<class T>
 Foam::List<T>::List(const label s, const zero)
 :
-    UList<T>(NULL, s)
+    UList<T>(nullptr, s)
 {
     if (this->size_ < 0)
     {
@@ -142,7 +142,7 @@ Foam::List<T>::List(const label s, const zero)
 template<class T>
 Foam::List<T>::List(const List<T>& a)
 :
-    UList<T>(NULL, a.size_)
+    UList<T>(nullptr, a.size_)
 {
     if (this->size_)
     {
@@ -170,7 +170,7 @@ template<class T>
 template<class T2>
 Foam::List<T>::List(const List<T2>& a)
 :
-    UList<T>(NULL, a.size())
+    UList<T>(nullptr, a.size())
 {
     if (this->size_)
     {
@@ -195,7 +195,7 @@ Foam::List<T>::List(const Xfer<List<T>>& lst)
 template<class T>
 Foam::List<T>::List(List<T>& a, bool reuse)
 :
-    UList<T>(NULL, a.size_)
+    UList<T>(nullptr, a.size_)
 {
     if (reuse)
     {
@@ -228,7 +228,7 @@ Foam::List<T>::List(List<T>& a, bool reuse)
 template<class T>
 Foam::List<T>::List(const UList<T>& a, const labelUList& map)
 :
-    UList<T>(NULL, map.size())
+    UList<T>(nullptr, map.size())
 {
     if (this->size_)
     {
@@ -256,7 +256,7 @@ template<class T>
 template<unsigned Size>
 Foam::List<T>::List(const FixedList<T, Size>& lst)
 :
-    UList<T>(NULL, Size)
+    UList<T>(nullptr, Size)
 {
     CopyList(lst);
 }
@@ -265,7 +265,7 @@ Foam::List<T>::List(const FixedList<T, Size>& lst)
 template<class T>
 Foam::List<T>::List(const PtrList<T>& lst)
 :
-    UList<T>(NULL, lst.size())
+    UList<T>(nullptr, lst.size())
 {
     CopyList(lst);
 }
@@ -281,7 +281,7 @@ Foam::List<T>::List(const SLList<T>& lst)
 template<class T>
 Foam::List<T>::List(const UIndirectList<T>& lst)
 :
-    UList<T>(NULL, lst.size())
+    UList<T>(nullptr, lst.size())
 {
     CopyList(lst);
 }
@@ -290,7 +290,7 @@ Foam::List<T>::List(const UIndirectList<T>& lst)
 template<class T>
 Foam::List<T>::List(const BiIndirectList<T>& lst)
 :
-    UList<T>(NULL, lst.size())
+    UList<T>(nullptr, lst.size())
 {
     CopyList(lst);
 }
diff --git a/src/OpenFOAM/containers/Lists/List/ListIO.C b/src/OpenFOAM/containers/Lists/List/ListIO.C
index 1ac3ecc9193..d43fda22d7e 100644
--- a/src/OpenFOAM/containers/Lists/List/ListIO.C
+++ b/src/OpenFOAM/containers/Lists/List/ListIO.C
@@ -34,7 +34,7 @@ License
 template<class T>
 Foam::List<T>::List(Istream& is)
 :
-    UList<T>(NULL, 0)
+    UList<T>(nullptr, 0)
 {
     operator>>(is, *this);
 }
diff --git a/src/OpenFOAM/containers/Lists/PtrList/PtrList.C b/src/OpenFOAM/containers/Lists/PtrList/PtrList.C
index 52ce53cb40b..c0183f501e9 100644
--- a/src/OpenFOAM/containers/Lists/PtrList/PtrList.C
+++ b/src/OpenFOAM/containers/Lists/PtrList/PtrList.C
@@ -164,7 +164,7 @@ void Foam::PtrList<T>::setSize(const label newSize)
         label i;
         for (i=oldSize; i<newSize; i++)
         {
-            this->ptrs_[i] = NULL;
+            this->ptrs_[i] = nullptr;
         }
     }
 }
diff --git a/src/OpenFOAM/containers/Lists/PtrList/PtrList.H b/src/OpenFOAM/containers/Lists/PtrList/PtrList.H
index 623aca4f45c..9d7e7fd5cf6 100644
--- a/src/OpenFOAM/containers/Lists/PtrList/PtrList.H
+++ b/src/OpenFOAM/containers/Lists/PtrList/PtrList.H
@@ -123,7 +123,7 @@ public:
         // Edit
 
             //- Reset size of PtrList. If extending the PtrList, new entries are
-            //  set to NULL. If truncating the PtrList, removed entries are
+            //  set to nullptr. If truncating the PtrList, removed entries are
             //  deleted
             void setSize(const label);
 
@@ -149,7 +149,7 @@ public:
             //- Is element set
             inline bool set(const label) const;
 
-            //- Set element to given T* and return old element (can be NULL)
+            //- Set element to given T* and return old element (can be nullptr)
             inline autoPtr<T> set(const label, T*);
 
             //- Set element to given autoPtr<T> and return old element
diff --git a/src/OpenFOAM/containers/Lists/PtrList/PtrListI.H b/src/OpenFOAM/containers/Lists/PtrList/PtrListI.H
index cfe7e265341..821c00de35b 100644
--- a/src/OpenFOAM/containers/Lists/PtrList/PtrListI.H
+++ b/src/OpenFOAM/containers/Lists/PtrList/PtrListI.H
@@ -64,7 +64,7 @@ inline void Foam::PtrList<T>::append
 template<class T>
 inline bool Foam::PtrList<T>::set(const label i) const
 {
-    return this->ptrs_[i] != NULL;
+    return this->ptrs_[i] != nullptr;
 }
 
 
diff --git a/src/OpenFOAM/containers/Lists/UPtrList/UPtrList.C b/src/OpenFOAM/containers/Lists/UPtrList/UPtrList.C
index c95d4808250..47b7f9339f1 100644
--- a/src/OpenFOAM/containers/Lists/UPtrList/UPtrList.C
+++ b/src/OpenFOAM/containers/Lists/UPtrList/UPtrList.C
@@ -74,10 +74,10 @@ void Foam::UPtrList<T>::setSize(const label newSize)
     {
         ptrs_.setSize(newSize);
 
-        // set new elements to NULL
+        // set new elements to nullptr
         for (label i=oldSize; i<newSize; i++)
         {
-            ptrs_[i] = NULL;
+            ptrs_[i] = nullptr;
         }
     }
 }
diff --git a/src/OpenFOAM/containers/Lists/UPtrList/UPtrList.H b/src/OpenFOAM/containers/Lists/UPtrList/UPtrList.H
index 9c92a8f347b..4ed912500b6 100644
--- a/src/OpenFOAM/containers/Lists/UPtrList/UPtrList.H
+++ b/src/OpenFOAM/containers/Lists/UPtrList/UPtrList.H
@@ -200,7 +200,7 @@ public:
             //- Is element set
             inline bool set(const label) const;
 
-            //- Set element. Return old element (can be NULL).
+            //- Set element. Return old element (can be nullptr).
             //  No checks on new element
             inline T* set(const label, T*);
 
diff --git a/src/OpenFOAM/containers/Lists/UPtrList/UPtrListI.H b/src/OpenFOAM/containers/Lists/UPtrList/UPtrListI.H
index 06002c2ae47..191ae39da73 100644
--- a/src/OpenFOAM/containers/Lists/UPtrList/UPtrListI.H
+++ b/src/OpenFOAM/containers/Lists/UPtrList/UPtrListI.H
@@ -77,7 +77,7 @@ inline void Foam::UPtrList<T>::resize(const label newSize)
 template<class T>
 inline bool Foam::UPtrList<T>::set(const label i) const
 {
-    return ptrs_[i] != NULL;
+    return ptrs_[i] != nullptr;
 }
 
 
diff --git a/src/OpenFOAM/db/IOobject/IOobject.C b/src/OpenFOAM/db/IOobject/IOobject.C
index e3013bc02db..8c8f30ac0e2 100644
--- a/src/OpenFOAM/db/IOobject/IOobject.C
+++ b/src/OpenFOAM/db/IOobject/IOobject.C
@@ -387,12 +387,12 @@ Foam::Istream* Foam::IOobject::objectStream(const fileName& fName)
         else
         {
             delete isPtr;
-            return NULL;
+            return nullptr;
         }
     }
     else
     {
-        return NULL;
+        return nullptr;
     }
 }
 
diff --git a/src/OpenFOAM/db/IOobject/IOobject.H b/src/OpenFOAM/db/IOobject/IOobject.H
index 15235b947e8..cef37bfd527 100644
--- a/src/OpenFOAM/db/IOobject/IOobject.H
+++ b/src/OpenFOAM/db/IOobject/IOobject.H
@@ -160,11 +160,11 @@ protected:
     // Protected Member Functions
 
         //- Construct and return an IFstream for the object.
-        //  The results is NULL if the stream construction failed
+        //  The results is nullptr if the stream construction failed
         Istream* objectStream();
 
         //- Construct and return an IFstream for the object given the
-        //  exact file. The results is NULL if the stream construction failed
+        //  exact file. The results is nullptr if the stream construction failed
         Istream* objectStream(const fileName&);
 
         //- Set the object state to bad
diff --git a/src/OpenFOAM/db/IOobjectList/IOobjectList.C b/src/OpenFOAM/db/IOobjectList/IOobjectList.C
index a3e1ece14d0..08d52c17fe5 100644
--- a/src/OpenFOAM/db/IOobjectList/IOobjectList.C
+++ b/src/OpenFOAM/db/IOobjectList/IOobjectList.C
@@ -145,7 +145,7 @@ Foam::IOobject* Foam::IOobjectList::lookup(const word& name) const
             InfoInFunction << "Could not find " << name << endl;
         }
 
-        return NULL;
+        return nullptr;
     }
 }
 
diff --git a/src/OpenFOAM/db/IOobjectList/IOobjectList.H b/src/OpenFOAM/db/IOobjectList/IOobjectList.H
index e5a3c20cb3c..5a0177d197d 100644
--- a/src/OpenFOAM/db/IOobjectList/IOobjectList.H
+++ b/src/OpenFOAM/db/IOobjectList/IOobjectList.H
@@ -2,7 +2,7 @@
   =========                 |
   \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox
    \\    /   O peration     |
-    \\  /    A nd           | Copyright (C) 2011-2015 OpenFOAM Foundation
+    \\  /    A nd           | Copyright (C) 2011-2016 OpenFOAM Foundation
      \\/     M anipulation  |
 -------------------------------------------------------------------------------
 License
@@ -92,7 +92,7 @@ public:
         //- Remove an IOobject from the list
         bool remove(IOobject&);
 
-        //- Lookup a given name and return IOobject ptr if found else NULL
+        //- Lookup a given name and return IOobject ptr if found else nullptr
         IOobject* lookup(const word& name) const;
 
         //- Return the list for all IOobects whose name matches name
diff --git a/src/OpenFOAM/db/IOstreams/Fstreams/IFstream.C b/src/OpenFOAM/db/IOstreams/Fstreams/IFstream.C
index 57a90a196d0..b558fbd3219 100644
--- a/src/OpenFOAM/db/IOstreams/Fstreams/IFstream.C
+++ b/src/OpenFOAM/db/IOstreams/Fstreams/IFstream.C
@@ -39,7 +39,7 @@ namespace Foam
 
 Foam::IFstreamAllocator::IFstreamAllocator(const fileName& pathname)
 :
-    ifPtr_(NULL),
+    ifPtr_(nullptr),
     compression_(IOstream::UNCOMPRESSED)
 {
     if (pathname.empty())
diff --git a/src/OpenFOAM/db/IOstreams/Fstreams/OFstream.C b/src/OpenFOAM/db/IOstreams/Fstreams/OFstream.C
index 1dd2c0531cd..6e4ca2d0579 100644
--- a/src/OpenFOAM/db/IOstreams/Fstreams/OFstream.C
+++ b/src/OpenFOAM/db/IOstreams/Fstreams/OFstream.C
@@ -43,7 +43,7 @@ Foam::OFstreamAllocator::OFstreamAllocator
     IOstream::compressionType compression
 )
 :
-    ofPtr_(NULL)
+    ofPtr_(nullptr)
 {
     if (pathname.empty())
     {
diff --git a/src/OpenFOAM/db/IOstreams/token/token.H b/src/OpenFOAM/db/IOstreams/token/token.H
index 7229e58b862..4d97fb7f395 100644
--- a/src/OpenFOAM/db/IOstreams/token/token.H
+++ b/src/OpenFOAM/db/IOstreams/token/token.H
@@ -94,7 +94,7 @@ public:
     //- Standard punctuation tokens
     enum punctuationToken
     {
-        NULL_TOKEN     = '\0',
+        nullptr_TOKEN     = '\0',
         SPACE          = ' ',
         TAB            = '\t',
         NL             = '\n',
diff --git a/src/OpenFOAM/db/IOstreams/token/tokenI.H b/src/OpenFOAM/db/IOstreams/token/tokenI.H
index 2f0383c9b25..0ffc613d3d0 100644
--- a/src/OpenFOAM/db/IOstreams/token/tokenI.H
+++ b/src/OpenFOAM/db/IOstreams/token/tokenI.H
@@ -206,7 +206,7 @@ inline Foam::token::punctuationToken  Foam::token::pToken() const
     else
     {
         parseError("punctuation character");
-        return NULL_TOKEN;
+        return nullptr_TOKEN;
     }
 }
 
diff --git a/src/OpenFOAM/db/dictionary/dictionary.C b/src/OpenFOAM/db/dictionary/dictionary.C
index 9717d209581..6512ce1e2b7 100644
--- a/src/OpenFOAM/db/dictionary/dictionary.C
+++ b/src/OpenFOAM/db/dictionary/dictionary.C
@@ -372,7 +372,7 @@ const Foam::entry* Foam::dictionary::lookupEntryPtr
         }
         else
         {
-            return NULL;
+            return nullptr;
         }
     }
 
@@ -416,7 +416,7 @@ Foam::entry* Foam::dictionary::lookupEntryPtr
         }
         else
         {
-            return NULL;
+            return nullptr;
         }
     }
 
@@ -433,7 +433,7 @@ const Foam::entry& Foam::dictionary::lookupEntry
 {
     const entry* entryPtr = lookupEntryPtr(keyword, recursive, patternMatch);
 
-    if (entryPtr == NULL)
+    if (entryPtr == nullptr)
     {
         FatalIOErrorInFunction
         (
@@ -567,7 +567,7 @@ const Foam::entry* Foam::dictionary::lookupScopedEntryPtr
                 }
                 else
                 {
-                    return NULL;
+                    return nullptr;
                 }
             }
         }
@@ -583,7 +583,7 @@ bool Foam::dictionary::substituteScopedKeyword(const word& keyword)
     const entry* ePtr = lookupScopedEntryPtr(varName, true, true);
 
     // If defined insert its entries into this dictionary
-    if (ePtr != NULL)
+    if (ePtr != nullptr)
     {
         const dictionary& addDict = ePtr->dict();
 
@@ -625,7 +625,7 @@ const Foam::dictionary* Foam::dictionary::subDictPtr(const word& keyword) const
     }
     else
     {
-        return NULL;
+        return nullptr;
     }
 }
 
@@ -634,7 +634,7 @@ const Foam::dictionary& Foam::dictionary::subDict(const word& keyword) const
 {
     const entry* entryPtr = lookupEntryPtr(keyword, false, true);
 
-    if (entryPtr == NULL)
+    if (entryPtr == nullptr)
     {
         FatalIOErrorInFunction
         (
@@ -651,7 +651,7 @@ Foam::dictionary& Foam::dictionary::subDict(const word& keyword)
 {
     entry* entryPtr = lookupEntryPtr(keyword, false, true);
 
-    if (entryPtr == NULL)
+    if (entryPtr == nullptr)
     {
         FatalIOErrorInFunction
         (
@@ -672,7 +672,7 @@ Foam::dictionary Foam::dictionary::subOrEmptyDict
 {
     const entry* entryPtr = lookupEntryPtr(keyword, false, true);
 
-    if (entryPtr == NULL)
+    if (entryPtr == nullptr)
     {
         if (mustRead)
         {
diff --git a/src/OpenFOAM/db/dictionary/dictionary.H b/src/OpenFOAM/db/dictionary/dictionary.H
index 90ae1917fbf..14ed0db635c 100644
--- a/src/OpenFOAM/db/dictionary/dictionary.H
+++ b/src/OpenFOAM/db/dictionary/dictionary.H
@@ -283,7 +283,7 @@ public:
             ) const;
 
             //- Find and return an entry data stream pointer if present
-            //  otherwise return NULL.
+            //  otherwise return nullptr.
             //  If recursive, search parent dictionaries.
             //  If patternMatch, use regular expressions
             const entry* lookupEntryPtr
@@ -294,7 +294,7 @@ public:
             ) const;
 
             //- Find and return an entry data stream pointer for manipulation
-            //  if present otherwise return NULL.
+            //  if present otherwise return nullptr.
             //  If recursive, search parent dictionaries.
             //  If patternMatch, use regular expressions.
             entry* lookupEntryPtr
@@ -364,7 +364,7 @@ public:
             ) const;
 
             //- Find and return an entry data stream pointer if present
-            //  otherwise return NULL. Allows scoping using '.'
+            //  otherwise return nullptr. Allows scoping using '.'
             const entry* lookupScopedEntryPtr
             (
                 const word&,
@@ -376,7 +376,7 @@ public:
             bool isDict(const word&) const;
 
             //- Find and return a sub-dictionary pointer if present
-            //  otherwise return NULL.
+            //  otherwise return nullptr.
             const dictionary* subDictPtr(const word&) const;
 
             //- Find and return a sub-dictionary
diff --git a/src/OpenFOAM/db/dictionary/dictionaryIO.C b/src/OpenFOAM/db/dictionary/dictionaryIO.C
index f27d326d8c6..586cb8ef465 100644
--- a/src/OpenFOAM/db/dictionary/dictionaryIO.C
+++ b/src/OpenFOAM/db/dictionary/dictionaryIO.C
@@ -137,7 +137,7 @@ bool Foam::dictionary::substituteKeyword(const word& keyword)
     const entry* ePtr = lookupEntryPtr(varName, true, true);
 
     // if defined insert its entries into this dictionary
-    if (ePtr != NULL)
+    if (ePtr != nullptr)
     {
         const dictionary& addDict = ePtr->dict();
 
diff --git a/src/OpenFOAM/db/dictionary/entry/entryIO.C b/src/OpenFOAM/db/dictionary/entry/entryIO.C
index 6e7d257688d..48b539588be 100644
--- a/src/OpenFOAM/db/dictionary/entry/entryIO.C
+++ b/src/OpenFOAM/db/dictionary/entry/entryIO.C
@@ -2,7 +2,7 @@
   =========                 |
   \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox
    \\    /   O peration     |
-    \\  /    A nd           | Copyright (C) 2011-2015 OpenFOAM Foundation
+    \\  /    A nd           | Copyright (C) 2011-2016 OpenFOAM Foundation
      \\/     M anipulation  |
 -------------------------------------------------------------------------------
 License
@@ -262,7 +262,7 @@ Foam::autoPtr<Foam::entry> Foam::entry::New(Istream& is)
     // Get the next keyword and if invalid return false
     if (!getKeyword(keyword, is))
     {
-        return autoPtr<entry>(NULL);
+        return autoPtr<entry>(nullptr);
     }
     else // Keyword starts entry ...
     {
diff --git a/src/OpenFOAM/db/dictionary/functionEntries/codeStream/codeStream.C b/src/OpenFOAM/db/dictionary/functionEntries/codeStream/codeStream.C
index f0e90284fb8..cc119532fde 100644
--- a/src/OpenFOAM/db/dictionary/functionEntries/codeStream/codeStream.C
+++ b/src/OpenFOAM/db/dictionary/functionEntries/codeStream/codeStream.C
@@ -2,7 +2,7 @@
   =========                 |
   \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox
    \\    /   O peration     |
-    \\  /    A nd           | Copyright (C) 2011-2015 OpenFOAM Foundation
+    \\  /    A nd           | Copyright (C) 2011-2016 OpenFOAM Foundation
      \\/     M anipulation  |
 -------------------------------------------------------------------------------
 License
@@ -95,7 +95,7 @@ Foam::functionEntries::codeStream::getFunction
     const fileName libPath = dynCode.libPath();
 
     // see if library is loaded
-    void* lib = NULL;
+    void* lib = nullptr;
     if (isA<IOdictionary>(parentDict.topDict()))
     {
         lib = libs(parentDict).findLibrary(libPath);
diff --git a/src/OpenFOAM/db/dynamicLibrary/dlLibraryTable/dlLibraryTable.C b/src/OpenFOAM/db/dynamicLibrary/dlLibraryTable/dlLibraryTable.C
index 83a4658108a..f99d39bc3ce 100644
--- a/src/OpenFOAM/db/dynamicLibrary/dlLibraryTable/dlLibraryTable.C
+++ b/src/OpenFOAM/db/dynamicLibrary/dlLibraryTable/dlLibraryTable.C
@@ -142,7 +142,7 @@ bool Foam::dlLibraryTable::close
 
         bool ok = dlClose(libPtrs_[index]);
 
-        libPtrs_[index] = NULL;
+        libPtrs_[index] = nullptr;
         libNames_[index] = fileName::null;
 
         if (!ok)
@@ -179,7 +179,7 @@ void* Foam::dlLibraryTable::findLibrary(const fileName& functionLibName)
     {
         return libPtrs_[index];
     }
-    return NULL;
+    return nullptr;
 }
 
 
diff --git a/src/OpenFOAM/db/functionObjects/functionObject/functionObject.H b/src/OpenFOAM/db/functionObjects/functionObject/functionObject.H
index cfe7e3a5444..40a626c30fc 100644
--- a/src/OpenFOAM/db/functionObjects/functionObject/functionObject.H
+++ b/src/OpenFOAM/db/functionObjects/functionObject/functionObject.H
@@ -180,7 +180,7 @@ public:
         autoPtr<functionObject> clone() const
         {
             NotImplemented;
-            return autoPtr<functionObject>(NULL);
+            return autoPtr<functionObject>(nullptr);
         }
 
 
diff --git a/src/OpenFOAM/db/functionObjects/functionObjectList/functionObjectList.C b/src/OpenFOAM/db/functionObjects/functionObjectList/functionObjectList.C
index 105e2f6aea4..7bd1882942b 100644
--- a/src/OpenFOAM/db/functionObjects/functionObjectList/functionObjectList.C
+++ b/src/OpenFOAM/db/functionObjects/functionObjectList/functionObjectList.C
@@ -606,7 +606,7 @@ bool Foam::functionObjectList::read()
                 {
                     // Delete the disabled functionObject
                     delete objPtr;
-                    objPtr = NULL;
+                    objPtr = nullptr;
                     continue;
                 }
             }
diff --git a/src/OpenFOAM/db/functionObjects/functionObjectList/functionObjectList.H b/src/OpenFOAM/db/functionObjects/functionObjectList/functionObjectList.H
index 83a3060d35d..672ff38f970 100644
--- a/src/OpenFOAM/db/functionObjects/functionObjectList/functionObjectList.H
+++ b/src/OpenFOAM/db/functionObjects/functionObjectList/functionObjectList.H
@@ -88,7 +88,7 @@ class functionObjectList
 
         //- Remove and return the function object pointer by name,
         //  and returns the old index via the parameter.
-        //  Returns a NULL pointer (and index -1) if it didn't exist
+        //  Returns a nullptr pointer (and index -1) if it didn't exist
         functionObject* remove(const word&, label& oldIndex);
 
         //- Search the specified directory for functionObject
diff --git a/src/OpenFOAM/db/regIOobject/regIOobject.C b/src/OpenFOAM/db/regIOobject/regIOobject.C
index b2447447d14..fbd5f64eeff 100644
--- a/src/OpenFOAM/db/regIOobject/regIOobject.C
+++ b/src/OpenFOAM/db/regIOobject/regIOobject.C
@@ -128,7 +128,7 @@ Foam::regIOobject::regIOobject(const IOobject& io, const bool isTime)
       ? 0
       : db().getEvent()
     ),
-    isPtr_(NULL)
+    isPtr_(nullptr)
 {
     // Register with objectRegistry if requested
     if (registerObject())
@@ -145,7 +145,7 @@ Foam::regIOobject::regIOobject(const regIOobject& rio)
     ownedByRegistry_(false),
     watchIndex_(rio.watchIndex_),
     eventNo_(db().getEvent()),
-    isPtr_(NULL)
+    isPtr_(nullptr)
 {
     // Do not register copy with objectRegistry
 }
@@ -158,7 +158,7 @@ Foam::regIOobject::regIOobject(const regIOobject& rio, bool registerCopy)
     ownedByRegistry_(false),
     watchIndex_(-1),
     eventNo_(db().getEvent()),
-    isPtr_(NULL)
+    isPtr_(nullptr)
 {
     if (registerCopy && rio.registered_)
     {
@@ -180,7 +180,7 @@ Foam::regIOobject::regIOobject
     ownedByRegistry_(false),
     watchIndex_(-1),
     eventNo_(db().getEvent()),
-    isPtr_(NULL)
+    isPtr_(nullptr)
 {
     if (registerCopy)
     {
@@ -200,7 +200,7 @@ Foam::regIOobject::regIOobject
     ownedByRegistry_(false),
     watchIndex_(-1),
     eventNo_(db().getEvent()),
-    isPtr_(NULL)
+    isPtr_(nullptr)
 {
     if (registerObject())
     {
@@ -224,7 +224,7 @@ Foam::regIOobject::~regIOobject()
     if (isPtr_)
     {
         delete isPtr_;
-        isPtr_ = NULL;
+        isPtr_ = nullptr;
     }
 
     // Check out of objectRegistry if not owned by the registry
@@ -425,7 +425,7 @@ void Foam::regIOobject::operator=(const IOobject& io)
     if (isPtr_)
     {
         delete isPtr_;
-        isPtr_ = NULL;
+        isPtr_ = nullptr;
     }
 
     // Check out of objectRegistry
diff --git a/src/OpenFOAM/db/regIOobject/regIOobjectRead.C b/src/OpenFOAM/db/regIOobject/regIOobjectRead.C
index 0ea3228226b..c699bb301f7 100644
--- a/src/OpenFOAM/db/regIOobject/regIOobjectRead.C
+++ b/src/OpenFOAM/db/regIOobject/regIOobjectRead.C
@@ -156,7 +156,7 @@ void Foam::regIOobject::close()
     if (isPtr_)
     {
         delete isPtr_;
-        isPtr_ = NULL;
+        isPtr_ = nullptr;
     }
 }
 
diff --git a/src/OpenFOAM/db/runTimeSelection/construction/runTimeSelectionTables.H b/src/OpenFOAM/db/runTimeSelection/construction/runTimeSelectionTables.H
index 6386c460fb8..ac8d362eeb0 100644
--- a/src/OpenFOAM/db/runTimeSelection/construction/runTimeSelectionTables.H
+++ b/src/OpenFOAM/db/runTimeSelection/construction/runTimeSelectionTables.H
@@ -253,7 +253,7 @@ Description
         if (baseType::argNames##ConstructorTablePtr_)                          \
         {                                                                      \
             delete baseType::argNames##ConstructorTablePtr_;                   \
-            baseType::argNames##ConstructorTablePtr_ = NULL;                   \
+            baseType::argNames##ConstructorTablePtr_ = nullptr;                \
         }                                                                      \
     }
 
@@ -263,7 +263,7 @@ Description
                                                                                \
     /* Define the constructor function table */                                \
     baseType::argNames##ConstructorTable*                                      \
-        baseType::argNames##ConstructorTablePtr_ = NULL
+        baseType::argNames##ConstructorTablePtr_ = nullptr
 
 
 
@@ -316,7 +316,7 @@ Description
         if (baseType<Targ>::argNames##ConstructorTablePtr_)                    \
         {                                                                      \
             delete baseType<Targ>::argNames##ConstructorTablePtr_;             \
-            baseType<Targ>::argNames##ConstructorTablePtr_ = NULL;             \
+            baseType<Targ>::argNames##ConstructorTablePtr_ = nullptr;          \
         }                                                                      \
     }
 
@@ -327,7 +327,7 @@ Description
                                                                                \
     /* Define the constructor function table */                                \
     baseType<Targ>::argNames##ConstructorTable*                                \
-        baseType<Targ>::argNames##ConstructorTablePtr_ = NULL
+        baseType<Targ>::argNames##ConstructorTablePtr_ = nullptr
 
 
 //- Define run-time selection table for template classes
diff --git a/src/OpenFOAM/db/runTimeSelection/memberFunctions/memberFunctionSelectionTables.H b/src/OpenFOAM/db/runTimeSelection/memberFunctions/memberFunctionSelectionTables.H
index ebf1d79b6b7..2e323bda6eb 100644
--- a/src/OpenFOAM/db/runTimeSelection/memberFunctions/memberFunctionSelectionTables.H
+++ b/src/OpenFOAM/db/runTimeSelection/memberFunctions/memberFunctionSelectionTables.H
@@ -113,7 +113,8 @@ Description
         if (baseType::memberFunction##argNames##MemberFunctionTablePtr_)       \
         {                                                                      \
             delete baseType::memberFunction##argNames##MemberFunctionTablePtr_;\
-            baseType::memberFunction##argNames##MemberFunctionTablePtr_ = NULL;\
+            baseType::memberFunction##argNames##MemberFunctionTablePtr_ =      \
+                nullptr;                                                       \
         }                                                                      \
     }
 
@@ -123,7 +124,7 @@ Description
                                                                                \
     /* Define the memberFunction table */                                      \
     baseType::memberFunction##argNames##MemberFunctionTable*                   \
-        baseType::memberFunction##argNames##MemberFunctionTablePtr_ = NULL
+        baseType::memberFunction##argNames##MemberFunctionTablePtr_ = nullptr
 
 
 
@@ -194,7 +195,7 @@ Description
             delete baseType<Targ>::memberFunction##argNames##                  \
                 MemberFunctionTablePtr_;                                       \
             baseType<Targ>::memberFunction##argNames##                         \
-                MemberFunctionTablePtr_ = NULL;                                \
+                MemberFunctionTablePtr_ = nullptr;                             \
         }                                                                      \
     }
 
@@ -206,7 +207,8 @@ Description
                                                                                \
     /* Define the memberFunction table */                                      \
     baseType<Targ>::memberFunction##argNames##MemberFunctionTable*             \
-        baseType<Targ>::memberFunction##argNames##MemberFunctionTablePtr_ = NULL
+        baseType<Targ>::memberFunction##argNames##MemberFunctionTablePtr_ =    \
+        nullptr
 
 
 //- Define run-time selection table for template classes
diff --git a/src/OpenFOAM/dimensionSet/dimensionSets.C b/src/OpenFOAM/dimensionSet/dimensionSets.C
index 85ccde69470..577ea7c5974 100644
--- a/src/OpenFOAM/dimensionSet/dimensionSets.C
+++ b/src/OpenFOAM/dimensionSet/dimensionSets.C
@@ -38,9 +38,9 @@ namespace Foam
 // Since dimensionSystems() can be reread we actually store a copy of
 // the controlDict subDict (v.s. a reference to the subDict for e.g.
 // dimensionedConstants)
-dictionary* dimensionSystemsPtr_(NULL);
-HashTable<dimensionedScalar>* unitSetPtr_(NULL);
-dimensionSets* writeUnitSetPtr_(NULL);
+dictionary* dimensionSystemsPtr_(nullptr);
+HashTable<dimensionedScalar>* unitSetPtr_(nullptr);
+dimensionSets* writeUnitSetPtr_(nullptr);
 
 // Helper class to
 //   register re-reader
@@ -80,7 +80,7 @@ dictionary& dimensionSystems()
 {
     if (!dimensionSystemsPtr_)
     {
-        dictionary* cachedPtr = NULL;
+        dictionary* cachedPtr = nullptr;
         dimensionSystemsPtr_ = new dictionary
         (
             debug::switchSet
diff --git a/src/OpenFOAM/fields/Fields/Field/FieldMapper.H b/src/OpenFOAM/fields/Fields/Field/FieldMapper.H
index b40e2fd03b6..d123472f98d 100644
--- a/src/OpenFOAM/fields/Fields/Field/FieldMapper.H
+++ b/src/OpenFOAM/fields/Fields/Field/FieldMapper.H
@@ -76,7 +76,7 @@ public:
             FatalErrorInFunction
                 << "attempt to access null distributeMap"
                 << abort(FatalError);
-            return *reinterpret_cast<mapDistributeBase*>(NULL);
+            return *static_cast<mapDistributeBase*>(nullptr);
         }
 
         //- Are there unmapped values? I.e. do all size() elements get
diff --git a/src/OpenFOAM/fields/GeometricFields/GeometricField/GeometricField.C b/src/OpenFOAM/fields/GeometricFields/GeometricField/GeometricField.C
index aa454dcafe0..91f4c9bf7cc 100644
--- a/src/OpenFOAM/fields/GeometricFields/GeometricField/GeometricField.C
+++ b/src/OpenFOAM/fields/GeometricFields/GeometricField/GeometricField.C
@@ -183,8 +183,8 @@ Foam::GeometricField<Type, PatchField, GeoMesh>::GeometricField
 :
     Internal(io, mesh, ds, false),
     timeIndex_(this->time().timeIndex()),
-    field0Ptr_(NULL),
-    fieldPrevIterPtr_(NULL),
+    field0Ptr_(nullptr),
+    fieldPrevIterPtr_(nullptr),
     boundaryField_(mesh.boundary(), *this, patchFieldType)
 {
     if (debug)
@@ -208,8 +208,8 @@ Foam::GeometricField<Type, PatchField, GeoMesh>::GeometricField
 :
     Internal(io, mesh, ds, false),
     timeIndex_(this->time().timeIndex()),
-    field0Ptr_(NULL),
-    fieldPrevIterPtr_(NULL),
+    field0Ptr_(nullptr),
+    fieldPrevIterPtr_(nullptr),
     boundaryField_(mesh.boundary(), *this, patchFieldTypes, actualPatchTypes)
 {
     if (debug)
@@ -232,8 +232,8 @@ Foam::GeometricField<Type, PatchField, GeoMesh>::GeometricField
 :
     Internal(io, mesh, dt, false),
     timeIndex_(this->time().timeIndex()),
-    field0Ptr_(NULL),
-    fieldPrevIterPtr_(NULL),
+    field0Ptr_(nullptr),
+    fieldPrevIterPtr_(nullptr),
     boundaryField_(mesh.boundary(), *this, patchFieldType)
 {
     if (debug)
@@ -259,8 +259,8 @@ Foam::GeometricField<Type, PatchField, GeoMesh>::GeometricField
 :
     Internal(io, mesh, dt, false),
     timeIndex_(this->time().timeIndex()),
-    field0Ptr_(NULL),
-    fieldPrevIterPtr_(NULL),
+    field0Ptr_(nullptr),
+    fieldPrevIterPtr_(nullptr),
     boundaryField_(mesh.boundary(), *this, patchFieldTypes, actualPatchTypes)
 {
     if (debug)
@@ -284,8 +284,8 @@ Foam::GeometricField<Type, PatchField, GeoMesh>::GeometricField
 :
     Internal(io, diField),
     timeIndex_(this->time().timeIndex()),
-    field0Ptr_(NULL),
-    fieldPrevIterPtr_(NULL),
+    field0Ptr_(nullptr),
+    fieldPrevIterPtr_(nullptr),
     boundaryField_(this->mesh().boundary(), *this, ptfl)
 {
     if (debug)
@@ -310,8 +310,8 @@ Foam::GeometricField<Type, PatchField, GeoMesh>::GeometricField
 :
     Internal(io, mesh, ds, iField),
     timeIndex_(this->time().timeIndex()),
-    field0Ptr_(NULL),
-    fieldPrevIterPtr_(NULL),
+    field0Ptr_(nullptr),
+    fieldPrevIterPtr_(nullptr),
     boundaryField_(mesh.boundary(), *this, ptfl)
 {
     if (debug)
@@ -333,8 +333,8 @@ Foam::GeometricField<Type, PatchField, GeoMesh>::GeometricField
 :
     Internal(io, mesh, dimless, false),
     timeIndex_(this->time().timeIndex()),
-    field0Ptr_(NULL),
-    fieldPrevIterPtr_(NULL),
+    field0Ptr_(nullptr),
+    fieldPrevIterPtr_(nullptr),
     boundaryField_(mesh.boundary())
 {
     readFields();
@@ -369,8 +369,8 @@ Foam::GeometricField<Type, PatchField, GeoMesh>::GeometricField
 :
     Internal(io, mesh, dimless, false),
     timeIndex_(this->time().timeIndex()),
-    field0Ptr_(NULL),
-    fieldPrevIterPtr_(NULL),
+    field0Ptr_(nullptr),
+    fieldPrevIterPtr_(nullptr),
     boundaryField_(mesh.boundary())
 {
     readFields(dict);
@@ -404,8 +404,8 @@ Foam::GeometricField<Type, PatchField, GeoMesh>::GeometricField
 :
     Internal(gf),
     timeIndex_(gf.timeIndex()),
-    field0Ptr_(NULL),
-    fieldPrevIterPtr_(NULL),
+    field0Ptr_(nullptr),
+    fieldPrevIterPtr_(nullptr),
     boundaryField_(*this, gf.boundaryField_)
 {
     if (debug)
@@ -439,8 +439,8 @@ Foam::GeometricField<Type, PatchField, GeoMesh>::GeometricField
         tgf.isTmp()
     ),
     timeIndex_(tgf().timeIndex()),
-    field0Ptr_(NULL),
-    fieldPrevIterPtr_(NULL),
+    field0Ptr_(nullptr),
+    fieldPrevIterPtr_(nullptr),
     boundaryField_(*this, tgf().boundaryField_)
 {
     if (debug)
@@ -465,8 +465,8 @@ Foam::GeometricField<Type, PatchField, GeoMesh>::GeometricField
 :
     Internal(io, gf),
     timeIndex_(gf.timeIndex()),
-    field0Ptr_(NULL),
-    fieldPrevIterPtr_(NULL),
+    field0Ptr_(nullptr),
+    fieldPrevIterPtr_(nullptr),
     boundaryField_(*this, gf.boundaryField_)
 {
     if (debug)
@@ -502,8 +502,8 @@ Foam::GeometricField<Type, PatchField, GeoMesh>::GeometricField
         tgf.isTmp()
     ),
     timeIndex_(tgf().timeIndex()),
-    field0Ptr_(NULL),
-    fieldPrevIterPtr_(NULL),
+    field0Ptr_(nullptr),
+    fieldPrevIterPtr_(nullptr),
     boundaryField_(*this, tgf().boundaryField_)
 {
     if (debug)
@@ -529,8 +529,8 @@ Foam::GeometricField<Type, PatchField, GeoMesh>::GeometricField
 :
     Internal(newName, gf),
     timeIndex_(gf.timeIndex()),
-    field0Ptr_(NULL),
-    fieldPrevIterPtr_(NULL),
+    field0Ptr_(nullptr),
+    fieldPrevIterPtr_(nullptr),
     boundaryField_(*this, gf.boundaryField_)
 {
     if (debug)
@@ -566,8 +566,8 @@ Foam::GeometricField<Type, PatchField, GeoMesh>::GeometricField
         tgf.isTmp()
     ),
     timeIndex_(tgf().timeIndex()),
-    field0Ptr_(NULL),
-    fieldPrevIterPtr_(NULL),
+    field0Ptr_(nullptr),
+    fieldPrevIterPtr_(nullptr),
     boundaryField_(*this, tgf().boundaryField_)
 {
     if (debug)
@@ -592,8 +592,8 @@ Foam::GeometricField<Type, PatchField, GeoMesh>::GeometricField
 :
     Internal(io, gf),
     timeIndex_(gf.timeIndex()),
-    field0Ptr_(NULL),
-    fieldPrevIterPtr_(NULL),
+    field0Ptr_(nullptr),
+    fieldPrevIterPtr_(nullptr),
     boundaryField_(this->mesh().boundary(), *this, patchFieldType)
 {
     if (debug)
@@ -628,8 +628,8 @@ Foam::GeometricField<Type, PatchField, GeoMesh>::GeometricField
 :
     Internal(io, gf),
     timeIndex_(gf.timeIndex()),
-    field0Ptr_(NULL),
-    fieldPrevIterPtr_(NULL),
+    field0Ptr_(nullptr),
+    fieldPrevIterPtr_(nullptr),
     boundaryField_
     (
         this->mesh().boundary(),
@@ -675,8 +675,8 @@ Foam::GeometricField<Type, PatchField, GeoMesh>::GeometricField
         tgf.isTmp()
     ),
     timeIndex_(tgf().timeIndex()),
-    field0Ptr_(NULL),
-    fieldPrevIterPtr_(NULL),
+    field0Ptr_(nullptr),
+    fieldPrevIterPtr_(nullptr),
     boundaryField_
     (
         this->mesh().boundary(),
diff --git a/src/OpenFOAM/fields/GeometricFields/SlicedGeometricField/SlicedGeometricField.C b/src/OpenFOAM/fields/GeometricFields/SlicedGeometricField/SlicedGeometricField.C
index 8bc8c195b27..f42c11ecdb3 100644
--- a/src/OpenFOAM/fields/GeometricFields/SlicedGeometricField/SlicedGeometricField.C
+++ b/src/OpenFOAM/fields/GeometricFields/SlicedGeometricField/SlicedGeometricField.C
@@ -350,9 +350,9 @@ template
 Foam::SlicedGeometricField<Type, PatchField, SlicedPatchField, GeoMesh>::
 ~SlicedGeometricField()
 {
-    // Set the internalField storage pointer to NULL before its destruction
+    // Set the internalField storage pointer to nullptr before its destruction
     // to protect the field it a slice of.
-    UList<Type>::shallowCopy(UList<Type>(NULL, 0));
+    UList<Type>::shallowCopy(UList<Type>(nullptr, 0));
 }
 
 
@@ -366,9 +366,9 @@ template
 Foam::SlicedGeometricField<Type, PatchField, SlicedPatchField, GeoMesh>::
 Internal::~Internal()
 {
-    // Set the internalField storage pointer to NULL before its destruction
+    // Set the internalField storage pointer to nullptr before its destruction
     // to protect the field it a slice of.
-    UList<Type>::shallowCopy(UList<Type>(NULL, 0));
+    UList<Type>::shallowCopy(UList<Type>(nullptr, 0));
 }
 
 
diff --git a/src/OpenFOAM/global/constants/dimensionedConstants.C b/src/OpenFOAM/global/constants/dimensionedConstants.C
index c55abd567ec..357cbc81da7 100644
--- a/src/OpenFOAM/global/constants/dimensionedConstants.C
+++ b/src/OpenFOAM/global/constants/dimensionedConstants.C
@@ -2,7 +2,7 @@
   =========                 |
   \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox
    \\    /   O peration     |
-    \\  /    A nd           | Copyright (C) 2011 OpenFOAM Foundation
+    \\  /    A nd           | Copyright (C) 2011-2016 OpenFOAM Foundation
      \\/     M anipulation  |
 -------------------------------------------------------------------------------
 License
@@ -32,7 +32,7 @@ namespace Foam
 
 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
 
-dictionary* dimensionedConstantsPtr_(NULL);
+dictionary* dimensionedConstantsPtr_(nullptr);
 
 dictionary& dimensionedConstants()
 {
diff --git a/src/OpenFOAM/global/debug/debug.C b/src/OpenFOAM/global/debug/debug.C
index 1c90bda00db..279be740903 100644
--- a/src/OpenFOAM/global/debug/debug.C
+++ b/src/OpenFOAM/global/debug/debug.C
@@ -44,17 +44,17 @@ namespace debug
 //! \cond ignoreDocumentation
 //- Skip documentation : local scope only
 
-dictionary* controlDictPtr_(NULL);
-dictionary* debugSwitchesPtr_(NULL);
-dictionary* infoSwitchesPtr_(NULL);
-dictionary* optimisationSwitchesPtr_(NULL);
+dictionary* controlDictPtr_(nullptr);
+dictionary* debugSwitchesPtr_(nullptr);
+dictionary* infoSwitchesPtr_(nullptr);
+dictionary* optimisationSwitchesPtr_(nullptr);
 
 // Debug switch read and write callback tables.
-simpleObjectRegistry* debugObjectsPtr_(NULL);
-simpleObjectRegistry* infoObjectsPtr_(NULL);
-simpleObjectRegistry* optimisationObjectsPtr_(NULL);
-simpleObjectRegistry* dimensionSetObjectsPtr_(NULL);
-simpleObjectRegistry* dimensionedConstantObjectsPtr_(NULL);
+simpleObjectRegistry* debugObjectsPtr_(nullptr);
+simpleObjectRegistry* infoObjectsPtr_(nullptr);
+simpleObjectRegistry* optimisationObjectsPtr_(nullptr);
+simpleObjectRegistry* dimensionSetObjectsPtr_(nullptr);
+simpleObjectRegistry* dimensionedConstantObjectsPtr_(nullptr);
 
 
 // To ensure controlDictPtr_ is deleted at the end of the run
@@ -73,9 +73,9 @@ public:
         deleteDemandDrivenData(dimensionSetObjectsPtr_);
         deleteDemandDrivenData(dimensionedConstantObjectsPtr_);
 
-        debugSwitchesPtr_ = NULL;
-        infoSwitchesPtr_ = NULL;
-        optimisationSwitchesPtr_ = NULL;
+        debugSwitchesPtr_ = nullptr;
+        infoSwitchesPtr_ = nullptr;
+        optimisationSwitchesPtr_ = nullptr;
         deleteDemandDrivenData(controlDictPtr_);
     }
 };
diff --git a/src/OpenFOAM/interpolations/interpolation2DTable/interpolation2DTable.C b/src/OpenFOAM/interpolations/interpolation2DTable/interpolation2DTable.C
index fe2e5bd5142..5b089f07ad7 100644
--- a/src/OpenFOAM/interpolations/interpolation2DTable/interpolation2DTable.C
+++ b/src/OpenFOAM/interpolations/interpolation2DTable/interpolation2DTable.C
@@ -57,7 +57,7 @@ Foam::interpolation2DTable<Type>::interpolation2DTable()
     List<Tuple2<scalar, List<Tuple2<scalar, Type>>>>(),
     boundsHandling_(interpolation2DTable::WARN),
     fileName_("fileNameIsUndefined"),
-    reader_(NULL)
+    reader_(nullptr)
 {}
 
 
@@ -72,7 +72,7 @@ Foam::interpolation2DTable<Type>::interpolation2DTable
     List<Tuple2<scalar, List<Tuple2<scalar, Type>>>>(values),
     boundsHandling_(bounds),
     fileName_(fName),
-    reader_(NULL)
+    reader_(nullptr)
 {}
 
 
diff --git a/src/OpenFOAM/interpolations/interpolationTable/interpolationTable.C b/src/OpenFOAM/interpolations/interpolationTable/interpolationTable.C
index 63b7bad3220..8f09b560acb 100644
--- a/src/OpenFOAM/interpolations/interpolationTable/interpolationTable.C
+++ b/src/OpenFOAM/interpolations/interpolationTable/interpolationTable.C
@@ -61,7 +61,7 @@ Foam::interpolationTable<Type>::interpolationTable()
     List<Tuple2<scalar, Type>>(),
     boundsHandling_(interpolationTable::WARN),
     fileName_("fileNameIsUndefined"),
-    reader_(NULL)
+    reader_(nullptr)
 {}
 
 
@@ -76,7 +76,7 @@ Foam::interpolationTable<Type>::interpolationTable
     List<Tuple2<scalar, Type>>(values),
     boundsHandling_(bounds),
     fileName_(fName),
-    reader_(NULL)
+    reader_(nullptr)
 {}
 
 
diff --git a/src/OpenFOAM/interpolations/patchToPatchInterpolation/PatchToPatchInterpolation.C b/src/OpenFOAM/interpolations/patchToPatchInterpolation/PatchToPatchInterpolation.C
index 3324e9af3cd..2b83b6865e1 100644
--- a/src/OpenFOAM/interpolations/patchToPatchInterpolation/PatchToPatchInterpolation.C
+++ b/src/OpenFOAM/interpolations/patchToPatchInterpolation/PatchToPatchInterpolation.C
@@ -118,12 +118,12 @@ PatchToPatchInterpolation<FromPatch, ToPatch>::PatchToPatchInterpolation
     toPatch_(toPatch),
     alg_(alg),
     dir_(dir),
-    pointAddressingPtr_(NULL),
-    pointWeightsPtr_(NULL),
-    pointDistancePtr_(NULL),
-    faceAddressingPtr_(NULL),
-    faceWeightsPtr_(NULL),
-    faceDistancePtr_(NULL)
+    pointAddressingPtr_(nullptr),
+    pointWeightsPtr_(nullptr),
+    pointDistancePtr_(nullptr),
+    faceAddressingPtr_(nullptr),
+    faceWeightsPtr_(nullptr),
+    faceDistancePtr_(nullptr)
 {}
 
 
diff --git a/src/OpenFOAM/interpolations/primitivePatchInterpolation/PrimitivePatchInterpolation.C b/src/OpenFOAM/interpolations/primitivePatchInterpolation/PrimitivePatchInterpolation.C
index 30c5ec1e70a..019afb8aedc 100644
--- a/src/OpenFOAM/interpolations/primitivePatchInterpolation/PrimitivePatchInterpolation.C
+++ b/src/OpenFOAM/interpolations/primitivePatchInterpolation/PrimitivePatchInterpolation.C
@@ -152,8 +152,8 @@ template<class Patch>
 PrimitivePatchInterpolation<Patch>::PrimitivePatchInterpolation(const Patch& p)
 :
     patch_(p),
-    faceToPointWeightsPtr_(NULL),
-    faceToEdgeWeightsPtr_(NULL)
+    faceToPointWeightsPtr_(nullptr),
+    faceToEdgeWeightsPtr_(nullptr)
 {}
 
 
diff --git a/src/OpenFOAM/matrices/LUscalarMatrix/procLduInterface.H b/src/OpenFOAM/matrices/LUscalarMatrix/procLduInterface.H
index 2f6035e3cff..7f99e76a9f2 100644
--- a/src/OpenFOAM/matrices/LUscalarMatrix/procLduInterface.H
+++ b/src/OpenFOAM/matrices/LUscalarMatrix/procLduInterface.H
@@ -93,7 +93,7 @@ public:
         autoPtr<procLduInterface> clone()
         {
             NotImplemented;
-            return autoPtr<procLduInterface>(NULL);
+            return autoPtr<procLduInterface>(nullptr);
         }
 
         static autoPtr<procLduInterface> New(Istream& is)
diff --git a/src/OpenFOAM/matrices/LduMatrix/LduMatrix/LduMatrix.C b/src/OpenFOAM/matrices/LduMatrix/LduMatrix/LduMatrix.C
index a36b31137bf..0e944bd3adb 100644
--- a/src/OpenFOAM/matrices/LduMatrix/LduMatrix/LduMatrix.C
+++ b/src/OpenFOAM/matrices/LduMatrix/LduMatrix/LduMatrix.C
@@ -32,10 +32,10 @@ template<class Type, class DType, class LUType>
 Foam::LduMatrix<Type, DType, LUType>::LduMatrix(const lduMesh& mesh)
 :
     lduMesh_(mesh),
-    diagPtr_(NULL),
-    upperPtr_(NULL),
-    lowerPtr_(NULL),
-    sourcePtr_(NULL),
+    diagPtr_(nullptr),
+    upperPtr_(nullptr),
+    lowerPtr_(nullptr),
+    sourcePtr_(nullptr),
     interfaces_(0),
     interfacesUpper_(0),
     interfacesLower_(0)
@@ -46,10 +46,10 @@ template<class Type, class DType, class LUType>
 Foam::LduMatrix<Type, DType, LUType>::LduMatrix(const LduMatrix& A)
 :
     lduMesh_(A.lduMesh_),
-    diagPtr_(NULL),
-    upperPtr_(NULL),
-    lowerPtr_(NULL),
-    sourcePtr_(NULL),
+    diagPtr_(nullptr),
+    upperPtr_(nullptr),
+    lowerPtr_(nullptr),
+    sourcePtr_(nullptr),
     interfaces_(0),
     interfacesUpper_(0),
     interfacesLower_(0)
@@ -80,10 +80,10 @@ template<class Type, class DType, class LUType>
 Foam::LduMatrix<Type, DType, LUType>::LduMatrix(LduMatrix& A, bool reuse)
 :
     lduMesh_(A.lduMesh_),
-    diagPtr_(NULL),
-    upperPtr_(NULL),
-    lowerPtr_(NULL),
-    sourcePtr_(NULL),
+    diagPtr_(nullptr),
+    upperPtr_(nullptr),
+    lowerPtr_(nullptr),
+    sourcePtr_(nullptr),
     interfaces_(0),
     interfacesUpper_(0),
     interfacesLower_(0)
@@ -93,25 +93,25 @@ Foam::LduMatrix<Type, DType, LUType>::LduMatrix(LduMatrix& A, bool reuse)
         if (A.diagPtr_)
         {
             diagPtr_ = A.diagPtr_;
-            A.diagPtr_ = NULL;
+            A.diagPtr_ = nullptr;
         }
 
         if (A.upperPtr_)
         {
             upperPtr_ = A.upperPtr_;
-            A.upperPtr_ = NULL;
+            A.upperPtr_ = nullptr;
         }
 
         if (A.lowerPtr_)
         {
             lowerPtr_ = A.lowerPtr_;
-            A.lowerPtr_ = NULL;
+            A.lowerPtr_ = nullptr;
         }
 
         if (A.sourcePtr_)
         {
             sourcePtr_ = A.sourcePtr_;
-            A.sourcePtr_ = NULL;
+            A.sourcePtr_ = nullptr;
         }
     }
     else
diff --git a/src/OpenFOAM/matrices/LduMatrix/LduMatrix/LduMatrixOperations.C b/src/OpenFOAM/matrices/LduMatrix/LduMatrix/LduMatrixOperations.C
index 8715b36752f..6d5f5be9c06 100644
--- a/src/OpenFOAM/matrices/LduMatrix/LduMatrix/LduMatrixOperations.C
+++ b/src/OpenFOAM/matrices/LduMatrix/LduMatrix/LduMatrixOperations.C
@@ -185,7 +185,7 @@ void Foam::LduMatrix<Type, DType, LUType>::operator=(const LduMatrix& A)
     else if (upperPtr_)
     {
         delete upperPtr_;
-        upperPtr_ = NULL;
+        upperPtr_ = nullptr;
     }
 
     if (A.lowerPtr_)
@@ -195,7 +195,7 @@ void Foam::LduMatrix<Type, DType, LUType>::operator=(const LduMatrix& A)
     else if (lowerPtr_)
     {
         delete lowerPtr_;
-        lowerPtr_ = NULL;
+        lowerPtr_ = nullptr;
     }
 
     if (A.sourcePtr_)
diff --git a/src/OpenFOAM/matrices/LduMatrix/LduMatrix/LduMatrixPreconditioner.C b/src/OpenFOAM/matrices/LduMatrix/LduMatrix/LduMatrixPreconditioner.C
index aafaf20c09f..fd21dc3983c 100644
--- a/src/OpenFOAM/matrices/LduMatrix/LduMatrix/LduMatrixPreconditioner.C
+++ b/src/OpenFOAM/matrices/LduMatrix/LduMatrix/LduMatrixPreconditioner.C
@@ -2,7 +2,7 @@
   =========                 |
   \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox
    \\    /   O peration     |
-    \\  /    A nd           | Copyright (C) 2011-2015 OpenFOAM Foundation
+    \\  /    A nd           | Copyright (C) 2011-2016 OpenFOAM Foundation
      \\/     M anipulation  |
 -------------------------------------------------------------------------------
 License
@@ -100,7 +100,7 @@ Foam::LduMatrix<Type, DType, LUType>::preconditioner::New
 
         return autoPtr<typename LduMatrix<Type, DType, LUType>::preconditioner>
         (
-            NULL
+            nullptr
         );
     }
 }
diff --git a/src/OpenFOAM/matrices/LduMatrix/LduMatrix/LduMatrixSmoother.C b/src/OpenFOAM/matrices/LduMatrix/LduMatrix/LduMatrixSmoother.C
index f15c0fac47c..d05203afc16 100644
--- a/src/OpenFOAM/matrices/LduMatrix/LduMatrix/LduMatrixSmoother.C
+++ b/src/OpenFOAM/matrices/LduMatrix/LduMatrix/LduMatrixSmoother.C
@@ -2,7 +2,7 @@
   =========                 |
   \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox
    \\    /   O peration     |
-    \\  /    A nd           | Copyright (C) 2011-2015 OpenFOAM Foundation
+    \\  /    A nd           | Copyright (C) 2011-2016 OpenFOAM Foundation
      \\/     M anipulation  |
 -------------------------------------------------------------------------------
 License
@@ -92,7 +92,10 @@ Foam::LduMatrix<Type, DType, LUType>::smoother::New
             << "cannot solve incomplete matrix, no off-diagonal coefficients"
             << exit(FatalIOError);
 
-        return autoPtr<typename LduMatrix<Type, DType, LUType>::smoother>(NULL);
+        return autoPtr<typename LduMatrix<Type, DType, LUType>::smoother>
+        (
+            nullptr
+        );
     }
 }
 
diff --git a/src/OpenFOAM/matrices/LduMatrix/LduMatrix/LduMatrixSolver.C b/src/OpenFOAM/matrices/LduMatrix/LduMatrix/LduMatrixSolver.C
index 157db46d7b9..651be6cee28 100644
--- a/src/OpenFOAM/matrices/LduMatrix/LduMatrix/LduMatrixSolver.C
+++ b/src/OpenFOAM/matrices/LduMatrix/LduMatrix/LduMatrixSolver.C
@@ -108,7 +108,10 @@ Foam::LduMatrix<Type, DType, LUType>::solver::New
                "no diagonal or off-diagonal coefficient"
             << exit(FatalIOError);
 
-        return autoPtr<typename LduMatrix<Type, DType, LUType>::solver>(NULL);
+        return autoPtr<typename LduMatrix<Type, DType, LUType>::solver>
+        (
+            nullptr
+        );
     }
 }
 
diff --git a/src/OpenFOAM/matrices/Matrix/Matrix.C b/src/OpenFOAM/matrices/Matrix/Matrix.C
index 46508d8e3f6..14e6911166d 100644
--- a/src/OpenFOAM/matrices/Matrix/Matrix.C
+++ b/src/OpenFOAM/matrices/Matrix/Matrix.C
@@ -44,7 +44,7 @@ Foam::Matrix<Form, Type>::Matrix(const label m, const label n)
 :
     mRows_(m),
     nCols_(n),
-    v_(NULL)
+    v_(nullptr)
 {
     if (mRows_ < 0 || nCols_ < 0)
     {
@@ -62,7 +62,7 @@ Foam::Matrix<Form, Type>::Matrix(const label m, const label n, const zero)
 :
     mRows_(m),
     nCols_(n),
-    v_(NULL)
+    v_(nullptr)
 {
     if (mRows_ < 0 || nCols_ < 0)
     {
@@ -89,7 +89,7 @@ Foam::Matrix<Form, Type>::Matrix(const label m, const label n, const Type& s)
 :
     mRows_(m),
     nCols_(n),
-    v_(NULL)
+    v_(nullptr)
 {
     if (mRows_ < 0 || nCols_ < 0)
     {
@@ -116,7 +116,7 @@ Foam::Matrix<Form, Type>::Matrix(const Matrix<Form, Type>& M)
 :
     mRows_(M.mRows_),
     nCols_(M.nCols_),
-    v_(NULL)
+    v_(nullptr)
 {
     if (M.v_)
     {
@@ -137,7 +137,7 @@ Foam::Matrix<Form, Type>::Matrix(const Matrix<Form2, Type>& M)
 :
     mRows_(M.m()),
     nCols_(M.n()),
-    v_(NULL)
+    v_(nullptr)
 {
     if (M.v())
     {
@@ -216,7 +216,7 @@ void Foam::Matrix<Form, Type>::clear()
     if (v_)
     {
         delete[] v_;
-        v_ = NULL;
+        v_ = nullptr;
     }
 
     mRows_ = 0;
@@ -236,7 +236,7 @@ void Foam::Matrix<Form, Type>::transfer(Matrix<Form, Type>& M)
     M.nCols_ = 0;
 
     v_ = M.v_;
-    M.v_ = NULL;
+    M.v_ = nullptr;
 }
 
 
diff --git a/src/OpenFOAM/matrices/Matrix/MatrixI.H b/src/OpenFOAM/matrices/Matrix/MatrixI.H
index 2ba29e355db..deed75bd45f 100644
--- a/src/OpenFOAM/matrices/Matrix/MatrixI.H
+++ b/src/OpenFOAM/matrices/Matrix/MatrixI.H
@@ -32,7 +32,7 @@ inline Foam::Matrix<Form, Type>::Matrix()
 :
     mRows_(0),
     nCols_(0),
-    v_(NULL)
+    v_(nullptr)
 {}
 
 
diff --git a/src/OpenFOAM/matrices/Matrix/MatrixIO.C b/src/OpenFOAM/matrices/Matrix/MatrixIO.C
index 13f613d74eb..154a0669146 100644
--- a/src/OpenFOAM/matrices/Matrix/MatrixIO.C
+++ b/src/OpenFOAM/matrices/Matrix/MatrixIO.C
@@ -36,7 +36,7 @@ Foam::Matrix<Form, Type>::Matrix(Istream& is)
 :
     mRows_(0),
     nCols_(0),
-    v_(NULL)
+    v_(nullptr)
 {
     operator>>(is, *this);
 }
diff --git a/src/OpenFOAM/matrices/lduMatrix/lduAddressing/lduAddressing.H b/src/OpenFOAM/matrices/lduMatrix/lduAddressing/lduAddressing.H
index 3c9d1b2fcba..b5d6f933b13 100644
--- a/src/OpenFOAM/matrices/lduMatrix/lduAddressing/lduAddressing.H
+++ b/src/OpenFOAM/matrices/lduMatrix/lduAddressing/lduAddressing.H
@@ -2,7 +2,7 @@
   =========                 |
   \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox
    \\    /   O peration     |
-    \\  /    A nd           | Copyright (C) 2011-2013 OpenFOAM Foundation
+    \\  /    A nd           | Copyright (C) 2011-2016 OpenFOAM Foundation
      \\/     M anipulation  |
 -------------------------------------------------------------------------------
 License
@@ -153,9 +153,9 @@ public:
     lduAddressing(const label nEqns)
     :
         size_(nEqns),
-        losortPtr_(NULL),
-        ownerStartPtr_(NULL),
-        losortStartPtr_(NULL)
+        losortPtr_(nullptr),
+        ownerStartPtr_(nullptr),
+        losortStartPtr_(nullptr)
     {}
 
 
diff --git a/src/OpenFOAM/matrices/lduMatrix/lduMatrix/lduMatrix.C b/src/OpenFOAM/matrices/lduMatrix/lduMatrix/lduMatrix.C
index 8de73956263..11cdf31485f 100644
--- a/src/OpenFOAM/matrices/lduMatrix/lduMatrix/lduMatrix.C
+++ b/src/OpenFOAM/matrices/lduMatrix/lduMatrix/lduMatrix.C
@@ -40,18 +40,18 @@ namespace Foam
 Foam::lduMatrix::lduMatrix(const lduMesh& mesh)
 :
     lduMesh_(mesh),
-    lowerPtr_(NULL),
-    diagPtr_(NULL),
-    upperPtr_(NULL)
+    lowerPtr_(nullptr),
+    diagPtr_(nullptr),
+    upperPtr_(nullptr)
 {}
 
 
 Foam::lduMatrix::lduMatrix(const lduMatrix& A)
 :
     lduMesh_(A.lduMesh_),
-    lowerPtr_(NULL),
-    diagPtr_(NULL),
-    upperPtr_(NULL)
+    lowerPtr_(nullptr),
+    diagPtr_(nullptr),
+    upperPtr_(nullptr)
 {
     if (A.lowerPtr_)
     {
@@ -73,28 +73,28 @@ Foam::lduMatrix::lduMatrix(const lduMatrix& A)
 Foam::lduMatrix::lduMatrix(lduMatrix& A, bool reuse)
 :
     lduMesh_(A.lduMesh_),
-    lowerPtr_(NULL),
-    diagPtr_(NULL),
-    upperPtr_(NULL)
+    lowerPtr_(nullptr),
+    diagPtr_(nullptr),
+    upperPtr_(nullptr)
 {
     if (reuse)
     {
         if (A.lowerPtr_)
         {
             lowerPtr_ = A.lowerPtr_;
-            A.lowerPtr_ = NULL;
+            A.lowerPtr_ = nullptr;
         }
 
         if (A.diagPtr_)
         {
             diagPtr_ = A.diagPtr_;
-            A.diagPtr_ = NULL;
+            A.diagPtr_ = nullptr;
         }
 
         if (A.upperPtr_)
         {
             upperPtr_ = A.upperPtr_;
-            A.upperPtr_ = NULL;
+            A.upperPtr_ = nullptr;
         }
     }
     else
@@ -120,9 +120,9 @@ Foam::lduMatrix::lduMatrix(lduMatrix& A, bool reuse)
 Foam::lduMatrix::lduMatrix(const lduMesh& mesh, Istream& is)
 :
     lduMesh_(mesh),
-    lowerPtr_(NULL),
-    diagPtr_(NULL),
-    upperPtr_(NULL)
+    lowerPtr_(nullptr),
+    diagPtr_(nullptr),
+    upperPtr_(nullptr)
 {
     Switch hasLow(is);
     Switch hasDiag(is);
diff --git a/src/OpenFOAM/matrices/lduMatrix/lduMatrix/lduMatrixOperations.C b/src/OpenFOAM/matrices/lduMatrix/lduMatrix/lduMatrixOperations.C
index 3bf180e493f..c14078b2615 100644
--- a/src/OpenFOAM/matrices/lduMatrix/lduMatrix/lduMatrixOperations.C
+++ b/src/OpenFOAM/matrices/lduMatrix/lduMatrix/lduMatrixOperations.C
@@ -2,7 +2,7 @@
   =========                 |
   \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox
    \\    /   O peration     |
-    \\  /    A nd           | Copyright (C) 2011-2015 OpenFOAM Foundation
+    \\  /    A nd           | Copyright (C) 2011-2016 OpenFOAM Foundation
      \\/     M anipulation  |
 -------------------------------------------------------------------------------
 License
@@ -102,7 +102,7 @@ void Foam::lduMatrix::operator=(const lduMatrix& A)
     else if (lowerPtr_)
     {
         delete lowerPtr_;
-        lowerPtr_ = NULL;
+        lowerPtr_ = nullptr;
     }
 
     if (A.upperPtr_)
@@ -112,7 +112,7 @@ void Foam::lduMatrix::operator=(const lduMatrix& A)
     else if (upperPtr_)
     {
         delete upperPtr_;
-        upperPtr_ = NULL;
+        upperPtr_ = nullptr;
     }
 
     if (A.diagPtr_)
diff --git a/src/OpenFOAM/matrices/lduMatrix/lduMatrix/lduMatrixPreconditioner.C b/src/OpenFOAM/matrices/lduMatrix/lduMatrix/lduMatrixPreconditioner.C
index 065079ee2cc..727f400a72d 100644
--- a/src/OpenFOAM/matrices/lduMatrix/lduMatrix/lduMatrixPreconditioner.C
+++ b/src/OpenFOAM/matrices/lduMatrix/lduMatrix/lduMatrixPreconditioner.C
@@ -2,7 +2,7 @@
   =========                 |
   \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox
    \\    /   O peration     |
-    \\  /    A nd           | Copyright (C) 2011-2015 OpenFOAM Foundation
+    \\  /    A nd           | Copyright (C) 2011-2016 OpenFOAM Foundation
      \\/     M anipulation  |
 -------------------------------------------------------------------------------
 License
@@ -141,7 +141,7 @@ Foam::lduMatrix::preconditioner::New
                "no diagonal or off-diagonal coefficient"
             << exit(FatalIOError);
 
-        return autoPtr<lduMatrix::preconditioner>(NULL);
+        return autoPtr<lduMatrix::preconditioner>(nullptr);
     }
 }
 
diff --git a/src/OpenFOAM/matrices/lduMatrix/lduMatrix/lduMatrixSmoother.C b/src/OpenFOAM/matrices/lduMatrix/lduMatrix/lduMatrixSmoother.C
index f24a990f9d8..3d3e3bbad0c 100644
--- a/src/OpenFOAM/matrices/lduMatrix/lduMatrix/lduMatrixSmoother.C
+++ b/src/OpenFOAM/matrices/lduMatrix/lduMatrix/lduMatrixSmoother.C
@@ -2,7 +2,7 @@
   =========                 |
   \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox
    \\    /   O peration     |
-    \\  /    A nd           | Copyright (C) 2011-2015 OpenFOAM Foundation
+    \\  /    A nd           | Copyright (C) 2011-2016 OpenFOAM Foundation
      \\/     M anipulation  |
 -------------------------------------------------------------------------------
 License
@@ -145,7 +145,7 @@ Foam::autoPtr<Foam::lduMatrix::smoother> Foam::lduMatrix::smoother::New
                "no diagonal or off-diagonal coefficient"
             << exit(FatalIOError);
 
-        return autoPtr<lduMatrix::smoother>(NULL);
+        return autoPtr<lduMatrix::smoother>(nullptr);
     }
 }
 
diff --git a/src/OpenFOAM/matrices/lduMatrix/lduMatrix/lduMatrixSolver.C b/src/OpenFOAM/matrices/lduMatrix/lduMatrix/lduMatrixSolver.C
index 1f6bd82d118..d554375cae3 100644
--- a/src/OpenFOAM/matrices/lduMatrix/lduMatrix/lduMatrixSolver.C
+++ b/src/OpenFOAM/matrices/lduMatrix/lduMatrix/lduMatrixSolver.C
@@ -2,7 +2,7 @@
   =========                 |
   \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox
    \\    /   O peration     |
-    \\  /    A nd           | Copyright (C) 2011-2015 OpenFOAM Foundation
+    \\  /    A nd           | Copyright (C) 2011-2016 OpenFOAM Foundation
      \\/     M anipulation  |
 -------------------------------------------------------------------------------
 License
@@ -125,7 +125,7 @@ Foam::autoPtr<Foam::lduMatrix::solver> Foam::lduMatrix::solver::New
                "no diagonal or off-diagonal coefficient"
             << exit(FatalIOError);
 
-        return autoPtr<lduMatrix::solver>(NULL);
+        return autoPtr<lduMatrix::solver>(nullptr);
     }
 }
 
diff --git a/src/OpenFOAM/matrices/lduMatrix/lduMatrix/lduMatrixTemplates.C b/src/OpenFOAM/matrices/lduMatrix/lduMatrix/lduMatrixTemplates.C
index 7ac02d189f3..0ac399fb598 100644
--- a/src/OpenFOAM/matrices/lduMatrix/lduMatrix/lduMatrixTemplates.C
+++ b/src/OpenFOAM/matrices/lduMatrix/lduMatrix/lduMatrixTemplates.C
@@ -105,7 +105,7 @@ Foam::lduMatrix::faceH(const Field<Type>& psi) const
                " the matrix does not have any off-diagonal coefficients."
             << exit(FatalError);
 
-        return tmp<Field<Type>>(NULL);
+        return tmp<Field<Type>>(nullptr);
     }
 }
 
diff --git a/src/OpenFOAM/matrices/lduMatrix/solvers/GAMG/GAMGAgglomerations/GAMGAgglomeration/GAMGAgglomerateLduAddressing.C b/src/OpenFOAM/matrices/lduMatrix/solvers/GAMG/GAMGAgglomerations/GAMGAgglomeration/GAMGAgglomerateLduAddressing.C
index d29f76eb2b3..334346962ae 100644
--- a/src/OpenFOAM/matrices/lduMatrix/solvers/GAMG/GAMGAgglomerations/GAMGAgglomeration/GAMGAgglomerateLduAddressing.C
+++ b/src/OpenFOAM/matrices/lduMatrix/solvers/GAMG/GAMGAgglomerations/GAMGAgglomeration/GAMGAgglomerateLduAddressing.C
@@ -561,8 +561,8 @@ void Foam::GAMGAgglomeration::combineLevels(const label curLevel)
     }
 
     // Delete the restrictAddressing for the coarser level
-    faceRestrictAddressing_.set(curLevel, NULL);
-    faceFlipMap_.set(curLevel, NULL);
+    faceRestrictAddressing_.set(curLevel, nullptr);
+    faceFlipMap_.set(curLevel, nullptr);
 
     forAll(prevResAddr, i)
     {
@@ -586,7 +586,7 @@ void Foam::GAMGAgglomeration::combineLevels(const label curLevel)
     }
 
     // Delete the restrictAddressing for the coarser level
-    restrictAddressing_.set(curLevel, NULL);
+    restrictAddressing_.set(curLevel, nullptr);
 
     // Patch faces
     nPatchFaces_[prevLevel] = nPatchFaces_[curLevel];
@@ -620,7 +620,7 @@ void Foam::GAMGAgglomeration::combineLevels(const label curLevel)
 
     // Delete the matrix addressing and coefficients from the previous level
     // and replace with the corresponding entry from the coarser level
-    meshLevels_.set(prevLevel, meshLevels_.set(curLevel, NULL));
+    meshLevels_.set(prevLevel, meshLevels_.set(curLevel, nullptr));
 }
 
 
diff --git a/src/OpenFOAM/matrices/lduMatrix/solvers/GAMG/GAMGAgglomerations/GAMGAgglomeration/GAMGAgglomeration.C b/src/OpenFOAM/matrices/lduMatrix/solvers/GAMG/GAMGAgglomerations/GAMGAgglomeration/GAMGAgglomeration.C
index 70efe48f4f9..6f7665b944b 100644
--- a/src/OpenFOAM/matrices/lduMatrix/solvers/GAMG/GAMGAgglomerations/GAMGAgglomeration/GAMGAgglomeration.C
+++ b/src/OpenFOAM/matrices/lduMatrix/solvers/GAMG/GAMGAgglomerations/GAMGAgglomeration/GAMGAgglomeration.C
@@ -245,7 +245,7 @@ Foam::GAMGAgglomeration::GAMGAgglomeration
             *this,
             controlDict
         )
-      : autoPtr<GAMGProcAgglomeration>(NULL)
+      : autoPtr<GAMGProcAgglomeration>(nullptr)
     ),
 
     nCells_(maxLevels_),
@@ -481,17 +481,17 @@ void Foam::GAMGAgglomeration::clearLevel(const label i)
 {
     if (hasMeshLevel(i))
     {
-        meshLevels_.set(i - 1, NULL);
+        meshLevels_.set(i - 1, nullptr);
 
         if (i < nCells_.size())
         {
             nCells_[i] = -555;
-            restrictAddressing_.set(i, NULL);
+            restrictAddressing_.set(i, nullptr);
             nFaces_[i] = -666;
-            faceRestrictAddressing_.set(i, NULL);
-            faceFlipMap_.set(i, NULL);
-            nPatchFaces_.set(i, NULL);
-            patchFaceRestrictAddressing_.set(i, NULL);
+            faceRestrictAddressing_.set(i, nullptr);
+            faceFlipMap_.set(i, nullptr);
+            nPatchFaces_.set(i, nullptr);
+            patchFaceRestrictAddressing_.set(i, nullptr);
         }
     }
 }
diff --git a/src/OpenFOAM/memory/autoPtr/autoPtr.H b/src/OpenFOAM/memory/autoPtr/autoPtr.H
index 917d0adf280..77dd1966cf9 100644
--- a/src/OpenFOAM/memory/autoPtr/autoPtr.H
+++ b/src/OpenFOAM/memory/autoPtr/autoPtr.H
@@ -67,15 +67,15 @@ public:
         inline explicit autoPtr(T* = 0);
 
         //- Construct as copy by transferring pointer to this autoPtr and
-        //  setting the arguments pointer to NULL
+        //  setting the arguments pointer to nullptr
         inline autoPtr(const autoPtr<T>&);
 
-        //- Construct either by transferring pointer or cloning. Should
-        //  only be called with type that supports cloning.
+        //- Construct either by transferring pointer or cloning.
+        //  Should only be called with type that supports cloning
         inline autoPtr(const autoPtr<T>&, const bool reuse);
 
 
-    //- Destructor, delete object if pointer is not NULL
+    //- Destructor, delete object if pointer is not nullptr
     inline ~autoPtr();
 
 
@@ -83,10 +83,10 @@ public:
 
         // Check
 
-            //- Return true if the autoPtr is empty (ie, no pointer set).
+            //- Return true if the autoPtr is empty (ie, no pointer set)
             inline bool empty() const;
 
-            //- Return true if the autoPtr valid (ie, the pointer is set).
+            //- Return true if the autoPtr valid (ie, the pointer is set)
             inline bool valid() const;
 
 
@@ -96,14 +96,15 @@ public:
             inline T* ptr();
 
             //- Set pointer to that given.
-            //  If object pointer already set issue a FatalError.
+            //  If object pointer already set issue a FatalError
             inline void set(T*);
 
             //- If object pointer already set, delete object and set to given
             //  pointer
             inline void reset(T* = 0);
 
-            //- Delete object (if the pointer is valid) and set pointer to NULL.
+            //- Delete object (if the pointer is valid) and set pointer to
+            //  nullptr
             inline void clear();
 
 
diff --git a/src/OpenFOAM/memory/autoPtr/autoPtrI.H b/src/OpenFOAM/memory/autoPtr/autoPtrI.H
index ef199ca20c6..7c35448f7df 100644
--- a/src/OpenFOAM/memory/autoPtr/autoPtrI.H
+++ b/src/OpenFOAM/memory/autoPtr/autoPtrI.H
@@ -58,7 +58,7 @@ inline Foam::autoPtr<T>::autoPtr(const autoPtr<T>& ap, const bool reuse)
     }
     else
     {
-        ptr_ = NULL;
+        ptr_ = nullptr;
     }
 }
 
diff --git a/src/OpenFOAM/memory/tmp/tmp.H b/src/OpenFOAM/memory/tmp/tmp.H
index 7aeedfd9ed1..a337271c402 100644
--- a/src/OpenFOAM/memory/tmp/tmp.H
+++ b/src/OpenFOAM/memory/tmp/tmp.H
@@ -134,7 +134,7 @@ public:
             inline T* ptr() const;
 
             //- If object pointer points to valid object:
-            //  delete object and set pointer to NULL
+            //  delete object and set pointer to nullptr
             inline void clear() const;
 
 
diff --git a/src/OpenFOAM/memory/tmpNrc/tmpNrc.H b/src/OpenFOAM/memory/tmpNrc/tmpNrc.H
index b31ad33f437..d6b6df0c316 100644
--- a/src/OpenFOAM/memory/tmpNrc/tmpNrc.H
+++ b/src/OpenFOAM/memory/tmpNrc/tmpNrc.H
@@ -130,7 +130,7 @@ public:
             inline T* ptr() const;
 
             //- If object pointer points to valid object:
-            //  delete object and set pointer to NULL
+            //  delete object and set pointer to nullptr
             inline void clear() const;
 
 
diff --git a/src/OpenFOAM/meshes/lduMesh/lduMesh.C b/src/OpenFOAM/meshes/lduMesh/lduMesh.C
index b3250d6b05f..1717be26c68 100644
--- a/src/OpenFOAM/meshes/lduMesh/lduMesh.C
+++ b/src/OpenFOAM/meshes/lduMesh/lduMesh.C
@@ -40,7 +40,7 @@ defineTypeNameAndDebug(lduMesh, 0);
 const Foam::objectRegistry& Foam::lduMesh::thisDb() const
 {
     NotImplemented;
-    const objectRegistry* orPtr_ = NULL;
+    const objectRegistry* orPtr_ = nullptr;
     return *orPtr_;
 }
 
diff --git a/src/OpenFOAM/meshes/meshShapes/cellMatcher/cellMatcher.C b/src/OpenFOAM/meshes/meshShapes/cellMatcher/cellMatcher.C
index 834853cfbbf..2ae0b4a7162 100644
--- a/src/OpenFOAM/meshes/meshShapes/cellMatcher/cellMatcher.C
+++ b/src/OpenFOAM/meshes/meshShapes/cellMatcher/cellMatcher.C
@@ -52,7 +52,7 @@ Foam::cellMatcher::cellMatcher
     vertLabels_(vertPerCell),
     faceLabels_(facePerCell),
     cellModelName_(cellModelName),
-    cellModelPtr_(NULL)
+    cellModelPtr_(nullptr)
 {
     forAll(localFaces_, facei)
     {
diff --git a/src/OpenFOAM/meshes/meshShapes/cellMatcher/cellMatcherI.H b/src/OpenFOAM/meshes/meshShapes/cellMatcher/cellMatcherI.H
index a6a952a8b7b..4a212e34e11 100644
--- a/src/OpenFOAM/meshes/meshShapes/cellMatcher/cellMatcherI.H
+++ b/src/OpenFOAM/meshes/meshShapes/cellMatcher/cellMatcherI.H
@@ -2,7 +2,7 @@
   =========                 |
   \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox
    \\    /   O peration     |
-    \\  /    A nd           | Copyright (C) 2011 OpenFOAM Foundation
+    \\  /    A nd           | Copyright (C) 2011-2016 OpenFOAM Foundation
      \\/     M anipulation  |
 -------------------------------------------------------------------------------
 License
@@ -85,7 +85,7 @@ inline const Foam::labelList& Foam::cellMatcher::faceLabels() const
 
 inline const Foam::cellModel& Foam::cellMatcher::model() const
 {
-    if (cellModelPtr_ == NULL)
+    if (cellModelPtr_ == nullptr)
     {
         cellModelPtr_ = cellModeller::lookup(cellModelName_);
     }
diff --git a/src/OpenFOAM/meshes/meshShapes/cellModeller/cellModeller.C b/src/OpenFOAM/meshes/meshShapes/cellModeller/cellModeller.C
index 1cfd988d7f6..8426b1336df 100644
--- a/src/OpenFOAM/meshes/meshShapes/cellModeller/cellModeller.C
+++ b/src/OpenFOAM/meshes/meshShapes/cellModeller/cellModeller.C
@@ -46,7 +46,7 @@ Foam::cellModeller::cellModeller()
     }
 
     modelPtrs_.setSize(maxIndex + 1);
-    modelPtrs_ = NULL;
+    modelPtrs_ = nullptr;
 
     // For all the words in the wordlist, set the details of the model
     // to those specified by the word name and the other parameters
@@ -95,7 +95,7 @@ const Foam::cellModel* Foam::cellModeller::lookup(const word& name)
     }
     else
     {
-        return NULL;
+        return nullptr;
     }
 }
 
diff --git a/src/OpenFOAM/meshes/meshShapes/cellModeller/cellModeller.H b/src/OpenFOAM/meshes/meshShapes/cellModeller/cellModeller.H
index 3c550dea392..490cf2eae60 100644
--- a/src/OpenFOAM/meshes/meshShapes/cellModeller/cellModeller.H
+++ b/src/OpenFOAM/meshes/meshShapes/cellModeller/cellModeller.H
@@ -2,7 +2,7 @@
   =========                 |
   \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox
    \\    /   O peration     |
-    \\  /    A nd           | Copyright (C) 2011 OpenFOAM Foundation
+    \\  /    A nd           | Copyright (C) 2011-2016 OpenFOAM Foundation
      \\/     M anipulation  |
 -------------------------------------------------------------------------------
 License
@@ -77,10 +77,11 @@ public:
 
     // Member functions
 
-        //- Look up a model by name and return a pointer to the model or NULL
+        //- Look up a model by name and return a pointer to the model or nullptr
         static const cellModel* lookup(const word&);
 
-        //- Look up a model by index and return a pointer to the model or NULL
+        //- Look up a model by index and return a pointer to the model or
+        //  nullptr
         static const cellModel* lookup(const label i)
         {
             return modelPtrs_[i];
diff --git a/src/OpenFOAM/meshes/meshShapes/cellShape/cellShapeI.H b/src/OpenFOAM/meshes/meshShapes/cellShape/cellShapeI.H
index 4cb5b6878c3..5120cd4dfa5 100644
--- a/src/OpenFOAM/meshes/meshShapes/cellShape/cellShapeI.H
+++ b/src/OpenFOAM/meshes/meshShapes/cellShape/cellShapeI.H
@@ -30,7 +30,7 @@ License
 
 inline Foam::cellShape::cellShape()
 :
-    m(NULL)
+    m(nullptr)
 {}
 
 
diff --git a/src/OpenFOAM/meshes/meshShapes/tetCell/tetCell.C b/src/OpenFOAM/meshes/meshShapes/tetCell/tetCell.C
index 8965d3c932c..76e75829e98 100644
--- a/src/OpenFOAM/meshes/meshShapes/tetCell/tetCell.C
+++ b/src/OpenFOAM/meshes/meshShapes/tetCell/tetCell.C
@@ -2,7 +2,7 @@
   =========                 |
   \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox
    \\    /   O peration     |
-    \\  /    A nd           | Copyright (C) 2011 OpenFOAM Foundation
+    \\  /    A nd           | Copyright (C) 2011-2016 OpenFOAM Foundation
      \\/     M anipulation  |
 -------------------------------------------------------------------------------
 License
@@ -32,7 +32,7 @@ License
 
 Foam::cellShape Foam::tetCell::tetCellShape() const
 {
-    static const cellModel* tetModelPtr_ = NULL;
+    static const cellModel* tetModelPtr_ = nullptr;
 
     if (!tetModelPtr_)
     {
diff --git a/src/OpenFOAM/meshes/pointMesh/pointMeshMapper/pointMapper.C b/src/OpenFOAM/meshes/pointMesh/pointMeshMapper/pointMapper.C
index a6d06903e5f..947a2f5d0f9 100644
--- a/src/OpenFOAM/meshes/pointMesh/pointMeshMapper/pointMapper.C
+++ b/src/OpenFOAM/meshes/pointMesh/pointMeshMapper/pointMapper.C
@@ -164,10 +164,10 @@ Foam::pointMapper::pointMapper(const pointMesh& pMesh, const mapPolyMesh& mpm)
     mpm_(mpm),
     insertedPoints_(true),
     direct_(false),
-    directAddrPtr_(NULL),
-    interpolationAddrPtr_(NULL),
-    weightsPtr_(NULL),
-    insertedPointLabelsPtr_(NULL)
+    directAddrPtr_(nullptr),
+    interpolationAddrPtr_(nullptr),
+    weightsPtr_(nullptr),
+    insertedPointLabelsPtr_(nullptr)
 {
     // Check for possibility of direct mapping
     if (mpm_.pointsFromPointsMap().empty())
diff --git a/src/OpenFOAM/meshes/pointMesh/pointMeshMapper/pointPatchMapper.C b/src/OpenFOAM/meshes/pointMesh/pointMeshMapper/pointPatchMapper.C
index b157ecbc2d2..cd281f6ec0f 100644
--- a/src/OpenFOAM/meshes/pointMesh/pointMeshMapper/pointPatchMapper.C
+++ b/src/OpenFOAM/meshes/pointMesh/pointMeshMapper/pointPatchMapper.C
@@ -127,9 +127,9 @@ Foam::pointPatchMapper::pointPatchMapper
       : 0
     ),
     hasUnmapped_(false),
-    directAddrPtr_(NULL),
-    interpolationAddrPtr_(NULL),
-    weightsPtr_(NULL)
+    directAddrPtr_(nullptr),
+    interpolationAddrPtr_(nullptr),
+    weightsPtr_(nullptr)
 {}
 
 
diff --git a/src/OpenFOAM/meshes/polyMesh/globalMeshData/globalMeshData.C b/src/OpenFOAM/meshes/polyMesh/globalMeshData/globalMeshData.C
index bd0e7eac1a3..ac9649ccda7 100644
--- a/src/OpenFOAM/meshes/polyMesh/globalMeshData/globalMeshData.C
+++ b/src/OpenFOAM/meshes/polyMesh/globalMeshData/globalMeshData.C
@@ -1765,12 +1765,12 @@ Foam::globalMeshData::globalMeshData(const polyMesh& mesh)
     processorPatchIndices_(0),
     processorPatchNeighbours_(0),
     nGlobalPoints_(-1),
-    sharedPointLabelsPtr_(NULL),
-    sharedPointAddrPtr_(NULL),
-    sharedPointGlobalLabelsPtr_(NULL),
+    sharedPointLabelsPtr_(nullptr),
+    sharedPointAddrPtr_(nullptr),
+    sharedPointGlobalLabelsPtr_(nullptr),
     nGlobalEdges_(-1),
-    sharedEdgeLabelsPtr_(NULL),
-    sharedEdgeAddrPtr_(NULL)
+    sharedEdgeLabelsPtr_(nullptr),
+    sharedEdgeAddrPtr_(nullptr)
 {
     updateMesh();
 }
diff --git a/src/OpenFOAM/meshes/polyMesh/mapPolyMesh/cellMapper/cellMapper.C b/src/OpenFOAM/meshes/polyMesh/mapPolyMesh/cellMapper/cellMapper.C
index 9253875b8a6..6e4045b48e6 100644
--- a/src/OpenFOAM/meshes/polyMesh/mapPolyMesh/cellMapper/cellMapper.C
+++ b/src/OpenFOAM/meshes/polyMesh/mapPolyMesh/cellMapper/cellMapper.C
@@ -292,10 +292,10 @@ Foam::cellMapper::cellMapper(const mapPolyMesh& mpm)
     mpm_(mpm),
     insertedCells_(true),
     direct_(false),
-    directAddrPtr_(NULL),
-    interpolationAddrPtr_(NULL),
-    weightsPtr_(NULL),
-    insertedCellLabelsPtr_(NULL)
+    directAddrPtr_(nullptr),
+    interpolationAddrPtr_(nullptr),
+    weightsPtr_(nullptr),
+    insertedCellLabelsPtr_(nullptr)
 {
     // Check for possibility of direct mapping
     if
diff --git a/src/OpenFOAM/meshes/polyMesh/mapPolyMesh/faceMapper/faceMapper.C b/src/OpenFOAM/meshes/polyMesh/mapPolyMesh/faceMapper/faceMapper.C
index 2e66f75f3cd..b81b4d23f90 100644
--- a/src/OpenFOAM/meshes/polyMesh/mapPolyMesh/faceMapper/faceMapper.C
+++ b/src/OpenFOAM/meshes/polyMesh/mapPolyMesh/faceMapper/faceMapper.C
@@ -207,10 +207,10 @@ Foam::faceMapper::faceMapper(const mapPolyMesh& mpm)
     mpm_(mpm),
     insertedFaces_(true),
     direct_(false),
-    directAddrPtr_(NULL),
-    interpolationAddrPtr_(NULL),
-    weightsPtr_(NULL),
-    insertedFaceLabelsPtr_(NULL)
+    directAddrPtr_(nullptr),
+    interpolationAddrPtr_(nullptr),
+    weightsPtr_(nullptr),
+    insertedFaceLabelsPtr_(nullptr)
 {
     // Check for possibility of direct mapping
     if
diff --git a/src/OpenFOAM/meshes/polyMesh/polyMesh.C b/src/OpenFOAM/meshes/polyMesh/polyMesh.C
index 28e8ee9c242..9f1db295212 100644
--- a/src/OpenFOAM/meshes/polyMesh/polyMesh.C
+++ b/src/OpenFOAM/meshes/polyMesh/polyMesh.C
@@ -207,8 +207,8 @@ Foam::polyMesh::polyMesh(const IOobject& io)
     comm_(UPstream::worldComm),
     geometricD_(Zero),
     solutionD_(Zero),
-    tetBasePtIsPtr_(NULL),
-    cellTreePtr_(NULL),
+    tetBasePtIsPtr_(nullptr),
+    cellTreePtr_(nullptr),
     pointZones_
     (
         IOobject
@@ -263,11 +263,11 @@ Foam::polyMesh::polyMesh(const IOobject& io)
         ),
         *this
     ),
-    globalMeshDataPtr_(NULL),
+    globalMeshDataPtr_(nullptr),
     moving_(false),
     topoChanging_(false),
     curMotionTimeIndex_(time().timeIndex()),
-    oldPointsPtr_(NULL)
+    oldPointsPtr_(nullptr)
 {
     if (exists(owner_.objectPath()))
     {
@@ -401,8 +401,8 @@ Foam::polyMesh::polyMesh
     comm_(UPstream::worldComm),
     geometricD_(Zero),
     solutionD_(Zero),
-    tetBasePtIsPtr_(NULL),
-    cellTreePtr_(NULL),
+    tetBasePtIsPtr_(nullptr),
+    cellTreePtr_(nullptr),
     pointZones_
     (
         IOobject
@@ -445,11 +445,11 @@ Foam::polyMesh::polyMesh
         *this,
         PtrList<cellZone>()
     ),
-    globalMeshDataPtr_(NULL),
+    globalMeshDataPtr_(nullptr),
     moving_(false),
     topoChanging_(false),
     curMotionTimeIndex_(time().timeIndex()),
-    oldPointsPtr_(NULL)
+    oldPointsPtr_(nullptr)
 {
     // Check if the faces and cells are valid
     forAll(faces_, facei)
@@ -552,8 +552,8 @@ Foam::polyMesh::polyMesh
     comm_(UPstream::worldComm),
     geometricD_(Zero),
     solutionD_(Zero),
-    tetBasePtIsPtr_(NULL),
-    cellTreePtr_(NULL),
+    tetBasePtIsPtr_(nullptr),
+    cellTreePtr_(nullptr),
     pointZones_
     (
         IOobject
@@ -596,11 +596,11 @@ Foam::polyMesh::polyMesh
         *this,
         0
     ),
-    globalMeshDataPtr_(NULL),
+    globalMeshDataPtr_(nullptr),
     moving_(false),
     topoChanging_(false),
     curMotionTimeIndex_(time().timeIndex()),
-    oldPointsPtr_(NULL)
+    oldPointsPtr_(nullptr)
 {
     // Check if faces are valid
     forAll(faces_, facei)
diff --git a/src/OpenFOAM/meshes/polyMesh/polyMesh.H b/src/OpenFOAM/meshes/polyMesh/polyMesh.H
index 99dd28573c1..1f61f738283 100644
--- a/src/OpenFOAM/meshes/polyMesh/polyMesh.H
+++ b/src/OpenFOAM/meshes/polyMesh/polyMesh.H
@@ -624,14 +624,14 @@ public:
             virtual bool checkFaceOrthogonality
             (
                 const bool report = false,
-                labelHashSet* setPtr = NULL
+                labelHashSet* setPtr = nullptr
             ) const;
 
             //- Check face skewness
             virtual bool checkFaceSkewness
             (
                 const bool report = false,
-                labelHashSet* setPtr = NULL
+                labelHashSet* setPtr = nullptr
             ) const;
 
             //- Check edge alignment for 1D/2D cases
@@ -661,7 +661,7 @@ public:
             (
                 const bool report,
                 const scalar minWeight = 0.05,
-                labelHashSet* setPtr = NULL
+                labelHashSet* setPtr = nullptr
             ) const;
 
             //- Check for neighbouring cell volumes
@@ -669,7 +669,7 @@ public:
             (
                 const bool report,
                 const scalar minRatio = 0.01,
-                labelHashSet* setPtr = NULL
+                labelHashSet* setPtr = nullptr
             ) const;
 
 
diff --git a/src/OpenFOAM/meshes/polyMesh/polyMeshCheck/polyMeshCheck.C b/src/OpenFOAM/meshes/polyMesh/polyMeshCheck/polyMeshCheck.C
index ec2c6877c96..91590e5467d 100644
--- a/src/OpenFOAM/meshes/polyMesh/polyMeshCheck/polyMeshCheck.C
+++ b/src/OpenFOAM/meshes/polyMesh/polyMeshCheck/polyMeshCheck.C
@@ -799,7 +799,7 @@ bool Foam::polyMesh::checkMeshMotion
         cellVols,       // vols
         report,         // report
         detailedReport, // detailedReport
-        NULL            // setPtr
+        nullptr            // setPtr
     );
 
 
@@ -809,7 +809,7 @@ bool Foam::polyMesh::checkMeshMotion
         fAreas,
         report,         // report
         detailedReport, // detailedReport,
-        NULL            // setPtr
+        nullptr            // setPtr
     );
     error = error || areaError;
 
@@ -822,7 +822,7 @@ bool Foam::polyMesh::checkMeshMotion
         report,         // report,
         detailedReport, // detailedReport,
         -SMALL,         // minPyrVol
-        NULL            // setPtr
+        nullptr            // setPtr
     );
     error = error || pyrVolError;
 
@@ -834,7 +834,7 @@ bool Foam::polyMesh::checkMeshMotion
         cellCtrs,
         report,         // report
         detailedReport, // detailedReport
-        NULL            // setPtr
+        nullptr            // setPtr
     );
     error = error || nonOrthoError;
 
diff --git a/src/OpenFOAM/meshes/polyMesh/polyMeshFromShapeMesh.C b/src/OpenFOAM/meshes/polyMesh/polyMeshFromShapeMesh.C
index 51277de647a..f7a6b8d2d34 100644
--- a/src/OpenFOAM/meshes/polyMesh/polyMeshFromShapeMesh.C
+++ b/src/OpenFOAM/meshes/polyMesh/polyMeshFromShapeMesh.C
@@ -475,8 +475,8 @@ Foam::polyMesh::polyMesh
     comm_(UPstream::worldComm),
     geometricD_(Zero),
     solutionD_(Zero),
-    tetBasePtIsPtr_(NULL),
-    cellTreePtr_(NULL),
+    tetBasePtIsPtr_(nullptr),
+    cellTreePtr_(nullptr),
     pointZones_
     (
         IOobject
@@ -519,11 +519,11 @@ Foam::polyMesh::polyMesh
         *this,
         0
     ),
-    globalMeshDataPtr_(NULL),
+    globalMeshDataPtr_(nullptr),
     moving_(false),
     topoChanging_(false),
     curMotionTimeIndex_(time().timeIndex()),
-    oldPointsPtr_(NULL)
+    oldPointsPtr_(nullptr)
 {
     if (debug)
     {
@@ -759,8 +759,8 @@ Foam::polyMesh::polyMesh
     comm_(UPstream::worldComm),
     geometricD_(Zero),
     solutionD_(Zero),
-    tetBasePtIsPtr_(NULL),
-    cellTreePtr_(NULL),
+    tetBasePtIsPtr_(nullptr),
+    cellTreePtr_(nullptr),
     pointZones_
     (
         IOobject
@@ -803,11 +803,11 @@ Foam::polyMesh::polyMesh
         *this,
         0
     ),
-    globalMeshDataPtr_(NULL),
+    globalMeshDataPtr_(nullptr),
     moving_(false),
     topoChanging_(false),
     curMotionTimeIndex_(time().timeIndex()),
-    oldPointsPtr_(NULL)
+    oldPointsPtr_(nullptr)
 {
     if (debug)
     {
diff --git a/src/OpenFOAM/meshes/polyMesh/polyMeshTetDecomposition/polyMeshTetDecomposition.H b/src/OpenFOAM/meshes/polyMesh/polyMeshTetDecomposition/polyMeshTetDecomposition.H
index 37b56a6844b..0a3ed7a03b8 100644
--- a/src/OpenFOAM/meshes/polyMesh/polyMeshTetDecomposition/polyMeshTetDecomposition.H
+++ b/src/OpenFOAM/meshes/polyMesh/polyMeshTetDecomposition/polyMeshTetDecomposition.H
@@ -2,7 +2,7 @@
   =========                 |
   \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox
    \\    /   O peration     |
-    \\  /    A nd           | Copyright (C) 2011-2013 OpenFOAM Foundation
+    \\  /    A nd           | Copyright (C) 2011-2016 OpenFOAM Foundation
      \\/     M anipulation  |
 -------------------------------------------------------------------------------
 License
@@ -118,7 +118,7 @@ public:
             const polyMesh& mesh,
             scalar tol = minTetQuality,
             const bool report = false,
-            labelHashSet* setPtr = NULL
+            labelHashSet* setPtr = nullptr
         );
 
         //- Return the tet decomposition of the given face, with
diff --git a/src/OpenFOAM/meshes/polyMesh/polyPatches/constraint/cyclic/cyclicPolyPatch.C b/src/OpenFOAM/meshes/polyMesh/polyPatches/constraint/cyclic/cyclicPolyPatch.C
index 0c9593ca07f..e092325721b 100644
--- a/src/OpenFOAM/meshes/polyMesh/polyPatches/constraint/cyclic/cyclicPolyPatch.C
+++ b/src/OpenFOAM/meshes/polyMesh/polyPatches/constraint/cyclic/cyclicPolyPatch.C
@@ -608,8 +608,8 @@ Foam::cyclicPolyPatch::cyclicPolyPatch
     rotationAxis_(Zero),
     rotationCentre_(Zero),
     separationVector_(Zero),
-    coupledPointsPtr_(NULL),
-    coupledEdgesPtr_(NULL)
+    coupledPointsPtr_(nullptr),
+    coupledEdgesPtr_(nullptr)
 {
     // Neighbour patch might not be valid yet so no transformation
     // calculation possible.
@@ -636,8 +636,8 @@ Foam::cyclicPolyPatch::cyclicPolyPatch
     rotationAxis_(rotationAxis),
     rotationCentre_(rotationCentre),
     separationVector_(separationVector),
-    coupledPointsPtr_(NULL),
-    coupledEdgesPtr_(NULL)
+    coupledPointsPtr_(nullptr),
+    coupledEdgesPtr_(nullptr)
 {
     // Neighbour patch might not be valid yet so no transformation
     // calculation possible.
@@ -660,8 +660,8 @@ Foam::cyclicPolyPatch::cyclicPolyPatch
     rotationAxis_(Zero),
     rotationCentre_(Zero),
     separationVector_(Zero),
-    coupledPointsPtr_(NULL),
-    coupledEdgesPtr_(NULL)
+    coupledPointsPtr_(nullptr),
+    coupledEdgesPtr_(nullptr)
 {
     if (neighbPatchName_ == word::null && !coupleGroup_.valid())
     {
@@ -730,8 +730,8 @@ Foam::cyclicPolyPatch::cyclicPolyPatch
     rotationAxis_(pp.rotationAxis_),
     rotationCentre_(pp.rotationCentre_),
     separationVector_(pp.separationVector_),
-    coupledPointsPtr_(NULL),
-    coupledEdgesPtr_(NULL)
+    coupledPointsPtr_(nullptr),
+    coupledEdgesPtr_(nullptr)
 {
     // Neighbour patch might not be valid yet so no transformation
     // calculation possible.
@@ -755,8 +755,8 @@ Foam::cyclicPolyPatch::cyclicPolyPatch
     rotationAxis_(pp.rotationAxis_),
     rotationCentre_(pp.rotationCentre_),
     separationVector_(pp.separationVector_),
-    coupledPointsPtr_(NULL),
-    coupledEdgesPtr_(NULL)
+    coupledPointsPtr_(nullptr),
+    coupledEdgesPtr_(nullptr)
 {
     if (neighbName == name())
     {
@@ -787,8 +787,8 @@ Foam::cyclicPolyPatch::cyclicPolyPatch
     rotationAxis_(pp.rotationAxis_),
     rotationCentre_(pp.rotationCentre_),
     separationVector_(pp.separationVector_),
-    coupledPointsPtr_(NULL),
-    coupledEdgesPtr_(NULL)
+    coupledPointsPtr_(nullptr),
+    coupledEdgesPtr_(nullptr)
 {}
 
 
diff --git a/src/OpenFOAM/meshes/polyMesh/polyPatches/polyPatch/polyPatch.C b/src/OpenFOAM/meshes/polyMesh/polyPatches/polyPatch/polyPatch.C
index ad8e33d401f..fb7a1954939 100644
--- a/src/OpenFOAM/meshes/polyMesh/polyPatches/polyPatch/polyPatch.C
+++ b/src/OpenFOAM/meshes/polyMesh/polyPatches/polyPatch/polyPatch.C
@@ -92,8 +92,8 @@ Foam::polyPatch::polyPatch
     ),
     start_(start),
     boundaryMesh_(bm),
-    faceCellsPtr_(NULL),
-    mePtr_(NULL)
+    faceCellsPtr_(nullptr),
+    mePtr_(nullptr)
 {
     if
     (
@@ -129,8 +129,8 @@ Foam::polyPatch::polyPatch
     ),
     start_(readLabel(dict.lookup("startFace"))),
     boundaryMesh_(bm),
-    faceCellsPtr_(NULL),
-    mePtr_(NULL)
+    faceCellsPtr_(nullptr),
+    mePtr_(nullptr)
 {
     if
     (
@@ -163,8 +163,8 @@ Foam::polyPatch::polyPatch
     ),
     start_(pp.start()),
     boundaryMesh_(bm),
-    faceCellsPtr_(NULL),
-    mePtr_(NULL)
+    faceCellsPtr_(nullptr),
+    mePtr_(nullptr)
 {}
 
 
@@ -190,8 +190,8 @@ Foam::polyPatch::polyPatch
     ),
     start_(newStart),
     boundaryMesh_(bm),
-    faceCellsPtr_(NULL),
-    mePtr_(NULL)
+    faceCellsPtr_(nullptr),
+    mePtr_(nullptr)
 {}
 
 
@@ -217,8 +217,8 @@ Foam::polyPatch::polyPatch
     ),
     start_(newStart),
     boundaryMesh_(bm),
-    faceCellsPtr_(NULL),
-    mePtr_(NULL)
+    faceCellsPtr_(nullptr),
+    mePtr_(nullptr)
 {}
 
 
@@ -228,8 +228,8 @@ Foam::polyPatch::polyPatch(const polyPatch& p)
     primitivePatch(p),
     start_(p.start_),
     boundaryMesh_(p.boundaryMesh_),
-    faceCellsPtr_(NULL),
-    mePtr_(NULL)
+    faceCellsPtr_(nullptr),
+    mePtr_(nullptr)
 {}
 
 
diff --git a/src/OpenFOAM/meshes/polyMesh/zones/ZoneMesh/ZoneMesh.C b/src/OpenFOAM/meshes/polyMesh/zones/ZoneMesh/ZoneMesh.C
index 30145ce34a8..56e6b755e87 100644
--- a/src/OpenFOAM/meshes/polyMesh/zones/ZoneMesh/ZoneMesh.C
+++ b/src/OpenFOAM/meshes/polyMesh/zones/ZoneMesh/ZoneMesh.C
@@ -142,7 +142,7 @@ Foam::ZoneMesh<ZoneType, MeshType>::ZoneMesh
     PtrList<ZoneType>(),
     regIOobject(io),
     mesh_(mesh),
-    zoneMapPtr_(NULL)
+    zoneMapPtr_(nullptr)
 {
     read();
 }
@@ -159,7 +159,7 @@ Foam::ZoneMesh<ZoneType, MeshType>::ZoneMesh
     PtrList<ZoneType>(size),
     regIOobject(io),
     mesh_(mesh),
-    zoneMapPtr_(NULL)
+    zoneMapPtr_(nullptr)
 {
     // Optionally read contents, otherwise keep size
     read();
@@ -177,7 +177,7 @@ Foam::ZoneMesh<ZoneType, MeshType>::ZoneMesh
     PtrList<ZoneType>(),
     regIOobject(io),
     mesh_(mesh),
-    zoneMapPtr_(NULL)
+    zoneMapPtr_(nullptr)
 {
     if (!read())
     {
diff --git a/src/OpenFOAM/meshes/polyMesh/zones/faceZone/faceZone.C b/src/OpenFOAM/meshes/polyMesh/zones/faceZone/faceZone.C
index 00fbd050bda..7e557268a6e 100644
--- a/src/OpenFOAM/meshes/polyMesh/zones/faceZone/faceZone.C
+++ b/src/OpenFOAM/meshes/polyMesh/zones/faceZone/faceZone.C
@@ -194,10 +194,10 @@ Foam::faceZone::faceZone
     zone(name, addr, index),
     flipMap_(fm),
     zoneMesh_(zm),
-    patchPtr_(NULL),
-    masterCellsPtr_(NULL),
-    slaveCellsPtr_(NULL),
-    mePtr_(NULL)
+    patchPtr_(nullptr),
+    masterCellsPtr_(nullptr),
+    slaveCellsPtr_(nullptr),
+    mePtr_(nullptr)
 {
     checkAddressing();
 }
@@ -215,10 +215,10 @@ Foam::faceZone::faceZone
     zone(name, addr, index),
     flipMap_(fm),
     zoneMesh_(zm),
-    patchPtr_(NULL),
-    masterCellsPtr_(NULL),
-    slaveCellsPtr_(NULL),
-    mePtr_(NULL)
+    patchPtr_(nullptr),
+    masterCellsPtr_(nullptr),
+    slaveCellsPtr_(nullptr),
+    mePtr_(nullptr)
 {
     checkAddressing();
 }
@@ -235,10 +235,10 @@ Foam::faceZone::faceZone
     zone(name, dict, this->labelsName, index),
     flipMap_(dict.lookup("flipMap")),
     zoneMesh_(zm),
-    patchPtr_(NULL),
-    masterCellsPtr_(NULL),
-    slaveCellsPtr_(NULL),
-    mePtr_(NULL)
+    patchPtr_(nullptr),
+    masterCellsPtr_(nullptr),
+    slaveCellsPtr_(nullptr),
+    mePtr_(nullptr)
 {
     checkAddressing();
 }
@@ -256,10 +256,10 @@ Foam::faceZone::faceZone
     zone(fz, addr, index),
     flipMap_(fm),
     zoneMesh_(zm),
-    patchPtr_(NULL),
-    masterCellsPtr_(NULL),
-    slaveCellsPtr_(NULL),
-    mePtr_(NULL)
+    patchPtr_(nullptr),
+    masterCellsPtr_(nullptr),
+    slaveCellsPtr_(nullptr),
+    mePtr_(nullptr)
 {
     checkAddressing();
 }
@@ -277,10 +277,10 @@ Foam::faceZone::faceZone
     zone(fz, addr, index),
     flipMap_(fm),
     zoneMesh_(zm),
-    patchPtr_(NULL),
-    masterCellsPtr_(NULL),
-    slaveCellsPtr_(NULL),
-    mePtr_(NULL)
+    patchPtr_(nullptr),
+    masterCellsPtr_(nullptr),
+    slaveCellsPtr_(nullptr),
+    mePtr_(nullptr)
 {
     checkAddressing();
 }
diff --git a/src/OpenFOAM/meshes/polyMesh/zones/zone/zone.C b/src/OpenFOAM/meshes/polyMesh/zones/zone/zone.C
index 1d800731389..8e26d4e8193 100644
--- a/src/OpenFOAM/meshes/polyMesh/zones/zone/zone.C
+++ b/src/OpenFOAM/meshes/polyMesh/zones/zone/zone.C
@@ -92,7 +92,7 @@ Foam::zone::zone
     labelList(addr),
     name_(name),
     index_(index),
-    lookupMapPtr_(NULL)
+    lookupMapPtr_(nullptr)
 {}
 
 
@@ -106,7 +106,7 @@ Foam::zone::zone
     labelList(addr),
     name_(name),
     index_(index),
-    lookupMapPtr_(NULL)
+    lookupMapPtr_(nullptr)
 {}
 
 
@@ -121,7 +121,7 @@ Foam::zone::zone
     labelList(dict.lookup(labelsName)),
     name_(name),
     index_(index),
-    lookupMapPtr_(NULL)
+    lookupMapPtr_(nullptr)
 {}
 
 
@@ -135,7 +135,7 @@ Foam::zone::zone
     labelList(addr),
     name_(z.name()),
     index_(index),
-    lookupMapPtr_(NULL)
+    lookupMapPtr_(nullptr)
 {}
 
 
@@ -149,7 +149,7 @@ Foam::zone::zone
     labelList(addr),
     name_(z.name()),
     index_(index),
-    lookupMapPtr_(NULL)
+    lookupMapPtr_(nullptr)
 {}
 
 
diff --git a/src/OpenFOAM/meshes/primitiveMesh/PrimitivePatch/PrimitivePatch.C b/src/OpenFOAM/meshes/primitiveMesh/PrimitivePatch/PrimitivePatch.C
index 7f78dde7b2d..04c3f9e62a5 100644
--- a/src/OpenFOAM/meshes/primitiveMesh/PrimitivePatch/PrimitivePatch.C
+++ b/src/OpenFOAM/meshes/primitiveMesh/PrimitivePatch/PrimitivePatch.C
@@ -43,23 +43,23 @@ PrimitivePatch
 :
     FaceList<Face>(faces),
     points_(points),
-    edgesPtr_(NULL),
+    edgesPtr_(nullptr),
     nInternalEdges_(-1),
-    boundaryPointsPtr_(NULL),
-    faceFacesPtr_(NULL),
-    edgeFacesPtr_(NULL),
-    faceEdgesPtr_(NULL),
-    pointEdgesPtr_(NULL),
-    pointFacesPtr_(NULL),
-    localFacesPtr_(NULL),
-    meshPointsPtr_(NULL),
-    meshPointMapPtr_(NULL),
-    edgeLoopsPtr_(NULL),
-    localPointsPtr_(NULL),
-    localPointOrderPtr_(NULL),
-    faceCentresPtr_(NULL),
-    faceNormalsPtr_(NULL),
-    pointNormalsPtr_(NULL)
+    boundaryPointsPtr_(nullptr),
+    faceFacesPtr_(nullptr),
+    edgeFacesPtr_(nullptr),
+    faceEdgesPtr_(nullptr),
+    pointEdgesPtr_(nullptr),
+    pointFacesPtr_(nullptr),
+    localFacesPtr_(nullptr),
+    meshPointsPtr_(nullptr),
+    meshPointMapPtr_(nullptr),
+    edgeLoopsPtr_(nullptr),
+    localPointsPtr_(nullptr),
+    localPointOrderPtr_(nullptr),
+    faceCentresPtr_(nullptr),
+    faceNormalsPtr_(nullptr),
+    pointNormalsPtr_(nullptr)
 {}
 
 
@@ -79,23 +79,23 @@ PrimitivePatch
 :
     FaceList<Face>(faces),
     points_(points),
-    edgesPtr_(NULL),
+    edgesPtr_(nullptr),
     nInternalEdges_(-1),
-    boundaryPointsPtr_(NULL),
-    faceFacesPtr_(NULL),
-    edgeFacesPtr_(NULL),
-    faceEdgesPtr_(NULL),
-    pointEdgesPtr_(NULL),
-    pointFacesPtr_(NULL),
-    localFacesPtr_(NULL),
-    meshPointsPtr_(NULL),
-    meshPointMapPtr_(NULL),
-    edgeLoopsPtr_(NULL),
-    localPointsPtr_(NULL),
-    localPointOrderPtr_(NULL),
-    faceCentresPtr_(NULL),
-    faceNormalsPtr_(NULL),
-    pointNormalsPtr_(NULL)
+    boundaryPointsPtr_(nullptr),
+    faceFacesPtr_(nullptr),
+    edgeFacesPtr_(nullptr),
+    faceEdgesPtr_(nullptr),
+    pointEdgesPtr_(nullptr),
+    pointFacesPtr_(nullptr),
+    localFacesPtr_(nullptr),
+    meshPointsPtr_(nullptr),
+    meshPointMapPtr_(nullptr),
+    edgeLoopsPtr_(nullptr),
+    localPointsPtr_(nullptr),
+    localPointOrderPtr_(nullptr),
+    faceCentresPtr_(nullptr),
+    faceNormalsPtr_(nullptr),
+    pointNormalsPtr_(nullptr)
 {}
 
 
@@ -116,23 +116,23 @@ PrimitivePatch
 :
     FaceList<Face>(faces, reuse),
     points_(points, reuse),
-    edgesPtr_(NULL),
+    edgesPtr_(nullptr),
     nInternalEdges_(-1),
-    boundaryPointsPtr_(NULL),
-    faceFacesPtr_(NULL),
-    edgeFacesPtr_(NULL),
-    faceEdgesPtr_(NULL),
-    pointEdgesPtr_(NULL),
-    pointFacesPtr_(NULL),
-    localFacesPtr_(NULL),
-    meshPointsPtr_(NULL),
-    meshPointMapPtr_(NULL),
-    edgeLoopsPtr_(NULL),
-    localPointsPtr_(NULL),
-    localPointOrderPtr_(NULL),
-    faceCentresPtr_(NULL),
-    faceNormalsPtr_(NULL),
-    pointNormalsPtr_(NULL)
+    boundaryPointsPtr_(nullptr),
+    faceFacesPtr_(nullptr),
+    edgeFacesPtr_(nullptr),
+    faceEdgesPtr_(nullptr),
+    pointEdgesPtr_(nullptr),
+    pointFacesPtr_(nullptr),
+    localFacesPtr_(nullptr),
+    meshPointsPtr_(nullptr),
+    meshPointMapPtr_(nullptr),
+    edgeLoopsPtr_(nullptr),
+    localPointsPtr_(nullptr),
+    localPointOrderPtr_(nullptr),
+    faceCentresPtr_(nullptr),
+    faceNormalsPtr_(nullptr),
+    pointNormalsPtr_(nullptr)
 {}
 
 
@@ -152,23 +152,23 @@ PrimitivePatch
     PrimitivePatchName(),
     FaceList<Face>(pp),
     points_(pp.points_),
-    edgesPtr_(NULL),
+    edgesPtr_(nullptr),
     nInternalEdges_(-1),
-    boundaryPointsPtr_(NULL),
-    faceFacesPtr_(NULL),
-    edgeFacesPtr_(NULL),
-    faceEdgesPtr_(NULL),
-    pointEdgesPtr_(NULL),
-    pointFacesPtr_(NULL),
-    localFacesPtr_(NULL),
-    meshPointsPtr_(NULL),
-    meshPointMapPtr_(NULL),
-    edgeLoopsPtr_(NULL),
-    localPointsPtr_(NULL),
-    localPointOrderPtr_(NULL),
-    faceCentresPtr_(NULL),
-    faceNormalsPtr_(NULL),
-    pointNormalsPtr_(NULL)
+    boundaryPointsPtr_(nullptr),
+    faceFacesPtr_(nullptr),
+    edgeFacesPtr_(nullptr),
+    faceEdgesPtr_(nullptr),
+    pointEdgesPtr_(nullptr),
+    pointFacesPtr_(nullptr),
+    localFacesPtr_(nullptr),
+    meshPointsPtr_(nullptr),
+    meshPointMapPtr_(nullptr),
+    edgeLoopsPtr_(nullptr),
+    localPointsPtr_(nullptr),
+    localPointOrderPtr_(nullptr),
+    faceCentresPtr_(nullptr),
+    faceNormalsPtr_(nullptr),
+    pointNormalsPtr_(nullptr)
 {}
 
 
diff --git a/src/OpenFOAM/meshes/primitiveMesh/PrimitivePatch/PrimitivePatch.H b/src/OpenFOAM/meshes/primitiveMesh/PrimitivePatch/PrimitivePatch.H
index f1721d8e1a0..a7b1e80fabd 100644
--- a/src/OpenFOAM/meshes/primitiveMesh/PrimitivePatch/PrimitivePatch.H
+++ b/src/OpenFOAM/meshes/primitiveMesh/PrimitivePatch/PrimitivePatch.H
@@ -434,7 +434,7 @@ public:
         bool checkTopology
         (
             const bool report = false,
-            labelHashSet* setPtr = NULL
+            labelHashSet* setPtr = nullptr
         ) const;
 
         //- Checks primitivePatch for faces sharing point but not edge.
@@ -446,7 +446,7 @@ public:
         bool checkPointManifold
         (
             const bool report = false,
-            labelHashSet* setPtr = NULL
+            labelHashSet* setPtr = nullptr
         ) const;
 
 
diff --git a/src/OpenFOAM/meshes/primitiveMesh/PrimitivePatch/PrimitivePatchClear.C b/src/OpenFOAM/meshes/primitiveMesh/PrimitivePatch/PrimitivePatchClear.C
index 96962082592..3ac89f2c61e 100644
--- a/src/OpenFOAM/meshes/primitiveMesh/PrimitivePatch/PrimitivePatchClear.C
+++ b/src/OpenFOAM/meshes/primitiveMesh/PrimitivePatch/PrimitivePatchClear.C
@@ -72,16 +72,16 @@ clearTopology()
     if (edgesPtr_ && faceFacesPtr_ && edgeFacesPtr_ && faceEdgesPtr_)
     {
         delete edgesPtr_;
-        edgesPtr_ = NULL;
+        edgesPtr_ = nullptr;
 
         delete faceFacesPtr_;
-        faceFacesPtr_ = NULL;
+        faceFacesPtr_ = nullptr;
 
         delete edgeFacesPtr_;
-        edgeFacesPtr_ = NULL;
+        edgeFacesPtr_ = nullptr;
 
         delete faceEdgesPtr_;
-        faceEdgesPtr_ = NULL;
+        faceEdgesPtr_ = nullptr;
     }
 
     deleteDemandDrivenData(boundaryPointsPtr_);
diff --git a/src/OpenFOAM/meshes/primitiveMesh/primitiveMesh.C b/src/OpenFOAM/meshes/primitiveMesh/primitiveMesh.C
index e514f7b432d..6ee65054402 100644
--- a/src/OpenFOAM/meshes/primitiveMesh/primitiveMesh.C
+++ b/src/OpenFOAM/meshes/primitiveMesh/primitiveMesh.C
@@ -48,28 +48,28 @@ Foam::primitiveMesh::primitiveMesh()
     nFaces_(0),
     nCells_(0),
 
-    cellShapesPtr_(NULL),
-    edgesPtr_(NULL),
-    ccPtr_(NULL),
-    ecPtr_(NULL),
-    pcPtr_(NULL),
-
-    cfPtr_(NULL),
-    efPtr_(NULL),
-    pfPtr_(NULL),
-
-    cePtr_(NULL),
-    fePtr_(NULL),
-    pePtr_(NULL),
-    ppPtr_(NULL),
-    cpPtr_(NULL),
+    cellShapesPtr_(nullptr),
+    edgesPtr_(nullptr),
+    ccPtr_(nullptr),
+    ecPtr_(nullptr),
+    pcPtr_(nullptr),
+
+    cfPtr_(nullptr),
+    efPtr_(nullptr),
+    pfPtr_(nullptr),
+
+    cePtr_(nullptr),
+    fePtr_(nullptr),
+    pePtr_(nullptr),
+    ppPtr_(nullptr),
+    cpPtr_(nullptr),
 
     labels_(0),
 
-    cellCentresPtr_(NULL),
-    faceCentresPtr_(NULL),
-    cellVolumesPtr_(NULL),
-    faceAreasPtr_(NULL)
+    cellCentresPtr_(nullptr),
+    faceCentresPtr_(nullptr),
+    cellVolumesPtr_(nullptr),
+    faceAreasPtr_(nullptr)
 {}
 
 
@@ -88,28 +88,28 @@ Foam::primitiveMesh::primitiveMesh
     nFaces_(nFaces),
     nCells_(nCells),
 
-    cellShapesPtr_(NULL),
-    edgesPtr_(NULL),
-    ccPtr_(NULL),
-    ecPtr_(NULL),
-    pcPtr_(NULL),
+    cellShapesPtr_(nullptr),
+    edgesPtr_(nullptr),
+    ccPtr_(nullptr),
+    ecPtr_(nullptr),
+    pcPtr_(nullptr),
 
-    cfPtr_(NULL),
-    efPtr_(NULL),
-    pfPtr_(NULL),
+    cfPtr_(nullptr),
+    efPtr_(nullptr),
+    pfPtr_(nullptr),
 
-    cePtr_(NULL),
-    fePtr_(NULL),
-    pePtr_(NULL),
-    ppPtr_(NULL),
-    cpPtr_(NULL),
+    cePtr_(nullptr),
+    fePtr_(nullptr),
+    pePtr_(nullptr),
+    ppPtr_(nullptr),
+    cpPtr_(nullptr),
 
     labels_(0),
 
-    cellCentresPtr_(NULL),
-    faceCentresPtr_(NULL),
-    cellVolumesPtr_(NULL),
-    faceAreasPtr_(NULL)
+    cellCentresPtr_(nullptr),
+    faceCentresPtr_(nullptr),
+    cellVolumesPtr_(nullptr),
+    faceAreasPtr_(nullptr)
 {}
 
 
diff --git a/src/OpenFOAM/meshes/primitiveMesh/primitiveMesh.H b/src/OpenFOAM/meshes/primitiveMesh/primitiveMesh.H
index 233b982326f..28057107c48 100644
--- a/src/OpenFOAM/meshes/primitiveMesh/primitiveMesh.H
+++ b/src/OpenFOAM/meshes/primitiveMesh/primitiveMesh.H
@@ -606,35 +606,35 @@ public:
                 virtual bool checkUpperTriangular
                 (
                     const bool report = false,
-                    labelHashSet* setPtr = NULL
+                    labelHashSet* setPtr = nullptr
                 ) const;
 
                 //- Check cell zip-up
                 virtual bool checkCellsZipUp
                 (
                     const bool report = false,
-                    labelHashSet* setPtr = NULL
+                    labelHashSet* setPtr = nullptr
                 ) const;
 
                 //- Check uniqueness of face vertices
                 virtual bool checkFaceVertices
                 (
                     const bool report = false,
-                    labelHashSet* setPtr = NULL
+                    labelHashSet* setPtr = nullptr
                 ) const;
 
                 //- Check for unused points
                 virtual bool checkPoints
                 (
                     const bool report = false,
-                    labelHashSet* setPtr = NULL
+                    labelHashSet* setPtr = nullptr
                 ) const;
 
                 //- Check face-face connectivity
                 virtual bool checkFaceFaces
                 (
                     const bool report = false,
-                    labelHashSet* setPtr = NULL
+                    labelHashSet* setPtr = nullptr
                 ) const;
 
 
@@ -648,8 +648,8 @@ public:
                 virtual bool checkClosedCells
                 (
                     const bool report = false,
-                    labelHashSet* setPtr = NULL,
-                    labelHashSet* highAspectSetPtr = NULL,
+                    labelHashSet* setPtr = nullptr,
+                    labelHashSet* highAspectSetPtr = nullptr,
                     const Vector<label>& solutionD = Vector<label>::one
                 ) const;
 
@@ -657,21 +657,21 @@ public:
                 virtual bool checkFaceAreas
                 (
                     const bool report = false,
-                    labelHashSet* setPtr = NULL
+                    labelHashSet* setPtr = nullptr
                 ) const;
 
                 //- Check for negative cell volumes
                 virtual bool checkCellVolumes
                 (
                     const bool report = false,
-                    labelHashSet* setPtr = NULL
+                    labelHashSet* setPtr = nullptr
                 ) const;
 
                 //- Check for non-orthogonality
                 virtual bool checkFaceOrthogonality
                 (
                     const bool report = false,
-                    labelHashSet* setPtr = NULL
+                    labelHashSet* setPtr = nullptr
                 ) const;
 
                 //- Check face pyramid volume
@@ -679,14 +679,14 @@ public:
                 (
                     const bool report = false,
                     const scalar minPyrVol = -SMALL,
-                    labelHashSet* setPtr = NULL
+                    labelHashSet* setPtr = nullptr
                 ) const;
 
                 //- Check face skewness
                 virtual bool checkFaceSkewness
                 (
                     const bool report = false,
-                    labelHashSet* setPtr = NULL
+                    labelHashSet* setPtr = nullptr
                 ) const;
 
                 //- Check face angles
@@ -694,7 +694,7 @@ public:
                 (
                     const bool report = false,
                     const scalar maxSin = 10,    // In degrees
-                    labelHashSet* setPtr = NULL
+                    labelHashSet* setPtr = nullptr
                 ) const;
 
                 //- Check face warpage: decompose face and check ratio between
@@ -713,7 +713,7 @@ public:
                 (
                     const bool report,
                     const scalar reportDistSqr,
-                    labelHashSet* setPtr = NULL
+                    labelHashSet* setPtr = nullptr
                 ) const;
 
                 //- Check edge length
@@ -721,14 +721,14 @@ public:
                 (
                     const bool report,
                     const scalar minLenSqr,
-                    labelHashSet* setPtr = NULL
+                    labelHashSet* setPtr = nullptr
                 ) const;
 
                 //- Check for concave cells by the planes of faces
                 virtual bool checkConcaveCells
                 (
                     const bool report = false,
-                    labelHashSet* setPtr = NULL
+                    labelHashSet* setPtr = nullptr
                 ) const;
 
 
diff --git a/src/OpenFOAM/primitives/functions/TimeFunction1/TimeFunction1.C b/src/OpenFOAM/primitives/functions/TimeFunction1/TimeFunction1.C
index ed8b34ab064..e167a05c1ae 100644
--- a/src/OpenFOAM/primitives/functions/TimeFunction1/TimeFunction1.C
+++ b/src/OpenFOAM/primitives/functions/TimeFunction1/TimeFunction1.C
@@ -48,7 +48,7 @@ Foam::TimeFunction1<Type>::TimeFunction1(const Time& t, const word& name)
 :
     time_(t),
     name_(name),
-    entry_(NULL)
+    entry_(nullptr)
 {}
 
 
diff --git a/src/OpenFOAM/primitives/ints/int32/int32IO.C b/src/OpenFOAM/primitives/ints/int32/int32IO.C
index 4377f95992b..a8c972377db 100644
--- a/src/OpenFOAM/primitives/ints/int32/int32IO.C
+++ b/src/OpenFOAM/primitives/ints/int32/int32IO.C
@@ -84,7 +84,7 @@ int32_t Foam::readInt32(Istream& is)
 
 bool Foam::read(const char* buf, int32_t& s)
 {
-    char *endptr = NULL;
+    char *endptr = nullptr;
     errno = 0;
     intmax_t l = strtoimax(buf, &endptr, 10);
     s = int32_t(l);
diff --git a/src/OpenFOAM/primitives/ints/int64/int64IO.C b/src/OpenFOAM/primitives/ints/int64/int64IO.C
index e9355a30121..89f14163a0b 100644
--- a/src/OpenFOAM/primitives/ints/int64/int64IO.C
+++ b/src/OpenFOAM/primitives/ints/int64/int64IO.C
@@ -84,7 +84,7 @@ int64_t Foam::readInt64(Istream& is)
 
 bool Foam::read(const char* buf, int64_t& s)
 {
-    char *endptr = NULL;
+    char *endptr = nullptr;
     errno = 0;
     intmax_t l = strtoimax(buf, &endptr, 10);
     s = int64_t(l);
diff --git a/src/OpenFOAM/primitives/ints/uint32/uint32IO.C b/src/OpenFOAM/primitives/ints/uint32/uint32IO.C
index 9111c2d7411..2746938d638 100644
--- a/src/OpenFOAM/primitives/ints/uint32/uint32IO.C
+++ b/src/OpenFOAM/primitives/ints/uint32/uint32IO.C
@@ -82,7 +82,7 @@ uint32_t Foam::readUint32(Istream& is)
 
 bool Foam::read(const char* buf, uint32_t& s)
 {
-    char *endptr = NULL;
+    char *endptr = nullptr;
     long l = strtol(buf, &endptr, 10);
     s = uint32_t(l);
     return (*endptr == 0);
diff --git a/src/OpenFOAM/primitives/ints/uint64/uint64IO.C b/src/OpenFOAM/primitives/ints/uint64/uint64IO.C
index dfb7ab4db6b..be10f83b014 100644
--- a/src/OpenFOAM/primitives/ints/uint64/uint64IO.C
+++ b/src/OpenFOAM/primitives/ints/uint64/uint64IO.C
@@ -82,7 +82,7 @@ uint64_t Foam::readUint64(Istream& is)
 
 bool Foam::read(const char* buf, uint64_t& s)
 {
-    char *endptr = NULL;
+    char *endptr = nullptr;
     long l = strtol(buf, &endptr, 10);
     s = uint64_t(l);
     return (*endptr == 0);
diff --git a/src/OpenFOAM/primitives/strings/lists/hashedWordList.H b/src/OpenFOAM/primitives/strings/lists/hashedWordList.H
index cdeeeb00ccc..b906f42f18d 100644
--- a/src/OpenFOAM/primitives/strings/lists/hashedWordList.H
+++ b/src/OpenFOAM/primitives/strings/lists/hashedWordList.H
@@ -88,7 +88,7 @@ public:
         //- Construct from number and list of names
         hashedWordList(const label nNames, const char** names);
 
-        //- Construct from a NULL-terminated list of names
+        //- Construct from a nullptr-terminated list of names
         hashedWordList(const char** names);
 
         //- Construct from Istream
diff --git a/src/OpenFOAM/primitives/strings/wordRe/wordRe.C b/src/OpenFOAM/primitives/strings/wordRe/wordRe.C
index 95fd22dc8a4..c2ab7daec0d 100644
--- a/src/OpenFOAM/primitives/strings/wordRe/wordRe.C
+++ b/src/OpenFOAM/primitives/strings/wordRe/wordRe.C
@@ -2,7 +2,7 @@
   =========                 |
   \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox
    \\    /   O peration     |
-    \\  /    A nd           | Copyright (C) 2011-2015 OpenFOAM Foundation
+    \\  /    A nd           | Copyright (C) 2011-2016 OpenFOAM Foundation
      \\/     M anipulation  |
 -------------------------------------------------------------------------------
 License
@@ -37,7 +37,7 @@ const Foam::wordRe Foam::wordRe::null;
 Foam::wordRe::wordRe(Istream& is)
 :
     word(),
-    re_(NULL)
+    re_(nullptr)
 {
     is >> *this;
 }
diff --git a/src/TurbulenceModels/compressible/turbulentFluidThermoModels/derivedFvPatchFields/thermalBaffle1D/thermalBaffle1DFvPatchScalarField.C b/src/TurbulenceModels/compressible/turbulentFluidThermoModels/derivedFvPatchFields/thermalBaffle1D/thermalBaffle1DFvPatchScalarField.C
index 41d4fbfc9eb..afbad998143 100644
--- a/src/TurbulenceModels/compressible/turbulentFluidThermoModels/derivedFvPatchFields/thermalBaffle1D/thermalBaffle1DFvPatchScalarField.C
+++ b/src/TurbulenceModels/compressible/turbulentFluidThermoModels/derivedFvPatchFields/thermalBaffle1D/thermalBaffle1DFvPatchScalarField.C
@@ -53,7 +53,7 @@ thermalBaffle1DFvPatchScalarField
     thickness_(p.size()),
     Qs_(p.size()),
     solidDict_(),
-    solidPtr_(NULL),
+    solidPtr_(nullptr),
     QrPrevious_(p.size()),
     QrRelaxation_(1),
     QrName_("undefined-Qr")
diff --git a/src/TurbulenceModels/phaseCompressible/LES/Niceno/NicenoKEqn.C b/src/TurbulenceModels/phaseCompressible/LES/Niceno/NicenoKEqn.C
index 12e23ea7028..21281b636d5 100644
--- a/src/TurbulenceModels/phaseCompressible/LES/Niceno/NicenoKEqn.C
+++ b/src/TurbulenceModels/phaseCompressible/LES/Niceno/NicenoKEqn.C
@@ -61,7 +61,7 @@ NicenoKEqn<BasicTurbulenceModel>::NicenoKEqn
         type
     ),
 
-    gasTurbulencePtr_(NULL),
+    gasTurbulencePtr_(nullptr),
 
     alphaInversion_
     (
diff --git a/src/TurbulenceModels/phaseCompressible/LES/SmagorinskyZhang/SmagorinskyZhang.C b/src/TurbulenceModels/phaseCompressible/LES/SmagorinskyZhang/SmagorinskyZhang.C
index c682d0b29a3..0dea09849fe 100644
--- a/src/TurbulenceModels/phaseCompressible/LES/SmagorinskyZhang/SmagorinskyZhang.C
+++ b/src/TurbulenceModels/phaseCompressible/LES/SmagorinskyZhang/SmagorinskyZhang.C
@@ -60,7 +60,7 @@ SmagorinskyZhang<BasicTurbulenceModel>::SmagorinskyZhang
         type
     ),
 
-    gasTurbulencePtr_(NULL),
+    gasTurbulencePtr_(nullptr),
 
     Cmub_
     (
diff --git a/src/TurbulenceModels/phaseCompressible/LES/continuousGasKEqn/continuousGasKEqn.C b/src/TurbulenceModels/phaseCompressible/LES/continuousGasKEqn/continuousGasKEqn.C
index 31d646b7598..f38e8b779d2 100644
--- a/src/TurbulenceModels/phaseCompressible/LES/continuousGasKEqn/continuousGasKEqn.C
+++ b/src/TurbulenceModels/phaseCompressible/LES/continuousGasKEqn/continuousGasKEqn.C
@@ -2,7 +2,7 @@
   =========                 |
   \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox
    \\    /   O peration     |
-    \\  /    A nd           | Copyright (C) 2013-2015 OpenFOAM Foundation
+    \\  /    A nd           | Copyright (C) 2013-2016 OpenFOAM Foundation
      \\/     M anipulation  |
 -------------------------------------------------------------------------------
 License
@@ -60,7 +60,7 @@ continuousGasKEqn<BasicTurbulenceModel>::continuousGasKEqn
         type
     ),
 
-    liquidTurbulencePtr_(NULL),
+    liquidTurbulencePtr_(nullptr),
 
     alphaInversion_
     (
diff --git a/src/TurbulenceModels/phaseCompressible/RAS/LaheyKEpsilon/LaheyKEpsilon.C b/src/TurbulenceModels/phaseCompressible/RAS/LaheyKEpsilon/LaheyKEpsilon.C
index 7d923e013ff..fcdf9c72679 100644
--- a/src/TurbulenceModels/phaseCompressible/RAS/LaheyKEpsilon/LaheyKEpsilon.C
+++ b/src/TurbulenceModels/phaseCompressible/RAS/LaheyKEpsilon/LaheyKEpsilon.C
@@ -61,7 +61,7 @@ LaheyKEpsilon<BasicTurbulenceModel>::LaheyKEpsilon
         type
     ),
 
-    gasTurbulencePtr_(NULL),
+    gasTurbulencePtr_(nullptr),
 
     alphaInversion_
     (
diff --git a/src/TurbulenceModels/phaseCompressible/RAS/continuousGasKEpsilon/continuousGasKEpsilon.C b/src/TurbulenceModels/phaseCompressible/RAS/continuousGasKEpsilon/continuousGasKEpsilon.C
index e57eff4b843..7e8b5ac4b40 100644
--- a/src/TurbulenceModels/phaseCompressible/RAS/continuousGasKEpsilon/continuousGasKEpsilon.C
+++ b/src/TurbulenceModels/phaseCompressible/RAS/continuousGasKEpsilon/continuousGasKEpsilon.C
@@ -2,7 +2,7 @@
   =========                 |
   \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox
    \\    /   O peration     |
-    \\  /    A nd           | Copyright (C) 2013-2015 OpenFOAM Foundation
+    \\  /    A nd           | Copyright (C) 2013-2016 OpenFOAM Foundation
      \\/     M anipulation  |
 -------------------------------------------------------------------------------
 License
@@ -62,7 +62,7 @@ continuousGasKEpsilon<BasicTurbulenceModel>::continuousGasKEpsilon
         type
     ),
 
-    liquidTurbulencePtr_(NULL),
+    liquidTurbulencePtr_(nullptr),
 
     nutEff_
     (
diff --git a/src/TurbulenceModels/phaseCompressible/RAS/kOmegaSSTSato/kOmegaSSTSato.C b/src/TurbulenceModels/phaseCompressible/RAS/kOmegaSSTSato/kOmegaSSTSato.C
index 25e47992f25..7f0af09be62 100644
--- a/src/TurbulenceModels/phaseCompressible/RAS/kOmegaSSTSato/kOmegaSSTSato.C
+++ b/src/TurbulenceModels/phaseCompressible/RAS/kOmegaSSTSato/kOmegaSSTSato.C
@@ -61,7 +61,7 @@ kOmegaSSTSato<BasicTurbulenceModel>::kOmegaSSTSato
         type
     ),
 
-    gasTurbulencePtr_(NULL),
+    gasTurbulencePtr_(nullptr),
 
     Cmub_
     (
diff --git a/src/TurbulenceModels/phaseCompressible/RAS/mixtureKEpsilon/mixtureKEpsilon.C b/src/TurbulenceModels/phaseCompressible/RAS/mixtureKEpsilon/mixtureKEpsilon.C
index 57ff8c1de69..d0e6316f2ce 100644
--- a/src/TurbulenceModels/phaseCompressible/RAS/mixtureKEpsilon/mixtureKEpsilon.C
+++ b/src/TurbulenceModels/phaseCompressible/RAS/mixtureKEpsilon/mixtureKEpsilon.C
@@ -66,7 +66,7 @@ mixtureKEpsilon<BasicTurbulenceModel>::mixtureKEpsilon
         propertiesName
     ),
 
-    liquidTurbulencePtr_(NULL),
+    liquidTurbulencePtr_(nullptr),
 
     Cmu_
     (
diff --git a/src/combustionModels/singleStepCombustion/singleStepCombustion.C b/src/combustionModels/singleStepCombustion/singleStepCombustion.C
index 8df2f329cf2..a8296fffb35 100644
--- a/src/combustionModels/singleStepCombustion/singleStepCombustion.C
+++ b/src/combustionModels/singleStepCombustion/singleStepCombustion.C
@@ -42,7 +42,7 @@ singleStepCombustion<CombThermoType, ThermoType>::singleStepCombustion
 )
 :
     CombThermoType(modelType, mesh, phaseName),
-    singleMixturePtr_(NULL),
+    singleMixturePtr_(nullptr),
     wFuel_
     (
         IOobject
diff --git a/src/conversion/meshReader/meshReader.C b/src/conversion/meshReader/meshReader.C
index 851492229dd..611b655d6f4 100644
--- a/src/conversion/meshReader/meshReader.C
+++ b/src/conversion/meshReader/meshReader.C
@@ -2,7 +2,7 @@
   =========                 |
   \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox
    \\    /   O peration     |
-    \\  /    A nd           | Copyright (C) 2011-2012 OpenFOAM Foundation
+    \\  /    A nd           | Copyright (C) 2011-2016 OpenFOAM Foundation
      \\/     M anipulation  |
 -------------------------------------------------------------------------------
 License
@@ -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 100d161ab8c..3ddd01c37b9 100644
--- a/src/conversion/meshReader/starcd/STARCDMeshReader.C
+++ b/src/conversion/meshReader/starcd/STARCDMeshReader.C
@@ -411,7 +411,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/dynamicMesh/attachDetach/attachDetach.C b/src/dynamicMesh/attachDetach/attachDetach.C
index 3bec7005c0d..8ce76a11c35 100644
--- a/src/dynamicMesh/attachDetach/attachDetach.C
+++ b/src/dynamicMesh/attachDetach/attachDetach.C
@@ -251,7 +251,7 @@ Foam::attachDetach::attachDetach
     triggerIndex_(0),
     state_(UNKNOWN),
     trigger_(false),
-    pointMatchMapPtr_(NULL)
+    pointMatchMapPtr_(nullptr)
 {
     checkDefinition();
 }
@@ -287,7 +287,7 @@ Foam::attachDetach::attachDetach
     triggerIndex_(0),
     state_(UNKNOWN),
     trigger_(false),
-    pointMatchMapPtr_(NULL)
+    pointMatchMapPtr_(nullptr)
 {
     checkDefinition();
 }
diff --git a/src/dynamicMesh/boundaryMesh/boundaryMesh.C b/src/dynamicMesh/boundaryMesh/boundaryMesh.C
index 24b5f3be810..6b1960eee98 100644
--- a/src/dynamicMesh/boundaryMesh/boundaryMesh.C
+++ b/src/dynamicMesh/boundaryMesh/boundaryMesh.C
@@ -436,7 +436,7 @@ void Foam::boundaryMesh::markZone
 // Null constructor
 Foam::boundaryMesh::boundaryMesh()
 :
-    meshPtr_(NULL),
+    meshPtr_(nullptr),
     patches_(),
     meshFace_(),
     featurePoints_(),
@@ -462,7 +462,7 @@ void Foam::boundaryMesh::clearOut()
     {
         delete meshPtr_;
 
-        meshPtr_ = NULL;
+        meshPtr_ = nullptr;
     }
 }
 
diff --git a/src/dynamicMesh/fvMeshAdder/fvMeshAdderTemplates.C b/src/dynamicMesh/fvMeshAdder/fvMeshAdderTemplates.C
index bc46a7568ce..b59832add3d 100644
--- a/src/dynamicMesh/fvMeshAdder/fvMeshAdderTemplates.C
+++ b/src/dynamicMesh/fvMeshAdder/fvMeshAdderTemplates.C
@@ -115,7 +115,7 @@ void Foam::fvMeshAdder::MapVolField
             newPatchi++
         )
         {
-            bfld.set(newPatchi, NULL);
+            bfld.set(newPatchi, nullptr);
         }
 
 
@@ -435,7 +435,7 @@ void Foam::fvMeshAdder::MapSurfaceField
             newPatchi++
         )
         {
-            bfld.set(newPatchi, NULL);
+            bfld.set(newPatchi, nullptr);
         }
 
 
diff --git a/src/dynamicMesh/fvMeshDistribute/fvMeshDistribute.C b/src/dynamicMesh/fvMeshDistribute/fvMeshDistribute.C
index d2ad4d6f5d5..2fdf0b3c160 100644
--- a/src/dynamicMesh/fvMeshDistribute/fvMeshDistribute.C
+++ b/src/dynamicMesh/fvMeshDistribute/fvMeshDistribute.C
@@ -598,7 +598,7 @@ Foam::autoPtr<Foam::mapPolyMesh> Foam::fvMeshDistribute::mergeSharedPoints
 
     if (returnReduce(pointToMaster.size(), sumOp<label>()) == 0)
     {
-        return autoPtr<mapPolyMesh>(NULL);
+        return autoPtr<mapPolyMesh>(nullptr);
     }
 
     polyTopoChange meshMod(mesh_);
diff --git a/src/dynamicMesh/fvMeshSubset/fvMeshSubset.C b/src/dynamicMesh/fvMeshSubset/fvMeshSubset.C
index 2818ef9c95f..8b8c616293a 100644
--- a/src/dynamicMesh/fvMeshSubset/fvMeshSubset.C
+++ b/src/dynamicMesh/fvMeshSubset/fvMeshSubset.C
@@ -395,7 +395,7 @@ Foam::labelList Foam::fvMeshSubset::getCellsToRemove
 Foam::fvMeshSubset::fvMeshSubset(const fvMesh& baseMesh)
 :
     baseMesh_(baseMesh),
-    fvMeshSubsetPtr_(NULL),
+    fvMeshSubsetPtr_(nullptr),
     pointMap_(0),
     faceMap_(0),
     cellMap_(0),
diff --git a/src/dynamicMesh/layerAdditionRemoval/layerAdditionRemoval.C b/src/dynamicMesh/layerAdditionRemoval/layerAdditionRemoval.C
index 0e0d45cd439..0913f7fba79 100644
--- a/src/dynamicMesh/layerAdditionRemoval/layerAdditionRemoval.C
+++ b/src/dynamicMesh/layerAdditionRemoval/layerAdditionRemoval.C
@@ -149,8 +149,8 @@ Foam::layerAdditionRemoval::layerAdditionRemoval
     maxLayerThickness_(maxThickness),
     thicknessFromVolume_(thicknessFromVolume),
     oldLayerThickness_(-1.0),
-    pointsPairingPtr_(NULL),
-    facesPairingPtr_(NULL),
+    pointsPairingPtr_(nullptr),
+    facesPairingPtr_(nullptr),
     triggerRemoval_(-1),
     triggerAddition_(-1)
 {
@@ -175,8 +175,8 @@ Foam::layerAdditionRemoval::layerAdditionRemoval
         dict.lookupOrDefault<Switch>("thicknessFromVolume", true)
     ),
     oldLayerThickness_(readOldThickness(dict)),
-    pointsPairingPtr_(NULL),
-    facesPairingPtr_(NULL),
+    pointsPairingPtr_(nullptr),
+    facesPairingPtr_(nullptr),
     triggerRemoval_(-1),
     triggerAddition_(-1)
 {
diff --git a/src/dynamicMesh/meshCut/cellCuts/cellCuts.C b/src/dynamicMesh/meshCut/cellCuts/cellCuts.C
index b49a7090093..d9aa92fdc3c 100644
--- a/src/dynamicMesh/meshCut/cellCuts/cellCuts.C
+++ b/src/dynamicMesh/meshCut/cellCuts/cellCuts.C
@@ -2675,7 +2675,7 @@ Foam::cellCuts::cellCuts
     pointIsCut_(expand(mesh.nPoints(), meshVerts)),
     edgeIsCut_(expand(mesh.nEdges(), meshEdges)),
     edgeWeight_(expand(mesh.nEdges(), meshEdges, meshEdgeWeights)),
-    faceCutsPtr_(NULL),
+    faceCutsPtr_(nullptr),
     faceSplitCut_(cutCells.size()),
     cellLoops_(mesh.nCells()),
     nLoops_(-1),
@@ -2718,7 +2718,7 @@ Foam::cellCuts::cellCuts
     pointIsCut_(expand(mesh.nPoints(), meshVerts)),
     edgeIsCut_(expand(mesh.nEdges(), meshEdges)),
     edgeWeight_(expand(mesh.nEdges(), meshEdges, meshEdgeWeights)),
-    faceCutsPtr_(NULL),
+    faceCutsPtr_(nullptr),
     faceSplitCut_(mesh.nFaces()/10 + 1),
     cellLoops_(mesh.nCells()),
     nLoops_(-1),
@@ -2763,7 +2763,7 @@ Foam::cellCuts::cellCuts
     pointIsCut_(mesh.nPoints(), false),
     edgeIsCut_(mesh.nEdges(), false),
     edgeWeight_(mesh.nEdges(), -GREAT),
-    faceCutsPtr_(NULL),
+    faceCutsPtr_(nullptr),
     faceSplitCut_(cellLabels.size()),
     cellLoops_(mesh.nCells()),
     nLoops_(-1),
@@ -2806,7 +2806,7 @@ Foam::cellCuts::cellCuts
     pointIsCut_(mesh.nPoints(), false),
     edgeIsCut_(mesh.nEdges(), false),
     edgeWeight_(mesh.nEdges(), -GREAT),
-    faceCutsPtr_(NULL),
+    faceCutsPtr_(nullptr),
     faceSplitCut_(refCells.size()),
     cellLoops_(mesh.nCells()),
     nLoops_(-1),
@@ -2850,7 +2850,7 @@ Foam::cellCuts::cellCuts
     pointIsCut_(mesh.nPoints(), false),
     edgeIsCut_(mesh.nEdges(), false),
     edgeWeight_(mesh.nEdges(), -GREAT),
-    faceCutsPtr_(NULL),
+    faceCutsPtr_(nullptr),
     faceSplitCut_(cellLabels.size()),
     cellLoops_(mesh.nCells()),
     nLoops_(-1),
@@ -2900,7 +2900,7 @@ Foam::cellCuts::cellCuts
     pointIsCut_(pointIsCut),
     edgeIsCut_(edgeIsCut),
     edgeWeight_(edgeWeight),
-    faceCutsPtr_(NULL),
+    faceCutsPtr_(nullptr),
     faceSplitCut_(faceSplitCut),
     cellLoops_(cellLoops),
     nLoops_(nLoops),
diff --git a/src/dynamicMesh/meshCut/cellLooper/cellLooper.H b/src/dynamicMesh/meshCut/cellLooper/cellLooper.H
index 1f7d579c9a1..2642fd641f6 100644
--- a/src/dynamicMesh/meshCut/cellLooper/cellLooper.H
+++ b/src/dynamicMesh/meshCut/cellLooper/cellLooper.H
@@ -146,7 +146,7 @@ public:
         autoPtr<cellLooper> clone() const
         {
             NotImplemented;
-            return autoPtr<cellLooper>(NULL);
+            return autoPtr<cellLooper>(nullptr);
         }
 
 
diff --git a/src/dynamicMesh/meshCut/directions/directions.H b/src/dynamicMesh/meshCut/directions/directions.H
index 0a16672e568..c81c794ae81 100644
--- a/src/dynamicMesh/meshCut/directions/directions.H
+++ b/src/dynamicMesh/meshCut/directions/directions.H
@@ -142,7 +142,7 @@ public:
         (
             const polyMesh& mesh,
             const dictionary& dict,
-            const twoDPointCorrector* correct2DPtr = NULL
+            const twoDPointCorrector* correct2DPtr = nullptr
         );
 };
 
diff --git a/src/dynamicMesh/meshCut/meshModifiers/multiDirRefinement/multiDirRefinement.C b/src/dynamicMesh/meshCut/meshModifiers/multiDirRefinement/multiDirRefinement.C
index 6868a933503..4eb2c5c2fa1 100644
--- a/src/dynamicMesh/meshCut/meshModifiers/multiDirRefinement/multiDirRefinement.C
+++ b/src/dynamicMesh/meshCut/meshModifiers/multiDirRefinement/multiDirRefinement.C
@@ -455,7 +455,7 @@ void Foam::multiDirRefinement::refineFromDict
     // How to walk cell circumference.
     Switch pureGeomCut(dict.lookup("geometricCut"));
 
-    autoPtr<cellLooper> cellWalker(NULL);
+    autoPtr<cellLooper> cellWalker(nullptr);
     if (pureGeomCut)
     {
         cellWalker.reset(new geomCellLooper(mesh));
diff --git a/src/dynamicMesh/meshCut/meshModifiers/undoableMeshCutter/undoableMeshCutter.C b/src/dynamicMesh/meshCut/meshModifiers/undoableMeshCutter/undoableMeshCutter.C
index 97b0d055251..71623907fde 100644
--- a/src/dynamicMesh/meshCut/meshModifiers/undoableMeshCutter/undoableMeshCutter.C
+++ b/src/dynamicMesh/meshCut/meshModifiers/undoableMeshCutter/undoableMeshCutter.C
@@ -77,7 +77,7 @@ void Foam::undoableMeshCutter::printRefTree(Ostream& os) const
         {
             if (!splitPtr->isMaster())
             {
-                splitPtr = NULL;
+                splitPtr = nullptr;
 
                 break;
             }
@@ -209,9 +209,9 @@ Foam::undoableMeshCutter::~undoableMeshCutter()
             {
                 splitCell* otherSidePtr = splitPtr->getOther();
 
-                otherSidePtr->parent() = NULL;
+                otherSidePtr->parent() = nullptr;
 
-                splitPtr->parent() = NULL;
+                splitPtr->parent() = nullptr;
             }
 
             // Delete splitCell (updates pointer on parent to itself)
@@ -257,7 +257,7 @@ void Foam::undoableMeshCutter::setRefinement
                 // place.
 
                 // Create 0th level. Null parent to denote this.
-                splitCell* parentPtr = new splitCell(celli, NULL);
+                splitCell* parentPtr = new splitCell(celli, nullptr);
 
                 splitCell* masterPtr = new splitCell(celli, parentPtr);
 
diff --git a/src/dynamicMesh/meshCut/splitCell/splitCell.C b/src/dynamicMesh/meshCut/splitCell/splitCell.C
index db036d918e2..ae143cfeb7c 100644
--- a/src/dynamicMesh/meshCut/splitCell/splitCell.C
+++ b/src/dynamicMesh/meshCut/splitCell/splitCell.C
@@ -33,8 +33,8 @@ Foam::splitCell::splitCell(const label celli, splitCell* parent)
 :
     celli_(celli),
     parent_(parent),
-    master_(NULL),
-    slave_(NULL)
+    master_(nullptr),
+    slave_(nullptr)
 {}
 
 
@@ -49,11 +49,11 @@ Foam::splitCell::~splitCell()
         // Make sure parent does not refer to me anymore.
         if (myParent->master() == this)
         {
-            myParent->master() = NULL;
+            myParent->master() = nullptr;
         }
         else if (myParent->slave() == this)
         {
-            myParent->slave() = NULL;
+            myParent->slave() = nullptr;
         }
         else
         {
@@ -112,7 +112,7 @@ Foam::splitCell* Foam::splitCell::getOther() const
         FatalErrorInFunction
             << "Cell:" << cellLabel() << abort(FatalError);
 
-        return NULL;
+        return nullptr;
     }
     else if (myParent->master() == this)
     {
@@ -128,7 +128,7 @@ Foam::splitCell* Foam::splitCell::getOther() const
             << " parent's master or slave pointer" << endl
             << "Cell:" << cellLabel() << abort(FatalError);
 
-        return NULL;
+        return nullptr;
     }
 }
 
diff --git a/src/dynamicMesh/polyMeshAdder/faceCoupleInfo.C b/src/dynamicMesh/polyMeshAdder/faceCoupleInfo.C
index a5039a4996d..b4f8f7449f5 100644
--- a/src/dynamicMesh/polyMeshAdder/faceCoupleInfo.C
+++ b/src/dynamicMesh/polyMeshAdder/faceCoupleInfo.C
@@ -1872,10 +1872,10 @@ Foam::faceCoupleInfo::faceCoupleInfo
     const bool perfectMatch
 )
 :
-    masterPatchPtr_(NULL),
-    slavePatchPtr_(NULL),
+    masterPatchPtr_(nullptr),
+    slavePatchPtr_(nullptr),
     cutPoints_(0),
-    cutFacesPtr_(NULL),
+    cutFacesPtr_(nullptr),
     cutToMasterFaces_(0),
     masterToCutPoints_(0),
     cutToSlaveFaces_(0),
@@ -1981,7 +1981,7 @@ Foam::faceCoupleInfo::faceCoupleInfo
         )
     ),
     cutPoints_(0),
-    cutFacesPtr_(NULL),
+    cutFacesPtr_(nullptr),
     cutToMasterFaces_(0),
     masterToCutPoints_(0),
     cutToSlaveFaces_(0),
diff --git a/src/dynamicMesh/polyTopoChange/polyTopoChange/combineFaces.C b/src/dynamicMesh/polyTopoChange/polyTopoChange/combineFaces.C
index 96511ebe4cd..9d1140a71ef 100644
--- a/src/dynamicMesh/polyTopoChange/polyTopoChange/combineFaces.C
+++ b/src/dynamicMesh/polyTopoChange/polyTopoChange/combineFaces.C
@@ -112,7 +112,7 @@ bool Foam::combineFaces::validFace
         return false;
     }
 
-    bool isNonManifold = bigFace.checkPointManifold(false, NULL);
+    bool isNonManifold = bigFace.checkPointManifold(false, nullptr);
     if (isNonManifold)
     {
         return false;
diff --git a/src/dynamicMesh/polyTopoChange/polyTopoChange/hexRef8/refinementHistory.C b/src/dynamicMesh/polyTopoChange/polyTopoChange/hexRef8/refinementHistory.C
index 0519999c040..251257c112b 100644
--- a/src/dynamicMesh/polyTopoChange/polyTopoChange/hexRef8/refinementHistory.C
+++ b/src/dynamicMesh/polyTopoChange/polyTopoChange/hexRef8/refinementHistory.C
@@ -108,14 +108,14 @@ void Foam::refinementHistory::writeDebug
 Foam::refinementHistory::splitCell8::splitCell8()
 :
     parent_(-1),
-    addedCellsPtr_(NULL)
+    addedCellsPtr_(nullptr)
 {}
 
 
 Foam::refinementHistory::splitCell8::splitCell8(const label parent)
 :
     parent_(parent),
-    addedCellsPtr_(NULL)
+    addedCellsPtr_(nullptr)
 {}
 
 
@@ -132,7 +132,7 @@ Foam::refinementHistory::splitCell8::splitCell8(const splitCell8& sc)
     (
         sc.addedCellsPtr_.valid()
       ? new FixedList<label, 8>(sc.addedCellsPtr_())
-      : NULL
+      : nullptr
     )
 {}
 
@@ -157,7 +157,7 @@ void Foam::refinementHistory::splitCell8::operator=(const splitCell8& s)
     (
         s.addedCellsPtr_.valid()
       ? new FixedList<label, 8>(s.addedCellsPtr_())
-      : NULL
+      : nullptr
     );
 }
 
@@ -203,7 +203,7 @@ Foam::Istream& Foam::operator>>(Istream& is, refinementHistory::splitCell8& sc)
     }
     else
     {
-        sc.addedCellsPtr_.reset(NULL);
+        sc.addedCellsPtr_.reset(nullptr);
     }
 
     return is;
@@ -1732,7 +1732,7 @@ void Foam::refinementHistory::combineCells
     }
 
     splitCell8& parentSplit = splitCells_[parentIndex];
-    parentSplit.addedCellsPtr_.reset(NULL);
+    parentSplit.addedCellsPtr_.reset(nullptr);
     visibleCells_[masterCelli] = parentIndex;
 }
 
diff --git a/src/dynamicMesh/polyTopoChange/polyTopoChanger/polyTopoChanger.C b/src/dynamicMesh/polyTopoChange/polyTopoChanger/polyTopoChanger.C
index 05f06958d52..9dbe9ea80f2 100644
--- a/src/dynamicMesh/polyTopoChange/polyTopoChanger/polyTopoChanger.C
+++ b/src/dynamicMesh/polyTopoChange/polyTopoChanger/polyTopoChanger.C
@@ -2,7 +2,7 @@
   =========                 |
   \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox
    \\    /   O peration     |
-    \\  /    A nd           | Copyright (C) 2011-2015 OpenFOAM Foundation
+    \\  /    A nd           | Copyright (C) 2011-2016 OpenFOAM Foundation
      \\/     M anipulation  |
 -------------------------------------------------------------------------------
 License
@@ -282,7 +282,7 @@ Foam::autoPtr<Foam::mapPolyMesh> Foam::polyTopoChanger::changeMesh
     }
     else
     {
-        return autoPtr<mapPolyMesh>(NULL);
+        return autoPtr<mapPolyMesh>(nullptr);
     }
 }
 
diff --git a/src/dynamicMesh/polyTopoChange/repatchPolyTopoChanger/repatchPolyTopoChanger.C b/src/dynamicMesh/polyTopoChange/repatchPolyTopoChanger/repatchPolyTopoChanger.C
index 4c1e0855c6b..2de1c3619a0 100644
--- a/src/dynamicMesh/polyTopoChange/repatchPolyTopoChanger/repatchPolyTopoChanger.C
+++ b/src/dynamicMesh/polyTopoChange/repatchPolyTopoChanger/repatchPolyTopoChanger.C
@@ -2,7 +2,7 @@
   =========                 |
   \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox
    \\    /   O peration     |
-    \\  /    A nd           | Copyright (C) 2011-2015 OpenFOAM Foundation
+    \\  /    A nd           | Copyright (C) 2011-2016 OpenFOAM Foundation
      \\/     M anipulation  |
 -------------------------------------------------------------------------------
 License
@@ -52,7 +52,7 @@ Foam::polyTopoChange& Foam::repatchPolyTopoChanger::meshMod()
 Foam::repatchPolyTopoChanger::repatchPolyTopoChanger(polyMesh& mesh)
 :
     mesh_(mesh),
-    meshModPtr_(NULL)
+    meshModPtr_(nullptr)
 {}
 
 
diff --git a/src/dynamicMesh/slidingInterface/enrichedPatch/enrichedPatch.C b/src/dynamicMesh/slidingInterface/enrichedPatch/enrichedPatch.C
index bbe891aa73e..e0ba1fd8e2a 100644
--- a/src/dynamicMesh/slidingInterface/enrichedPatch/enrichedPatch.C
+++ b/src/dynamicMesh/slidingInterface/enrichedPatch/enrichedPatch.C
@@ -153,15 +153,15 @@ Foam::enrichedPatch::enrichedPatch
     slavePointPointHits_(slavePointPointHits),
     slavePointEdgeHits_(slavePointEdgeHits),
     slavePointFaceHits_(slavePointFaceHits),
-    enrichedFacesPtr_(NULL),
-    meshPointsPtr_(NULL),
-    localFacesPtr_(NULL),
-    localPointsPtr_(NULL),
-    pointPointsPtr_(NULL),
-    masterPointFacesPtr_(NULL),
-    cutFacesPtr_(NULL),
-    cutFaceMasterPtr_(NULL),
-    cutFaceSlavePtr_(NULL)
+    enrichedFacesPtr_(nullptr),
+    meshPointsPtr_(nullptr),
+    localFacesPtr_(nullptr),
+    localPointsPtr_(nullptr),
+    pointPointsPtr_(nullptr),
+    masterPointFacesPtr_(nullptr),
+    cutFacesPtr_(nullptr),
+    cutFaceMasterPtr_(nullptr),
+    cutFaceSlavePtr_(nullptr)
 {}
 
 
diff --git a/src/dynamicMesh/slidingInterface/slidingInterface.C b/src/dynamicMesh/slidingInterface/slidingInterface.C
index ad1ed4d8716..52026efb911 100644
--- a/src/dynamicMesh/slidingInterface/slidingInterface.C
+++ b/src/dynamicMesh/slidingInterface/slidingInterface.C
@@ -178,19 +178,19 @@ Foam::slidingInterface::slidingInterface
     edgeMasterCatchFraction_(edgeMasterCatchFractionDefault_),
     edgeCoPlanarTol_(edgeCoPlanarTolDefault_),
     edgeEndCutoffTol_(edgeEndCutoffTolDefault_),
-    cutFaceMasterPtr_(NULL),
-    cutFaceSlavePtr_(NULL),
-    masterFaceCellsPtr_(NULL),
-    slaveFaceCellsPtr_(NULL),
-    masterStickOutFacesPtr_(NULL),
-    slaveStickOutFacesPtr_(NULL),
-    retiredPointMapPtr_(NULL),
-    cutPointEdgePairMapPtr_(NULL),
-    slavePointPointHitsPtr_(NULL),
-    slavePointEdgeHitsPtr_(NULL),
-    slavePointFaceHitsPtr_(NULL),
-    masterPointEdgeHitsPtr_(NULL),
-    projectedSlavePointsPtr_(NULL)
+    cutFaceMasterPtr_(nullptr),
+    cutFaceSlavePtr_(nullptr),
+    masterFaceCellsPtr_(nullptr),
+    slaveFaceCellsPtr_(nullptr),
+    masterStickOutFacesPtr_(nullptr),
+    slaveStickOutFacesPtr_(nullptr),
+    retiredPointMapPtr_(nullptr),
+    cutPointEdgePairMapPtr_(nullptr),
+    slavePointPointHitsPtr_(nullptr),
+    slavePointEdgeHitsPtr_(nullptr),
+    slavePointFaceHitsPtr_(nullptr),
+    masterPointEdgeHitsPtr_(nullptr),
+    projectedSlavePointsPtr_(nullptr)
 {
     checkDefinition();
 
@@ -256,19 +256,19 @@ Foam::slidingInterface::slidingInterface
         intersection::algorithmNames_.read(dict.lookup("projection"))
     ),
     trigger_(false),
-    cutFaceMasterPtr_(NULL),
-    cutFaceSlavePtr_(NULL),
-    masterFaceCellsPtr_(NULL),
-    slaveFaceCellsPtr_(NULL),
-    masterStickOutFacesPtr_(NULL),
-    slaveStickOutFacesPtr_(NULL),
-    retiredPointMapPtr_(NULL),
-    cutPointEdgePairMapPtr_(NULL),
-    slavePointPointHitsPtr_(NULL),
-    slavePointEdgeHitsPtr_(NULL),
-    slavePointFaceHitsPtr_(NULL),
-    masterPointEdgeHitsPtr_(NULL),
-    projectedSlavePointsPtr_(NULL)
+    cutFaceMasterPtr_(nullptr),
+    cutFaceSlavePtr_(nullptr),
+    masterFaceCellsPtr_(nullptr),
+    slaveFaceCellsPtr_(nullptr),
+    masterStickOutFacesPtr_(nullptr),
+    slaveStickOutFacesPtr_(nullptr),
+    retiredPointMapPtr_(nullptr),
+    cutPointEdgePairMapPtr_(nullptr),
+    slavePointPointHitsPtr_(nullptr),
+    slavePointEdgeHitsPtr_(nullptr),
+    slavePointFaceHitsPtr_(nullptr),
+    masterPointEdgeHitsPtr_(nullptr),
+    projectedSlavePointsPtr_(nullptr)
 {
     // Optionally default tolerances from dictionary
     setTolerances(dict);
diff --git a/src/edgeMesh/edgeMesh.C b/src/edgeMesh/edgeMesh.C
index 4964d0c0b44..937a8a373c6 100644
--- a/src/edgeMesh/edgeMesh.C
+++ b/src/edgeMesh/edgeMesh.C
@@ -2,7 +2,7 @@
   =========                 |
   \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox
    \\    /   O peration     |
-    \\  /    A nd           | Copyright (C) 2011-2015 OpenFOAM Foundation
+    \\  /    A nd           | Copyright (C) 2011-2016 OpenFOAM Foundation
      \\/     M anipulation  |
 -------------------------------------------------------------------------------
 License
@@ -125,7 +125,7 @@ Foam::edgeMesh::edgeMesh()
     fileFormats::edgeMeshFormatsCore(),
     points_(0),
     edges_(0),
-    pointEdgesPtr_(NULL)
+    pointEdgesPtr_(nullptr)
 {}
 
 
@@ -138,7 +138,7 @@ Foam::edgeMesh::edgeMesh
     fileFormats::edgeMeshFormatsCore(),
     points_(points),
     edges_(edges),
-    pointEdgesPtr_(NULL)
+    pointEdgesPtr_(nullptr)
 {}
 
 
@@ -151,7 +151,7 @@ Foam::edgeMesh::edgeMesh
     fileFormats::edgeMeshFormatsCore(),
     points_(0),
     edges_(0),
-    pointEdgesPtr_(NULL)
+    pointEdgesPtr_(nullptr)
 {
     points_.transfer(pointLst());
     edges_.transfer(edgeLst());
diff --git a/src/edgeMesh/edgeMeshI.H b/src/edgeMesh/edgeMeshI.H
index cfd6a27d758..4c808c239d5 100644
--- a/src/edgeMesh/edgeMeshI.H
+++ b/src/edgeMesh/edgeMeshI.H
@@ -2,7 +2,7 @@
   =========                 |
   \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox
    \\    /   O peration     |
-    \\  /    A nd           | Copyright (C) 2011-2012 OpenFOAM Foundation
+    \\  /    A nd           | Copyright (C) 2011-2016 OpenFOAM Foundation
      \\/     M anipulation  |
 -------------------------------------------------------------------------------
 License
@@ -30,7 +30,7 @@ inline Foam::edgeMesh::edgeMesh(const edgeMesh& em)
     fileFormats::edgeMeshFormatsCore(),
     points_(em.points_),
     edges_(em.edges_),
-    pointEdgesPtr_(NULL)
+    pointEdgesPtr_(nullptr)
 {}
 
 
diff --git a/src/edgeMesh/edgeMeshIO.C b/src/edgeMesh/edgeMeshIO.C
index e8bc88f4026..6b4dd6f3820 100644
--- a/src/edgeMesh/edgeMeshIO.C
+++ b/src/edgeMesh/edgeMeshIO.C
@@ -37,7 +37,7 @@ Foam::edgeMesh::edgeMesh
 :
     points_(0),
     edges_(0),
-    pointEdgesPtr_(NULL)
+    pointEdgesPtr_(nullptr)
 {
     read(name, ext);
 }
@@ -47,7 +47,7 @@ Foam::edgeMesh::edgeMesh(const fileName& name)
 :
     points_(0),
     edges_(0),
-    pointEdgesPtr_(NULL)
+    pointEdgesPtr_(nullptr)
 {
     read(name);
 }
diff --git a/src/finiteVolume/cfdTools/general/MRF/MRFZone.H b/src/finiteVolume/cfdTools/general/MRF/MRFZone.H
index d6ea9cdf5c2..0bcbcfd935c 100644
--- a/src/finiteVolume/cfdTools/general/MRF/MRFZone.H
+++ b/src/finiteVolume/cfdTools/general/MRF/MRFZone.H
@@ -174,7 +174,7 @@ public:
         autoPtr<MRFZone> clone() const
         {
             NotImplemented;
-            return autoPtr<MRFZone>(NULL);
+            return autoPtr<MRFZone>(nullptr);
         }
 
 
diff --git a/src/finiteVolume/cfdTools/general/fvOptions/fvOption.H b/src/finiteVolume/cfdTools/general/fvOptions/fvOption.H
index 4beb6d612a3..506a868bc5b 100644
--- a/src/finiteVolume/cfdTools/general/fvOptions/fvOption.H
+++ b/src/finiteVolume/cfdTools/general/fvOptions/fvOption.H
@@ -133,7 +133,7 @@ public:
         autoPtr<option> clone() const
         {
             NotImplemented;
-            return autoPtr<option>(NULL);
+            return autoPtr<option>(nullptr);
         }
 
         //- Return pointer to new fvOption object created
diff --git a/src/finiteVolume/fields/fvPatchFields/basic/sliced/slicedFvPatchField.C b/src/finiteVolume/fields/fvPatchFields/basic/sliced/slicedFvPatchField.C
index 04e34779180..98bd38eb72b 100644
--- a/src/finiteVolume/fields/fvPatchFields/basic/sliced/slicedFvPatchField.C
+++ b/src/finiteVolume/fields/fvPatchFields/basic/sliced/slicedFvPatchField.C
@@ -142,9 +142,9 @@ Foam::slicedFvPatchField<Type>::clone
 template<class Type>
 Foam::slicedFvPatchField<Type>::~slicedFvPatchField()
 {
-    // Set the fvPatchField storage pointer to NULL before its destruction
+    // Set the fvPatchField storage pointer to nullptr before its destruction
     // to protect the field it a slice of.
-    UList<Type>::shallowCopy(UList<Type>(NULL, 0));
+    UList<Type>::shallowCopy(UList<Type>(nullptr, 0));
 }
 
 
diff --git a/src/finiteVolume/fields/fvPatchFields/derived/timeVaryingMappedFixedValue/timeVaryingMappedFixedValueFvPatchField.C b/src/finiteVolume/fields/fvPatchFields/derived/timeVaryingMappedFixedValue/timeVaryingMappedFixedValueFvPatchField.C
index 26c447f3452..2222b05b1e5 100644
--- a/src/finiteVolume/fields/fvPatchFields/derived/timeVaryingMappedFixedValue/timeVaryingMappedFixedValueFvPatchField.C
+++ b/src/finiteVolume/fields/fvPatchFields/derived/timeVaryingMappedFixedValue/timeVaryingMappedFixedValueFvPatchField.C
@@ -42,7 +42,7 @@ timeVaryingMappedFixedValueFvPatchField
     fieldTableName_(iF.name()),
     setAverage_(false),
     perturb_(0),
-    mapperPtr_(NULL),
+    mapperPtr_(nullptr),
     sampleTimes_(0),
     startSampleTime_(-1),
     startSampledValues_(0),
@@ -75,7 +75,7 @@ timeVaryingMappedFixedValueFvPatchField
             "planarInterpolation"
         )
     ),
-    mapperPtr_(NULL),
+    mapperPtr_(nullptr),
     sampleTimes_(0),
     startSampleTime_(-1),
     startSampledValues_(0),
@@ -135,7 +135,7 @@ timeVaryingMappedFixedValueFvPatchField
     setAverage_(ptf.setAverage_),
     perturb_(ptf.perturb_),
     mapMethod_(ptf.mapMethod_),
-    mapperPtr_(NULL),
+    mapperPtr_(nullptr),
     sampleTimes_(0),
     startSampleTime_(-1),
     startSampledValues_(0),
@@ -159,7 +159,7 @@ timeVaryingMappedFixedValueFvPatchField
     setAverage_(ptf.setAverage_),
     perturb_(ptf.perturb_),
     mapMethod_(ptf.mapMethod_),
-    mapperPtr_(NULL),
+    mapperPtr_(nullptr),
     sampleTimes_(ptf.sampleTimes_),
     startSampleTime_(ptf.startSampleTime_),
     startSampledValues_(ptf.startSampledValues_),
@@ -184,7 +184,7 @@ timeVaryingMappedFixedValueFvPatchField
     setAverage_(ptf.setAverage_),
     perturb_(ptf.perturb_),
     mapMethod_(ptf.mapMethod_),
-    mapperPtr_(NULL),
+    mapperPtr_(nullptr),
     sampleTimes_(ptf.sampleTimes_),
     startSampleTime_(ptf.startSampleTime_),
     startSampledValues_(ptf.startSampledValues_),
diff --git a/src/finiteVolume/fields/fvsPatchFields/basic/sliced/slicedFvsPatchField.C b/src/finiteVolume/fields/fvsPatchFields/basic/sliced/slicedFvsPatchField.C
index ef3246303d4..39ad3b45f78 100644
--- a/src/finiteVolume/fields/fvsPatchFields/basic/sliced/slicedFvsPatchField.C
+++ b/src/finiteVolume/fields/fvsPatchFields/basic/sliced/slicedFvsPatchField.C
@@ -142,9 +142,9 @@ Foam::slicedFvsPatchField<Type>::clone
 template<class Type>
 Foam::slicedFvsPatchField<Type>::~slicedFvsPatchField()
 {
-    // Set the fvsPatchField storage pointer to NULL before its destruction
+    // Set the fvsPatchField storage pointer to nullptr before its destruction
     // to protect the field it a slice of.
-    UList<Type>::shallowCopy(UList<Type>(NULL, 0));
+    UList<Type>::shallowCopy(UList<Type>(nullptr, 0));
 }
 
 
diff --git a/src/finiteVolume/finiteVolume/ddtSchemes/CoEulerDdtScheme/CoEulerDdtScheme.C b/src/finiteVolume/finiteVolume/ddtSchemes/CoEulerDdtScheme/CoEulerDdtScheme.C
index 53004b47865..5d896b07a93 100644
--- a/src/finiteVolume/finiteVolume/ddtSchemes/CoEulerDdtScheme/CoEulerDdtScheme.C
+++ b/src/finiteVolume/finiteVolume/ddtSchemes/CoEulerDdtScheme/CoEulerDdtScheme.C
@@ -141,7 +141,7 @@ tmp<surfaceScalarField> CoEulerDdtScheme<Type>::CofrDeltaT() const
             << "Incorrect dimensions of phi: " << phi.dimensions()
             << abort(FatalError);
 
-        return tmp<surfaceScalarField>(NULL);
+        return tmp<surfaceScalarField>(nullptr);
     }
 }
 
diff --git a/src/finiteVolume/finiteVolume/gradSchemes/gaussGrad/gaussGrad.H b/src/finiteVolume/finiteVolume/gradSchemes/gaussGrad/gaussGrad.H
index bec2d9c6f1c..991c54d63b9 100644
--- a/src/finiteVolume/finiteVolume/gradSchemes/gaussGrad/gaussGrad.H
+++ b/src/finiteVolume/finiteVolume/gradSchemes/gaussGrad/gaussGrad.H
@@ -92,7 +92,7 @@ public:
         gaussGrad(const fvMesh& mesh, Istream& is)
         :
             gradScheme<Type>(mesh),
-            tinterpScheme_(NULL)
+            tinterpScheme_(nullptr)
         {
             if (is.eof())
             {
diff --git a/src/finiteVolume/finiteVolume/laplacianSchemes/laplacianScheme/laplacianScheme.H b/src/finiteVolume/finiteVolume/laplacianSchemes/laplacianScheme/laplacianScheme.H
index c88282da176..6e593c9c5c8 100644
--- a/src/finiteVolume/finiteVolume/laplacianSchemes/laplacianScheme/laplacianScheme.H
+++ b/src/finiteVolume/finiteVolume/laplacianSchemes/laplacianScheme/laplacianScheme.H
@@ -120,8 +120,8 @@ public:
         laplacianScheme(const fvMesh& mesh, Istream& is)
         :
             mesh_(mesh),
-            tinterpGammaScheme_(NULL),
-            tsnGradScheme_(NULL)
+            tinterpGammaScheme_(nullptr),
+            tsnGradScheme_(nullptr)
         {
             tinterpGammaScheme_ = tmp<surfaceInterpolationScheme<GType>>
             (
diff --git a/src/finiteVolume/finiteVolume/snGradSchemes/orthogonalSnGrad/orthogonalSnGrad.C b/src/finiteVolume/finiteVolume/snGradSchemes/orthogonalSnGrad/orthogonalSnGrad.C
index f1249ad65fa..11e4ab45c9e 100644
--- a/src/finiteVolume/finiteVolume/snGradSchemes/orthogonalSnGrad/orthogonalSnGrad.C
+++ b/src/finiteVolume/finiteVolume/snGradSchemes/orthogonalSnGrad/orthogonalSnGrad.C
@@ -57,7 +57,7 @@ orthogonalSnGrad<Type>::correction
 ) const
 {
     NotImplemented;
-    return tmp<GeometricField<Type, fvsPatchField, surfaceMesh>>(NULL);
+    return tmp<GeometricField<Type, fvsPatchField, surfaceMesh>>(nullptr);
 }
 
 
diff --git a/src/finiteVolume/finiteVolume/snGradSchemes/snGradScheme/snGradScheme.H b/src/finiteVolume/finiteVolume/snGradSchemes/snGradScheme/snGradScheme.H
index db7ad52082c..383e36823ee 100644
--- a/src/finiteVolume/finiteVolume/snGradSchemes/snGradScheme/snGradScheme.H
+++ b/src/finiteVolume/finiteVolume/snGradSchemes/snGradScheme/snGradScheme.H
@@ -161,7 +161,10 @@ public:
         virtual tmp<GeometricField<Type, fvsPatchField, surfaceMesh>>
         correction(const GeometricField<Type, fvPatchField, volMesh>&) const
         {
-            return tmp<GeometricField<Type, fvsPatchField, surfaceMesh>>(NULL);
+            return tmp<GeometricField<Type, fvsPatchField, surfaceMesh>>
+            (
+                nullptr
+            );
         }
 
         //- Return the snGrad of the given cell field
diff --git a/src/finiteVolume/finiteVolume/snGradSchemes/uncorrectedSnGrad/uncorrectedSnGrad.C b/src/finiteVolume/finiteVolume/snGradSchemes/uncorrectedSnGrad/uncorrectedSnGrad.C
index 5693e6cb7fa..548bbe71334 100644
--- a/src/finiteVolume/finiteVolume/snGradSchemes/uncorrectedSnGrad/uncorrectedSnGrad.C
+++ b/src/finiteVolume/finiteVolume/snGradSchemes/uncorrectedSnGrad/uncorrectedSnGrad.C
@@ -57,7 +57,7 @@ uncorrectedSnGrad<Type>::correction
 ) const
 {
     NotImplemented;
-    return tmp<GeometricField<Type, fvsPatchField, surfaceMesh>>(NULL);
+    return tmp<GeometricField<Type, fvsPatchField, surfaceMesh>>(nullptr);
 }
 
 
diff --git a/src/finiteVolume/fvMatrices/fvMatrix/fvMatrix.C b/src/finiteVolume/fvMatrices/fvMatrix/fvMatrix.C
index fd586598b80..16270c07d5e 100644
--- a/src/finiteVolume/fvMatrices/fvMatrix/fvMatrix.C
+++ b/src/finiteVolume/fvMatrices/fvMatrix/fvMatrix.C
@@ -276,7 +276,7 @@ Foam::fvMatrix<Type>::fvMatrix
     source_(psi.size(), Zero),
     internalCoeffs_(psi.mesh().boundary().size()),
     boundaryCoeffs_(psi.mesh().boundary().size()),
-    faceFluxCorrectionPtr_(NULL)
+    faceFluxCorrectionPtr_(nullptr)
 {
     if (debug)
     {
@@ -328,7 +328,7 @@ Foam::fvMatrix<Type>::fvMatrix(const fvMatrix<Type>& fvm)
     source_(fvm.source_),
     internalCoeffs_(fvm.internalCoeffs_),
     boundaryCoeffs_(fvm.boundaryCoeffs_),
-    faceFluxCorrectionPtr_(NULL)
+    faceFluxCorrectionPtr_(nullptr)
 {
     if (debug)
     {
@@ -373,7 +373,7 @@ Foam::fvMatrix<Type>::fvMatrix(const tmp<fvMatrix<Type>>& tfvm)
         const_cast<fvMatrix<Type>&>(tfvm()).boundaryCoeffs_,
         tfvm.isTmp()
     ),
-    faceFluxCorrectionPtr_(NULL)
+    faceFluxCorrectionPtr_(nullptr)
 {
     if (debug)
     {
@@ -386,7 +386,7 @@ Foam::fvMatrix<Type>::fvMatrix(const tmp<fvMatrix<Type>>& tfvm)
         if (tfvm.isTmp())
         {
             faceFluxCorrectionPtr_ = tfvm().faceFluxCorrectionPtr_;
-            tfvm().faceFluxCorrectionPtr_ = NULL;
+            tfvm().faceFluxCorrectionPtr_ = nullptr;
         }
         else
         {
@@ -416,7 +416,7 @@ Foam::fvMatrix<Type>::fvMatrix
     source_(is),
     internalCoeffs_(psi.mesh().boundary().size()),
     boundaryCoeffs_(psi.mesh().boundary().size()),
-    faceFluxCorrectionPtr_(NULL)
+    faceFluxCorrectionPtr_(nullptr)
 {
     if (debug)
     {
diff --git a/src/finiteVolume/fvMatrices/solvers/MULES/IMULESTemplates.C b/src/finiteVolume/fvMatrices/solvers/MULES/IMULESTemplates.C
index 33c06fae222..c1ecbb927fa 100644
--- a/src/finiteVolume/fvMatrices/solvers/MULES/IMULESTemplates.C
+++ b/src/finiteVolume/fvMatrices/solvers/MULES/IMULESTemplates.C
@@ -40,7 +40,7 @@ namespace MULES
     inline tmp<surfaceScalarField> interpolate(const RhoType& rho)
     {
         NotImplemented;
-        return tmp<surfaceScalarField>(NULL);
+        return tmp<surfaceScalarField>(nullptr);
     }
 
     template<>
diff --git a/src/finiteVolume/fvMesh/fvMesh.C b/src/finiteVolume/fvMesh/fvMesh.C
index 0ba93d1f101..72a2d5fd80c 100644
--- a/src/finiteVolume/fvMesh/fvMesh.C
+++ b/src/finiteVolume/fvMesh/fvMesh.C
@@ -66,7 +66,7 @@ void Foam::fvMesh::clearGeomNotOldVol()
     slicedVolScalarField::Internal* VPtr =
         static_cast<slicedVolScalarField::Internal*>(VPtr_);
     deleteDemandDrivenData(VPtr);
-    VPtr_ = NULL;
+    VPtr_ = nullptr;
 
     deleteDemandDrivenData(SfPtr_);
     deleteDemandDrivenData(magSfPtr_);
@@ -77,11 +77,11 @@ void Foam::fvMesh::clearGeomNotOldVol()
 
 void Foam::fvMesh::updateGeomNotOldVol()
 {
-    bool haveV = (VPtr_ != NULL);
-    bool haveSf = (SfPtr_ != NULL);
-    bool haveMagSf = (magSfPtr_ != NULL);
-    bool haveCP = (CPtr_ != NULL);
-    bool haveCf = (CfPtr_ != NULL);
+    bool haveV = (VPtr_ != nullptr);
+    bool haveSf = (SfPtr_ != nullptr);
+    bool haveMagSf = (magSfPtr_ != nullptr);
+    bool haveCP = (CPtr_ != nullptr);
+    bool haveCf = (CfPtr_ != nullptr);
 
     clearGeomNotOldVol();
 
@@ -251,16 +251,16 @@ Foam::fvMesh::fvMesh(const IOobject& io)
     fvSolution(static_cast<const objectRegistry&>(*this)),
     data(static_cast<const objectRegistry&>(*this)),
     boundary_(*this, boundaryMesh()),
-    lduPtr_(NULL),
+    lduPtr_(nullptr),
     curTimeIndex_(time().timeIndex()),
-    VPtr_(NULL),
-    V0Ptr_(NULL),
-    V00Ptr_(NULL),
-    SfPtr_(NULL),
-    magSfPtr_(NULL),
-    CPtr_(NULL),
-    CfPtr_(NULL),
-    phiPtr_(NULL)
+    VPtr_(nullptr),
+    V0Ptr_(nullptr),
+    V00Ptr_(nullptr),
+    SfPtr_(nullptr),
+    magSfPtr_(nullptr),
+    CPtr_(nullptr),
+    CfPtr_(nullptr),
+    phiPtr_(nullptr)
 {
     if (debug)
     {
@@ -361,16 +361,16 @@ Foam::fvMesh::fvMesh
     fvSolution(static_cast<const objectRegistry&>(*this)),
     data(static_cast<const objectRegistry&>(*this)),
     boundary_(*this, boundaryMesh()),
-    lduPtr_(NULL),
+    lduPtr_(nullptr),
     curTimeIndex_(time().timeIndex()),
-    VPtr_(NULL),
-    V0Ptr_(NULL),
-    V00Ptr_(NULL),
-    SfPtr_(NULL),
-    magSfPtr_(NULL),
-    CPtr_(NULL),
-    CfPtr_(NULL),
-    phiPtr_(NULL)
+    VPtr_(nullptr),
+    V0Ptr_(nullptr),
+    V00Ptr_(nullptr),
+    SfPtr_(nullptr),
+    magSfPtr_(nullptr),
+    CPtr_(nullptr),
+    CfPtr_(nullptr),
+    phiPtr_(nullptr)
 {
     if (debug)
     {
@@ -395,16 +395,16 @@ Foam::fvMesh::fvMesh
     fvSolution(static_cast<const objectRegistry&>(*this)),
     data(static_cast<const objectRegistry&>(*this)),
     boundary_(*this, boundaryMesh()),
-    lduPtr_(NULL),
+    lduPtr_(nullptr),
     curTimeIndex_(time().timeIndex()),
-    VPtr_(NULL),
-    V0Ptr_(NULL),
-    V00Ptr_(NULL),
-    SfPtr_(NULL),
-    magSfPtr_(NULL),
-    CPtr_(NULL),
-    CfPtr_(NULL),
-    phiPtr_(NULL)
+    VPtr_(nullptr),
+    V0Ptr_(nullptr),
+    V00Ptr_(nullptr),
+    SfPtr_(nullptr),
+    magSfPtr_(nullptr),
+    CPtr_(nullptr),
+    CfPtr_(nullptr),
+    phiPtr_(nullptr)
 {
     if (debug)
     {
@@ -428,16 +428,16 @@ Foam::fvMesh::fvMesh
     fvSolution(static_cast<const objectRegistry&>(*this)),
     data(static_cast<const objectRegistry&>(*this)),
     boundary_(*this),
-    lduPtr_(NULL),
+    lduPtr_(nullptr),
     curTimeIndex_(time().timeIndex()),
-    VPtr_(NULL),
-    V0Ptr_(NULL),
-    V00Ptr_(NULL),
-    SfPtr_(NULL),
-    magSfPtr_(NULL),
-    CPtr_(NULL),
-    CfPtr_(NULL),
-    phiPtr_(NULL)
+    VPtr_(nullptr),
+    V0Ptr_(nullptr),
+    V00Ptr_(nullptr),
+    SfPtr_(nullptr),
+    magSfPtr_(nullptr),
+    CPtr_(nullptr),
+    CfPtr_(nullptr),
+    phiPtr_(nullptr)
 {
     if (debug)
     {
diff --git a/src/finiteVolume/fvMesh/fvMeshMapper/fvPatchMapper.C b/src/finiteVolume/fvMesh/fvMeshMapper/fvPatchMapper.C
index fd41e045e77..e00d44cb562 100644
--- a/src/finiteVolume/fvMesh/fvMeshMapper/fvPatchMapper.C
+++ b/src/finiteVolume/fvMesh/fvMeshMapper/fvPatchMapper.C
@@ -213,9 +213,9 @@ Foam::fvPatchMapper::fvPatchMapper
     faceMap_(faceMap),
     sizeBeforeMapping_(faceMap.oldPatchSizes()[patch_.index()]),
     hasUnmapped_(false),
-    directAddrPtr_(NULL),
-    interpolationAddrPtr_(NULL),
-    weightsPtr_(NULL)
+    directAddrPtr_(nullptr),
+    interpolationAddrPtr_(nullptr),
+    weightsPtr_(nullptr)
 {}
 
 
diff --git a/src/finiteVolume/fvMesh/fvMeshMapper/fvSurfaceMapper.C b/src/finiteVolume/fvMesh/fvMeshMapper/fvSurfaceMapper.C
index 32e6a39a2c6..0872af5dc97 100644
--- a/src/finiteVolume/fvMesh/fvMeshMapper/fvSurfaceMapper.C
+++ b/src/finiteVolume/fvMesh/fvMeshMapper/fvSurfaceMapper.C
@@ -152,10 +152,10 @@ Foam::fvSurfaceMapper::fvSurfaceMapper
 :
     mesh_(mesh),
     faceMap_(fMapper),
-    directAddrPtr_(NULL),
-    interpolationAddrPtr_(NULL),
-    weightsPtr_(NULL),
-    insertedObjectLabelsPtr_(NULL)
+    directAddrPtr_(nullptr),
+    interpolationAddrPtr_(nullptr),
+    weightsPtr_(nullptr),
+    insertedObjectLabelsPtr_(nullptr)
 {}
 
 
diff --git a/src/finiteVolume/fvMesh/fvPatches/derived/regionCoupled/regionCoupledFvPatch.C b/src/finiteVolume/fvMesh/fvPatches/derived/regionCoupled/regionCoupledFvPatch.C
index 6f68e1abff9..d263b854d79 100644
--- a/src/finiteVolume/fvMesh/fvPatches/derived/regionCoupled/regionCoupledFvPatch.C
+++ b/src/finiteVolume/fvMesh/fvPatches/derived/regionCoupled/regionCoupledFvPatch.C
@@ -2,7 +2,7 @@
   =========                 |
   \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox
    \\    /   O peration     |
-    \\  /    A nd           | Copyright (C) 2011-2015 OpenFOAM Foundation
+    \\  /    A nd           | Copyright (C) 2011-2016 OpenFOAM Foundation
      \\/     M anipulation  |
 -------------------------------------------------------------------------------
 License
@@ -62,7 +62,7 @@ Foam::tmp<Foam::labelField> Foam::regionCoupledFvPatch::internalFieldTransfer
 
     }
 
-    return tmp<labelField>(NULL);
+    return tmp<labelField>(nullptr);
 }
 
 
diff --git a/src/finiteVolume/fvMesh/fvPatches/derived/regionCoupled/regionCoupledWallFvPatch.C b/src/finiteVolume/fvMesh/fvPatches/derived/regionCoupled/regionCoupledWallFvPatch.C
index 382fff4e799..2aad9298588 100644
--- a/src/finiteVolume/fvMesh/fvPatches/derived/regionCoupled/regionCoupledWallFvPatch.C
+++ b/src/finiteVolume/fvMesh/fvPatches/derived/regionCoupled/regionCoupledWallFvPatch.C
@@ -2,7 +2,7 @@
   =========                 |
   \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox
    \\    /   O peration     |
-    \\  /    A nd           | Copyright (C) 2011 OpenFOAM Foundation
+    \\  /    A nd           | Copyright (C) 2011-2016 OpenFOAM Foundation
      \\/     M anipulation  |
 -------------------------------------------------------------------------------
 License
@@ -63,7 +63,7 @@ internalFieldTransfer
         return tmp<labelField>(new labelField(iF.size(), 0));
 
     }
-    return tmp<labelField>(NULL);
+    return tmp<labelField>(nullptr);
 }
 
 // ************************************************************************* //
diff --git a/src/finiteVolume/fvMesh/fvPatches/fvPatch/fvPatch.H b/src/finiteVolume/fvMesh/fvPatches/fvPatch/fvPatch.H
index ee8943ec822..6dc1716e6d8 100644
--- a/src/finiteVolume/fvMesh/fvPatches/fvPatch/fvPatch.H
+++ b/src/finiteVolume/fvMesh/fvPatches/fvPatch/fvPatch.H
@@ -259,8 +259,8 @@ public:
             const typename GeometricField::Patch& lookupPatchField
             (
                 const word& name,
-                const GeometricField* = NULL,
-                const Type* = NULL
+                const GeometricField* = nullptr,
+                const Type* = nullptr
             ) const;
 };
 
diff --git a/src/finiteVolume/interpolation/surfaceInterpolation/schemes/CoBlended/CoBlended.H b/src/finiteVolume/interpolation/surfaceInterpolation/schemes/CoBlended/CoBlended.H
index 73cc5ab7106..bd1ad10af78 100644
--- a/src/finiteVolume/interpolation/surfaceInterpolation/schemes/CoBlended/CoBlended.H
+++ b/src/finiteVolume/interpolation/surfaceInterpolation/schemes/CoBlended/CoBlended.H
@@ -315,7 +315,7 @@ public:
             {
                 return tmp<GeometricField<Type, fvsPatchField, surfaceMesh>>
                 (
-                    NULL
+                    nullptr
                 );
             }
         }
diff --git a/src/finiteVolume/interpolation/surfaceInterpolation/schemes/cellCoBlended/cellCoBlended.H b/src/finiteVolume/interpolation/surfaceInterpolation/schemes/cellCoBlended/cellCoBlended.H
index a2f1e3bea21..213633d120c 100644
--- a/src/finiteVolume/interpolation/surfaceInterpolation/schemes/cellCoBlended/cellCoBlended.H
+++ b/src/finiteVolume/interpolation/surfaceInterpolation/schemes/cellCoBlended/cellCoBlended.H
@@ -343,7 +343,7 @@ public:
             {
                 return tmp<GeometricField<Type, fvsPatchField, surfaceMesh>>
                 (
-                    NULL
+                    nullptr
                 );
             }
         }
diff --git a/src/finiteVolume/interpolation/surfaceInterpolation/schemes/fixedBlended/fixedBlended.H b/src/finiteVolume/interpolation/surfaceInterpolation/schemes/fixedBlended/fixedBlended.H
index 2d28a495844..97c02cdb169 100644
--- a/src/finiteVolume/interpolation/surfaceInterpolation/schemes/fixedBlended/fixedBlended.H
+++ b/src/finiteVolume/interpolation/surfaceInterpolation/schemes/fixedBlended/fixedBlended.H
@@ -239,7 +239,7 @@ public:
             {
                 return tmp<GeometricField<Type, fvsPatchField, surfaceMesh>>
                 (
-                    NULL
+                    nullptr
                 );
             }
         }
diff --git a/src/finiteVolume/interpolation/surfaceInterpolation/schemes/harmonic/harmonic.H b/src/finiteVolume/interpolation/surfaceInterpolation/schemes/harmonic/harmonic.H
index 61b93499131..05b01823804 100644
--- a/src/finiteVolume/interpolation/surfaceInterpolation/schemes/harmonic/harmonic.H
+++ b/src/finiteVolume/interpolation/surfaceInterpolation/schemes/harmonic/harmonic.H
@@ -110,7 +110,7 @@ public:
         {
             NotImplemented;
 
-            return tmp<surfaceScalarField>(NULL);
+            return tmp<surfaceScalarField>(nullptr);
         }
 
         //- Return the face-interpolate of the given cell field
diff --git a/src/finiteVolume/interpolation/surfaceInterpolation/schemes/limiterBlended/limiterBlended.H b/src/finiteVolume/interpolation/surfaceInterpolation/schemes/limiterBlended/limiterBlended.H
index de4294da11e..77fc9a0015c 100644
--- a/src/finiteVolume/interpolation/surfaceInterpolation/schemes/limiterBlended/limiterBlended.H
+++ b/src/finiteVolume/interpolation/surfaceInterpolation/schemes/limiterBlended/limiterBlended.H
@@ -219,7 +219,7 @@ public:
             {
                 return tmp<GeometricField<Type, fvsPatchField, surfaceMesh>>
                 (
-                    NULL
+                    nullptr
                 );
             }
         }
diff --git a/src/finiteVolume/interpolation/surfaceInterpolation/schemes/localBlended/localBlended.H b/src/finiteVolume/interpolation/surfaceInterpolation/schemes/localBlended/localBlended.H
index 03fa6647123..f1a30e1efc4 100644
--- a/src/finiteVolume/interpolation/surfaceInterpolation/schemes/localBlended/localBlended.H
+++ b/src/finiteVolume/interpolation/surfaceInterpolation/schemes/localBlended/localBlended.H
@@ -231,7 +231,7 @@ public:
             {
                 return tmp<GeometricField<Type, fvsPatchField, surfaceMesh>>
                 (
-                    NULL
+                    nullptr
                 );
             }
         }
diff --git a/src/finiteVolume/interpolation/surfaceInterpolation/schemes/localMax/localMax.H b/src/finiteVolume/interpolation/surfaceInterpolation/schemes/localMax/localMax.H
index 6dc51cc7908..49ec408ecf9 100644
--- a/src/finiteVolume/interpolation/surfaceInterpolation/schemes/localMax/localMax.H
+++ b/src/finiteVolume/interpolation/surfaceInterpolation/schemes/localMax/localMax.H
@@ -110,7 +110,7 @@ public:
         {
             NotImplemented;
 
-            return tmp<surfaceScalarField>(NULL);
+            return tmp<surfaceScalarField>(nullptr);
         }
 
         //- Return the face-interpolate of the given cell field
diff --git a/src/finiteVolume/interpolation/surfaceInterpolation/schemes/localMin/localMin.H b/src/finiteVolume/interpolation/surfaceInterpolation/schemes/localMin/localMin.H
index 48f008ae7a1..6aa892c077f 100644
--- a/src/finiteVolume/interpolation/surfaceInterpolation/schemes/localMin/localMin.H
+++ b/src/finiteVolume/interpolation/surfaceInterpolation/schemes/localMin/localMin.H
@@ -110,7 +110,7 @@ public:
         {
             NotImplemented;
 
-            return tmp<surfaceScalarField>(NULL);
+            return tmp<surfaceScalarField>(nullptr);
         }
 
         //- Return the face-interpolate of the given cell field
diff --git a/src/finiteVolume/interpolation/surfaceInterpolation/schemes/outletStabilised/outletStabilised.H b/src/finiteVolume/interpolation/surfaceInterpolation/schemes/outletStabilised/outletStabilised.H
index dbdebfa7d2c..13473fd2e49 100644
--- a/src/finiteVolume/interpolation/surfaceInterpolation/schemes/outletStabilised/outletStabilised.H
+++ b/src/finiteVolume/interpolation/surfaceInterpolation/schemes/outletStabilised/outletStabilised.H
@@ -235,7 +235,7 @@ public:
             {
                 return tmp<GeometricField<Type, fvsPatchField, surfaceMesh>>
                 (
-                    NULL
+                    nullptr
                 );
             }
         }
diff --git a/src/finiteVolume/interpolation/surfaceInterpolation/schemes/skewCorrected/skewCorrected.H b/src/finiteVolume/interpolation/surfaceInterpolation/schemes/skewCorrected/skewCorrected.H
index 28649caa75d..f02f05d3302 100644
--- a/src/finiteVolume/interpolation/surfaceInterpolation/schemes/skewCorrected/skewCorrected.H
+++ b/src/finiteVolume/interpolation/surfaceInterpolation/schemes/skewCorrected/skewCorrected.H
@@ -209,7 +209,7 @@ public:
                 return
                     tmp<GeometricField<Type, fvsPatchField, surfaceMesh>>
                     (
-                        NULL
+                        nullptr
                     );
             }
         }
diff --git a/src/finiteVolume/interpolation/surfaceInterpolation/surfaceInterpolation/surfaceInterpolation.C b/src/finiteVolume/interpolation/surfaceInterpolation/surfaceInterpolation/surfaceInterpolation.C
index c0f548f9af4..6e8f8bc7d45 100644
--- a/src/finiteVolume/interpolation/surfaceInterpolation/surfaceInterpolation/surfaceInterpolation.C
+++ b/src/finiteVolume/interpolation/surfaceInterpolation/surfaceInterpolation/surfaceInterpolation.C
@@ -56,10 +56,10 @@ void Foam::surfaceInterpolation::clearOut()
 Foam::surfaceInterpolation::surfaceInterpolation(const fvMesh& fvm)
 :
     mesh_(fvm),
-    weights_(NULL),
-    deltaCoeffs_(NULL),
-    nonOrthDeltaCoeffs_(NULL),
-    nonOrthCorrectionVectors_(NULL)
+    weights_(nullptr),
+    deltaCoeffs_(nullptr),
+    nonOrthDeltaCoeffs_(nullptr),
+    nonOrthCorrectionVectors_(nullptr)
 {}
 
 
diff --git a/src/finiteVolume/interpolation/surfaceInterpolation/surfaceInterpolationScheme/surfaceInterpolationScheme.H b/src/finiteVolume/interpolation/surfaceInterpolation/surfaceInterpolationScheme/surfaceInterpolationScheme.H
index da6a64fbfff..8e6c802c5e8 100644
--- a/src/finiteVolume/interpolation/surfaceInterpolation/surfaceInterpolationScheme/surfaceInterpolationScheme.H
+++ b/src/finiteVolume/interpolation/surfaceInterpolation/surfaceInterpolationScheme/surfaceInterpolationScheme.H
@@ -201,7 +201,10 @@ public:
         virtual tmp<GeometricField<Type, fvsPatchField, surfaceMesh>>
         correction(const GeometricField<Type, fvPatchField, volMesh>&) const
         {
-            return tmp<GeometricField<Type, fvsPatchField, surfaceMesh>>(NULL);
+            return tmp<GeometricField<Type, fvsPatchField, surfaceMesh>>
+            (
+                nullptr
+            );
         }
 
         //- Return the face-interpolate of the given cell field
diff --git a/src/functionObjects/field/fieldValues/fieldValueDelta/fieldValueDelta.C b/src/functionObjects/field/fieldValues/fieldValueDelta/fieldValueDelta.C
index e60099d0571..5c0b22c3e9a 100644
--- a/src/functionObjects/field/fieldValues/fieldValueDelta/fieldValueDelta.C
+++ b/src/functionObjects/field/fieldValues/fieldValueDelta/fieldValueDelta.C
@@ -108,8 +108,8 @@ Foam::functionObjects::fieldValues::fieldValueDelta::fieldValueDelta
 :
     writeFiles(name, runTime, dict, name),
     operation_(opSubtract),
-    region1Ptr_(NULL),
-    region2Ptr_(NULL)
+    region1Ptr_(nullptr),
+    region2Ptr_(nullptr)
 {
     if (!isA<fvMesh>(obr_))
     {
diff --git a/src/functionObjects/field/fieldValues/surfaceRegion/surfaceRegion.C b/src/functionObjects/field/fieldValues/surfaceRegion/surfaceRegion.C
index 4dc3e9e72b6..4d0abc685a9 100644
--- a/src/functionObjects/field/fieldValues/surfaceRegion/surfaceRegion.C
+++ b/src/functionObjects/field/fieldValues/surfaceRegion/surfaceRegion.C
@@ -651,7 +651,7 @@ Foam::functionObjects::fieldValues::surfaceRegion::surfaceRegion
 )
 :
     fieldValue(name, runTime, dict, typeName),
-    surfaceWriterPtr_(NULL),
+    surfaceWriterPtr_(nullptr),
     regionType_(regionTypeNames_.read(dict.lookup("regionType"))),
     operation_(operationTypeNames_.read(dict.lookup("operation"))),
     weightFieldName_("none"),
@@ -681,7 +681,7 @@ Foam::functionObjects::fieldValues::surfaceRegion::surfaceRegion
 )
 :
     fieldValue(name, obr, dict, typeName),
-    surfaceWriterPtr_(NULL),
+    surfaceWriterPtr_(nullptr),
     regionType_(regionTypeNames_.read(dict.lookup("regionType"))),
     operation_(operationTypeNames_.read(dict.lookup("operation"))),
     weightFieldName_("none"),
diff --git a/src/fvAgglomerationMethods/pairPatchAgglomeration/pairPatchAgglomeration.C b/src/fvAgglomerationMethods/pairPatchAgglomeration/pairPatchAgglomeration.C
index 32bf9efa12b..d68a5de52a5 100644
--- a/src/fvAgglomerationMethods/pairPatchAgglomeration/pairPatchAgglomeration.C
+++ b/src/fvAgglomerationMethods/pairPatchAgglomeration/pairPatchAgglomeration.C
@@ -556,9 +556,9 @@ void Foam::pairPatchAgglomeration::combineLevels(const label curLevel)
     }
 
     // Delete the restrictAddressing for the coarser level
-    restrictAddressing_.set(curLevel, NULL);
+    restrictAddressing_.set(curLevel, nullptr);
 
-    patchLevels_.set(prevLevel, patchLevels_.set(curLevel, NULL));
+    patchLevels_.set(prevLevel, patchLevels_.set(curLevel, nullptr));
 }
 
 
diff --git a/src/fvMotionSolver/fvMotionSolvers/componentDisplacement/componentLaplacian/displacementComponentLaplacianFvMotionSolver.C b/src/fvMotionSolver/fvMotionSolvers/componentDisplacement/componentLaplacian/displacementComponentLaplacianFvMotionSolver.C
index 0260a370d48..4b1751f6569 100644
--- a/src/fvMotionSolver/fvMotionSolvers/componentDisplacement/componentLaplacian/displacementComponentLaplacianFvMotionSolver.C
+++ b/src/fvMotionSolver/fvMotionSolvers/componentDisplacement/componentLaplacian/displacementComponentLaplacianFvMotionSolver.C
@@ -75,7 +75,7 @@ displacementComponentLaplacianFvMotionSolver
         ),
         cellMotionBoundaryTypes<scalar>(pointDisplacement_.boundaryField())
     ),
-    pointLocation_(NULL),
+    pointLocation_(nullptr),
     diffusivityPtr_
     (
         motionDiffusivity::New(fvMesh_, coeffDict().lookup("diffusivity"))
@@ -246,7 +246,7 @@ void Foam::displacementComponentLaplacianFvMotionSolver::updateMesh
 
     // Update diffusivity. Note two stage to make sure old one is de-registered
     // before creating/registering new one.
-    diffusivityPtr_.reset(NULL);
+    diffusivityPtr_.reset(nullptr);
     diffusivityPtr_ = motionDiffusivity::New
     (
         fvMesh_,
diff --git a/src/fvMotionSolver/fvMotionSolvers/componentVelocity/componentLaplacian/velocityComponentLaplacianFvMotionSolver.C b/src/fvMotionSolver/fvMotionSolvers/componentVelocity/componentLaplacian/velocityComponentLaplacianFvMotionSolver.C
index 16e466457a8..5f297bbb663 100644
--- a/src/fvMotionSolver/fvMotionSolvers/componentVelocity/componentLaplacian/velocityComponentLaplacianFvMotionSolver.C
+++ b/src/fvMotionSolver/fvMotionSolvers/componentVelocity/componentLaplacian/velocityComponentLaplacianFvMotionSolver.C
@@ -144,7 +144,7 @@ void Foam::velocityComponentLaplacianFvMotionSolver::updateMesh
 
     // Update diffusivity. Note two stage to make sure old one is de-registered
     // before creating/registering new one.
-    diffusivityPtr_.reset(NULL);
+    diffusivityPtr_.reset(nullptr);
     diffusivityPtr_ = motionDiffusivity::New
     (
         fvMesh_,
diff --git a/src/fvMotionSolver/fvMotionSolvers/displacement/SBRStress/displacementSBRStressFvMotionSolver.C b/src/fvMotionSolver/fvMotionSolvers/displacement/SBRStress/displacementSBRStressFvMotionSolver.C
index b2d12efb6c1..ffa2ce9fc49 100644
--- a/src/fvMotionSolver/fvMotionSolvers/displacement/SBRStress/displacementSBRStressFvMotionSolver.C
+++ b/src/fvMotionSolver/fvMotionSolvers/displacement/SBRStress/displacementSBRStressFvMotionSolver.C
@@ -187,7 +187,7 @@ void Foam::displacementSBRStressFvMotionSolver::updateMesh
 
     // Update diffusivity. Note two stage to make sure old one is de-registered
     // before creating/registering new one.
-    diffusivityPtr_.reset(NULL);
+    diffusivityPtr_.reset(nullptr);
     diffusivityPtr_ = motionDiffusivity::New
     (
         fvMesh_,
diff --git a/src/fvMotionSolver/fvMotionSolvers/displacement/laplacian/displacementLaplacianFvMotionSolver.C b/src/fvMotionSolver/fvMotionSolvers/displacement/laplacian/displacementLaplacianFvMotionSolver.C
index ccb44f877ee..705ea097040 100644
--- a/src/fvMotionSolver/fvMotionSolvers/displacement/laplacian/displacementLaplacianFvMotionSolver.C
+++ b/src/fvMotionSolver/fvMotionSolvers/displacement/laplacian/displacementLaplacianFvMotionSolver.C
@@ -76,7 +76,7 @@ Foam::displacementLaplacianFvMotionSolver::displacementLaplacianFvMotionSolver
         ),
         cellMotionBoundaryTypes<vector>(pointDisplacement_.boundaryField())
     ),
-    pointLocation_(NULL),
+    pointLocation_(nullptr),
     diffusivityPtr_
     (
         motionDiffusivity::New(fvMesh_, coeffDict().lookup("diffusivity"))
diff --git a/src/fvMotionSolver/fvMotionSolvers/velocity/laplacian/velocityLaplacianFvMotionSolver.C b/src/fvMotionSolver/fvMotionSolvers/velocity/laplacian/velocityLaplacianFvMotionSolver.C
index 2c14e541061..4adf5a4873d 100644
--- a/src/fvMotionSolver/fvMotionSolvers/velocity/laplacian/velocityLaplacianFvMotionSolver.C
+++ b/src/fvMotionSolver/fvMotionSolvers/velocity/laplacian/velocityLaplacianFvMotionSolver.C
@@ -146,7 +146,7 @@ void Foam::velocityLaplacianFvMotionSolver::updateMesh
 
     // Update diffusivity. Note two stage to make sure old one is de-registered
     // before creating/registering new one.
-    diffusivityPtr_.reset(NULL);
+    diffusivityPtr_.reset(nullptr);
     diffusivityPtr_ = motionDiffusivity::New
     (
         fvMesh_,
diff --git a/src/fvMotionSolver/pointPatchFields/derived/surfaceDisplacement/surfaceDisplacementPointPatchVectorField.C b/src/fvMotionSolver/pointPatchFields/derived/surfaceDisplacement/surfaceDisplacementPointPatchVectorField.C
index b2f3b353177..52d68a6fb6b 100644
--- a/src/fvMotionSolver/pointPatchFields/derived/surfaceDisplacement/surfaceDisplacementPointPatchVectorField.C
+++ b/src/fvMotionSolver/pointPatchFields/derived/surfaceDisplacement/surfaceDisplacementPointPatchVectorField.C
@@ -81,7 +81,7 @@ void surfaceDisplacementPointPatchVectorField::calcProjection
 
 
     // Get fixed points (bit of a hack)
-    const pointZone* zonePtr = NULL;
+    const pointZone* zonePtr = nullptr;
 
     if (frozenPointsZone_.size() > 0)
     {
diff --git a/src/fvMotionSolver/pointPatchFields/derived/surfaceSlipDisplacement/surfaceSlipDisplacementPointPatchVectorField.C b/src/fvMotionSolver/pointPatchFields/derived/surfaceSlipDisplacement/surfaceSlipDisplacementPointPatchVectorField.C
index 82b530d3052..6eee20eb32c 100644
--- a/src/fvMotionSolver/pointPatchFields/derived/surfaceSlipDisplacement/surfaceSlipDisplacementPointPatchVectorField.C
+++ b/src/fvMotionSolver/pointPatchFields/derived/surfaceSlipDisplacement/surfaceSlipDisplacementPointPatchVectorField.C
@@ -80,7 +80,7 @@ void surfaceSlipDisplacementPointPatchVectorField::calcProjection
 
 
     // Get fixed points (bit of a hack)
-    const pointZone* zonePtr = NULL;
+    const pointZone* zonePtr = nullptr;
 
     if (frozenPointsZone_.size() > 0)
     {
diff --git a/src/fvMotionSolver/pointPatchFields/derived/timeVaryingMappedFixedValue/timeVaryingMappedFixedValuePointPatchField.C b/src/fvMotionSolver/pointPatchFields/derived/timeVaryingMappedFixedValue/timeVaryingMappedFixedValuePointPatchField.C
index ef03e416d6f..ec50acb65f1 100644
--- a/src/fvMotionSolver/pointPatchFields/derived/timeVaryingMappedFixedValue/timeVaryingMappedFixedValuePointPatchField.C
+++ b/src/fvMotionSolver/pointPatchFields/derived/timeVaryingMappedFixedValue/timeVaryingMappedFixedValuePointPatchField.C
@@ -42,7 +42,7 @@ timeVaryingMappedFixedValuePointPatchField
     fieldTableName_(iF.name()),
     setAverage_(false),
     perturb_(0),
-    mapperPtr_(NULL),
+    mapperPtr_(nullptr),
     sampleTimes_(0),
     startSampleTime_(-1),
     startSampledValues_(0),
@@ -75,7 +75,7 @@ timeVaryingMappedFixedValuePointPatchField
             "planarInterpolation"
         )
     ),
-    mapperPtr_(NULL),
+    mapperPtr_(nullptr),
     sampleTimes_(0),
     startSampleTime_(-1),
     startSampledValues_(0),
@@ -138,7 +138,7 @@ timeVaryingMappedFixedValuePointPatchField
     setAverage_(ptf.setAverage_),
     perturb_(ptf.perturb_),
     mapMethod_(ptf.mapMethod_),
-    mapperPtr_(NULL),
+    mapperPtr_(nullptr),
     sampleTimes_(0),
     startSampleTime_(-1),
     startSampledValues_(0),
diff --git a/src/fvOptions/constraints/fixedTemperatureConstraint/fixedTemperatureConstraint.C b/src/fvOptions/constraints/fixedTemperatureConstraint/fixedTemperatureConstraint.C
index d41dac0660d..2fdfeddd133 100644
--- a/src/fvOptions/constraints/fixedTemperatureConstraint/fixedTemperatureConstraint.C
+++ b/src/fvOptions/constraints/fixedTemperatureConstraint/fixedTemperatureConstraint.C
@@ -69,7 +69,7 @@ Foam::fv::fixedTemperatureConstraint::fixedTemperatureConstraint
 :
     cellSetOption(name, modelType, dict, mesh),
     mode_(temperatureModeNames_.read(coeffs_.lookup("mode"))),
-    Tuniform_(NULL),
+    Tuniform_(nullptr),
     TName_("T")
 {
     switch (mode_)
diff --git a/src/fvOptions/sources/derived/explicitPorositySource/explicitPorositySource.C b/src/fvOptions/sources/derived/explicitPorositySource/explicitPorositySource.C
index ae861256b50..8b8c37762c1 100644
--- a/src/fvOptions/sources/derived/explicitPorositySource/explicitPorositySource.C
+++ b/src/fvOptions/sources/derived/explicitPorositySource/explicitPorositySource.C
@@ -57,7 +57,7 @@ Foam::fv::explicitPorositySource::explicitPorositySource
 )
 :
     cellSetOption(name, modelType, dict, mesh),
-    porosityPtr_(NULL)
+    porosityPtr_(nullptr)
 {
     read(dict);
 
diff --git a/src/fvOptions/sources/derived/meanVelocityForce/meanVelocityForce.C b/src/fvOptions/sources/derived/meanVelocityForce/meanVelocityForce.C
index 1720cc157d8..96cd17ce60d 100644
--- a/src/fvOptions/sources/derived/meanVelocityForce/meanVelocityForce.C
+++ b/src/fvOptions/sources/derived/meanVelocityForce/meanVelocityForce.C
@@ -91,7 +91,7 @@ Foam::fv::meanVelocityForce::meanVelocityForce
     dGradP_(0.0),
     flowDir_(Ubar_/mag(Ubar_)),
     relaxation_(coeffs_.lookupOrDefault<scalar>("relaxation", 1.0)),
-    rAPtr_(NULL)
+    rAPtr_(nullptr)
 {
     coeffs_.lookup("fields") >> fieldNames_;
 
diff --git a/src/fvOptions/sources/derived/solidificationMeltingSource/solidificationMeltingSource.C b/src/fvOptions/sources/derived/solidificationMeltingSource/solidificationMeltingSource.C
index d421d40b7f4..859ef24a2b1 100644
--- a/src/fvOptions/sources/derived/solidificationMeltingSource/solidificationMeltingSource.C
+++ b/src/fvOptions/sources/derived/solidificationMeltingSource/solidificationMeltingSource.C
@@ -123,7 +123,7 @@ Foam::fv::solidificationMeltingSource::Cp() const
         }
     }
 
-    return tmp<volScalarField>(NULL);
+    return tmp<volScalarField>(nullptr);
 }
 
 
diff --git a/src/fvOptions/sources/interRegion/interRegionExplicitPorositySource/interRegionExplicitPorositySource.C b/src/fvOptions/sources/interRegion/interRegionExplicitPorositySource/interRegionExplicitPorositySource.C
index 0291b20b3b2..0adb2b5ee95 100644
--- a/src/fvOptions/sources/interRegion/interRegionExplicitPorositySource/interRegionExplicitPorositySource.C
+++ b/src/fvOptions/sources/interRegion/interRegionExplicitPorositySource/interRegionExplicitPorositySource.C
@@ -116,7 +116,7 @@ Foam::fv::interRegionExplicitPorositySource::interRegionExplicitPorositySource
 )
 :
     interRegionOption(name, modelType, dict, mesh),
-    porosityPtr_(NULL),
+    porosityPtr_(nullptr),
     firstIter_(true),
     UName_(coeffs_.lookupOrDefault<word>("U", "U")),
     muName_(coeffs_.lookupOrDefault<word>("mu", "thermo:mu"))
diff --git a/src/fvOptions/sources/interRegion/interRegionHeatTransfer/interRegionHeatTransferModel/interRegionHeatTransferModel.C b/src/fvOptions/sources/interRegion/interRegionHeatTransfer/interRegionHeatTransferModel/interRegionHeatTransferModel.C
index 081977aa26e..ecf9e844104 100644
--- a/src/fvOptions/sources/interRegion/interRegionHeatTransfer/interRegionHeatTransferModel/interRegionHeatTransferModel.C
+++ b/src/fvOptions/sources/interRegion/interRegionHeatTransfer/interRegionHeatTransferModel/interRegionHeatTransferModel.C
@@ -120,7 +120,7 @@ Foam::fv::interRegionHeatTransferModel::interRegionHeatTransferModel
         mesh
     ),
     nbrModelName_(coeffs_.lookup("nbrModel")),
-    nbrModel_(NULL),
+    nbrModel_(nullptr),
     firstIter_(true),
     timeIndex_(-1),
     htc_
diff --git a/src/fvOptions/sources/interRegion/interRegionHeatTransfer/interRegionHeatTransferModel/interRegionHeatTransferModelI.H b/src/fvOptions/sources/interRegion/interRegionHeatTransfer/interRegionHeatTransferModel/interRegionHeatTransferModelI.H
index 42f7fd28a5c..c9a57a05d1a 100644
--- a/src/fvOptions/sources/interRegion/interRegionHeatTransfer/interRegionHeatTransferModel/interRegionHeatTransferModelI.H
+++ b/src/fvOptions/sources/interRegion/interRegionHeatTransfer/interRegionHeatTransferModel/interRegionHeatTransferModelI.H
@@ -2,7 +2,7 @@
   =========                 |
   \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox
    \\    /   O peration     |
-    \\  /    A nd           | Copyright (C) 2012-2015 OpenFOAM Foundation
+    \\  /    A nd           | Copyright (C) 2012-2016 OpenFOAM Foundation
      \\/     M anipulation  |
 -------------------------------------------------------------------------------
 License
@@ -56,7 +56,7 @@ Foam::fv::interRegionHeatTransferModel::htc() const
 inline const Foam::fv::interRegionHeatTransferModel&
 Foam::fv::interRegionHeatTransferModel::nbrModel() const
 {
-    if (nbrModel_ == NULL)
+    if (nbrModel_ == nullptr)
     {
         FatalErrorInFunction
             << "Neighbour model not set"
@@ -70,7 +70,7 @@ Foam::fv::interRegionHeatTransferModel::nbrModel() const
 inline Foam::fv::interRegionHeatTransferModel&
 Foam::fv::interRegionHeatTransferModel::nbrModel()
 {
-    if (nbrModel_ == NULL)
+    if (nbrModel_ == nullptr)
     {
         FatalErrorInFunction
             << "Neighbour model not set"
diff --git a/src/lagrangian/basic/InteractionLists/InteractionLists.C b/src/lagrangian/basic/InteractionLists/InteractionLists.C
index b911153f705..4223cd67789 100644
--- a/src/lagrangian/basic/InteractionLists/InteractionLists.C
+++ b/src/lagrangian/basic/InteractionLists/InteractionLists.C
@@ -1095,7 +1095,7 @@ template<class ParticleType>
 Foam::InteractionLists<ParticleType>::InteractionLists(const polyMesh& mesh)
 :
     mesh_(mesh),
-    cloud_(mesh_, "NULL_Cloud", IDLList<ParticleType>()),
+    cloud_(mesh_, "nullptr_Cloud", IDLList<ParticleType>()),
     writeCloud_(false),
     cellMapPtr_(),
     wallFaceMapPtr_(),
diff --git a/src/lagrangian/intermediate/clouds/Templates/CollidingCloud/CollidingCloud.C b/src/lagrangian/intermediate/clouds/Templates/CollidingCloud/CollidingCloud.C
index 58662a716cb..be5611162f6 100644
--- a/src/lagrangian/intermediate/clouds/Templates/CollidingCloud/CollidingCloud.C
+++ b/src/lagrangian/intermediate/clouds/Templates/CollidingCloud/CollidingCloud.C
@@ -93,7 +93,7 @@ Foam::CollidingCloud<CloudType>::CollidingCloud
 :
     CloudType(cloudName, rho, U, mu, g, false),
     constProps_(this->particleProperties()),
-    collisionModel_(NULL)
+    collisionModel_(nullptr)
 {
     if (this->solution().steadyState())
     {
@@ -135,7 +135,7 @@ Foam::CollidingCloud<CloudType>::CollidingCloud
 )
 :
     CloudType(mesh, name, c),
-    collisionModel_(NULL)
+    collisionModel_(nullptr)
 {}
 
 
diff --git a/src/lagrangian/intermediate/clouds/Templates/KinematicCloud/KinematicCloud.C b/src/lagrangian/intermediate/clouds/Templates/KinematicCloud/KinematicCloud.C
index 1b13722c5e0..a6a9ba0b153 100644
--- a/src/lagrangian/intermediate/clouds/Templates/KinematicCloud/KinematicCloud.C
+++ b/src/lagrangian/intermediate/clouds/Templates/KinematicCloud/KinematicCloud.C
@@ -282,7 +282,7 @@ Foam::KinematicCloud<CloudType>::KinematicCloud
 :
     CloudType(rho.mesh(), cloudName, false),
     kinematicCloud(),
-    cloudCopyPtr_(NULL),
+    cloudCopyPtr_(nullptr),
     mesh_(rho.mesh()),
     particleProperties_
     (
@@ -349,11 +349,11 @@ Foam::KinematicCloud<CloudType>::KinematicCloud
         subModelProperties_.subOrEmptyDict("injectionModels"),
         *this
     ),
-    dispersionModel_(NULL),
-    patchInteractionModel_(NULL),
-    stochasticCollisionModel_(NULL),
-    surfaceFilmModel_(NULL),
-    UIntegrator_(NULL),
+    dispersionModel_(nullptr),
+    patchInteractionModel_(nullptr),
+    stochasticCollisionModel_(nullptr),
+    surfaceFilmModel_(nullptr),
+    UIntegrator_(nullptr),
     UTrans_
     (
         new volVectorField::Internal
@@ -413,7 +413,7 @@ Foam::KinematicCloud<CloudType>::KinematicCloud
 :
     CloudType(c.mesh_, name, c),
     kinematicCloud(),
-    cloudCopyPtr_(NULL),
+    cloudCopyPtr_(nullptr),
     mesh_(c.mesh_),
     particleProperties_(c.particleProperties_),
     outputProperties_(c.outputProperties_),
@@ -421,7 +421,7 @@ Foam::KinematicCloud<CloudType>::KinematicCloud
     constProps_(c.constProps_),
     subModelProperties_(c.subModelProperties_),
     rndGen_(c.rndGen_, true),
-    cellOccupancyPtr_(NULL),
+    cellOccupancyPtr_(nullptr),
     cellLengthScale_(c.cellLengthScale_),
     rho_(c.rho_),
     U_(c.U_),
@@ -481,7 +481,7 @@ Foam::KinematicCloud<CloudType>::KinematicCloud
 :
     CloudType(mesh, name, IDLList<parcelType>()),
     kinematicCloud(),
-    cloudCopyPtr_(NULL),
+    cloudCopyPtr_(nullptr),
     mesh_(mesh),
     particleProperties_
     (
@@ -512,7 +512,7 @@ Foam::KinematicCloud<CloudType>::KinematicCloud
     constProps_(),
     subModelProperties_(dictionary::null),
     rndGen_(0, 0),
-    cellOccupancyPtr_(NULL),
+    cellOccupancyPtr_(nullptr),
     cellLengthScale_(c.cellLengthScale_),
     rho_(c.rho_),
     U_(c.U_),
@@ -522,13 +522,13 @@ Foam::KinematicCloud<CloudType>::KinematicCloud
     forces_(*this, mesh),
     functions_(*this),
     injectors_(*this),
-    dispersionModel_(NULL),
-    patchInteractionModel_(NULL),
-    stochasticCollisionModel_(NULL),
-    surfaceFilmModel_(NULL),
-    UIntegrator_(NULL),
-    UTrans_(NULL),
-    UCoeff_(NULL)
+    dispersionModel_(nullptr),
+    patchInteractionModel_(nullptr),
+    stochasticCollisionModel_(nullptr),
+    surfaceFilmModel_(nullptr),
+    UIntegrator_(nullptr),
+    UTrans_(nullptr),
+    UCoeff_(nullptr)
 {}
 
 
diff --git a/src/lagrangian/intermediate/clouds/Templates/MPPICCloud/MPPICCloud.C b/src/lagrangian/intermediate/clouds/Templates/MPPICCloud/MPPICCloud.C
index 702d2454b82..5cbfaf7418f 100644
--- a/src/lagrangian/intermediate/clouds/Templates/MPPICCloud/MPPICCloud.C
+++ b/src/lagrangian/intermediate/clouds/Templates/MPPICCloud/MPPICCloud.C
@@ -76,9 +76,9 @@ Foam::MPPICCloud<CloudType>::MPPICCloud
 )
 :
     CloudType(cloudName, rho, U, mu, g, false),
-    packingModel_(NULL),
-    dampingModel_(NULL),
-    isotropyModel_(NULL)
+    packingModel_(nullptr),
+    dampingModel_(nullptr),
+    isotropyModel_(nullptr)
 {
     if (this->solution().steadyState())
     {
@@ -122,9 +122,9 @@ Foam::MPPICCloud<CloudType>::MPPICCloud
 )
 :
     CloudType(mesh, name, c),
-    packingModel_(NULL),
-    dampingModel_(NULL),
-    isotropyModel_(NULL)
+    packingModel_(nullptr),
+    dampingModel_(nullptr),
+    isotropyModel_(nullptr)
 {}
 
 
diff --git a/src/lagrangian/intermediate/clouds/Templates/ReactingCloud/ReactingCloud.C b/src/lagrangian/intermediate/clouds/Templates/ReactingCloud/ReactingCloud.C
index e3acc3bea1e..9343fe5e240 100644
--- a/src/lagrangian/intermediate/clouds/Templates/ReactingCloud/ReactingCloud.C
+++ b/src/lagrangian/intermediate/clouds/Templates/ReactingCloud/ReactingCloud.C
@@ -98,10 +98,10 @@ Foam::ReactingCloud<CloudType>::ReactingCloud
 :
     CloudType(cloudName, rho, U, g, thermo, false),
     reactingCloud(),
-    cloudCopyPtr_(NULL),
+    cloudCopyPtr_(nullptr),
     constProps_(this->particleProperties()),
-    compositionModel_(NULL),
-    phaseChangeModel_(NULL),
+    compositionModel_(nullptr),
+    phaseChangeModel_(nullptr),
     rhoTrans_(thermo.carrier().species().size())
 {
     if (this->solution().active())
@@ -153,7 +153,7 @@ Foam::ReactingCloud<CloudType>::ReactingCloud
 :
     CloudType(c, name),
     reactingCloud(),
-    cloudCopyPtr_(NULL),
+    cloudCopyPtr_(nullptr),
     constProps_(c.constProps_),
     compositionModel_(c.compositionModel_->clone()),
     phaseChangeModel_(c.phaseChangeModel_->clone()),
@@ -193,11 +193,11 @@ Foam::ReactingCloud<CloudType>::ReactingCloud
 :
     CloudType(mesh, name, c),
     reactingCloud(),
-    cloudCopyPtr_(NULL),
+    cloudCopyPtr_(nullptr),
     constProps_(),
     compositionModel_(c.compositionModel_->clone()),
-//    compositionModel_(NULL),
-    phaseChangeModel_(NULL),
+//    compositionModel_(nullptr),
+    phaseChangeModel_(nullptr),
     rhoTrans_(0)
 {}
 
diff --git a/src/lagrangian/intermediate/clouds/Templates/ReactingMultiphaseCloud/ReactingMultiphaseCloud.C b/src/lagrangian/intermediate/clouds/Templates/ReactingMultiphaseCloud/ReactingMultiphaseCloud.C
index c70e8f04c7d..831208bf433 100644
--- a/src/lagrangian/intermediate/clouds/Templates/ReactingMultiphaseCloud/ReactingMultiphaseCloud.C
+++ b/src/lagrangian/intermediate/clouds/Templates/ReactingMultiphaseCloud/ReactingMultiphaseCloud.C
@@ -84,10 +84,10 @@ Foam::ReactingMultiphaseCloud<CloudType>::ReactingMultiphaseCloud
 :
     CloudType(cloudName, rho, U, g, thermo, false),
     reactingMultiphaseCloud(),
-    cloudCopyPtr_(NULL),
+    cloudCopyPtr_(nullptr),
     constProps_(this->particleProperties()),
-    devolatilisationModel_(NULL),
-    surfaceReactionModel_(NULL),
+    devolatilisationModel_(nullptr),
+    surfaceReactionModel_(nullptr),
     dMassDevolatilisation_(0.0),
     dMassSurfaceReaction_(0.0)
 {
@@ -117,7 +117,7 @@ Foam::ReactingMultiphaseCloud<CloudType>::ReactingMultiphaseCloud
 :
     CloudType(c, name),
     reactingMultiphaseCloud(),
-    cloudCopyPtr_(NULL),
+    cloudCopyPtr_(nullptr),
     constProps_(c.constProps_),
     devolatilisationModel_(c.devolatilisationModel_->clone()),
     surfaceReactionModel_(c.surfaceReactionModel_->clone()),
@@ -136,10 +136,10 @@ Foam::ReactingMultiphaseCloud<CloudType>::ReactingMultiphaseCloud
 :
     CloudType(mesh, name, c),
     reactingMultiphaseCloud(),
-    cloudCopyPtr_(NULL),
+    cloudCopyPtr_(nullptr),
     constProps_(),
-    devolatilisationModel_(NULL),
-    surfaceReactionModel_(NULL),
+    devolatilisationModel_(nullptr),
+    surfaceReactionModel_(nullptr),
     dMassDevolatilisation_(0.0),
     dMassSurfaceReaction_(0.0)
 {}
diff --git a/src/lagrangian/intermediate/clouds/Templates/ThermoCloud/ThermoCloud.C b/src/lagrangian/intermediate/clouds/Templates/ThermoCloud/ThermoCloud.C
index f0340d0b0bd..2b47ad1cd04 100644
--- a/src/lagrangian/intermediate/clouds/Templates/ThermoCloud/ThermoCloud.C
+++ b/src/lagrangian/intermediate/clouds/Templates/ThermoCloud/ThermoCloud.C
@@ -152,17 +152,17 @@ Foam::ThermoCloud<CloudType>::ThermoCloud
         false
     ),
     thermoCloud(),
-    cloudCopyPtr_(NULL),
+    cloudCopyPtr_(nullptr),
     constProps_(this->particleProperties()),
     thermo_(thermo),
     T_(thermo.thermo().T()),
     p_(thermo.thermo().p()),
-    heatTransferModel_(NULL),
-    TIntegrator_(NULL),
+    heatTransferModel_(nullptr),
+    TIntegrator_(nullptr),
     radiation_(false),
-    radAreaP_(NULL),
-    radT4_(NULL),
-    radAreaPT4_(NULL),
+    radAreaP_(nullptr),
+    radT4_(nullptr),
+    radAreaPT4_(nullptr),
     hsTrans_
     (
         new volScalarField::Internal
@@ -222,7 +222,7 @@ Foam::ThermoCloud<CloudType>::ThermoCloud
 :
     CloudType(c, name),
     thermoCloud(),
-    cloudCopyPtr_(NULL),
+    cloudCopyPtr_(nullptr),
     constProps_(c.constProps_),
     thermo_(c.thermo_),
     T_(c.T()),
@@ -230,9 +230,9 @@ Foam::ThermoCloud<CloudType>::ThermoCloud
     heatTransferModel_(c.heatTransferModel_->clone()),
     TIntegrator_(c.TIntegrator_->clone()),
     radiation_(c.radiation_),
-    radAreaP_(NULL),
-    radT4_(NULL),
-    radAreaPT4_(NULL),
+    radAreaP_(nullptr),
+    radT4_(nullptr),
+    radAreaPT4_(nullptr),
     hsTrans_
     (
         new volScalarField::Internal
@@ -332,19 +332,19 @@ Foam::ThermoCloud<CloudType>::ThermoCloud
 :
     CloudType(mesh, name, c),
     thermoCloud(),
-    cloudCopyPtr_(NULL),
+    cloudCopyPtr_(nullptr),
     constProps_(),
     thermo_(c.thermo()),
     T_(c.T()),
     p_(c.p()),
-    heatTransferModel_(NULL),
-    TIntegrator_(NULL),
+    heatTransferModel_(nullptr),
+    TIntegrator_(nullptr),
     radiation_(false),
-    radAreaP_(NULL),
-    radT4_(NULL),
-    radAreaPT4_(NULL),
-    hsTrans_(NULL),
-    hsCoeff_(NULL)
+    radAreaP_(nullptr),
+    radT4_(nullptr),
+    radAreaPT4_(nullptr),
+    hsTrans_(nullptr),
+    hsCoeff_(nullptr)
 {}
 
 
diff --git a/src/lagrangian/intermediate/parcels/Templates/ThermoParcel/ThermoParcelTrackingDataI.H b/src/lagrangian/intermediate/parcels/Templates/ThermoParcel/ThermoParcelTrackingDataI.H
index 22d7ccf85a3..76b36470d77 100644
--- a/src/lagrangian/intermediate/parcels/Templates/ThermoParcel/ThermoParcelTrackingDataI.H
+++ b/src/lagrangian/intermediate/parcels/Templates/ThermoParcel/ThermoParcelTrackingDataI.H
@@ -2,7 +2,7 @@
   =========                 |
   \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox
    \\    /   O peration     |
-    \\  /    A nd           | Copyright (C) 2011-2015 OpenFOAM Foundation
+    \\  /    A nd           | Copyright (C) 2011-2016 OpenFOAM Foundation
      \\/     M anipulation  |
 -------------------------------------------------------------------------------
 License
@@ -58,7 +58,7 @@ inline Foam::ThermoParcel<ParcelType>::TrackingData<CloudType>::TrackingData
             kappa_
         )
     ),
-    GInterp_(NULL)
+    GInterp_(nullptr)
 {
     if (cloud.radiation())
     {
diff --git a/src/lagrangian/intermediate/submodels/CloudFunctionObjects/ParticleErosion/ParticleErosion.C b/src/lagrangian/intermediate/submodels/CloudFunctionObjects/ParticleErosion/ParticleErosion.C
index 8255e894281..00393be1884 100644
--- a/src/lagrangian/intermediate/submodels/CloudFunctionObjects/ParticleErosion/ParticleErosion.C
+++ b/src/lagrangian/intermediate/submodels/CloudFunctionObjects/ParticleErosion/ParticleErosion.C
@@ -71,7 +71,7 @@ Foam::ParticleErosion<CloudType>::ParticleErosion
 )
 :
     CloudFunctionObject<CloudType>(dict, owner, modelName, typeName),
-    QPtr_(NULL),
+    QPtr_(nullptr),
     patchIDs_(),
     p_(readScalar(this->coeffDict().lookup("p"))),
     psi_(this->coeffDict().template lookupOrDefault<scalar>("psi", 2.0)),
@@ -109,7 +109,7 @@ Foam::ParticleErosion<CloudType>::ParticleErosion
 )
 :
     CloudFunctionObject<CloudType>(pe),
-    QPtr_(NULL),
+    QPtr_(nullptr),
     patchIDs_(pe.patchIDs_),
     p_(pe.p_),
     psi_(pe.psi_),
diff --git a/src/lagrangian/intermediate/submodels/CloudFunctionObjects/ParticleTracks/ParticleTracks.C b/src/lagrangian/intermediate/submodels/CloudFunctionObjects/ParticleTracks/ParticleTracks.C
index 14ac5b13668..b9a692fbf69 100644
--- a/src/lagrangian/intermediate/submodels/CloudFunctionObjects/ParticleTracks/ParticleTracks.C
+++ b/src/lagrangian/intermediate/submodels/CloudFunctionObjects/ParticleTracks/ParticleTracks.C
@@ -67,7 +67,7 @@ Foam::ParticleTracks<CloudType>::ParticleTracks
     maxSamples_(readLabel(this->coeffDict().lookup("maxSamples"))),
     resetOnWrite_(this->coeffDict().lookup("resetOnWrite")),
     faceHitCounter_(),
-    cloudPtr_(NULL)
+    cloudPtr_(nullptr)
 {}
 
 
diff --git a/src/lagrangian/intermediate/submodels/CloudFunctionObjects/ParticleTrap/ParticleTrap.C b/src/lagrangian/intermediate/submodels/CloudFunctionObjects/ParticleTrap/ParticleTrap.C
index ad03f5ace1b..a0b95127fde 100644
--- a/src/lagrangian/intermediate/submodels/CloudFunctionObjects/ParticleTrap/ParticleTrap.C
+++ b/src/lagrangian/intermediate/submodels/CloudFunctionObjects/ParticleTrap/ParticleTrap.C
@@ -41,8 +41,8 @@ Foam::ParticleTrap<CloudType>::ParticleTrap
     (
         this->coeffDict().template lookupOrDefault<word>("alpha", "alpha")
     ),
-    alphaPtr_(NULL),
-    gradAlphaPtr_(NULL),
+    alphaPtr_(nullptr),
+    gradAlphaPtr_(nullptr),
     threshold_(readScalar(this->coeffDict().lookup("threshold")))
 {}
 
@@ -56,7 +56,7 @@ Foam::ParticleTrap<CloudType>::ParticleTrap
     CloudFunctionObject<CloudType>(pt),
     alphaName_(pt.alphaName_),
     alphaPtr_(pt.alphaPtr_),
-    gradAlphaPtr_(NULL),
+    gradAlphaPtr_(nullptr),
     threshold_(pt.threshold_)
 {}
 
@@ -73,7 +73,7 @@ Foam::ParticleTrap<CloudType>::~ParticleTrap()
 template<class CloudType>
 void Foam::ParticleTrap<CloudType>::preEvolve()
 {
-    if (alphaPtr_ == NULL)
+    if (alphaPtr_ == nullptr)
     {
         const fvMesh& mesh = this->owner().mesh();
         const volScalarField& alpha =
diff --git a/src/lagrangian/intermediate/submodels/CloudFunctionObjects/VoidFraction/VoidFraction.C b/src/lagrangian/intermediate/submodels/CloudFunctionObjects/VoidFraction/VoidFraction.C
index dcc5129cfd9..a8fb05fac24 100644
--- a/src/lagrangian/intermediate/submodels/CloudFunctionObjects/VoidFraction/VoidFraction.C
+++ b/src/lagrangian/intermediate/submodels/CloudFunctionObjects/VoidFraction/VoidFraction.C
@@ -53,7 +53,7 @@ Foam::VoidFraction<CloudType>::VoidFraction
 )
 :
     CloudFunctionObject<CloudType>(dict, owner, modelName, typeName),
-    thetaPtr_(NULL)
+    thetaPtr_(nullptr)
 {}
 
 
@@ -64,7 +64,7 @@ Foam::VoidFraction<CloudType>::VoidFraction
 )
 :
     CloudFunctionObject<CloudType>(vf),
-    thetaPtr_(NULL)
+    thetaPtr_(nullptr)
 {}
 
 
diff --git a/src/lagrangian/intermediate/submodels/Kinematic/CollisionModel/PairCollision/PairCollision.C b/src/lagrangian/intermediate/submodels/Kinematic/CollisionModel/PairCollision/PairCollision.C
index c577013802b..5c0087e52f5 100644
--- a/src/lagrangian/intermediate/submodels/Kinematic/CollisionModel/PairCollision/PairCollision.C
+++ b/src/lagrangian/intermediate/submodels/Kinematic/CollisionModel/PairCollision/PairCollision.C
@@ -77,8 +77,8 @@ void Foam::PairCollision<CloudType>::realRealInteraction()
     // Direct interaction list (dil)
     const labelListList& dil = il_.dil();
 
-    typename CloudType::parcelType* pA_ptr = NULL;
-    typename CloudType::parcelType* pB_ptr = NULL;
+    typename CloudType::parcelType* pA_ptr = nullptr;
+    typename CloudType::parcelType* pB_ptr = nullptr;
 
     List<DynamicList<typename CloudType::parcelType*>>& cellOccupancy =
         this->owner().cellOccupancy();
@@ -603,8 +603,8 @@ Foam::PairCollision<CloudType>::PairCollision
 )
 :
     CollisionModel<CloudType>(cm),
-    pairModel_(NULL),
-    wallModel_(NULL),
+    pairModel_(nullptr),
+    wallModel_(nullptr),
     il_(cm.owner().mesh())
 {
     // Need to clone to PairModel and WallModel
diff --git a/src/lagrangian/intermediate/submodels/Kinematic/InjectionModel/InflationInjection/InflationInjection.C b/src/lagrangian/intermediate/submodels/Kinematic/InjectionModel/InflationInjection/InflationInjection.C
index 2d6030b3059..8951c6c6536 100644
--- a/src/lagrangian/intermediate/submodels/Kinematic/InjectionModel/InflationInjection/InflationInjection.C
+++ b/src/lagrangian/intermediate/submodels/Kinematic/InjectionModel/InflationInjection/InflationInjection.C
@@ -189,7 +189,7 @@ Foam::label Foam::InflationInjection<CloudType>::parcelsToInject
     {
         label cI = inflationCells_[iCI];
 
-        typename CloudType::parcelType* pPtr = NULL;
+        typename CloudType::parcelType* pPtr = nullptr;
 
         forAll(cellOccupancy[cI], cPI)
         {
@@ -281,10 +281,10 @@ Foam::label Foam::InflationInjection<CloudType>::parcelsToInject
             label cPI = rnd.position(label(0), cellOccupancy[cI].size() - 1);
 
             // This has to be a reference to the pointer so that it
-            // can be set to NULL when the particle is deleted.
+            // can be set to nullptr when the particle is deleted.
             typename CloudType::parcelType*& pPtr = cellOccupancy[cI][cPI];
 
-            if (pPtr != NULL)
+            if (pPtr != nullptr)
             {
                 scalar pD = pPtr->d();
 
@@ -378,7 +378,7 @@ Foam::label Foam::InflationInjection<CloudType>::parcelsToInject
 
                 this->owner().deleteParticle(*pPtr);
 
-                pPtr = NULL;
+                pPtr = nullptr;
             }
         }
 
diff --git a/src/lagrangian/intermediate/submodels/Kinematic/ParticleForces/Lift/LiftForce/LiftForce.C b/src/lagrangian/intermediate/submodels/Kinematic/ParticleForces/Lift/LiftForce/LiftForce.C
index 5ffcb390a02..c9c7fbc0b5a 100644
--- a/src/lagrangian/intermediate/submodels/Kinematic/ParticleForces/Lift/LiftForce/LiftForce.C
+++ b/src/lagrangian/intermediate/submodels/Kinematic/ParticleForces/Lift/LiftForce/LiftForce.C
@@ -55,7 +55,7 @@ Foam::LiftForce<CloudType>::LiftForce
 :
     ParticleForce<CloudType>(owner, mesh, dict, forceType, true),
     UName_(this->coeffs().template lookupOrDefault<word>("U", "U")),
-    curlUcInterpPtr_(NULL)
+    curlUcInterpPtr_(nullptr)
 {}
 
 
@@ -64,7 +64,7 @@ Foam::LiftForce<CloudType>::LiftForce(const LiftForce& lf)
 :
     ParticleForce<CloudType>(lf),
     UName_(lf.UName_),
-    curlUcInterpPtr_(NULL)
+    curlUcInterpPtr_(nullptr)
 {}
 
 
diff --git a/src/lagrangian/intermediate/submodels/Kinematic/ParticleForces/Paramagnetic/ParamagneticForce.C b/src/lagrangian/intermediate/submodels/Kinematic/ParticleForces/Paramagnetic/ParamagneticForce.C
index 00737cc110b..8426d371403 100644
--- a/src/lagrangian/intermediate/submodels/Kinematic/ParticleForces/Paramagnetic/ParamagneticForce.C
+++ b/src/lagrangian/intermediate/submodels/Kinematic/ParticleForces/Paramagnetic/ParamagneticForce.C
@@ -42,7 +42,7 @@ Foam::ParamagneticForce<CloudType>::ParamagneticForce
     (
         this->coeffs().template lookupOrDefault<word>("HdotGradH", "HdotGradH")
     ),
-    HdotGradHInterpPtr_(NULL),
+    HdotGradHInterpPtr_(nullptr),
     magneticSusceptibility_
     (
         readScalar(this->coeffs().lookup("magneticSusceptibility"))
diff --git a/src/lagrangian/intermediate/submodels/Kinematic/ParticleForces/PressureGradient/PressureGradientForce.C b/src/lagrangian/intermediate/submodels/Kinematic/ParticleForces/PressureGradient/PressureGradientForce.C
index eac19829f07..e0d6518fba7 100644
--- a/src/lagrangian/intermediate/submodels/Kinematic/ParticleForces/PressureGradient/PressureGradientForce.C
+++ b/src/lagrangian/intermediate/submodels/Kinematic/ParticleForces/PressureGradient/PressureGradientForce.C
@@ -40,7 +40,7 @@ Foam::PressureGradientForce<CloudType>::PressureGradientForce
 :
     ParticleForce<CloudType>(owner, mesh, dict, forceType, true),
     UName_(this->coeffs().template lookupOrDefault<word>("U", "U")),
-    DUcDtInterpPtr_(NULL)
+    DUcDtInterpPtr_(nullptr)
 {}
 
 
@@ -52,7 +52,7 @@ Foam::PressureGradientForce<CloudType>::PressureGradientForce
 :
     ParticleForce<CloudType>(pgf),
     UName_(pgf.UName_),
-    DUcDtInterpPtr_(NULL)
+    DUcDtInterpPtr_(nullptr)
 {}
 
 
diff --git a/src/lagrangian/intermediate/submodels/Kinematic/ParticleForces/SRF/SRFForce.C b/src/lagrangian/intermediate/submodels/Kinematic/ParticleForces/SRF/SRFForce.C
index 82fdca98e10..08f065539e9 100644
--- a/src/lagrangian/intermediate/submodels/Kinematic/ParticleForces/SRF/SRFForce.C
+++ b/src/lagrangian/intermediate/submodels/Kinematic/ParticleForces/SRF/SRFForce.C
@@ -36,7 +36,7 @@ Foam::SRFForce<CloudType>::SRFForce
 )
 :
     ParticleForce<CloudType>(owner, mesh, dict, typeName, false),
-    srfPtr_(NULL)
+    srfPtr_(nullptr)
 {}
 
 
@@ -47,7 +47,7 @@ Foam::SRFForce<CloudType>::SRFForce
 )
 :
     ParticleForce<CloudType>(srff),
-    srfPtr_(NULL)
+    srfPtr_(nullptr)
 {}
 
 
@@ -71,7 +71,7 @@ void Foam::SRFForce<CloudType>::cacheFields(const bool store)
     }
     else
     {
-        srfPtr_ = NULL;
+        srfPtr_ = nullptr;
     }
 }
 
diff --git a/src/lagrangian/intermediate/submodels/Kinematic/PatchInteractionModel/LocalInteraction/LocalInteraction.C b/src/lagrangian/intermediate/submodels/Kinematic/PatchInteractionModel/LocalInteraction/LocalInteraction.C
index 4265100e74f..42a47f4d45a 100644
--- a/src/lagrangian/intermediate/submodels/Kinematic/PatchInteractionModel/LocalInteraction/LocalInteraction.C
+++ b/src/lagrangian/intermediate/submodels/Kinematic/PatchInteractionModel/LocalInteraction/LocalInteraction.C
@@ -41,8 +41,8 @@ Foam::LocalInteraction<CloudType>::LocalInteraction
     nStick_(patchData_.size(), 0),
     massStick_(patchData_.size(), 0.0),
     writeFields_(this->coeffDict().lookupOrDefault("writeFields", false)),
-    massEscapePtr_(NULL),
-    massStickPtr_(NULL)
+    massEscapePtr_(nullptr),
+    massStickPtr_(nullptr)
 {
     if (writeFields_)
     {
@@ -94,8 +94,8 @@ Foam::LocalInteraction<CloudType>::LocalInteraction
     nStick_(pim.nStick_),
     massStick_(pim.massStick_),
     writeFields_(pim.writeFields_),
-    massEscapePtr_(NULL),
-    massStickPtr_(NULL)
+    massEscapePtr_(nullptr),
+    massStickPtr_(nullptr)
 {}
 
 
diff --git a/src/lagrangian/intermediate/submodels/MPPIC/DampingModels/DampingModel/DampingModel.C b/src/lagrangian/intermediate/submodels/MPPIC/DampingModels/DampingModel/DampingModel.C
index d823496d7ef..3c33ee10844 100644
--- a/src/lagrangian/intermediate/submodels/MPPIC/DampingModels/DampingModel/DampingModel.C
+++ b/src/lagrangian/intermediate/submodels/MPPIC/DampingModels/DampingModel/DampingModel.C
@@ -32,7 +32,7 @@ template<class CloudType>
 Foam::DampingModel<CloudType>::DampingModel(CloudType& owner)
 :
     CloudSubModelBase<CloudType>(owner),
-    timeScaleModel_(NULL)
+    timeScaleModel_(nullptr)
 {}
 
 
diff --git a/src/lagrangian/intermediate/submodels/MPPIC/DampingModels/Relaxation/Relaxation.C b/src/lagrangian/intermediate/submodels/MPPIC/DampingModels/Relaxation/Relaxation.C
index 3e37bb61ad1..d9f58b3b231 100644
--- a/src/lagrangian/intermediate/submodels/MPPIC/DampingModels/Relaxation/Relaxation.C
+++ b/src/lagrangian/intermediate/submodels/MPPIC/DampingModels/Relaxation/Relaxation.C
@@ -35,8 +35,8 @@ Foam::DampingModels::Relaxation<CloudType>::Relaxation
 )
 :
     DampingModel<CloudType>(dict, owner, typeName),
-    uAverage_(NULL),
-    oneByTimeScaleAverage_(NULL)
+    uAverage_(nullptr),
+    oneByTimeScaleAverage_(nullptr)
 {}
 
 
@@ -47,7 +47,7 @@ Foam::DampingModels::Relaxation<CloudType>::Relaxation
 )
 :
     DampingModel<CloudType>(cm),
-    uAverage_(NULL),
+    uAverage_(nullptr),
     oneByTimeScaleAverage_(cm.oneByTimeScaleAverage_->clone())
 {}
 
@@ -126,7 +126,7 @@ void Foam::DampingModels::Relaxation<CloudType>::cacheFields(const bool store)
     }
     else
     {
-        uAverage_ = NULL;
+        uAverage_ = nullptr;
         oneByTimeScaleAverage_.clear();
     }
 }
diff --git a/src/lagrangian/intermediate/submodels/MPPIC/IsotropyModels/IsotropyModel/IsotropyModel.C b/src/lagrangian/intermediate/submodels/MPPIC/IsotropyModels/IsotropyModel/IsotropyModel.C
index 50cad5b9dcb..d11cfb7a134 100644
--- a/src/lagrangian/intermediate/submodels/MPPIC/IsotropyModels/IsotropyModel/IsotropyModel.C
+++ b/src/lagrangian/intermediate/submodels/MPPIC/IsotropyModels/IsotropyModel/IsotropyModel.C
@@ -33,7 +33,7 @@ template<class CloudType>
 Foam::IsotropyModel<CloudType>::IsotropyModel(CloudType& owner)
 :
     CloudSubModelBase<CloudType>(owner),
-    timeScaleModel_(NULL)
+    timeScaleModel_(nullptr)
 {}
 
 
diff --git a/src/lagrangian/intermediate/submodels/MPPIC/PackingModels/Explicit/Explicit.C b/src/lagrangian/intermediate/submodels/MPPIC/PackingModels/Explicit/Explicit.C
index f4d5d0fa582..d11e55e35df 100644
--- a/src/lagrangian/intermediate/submodels/MPPIC/PackingModels/Explicit/Explicit.C
+++ b/src/lagrangian/intermediate/submodels/MPPIC/PackingModels/Explicit/Explicit.C
@@ -35,7 +35,7 @@ Foam::PackingModels::Explicit<CloudType>::Explicit
 )
 :
     PackingModel<CloudType>(dict, owner, typeName),
-    stressAverage_(NULL),
+    stressAverage_(nullptr),
     correctionLimiting_
     (
         CorrectionLimitingMethod::New
@@ -129,8 +129,8 @@ void Foam::PackingModels::Explicit<CloudType>::cacheFields(const bool store)
     }
     else
     {
-        volumeAverage_ = NULL;
-        uAverage_ = NULL;
+        volumeAverage_ = nullptr;
+        uAverage_ = nullptr;
         stressAverage_.clear();
     }
 }
diff --git a/src/lagrangian/intermediate/submodels/MPPIC/PackingModels/Implicit/Implicit.C b/src/lagrangian/intermediate/submodels/MPPIC/PackingModels/Implicit/Implicit.C
index ce800c22c34..9f8cb4ef0c2 100644
--- a/src/lagrangian/intermediate/submodels/MPPIC/PackingModels/Implicit/Implicit.C
+++ b/src/lagrangian/intermediate/submodels/MPPIC/PackingModels/Implicit/Implicit.C
@@ -56,8 +56,8 @@ Foam::PackingModels::Implicit<CloudType>::Implicit
         dimensionedScalar("zero", dimless, 0.0),
         zeroGradientFvPatchScalarField::typeName
     ),
-    phiCorrect_(NULL),
-    uCorrect_(NULL),
+    phiCorrect_(nullptr),
+    uCorrect_(nullptr),
     applyLimiting_(this->coeffDict().lookup("applyLimiting")),
     applyGravity_(this->coeffDict().lookup("applyGravity")),
     alphaMin_(readScalar(this->coeffDict().lookup("alphaMin"))),
diff --git a/src/lagrangian/intermediate/submodels/MPPIC/PackingModels/PackingModel/PackingModel.C b/src/lagrangian/intermediate/submodels/MPPIC/PackingModels/PackingModel/PackingModel.C
index e412380d638..38187b8e3a6 100644
--- a/src/lagrangian/intermediate/submodels/MPPIC/PackingModels/PackingModel/PackingModel.C
+++ b/src/lagrangian/intermediate/submodels/MPPIC/PackingModels/PackingModel/PackingModel.C
@@ -34,7 +34,7 @@ template<class CloudType>
 Foam::PackingModel<CloudType>::PackingModel(CloudType& owner)
 :
     CloudSubModelBase<CloudType>(owner),
-    particleStressModel_(NULL)
+    particleStressModel_(nullptr)
 {}
 
 
diff --git a/src/lagrangian/intermediate/submodels/MPPIC/ParticleStressModels/Lun/Lun.C b/src/lagrangian/intermediate/submodels/MPPIC/ParticleStressModels/Lun/Lun.C
index 038d11284d2..2c1c04c456e 100644
--- a/src/lagrangian/intermediate/submodels/MPPIC/ParticleStressModels/Lun/Lun.C
+++ b/src/lagrangian/intermediate/submodels/MPPIC/ParticleStressModels/Lun/Lun.C
@@ -110,7 +110,7 @@ Foam::ParticleStressModels::Lun::dTaudTheta
 {
     NotImplemented;
 
-    return tmp<Field<scalar>>(NULL);
+    return tmp<Field<scalar>>(nullptr);
 }
 
 
diff --git a/src/lagrangian/molecularDynamics/molecule/moleculeCloud/moleculeCloud.C b/src/lagrangian/molecularDynamics/molecule/moleculeCloud/moleculeCloud.C
index 0ec0ec4727d..761dfc8d945 100644
--- a/src/lagrangian/molecularDynamics/molecule/moleculeCloud/moleculeCloud.C
+++ b/src/lagrangian/molecularDynamics/molecule/moleculeCloud/moleculeCloud.C
@@ -133,8 +133,8 @@ void Foam::moleculeCloud::calculatePairForce()
     label startOfRequests = Pstream::nRequests();
     il_.sendReferredData(cellOccupancy(), pBufs);
 
-    molecule* molI = NULL;
-    molecule* molJ = NULL;
+    molecule* molI = nullptr;
+    molecule* molJ = nullptr;
 
     {
         // Real-Real interactions
@@ -268,8 +268,8 @@ void Foam::moleculeCloud::removeHighEnergyOverlaps()
 
     // Real-Real interaction
 
-    molecule* molI = NULL;
-    molecule* molJ = NULL;
+    molecule* molI = nullptr;
+    molecule* molJ = nullptr;
 
     {
         DynamicList<molecule*> molsToDelete;
diff --git a/src/lagrangian/molecularDynamics/potential/pairPotential/basic/pairPotential.C b/src/lagrangian/molecularDynamics/potential/pairPotential/basic/pairPotential.C
index c2adf842213..8c3f8fa448f 100644
--- a/src/lagrangian/molecularDynamics/potential/pairPotential/basic/pairPotential.C
+++ b/src/lagrangian/molecularDynamics/potential/pairPotential/basic/pairPotential.C
@@ -68,7 +68,7 @@ Foam::pairPotential::pairPotential
     dr_(readScalar(pairPotentialProperties_.lookup("dr"))),
     forceLookup_(0),
     energyLookup_(0),
-    esfPtr_(NULL),
+    esfPtr_(nullptr),
     writeTables_(Switch(pairPotentialProperties_.lookup("writeTables")))
 {}
 
diff --git a/src/lagrangian/spray/clouds/Templates/SprayCloud/SprayCloud.C b/src/lagrangian/spray/clouds/Templates/SprayCloud/SprayCloud.C
index b6542dc3a78..d5684374f92 100644
--- a/src/lagrangian/spray/clouds/Templates/SprayCloud/SprayCloud.C
+++ b/src/lagrangian/spray/clouds/Templates/SprayCloud/SprayCloud.C
@@ -80,10 +80,10 @@ Foam::SprayCloud<CloudType>::SprayCloud
 :
     CloudType(cloudName, rho, U, g, thermo, false),
     sprayCloud(),
-    cloudCopyPtr_(NULL),
+    cloudCopyPtr_(nullptr),
     averageParcelMass_(0.0),
-    atomizationModel_(NULL),
-    breakupModel_(NULL)
+    atomizationModel_(nullptr),
+    breakupModel_(nullptr)
 {
     if (this->solution().active())
     {
@@ -115,7 +115,7 @@ Foam::SprayCloud<CloudType>::SprayCloud
 :
     CloudType(c, name),
     sprayCloud(),
-    cloudCopyPtr_(NULL),
+    cloudCopyPtr_(nullptr),
     averageParcelMass_(c.averageParcelMass_),
     atomizationModel_(c.atomizationModel_->clone()),
     breakupModel_(c.breakupModel_->clone())
@@ -132,10 +132,10 @@ Foam::SprayCloud<CloudType>::SprayCloud
 :
     CloudType(mesh, name, c),
     sprayCloud(),
-    cloudCopyPtr_(NULL),
+    cloudCopyPtr_(nullptr),
     averageParcelMass_(0.0),
-    atomizationModel_(NULL),
-    breakupModel_(NULL)
+    atomizationModel_(nullptr),
+    breakupModel_(nullptr)
 {}
 
 
diff --git a/src/lagrangian/turbulence/submodels/Kinematic/DispersionModel/DispersionRASModel/DispersionRASModel.C b/src/lagrangian/turbulence/submodels/Kinematic/DispersionModel/DispersionRASModel/DispersionRASModel.C
index cccba17a2c0..1ed66474989 100644
--- a/src/lagrangian/turbulence/submodels/Kinematic/DispersionModel/DispersionRASModel/DispersionRASModel.C
+++ b/src/lagrangian/turbulence/submodels/Kinematic/DispersionModel/DispersionRASModel/DispersionRASModel.C
@@ -54,7 +54,7 @@ Foam::DispersionRASModel<CloudType>::kModel() const
             << "Database objects include: " << obr.sortedToc()
             << abort(FatalError);
 
-        return tmp<volScalarField>(NULL);
+        return tmp<volScalarField>(nullptr);
     }
 }
 
@@ -84,7 +84,7 @@ Foam::DispersionRASModel<CloudType>::epsilonModel() const
             << "Database objects include: " << obr.sortedToc()
             << abort(FatalError);
 
-        return tmp<volScalarField>(NULL);
+        return tmp<volScalarField>(nullptr);
     }
 }
 
@@ -99,9 +99,9 @@ Foam::DispersionRASModel<CloudType>::DispersionRASModel
 )
 :
     DispersionModel<CloudType>(owner),
-    kPtr_(NULL),
+    kPtr_(nullptr),
     ownK_(false),
-    epsilonPtr_(NULL),
+    epsilonPtr_(nullptr),
     ownEpsilon_(false)
 {}
 
diff --git a/src/lagrangian/turbulence/submodels/Kinematic/DispersionModel/GradientDispersionRAS/GradientDispersionRAS.C b/src/lagrangian/turbulence/submodels/Kinematic/DispersionModel/GradientDispersionRAS/GradientDispersionRAS.C
index 1dc9ab7a1fb..ef93f6a3cfc 100644
--- a/src/lagrangian/turbulence/submodels/Kinematic/DispersionModel/GradientDispersionRAS/GradientDispersionRAS.C
+++ b/src/lagrangian/turbulence/submodels/Kinematic/DispersionModel/GradientDispersionRAS/GradientDispersionRAS.C
@@ -37,7 +37,7 @@ Foam::GradientDispersionRAS<CloudType>::GradientDispersionRAS
 )
 :
     DispersionRASModel<CloudType>(dict, owner),
-    gradkPtr_(NULL),
+    gradkPtr_(nullptr),
     ownGradK_(false)
 {}
 
@@ -82,7 +82,7 @@ void Foam::GradientDispersionRAS<CloudType>::cacheFields(const bool store)
         if (ownGradK_)
         {
             deleteDemandDrivenData(gradkPtr_);
-            gradkPtr_ = NULL;
+            gradkPtr_ = nullptr;
             ownGradK_ = false;
         }
     }
diff --git a/src/lagrangian/turbulence/submodels/Thermodynamic/ParticleForces/BrownianMotion/BrownianMotionForce.C b/src/lagrangian/turbulence/submodels/Thermodynamic/ParticleForces/BrownianMotion/BrownianMotionForce.C
index 313cbf0b171..a2228fa5e35 100644
--- a/src/lagrangian/turbulence/submodels/Thermodynamic/ParticleForces/BrownianMotion/BrownianMotionForce.C
+++ b/src/lagrangian/turbulence/submodels/Thermodynamic/ParticleForces/BrownianMotion/BrownianMotionForce.C
@@ -77,7 +77,7 @@ Foam::BrownianMotionForce<CloudType>::kModel() const
             << "Database objects include: " << obr.sortedToc()
             << abort(FatalError);
 
-        return tmp<volScalarField>(NULL);
+        return tmp<volScalarField>(nullptr);
     }
 }
 
@@ -96,7 +96,7 @@ Foam::BrownianMotionForce<CloudType>::BrownianMotionForce
     rndGen_(owner.rndGen()),
     lambda_(readScalar(this->coeffs().lookup("lambda"))),
     turbulence_(readBool(this->coeffs().lookup("turbulence"))),
-    kPtr_(NULL),
+    kPtr_(nullptr),
     ownK_(false)
 {}
 
@@ -111,7 +111,7 @@ Foam::BrownianMotionForce<CloudType>::BrownianMotionForce
     rndGen_(bmf.rndGen_),
     lambda_(bmf.lambda_),
     turbulence_(bmf.turbulence_),
-    kPtr_(NULL),
+    kPtr_(nullptr),
     ownK_(false)
 {}
 
diff --git a/src/mesh/blockMesh/block/block.H b/src/mesh/blockMesh/block/block.H
index ee88f8c9a32..3e47a80a6fb 100644
--- a/src/mesh/blockMesh/block/block.H
+++ b/src/mesh/blockMesh/block/block.H
@@ -2,7 +2,7 @@
   =========                 |
   \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox
    \\    /   O peration     |
-    \\  /    A nd           | Copyright (C) 2011-2015 OpenFOAM Foundation
+    \\  /    A nd           | Copyright (C) 2011-2016 OpenFOAM Foundation
      \\/     M anipulation  |
 -------------------------------------------------------------------------------
 License
@@ -113,7 +113,7 @@ public:
         autoPtr<block> clone() const
         {
             NotImplemented;
-            return autoPtr<block>(NULL);
+            return autoPtr<block>(nullptr);
         }
 
 
diff --git a/src/mesh/blockMesh/blockDescriptor/blockDescriptor.H b/src/mesh/blockMesh/blockDescriptor/blockDescriptor.H
index a1e6e607985..c245eefccc9 100644
--- a/src/mesh/blockMesh/blockDescriptor/blockDescriptor.H
+++ b/src/mesh/blockMesh/blockDescriptor/blockDescriptor.H
@@ -130,7 +130,7 @@ public:
         autoPtr<blockDescriptor> clone() const
         {
             NotImplemented;
-            return autoPtr<blockDescriptor>(NULL);
+            return autoPtr<blockDescriptor>(nullptr);
         }
 
 
diff --git a/src/mesh/blockMesh/blockMesh/blockMeshTopology.C b/src/mesh/blockMesh/blockMesh/blockMeshTopology.C
index 54fbdc75c69..c0223efe717 100644
--- a/src/mesh/blockMesh/blockMesh/blockMeshTopology.C
+++ b/src/mesh/blockMesh/blockMesh/blockMeshTopology.C
@@ -429,7 +429,7 @@ Foam::polyMesh* Foam::blockMesh::createTopology
     }
 
 
-    polyMesh* blockMeshPtr = NULL;
+    polyMesh* blockMeshPtr = nullptr;
 
     //
     // Create the patches
diff --git a/src/mesh/blockMesh/curvedEdges/curvedEdge.C b/src/mesh/blockMesh/curvedEdges/curvedEdge.C
index b3816b016c3..02bfb6e5e1b 100644
--- a/src/mesh/blockMesh/curvedEdges/curvedEdge.C
+++ b/src/mesh/blockMesh/curvedEdges/curvedEdge.C
@@ -69,7 +69,7 @@ Foam::curvedEdge::curvedEdge(const curvedEdge& c)
 Foam::autoPtr<Foam::curvedEdge> Foam::curvedEdge::clone() const
 {
     NotImplemented;
-    return autoPtr<curvedEdge>(NULL);
+    return autoPtr<curvedEdge>(nullptr);
 }
 
 
diff --git a/src/mesh/snappyHexMesh/refinementSurfaces/refinementSurfaces.C b/src/mesh/snappyHexMesh/refinementSurfaces/refinementSurfaces.C
index 4515e690256..b2a7172e02e 100644
--- a/src/mesh/snappyHexMesh/refinementSurfaces/refinementSurfaces.C
+++ b/src/mesh/snappyHexMesh/refinementSurfaces/refinementSurfaces.C
@@ -329,7 +329,7 @@ Foam::refinementSurfaces::refinementSurfaces
     {
         if (patchInfo.set(pI))
         {
-            patchInfo_.set(pI, patchInfo.set(pI, NULL));
+            patchInfo_.set(pI, patchInfo.set(pI, nullptr));
         }
     }
 }
diff --git a/src/meshTools/AMIInterpolation/AMIInterpolation/AMIInterpolation.C b/src/meshTools/AMIInterpolation/AMIInterpolation/AMIInterpolation.C
index 0ebee5390d2..03f9bab1f0b 100644
--- a/src/meshTools/AMIInterpolation/AMIInterpolation/AMIInterpolation.C
+++ b/src/meshTools/AMIInterpolation/AMIInterpolation/AMIInterpolation.C
@@ -607,8 +607,8 @@ Foam::AMIInterpolation<SourcePatch, TargetPatch>::AMIInterpolation
     tgtWeights_(),
     tgtWeightsSum_(),
     triMode_(triMode),
-    srcMapPtr_(NULL),
-    tgtMapPtr_(NULL)
+    srcMapPtr_(nullptr),
+    tgtMapPtr_(nullptr)
 {
     update(srcPatch, tgtPatch);
 }
@@ -638,8 +638,8 @@ Foam::AMIInterpolation<SourcePatch, TargetPatch>::AMIInterpolation
     tgtWeights_(),
     tgtWeightsSum_(),
     triMode_(triMode),
-    srcMapPtr_(NULL),
-    tgtMapPtr_(NULL)
+    srcMapPtr_(nullptr),
+    tgtMapPtr_(nullptr)
 {
     update(srcPatch, tgtPatch);
 }
@@ -670,8 +670,8 @@ Foam::AMIInterpolation<SourcePatch, TargetPatch>::AMIInterpolation
     tgtWeights_(),
     tgtWeightsSum_(),
     triMode_(triMode),
-    srcMapPtr_(NULL),
-    tgtMapPtr_(NULL)
+    srcMapPtr_(nullptr),
+    tgtMapPtr_(nullptr)
 {
     constructFromSurface(srcPatch, tgtPatch, surfPtr);
 }
@@ -702,8 +702,8 @@ Foam::AMIInterpolation<SourcePatch, TargetPatch>::AMIInterpolation
     tgtWeights_(),
     tgtWeightsSum_(),
     triMode_(triMode),
-    srcMapPtr_(NULL),
-    tgtMapPtr_(NULL)
+    srcMapPtr_(nullptr),
+    tgtMapPtr_(nullptr)
 {
     constructFromSurface(srcPatch, tgtPatch, surfPtr);
 }
@@ -729,8 +729,8 @@ Foam::AMIInterpolation<SourcePatch, TargetPatch>::AMIInterpolation
     tgtWeights_(),
     tgtWeightsSum_(),
     triMode_(fineAMI.triMode_),
-    srcMapPtr_(NULL),
-    tgtMapPtr_(NULL)
+    srcMapPtr_(nullptr),
+    tgtMapPtr_(nullptr)
 {
     label sourceCoarseSize =
     (
diff --git a/src/meshTools/AMIInterpolation/patches/cyclicACMI/cyclicACMIPointPatchField/cyclicACMIPointPatchField.C b/src/meshTools/AMIInterpolation/patches/cyclicACMI/cyclicACMIPointPatchField/cyclicACMIPointPatchField.C
index 897839717d0..cd4eae9048b 100644
--- a/src/meshTools/AMIInterpolation/patches/cyclicACMI/cyclicACMIPointPatchField/cyclicACMIPointPatchField.C
+++ b/src/meshTools/AMIInterpolation/patches/cyclicACMI/cyclicACMIPointPatchField/cyclicACMIPointPatchField.C
@@ -39,8 +39,8 @@ Foam::cyclicACMIPointPatchField<Type>::cyclicACMIPointPatchField
 :
     coupledPointPatchField<Type>(p, iF),
     cyclicACMIPatch_(refCast<const cyclicACMIPointPatch>(p)),
-    ppiPtr_(NULL),
-    nbrPpiPtr_(NULL)
+    ppiPtr_(nullptr),
+    nbrPpiPtr_(nullptr)
 {}
 
 
@@ -54,8 +54,8 @@ Foam::cyclicACMIPointPatchField<Type>::cyclicACMIPointPatchField
 :
     coupledPointPatchField<Type>(p, iF, dict),
     cyclicACMIPatch_(refCast<const cyclicACMIPointPatch>(p)),
-    ppiPtr_(NULL),
-    nbrPpiPtr_(NULL)
+    ppiPtr_(nullptr),
+    nbrPpiPtr_(nullptr)
 {
     if (!isType<cyclicACMIPointPatch>(p))
     {
@@ -80,8 +80,8 @@ Foam::cyclicACMIPointPatchField<Type>::cyclicACMIPointPatchField
 :
     coupledPointPatchField<Type>(ptf, p, iF, mapper),
     cyclicACMIPatch_(refCast<const cyclicACMIPointPatch>(p)),
-    ppiPtr_(NULL),
-    nbrPpiPtr_(NULL)
+    ppiPtr_(nullptr),
+    nbrPpiPtr_(nullptr)
 {
     if (!isType<cyclicACMIPointPatch>(this->patch()))
     {
@@ -104,8 +104,8 @@ Foam::cyclicACMIPointPatchField<Type>::cyclicACMIPointPatchField
 :
     coupledPointPatchField<Type>(ptf, iF),
     cyclicACMIPatch_(ptf.cyclicACMIPatch_),
-    ppiPtr_(NULL),
-    nbrPpiPtr_(NULL)
+    ppiPtr_(nullptr),
+    nbrPpiPtr_(nullptr)
 {}
 
 
diff --git a/src/meshTools/AMIInterpolation/patches/cyclicAMI/cyclicAMIPointPatchField/cyclicAMIPointPatchField.C b/src/meshTools/AMIInterpolation/patches/cyclicAMI/cyclicAMIPointPatchField/cyclicAMIPointPatchField.C
index 8678b33d866..2d2d6c524db 100644
--- a/src/meshTools/AMIInterpolation/patches/cyclicAMI/cyclicAMIPointPatchField/cyclicAMIPointPatchField.C
+++ b/src/meshTools/AMIInterpolation/patches/cyclicAMI/cyclicAMIPointPatchField/cyclicAMIPointPatchField.C
@@ -39,8 +39,8 @@ Foam::cyclicAMIPointPatchField<Type>::cyclicAMIPointPatchField
 :
     coupledPointPatchField<Type>(p, iF),
     cyclicAMIPatch_(refCast<const cyclicAMIPointPatch>(p)),
-    ppiPtr_(NULL),
-    nbrPpiPtr_(NULL)
+    ppiPtr_(nullptr),
+    nbrPpiPtr_(nullptr)
 {}
 
 
@@ -54,8 +54,8 @@ Foam::cyclicAMIPointPatchField<Type>::cyclicAMIPointPatchField
 :
     coupledPointPatchField<Type>(p, iF, dict),
     cyclicAMIPatch_(refCast<const cyclicAMIPointPatch>(p)),
-    ppiPtr_(NULL),
-    nbrPpiPtr_(NULL)
+    ppiPtr_(nullptr),
+    nbrPpiPtr_(nullptr)
 {
     if (!isType<cyclicAMIPointPatch>(p))
     {
@@ -80,8 +80,8 @@ Foam::cyclicAMIPointPatchField<Type>::cyclicAMIPointPatchField
 :
     coupledPointPatchField<Type>(ptf, p, iF, mapper),
     cyclicAMIPatch_(refCast<const cyclicAMIPointPatch>(p)),
-    ppiPtr_(NULL),
-    nbrPpiPtr_(NULL)
+    ppiPtr_(nullptr),
+    nbrPpiPtr_(nullptr)
 {
     if (!isType<cyclicAMIPointPatch>(this->patch()))
     {
@@ -104,8 +104,8 @@ Foam::cyclicAMIPointPatchField<Type>::cyclicAMIPointPatchField
 :
     coupledPointPatchField<Type>(ptf, iF),
     cyclicAMIPatch_(ptf.cyclicAMIPatch_),
-    ppiPtr_(NULL),
-    nbrPpiPtr_(NULL)
+    ppiPtr_(nullptr),
+    nbrPpiPtr_(nullptr)
 {}
 
 
diff --git a/src/meshTools/AMIInterpolation/patches/cyclicAMI/cyclicAMIPolyPatch/cyclicAMIPolyPatch.C b/src/meshTools/AMIInterpolation/patches/cyclicAMI/cyclicAMIPolyPatch/cyclicAMIPolyPatch.C
index 257d4737cb8..b02dbed5098 100644
--- a/src/meshTools/AMIInterpolation/patches/cyclicAMI/cyclicAMIPolyPatch/cyclicAMIPolyPatch.C
+++ b/src/meshTools/AMIInterpolation/patches/cyclicAMI/cyclicAMIPolyPatch/cyclicAMIPolyPatch.C
@@ -490,11 +490,11 @@ Foam::cyclicAMIPolyPatch::cyclicAMIPolyPatch
     rotationAngleDefined_(false),
     rotationAngle_(0.0),
     separationVector_(Zero),
-    AMIPtr_(NULL),
+    AMIPtr_(nullptr),
     AMIReverse_(false),
     AMIRequireMatch_(true),
     AMILowWeightCorrection_(-1.0),
-    surfPtr_(NULL),
+    surfPtr_(nullptr),
     surfDict_(fileName("surface"))
 {
     // Neighbour patch might not be valid yet so no transformation
@@ -520,11 +520,11 @@ Foam::cyclicAMIPolyPatch::cyclicAMIPolyPatch
     rotationAngleDefined_(false),
     rotationAngle_(0.0),
     separationVector_(Zero),
-    AMIPtr_(NULL),
+    AMIPtr_(nullptr),
     AMIReverse_(dict.lookupOrDefault<bool>("flipNormals", false)),
     AMIRequireMatch_(true),
     AMILowWeightCorrection_(dict.lookupOrDefault("lowWeightCorrection", -1.0)),
-    surfPtr_(NULL),
+    surfPtr_(nullptr),
     surfDict_(dict.subOrEmptyDict("surface"))
 {
     if (nbrPatchName_ == word::null && !coupleGroup_.valid())
@@ -609,11 +609,11 @@ Foam::cyclicAMIPolyPatch::cyclicAMIPolyPatch
     rotationAngleDefined_(pp.rotationAngleDefined_),
     rotationAngle_(pp.rotationAngle_),
     separationVector_(pp.separationVector_),
-    AMIPtr_(NULL),
+    AMIPtr_(nullptr),
     AMIReverse_(pp.AMIReverse_),
     AMIRequireMatch_(pp.AMIRequireMatch_),
     AMILowWeightCorrection_(pp.AMILowWeightCorrection_),
-    surfPtr_(NULL),
+    surfPtr_(nullptr),
     surfDict_(pp.surfDict_)
 {
     // Neighbour patch might not be valid yet so no transformation
@@ -640,11 +640,11 @@ Foam::cyclicAMIPolyPatch::cyclicAMIPolyPatch
     rotationAngleDefined_(pp.rotationAngleDefined_),
     rotationAngle_(pp.rotationAngle_),
     separationVector_(pp.separationVector_),
-    AMIPtr_(NULL),
+    AMIPtr_(nullptr),
     AMIReverse_(pp.AMIReverse_),
     AMIRequireMatch_(pp.AMIRequireMatch_),
     AMILowWeightCorrection_(pp.AMILowWeightCorrection_),
-    surfPtr_(NULL),
+    surfPtr_(nullptr),
     surfDict_(pp.surfDict_)
 {
     if (nbrPatchName_ == name())
@@ -678,11 +678,11 @@ Foam::cyclicAMIPolyPatch::cyclicAMIPolyPatch
     rotationAngleDefined_(pp.rotationAngleDefined_),
     rotationAngle_(pp.rotationAngle_),
     separationVector_(pp.separationVector_),
-    AMIPtr_(NULL),
+    AMIPtr_(nullptr),
     AMIReverse_(pp.AMIReverse_),
     AMIRequireMatch_(pp.AMIRequireMatch_),
     AMILowWeightCorrection_(pp.AMILowWeightCorrection_),
-    surfPtr_(NULL),
+    surfPtr_(nullptr),
     surfDict_(pp.surfDict_)
 {}
 
diff --git a/src/meshTools/cellFeatures/cellFeatures.C b/src/meshTools/cellFeatures/cellFeatures.C
index 74ce47a30b7..b49a6b97261 100644
--- a/src/meshTools/cellFeatures/cellFeatures.C
+++ b/src/meshTools/cellFeatures/cellFeatures.C
@@ -383,7 +383,7 @@ Foam::cellFeatures::cellFeatures
     minCos_(minCos),
     celli_(celli),
     featureEdge_(10*mesh.cellEdges()[celli].size()),
-    facesPtr_(NULL),
+    facesPtr_(nullptr),
     faceMap_(0)
 {
     const labelList& cEdges = mesh_.cellEdges()[celli_];
diff --git a/src/meshTools/coordinateSystems/coordinateRotation/EulerCoordinateRotation.C b/src/meshTools/coordinateSystems/coordinateRotation/EulerCoordinateRotation.C
index a0bfb14b8fc..b43d603f6d1 100644
--- a/src/meshTools/coordinateSystems/coordinateRotation/EulerCoordinateRotation.C
+++ b/src/meshTools/coordinateSystems/coordinateRotation/EulerCoordinateRotation.C
@@ -70,7 +70,7 @@ Foam::tmp<Foam::vectorField> Foam::EulerCoordinateRotation::transform
 ) const
 {
     NotImplemented;
-    return tmp<vectorField>(NULL);
+    return tmp<vectorField>(nullptr);
 }
 
 
@@ -80,7 +80,7 @@ Foam::tmp<Foam::vectorField> Foam::EulerCoordinateRotation::invTransform
 ) const
 {
     NotImplemented;
-    return tmp<vectorField>(NULL);
+    return tmp<vectorField>(nullptr);
 }
 
 
@@ -97,7 +97,7 @@ Foam::tmp<Foam::tensorField> Foam::EulerCoordinateRotation::transformTensor
 ) const
 {
      NotImplemented;
-    return tmp<tensorField>(NULL);
+    return tmp<tensorField>(nullptr);
 }
 
 
@@ -117,7 +117,7 @@ Foam::tmp<Foam::tensorField> Foam::EulerCoordinateRotation::transformTensor
 ) const
 {
     NotImplemented;
-    return tmp<tensorField>(NULL);
+    return tmp<tensorField>(nullptr);
 }
 
 
diff --git a/src/meshTools/coordinateSystems/coordinateRotation/STARCDCoordinateRotation.C b/src/meshTools/coordinateSystems/coordinateRotation/STARCDCoordinateRotation.C
index 41e331c2b5d..89630cd0fb5 100644
--- a/src/meshTools/coordinateSystems/coordinateRotation/STARCDCoordinateRotation.C
+++ b/src/meshTools/coordinateSystems/coordinateRotation/STARCDCoordinateRotation.C
@@ -71,7 +71,7 @@ Foam::tmp<Foam::vectorField> Foam::STARCDCoordinateRotation::transform
 ) const
 {
     NotImplemented;
-    return tmp<vectorField>(NULL);
+    return tmp<vectorField>(nullptr);
 }
 
 
@@ -81,7 +81,7 @@ Foam::tmp<Foam::vectorField> Foam::STARCDCoordinateRotation::invTransform
 ) const
 {
     NotImplemented;
-    return tmp<vectorField>(NULL);
+    return tmp<vectorField>(nullptr);
 }
 
 
@@ -98,7 +98,7 @@ Foam::tmp<Foam::tensorField> Foam::STARCDCoordinateRotation::transformTensor
 ) const
 {
      NotImplemented;
-    return tmp<tensorField>(NULL);
+    return tmp<tensorField>(nullptr);
 }
 
 
@@ -118,7 +118,7 @@ Foam::tmp<Foam::tensorField> Foam::STARCDCoordinateRotation::transformTensor
 ) const
 {
     NotImplemented;
-    return tmp<tensorField>(NULL);
+    return tmp<tensorField>(nullptr);
 }
 
 
diff --git a/src/meshTools/coordinateSystems/coordinateRotation/axesRotation.C b/src/meshTools/coordinateSystems/coordinateRotation/axesRotation.C
index 1c62449c209..88a62fb45d2 100644
--- a/src/meshTools/coordinateSystems/coordinateRotation/axesRotation.C
+++ b/src/meshTools/coordinateSystems/coordinateRotation/axesRotation.C
@@ -202,7 +202,7 @@ Foam::tmp<Foam::tensorField> Foam::axesRotation::transformTensor
 ) const
 {
     NotImplemented;
-    return tmp<tensorField>(NULL);
+    return tmp<tensorField>(nullptr);
 }
 
 
@@ -222,7 +222,7 @@ Foam::tmp<Foam::tensorField> Foam::axesRotation::transformTensor
 ) const
 {
     NotImplemented;
-    return tmp<tensorField>(NULL);
+    return tmp<tensorField>(nullptr);
 }
 
 
diff --git a/src/meshTools/mappedPatches/mappedPolyPatch/mappedPatchBase.C b/src/meshTools/mappedPatches/mappedPolyPatch/mappedPatchBase.C
index b32b94606b6..58a5f04772d 100644
--- a/src/meshTools/mappedPatches/mappedPolyPatch/mappedPatchBase.C
+++ b/src/meshTools/mappedPatches/mappedPolyPatch/mappedPatchBase.C
@@ -943,10 +943,10 @@ Foam::mappedPatchBase::mappedPatchBase
     offsets_(pp.size(), offset_),
     distance_(0),
     sameRegion_(sampleRegion_ == patch_.boundaryMesh().mesh().name()),
-    mapPtr_(NULL),
-    AMIPtr_(NULL),
+    mapPtr_(nullptr),
+    AMIPtr_(nullptr),
     AMIReverse_(false),
-    surfPtr_(NULL),
+    surfPtr_(nullptr),
     surfDict_(fileName("surface"))
 {}
 
@@ -970,10 +970,10 @@ Foam::mappedPatchBase::mappedPatchBase
     offsets_(offsets),
     distance_(0),
     sameRegion_(sampleRegion_ == patch_.boundaryMesh().mesh().name()),
-    mapPtr_(NULL),
-    AMIPtr_(NULL),
+    mapPtr_(nullptr),
+    AMIPtr_(nullptr),
     AMIReverse_(false),
-    surfPtr_(NULL),
+    surfPtr_(nullptr),
     surfDict_(fileName("surface"))
 {}
 
@@ -997,10 +997,10 @@ Foam::mappedPatchBase::mappedPatchBase
     offsets_(0),
     distance_(0),
     sameRegion_(sampleRegion_ == patch_.boundaryMesh().mesh().name()),
-    mapPtr_(NULL),
-    AMIPtr_(NULL),
+    mapPtr_(nullptr),
+    AMIPtr_(nullptr),
     AMIReverse_(false),
-    surfPtr_(NULL),
+    surfPtr_(nullptr),
     surfDict_(fileName("surface"))
 {}
 
@@ -1024,10 +1024,10 @@ Foam::mappedPatchBase::mappedPatchBase
     offsets_(0),
     distance_(distance),
     sameRegion_(sampleRegion_ == patch_.boundaryMesh().mesh().name()),
-    mapPtr_(NULL),
-    AMIPtr_(NULL),
+    mapPtr_(nullptr),
+    AMIPtr_(nullptr),
     AMIReverse_(false),
-    surfPtr_(NULL),
+    surfPtr_(nullptr),
     surfDict_(fileName("surface"))
 {}
 
@@ -1048,10 +1048,10 @@ Foam::mappedPatchBase::mappedPatchBase
     offsets_(0),
     distance_(0.0),
     sameRegion_(sampleRegion_ == patch_.boundaryMesh().mesh().name()),
-    mapPtr_(NULL),
-    AMIPtr_(NULL),
+    mapPtr_(nullptr),
+    AMIPtr_(nullptr),
     AMIReverse_(dict.lookupOrDefault<bool>("flipNormals", false)),
-    surfPtr_(NULL),
+    surfPtr_(nullptr),
     surfDict_(dict.subOrEmptyDict("surface"))
 {
     if (!coupleGroup_.valid())
@@ -1130,10 +1130,10 @@ Foam::mappedPatchBase::mappedPatchBase
     offsets_(0),
     distance_(0.0),
     sameRegion_(sampleRegion_ == patch_.boundaryMesh().mesh().name()),
-    mapPtr_(NULL),
-    AMIPtr_(NULL),
+    mapPtr_(nullptr),
+    AMIPtr_(nullptr),
     AMIReverse_(dict.lookupOrDefault<bool>("flipNormals", false)),
-    surfPtr_(NULL),
+    surfPtr_(nullptr),
     surfDict_(dict.subOrEmptyDict("surface"))
 {
     if (mode != NEARESTPATCHFACE && mode != NEARESTPATCHFACEAMI)
@@ -1177,10 +1177,10 @@ Foam::mappedPatchBase::mappedPatchBase
     offsets_(mpb.offsets_),
     distance_(mpb.distance_),
     sameRegion_(mpb.sameRegion_),
-    mapPtr_(NULL),
-    AMIPtr_(NULL),
+    mapPtr_(nullptr),
+    AMIPtr_(nullptr),
     AMIReverse_(mpb.AMIReverse_),
-    surfPtr_(NULL),
+    surfPtr_(nullptr),
     surfDict_(mpb.surfDict_)
 {}
 
@@ -1207,10 +1207,10 @@ Foam::mappedPatchBase::mappedPatchBase
     ),
     distance_(mpb.distance_),
     sameRegion_(mpb.sameRegion_),
-    mapPtr_(NULL),
-    AMIPtr_(NULL),
+    mapPtr_(nullptr),
+    AMIPtr_(nullptr),
     AMIReverse_(mpb.AMIReverse_),
-    surfPtr_(NULL),
+    surfPtr_(nullptr),
     surfDict_(mpb.surfDict_)
 {}
 
diff --git a/src/meshTools/regionCoupled/patches/regionCoupledPolyPatch/regionCoupledBase.C b/src/meshTools/regionCoupled/patches/regionCoupledPolyPatch/regionCoupledBase.C
index 482c7e65579..02583cd7d76 100644
--- a/src/meshTools/regionCoupled/patches/regionCoupledPolyPatch/regionCoupledBase.C
+++ b/src/meshTools/regionCoupled/patches/regionCoupledPolyPatch/regionCoupledBase.C
@@ -2,7 +2,7 @@
   =========                 |
   \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox
    \\    /   O peration     |
-    \\  /    A nd           | Copyright (C) 2011-2015 OpenFOAM Foundation
+    \\  /    A nd           | Copyright (C) 2011-2016 OpenFOAM Foundation
      \\/     M anipulation  |
 -------------------------------------------------------------------------------
 License
@@ -132,9 +132,9 @@ Foam::regionCoupledBase::regionCoupledBase
     nbrPatchID_(-1),
     nbrRegionName_(word::null),
     sameRegion_(false),
-    AMIPtr_(NULL),
+    AMIPtr_(nullptr),
     AMIReverse_(false),
-    surfPtr_(NULL),
+    surfPtr_(nullptr),
     surfDict_(fileName("surface"))
 {}
 
@@ -150,9 +150,9 @@ Foam::regionCoupledBase::regionCoupledBase
     nbrPatchID_(-1),
     nbrRegionName_(dict.lookup("neighbourRegion")),
     sameRegion_(nbrRegionName_ == patch_.boundaryMesh().mesh().name()),
-    AMIPtr_(NULL),
+    AMIPtr_(nullptr),
     AMIReverse_(dict.lookupOrDefault<bool>("flipNormals", false)),
-    surfPtr_(NULL),
+    surfPtr_(nullptr),
     surfDict_(dict.subOrEmptyDict("surface"))
 {}
 
@@ -168,7 +168,7 @@ Foam::regionCoupledBase::regionCoupledBase
     nbrPatchID_(mpb.nbrPatchID_),
     nbrRegionName_(mpb.nbrRegionName_),
     sameRegion_(mpb.sameRegion_),
-    AMIPtr_(NULL),
+    AMIPtr_(nullptr),
     AMIReverse_(mpb.AMIReverse_),
     surfPtr_(mpb.surfPtr_),
     surfDict_(mpb.surfDict_)
diff --git a/src/meshTools/searchableSurface/searchableSurface.H b/src/meshTools/searchableSurface/searchableSurface.H
index c7e25cc94a4..9e6321f9e05 100644
--- a/src/meshTools/searchableSurface/searchableSurface.H
+++ b/src/meshTools/searchableSurface/searchableSurface.H
@@ -138,7 +138,7 @@ public:
         virtual autoPtr<searchableSurface> clone() const
         {
             NotImplemented;
-            return autoPtr<searchableSurface>(NULL);
+            return autoPtr<searchableSurface>(nullptr);
         }
 
 
diff --git a/src/meshTools/sets/topoSetSource/topoSetSource.C b/src/meshTools/sets/topoSetSource/topoSetSource.C
index 632e159ddd5..295af9f0f95 100644
--- a/src/meshTools/sets/topoSetSource/topoSetSource.C
+++ b/src/meshTools/sets/topoSetSource/topoSetSource.C
@@ -54,7 +54,7 @@ namespace Foam
 }
 
 
-Foam::HashTable<Foam::string>* Foam::topoSetSource::usageTablePtr_ = NULL;
+Foam::HashTable<Foam::string>* Foam::topoSetSource::usageTablePtr_ = nullptr;
 
 
 const Foam::NamedEnum<Foam::topoSetSource::setAction, 8>
diff --git a/src/meshTools/sets/topoSetSource/topoSetSource.H b/src/meshTools/sets/topoSetSource/topoSetSource.H
index d031a1a0d93..5bef2158195 100644
--- a/src/meshTools/sets/topoSetSource/topoSetSource.H
+++ b/src/meshTools/sets/topoSetSource/topoSetSource.H
@@ -116,7 +116,7 @@ protected:
                 if (usageTablePtr_)
                 {
                     delete usageTablePtr_;
-                    usageTablePtr_ = NULL;
+                    usageTablePtr_ = nullptr;
                 }
             }
         };
@@ -243,7 +243,7 @@ public:
         autoPtr<topoSetSource> clone() const
         {
             NotImplemented;
-            return autoPtr<topoSetSource>(NULL);
+            return autoPtr<topoSetSource>(nullptr);
         }
 
 
diff --git a/src/meshTools/sets/topoSets/topoSet.H b/src/meshTools/sets/topoSets/topoSet.H
index bcad4e18361..ffdc64ca48b 100644
--- a/src/meshTools/sets/topoSets/topoSet.H
+++ b/src/meshTools/sets/topoSets/topoSet.H
@@ -2,7 +2,7 @@
   =========                 |
   \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox
    \\    /   O peration     |
-    \\  /    A nd           | Copyright (C) 2011-2015 OpenFOAM Foundation
+    \\  /    A nd           | Copyright (C) 2011-2016 OpenFOAM Foundation
      \\/     M anipulation  |
 -------------------------------------------------------------------------------
 License
@@ -220,7 +220,7 @@ public:
         autoPtr<topoSet> clone() const
         {
             NotImplemented;
-            return autoPtr<topoSet>(NULL);
+            return autoPtr<topoSet>(nullptr);
         }
 
 
diff --git a/src/meshTools/triSurface/triSurfaceSearch/triSurfaceSearch.C b/src/meshTools/triSurface/triSurfaceSearch/triSurfaceSearch.C
index 36f6ac9ca9e..d95b28a9842 100644
--- a/src/meshTools/triSurface/triSurfaceSearch/triSurfaceSearch.C
+++ b/src/meshTools/triSurface/triSurfaceSearch/triSurfaceSearch.C
@@ -135,7 +135,7 @@ Foam::triSurfaceSearch::triSurfaceSearch(const triSurface& surface)
     surface_(surface),
     tolerance_(indexedOctree<treeDataTriSurface>::perturbTol()),
     maxTreeDepth_(10),
-    treePtr_(NULL)
+    treePtr_(nullptr)
 {}
 
 
@@ -148,7 +148,7 @@ Foam::triSurfaceSearch::triSurfaceSearch
     surface_(surface),
     tolerance_(indexedOctree<treeDataTriSurface>::perturbTol()),
     maxTreeDepth_(10),
-    treePtr_(NULL)
+    treePtr_(nullptr)
 {
     // Have optional non-standard search tolerance for gappy surfaces.
     if (dict.readIfPresent("tolerance", tolerance_) && tolerance_ > 0)
@@ -174,7 +174,7 @@ Foam::triSurfaceSearch::triSurfaceSearch
     surface_(surface),
     tolerance_(tolerance),
     maxTreeDepth_(maxTreeDepth),
-    treePtr_(NULL)
+    treePtr_(nullptr)
 {}
 
 
diff --git a/src/meshTools/twoDPointCorrector/twoDPointCorrector.C b/src/meshTools/twoDPointCorrector/twoDPointCorrector.C
index ccd7257ee03..217c99565c4 100644
--- a/src/meshTools/twoDPointCorrector/twoDPointCorrector.C
+++ b/src/meshTools/twoDPointCorrector/twoDPointCorrector.C
@@ -198,8 +198,8 @@ Foam::twoDPointCorrector::twoDPointCorrector(const polyMesh& mesh)
 :
     MeshObject<polyMesh, Foam::UpdateableMeshObject, twoDPointCorrector>(mesh),
     required_(mesh_.nGeometricD() == 2),
-    planeNormalPtr_(NULL),
-    normalEdgeIndicesPtr_(NULL),
+    planeNormalPtr_(nullptr),
+    normalEdgeIndicesPtr_(nullptr),
     isWedge_(false),
     wedgeAxis_(Zero),
     wedgeAngle_(0.0)
diff --git a/src/parallel/decompose/decompose/fvFieldDecomposer.C b/src/parallel/decompose/decompose/fvFieldDecomposer.C
index e007571eb93..310d0ce1fec 100644
--- a/src/parallel/decompose/decompose/fvFieldDecomposer.C
+++ b/src/parallel/decompose/decompose/fvFieldDecomposer.C
@@ -2,7 +2,7 @@
   =========                 |
   \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox
    \\    /   O peration     |
-    \\  /    A nd           | Copyright (C) 2011 OpenFOAM Foundation
+    \\  /    A nd           | Copyright (C) 2011-2016 OpenFOAM Foundation
      \\/     M anipulation  |
 -------------------------------------------------------------------------------
 License
@@ -129,17 +129,17 @@ Foam::fvFieldDecomposer::fvFieldDecomposer
     patchFieldDecomposerPtrs_
     (
         procMesh_.boundary().size(),
-        static_cast<patchFieldDecomposer*>(NULL)
+        static_cast<patchFieldDecomposer*>(nullptr)
     ),
     processorVolPatchFieldDecomposerPtrs_
     (
         procMesh_.boundary().size(),
-        static_cast<processorVolPatchFieldDecomposer*>(NULL)
+        static_cast<processorVolPatchFieldDecomposer*>(nullptr)
     ),
     processorSurfacePatchFieldDecomposerPtrs_
     (
         procMesh_.boundary().size(),
-        static_cast<processorSurfacePatchFieldDecomposer*>(NULL)
+        static_cast<processorSurfacePatchFieldDecomposer*>(nullptr)
     )
 {
     forAll(boundaryAddressing_, patchi)
diff --git a/src/parallel/decompose/decompositionMethods/decompositionConstraints/refinementHistory/refinementHistoryConstraint.C b/src/parallel/decompose/decompositionMethods/decompositionConstraints/refinementHistory/refinementHistoryConstraint.C
index a60917157f4..2a937024100 100644
--- a/src/parallel/decompose/decompositionMethods/decompositionConstraints/refinementHistory/refinementHistoryConstraint.C
+++ b/src/parallel/decompose/decompositionMethods/decompositionConstraints/refinementHistory/refinementHistoryConstraint.C
@@ -85,7 +85,7 @@ void Foam::refinementHistoryConstraint::add
 ) const
 {
     autoPtr<const refinementHistory> storagePtr;
-    refinementHistory const* refPtr = NULL;
+    refinementHistory const* refPtr = nullptr;
 
     if (mesh.foundObject<refinementHistory>("refinementHistory"))
     {
@@ -152,7 +152,7 @@ void Foam::refinementHistoryConstraint::apply
 ) const
 {
     autoPtr<const refinementHistory> storagePtr;
-    refinementHistory const* refPtr = NULL;
+    refinementHistory const* refPtr = nullptr;
 
     if (mesh.foundObject<refinementHistory>("refinementHistory"))
     {
diff --git a/src/parallel/decompose/metisDecomp/metisDecomp.C b/src/parallel/decompose/metisDecomp/metisDecomp.C
index 90151843c44..3ede45d3f7b 100644
--- a/src/parallel/decompose/metisDecomp/metisDecomp.C
+++ b/src/parallel/decompose/metisDecomp/metisDecomp.C
@@ -175,11 +175,11 @@ Foam::label Foam::metisDecomp::decompose
             const_cast<List<label>&>(xadj).begin(),   // indexing into adjncy
             const_cast<List<label>&>(adjncy).begin(), // neighbour info
             cellWeights.begin(),// vertexweights
-            NULL,               // vsize: total communication vol
+            nullptr,               // vsize: total communication vol
             faceWeights.begin(),// edgeweights
             &nProcs,            // nParts
             processorWeights.begin(),   // tpwgts
-            NULL,               // ubvec: processor imbalance (default)
+            nullptr,               // ubvec: processor imbalance (default)
             options.begin(),
             &edgeCut,
             finalDecomp.begin()
@@ -194,11 +194,11 @@ Foam::label Foam::metisDecomp::decompose
             const_cast<List<label>&>(xadj).begin(),   // indexing into adjncy
             const_cast<List<label>&>(adjncy).begin(), // neighbour info
             cellWeights.begin(),// vertexweights
-            NULL,               // vsize: total communication vol
+            nullptr,               // vsize: total communication vol
             faceWeights.begin(),// edgeweights
             &nProcs,            // nParts
             processorWeights.begin(),   // tpwgts
-            NULL,               // ubvec: processor imbalance (default)
+            nullptr,               // ubvec: processor imbalance (default)
             options.begin(),
             &edgeCut,
             finalDecomp.begin()
diff --git a/src/parallel/decompose/ptscotchDecomp/ptscotchDecomp.C b/src/parallel/decompose/ptscotchDecomp/ptscotchDecomp.C
index 4c6d2939cea..dcd2596d6b8 100644
--- a/src/parallel/decompose/ptscotchDecomp/ptscotchDecomp.C
+++ b/src/parallel/decompose/ptscotchDecomp/ptscotchDecomp.C
@@ -492,13 +492,13 @@ Foam::label Foam::ptscotchDecomp::decompose
             const_cast<SCOTCH_Num*>(xadj+1),// vendloctab, end index  ,,
 
             const_cast<SCOTCH_Num*>(velotab.begin()),// veloloctab, vtx weights
-            NULL,                   // vlblloctab
+            nullptr,                   // vlblloctab
 
             adjncySize,             // edgelocnbr, number of arcs
             adjncySize,             // edgelocsiz
             const_cast<SCOTCH_Num*>(adjncy),         // edgeloctab
-            NULL,                   // edgegsttab
-            NULL                    // edlotab, edge weights
+            nullptr,                   // edgegsttab
+            nullptr                    // edlotab, edge weights
         ),
         "SCOTCH_dgraphBuild"
     );
diff --git a/src/parallel/decompose/scotchDecomp/scotchDecomp.C b/src/parallel/decompose/scotchDecomp/scotchDecomp.C
index d76ee941f39..987ef18a1e6 100644
--- a/src/parallel/decompose/scotchDecomp/scotchDecomp.C
+++ b/src/parallel/decompose/scotchDecomp/scotchDecomp.C
@@ -338,10 +338,10 @@ Foam::label Foam::scotchDecomp::decomposeOneProc
             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"
     );
@@ -421,7 +421,7 @@ Foam::label Foam::scotchDecomp::decomposeOneProc
 
 
     //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/parallel/reconstruct/reconstruct/processorMeshes.C b/src/parallel/reconstruct/reconstruct/processorMeshes.C
index adc11f56355..47bd1166d0b 100644
--- a/src/parallel/reconstruct/reconstruct/processorMeshes.C
+++ b/src/parallel/reconstruct/reconstruct/processorMeshes.C
@@ -35,11 +35,11 @@ void Foam::processorMeshes::read()
     // and fields
     forAll(databases_, proci)
     {
-        meshes_.set(proci, NULL);
-        pointProcAddressing_.set(proci, NULL);
-        faceProcAddressing_.set(proci, NULL);
-        cellProcAddressing_.set(proci, NULL);
-        boundaryProcAddressing_.set(proci, NULL);
+        meshes_.set(proci, nullptr);
+        pointProcAddressing_.set(proci, nullptr);
+        faceProcAddressing_.set(proci, nullptr);
+        cellProcAddressing_.set(proci, nullptr);
+        boundaryProcAddressing_.set(proci, nullptr);
     }
 
     forAll(databases_, proci)
diff --git a/src/regionCoupled/derivedFvPatchFields/energyRegionCoupled/energyRegionCoupledFvPatchScalarField.C b/src/regionCoupled/derivedFvPatchFields/energyRegionCoupled/energyRegionCoupledFvPatchScalarField.C
index c0912107aaf..2935936e8bb 100644
--- a/src/regionCoupled/derivedFvPatchFields/energyRegionCoupled/energyRegionCoupledFvPatchScalarField.C
+++ b/src/regionCoupled/derivedFvPatchFields/energyRegionCoupled/energyRegionCoupledFvPatchScalarField.C
@@ -216,8 +216,8 @@ energyRegionCoupledFvPatchScalarField
     coupledFvPatchField<scalar>(p, iF),
     regionCoupledPatch_(refCast<const regionCoupledBaseFvPatch>(p)),
     method_(UNDEFINED),
-    nbrThermoPtr_(NULL),
-    thermoPtr_(NULL)
+    nbrThermoPtr_(nullptr),
+    thermoPtr_(nullptr)
 {}
 
 
@@ -233,8 +233,8 @@ energyRegionCoupledFvPatchScalarField
     coupledFvPatchField<scalar>(ptf, p, iF, mapper),
     regionCoupledPatch_(refCast<const regionCoupledBaseFvPatch>(p)),
     method_(ptf.method_),
-    nbrThermoPtr_(NULL),
-    thermoPtr_(NULL)
+    nbrThermoPtr_(nullptr),
+    thermoPtr_(nullptr)
 {}
 
 
@@ -249,8 +249,8 @@ energyRegionCoupledFvPatchScalarField
     coupledFvPatchField<scalar>(p, iF, dict),
     regionCoupledPatch_(refCast<const regionCoupledBaseFvPatch>(p)),
     method_(UNDEFINED),
-    nbrThermoPtr_(NULL),
-    thermoPtr_(NULL)
+    nbrThermoPtr_(nullptr),
+    thermoPtr_(nullptr)
 {
 
     if (!isA<regionCoupledBase>(this->patch().patch()))
@@ -274,8 +274,8 @@ energyRegionCoupledFvPatchScalarField
     coupledFvPatchField<scalar>(ptf),
     regionCoupledPatch_(ptf.regionCoupledPatch_),
     method_(ptf.method_),
-    nbrThermoPtr_(NULL),
-    thermoPtr_(NULL)
+    nbrThermoPtr_(nullptr),
+    thermoPtr_(nullptr)
 {}
 
 
@@ -289,8 +289,8 @@ energyRegionCoupledFvPatchScalarField
     coupledFvPatchField<scalar>(ptf, iF),
     regionCoupledPatch_(ptf.regionCoupledPatch_),
     method_(ptf.method_),
-    nbrThermoPtr_(NULL),
-    thermoPtr_(NULL)
+    nbrThermoPtr_(nullptr),
+    thermoPtr_(nullptr)
 {}
 
 
diff --git a/src/regionModels/pyrolysisModels/noPyrolysis/noPyrolysis.C b/src/regionModels/pyrolysisModels/noPyrolysis/noPyrolysis.C
index 8e01df73ef6..257bddf9250 100644
--- a/src/regionModels/pyrolysisModels/noPyrolysis/noPyrolysis.C
+++ b/src/regionModels/pyrolysisModels/noPyrolysis/noPyrolysis.C
@@ -95,9 +95,9 @@ noPyrolysis::noPyrolysis
 )
 :
     pyrolysisModel(mesh, regionType),
-    solidChemistry_(NULL),
-    solidThermo_(NULL),
-    radiation_(NULL)
+    solidChemistry_(nullptr),
+    solidThermo_(nullptr),
+    radiation_(nullptr)
 {
     if (active())
     {
@@ -115,9 +115,9 @@ noPyrolysis::noPyrolysis
 )
 :
     pyrolysisModel(mesh, regionType),
-    solidChemistry_(NULL),
-    solidThermo_(NULL),
-    radiation_(NULL)
+    solidChemistry_(nullptr),
+    solidThermo_(nullptr),
+    radiation_(nullptr)
 {
     if (active())
     {
diff --git a/src/regionModels/pyrolysisModels/pyrolysisModel/pyrolysisModel.H b/src/regionModels/pyrolysisModels/pyrolysisModel/pyrolysisModel.H
index 92e495b0b55..9f3ee2a2892 100644
--- a/src/regionModels/pyrolysisModels/pyrolysisModel/pyrolysisModel.H
+++ b/src/regionModels/pyrolysisModels/pyrolysisModel/pyrolysisModel.H
@@ -156,7 +156,7 @@ public:
         autoPtr<pyrolysisModel> clone() const
         {
             NotImplemented;
-            return autoPtr<pyrolysisModel>(NULL);
+            return autoPtr<pyrolysisModel>(nullptr);
         }
 
 
diff --git a/src/regionModels/regionModel/regionModel/regionModel.C b/src/regionModels/regionModel/regionModel/regionModel.C
index f1c21e778ba..31a9ff533b6 100644
--- a/src/regionModels/regionModel/regionModel/regionModel.C
+++ b/src/regionModels/regionModel/regionModel/regionModel.C
@@ -391,9 +391,9 @@ Foam::regionModels::regionModel::regionModel
     active_(false),
     infoOutput_(false),
     modelName_("none"),
-    regionMeshPtr_(NULL),
+    regionMeshPtr_(nullptr),
     coeffs_(dictionary::null),
-    outputPropertiesPtr_(NULL),
+    outputPropertiesPtr_(nullptr),
     primaryPatchIDs_(),
     intCoupledPatchIDs_(),
     regionName_("none"),
@@ -427,9 +427,9 @@ Foam::regionModels::regionModel::regionModel
     active_(lookup("active")),
     infoOutput_(true),
     modelName_(modelName),
-    regionMeshPtr_(NULL),
+    regionMeshPtr_(nullptr),
     coeffs_(subOrEmptyDict(modelName + "Coeffs")),
-    outputPropertiesPtr_(NULL),
+    outputPropertiesPtr_(nullptr),
     primaryPatchIDs_(),
     intCoupledPatchIDs_(),
     regionName_(lookup("regionName")),
@@ -475,9 +475,9 @@ Foam::regionModels::regionModel::regionModel
     active_(dict.lookup("active")),
     infoOutput_(false),
     modelName_(modelName),
-    regionMeshPtr_(NULL),
+    regionMeshPtr_(nullptr),
     coeffs_(dict.subOrEmptyDict(modelName + "Coeffs")),
-    outputPropertiesPtr_(NULL),
+    outputPropertiesPtr_(nullptr),
     primaryPatchIDs_(),
     intCoupledPatchIDs_(),
     regionName_(dict.lookup("regionName")),
diff --git a/src/regionModels/regionModel/regionModel1D/regionModel1D.C b/src/regionModels/regionModel/regionModel1D/regionModel1D.C
index ef1676b79c3..15154dc33d0 100644
--- a/src/regionModels/regionModel/regionModel1D/regionModel1D.C
+++ b/src/regionModels/regionModel/regionModel1D/regionModel1D.C
@@ -291,7 +291,7 @@ Foam::regionModels::regionModel1D::regionModel1D
     boundaryFaceCells_(),
     boundaryFaceOppositeFace_(),
     nLayers_(0),
-    nMagSfPtr_(NULL),
+    nMagSfPtr_(nullptr),
     moveMesh_(false)
 {}
 
@@ -309,7 +309,7 @@ Foam::regionModels::regionModel1D::regionModel1D
     boundaryFaceCells_(regionMesh().nCells()),
     boundaryFaceOppositeFace_(regionMesh().nCells()),
     nLayers_(0),
-    nMagSfPtr_(NULL),
+    nMagSfPtr_(nullptr),
     moveMesh_(true)
 {
     if (active_)
@@ -339,7 +339,7 @@ Foam::regionModels::regionModel1D::regionModel1D
     boundaryFaceCells_(regionMesh().nCells()),
     boundaryFaceOppositeFace_(regionMesh().nCells()),
     nLayers_(0),
-    nMagSfPtr_(NULL),
+    nMagSfPtr_(nullptr),
     moveMesh_(false)
 {
     if (active_)
diff --git a/src/regionModels/regionModel/singleLayerRegion/singleLayerRegion.C b/src/regionModels/regionModel/singleLayerRegion/singleLayerRegion.C
index 360607e4cfa..0c3571ef307 100644
--- a/src/regionModels/regionModel/singleLayerRegion/singleLayerRegion.C
+++ b/src/regionModels/regionModel/singleLayerRegion/singleLayerRegion.C
@@ -164,8 +164,8 @@ Foam::regionModels::singleLayerRegion::singleLayerRegion
 )
 :
     regionModel(mesh, regionType),
-    nHatPtr_(NULL),
-    magSfPtr_(NULL),
+    nHatPtr_(nullptr),
+    magSfPtr_(nullptr),
     passivePatchIDs_()
 {}
 
@@ -179,8 +179,8 @@ Foam::regionModels::singleLayerRegion::singleLayerRegion
 )
 :
     regionModel(mesh, regionType, modelName, false),
-    nHatPtr_(NULL),
-    magSfPtr_(NULL),
+    nHatPtr_(nullptr),
+    magSfPtr_(nullptr),
     passivePatchIDs_()
 {
     if (active_)
diff --git a/src/regionModels/surfaceFilmModels/submodels/kinematic/filmThermoModel/liquidFilmThermo/liquidFilmThermo.C b/src/regionModels/surfaceFilmModels/submodels/kinematic/filmThermoModel/liquidFilmThermo/liquidFilmThermo.C
index 5511b2e2002..824dd5a203e 100644
--- a/src/regionModels/surfaceFilmModels/submodels/kinematic/filmThermoModel/liquidFilmThermo/liquidFilmThermo.C
+++ b/src/regionModels/surfaceFilmModels/submodels/kinematic/filmThermoModel/liquidFilmThermo/liquidFilmThermo.C
@@ -71,7 +71,7 @@ const thermoSingleLayer& liquidFilmThermo::thermoFilm() const
 
 void liquidFilmThermo::initLiquid(const dictionary& dict)
 {
-    if (liquidPtr_ != NULL)
+    if (liquidPtr_ != nullptr)
     {
         return;
     }
@@ -108,7 +108,7 @@ liquidFilmThermo::liquidFilmThermo
 :
     filmThermoModel(typeName, owner, dict),
     name_("unknown_liquid"),
-    liquidPtr_(NULL),
+    liquidPtr_(nullptr),
     ownLiquid_(false),
     useReferenceValues_(readBool(coeffDict_.lookup("useReferenceValues"))),
     pRef_(0.0),
diff --git a/src/regionModels/surfaceFilmModels/surfaceFilmModel/surfaceFilmModel.C b/src/regionModels/surfaceFilmModels/surfaceFilmModel/surfaceFilmModel.C
index a504a76507f..2ac323d0f75 100644
--- a/src/regionModels/surfaceFilmModels/surfaceFilmModel/surfaceFilmModel.C
+++ b/src/regionModels/surfaceFilmModels/surfaceFilmModel/surfaceFilmModel.C
@@ -93,7 +93,7 @@ tmp<volScalarField::Internal> surfaceFilmModel::Srho() const
 {
     NotImplemented;
 
-    return tmp<volScalarField::Internal>(NULL);
+    return tmp<volScalarField::Internal>(nullptr);
 }
 
 
@@ -102,7 +102,7 @@ surfaceFilmModel::Srho(const label) const
 {
     NotImplemented;
 
-    return tmp<volScalarField::Internal>(NULL);
+    return tmp<volScalarField::Internal>(nullptr);
 }
 
 
@@ -110,7 +110,7 @@ tmp<volScalarField::Internal> surfaceFilmModel::Sh() const
 {
     NotImplemented;
 
-    return tmp<volScalarField::Internal>(NULL);
+    return tmp<volScalarField::Internal>(nullptr);
 }
 
 
diff --git a/src/renumber/zoltanRenumber/zoltanRenumber.C b/src/renumber/zoltanRenumber/zoltanRenumber.C
index 73c7c5f9539..da7a2957b53 100644
--- a/src/renumber/zoltanRenumber/zoltanRenumber.C
+++ b/src/renumber/zoltanRenumber/zoltanRenumber.C
@@ -96,7 +96,7 @@ static void get_vertex_list(void *data, int sizeGID, int sizeLID,
    */
 
     wgt_dim = 0;
-    obj_wgts = NULL;
+    obj_wgts = nullptr;
 
     for (Foam::label i=0; i<mesh.nCells(); i++)
     {
diff --git a/src/rigidBodyDynamics/rigidBodyModel/rigidBodyModel.C b/src/rigidBodyDynamics/rigidBodyModel/rigidBodyModel.C
index aebfb762edc..b2236c39c49 100644
--- a/src/rigidBodyDynamics/rigidBodyModel/rigidBodyModel.C
+++ b/src/rigidBodyDynamics/rigidBodyModel/rigidBodyModel.C
@@ -295,7 +295,7 @@ void Foam::RBD::rigidBodyModel::makeComposite(const label bodyID)
     if (!isA<compositeBody>(bodies_[bodyID]))
     {
         // Retrieve the un-merged body
-        autoPtr<rigidBody> bodyPtr = bodies_.set(bodyID, NULL);
+        autoPtr<rigidBody> bodyPtr = bodies_.set(bodyID, nullptr);
 
         // Insert the compositeBody containing the original body
         bodies_.set
diff --git a/src/rigidBodyDynamics/rigidBodyMotion/rigidBodyMotion.C b/src/rigidBodyDynamics/rigidBodyMotion/rigidBodyMotion.C
index 9eb21c39691..f14acc6e60a 100644
--- a/src/rigidBodyDynamics/rigidBodyMotion/rigidBodyMotion.C
+++ b/src/rigidBodyDynamics/rigidBodyMotion/rigidBodyMotion.C
@@ -50,7 +50,7 @@ Foam::RBD::rigidBodyMotion::rigidBodyMotion()
     aRelax_(1.0),
     aDamp_(1.0),
     report_(false),
-    solver_(NULL)
+    solver_(nullptr)
 {}
 
 Foam::RBD::rigidBodyMotion::rigidBodyMotion
diff --git a/src/sampling/meshToMesh/distributedWeightedFvPatchFieldMapper.H b/src/sampling/meshToMesh/distributedWeightedFvPatchFieldMapper.H
index 537f7d8de5c..66b37308016 100644
--- a/src/sampling/meshToMesh/distributedWeightedFvPatchFieldMapper.H
+++ b/src/sampling/meshToMesh/distributedWeightedFvPatchFieldMapper.H
@@ -85,7 +85,7 @@ public:
                 }
             }
 
-            if ((singlePatchProc_ == -1) != (distMapPtr_ != NULL))
+            if ((singlePatchProc_ == -1) != (distMapPtr_ != nullptr))
             {
                 FatalErrorIn
                 (
@@ -94,7 +94,7 @@ public:
                 )   << "Supply a mapDistributeBase if and only if "
                     << "singlePatchProc is -1"
                     << " singlePatchProc_:" << singlePatchProc_
-                    << " distMapPtr_:" << (distMapPtr_ != NULL)
+                    << " distMapPtr_:" << (distMapPtr_ != nullptr)
                     << exit(FatalError);
             }
         }
diff --git a/src/sampling/meshToMesh/meshToMesh.C b/src/sampling/meshToMesh/meshToMesh.C
index 0c2efaaeed2..73d7514d1ca 100644
--- a/src/sampling/meshToMesh/meshToMesh.C
+++ b/src/sampling/meshToMesh/meshToMesh.C
@@ -653,8 +653,8 @@ Foam::meshToMesh::meshToMesh
     tgtToSrcCellWght_(),
     V_(0.0),
     singleMeshProc_(-1),
-    srcMapPtr_(NULL),
-    tgtMapPtr_(NULL)
+    srcMapPtr_(nullptr),
+    tgtMapPtr_(nullptr)
 {
     constructNoCuttingPatches
     (
@@ -689,8 +689,8 @@ Foam::meshToMesh::meshToMesh
     tgtToSrcCellWght_(),
     V_(0.0),
     singleMeshProc_(-1),
-    srcMapPtr_(NULL),
-    tgtMapPtr_(NULL)
+    srcMapPtr_(nullptr),
+    tgtMapPtr_(nullptr)
 {
     constructNoCuttingPatches(methodName, AMIMethodName, interpAllPatches);
 }
@@ -717,8 +717,8 @@ Foam::meshToMesh::meshToMesh
     tgtToSrcCellWght_(),
     V_(0.0),
     singleMeshProc_(-1),
-    srcMapPtr_(NULL),
-    tgtMapPtr_(NULL)
+    srcMapPtr_(nullptr),
+    tgtMapPtr_(nullptr)
 {
     constructFromCuttingPatches
     (
@@ -755,8 +755,8 @@ Foam::meshToMesh::meshToMesh
     tgtToSrcCellWght_(),
     V_(0.0),
     singleMeshProc_(-1),
-    srcMapPtr_(NULL),
-    tgtMapPtr_(NULL)
+    srcMapPtr_(nullptr),
+    tgtMapPtr_(nullptr)
 {
     constructFromCuttingPatches
     (
diff --git a/src/sampling/meshToMesh/meshToMeshTemplates.C b/src/sampling/meshToMesh/meshToMeshTemplates.C
index 8c0952d08d4..1897147dae5 100644
--- a/src/sampling/meshToMesh/meshToMeshTemplates.C
+++ b/src/sampling/meshToMesh/meshToMeshTemplates.C
@@ -375,7 +375,7 @@ void Foam::meshToMesh::mapSrcToTgt
                     (
                         AMIList[i].singlePatchProc() == -1
                       ? &AMIList[i].srcMap()
-                      : NULL
+                      : nullptr
                     ),
                     AMIList[i].tgtAddress(),
                     AMIList[i].tgtWeights()
@@ -581,7 +581,7 @@ void Foam::meshToMesh::mapTgtToSrc
                     (
                         AMIList[i].singlePatchProc() == -1
                       ? &AMIList[i].tgtMap()
-                      : NULL
+                      : nullptr
                     ),
                     AMIList[i].srcAddress(),
                     AMIList[i].srcWeights()
diff --git a/src/sampling/meshToMesh0/meshToMesh0.C b/src/sampling/meshToMesh0/meshToMesh0.C
index 73991b8b72b..e4ff3263ace 100644
--- a/src/sampling/meshToMesh0/meshToMesh0.C
+++ b/src/sampling/meshToMesh0/meshToMesh0.C
@@ -2,7 +2,7 @@
   =========                 |
   \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox
    \\    /   O peration     |
-    \\  /    A nd           | Copyright (C) 2011-2015 OpenFOAM Foundation
+    \\  /    A nd           | Copyright (C) 2011-2016 OpenFOAM Foundation
      \\/     M anipulation  |
 -------------------------------------------------------------------------------
 License
@@ -52,9 +52,9 @@ Foam::meshToMesh0::meshToMesh0
     patchMap_(patchMap),
     cellAddressing_(toMesh_.nCells()),
     boundaryAddressing_(toMesh_.boundaryMesh().size()),
-    inverseDistanceWeightsPtr_(NULL),
-    inverseVolumeWeightsPtr_(NULL),
-    cellToCellAddressingPtr_(NULL),
+    inverseDistanceWeightsPtr_(nullptr),
+    inverseVolumeWeightsPtr_(nullptr),
+    cellToCellAddressingPtr_(nullptr),
     V_(0.0)
 {
     forAll(fromMesh_.boundaryMesh(), patchi)
@@ -120,9 +120,9 @@ Foam::meshToMesh0::meshToMesh0
     toMesh_(meshTo),
     cellAddressing_(toMesh_.nCells()),
     boundaryAddressing_(toMesh_.boundaryMesh().size()),
-    inverseDistanceWeightsPtr_(NULL),
-    inverseVolumeWeightsPtr_(NULL),
-    cellToCellAddressingPtr_(NULL),
+    inverseDistanceWeightsPtr_(nullptr),
+    inverseVolumeWeightsPtr_(nullptr),
+    cellToCellAddressingPtr_(nullptr),
     V_(0.0)
 {
     // check whether both meshes have got the same number
diff --git a/src/sampling/sampledSet/sampledSet/sampledSet.H b/src/sampling/sampledSet/sampledSet/sampledSet.H
index 7623524f87b..1f146c9a867 100644
--- a/src/sampling/sampledSet/sampledSet/sampledSet.H
+++ b/src/sampling/sampledSet/sampledSet/sampledSet.H
@@ -217,7 +217,7 @@ public:
         autoPtr<sampledSet> clone() const
         {
             NotImplemented;
-            return autoPtr<sampledSet>(NULL);
+            return autoPtr<sampledSet>(nullptr);
         }
 
 
diff --git a/src/sampling/sampledSet/sampledSets/sampledSets.H b/src/sampling/sampledSet/sampledSets/sampledSets.H
index 2e8bc5ac942..eed3e754cdd 100644
--- a/src/sampling/sampledSet/sampledSets/sampledSets.H
+++ b/src/sampling/sampledSet/sampledSets/sampledSets.H
@@ -82,7 +82,7 @@ class sampledSets
             fieldGroup()
             :
                 DynamicList<word>(0),
-                formatter(NULL)
+                formatter(nullptr)
             {}
 
             //- Construct for a particular format
diff --git a/src/sampling/sampledSurface/distanceSurface/distanceSurface.C b/src/sampling/sampledSurface/distanceSurface/distanceSurface.C
index 9d703f4dc81..7b5a2c4c609 100644
--- a/src/sampling/sampledSurface/distanceSurface/distanceSurface.C
+++ b/src/sampling/sampledSurface/distanceSurface/distanceSurface.C
@@ -335,9 +335,9 @@ Foam::distanceSurface::distanceSurface
     average_(dict.lookupOrDefault("average", false)),
     zoneKey_(keyType::null),
     needsUpdate_(true),
-    isoSurfCellPtr_(NULL),
-    isoSurfPtr_(NULL),
-    facesPtr_(NULL)
+    isoSurfCellPtr_(nullptr),
+    isoSurfPtr_(nullptr),
+    facesPtr_(nullptr)
 {
 //    dict.readIfPresent("zone", zoneKey_);
 //
@@ -389,9 +389,9 @@ Foam::distanceSurface::distanceSurface
     average_(average),
     zoneKey_(keyType::null),
     needsUpdate_(true),
-    isoSurfCellPtr_(NULL),
-    isoSurfPtr_(NULL),
-    facesPtr_(NULL)
+    isoSurfCellPtr_(nullptr),
+    isoSurfPtr_(nullptr),
+    facesPtr_(nullptr)
 {}
 
 
diff --git a/src/sampling/sampledSurface/isoSurface/isoSurface.C b/src/sampling/sampledSurface/isoSurface/isoSurface.C
index caaa6a8c8c0..a15f625ed94 100644
--- a/src/sampling/sampledSurface/isoSurface/isoSurface.C
+++ b/src/sampling/sampledSurface/isoSurface/isoSurface.C
@@ -1259,7 +1259,7 @@ Foam::isoSurface::isoSurface
             bType& bfld = const_cast<bType&>(meshC.boundaryField());
 
             // Clear old value. Cannot resize it since is a slice.
-            bfld.set(patchi, NULL);
+            bfld.set(patchi, nullptr);
 
             // Set new value we can change
             bfld.set
diff --git a/src/sampling/sampledSurface/isoSurface/isoSurfaceTemplates.C b/src/sampling/sampledSurface/isoSurface/isoSurfaceTemplates.C
index 8170fba6779..deae85c925d 100644
--- a/src/sampling/sampledSurface/isoSurface/isoSurfaceTemplates.C
+++ b/src/sampling/sampledSurface/isoSurface/isoSurfaceTemplates.C
@@ -90,7 +90,7 @@ Foam::isoSurface::adaptPatchFields
         )
         {
             // Clear old value. Cannot resize it since is a slice.
-            sliceFldBf.set(patchi, NULL);
+            sliceFldBf.set(patchi, nullptr);
 
             // Set new value we can change
             sliceFldBf.set
diff --git a/src/sampling/sampledSurface/isoSurface/sampledIsoSurface.C b/src/sampling/sampledSurface/isoSurface/sampledIsoSurface.C
index 91806f79132..88966077ddf 100644
--- a/src/sampling/sampledSurface/isoSurface/sampledIsoSurface.C
+++ b/src/sampling/sampledSurface/isoSurface/sampledIsoSurface.C
@@ -449,12 +449,12 @@ Foam::sampledIsoSurface::sampledIsoSurface
     average_(dict.lookupOrDefault("average", false)),
     zoneID_(dict.lookupOrDefault("zone", word::null), mesh.cellZones()),
     exposedPatchName_(word::null),
-    surfPtr_(NULL),
-    facesPtr_(NULL),
+    surfPtr_(nullptr),
+    facesPtr_(nullptr),
     prevTimeIndex_(-1),
-    storedVolFieldPtr_(NULL),
-    volFieldPtr_(NULL),
-    pointFieldPtr_(NULL)
+    storedVolFieldPtr_(nullptr),
+    volFieldPtr_(nullptr),
+    pointFieldPtr_(nullptr)
 {
     if (!sampledSurface::interpolate())
     {
diff --git a/src/sampling/sampledSurface/isoSurface/sampledIsoSurfaceCell.C b/src/sampling/sampledSurface/isoSurface/sampledIsoSurfaceCell.C
index 8e31ea4fac0..a44c155d046 100644
--- a/src/sampling/sampledSurface/isoSurface/sampledIsoSurfaceCell.C
+++ b/src/sampling/sampledSurface/isoSurface/sampledIsoSurfaceCell.C
@@ -70,7 +70,7 @@ bool Foam::sampledIsoSurfaceCell::updateGeometry() const
 
     // 1. see if field in database
     // 2. see if field can be read
-    const volScalarField* cellFldPtr = NULL;
+    const volScalarField* cellFldPtr = nullptr;
     if (fvm.foundObject<volScalarField>(isoField_))
     {
         if (debug)
@@ -209,7 +209,7 @@ Foam::sampledIsoSurfaceCell::sampledIsoSurfaceCell
     regularise_(dict.lookupOrDefault("regularise", true)),
     average_(dict.lookupOrDefault("average", true)),
     zoneKey_(keyType::null),
-    facesPtr_(NULL),
+    facesPtr_(nullptr),
     prevTimeIndex_(-1),
     meshCells_(0)
 {}
diff --git a/src/sampling/sampledSurface/sampledCuttingPlane/sampledCuttingPlane.C b/src/sampling/sampledSurface/sampledCuttingPlane/sampledCuttingPlane.C
index 7d439f3bfec..da72b196d8d 100644
--- a/src/sampling/sampledSurface/sampledCuttingPlane/sampledCuttingPlane.C
+++ b/src/sampling/sampledSurface/sampledCuttingPlane/sampledCuttingPlane.C
@@ -269,10 +269,10 @@ Foam::sampledCuttingPlane::sampledCuttingPlane
     zoneID_(dict.lookupOrDefault("zone", word::null), mesh.cellZones()),
     exposedPatchName_(word::null),
     needsUpdate_(true),
-    subMeshPtr_(NULL),
-    cellDistancePtr_(NULL),
-    isoSurfPtr_(NULL),
-    facesPtr_(NULL)
+    subMeshPtr_(nullptr),
+    cellDistancePtr_(nullptr),
+    isoSurfPtr_(nullptr),
+    facesPtr_(nullptr)
 {
     if (zoneID_.index() != -1)
     {
diff --git a/src/sampling/sampledSurface/sampledSurface/sampledSurface.C b/src/sampling/sampledSurface/sampledSurface/sampledSurface.C
index 7d6b4916875..d1281cfb457 100644
--- a/src/sampling/sampledSurface/sampledSurface/sampledSurface.C
+++ b/src/sampling/sampledSurface/sampledSurface/sampledSurface.C
@@ -156,9 +156,9 @@ Foam::sampledSurface::sampledSurface
     name_(name),
     mesh_(mesh),
     interpolate_(interpolate),
-    SfPtr_(NULL),
-    magSfPtr_(NULL),
-    CfPtr_(NULL),
+    SfPtr_(nullptr),
+    magSfPtr_(nullptr),
+    CfPtr_(nullptr),
     area_(-1)
 {}
 
@@ -173,9 +173,9 @@ Foam::sampledSurface::sampledSurface
     name_(name),
     mesh_(mesh),
     interpolate_(dict.lookupOrDefault("interpolate", false)),
-    SfPtr_(NULL),
-    magSfPtr_(NULL),
-    CfPtr_(NULL),
+    SfPtr_(nullptr),
+    magSfPtr_(nullptr),
+    CfPtr_(nullptr),
     area_(-1)
 {
     dict.readIfPresent("name", name_);
@@ -243,7 +243,7 @@ Foam::tmp<Foam::scalarField> Foam::sampledSurface::sample
 ) const
 {
     NotImplemented;
-    return tmp<scalarField>(NULL);
+    return tmp<scalarField>(nullptr);
 }
 
 
@@ -253,7 +253,7 @@ Foam::tmp<Foam::vectorField> Foam::sampledSurface::sample
 ) const
 {
     NotImplemented;
-    return tmp<vectorField>(NULL);
+    return tmp<vectorField>(nullptr);
 }
 
 
@@ -263,7 +263,7 @@ Foam::tmp<Foam::sphericalTensorField> Foam::sampledSurface::sample
 ) const
 {
     NotImplemented;
-    return tmp<sphericalTensorField>(NULL);
+    return tmp<sphericalTensorField>(nullptr);
 }
 
 
@@ -273,7 +273,7 @@ Foam::tmp<Foam::symmTensorField> Foam::sampledSurface::sample
 ) const
 {
     NotImplemented;
-    return tmp<symmTensorField>(NULL);
+    return tmp<symmTensorField>(nullptr);
 }
 
 
@@ -283,7 +283,7 @@ Foam::tmp<Foam::tensorField> Foam::sampledSurface::sample
 ) const
 {
     NotImplemented;
-    return tmp<tensorField>(NULL);
+    return tmp<tensorField>(nullptr);
 }
 
 
diff --git a/src/sampling/sampledSurface/sampledSurface/sampledSurface.H b/src/sampling/sampledSurface/sampledSurface/sampledSurface.H
index 98db69744a0..b0a19707a96 100644
--- a/src/sampling/sampledSurface/sampledSurface/sampledSurface.H
+++ b/src/sampling/sampledSurface/sampledSurface/sampledSurface.H
@@ -225,7 +225,7 @@ public:
         autoPtr<sampledSurface> clone() const
         {
             NotImplemented;
-            return autoPtr<sampledSurface>(NULL);
+            return autoPtr<sampledSurface>(nullptr);
         }
 
 
diff --git a/src/sampling/sampledSurface/sampledSurfaces/sampledSurfaces.C b/src/sampling/sampledSurface/sampledSurfaces/sampledSurfaces.C
index 98c596a3461..86d88a9e0ed 100644
--- a/src/sampling/sampledSurface/sampledSurfaces/sampledSurfaces.C
+++ b/src/sampling/sampledSurface/sampledSurfaces/sampledSurfaces.C
@@ -117,7 +117,7 @@ Foam::sampledSurfaces::sampledSurfaces
     fieldSelection_(),
     interpolationScheme_(word::null),
     mergeList_(),
-    formatter_(NULL)
+    formatter_(nullptr)
 {
     if (Pstream::parRun())
     {
@@ -148,7 +148,7 @@ Foam::sampledSurfaces::sampledSurfaces
     fieldSelection_(),
     interpolationScheme_(word::null),
     mergeList_(),
-    formatter_(NULL)
+    formatter_(nullptr)
 {
     if (Pstream::parRun())
     {
diff --git a/src/sampling/sampledSurface/thresholdCellFaces/sampledThresholdCellFaces.C b/src/sampling/sampledSurface/thresholdCellFaces/sampledThresholdCellFaces.C
index d39297292ec..503853c7747 100644
--- a/src/sampling/sampledSurface/thresholdCellFaces/sampledThresholdCellFaces.C
+++ b/src/sampling/sampledSurface/thresholdCellFaces/sampledThresholdCellFaces.C
@@ -64,7 +64,7 @@ bool Foam::sampledThresholdCellFaces::updateGeometry() const
 
     // 1. see if field in database
     // 2. see if field can be read
-    const volScalarField* cellFldPtr = NULL;
+    const volScalarField* cellFldPtr = nullptr;
     if (fvm.foundObject<volScalarField>(fieldName_))
     {
         if (debug)
diff --git a/src/sixDoFRigidBodyMotion/sixDoFRigidBodyMotion/sixDoFRigidBodyMotion.C b/src/sixDoFRigidBodyMotion/sixDoFRigidBodyMotion/sixDoFRigidBodyMotion.C
index 06774ef78be..65ad05cc747 100644
--- a/src/sixDoFRigidBodyMotion/sixDoFRigidBodyMotion/sixDoFRigidBodyMotion.C
+++ b/src/sixDoFRigidBodyMotion/sixDoFRigidBodyMotion/sixDoFRigidBodyMotion.C
@@ -86,7 +86,7 @@ Foam::sixDoFRigidBodyMotion::sixDoFRigidBodyMotion()
     aRelax_(1.0),
     aDamp_(1.0),
     report_(false),
-    solver_(NULL)
+    solver_(nullptr)
 {}
 
 
diff --git a/src/surfMesh/surfZone/surfZone/surfZone.H b/src/surfMesh/surfZone/surfZone/surfZone.H
index 047bae120e1..c7692c46438 100644
--- a/src/surfMesh/surfZone/surfZone/surfZone.H
+++ b/src/surfMesh/surfZone/surfZone/surfZone.H
@@ -2,7 +2,7 @@
   =========                 |
   \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox
    \\    /   O peration     |
-    \\  /    A nd           | Copyright (C) 2011-2015 OpenFOAM Foundation
+    \\  /    A nd           | Copyright (C) 2011-2016 OpenFOAM Foundation
      \\/     M anipulation  |
 -------------------------------------------------------------------------------
 License
@@ -115,7 +115,7 @@ public:
         autoPtr<surfZone> clone() const
         {
             NotImplemented;
-            return autoPtr<surfZone>(NULL);
+            return autoPtr<surfZone>(nullptr);
         }
 
         static autoPtr<surfZone> New(Istream& is)
diff --git a/src/thermophysicalModels/SLGThermo/SLGThermo/SLGThermo.C b/src/thermophysicalModels/SLGThermo/SLGThermo/SLGThermo.C
index 53c8c6aa764..b307c820c5d 100644
--- a/src/thermophysicalModels/SLGThermo/SLGThermo/SLGThermo.C
+++ b/src/thermophysicalModels/SLGThermo/SLGThermo/SLGThermo.C
@@ -2,7 +2,7 @@
   =========                 |
   \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox
    \\    /   O peration     |
-    \\  /    A nd           | Copyright (C) 2011-2015 OpenFOAM Foundation
+    \\  /    A nd           | Copyright (C) 2011-2016 OpenFOAM Foundation
      \\/     M anipulation  |
 -------------------------------------------------------------------------------
 License
@@ -47,9 +47,9 @@ Foam::SLGThermo::SLGThermo(const fvMesh& mesh, fluidThermo& thermo)
         )
     ),
     thermo_(thermo),
-    carrier_(NULL),
-    liquids_(NULL),
-    solids_(NULL)
+    carrier_(nullptr),
+    liquids_(nullptr),
+    solids_(nullptr)
 {
     Info<< "Creating component thermo properties:" << endl;
 
@@ -107,7 +107,7 @@ const Foam::fluidThermo& Foam::SLGThermo::thermo() const
 
 const Foam::basicSpecieMixture& Foam::SLGThermo::carrier() const
 {
-    if (carrier_ == NULL)
+    if (carrier_ == nullptr)
     {
         FatalErrorInFunction
             << "carrier requested, but object is not allocated"
@@ -222,7 +222,7 @@ Foam::label Foam::SLGThermo::solidId
 
 bool Foam::SLGThermo::hasMultiComponentCarrier() const
 {
-    return (carrier_ != NULL);
+    return (carrier_ != nullptr);
 }
 
 
diff --git a/src/thermophysicalModels/SLGThermo/SLGThermo/SLGThermo.H b/src/thermophysicalModels/SLGThermo/SLGThermo/SLGThermo.H
index 33c9f38f55a..99522911f58 100644
--- a/src/thermophysicalModels/SLGThermo/SLGThermo/SLGThermo.H
+++ b/src/thermophysicalModels/SLGThermo/SLGThermo/SLGThermo.H
@@ -2,7 +2,7 @@
   =========                 |
   \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox
    \\    /   O peration     |
-    \\  /    A nd           | Copyright (C) 2011-2015 OpenFOAM Foundation
+    \\  /    A nd           | Copyright (C) 2011-2016 OpenFOAM Foundation
      \\/     M anipulation  |
 -------------------------------------------------------------------------------
 License
@@ -31,9 +31,9 @@ Description
     - liquids : liquid components - access  to elemental properties
     - solids  : solid components - access  to elemental properties
 
-    If thermo is not a multi-component thermo package, carrier is NULL.
+    If thermo is not a multi-component thermo package, carrier is nullptr.
     Similarly, if no liquids or solids are specified, their respective
-    pointers will also be NULL.
+    pointers will also be nullptr.
 
     Registered to the mesh so that it can be looked-up
 
diff --git a/src/thermophysicalModels/chemistryModel/chemistryModel/TDACChemistryModel/tabulation/ISAT/ISAT.C b/src/thermophysicalModels/chemistryModel/chemistryModel/TDACChemistryModel/tabulation/ISAT/ISAT.C
index 25b79011d9e..cf54307b15a 100644
--- a/src/thermophysicalModels/chemistryModel/chemistryModel/TDACChemistryModel/tabulation/ISAT/ISAT.C
+++ b/src/thermophysicalModels/chemistryModel/chemistryModel/TDACChemistryModel/tabulation/ISAT/ISAT.C
@@ -75,7 +75,7 @@ Foam::chemistryTabulationMethods::ISAT<CompType, ThermoType>::ISAT
     ),
     MRURetrieve_(this->coeffsDict_.lookupOrDefault("MRURetrieve", false)),
     maxMRUSize_(this->coeffsDict_.lookupOrDefault("maxMRUSize", 0)),
-    lastSearch_(NULL),
+    lastSearch_(nullptr),
     growPoints_(this->coeffsDict_.lookupOrDefault("growPoints", true)),
     nRetrieved_(0),
     nGrowth_(0),
@@ -252,7 +252,7 @@ bool Foam::chemistryTabulationMethods::ISAT<CompType, ThermoType>::grow
     const scalarField& Rphiq
 )
 {
-    // If the pointer to the chemPoint is NULL, the function stops
+    // If the pointer to the chemPoint is nullptr, the function stops
     if (!phi0)
     {
         return false;
@@ -290,7 +290,7 @@ Foam::chemistryTabulationMethods::ISAT<CompType, ThermoType>::cleanAndBalance()
     // Check all chemPoints to see if we need to delete some of the chemPoints
     // according to the ellapsed time and number of growths
     chemPointISAT<CompType, ThermoType>* x = chemisTree_.treeMin();
-    while(x != NULL)
+    while(x != nullptr)
     {
         chemPointISAT<CompType, ThermoType>* xtmp =
             chemisTree_.treeSuccessor(x);
@@ -458,7 +458,7 @@ bool Foam::chemistryTabulationMethods::ISAT<CompType, ThermoType>::retrieve
     else
     {
         // There is no chempoints that we can try to grow
-        lastSearch_ = NULL;
+        lastSearch_ = nullptr;
     }
 
     if (retrieved)
@@ -566,7 +566,7 @@ bool Foam::chemistryTabulationMethods::ISAT<CompType, ThermoType>::add
 
         // The structure has been changed, it will force the binary tree to
         // perform a new search and find the most appropriate point still stored
-        lastSearch_ = NULL;
+        lastSearch_ = nullptr;
 
         // Either cleanAndBalance has changed the tree or it has been cleared
         // in any case treeCleanedOrCleared should be set to true
@@ -586,7 +586,7 @@ bool Foam::chemistryTabulationMethods::ISAT<CompType, ThermoType>::add
         scaleFactor(),
         this->tolerance(),
         scaleFactor_.size(),
-        lastSearch_ // lastSearch_ may be NULL (handled by binaryTree)
+        lastSearch_ // lastSearch_ may be nullptr (handled by binaryTree)
     );
 
     nAdd_++;
diff --git a/src/thermophysicalModels/chemistryModel/chemistryModel/TDACChemistryModel/tabulation/ISAT/binaryNode/binaryNode.C b/src/thermophysicalModels/chemistryModel/chemistryModel/TDACChemistryModel/tabulation/ISAT/binaryNode/binaryNode.C
index a2c5d389950..45bf42a4c4e 100644
--- a/src/thermophysicalModels/chemistryModel/chemistryModel/TDACChemistryModel/tabulation/ISAT/binaryNode/binaryNode.C
+++ b/src/thermophysicalModels/chemistryModel/chemistryModel/TDACChemistryModel/tabulation/ISAT/binaryNode/binaryNode.C
@@ -32,11 +32,11 @@ Foam::binaryNode<CompType, ThermoType>::binaryNode
 (
 )
 :
-    leafLeft_(NULL),
-    leafRight_(NULL),
-    nodeLeft_(NULL),
-    nodeRight_(NULL),
-    parent_(NULL)
+    leafLeft_(nullptr),
+    leafRight_(nullptr),
+    nodeLeft_(nullptr),
+    nodeRight_(nullptr),
+    parent_(nullptr)
 {}
 
 
@@ -50,8 +50,8 @@ Foam::binaryNode<CompType, ThermoType>::binaryNode
 :
     leafLeft_(elementLeft),
     leafRight_(elementRight),
-    nodeLeft_(NULL),
-    nodeRight_(NULL),
+    nodeLeft_(nullptr),
+    nodeRight_(nullptr),
     parent_(parent),
     v_(elementLeft->completeSpaceSize(),0.0)
 {
diff --git a/src/thermophysicalModels/chemistryModel/chemistryModel/TDACChemistryModel/tabulation/ISAT/binaryTree/binaryTree.C b/src/thermophysicalModels/chemistryModel/chemistryModel/TDACChemistryModel/tabulation/ISAT/binaryTree/binaryTree.C
index e7a31e43d96..7ed6495991f 100644
--- a/src/thermophysicalModels/chemistryModel/chemistryModel/TDACChemistryModel/tabulation/ISAT/binaryTree/binaryTree.C
+++ b/src/thermophysicalModels/chemistryModel/chemistryModel/TDACChemistryModel/tabulation/ISAT/binaryTree/binaryTree.C
@@ -37,13 +37,13 @@ void Foam::binaryTree<CompType, ThermoType>::insertNode
 {
     if (phi0 == phi0->node()->leafRight())// phi0 is on the right
     {
-        phi0->node()->leafRight() = NULL;
+        phi0->node()->leafRight() = nullptr;
         phi0->node()->nodeRight() = newNode;
         return;
     }
     else if (phi0 == phi0->node()->leafLeft())// phi0 is on the left
     {
-        phi0->node()->leafLeft() = NULL;
+        phi0->node()->leafLeft() = nullptr;
         phi0->node()->nodeLeft() = newNode;
         return;
 
@@ -64,7 +64,7 @@ bool Foam::binaryTree<CompType, ThermoType>::inSubTree
     chP* x
 )
 {
-    if ((n2ndSearch_ < max2ndSearch_) && (y!=NULL))
+    if ((n2ndSearch_ < max2ndSearch_) && (y!=nullptr))
     {
         scalar vPhi=0.0;
         const scalarField& v = y->v();
@@ -76,7 +76,7 @@ bool Foam::binaryTree<CompType, ThermoType>::inSubTree
         }
         if (vPhi<=a)// on the left side of the node
         {
-            if (y->nodeLeft() == NULL)// left is a chemPoint
+            if (y->nodeLeft() == nullptr)// left is a chemPoint
             {
                 n2ndSearch_++;
                 if (y->leafLeft()->inEOA(phiq))
@@ -94,7 +94,7 @@ bool Foam::binaryTree<CompType, ThermoType>::inSubTree
             }
 
             // not on the left side, try the right side
-            if ((n2ndSearch_ < max2ndSearch_) && y->nodeRight() == NULL)
+            if ((n2ndSearch_ < max2ndSearch_) && y->nodeRight() == nullptr)
             {
                 n2ndSearch_++;
                 // we reach the end of the subTree we can return the result
@@ -105,7 +105,7 @@ bool Foam::binaryTree<CompType, ThermoType>::inSubTree
                 }
                 else
                 {
-                    x=NULL;
+                    x=nullptr;
                     return false;
                 }
             }
@@ -116,7 +116,7 @@ bool Foam::binaryTree<CompType, ThermoType>::inSubTree
         }
         else // on right side (symetric of above)
         {
-            if (y->nodeRight() == NULL)
+            if (y->nodeRight() == nullptr)
             {
                 n2ndSearch_++;
                 if (y->leafRight()->inEOA(phiq))
@@ -134,7 +134,7 @@ bool Foam::binaryTree<CompType, ThermoType>::inSubTree
             }
             // if we reach this point, the retrieve has
             // failed on the right side, explore the left side
-            if ((n2ndSearch_ < max2ndSearch_) && y->nodeLeft() == NULL)
+            if ((n2ndSearch_ < max2ndSearch_) && y->nodeLeft() == nullptr)
             {
                 n2ndSearch_++;
                 if (y->leafLeft()->inEOA(phiq))
@@ -144,7 +144,7 @@ bool Foam::binaryTree<CompType, ThermoType>::inSubTree
                 }
                 else
                 {
-                    x=NULL;
+                    x=nullptr;
                     return false;
                 }
             }
@@ -164,7 +164,7 @@ bool Foam::binaryTree<CompType, ThermoType>::inSubTree
 template<class CompType, class ThermoType>
 void Foam::binaryTree<CompType, ThermoType>::deleteSubTree(bn* subTreeRoot)
 {
-    if (subTreeRoot != NULL)
+    if (subTreeRoot != nullptr)
     {
         deleteDemandDrivenData(subTreeRoot->leafLeft());
         deleteDemandDrivenData(subTreeRoot->leafRight());
@@ -178,10 +178,10 @@ void Foam::binaryTree<CompType, ThermoType>::deleteSubTree(bn* subTreeRoot)
 template<class CompType, class ThermoType>
 void Foam::binaryTree<CompType, ThermoType>::transplant(bn* u, bn* v)
 {
-    if (v != NULL)
+    if (v != nullptr)
     {
         // u is root_
-        if (u->parent() == NULL)
+        if (u->parent() == nullptr)
         {
             root_ = v;
         }
@@ -206,7 +206,7 @@ void Foam::binaryTree<CompType, ThermoType>::transplant(bn* u, bn* v)
     else
     {
         FatalErrorInFunction
-            << "trying to transplant a NULL node"
+            << "trying to transplant a nullptr node"
             << exit(FatalError);
     }
 }
@@ -216,11 +216,11 @@ template<class CompType, class ThermoType>
 Foam::chemPointISAT<CompType, ThermoType>*
 Foam::binaryTree<CompType, ThermoType>::chemPSibling(bn* y)
 {
-    if (y->parent()!=NULL)
+    if (y->parent()!=nullptr)
     {
         if (y == y->parent()->nodeLeft())// y is on the left, return right side
         {
-            // might return NULL if the right side is a node
+            // might return nullptr if the right side is a node
             return y->parent()->leafRight();
         }
         else if (y == y->parent()->nodeRight())
@@ -232,11 +232,11 @@ Foam::binaryTree<CompType, ThermoType>::chemPSibling(bn* y)
             FatalErrorInFunction
                 << "wrong addressing of the initial node"
                 << exit(FatalError);
-            return NULL;
+            return nullptr;
         }
     }
     // the binaryNode is root_ and has no sibling
-    return NULL;
+    return nullptr;
 }
 
 
@@ -249,7 +249,7 @@ Foam::binaryTree<CompType, ThermoType>::chemPSibling(chP* x)
         if (x == x->node()->leafLeft())
         {
             // x is on the left, return right side
-            // might return NULL if the right side is a node
+            // might return nullptr if the right side is a node
             return x->node()->leafRight();
         }
         else if (x == x->node()->leafRight())
@@ -262,11 +262,11 @@ Foam::binaryTree<CompType, ThermoType>::chemPSibling(chP* x)
             FatalErrorInFunction
                 << "wrong addressing of the initial leaf"
                 << exit(FatalError);
-            return NULL;
+            return nullptr;
         }
     }
     // there is only one leaf attached to the root_, no sibling
-    return NULL;
+    return nullptr;
 }
 
 
@@ -274,7 +274,7 @@ template<class CompType, class ThermoType>
 Foam::binaryNode<CompType, ThermoType>*
 Foam::binaryTree<CompType, ThermoType>::nodeSibling(bn* y)
 {
-    if (y->parent()!=NULL)
+    if (y->parent()!=nullptr)
     {
         if (y == y->parent()->nodeLeft())
         {
@@ -290,10 +290,10 @@ Foam::binaryTree<CompType, ThermoType>::nodeSibling(bn* y)
             FatalErrorInFunction
                 << "wrong addressing of the initial node"
                 << exit(FatalError);
-        return NULL;
+        return nullptr;
         }
     }
-    return NULL;
+    return nullptr;
 }
 
 
@@ -318,17 +318,17 @@ Foam::binaryTree<CompType, ThermoType>::nodeSibling(chP* x)
             FatalErrorInFunction
                 << "wrong addressing of the initial leaf"
                 << exit(FatalError);
-            return NULL;
+            return nullptr;
         }
     }
-    return NULL;
+    return nullptr;
 }
 
 
 template<class CompType, class ThermoType>
 void Foam::binaryTree<CompType, ThermoType>::deleteAllNode(bn* subTreeRoot)
 {
-    if (subTreeRoot != NULL)
+    if (subTreeRoot != nullptr)
     {
         deleteAllNode(subTreeRoot->nodeLeft());
         deleteAllNode(subTreeRoot->nodeRight());
@@ -347,7 +347,7 @@ Foam::binaryTree<CompType, ThermoType>::binaryTree
 )
 :
     chemistry_(chemistry),
-    root_(NULL),
+    root_(nullptr),
     maxNLeafs_(readLabel(coeffsDict.lookup("maxNLeafs"))),
     size_(0),
     n2ndSearch_(0),
@@ -361,7 +361,7 @@ template<class CompType, class ThermoType>
 Foam::label Foam::binaryTree<CompType, ThermoType>::depth(bn* subTreeRoot)
 {
     // when we reach the leaf, we return 0
-    if (subTreeRoot == NULL)
+    if (subTreeRoot == nullptr)
     {
         return 0;
     }
@@ -412,7 +412,7 @@ void Foam::binaryTree<CompType, ThermoType>::insertNewLeaf
     else // at least one point stored
     {
         // no reference chemPoint, a BT search is required
-        if (phi0 == NULL)
+        if (phi0 == nullptr)
         {
             binaryTreeSearch(phiq, root_,phi0);
         }
@@ -448,7 +448,7 @@ void Foam::binaryTree<CompType, ThermoType>::insertNewLeaf
         {
             // when size is 1, the binaryNode is without hyperplane
             deleteDemandDrivenData(root_);
-            newNode = new bn(phi0, newChemPoint, NULL);
+            newNode = new bn(phi0, newChemPoint, nullptr);
             root_ = newNode;
         }
 
@@ -478,7 +478,7 @@ void Foam::binaryTree<CompType, ThermoType>::binaryTreeSearch
 
         if (vPhi > a) // on right side (side of the newly added point)
         {
-            if (node->nodeRight()!=NULL)
+            if (node->nodeRight()!=nullptr)
             {
                 binaryTreeSearch(phiq, node->nodeRight(), nearest);
             }
@@ -490,7 +490,7 @@ void Foam::binaryTree<CompType, ThermoType>::binaryTreeSearch
         }
         else // on left side (side of the previously stored point)
         {
-            if (node->nodeLeft()!=NULL)
+            if (node->nodeLeft()!=nullptr)
             {
                 binaryTreeSearch(phiq, node->nodeLeft(), nearest);
             }
@@ -508,7 +508,7 @@ void Foam::binaryTree<CompType, ThermoType>::binaryTreeSearch
     }
     else // no point stored
     {
-        nearest = NULL;
+        nearest = nullptr;
     }
 }
 
@@ -525,7 +525,7 @@ bool Foam::binaryTree<CompType, ThermoType>::secondaryBTSearch
     if ((n2ndSearch_ < max2ndSearch_) && (size_ > 1))
     {
         chP* xS = chemPSibling(x);
-        if (xS != NULL)
+        if (xS != nullptr)
         {
             n2ndSearch_++;
             if (xS->inEOA(phiq))
@@ -541,10 +541,10 @@ bool Foam::binaryTree<CompType, ThermoType>::secondaryBTSearch
         // if we reach this point, no leafs were found at this depth or lower
         // we move upward in the tree
         bn* y = x->node();
-        while((y->parent()!= NULL) && (n2ndSearch_ < max2ndSearch_))
+        while((y->parent()!= nullptr) && (n2ndSearch_ < max2ndSearch_))
         {
             xS = chemPSibling(y);
-            if (xS != NULL)
+            if (xS != nullptr)
             {
                 n2ndSearch_++;
                 if (xS->inEOA(phiq))
@@ -586,10 +586,10 @@ void Foam::binaryTree<CompType, ThermoType>::deleteLeaf(chP*& phi0)
         bn* x;
         chP* siblingPhi0 = chemPSibling(phi0);
 
-        if (siblingPhi0 != NULL)// the sibling of phi0 is a chemPoint
+        if (siblingPhi0 != nullptr)// the sibling of phi0 is a chemPoint
         {
             // z was root (only two chemPoints in the tree)
-            if (z->parent() == NULL)
+            if (z->parent() == nullptr)
             {
                 root_ = new bn();
                 root_->leafLeft()=siblingPhi0;
@@ -598,13 +598,13 @@ void Foam::binaryTree<CompType, ThermoType>::deleteLeaf(chP*& phi0)
             else if (z==z->parent()->nodeLeft())
             {
                 z->parent()->leafLeft() = siblingPhi0;
-                z->parent()->nodeLeft() = NULL;
+                z->parent()->nodeLeft() = nullptr;
                 siblingPhi0->node() = z->parent();
             }
             else if (z == z->parent()->nodeRight())
             {
                 z->parent()->leafRight() = siblingPhi0;
-                z->parent()->nodeRight() = NULL;
+                z->parent()->nodeRight() = nullptr;
                 siblingPhi0->node() = z->parent();
             }
             else
@@ -617,7 +617,7 @@ void Foam::binaryTree<CompType, ThermoType>::deleteLeaf(chP*& phi0)
         else
         {
             x = nodeSibling(phi0);
-            if (x !=NULL)
+            if (x !=nullptr)
             {
                 transplant(z, x);
             }
@@ -646,7 +646,7 @@ void Foam::binaryTree<CompType, ThermoType>::balance()
     List<chP*> chemPoints(size_);
     label chPi=0;
     //2) compute the mean composition
-    while(x!=NULL)
+    while(x!=nullptr)
     {
         const scalarField& phij = x->phi();
         mean += phij;
@@ -691,14 +691,14 @@ void Foam::binaryTree<CompType, ThermoType>::balance()
     phiMaxDir.sort();
     // delete reference to all node since the tree is reshaped
     deleteAllNode();
-    root_=NULL;
+    root_=nullptr;
 
     // add the node for the two extremum
     bn* newNode = new bn
         (
             chemPoints[phiMaxDir.indices()[0]],
             chemPoints[phiMaxDir.indices()[phiMaxDir.size()-1]],
-            NULL
+            nullptr
         );
     root_ = newNode;
 
@@ -729,9 +729,9 @@ template<class CompType, class ThermoType>
 Foam::chemPointISAT<CompType, ThermoType>*
 Foam::binaryTree<CompType, ThermoType>::treeMin(bn* subTreeRoot)
 {
-    if (subTreeRoot!=NULL)
+    if (subTreeRoot!=nullptr)
     {
-        while(subTreeRoot->nodeLeft() != NULL)
+        while(subTreeRoot->nodeLeft() != nullptr)
         {
             subTreeRoot = subTreeRoot->nodeLeft();
         }
@@ -739,7 +739,7 @@ Foam::binaryTree<CompType, ThermoType>::treeMin(bn* subTreeRoot)
     }
     else
     {
-        return NULL;
+        return nullptr;
     }
 }
 
@@ -752,7 +752,7 @@ Foam::binaryTree<CompType, ThermoType>::treeSuccessor(chP* x)
     {
         if (x == x->node()->leafLeft())
         {
-            if (x->node()->nodeRight() == NULL)
+            if (x->node()->nodeRight() == nullptr)
             {
                 return x->node()->leafRight();
             }
@@ -764,11 +764,11 @@ Foam::binaryTree<CompType, ThermoType>::treeSuccessor(chP* x)
         else if (x == x->node()->leafRight())
         {
             bn* y = x->node();
-            while((y->parent() !=NULL))
+            while((y->parent() !=nullptr))
             {
                 if (y == y->parent()->nodeLeft())
                 {
-                    if (y->parent()->nodeRight() == NULL)
+                    if (y->parent()->nodeRight() == nullptr)
                     {
                         return y->parent()->leafRight();
                     }
@@ -782,18 +782,18 @@ Foam::binaryTree<CompType, ThermoType>::treeSuccessor(chP* x)
             // when we reach this point, y points to the root and
             // never entered in the if loop (coming from the right)
             // so we are at the tree maximum and there is no successor
-            return NULL;
+            return nullptr;
         }
         else
         {
             FatalErrorInFunction
                 << "inconsistent structure of the tree, no leaf and no node"
                 << exit(FatalError);
-            return NULL;
+            return nullptr;
         }
     }
 
-    return NULL;
+    return nullptr;
 }
 
 
@@ -803,8 +803,8 @@ void Foam::binaryTree<CompType, ThermoType>::clear()
     // recursively delete the element in the subTree
     deleteSubTree();
 
-    // reset root node (should already be NULL)
-    root_=NULL;
+    // reset root node (should already be nullptr)
+    root_=nullptr;
 
     // reset size_
     size_=0;
diff --git a/src/thermophysicalModels/chemistryModel/chemistryModel/TDACChemistryModel/tabulation/ISAT/chemPointISAT/chemPointISAT.H b/src/thermophysicalModels/chemistryModel/chemistryModel/TDACChemistryModel/tabulation/ISAT/chemPointISAT/chemPointISAT.H
index 386174327c0..f1cff9013df 100644
--- a/src/thermophysicalModels/chemistryModel/chemistryModel/TDACChemistryModel/tabulation/ISAT/chemPointISAT/chemPointISAT.H
+++ b/src/thermophysicalModels/chemistryModel/chemistryModel/TDACChemistryModel/tabulation/ISAT/chemPointISAT/chemPointISAT.H
@@ -237,7 +237,7 @@ public:
             const scalar& tolerance,
             const label& completeSpaceSize,
             const dictionary& coeffsDict,
-            binaryNode<CompType, ThermoType>* node = NULL
+            binaryNode<CompType, ThermoType>* node = nullptr
         );
 
         //- Construct from another chemPoint and reference to a binary node
diff --git a/src/thermophysicalModels/properties/liquidProperties/liquidProperties/liquidProperties.C b/src/thermophysicalModels/properties/liquidProperties/liquidProperties/liquidProperties.C
index 042e11df953..57f6e789553 100644
--- a/src/thermophysicalModels/properties/liquidProperties/liquidProperties/liquidProperties.C
+++ b/src/thermophysicalModels/properties/liquidProperties/liquidProperties/liquidProperties.C
@@ -157,7 +157,7 @@ Foam::autoPtr<Foam::liquidProperties> Foam::liquidProperties::New(Istream& is)
             << ", should be coeffs or defaultCoeffs"
             << abort(FatalError);
 
-        return autoPtr<liquidProperties>(NULL);
+        return autoPtr<liquidProperties>(nullptr);
     }
 }
 
diff --git a/src/thermophysicalModels/properties/solidProperties/solidProperties/solidPropertiesNew.C b/src/thermophysicalModels/properties/solidProperties/solidProperties/solidPropertiesNew.C
index 203e7e2a27f..e9c34b5726b 100644
--- a/src/thermophysicalModels/properties/solidProperties/solidProperties/solidPropertiesNew.C
+++ b/src/thermophysicalModels/properties/solidProperties/solidProperties/solidPropertiesNew.C
@@ -66,7 +66,7 @@ Foam::autoPtr<Foam::solidProperties> Foam::solidProperties::New(Istream& is)
             << ", should be coeffs or defaultCoeffs"
             << exit(FatalError);
 
-        return autoPtr<solidProperties>(NULL);
+        return autoPtr<solidProperties>(nullptr);
     }
 }
 
diff --git a/src/thermophysicalModels/radiation/radiationModels/radiationModel/radiationModel.C b/src/thermophysicalModels/radiation/radiationModels/radiationModel/radiationModel.C
index c8ae902c49e..22312d5dad7 100644
--- a/src/thermophysicalModels/radiation/radiationModels/radiationModel/radiationModel.C
+++ b/src/thermophysicalModels/radiation/radiationModels/radiationModel/radiationModel.C
@@ -2,7 +2,7 @@
   =========                 |
   \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox
    \\    /   O peration     |
-    \\  /    A nd           | Copyright (C) 2011-2015 OpenFOAM Foundation
+    \\  /    A nd           | Copyright (C) 2011-2016 OpenFOAM Foundation
      \\/     M anipulation  |
 -------------------------------------------------------------------------------
 License
@@ -112,9 +112,9 @@ Foam::radiation::radiationModel::radiationModel(const volScalarField& T)
     coeffs_(dictionary::null),
     solverFreq_(0),
     firstIter_(true),
-    absorptionEmission_(NULL),
-    scatter_(NULL),
-    soot_(NULL)
+    absorptionEmission_(nullptr),
+    scatter_(nullptr),
+    soot_(nullptr)
 {}
 
 
@@ -132,9 +132,9 @@ Foam::radiation::radiationModel::radiationModel
     coeffs_(subOrEmptyDict(type + "Coeffs")),
     solverFreq_(1),
     firstIter_(true),
-    absorptionEmission_(NULL),
-    scatter_(NULL),
-    soot_(NULL)
+    absorptionEmission_(nullptr),
+    scatter_(nullptr),
+    soot_(nullptr)
 {
     if (readOpt() == IOobject::NO_READ)
     {
@@ -171,9 +171,9 @@ Foam::radiation::radiationModel::radiationModel
     coeffs_(subOrEmptyDict(type + "Coeffs")),
     solverFreq_(1),
     firstIter_(true),
-    absorptionEmission_(NULL),
-    scatter_(NULL),
-    soot_(NULL)
+    absorptionEmission_(nullptr),
+    scatter_(nullptr),
+    soot_(nullptr)
 {
     initialise();
 }
diff --git a/src/thermophysicalModels/radiation/submodels/sootModel/noSoot/noSoot.C b/src/thermophysicalModels/radiation/submodels/sootModel/noSoot/noSoot.C
index 42429fc5c72..dd7ee27b91d 100644
--- a/src/thermophysicalModels/radiation/submodels/sootModel/noSoot/noSoot.C
+++ b/src/thermophysicalModels/radiation/submodels/sootModel/noSoot/noSoot.C
@@ -66,7 +66,7 @@ void Foam::radiation::noSoot::correct()
 const Foam::volScalarField& Foam::radiation::noSoot::soot() const
 {
     NotImplemented;
-    return tmp<volScalarField>(NULL);
+    return tmp<volScalarField>(nullptr);
 }
 
 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
diff --git a/src/topoChangerFvMesh/mixerFvMesh/mixerFvMesh.C b/src/topoChangerFvMesh/mixerFvMesh/mixerFvMesh.C
index 6f085b5cff4..dec25b57461 100644
--- a/src/topoChangerFvMesh/mixerFvMesh/mixerFvMesh.C
+++ b/src/topoChangerFvMesh/mixerFvMesh/mixerFvMesh.C
@@ -304,7 +304,7 @@ Foam::mixerFvMesh::mixerFvMesh
         )
     ),
     rpm_(readScalar(motionDict_.lookup("rpm"))),
-    movingPointsMaskPtr_(NULL)
+    movingPointsMaskPtr_(nullptr)
 {
     addZonesAndModifiers();
 
diff --git a/src/triSurface/tools/labelledTri/sortLabelledTri.H b/src/triSurface/tools/labelledTri/sortLabelledTri.H
index 67ae6ee965b..593ebe1eaf9 100644
--- a/src/triSurface/tools/labelledTri/sortLabelledTri.H
+++ b/src/triSurface/tools/labelledTri/sortLabelledTri.H
@@ -2,7 +2,7 @@
   =========                 |
   \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox
    \\    /   O peration     |
-    \\  /    A nd           | Copyright (C) 2011-2015 OpenFOAM Foundation
+    \\  /    A nd           | Copyright (C) 2011-2016 OpenFOAM Foundation
      \\/     M anipulation  |
 -------------------------------------------------------------------------------
 License
@@ -82,7 +82,7 @@ public:
         //- Construct null
         surfAndLabel()
         :
-            surfPtr_(NULL),
+            surfPtr_(nullptr),
             index_(-1)
         {}
 
diff --git a/src/triSurface/triSurface/triSurface.C b/src/triSurface/triSurface/triSurface.C
index decb3a90d79..032423dd98b 100644
--- a/src/triSurface/triSurface/triSurface.C
+++ b/src/triSurface/triSurface/triSurface.C
@@ -595,8 +595,8 @@ Foam::triSurface::triSurface()
 :
     ParentType(List<Face>(), pointField()),
     patches_(0),
-    sortedEdgeFacesPtr_(NULL),
-    edgeOwnerPtr_(NULL)
+    sortedEdgeFacesPtr_(nullptr),
+    edgeOwnerPtr_(nullptr)
 {}
 
 
@@ -610,8 +610,8 @@ Foam::triSurface::triSurface
 :
     ParentType(triangles, points),
     patches_(patches),
-    sortedEdgeFacesPtr_(NULL),
-    edgeOwnerPtr_(NULL)
+    sortedEdgeFacesPtr_(nullptr),
+    edgeOwnerPtr_(nullptr)
 {}
 
 
@@ -625,8 +625,8 @@ Foam::triSurface::triSurface
 :
     ParentType(triangles, points, reuse),
     patches_(patches),
-    sortedEdgeFacesPtr_(NULL),
-    edgeOwnerPtr_(NULL)
+    sortedEdgeFacesPtr_(nullptr),
+    edgeOwnerPtr_(nullptr)
 {}
 
 
@@ -639,8 +639,8 @@ Foam::triSurface::triSurface
 :
     ParentType(triangles, points),
     patches_(patches),
-    sortedEdgeFacesPtr_(NULL),
-    edgeOwnerPtr_(NULL)
+    sortedEdgeFacesPtr_(nullptr),
+    edgeOwnerPtr_(nullptr)
 {}
 
 
@@ -652,8 +652,8 @@ Foam::triSurface::triSurface
 :
     ParentType(triangles, points),
     patches_(),
-    sortedEdgeFacesPtr_(NULL),
-    edgeOwnerPtr_(NULL)
+    sortedEdgeFacesPtr_(nullptr),
+    edgeOwnerPtr_(nullptr)
 {
     setDefaultPatches();
 }
@@ -667,8 +667,8 @@ Foam::triSurface::triSurface
 :
     ParentType(convertToTri(triangles, 0), points),
     patches_(),
-    sortedEdgeFacesPtr_(NULL),
-    edgeOwnerPtr_(NULL)
+    sortedEdgeFacesPtr_(nullptr),
+    edgeOwnerPtr_(nullptr)
 {
     setDefaultPatches();
 }
@@ -678,8 +678,8 @@ Foam::triSurface::triSurface(const fileName& name)
 :
     ParentType(List<Face>(), pointField()),
     patches_(),
-    sortedEdgeFacesPtr_(NULL),
-    edgeOwnerPtr_(NULL)
+    sortedEdgeFacesPtr_(nullptr),
+    edgeOwnerPtr_(nullptr)
 {
     word ext = name.ext();
 
@@ -693,8 +693,8 @@ Foam::triSurface::triSurface(Istream& is)
 :
     ParentType(List<Face>(), pointField()),
     patches_(),
-    sortedEdgeFacesPtr_(NULL),
-    edgeOwnerPtr_(NULL)
+    sortedEdgeFacesPtr_(nullptr),
+    edgeOwnerPtr_(nullptr)
 {
     read(is);
 
@@ -706,8 +706,8 @@ Foam::triSurface::triSurface(const Time& d)
 :
     ParentType(List<Face>(), pointField()),
     patches_(),
-    sortedEdgeFacesPtr_(NULL),
-    edgeOwnerPtr_(NULL)
+    sortedEdgeFacesPtr_(nullptr),
+    edgeOwnerPtr_(nullptr)
 {
     fileName foamFile(d.caseName() + ".ftr");
 
@@ -725,8 +725,8 @@ Foam::triSurface::triSurface(const triSurface& ts)
 :
     ParentType(ts, ts.points()),
     patches_(ts.patches()),
-    sortedEdgeFacesPtr_(NULL),
-    edgeOwnerPtr_(NULL)
+    sortedEdgeFacesPtr_(nullptr),
+    edgeOwnerPtr_(nullptr)
 {}
 
 
-- 
GitLab