From 660f3e5492f9589f0f742b112da75543ca9acc4f Mon Sep 17 00:00:00 2001
From: Mark Olesen <Mark.Olesen@esi-group.com>
Date: Mon, 26 Feb 2018 12:00:00 +0100
Subject: [PATCH] ENH: cleanup autoPtr class (issue #639)

Improve alignment of its behaviour with std::unique_ptr

  - element_type typedef
  - release() method - identical to ptr() method
  - get() method to get the pointer without checking and without releasing it.
  - operator*() for dereferencing

Method name changes

  - renamed rawPtr() to get()
  - renamed rawRef() to ref(), removed unused const version.

Removed methods/operators

  - assignment from a raw pointer was deleted (was rarely used).
    Can be convenient, but uncontrolled and potentially unsafe.
    Do allow assignment from a literal nullptr though, since this
    can never leak (and also corresponds to the unique_ptr API).

Additional methods

  - clone() method: forwards to the clone() method of the underlying
    data object with argument forwarding.

  - reset(autoPtr&&) as an alternative to operator=(autoPtr&&)

STYLE: avoid implicit conversion from autoPtr to object type in many places

- existing implementation has the following:

     operator const T&() const { return operator*(); }

  which means that the following code works:

       autoPtr<mapPolyMesh> map = ...;
       updateMesh(*map);    // OK: explicit dereferencing
       updateMesh(map());   // OK: explicit dereferencing
       updateMesh(map);     // OK: implicit dereferencing

  for clarity it may preferable to avoid the implicit dereferencing

- prefer operator* to operator() when deferenced a return value
  so it is clearer that a pointer is involve and not a function call
  etc    Eg,   return *meshPtr_;  vs.  return meshPtr_();
---
 .../solvers/combustion/PDRFoam/createFields.H |   4 +-
 .../twoPhaseMixtureThermo.H                   |   8 +-
 .../phaseModel/phaseModel.C                   |   2 +-
 .../phaseModel/phaseModel.H                   |   4 +-
 ...incompressibleTwoPhaseInteractingMixture.H |   4 +-
 .../incompressibleThreePhaseMixture.H         |   6 +-
 .../multiphaseSystem/phaseModel/phaseModel.C  |   2 +-
 .../multiphaseSystem/phaseModel/phaseModel.H  |   4 +-
 .../multiphaseMixture/phase/phase.C           |   2 +-
 .../multiphaseMixture/phase/phase.H           |   2 +-
 .../HeatAndMassTransferPhaseSystem.C          |  49 +---
 .../HeatTransferPhaseSystem.C                 |  12 +-
 ...terfaceCompositionPhaseChangePhaseSystem.C |  34 +--
 .../MomentumTransferPhaseSystem.C             | 101 ++-----
 .../ThermalPhaseChangePhaseSystem.C           |  48 +---
 .../MovingPhaseModel/MovingPhaseModel.C       |   2 +-
 .../phaseModel/phaseModel/phaseModel.C        |   2 +-
 .../phaseSystem/phaseSystemTemplates.C        |  10 +-
 .../reactingMultiphaseEulerFoam/pU/pEqn.H     |   9 +-
 .../IATE/IATEsources/IATEsource/IATEsource.H  |   2 +-
 .../BlendedInterfacialModel.C                 |   8 +-
 .../IATE/IATEsources/IATEsource/IATEsource.H  |   2 +-
 .../twoPhaseSystem/phaseModel/phaseModel.C    |   4 +-
 .../twoPhaseSystem/phaseModel/phaseModel.H    |   8 +-
 .../twoPhaseSystem/twoPhaseSystem.C           |  62 ++---
 .../solidDisplacementFoam/createFields.H      |   2 +-
 applications/test/autoPtr/Make/files          |   3 +
 applications/test/autoPtr/Make/options        |   5 +
 applications/test/autoPtr/Test-autoPtr.C      | 219 +++++++++++++++
 .../test/fieldMapping/Test-fieldMapping.C     |   4 +-
 applications/test/hexRef8/Test-hexRef8.C      |   4 +-
 .../utilities/mesh/advanced/PDRMesh/PDRMesh.C |   8 +-
 .../advanced/collapseEdges/collapseEdges.C    |  10 +-
 .../combinePatchFaces/combinePatchFaces.C     |   6 +-
 .../advanced/refineHexMesh/refineHexMesh.C    |   4 +-
 .../mesh/advanced/removeFaces/removeFaces.C   |  10 +-
 .../mesh/advanced/selectCells/selectCells.C   |  12 +-
 .../mesh/conversion/ccm/ccmToFoam/ccmToFoam.C |   4 +-
 .../mesh/conversion/star4ToFoam/star4ToFoam.C |   2 +-
 .../conversion/tetgenToFoam/tetgenToFoam.C    |   2 +-
 .../extrude/extrudeMesh/extrudeMesh.C         |   8 +-
 .../extrudeToRegionMesh/extrudeToRegionMesh.C |   4 +-
 .../extrude2DMesh/extrude2DMeshApp.C          |   4 +-
 .../DelaunayMesh/DistributedDelaunayMesh.C    |  10 +-
 .../DelaunayMesh/DistributedDelaunayMesh.H    |   2 +-
 .../backgroundMeshDecomposition.C             |  24 +-
 .../backgroundMeshDecomposition.H             |   2 +-
 .../backgroundMeshDecompositionI.H            |   2 +-
 .../conformalVoronoiMesh.C                    |   6 +-
 .../conformalVoronoiMeshI.H                   |   2 +-
 .../conformalVoronoiMeshTemplates.C           |   2 +-
 .../initialPointsMethod/initialPointsMethod.C |   6 -
 .../initialPointsMethod/initialPointsMethod.H |   4 +-
 .../searchableSurfaceFeatures.H               |   2 +-
 .../foamyMesh/foamyQuadMesh/foamyQuadMesh.C   |   2 +-
 .../manipulation/checkMesh/checkGeometry.C    |   6 +-
 .../manipulation/checkMesh/checkTopology.C    |   6 +-
 .../createBaffles/createBaffles.C             |   5 +-
 .../faceSelection/faceSelection.H             |   2 +-
 .../faceSelection/faceZoneSelection.H         |   2 +-
 .../searchableSurfaceSelection.H              |   2 +-
 .../mergeOrSplitBaffles/mergeOrSplitBaffles.C |   4 +-
 .../polyDualMesh/polyDualMeshApp.C            |   2 +-
 .../manipulation/renumberMesh/renumberMesh.C  |   2 +-
 .../mesh/manipulation/setSet/setSet.C         |   4 +-
 .../reconstructParMesh/reconstructParMesh.C   |   8 +-
 .../redistributePar/redistributePar.C         |  19 +-
 .../ensightOutputCloudTemplates.C             |   2 +-
 .../ensightOutputSerialCloudTemplates.C       |   2 +-
 .../foamToEnsightParts/foamToEnsightParts.C   |   2 +-
 .../foamToVTK/foamVtkLagrangianWriter.H       |   2 +-
 .../miscellaneous/pdfPlot/createFields.H      |   2 +-
 .../searchableSurfaceModifier/autoPatch.H     |   2 +-
 .../searchableSurfaceModifier/cut.H           |   2 +-
 .../searchableSurfaceModifier.H               |   2 +-
 .../dynamicIndexedOctree.C                    |  42 ++-
 .../dynamicIndexedOctree.H                    |   2 +-
 .../decomposedBlockData/decomposedBlockData.C |  78 +++---
 src/OpenFOAM/db/IOstreams/token/token.C       |   6 -
 src/OpenFOAM/db/IOstreams/token/token.H       |  22 +-
 src/OpenFOAM/db/Time/Time.H                   |   2 +-
 src/OpenFOAM/db/dictionary/entry/entryIO.C    |   2 +-
 .../functionObject/functionObject.H           |   2 +-
 .../functionObjectList/functionObjectList.C   |   4 +-
 .../timeControl/timeControlFunctionObjectI.H  |   2 +-
 .../db/functionObjects/writeFile/writeFile.C  |   2 +-
 src/OpenFOAM/db/regIOobject/regIOobjectRead.C |   4 +-
 .../codedFixedValuePointPatchField.C          |   2 +-
 .../uniformFixedValuePointPatchField.C        |   6 +-
 .../fileOperation/fileOperation.C             |   7 +-
 .../LUscalarMatrix/procLduInterface.H         |   2 +-
 .../lduMatrix/lduMatrixPreconditioner.C       |   2 +-
 .../lduMatrix/lduMatrix/lduMatrixSmoother.C   |   2 +-
 .../lduMatrix/lduMatrix/lduMatrixSolver.C     |   2 +-
 .../GAMGAgglomeration/GAMGAgglomeration.C     |   2 +-
 src/OpenFOAM/memory/autoPtr/autoPtr.H         | 253 +++++++++++++-----
 src/OpenFOAM/memory/autoPtr/autoPtrI.H        | 213 +++++++++------
 .../polyMesh/globalMeshData/globalMeshData.C  |  59 ++--
 .../polyMesh/globalMeshData/globalPoints.H    |   4 +-
 .../mapDistribute/mapDistributeBase.C         |   2 +-
 .../meshes/polyMesh/mapPolyMesh/mapPolyMesh.C |  12 +-
 .../meshes/polyMesh/mapPolyMesh/mapPolyMesh.H |   2 +-
 .../polyBoundaryMesh/polyBoundaryMesh.C       |   7 +-
 src/OpenFOAM/meshes/polyMesh/polyMesh.C       |  12 +-
 src/OpenFOAM/meshes/polyMesh/polyMeshIO.C     |   2 +-
 .../constraint/processor/processorPolyPatch.C |   4 +-
 .../functions/Function1/Scale/Scale.C         |   4 +-
 .../functions/Function1/Sine/Sine.C           |   8 +-
 .../functions/Function1/Square/Square.C       |   8 +-
 .../functions/Function1/Table/TableBase.C     |   2 +-
 ...allHeatFluxTemperatureFvPatchScalarField.C |   6 +-
 .../thermalBaffle1DFvPatchScalarField.C       |   2 +-
 .../turbulenceModels/LES/LESModel/LESModel.H  |   2 +-
 .../LES/LESdeltas/IDDESDelta/IDDESDelta.H     |   2 +-
 .../RAS/kOmegaSSTSAS/kOmegaSSTSAS.H           |   2 +-
 .../porousBafflePressureFvPatchField.C        |  14 +-
 .../psiThermoCombustion/psiThermoCombustion.C |   4 +-
 .../rhoThermoCombustion/rhoThermoCombustion.C |   4 +-
 src/conversion/common/reader/meshReader.C     |  15 +-
 src/conversion/ensight/mesh/ensightMeshI.H    |   2 +-
 .../ensight/mesh/ensightMeshOptions.C         |   4 +-
 src/conversion/ensight/output/ensightOutput.H |   2 +-
 .../ensight/output/ensightSerialOutput.H      |   4 +-
 .../vtk/output/foamVtkInternalWriter.H        |   2 +-
 .../vtk/output/foamVtkPatchWriter.H           |   2 +-
 .../vtk/output/foamVtkSurfaceMeshWriter.H     |   2 +-
 .../dynamicMotionSolverFvMesh.C               |   2 +-
 .../dynamicRefineFvMesh/dynamicRefineFvMesh.C |  61 ++---
 .../extrudePatchMesh/extrudePatchMesh.C       |  12 +-
 .../extrudePatchMesh/extrudePatchMesh.H       |   2 +-
 src/dynamicMesh/fvMeshAdder/fvMeshAdder.C     |  35 +--
 .../fvMeshDistribute/fvMeshDistribute.C       |  25 +-
 src/dynamicMesh/fvMeshSubset/fvMeshSubset.C   |   6 +-
 src/dynamicMesh/meshCut/cellCuts/cellCuts.H   |   2 +-
 .../meshCut/cellLooper/cellLooper.H           |   2 +-
 .../multiDirRefinement/multiDirRefinement.C   |   2 +-
 ...yMotionDisplacementPointPatchVectorField.C |   2 +-
 ...yMotionDisplacementPointPatchVectorField.H |   2 +-
 .../motionSolvers/motionSolver/motionSolver.C |   2 +-
 .../polyMeshAdder/faceCoupleInfo.H            |   6 +-
 .../polyTopoChange/hexRef8/hexRef8.C          |   2 +-
 .../polyTopoChanger/polyTopoChanger.C         |   2 +-
 .../repatchPolyTopoChanger.C                  |   2 +-
 src/engine/enginePiston/enginePiston.H        |   2 +-
 src/engine/engineValve/engineValve.H          |   2 +-
 .../cfdTools/general/MRF/MRFZone.H            |   2 +-
 .../cfdTools/general/fvOptions/fvOption.H     |   2 +-
 .../porosityModel/porosityModel.C             |   2 +-
 .../codedFixedValueFvPatchField.C             |   2 +-
 .../codedMixed/codedMixedFvPatchField.C       |   2 +-
 ...lindricalInletVelocityFvPatchVectorField.C |  18 +-
 .../derived/fixedMean/fixedMeanFvPatchField.C |   6 +-
 .../fixedProfile/fixedProfileFvPatchField.C   |   6 +-
 .../flowRateInletVelocityFvPatchVectorField.C |   6 +-
 ...flowRateOutletVelocityFvPatchVectorField.C |   6 +-
 ...ureInletOutletVelocityFvPatchVectorField.C |   6 +-
 ...ureInletOutletVelocityFvPatchVectorField.H |   2 +-
 .../rotatingTotalPressureFvPatchScalarField.C |   6 +-
 .../rotatingWallVelocityFvPatchVectorField.C  |   8 +-
 ...lFlowRateInletVelocityFvPatchVectorField.C |  12 +-
 .../swirlInletVelocityFvPatchVectorField.C    |  18 +-
 .../timeVaryingMappedFixedValueFvPatchField.C |   6 +-
 ...ranslatingWallVelocityFvPatchVectorField.C |   8 +-
 .../turbulentDFSEMInletFvPatchVectorField.C   |   2 +-
 .../uniformFixedGradientFvPatchField.C        |   6 +-
 .../uniformFixedValueFvPatchField.C           |   6 +-
 .../uniformInletOutletFvPatchField.C          |   6 +-
 .../uniformJump/uniformJumpFvPatchField.C     |   6 +-
 .../uniformJumpAMIFvPatchField.C              |   6 +-
 .../uniformTotalPressureFvPatchScalarField.C  |   6 +-
 ...tFlowRateInletVelocityFvPatchVectorField.C |   6 +-
 .../CrankNicolsonDdtScheme.C                  |   5 +-
 .../extendedCentredCellToCellStencil.H        |   2 +-
 .../extendedCentredCellToFaceStencil.H        |   2 +-
 .../extendedUpwindCellToFaceStencil.H         |   4 +-
 .../extendedCentredFaceToCellStencil.H        |   2 +-
 .../field/streamLine/streamLineBase.C         |   2 +-
 .../codedFunctionObject/codedFunctionObject.C |   2 +-
 .../utilities/ensightWrite/ensightWrite.H     |   4 +-
 .../displacementSBRStressFvMotionSolver.H     |   2 +-
 .../displacementLaplacianFvMotionSolver.C     |   3 +-
 ...dBodyDisplacementLaplacianFvMotionSolver.C |   3 +-
 ...surfaceDisplacementPointPatchVectorField.C |   3 +-
 ...aceSlipDisplacementPointPatchVectorField.C |   3 +-
 ...meVaryingMappedFixedValuePointPatchField.C |   6 +-
 .../interRegionOption/interRegionOptionI.H    |   2 +-
 .../jouleHeatingSource/jouleHeatingSource.C   |   2 +-
 .../sources/general/codedSource/CodedSource.C |   2 +-
 .../interRegionHeatTransferModelI.H           |   4 +-
 .../tabulatedHeatTransfer.C                   |   4 +-
 .../tabulatedNTUHeatTransfer.C                |   2 +-
 .../variableHeatTransfer.C                    |   8 +-
 .../variableHeatTransfer.H                    |   9 +-
 .../clouds/Templates/DSMCCloud/DSMCCloudI.H   |  10 +-
 .../InteractionLists/InteractionListsI.H      |   4 +-
 .../CollidingCloud/CollidingCloudI.H          |   6 +-
 .../Templates/KinematicCloud/KinematicCloud.C |   7 -
 .../Templates/KinematicCloud/KinematicCloud.H |   2 +-
 .../KinematicCloud/KinematicCloudI.H          |  30 +--
 .../clouds/Templates/MPPICCloud/MPPICCloudI.H |  14 +-
 .../Templates/ReactingCloud/ReactingCloud.C   |   7 -
 .../Templates/ReactingCloud/ReactingCloud.H   |   2 +-
 .../Templates/ReactingCloud/ReactingCloudI.H  |   8 +-
 .../ReactingMultiphaseCloudI.H                |   6 +-
 .../Templates/ThermoCloud/ThermoCloud.C       |   7 -
 .../Templates/ThermoCloud/ThermoCloud.H       |   2 +-
 .../Templates/ThermoCloud/ThermoCloudI.H      |  38 ++-
 .../KinematicParcelTrackingDataI.H            |   6 +-
 .../MPPICParcel/MPPICParcelTrackingDataI.H    |   6 +-
 .../ReactingParcelTrackingDataI.H             |   2 +-
 .../ThermoParcel/ThermoParcelTrackingDataI.H  |   8 +-
 .../ParticleTracks/ParticleTracksI.H          |   2 +-
 .../CellZoneInjection/CellZoneInjection.C     |   2 +-
 .../ConeInjection/ConeInjection.C             |   2 +-
 .../ConeNozzleInjection/ConeNozzleInjection.C |   2 +-
 .../FieldActivatedInjection.C                 |   2 +-
 .../InflationInjection/InflationInjection.C   |   2 +-
 .../ManualInjection/ManualInjection.C         |   2 +-
 .../PatchFlowRateInjection.C                  |   2 +-
 .../PatchInjection/PatchInjection.C           |   2 +-
 .../Lift/LiftForce/LiftForceI.H               |   2 +-
 .../PressureGradient/PressureGradientForceI.H |   2 +-
 .../LocalInteraction/LocalInteraction.C       |   4 +-
 .../AveragingMethod/AveragingMethod.C         |   7 -
 .../AveragingMethod/AveragingMethod.H         |   2 +-
 .../MPPIC/AveragingMethods/Dual/Dual.C        |  26 +-
 .../MPPIC/AveragingMethods/Dual/Dual.H        |  12 +-
 .../pairPotentialList/pairPotentialListI.H    |   3 +-
 .../clouds/Templates/SprayCloud/SprayCloudI.H |   6 +-
 src/lumpedPointMotion/lumpedPointMovement.C   |   2 +-
 .../blockEdges/blockEdge/blockEdge.C          |   2 +-
 .../blockFaces/blockFace/blockFace.C          |   2 +-
 .../blockVertices/blockVertex/blockVertex.C   |   4 +-
 src/mesh/blockMesh/blocks/block/block.H       |   2 +-
 .../displacementMeshMoverMotionSolver.C       |   2 +-
 .../medialAxisMeshMover.C                     |   4 +-
 .../meshRefinement/meshRefinement.C           |  46 ++--
 .../meshRefinement/meshRefinementBaffles.C    |  60 +++--
 .../meshRefinement/meshRefinementMerge.C      |  44 +--
 .../meshRefinement/meshRefinementRefine.C     |   9 +-
 .../refinementFeatures/refinementFeatures.C   |   3 +-
 .../snappyHexMeshDriver/snappyLayerDriver.C   |  66 ++---
 .../AMIInterpolation/AMIInterpolationI.H      |   4 +-
 .../cyclicACMIGAMGInterface.H                 |   2 +-
 .../cyclicAMIGAMGInterface.H                  |   2 +-
 .../cyclicACMIPointPatchField.H               |   4 +-
 .../cyclicAMIPointPatchField.H                |   4 +-
 .../cyclicAMIPolyPatch/cyclicAMIPolyPatch.C   |   2 +-
 .../coordinateRotation/cylindrical.C          |   8 +-
 .../coordinateRotation/cylindrical.H          |   2 +-
 .../coordinateSystems/coordinateSystem.C      |  92 ++++---
 .../coordinateSystems/coordinateSystem.H      |  34 ++-
 src/meshTools/edgeMesh/edgeMesh.C             |   2 +-
 .../extendedEdgeMesh/extendedEdgeMesh.C       |   8 +-
 .../mappedPolyPatch/mappedPatchBaseI.H        |   4 +-
 src/meshTools/meshSearch/meshSearch.C         |   4 +-
 .../regionCoupledBaseGAMGInterface.H          |   2 +-
 .../regionCoupledBase.C                       |   2 +-
 src/meshTools/regionSplit/regionSplit.H       |   2 +-
 .../searchableSurface/searchableSurface.H     |   2 +-
 .../triSurfaceMesh/triSurfaceMesh.C           |   3 +-
 .../sets/topoSetSource/topoSetSource.H        |   2 +-
 src/meshTools/sets/topoSets/topoSet.H         |   2 +-
 .../triSurfaceSearch/triSurfaceSearch.C       |   2 +-
 .../dynamicOversetFvMesh.C                    |   4 +-
 .../oversetPolyPatch/oversetGAMGInterface.H   |   2 +-
 .../decompose/decompose/decompositionModel.H  |   2 +-
 .../distributedTriSurfaceMesh.C               |   2 +-
 .../pyrolysisModel/pyrolysisModel.H           |   2 +-
 .../regionModel/regionModel/regionModelI.H    |   8 +-
 .../regionModel1D/regionModel1DI.H            |   2 +-
 .../singleLayerRegion/singleLayerRegion.C     |   4 +-
 ...linedFilmNusseltHeightFvPatchScalarField.C |  18 +-
 ...lmNusseltInletVelocityFvPatchVectorField.C |  18 +-
 .../kinematicSingleLayerI.H                   |   4 +-
 .../thermoSingleLayer/thermoSingleLayerI.H    |   8 +-
 .../thermalBaffle/thermalBaffle.C             |   2 +-
 .../bodies/compositeBody/compositeBodyI.H     |   2 +-
 .../bodies/subBody/subBodyI.H                 |   2 +-
 .../joints/floating/floatingJoint.C           |  13 +-
 .../joints/floating/floatingJoint.H           |   4 +-
 .../rigidBodyMeshMotion/rigidBodyMeshMotion.C |   2 +-
 .../sampledSet/sampledSet/sampledSet.H        |   2 +-
 .../distanceSurface/distanceSurface.H         |   8 +-
 .../isoSurface/sampledIsoSurface.H            |   2 +-
 .../sampledCuttingPlane/sampledCuttingPlane.H |   2 +-
 .../sampledSurface/sampledSurface.H           |   2 +-
 .../sampledTriSurfaceMesh.C                   |   2 +-
 .../surfMeshSampler/surfMeshSampler.H         |   2 +-
 .../surface/triSurfaceMesh/discreteSurface.C  |   2 +-
 .../sixDoFRigidBodyMotion.C                   |   6 +-
 .../sixDoFRigidBodyMotion.H                   |   4 +-
 .../sixDoFRigidBodyState.C                    |   7 -
 .../sixDoFRigidBodyState.H                    |   2 +-
 src/surfMesh/surfZone/surfZone/surfZone.H     |   2 +-
 .../SLGThermo/SLGThermo/SLGThermo.C           |   4 +-
 .../psiChemistryModel/psiChemistryModelI.H    |   4 +-
 .../rhoChemistryModel/rhoChemistryModelI.H    |   4 +-
 .../radiationModels/fvDOM/fvDOM/fvDOM.C       |   6 +-
 .../radiationModel/radiationModel.C           |   6 +-
 .../boundaryRadiationPropertiesPatch.C        |   4 +-
 .../solarCalculator/solarCalculator.H         |   2 +-
 .../basicSolidChemistryModelI.H               |   4 +-
 .../thermophysicalPropertiesSelectorI.H       |   2 +-
 ...emperatureCoupledMixedFvPatchScalarField.C |   4 +-
 .../mixerFvMesh/mixerFvMesh.H                 |   2 +-
 .../incompressibleTwoPhaseMixture.H           |   4 +-
 ...ndentAlphaContactAngleFvPatchScalarField.C |   6 +-
 308 files changed, 1604 insertions(+), 1379 deletions(-)
 create mode 100644 applications/test/autoPtr/Make/files
 create mode 100644 applications/test/autoPtr/Make/options
 create mode 100644 applications/test/autoPtr/Test-autoPtr.C

diff --git a/applications/solvers/combustion/PDRFoam/createFields.H b/applications/solvers/combustion/PDRFoam/createFields.H
index 84155c48496..c0602016c83 100644
--- a/applications/solvers/combustion/PDRFoam/createFields.H
+++ b/applications/solvers/combustion/PDRFoam/createFields.H
@@ -165,7 +165,7 @@ IOdictionary PDRProperties
 autoPtr<PDRDragModel> drag = PDRDragModel::New
 (
     PDRProperties,
-    turbulence,
+    *turbulence,
     rho,
     U,
     phi
@@ -176,7 +176,7 @@ autoPtr<XiModel> flameWrinkling = XiModel::New
 (
     PDRProperties,
     thermo,
-    turbulence,
+    *turbulence,
     Su,
     rho,
     b,
diff --git a/applications/solvers/multiphase/compressibleInterFoam/twoPhaseMixtureThermo/twoPhaseMixtureThermo.H b/applications/solvers/multiphase/compressibleInterFoam/twoPhaseMixtureThermo/twoPhaseMixtureThermo.H
index aefdbdee4fb..b84ce6a7fac 100644
--- a/applications/solvers/multiphase/compressibleInterFoam/twoPhaseMixtureThermo/twoPhaseMixtureThermo.H
+++ b/applications/solvers/multiphase/compressibleInterFoam/twoPhaseMixtureThermo/twoPhaseMixtureThermo.H
@@ -89,22 +89,22 @@ public:
 
         const rhoThermo& thermo1() const
         {
-            return thermo1_();
+            return *thermo1_;
         }
 
         const rhoThermo& thermo2() const
         {
-            return thermo2_();
+            return *thermo2_;
         }
 
         rhoThermo& thermo1()
         {
-            return thermo1_();
+            return *thermo1_;
         }
 
         rhoThermo& thermo2()
         {
-            return thermo2_();
+            return *thermo2_;
         }
 
         //- Correct the thermodynamics of each phase
diff --git a/applications/solvers/multiphase/compressibleMultiphaseInterFoam/multiphaseMixtureThermo/phaseModel/phaseModel.C b/applications/solvers/multiphase/compressibleMultiphaseInterFoam/multiphaseMixtureThermo/phaseModel/phaseModel.C
index c97a5a1382f..007b8206ae2 100644
--- a/applications/solvers/multiphase/compressibleMultiphaseInterFoam/multiphaseMixtureThermo/phaseModel/phaseModel.C
+++ b/applications/solvers/multiphase/compressibleMultiphaseInterFoam/multiphaseMixtureThermo/phaseModel/phaseModel.C
@@ -81,7 +81,7 @@ Foam::phaseModel::phaseModel
 Foam::autoPtr<Foam::phaseModel> Foam::phaseModel::clone() const
 {
     NotImplemented;
-    return autoPtr<phaseModel>(nullptr);
+    return autoPtr<phaseModel>();
 }
 
 
diff --git a/applications/solvers/multiphase/compressibleMultiphaseInterFoam/multiphaseMixtureThermo/phaseModel/phaseModel.H b/applications/solvers/multiphase/compressibleMultiphaseInterFoam/multiphaseMixtureThermo/phaseModel/phaseModel.H
index 66d0ac8d63a..44310e4df36 100644
--- a/applications/solvers/multiphase/compressibleMultiphaseInterFoam/multiphaseMixtureThermo/phaseModel/phaseModel.H
+++ b/applications/solvers/multiphase/compressibleMultiphaseInterFoam/multiphaseMixtureThermo/phaseModel/phaseModel.H
@@ -120,13 +120,13 @@ public:
         //- Return const-access to phase rhoThermo
         const rhoThermo& thermo() const
         {
-            return thermo_();
+            return *thermo_;
         }
 
         //- Return access to phase rhoThermo
         rhoThermo& thermo()
         {
-            return thermo_();
+            return *thermo_;
         }
 
         //- Return const-access to phase divergence
diff --git a/applications/solvers/multiphase/driftFluxFoam/incompressibleTwoPhaseInteractingMixture/incompressibleTwoPhaseInteractingMixture.H b/applications/solvers/multiphase/driftFluxFoam/incompressibleTwoPhaseInteractingMixture/incompressibleTwoPhaseInteractingMixture.H
index 0950bbaba08..d790264fef2 100644
--- a/applications/solvers/multiphase/driftFluxFoam/incompressibleTwoPhaseInteractingMixture/incompressibleTwoPhaseInteractingMixture.H
+++ b/applications/solvers/multiphase/driftFluxFoam/incompressibleTwoPhaseInteractingMixture/incompressibleTwoPhaseInteractingMixture.H
@@ -106,13 +106,13 @@ public:
         //- Return const-access to the mixture viscosityModel
         const mixtureViscosityModel& muModel() const
         {
-            return muModel_();
+            return *muModel_;
         }
 
         //- Return const-access to the continuous-phase viscosityModel
         const viscosityModel& nucModel() const
         {
-            return nucModel_();
+            return *nucModel_;
         }
 
         //- Return const-access to the dispersed-phase density
diff --git a/applications/solvers/multiphase/interFoam/interMixingFoam/incompressibleThreePhaseMixture/incompressibleThreePhaseMixture.H b/applications/solvers/multiphase/interFoam/interMixingFoam/incompressibleThreePhaseMixture/incompressibleThreePhaseMixture.H
index 58341e6cad0..393c388d9fd 100644
--- a/applications/solvers/multiphase/interFoam/interMixingFoam/incompressibleThreePhaseMixture/incompressibleThreePhaseMixture.H
+++ b/applications/solvers/multiphase/interFoam/interMixingFoam/incompressibleThreePhaseMixture/incompressibleThreePhaseMixture.H
@@ -181,19 +181,19 @@ public:
         //- Return const-access to phase1 viscosityModel
         const viscosityModel& nuModel1() const
         {
-            return nuModel1_();
+            return *nuModel1_;
         }
 
         //- Return const-access to phase2 viscosityModel
         const viscosityModel& nuModel2() const
         {
-            return nuModel2_();
+            return *nuModel2_;
         }
 
         //- Return const-access to phase3 viscosityModel
         const viscosityModel& nuModel3() const
         {
-            return nuModel3_();
+            return *nuModel3_;
         }
 
         //- Return the dynamic laminar viscosity
diff --git a/applications/solvers/multiphase/multiphaseEulerFoam/multiphaseSystem/phaseModel/phaseModel.C b/applications/solvers/multiphase/multiphaseEulerFoam/multiphaseSystem/phaseModel/phaseModel.C
index 224d0345d6d..b57058d61ff 100644
--- a/applications/solvers/multiphase/multiphaseEulerFoam/multiphaseSystem/phaseModel/phaseModel.C
+++ b/applications/solvers/multiphase/multiphaseEulerFoam/multiphaseSystem/phaseModel/phaseModel.C
@@ -205,7 +205,7 @@ Foam::phaseModel::~phaseModel()
 Foam::autoPtr<Foam::phaseModel> Foam::phaseModel::clone() const
 {
     NotImplemented;
-    return autoPtr<phaseModel>(nullptr);
+    return autoPtr<phaseModel>();
 }
 
 
diff --git a/applications/solvers/multiphase/multiphaseEulerFoam/multiphaseSystem/phaseModel/phaseModel.H b/applications/solvers/multiphase/multiphaseEulerFoam/multiphaseSystem/phaseModel/phaseModel.H
index 90e48183cae..37408786106 100644
--- a/applications/solvers/multiphase/multiphaseEulerFoam/multiphaseSystem/phaseModel/phaseModel.H
+++ b/applications/solvers/multiphase/multiphaseEulerFoam/multiphaseSystem/phaseModel/phaseModel.H
@@ -190,12 +190,12 @@ public:
 
         const surfaceScalarField& phi() const
         {
-            return phiPtr_();
+            return *phiPtr_;
         }
 
         surfaceScalarField& phi()
         {
-            return phiPtr_();
+            return *phiPtr_;
         }
 
         const surfaceScalarField& alphaPhi() const
diff --git a/applications/solvers/multiphase/multiphaseInterFoam/multiphaseMixture/phase/phase.C b/applications/solvers/multiphase/multiphaseInterFoam/multiphaseMixture/phase/phase.C
index 5fc59061a4f..e14906619b4 100644
--- a/applications/solvers/multiphase/multiphaseInterFoam/multiphaseMixture/phase/phase.C
+++ b/applications/solvers/multiphase/multiphaseInterFoam/multiphaseMixture/phase/phase.C
@@ -68,7 +68,7 @@ Foam::phase::phase
 Foam::autoPtr<Foam::phase> Foam::phase::clone() const
 {
     NotImplemented;
-    return autoPtr<phase>(nullptr);
+    return autoPtr<phase>();
 }
 
 
diff --git a/applications/solvers/multiphase/multiphaseInterFoam/multiphaseMixture/phase/phase.H b/applications/solvers/multiphase/multiphaseInterFoam/multiphaseMixture/phase/phase.H
index 91341fcf5c1..3ce0ba7d65e 100644
--- a/applications/solvers/multiphase/multiphaseInterFoam/multiphaseMixture/phase/phase.H
+++ b/applications/solvers/multiphase/multiphaseInterFoam/multiphaseMixture/phase/phase.H
@@ -120,7 +120,7 @@ public:
         //- Return const-access to phase1 viscosityModel
         const viscosityModel& nuModel() const
         {
-            return nuModel_();
+            return *nuModel_;
         }
 
         //- Return the kinematic laminar viscosity
diff --git a/applications/solvers/multiphase/reactingEulerFoam/phaseSystems/PhaseSystems/HeatAndMassTransferPhaseSystem/HeatAndMassTransferPhaseSystem.C b/applications/solvers/multiphase/reactingEulerFoam/phaseSystems/PhaseSystems/HeatAndMassTransferPhaseSystem/HeatAndMassTransferPhaseSystem.C
index c63f6bfd447..bb493847b05 100644
--- a/applications/solvers/multiphase/reactingEulerFoam/phaseSystems/PhaseSystems/HeatAndMassTransferPhaseSystem/HeatAndMassTransferPhaseSystem.C
+++ b/applications/solvers/multiphase/reactingEulerFoam/phaseSystems/PhaseSystems/HeatAndMassTransferPhaseSystem/HeatAndMassTransferPhaseSystem.C
@@ -59,14 +59,9 @@ HeatAndMassTransferPhaseSystem
         massTransferModels_
     );
 
-    forAllConstIter
-    (
-        phaseSystem::phasePairTable,
-        this->phasePairs_,
-        phasePairIter
-    )
+    forAllConstIters(this->phasePairs_, phasePairIter)
     {
-        const phasePair& pair(phasePairIter());
+        const phasePair& pair = *(phasePairIter.object());
 
         if (pair.ordered())
         {
@@ -197,14 +192,9 @@ Foam::HeatAndMassTransferPhaseSystem<BasePhaseSystem>::dmdt
         )
     );
 
-    forAllConstIter
-    (
-        phaseSystem::phasePairTable,
-        this->phasePairs_,
-        phasePairIter
-    )
+    forAllConstIters(this->phasePairs_, phasePairIter)
     {
-        const phasePair& pair(phasePairIter());
+        const phasePair& pair = *(phasePairIter.object());
 
         if (pair.ordered())
         {
@@ -239,14 +229,9 @@ Foam::HeatAndMassTransferPhaseSystem<BasePhaseSystem>::momentumTransfer() const
     phaseSystem::momentumTransferTable& eqns = eqnsPtr();
 
     // Source term due to mass trasfer
-    forAllConstIter
-    (
-        phaseSystem::phasePairTable,
-        this->phasePairs_,
-        phasePairIter
-    )
+    forAllConstIters(this->phasePairs_, phasePairIter)
     {
-        const phasePair& pair(phasePairIter());
+        const phasePair& pair = *(phasePairIter.object());
 
         if (pair.ordered())
         {
@@ -291,17 +276,10 @@ Foam::HeatAndMassTransferPhaseSystem<BasePhaseSystem>::heatTransfer() const
     }
 
     // Heat transfer with the interface
-    forAllConstIter
-    (
-        heatTransferModelTable,
-        heatTransferModels_,
-        heatTransferModelIter
-    )
+    forAllConstIters(heatTransferModels_, heatTransferModelIter)
     {
-        const phasePair& pair
-        (
-            this->phasePairs_[heatTransferModelIter.key()]
-        );
+        const phasePair& pair =
+            *(this->phasePairs_[heatTransferModelIter.key()]);
 
         const phaseModel* phase = &pair.phase1();
         const phaseModel* otherPhase = &pair.phase2();
@@ -344,14 +322,9 @@ Foam::HeatAndMassTransferPhaseSystem<BasePhaseSystem>::heatTransfer() const
     }
 
     // Source term due to mass transfer
-    forAllConstIter
-    (
-        phaseSystem::phasePairTable,
-        this->phasePairs_,
-        phasePairIter
-    )
+    forAllConstIters(this->phasePairs_, phasePairIter)
     {
-        const phasePair& pair(phasePairIter());
+        const phasePair& pair = *(phasePairIter.object());
 
         if (pair.ordered())
         {
diff --git a/applications/solvers/multiphase/reactingEulerFoam/phaseSystems/PhaseSystems/HeatTransferPhaseSystem/HeatTransferPhaseSystem.C b/applications/solvers/multiphase/reactingEulerFoam/phaseSystems/PhaseSystems/HeatTransferPhaseSystem/HeatTransferPhaseSystem.C
index 9fee19e77fd..465d0b3af96 100644
--- a/applications/solvers/multiphase/reactingEulerFoam/phaseSystems/PhaseSystems/HeatTransferPhaseSystem/HeatTransferPhaseSystem.C
+++ b/applications/solvers/multiphase/reactingEulerFoam/phaseSystems/PhaseSystems/HeatTransferPhaseSystem/HeatTransferPhaseSystem.C
@@ -128,16 +128,12 @@ Foam::HeatTransferPhaseSystem<BasePhaseSystem>::heatTransfer() const
         );
     }
 
-    forAllConstIter
-    (
-        heatTransferModelTable,
-        heatTransferModels_,
-        heatTransferModelIter
-    )
+    forAllConstIters(heatTransferModels_, heatTransferModelIter)
     {
-        const volScalarField K(heatTransferModelIter()->K());
+        const phasePair& pair =
+            *(this->phasePairs_[heatTransferModelIter.key()]);
 
-        const phasePair& pair(this->phasePairs_[heatTransferModelIter.key()]);
+        const volScalarField K(heatTransferModelIter()->K());
 
         const phaseModel* phase = &pair.phase1();
         const phaseModel* otherPhase = &pair.phase2();
diff --git a/applications/solvers/multiphase/reactingEulerFoam/phaseSystems/PhaseSystems/InterfaceCompositionPhaseChangePhaseSystem/InterfaceCompositionPhaseChangePhaseSystem.C b/applications/solvers/multiphase/reactingEulerFoam/phaseSystems/PhaseSystems/InterfaceCompositionPhaseChangePhaseSystem/InterfaceCompositionPhaseChangePhaseSystem.C
index 1c9b53c803c..53f724680be 100644
--- a/applications/solvers/multiphase/reactingEulerFoam/phaseSystems/PhaseSystems/InterfaceCompositionPhaseChangePhaseSystem/InterfaceCompositionPhaseChangePhaseSystem.C
+++ b/applications/solvers/multiphase/reactingEulerFoam/phaseSystems/PhaseSystems/InterfaceCompositionPhaseChangePhaseSystem/InterfaceCompositionPhaseChangePhaseSystem.C
@@ -86,14 +86,9 @@ massTransfer() const
     }
 
     // Reset the interfacial mass flow rates
-    forAllConstIter
-    (
-        phaseSystem::phasePairTable,
-        this->phasePairs_,
-        phasePairIter
-    )
+    forAllConstIters(this->phasePairs_, phasePairIter)
     {
-        const phasePair& pair(phasePairIter());
+        const phasePair& pair = *(phasePairIter.object());
 
         if (pair.ordered())
         {
@@ -108,22 +103,18 @@ massTransfer() const
     }
 
     // Sum up the contribution from each interface composition model
-    forAllConstIter
+    forAllConstIters
     (
-        interfaceCompositionModelTable,
         interfaceCompositionModels_,
         interfaceCompositionModelIter
     )
     {
-        const interfaceCompositionModel& compositionModel
-        (
-            interfaceCompositionModelIter()
-        );
+        const phasePair& pair =
+            *(this->phasePairs_[interfaceCompositionModelIter.key()]);
+
+        const interfaceCompositionModel& compositionModel =
+            *(interfaceCompositionModelIter.object());
 
-        const phasePair& pair
-        (
-            this->phasePairs_[interfaceCompositionModelIter.key()]
-        );
         const phaseModel& phase = pair.phase1();
         const phaseModel& otherPhase = pair.phase2();
         const phasePairKey key(phase.name(), otherPhase.name());
@@ -209,14 +200,9 @@ correctThermo()
     // Yfi is likely to be a strong non-linear (typically exponential) function
     // of Tf, so the solution for the temperature is newton-accelerated
 
-    forAllConstIter
-    (
-        phaseSystem::phasePairTable,
-        this->phasePairs_,
-        phasePairIter
-    )
+    forAllConstIters(this->phasePairs_, phasePairIter)
     {
-        const phasePair& pair(phasePairIter());
+        const phasePair& pair = *(phasePairIter.object());
 
         if (pair.ordered())
         {
diff --git a/applications/solvers/multiphase/reactingEulerFoam/phaseSystems/PhaseSystems/MomentumTransferPhaseSystem/MomentumTransferPhaseSystem.C b/applications/solvers/multiphase/reactingEulerFoam/phaseSystems/PhaseSystems/MomentumTransferPhaseSystem/MomentumTransferPhaseSystem.C
index 02969b89cb8..43d5881fed0 100644
--- a/applications/solvers/multiphase/reactingEulerFoam/phaseSystems/PhaseSystems/MomentumTransferPhaseSystem/MomentumTransferPhaseSystem.C
+++ b/applications/solvers/multiphase/reactingEulerFoam/phaseSystems/PhaseSystems/MomentumTransferPhaseSystem/MomentumTransferPhaseSystem.C
@@ -82,14 +82,10 @@ MomentumTransferPhaseSystem
         turbulentDispersionModels_
     );
 
-    forAllConstIter
-    (
-        dragModelTable,
-        dragModels_,
-        dragModelIter
-    )
+    forAllConstIters(dragModels_, dragModelIter)
     {
-        const phasePair& pair(this->phasePairs_[dragModelIter.key()]);
+        const phasePair& pair =
+            *(this->phasePairs_[dragModelIter.key()]);
 
         Kds_.insert
         (
@@ -102,14 +98,10 @@ MomentumTransferPhaseSystem
         );
     }
 
-    forAllConstIter
-    (
-        virtualMassModelTable,
-        virtualMassModels_,
-        virtualMassModelIter
-    )
+    forAllConstIters(virtualMassModels_, virtualMassModelIter)
     {
-        const phasePair& pair(this->phasePairs_[virtualMassModelIter.key()]);
+        const phasePair& pair =
+            *(this->phasePairs_[virtualMassModelIter.key()]);
 
         Vms_.insert
         (
@@ -183,16 +175,11 @@ Foam::MomentumTransferPhaseSystem<BasePhaseSystem>::Kd
         )
     );
 
-    forAllConstIter
-    (
-        phaseSystem::KdTable,
-        Kds_,
-        KdIter
-    )
+    forAllConstIters(Kds_, KdIter)
     {
-        const volScalarField& K(*KdIter());
+        const phasePair& pair = *(this->phasePairs_[KdIter.key()]);
 
-        const phasePair& pair(this->phasePairs_[KdIter.key()]);
+        const volScalarField& K(*KdIter());
 
         const phaseModel* phase1 = &pair.phase1();
         const phaseModel* phase2 = &pair.phase2();
@@ -430,27 +417,17 @@ Foam::MomentumTransferPhaseSystem<BasePhaseSystem>::momentumTransfer() const
     }
 
     // Update the drag coefficients
-    forAllConstIter
-    (
-        dragModelTable,
-        dragModels_,
-        dragModelIter
-    )
+    forAllConstIters(dragModels_, dragModelIter)
     {
         *Kds_[dragModelIter.key()] = dragModelIter()->K();
     }
 
     // Add the implicit part of the drag force
-    forAllConstIter
-    (
-        phaseSystem::KdTable,
-        Kds_,
-        KdIter
-    )
+    forAllConstIters(Kds_, KdIter)
     {
-        const volScalarField& K(*KdIter());
+        const phasePair& pair = *(this->phasePairs_[KdIter.key()]);
 
-        const phasePair& pair(this->phasePairs_[KdIter.key()]);
+        const volScalarField& K(*KdIter());
 
         const phaseModel* phase = &pair.phase1();
         const phaseModel* otherPhase = &pair.phase2();
@@ -466,27 +443,17 @@ Foam::MomentumTransferPhaseSystem<BasePhaseSystem>::momentumTransfer() const
     }
 
     // Update the virtual mass coefficients
-    forAllConstIter
-    (
-        virtualMassModelTable,
-        virtualMassModels_,
-        virtualMassModelIter
-    )
+    forAllConstIters(virtualMassModels_, virtualMassModelIter)
     {
         *Vms_[virtualMassModelIter.key()] = virtualMassModelIter()->K();
     }
 
     // Add the virtual mass force
-    forAllConstIter
-    (
-        phaseSystem::VmTable,
-        Vms_,
-        VmIter
-    )
+    forAllConstIters(Vms_, VmIter)
     {
-        const volScalarField& Vm(*VmIter());
+        const phasePair& pair = *(this->phasePairs_[VmIter.key()]);
 
-        const phasePair& pair(this->phasePairs_[VmIter.key()]);
+        const volScalarField& Vm(*VmIter());
 
         const phaseModel* phase = &pair.phase1();
         const phaseModel* otherPhase = &pair.phase2();
@@ -557,33 +524,22 @@ Foam::MomentumTransferPhaseSystem<BasePhaseSystem>::Fs() const
     PtrList<volVectorField>& Fs = tFs();
 
     // Add the lift force
-    forAllConstIter
-    (
-        liftModelTable,
-        liftModels_,
-        liftModelIter
-    )
+    forAllConstIters(liftModels_, modelIter)
     {
-        const volVectorField F(liftModelIter()->F<vector>());
+        const phasePair& pair = *(this->phasePairs_[modelIter.key()]);
 
-        const phasePair& pair(this->phasePairs_[liftModelIter.key()]);
+        const volVectorField F(modelIter()->template F<vector>());
 
         setF(Fs, pair.phase1().index()) += F;
         setF(Fs, pair.phase2().index()) -= F;
     }
 
     // Add the wall lubrication force
-    forAllConstIter
-    (
-        wallLubricationModelTable,
-        wallLubricationModels_,
-        wallLubricationModelIter
-    )
+    forAllConstIters(wallLubricationModels_, modelIter)
     {
-        const volVectorField F(wallLubricationModelIter()->F<vector>());
+        const phasePair& pair = *(this->phasePairs_[modelIter.key()]);
 
-        const phasePair&
-            pair(this->phasePairs_[wallLubricationModelIter.key()]);
+        const volVectorField F(modelIter()->template F<vector>());
 
         setF(Fs, pair.phase1().index()) += F;
         setF(Fs, pair.phase2().index()) -= F;
@@ -647,15 +603,10 @@ Foam::MomentumTransferPhaseSystem<BasePhaseSystem>::phiDs
     PtrList<surfaceScalarField>& phiDs = tphiDs();
 
     // Add the turbulent dispersion force
-    forAllConstIter
-    (
-        turbulentDispersionModelTable,
-        turbulentDispersionModels_,
-        turbulentDispersionModelIter
-    )
+    forAllConstIters(turbulentDispersionModels_, turbulentDispersionModelIter)
     {
-        const phasePair&
-            pair(this->phasePairs_[turbulentDispersionModelIter.key()]);
+        const phasePair& pair =
+            *(this->phasePairs_[turbulentDispersionModelIter.key()]);
 
         const volScalarField D(turbulentDispersionModelIter()->D());
         const surfaceScalarField snGradAlpha1
diff --git a/applications/solvers/multiphase/reactingEulerFoam/phaseSystems/PhaseSystems/ThermalPhaseChangePhaseSystem/ThermalPhaseChangePhaseSystem.C b/applications/solvers/multiphase/reactingEulerFoam/phaseSystems/PhaseSystems/ThermalPhaseChangePhaseSystem/ThermalPhaseChangePhaseSystem.C
index a6dd838d235..bb5c2462c34 100644
--- a/applications/solvers/multiphase/reactingEulerFoam/phaseSystems/PhaseSystems/ThermalPhaseChangePhaseSystem/ThermalPhaseChangePhaseSystem.C
+++ b/applications/solvers/multiphase/reactingEulerFoam/phaseSystems/PhaseSystems/ThermalPhaseChangePhaseSystem/ThermalPhaseChangePhaseSystem.C
@@ -42,14 +42,9 @@ ThermalPhaseChangePhaseSystem
     massTransfer_(this->lookup("massTransfer"))
 {
 
-    forAllConstIter
-    (
-        phaseSystem::phasePairTable,
-        this->phasePairs_,
-        phasePairIter
-    )
+    forAllConstIters(this->phasePairs_, phasePairIter)
     {
-        const phasePair& pair(phasePairIter());
+        const phasePair& pair = *(phasePairIter.object());
 
         if (pair.ordered())
         {
@@ -92,7 +87,7 @@ template<class BasePhaseSystem>
 const Foam::saturationModel&
 Foam::ThermalPhaseChangePhaseSystem<BasePhaseSystem>::saturation() const
 {
-    return saturationModel_();
+    return *saturationModel_;
 }
 
 
@@ -109,14 +104,9 @@ Foam::ThermalPhaseChangePhaseSystem<BasePhaseSystem>::heatTransfer() const
     phaseSystem::heatTransferTable& eqns = eqnsPtr();
 
     // Accumulate mDotL contributions from boundaries
-    forAllConstIter
-    (
-        phaseSystem::phasePairTable,
-        this->phasePairs_,
-        phasePairIter
-    )
+    forAllConstIters(this->phasePairs_, phasePairIter)
     {
-        const phasePair& pair(phasePairIter());
+        const phasePair& pair = *(phasePairIter.object());
 
         if (pair.ordered())
         {
@@ -219,19 +209,15 @@ Foam::ThermalPhaseChangePhaseSystem<BasePhaseSystem>::massTransfer() const
         }
     }
 
-    forAllConstIter
-    (
-        phaseSystem::phasePairTable,
-        this->phasePairs_,
-        phasePairIter
-    )
+    forAllConstIters(this->phasePairs_, phasePairIter)
     {
-        const phasePair& pair(phasePairIter());
+        const phasePair& pair = *(phasePairIter.object());
 
         if (pair.ordered())
         {
             continue;
         }
+
         const phaseModel& phase = pair.phase1();
         const phaseModel& otherPhase = pair.phase2();
 
@@ -292,14 +278,9 @@ Foam::ThermalPhaseChangePhaseSystem<BasePhaseSystem>::iDmdt
         )
     );
 
-    forAllConstIter
-    (
-        phaseSystem::phasePairTable,
-        this->phasePairs_,
-        phasePairIter
-    )
+    forAllConstIters(this->phasePairs_, phasePairIter)
     {
-        const phasePair& pair(phasePairIter());
+        const phasePair& pair = *(phasePairIter.object());
 
         if (pair.ordered())
         {
@@ -332,14 +313,9 @@ void Foam::ThermalPhaseChangePhaseSystem<BasePhaseSystem>::correctThermo()
 
     BasePhaseSystem::correctThermo();
 
-    forAllConstIter
-    (
-        phaseSystem::phasePairTable,
-        this->phasePairs_,
-        phasePairIter
-    )
+    forAllConstIters(this->phasePairs_, phasePairIter)
     {
-        const phasePair& pair(phasePairIter());
+        const phasePair& pair = *(phasePairIter.object());
 
         if (pair.ordered())
         {
diff --git a/applications/solvers/multiphase/reactingEulerFoam/phaseSystems/phaseModel/MovingPhaseModel/MovingPhaseModel.C b/applications/solvers/multiphase/reactingEulerFoam/phaseSystems/phaseModel/MovingPhaseModel/MovingPhaseModel.C
index 2afa388aca9..460e21ce859 100644
--- a/applications/solvers/multiphase/reactingEulerFoam/phaseSystems/phaseModel/MovingPhaseModel/MovingPhaseModel.C
+++ b/applications/solvers/multiphase/reactingEulerFoam/phaseSystems/phaseModel/MovingPhaseModel/MovingPhaseModel.C
@@ -401,7 +401,7 @@ template<class BasePhaseModel>
 const Foam::phaseCompressibleTurbulenceModel&
 Foam::MovingPhaseModel<BasePhaseModel>::turbulence() const
 {
-    return turbulence_;
+    return *turbulence_;
 }
 
 
diff --git a/applications/solvers/multiphase/reactingEulerFoam/phaseSystems/phaseModel/phaseModel/phaseModel.C b/applications/solvers/multiphase/reactingEulerFoam/phaseSystems/phaseModel/phaseModel/phaseModel.C
index da10824230f..26be4e1bc70 100644
--- a/applications/solvers/multiphase/reactingEulerFoam/phaseSystems/phaseModel/phaseModel/phaseModel.C
+++ b/applications/solvers/multiphase/reactingEulerFoam/phaseSystems/phaseModel/phaseModel/phaseModel.C
@@ -77,7 +77,7 @@ Foam::phaseModel::phaseModel
 Foam::autoPtr<Foam::phaseModel> Foam::phaseModel::clone() const
 {
     NotImplemented;
-    return autoPtr<phaseModel>(nullptr);
+    return autoPtr<phaseModel>();
 }
 
 
diff --git a/applications/solvers/multiphase/reactingEulerFoam/phaseSystems/phaseSystem/phaseSystemTemplates.C b/applications/solvers/multiphase/reactingEulerFoam/phaseSystems/phaseSystem/phaseSystemTemplates.C
index 8f4bf7ee0fd..768c905e1ff 100644
--- a/applications/solvers/multiphase/reactingEulerFoam/phaseSystems/phaseSystem/phaseSystemTemplates.C
+++ b/applications/solvers/multiphase/reactingEulerFoam/phaseSystems/phaseSystem/phaseSystemTemplates.C
@@ -48,8 +48,8 @@ void Foam::phaseSystem::createSubModels
             key,
             modelType::New
             (
-               *iter,
-                phasePairs_[key]
+                iter.object(),
+                phasePairs_[key]()
             )
         );
     }
@@ -98,11 +98,11 @@ void Foam::phaseSystem::generatePairsAndSubModels
     const blendingMethod& blending
     (
         blendingMethods_.found(modelName)
-      ? blendingMethods_[modelName]
-      : blendingMethods_["default"]
+      ? *(blendingMethods_[modelName])
+      : *(blendingMethods_["default"])
     );
 
-    autoPtr<modelType> noModel(nullptr);
+    autoPtr<modelType> noModel;
 
     forAllConstIter(typename modelTypeTable, tempModels, iter)
     {
diff --git a/applications/solvers/multiphase/reactingEulerFoam/reactingMultiphaseEulerFoam/pU/pEqn.H b/applications/solvers/multiphase/reactingEulerFoam/reactingMultiphaseEulerFoam/pU/pEqn.H
index a164b73f269..758c411968e 100644
--- a/applications/solvers/multiphase/reactingEulerFoam/reactingMultiphaseEulerFoam/pU/pEqn.H
+++ b/applications/solvers/multiphase/reactingEulerFoam/reactingMultiphaseEulerFoam/pU/pEqn.H
@@ -217,16 +217,11 @@ while (pimple.correct())
             )
         );
 
-        forAllConstIter
-        (
-            phaseSystem::KdTable,
-            fluid.Kds(),
-            KdIter
-        )
+        forAllConstIters(fluid.Kds(), KdIter)
         {
             const volScalarField& K(*KdIter());
 
-            const phasePair& pair(fluid.phasePairs()[KdIter.key()]);
+            const phasePair& pair = *(fluid.phasePairs()[KdIter.key()]);
 
             const phaseModel* phase1 = &pair.phase1();
             const phaseModel* phase2 = &pair.phase2();
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 31837960150..db917c48659 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
@@ -115,7 +115,7 @@ public:
         autoPtr<IATEsource> clone() const
         {
             NotImplemented;
-            return autoPtr<IATEsource>(nullptr);
+            return autoPtr<IATEsource>();
         }
 
 
diff --git a/applications/solvers/multiphase/twoPhaseEulerFoam/twoPhaseSystem/BlendedInterfacialModel/BlendedInterfacialModel.C b/applications/solvers/multiphase/twoPhaseEulerFoam/twoPhaseSystem/BlendedInterfacialModel/BlendedInterfacialModel.C
index cc089e347e9..289054982d9 100644
--- a/applications/solvers/multiphase/twoPhaseEulerFoam/twoPhaseSystem/BlendedInterfacialModel/BlendedInterfacialModel.C
+++ b/applications/solvers/multiphase/twoPhaseEulerFoam/twoPhaseSystem/BlendedInterfacialModel/BlendedInterfacialModel.C
@@ -451,9 +451,11 @@ bool Foam::BlendedInterfacialModel<modelType>::hasModel
 ) const
 {
     return
-       &phase == &(pair_.phase1())
+    (
+        &phase == &(pair_.phase1())
       ? model1In2_.valid()
-      : model2In1_.valid();
+      : model2In1_.valid()
+    );
 }
 
 
@@ -463,7 +465,7 @@ const modelType& Foam::BlendedInterfacialModel<modelType>::phaseModel
     const class phaseModel& phase
 ) const
 {
-    return &phase == &(pair_.phase1()) ? model1In2_ : model2In1_;
+    return &phase == &(pair_.phase1()) ? *model1In2_ : *model2In1_;
 }
 
 
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 c7655b9c342..29c150ce741 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
@@ -114,7 +114,7 @@ public:
         autoPtr<IATEsource> clone() const
         {
             NotImplemented;
-            return autoPtr<IATEsource>(nullptr);
+            return autoPtr<IATEsource>();
         }
 
 
diff --git a/applications/solvers/multiphase/twoPhaseEulerFoam/twoPhaseSystem/phaseModel/phaseModel.C b/applications/solvers/multiphase/twoPhaseEulerFoam/twoPhaseSystem/phaseModel/phaseModel.C
index 9352b723973..139826e8858 100644
--- a/applications/solvers/multiphase/twoPhaseEulerFoam/twoPhaseSystem/phaseModel/phaseModel.C
+++ b/applications/solvers/multiphase/twoPhaseEulerFoam/twoPhaseSystem/phaseModel/phaseModel.C
@@ -227,14 +227,14 @@ Foam::tmp<Foam::volScalarField> Foam::phaseModel::d() const
 Foam::PhaseCompressibleTurbulenceModel<Foam::phaseModel>&
 Foam::phaseModel::turbulence()
 {
-    return turbulence_();
+    return *turbulence_;
 }
 
 
 const Foam::PhaseCompressibleTurbulenceModel<Foam::phaseModel>&
 Foam::phaseModel::turbulence() const
 {
-    return turbulence_();
+    return *turbulence_;
 }
 
 
diff --git a/applications/solvers/multiphase/twoPhaseEulerFoam/twoPhaseSystem/phaseModel/phaseModel.H b/applications/solvers/multiphase/twoPhaseEulerFoam/twoPhaseSystem/phaseModel/phaseModel.H
index 894907fe7cc..f0c88afa1ef 100644
--- a/applications/solvers/multiphase/twoPhaseEulerFoam/twoPhaseSystem/phaseModel/phaseModel.H
+++ b/applications/solvers/multiphase/twoPhaseEulerFoam/twoPhaseSystem/phaseModel/phaseModel.H
@@ -162,14 +162,14 @@ public:
         //- Return the thermophysical model
         const rhoThermo& thermo() const
         {
-            return thermo_();
+            return *thermo_;
         }
 
         //- Return non-const access to the thermophysical model
         //  for correction
         rhoThermo& thermo()
         {
-            return thermo_();
+            return *thermo_;
         }
 
         //- Return the laminar viscosity
@@ -286,13 +286,13 @@ public:
         //- Return the volumetric flux
         const surfaceScalarField& phi() const
         {
-            return phiPtr_();
+            return *phiPtr_;
         }
 
         //- Return non-const access to the volumetric flux
         surfaceScalarField& phi()
         {
-            return phiPtr_();
+            return *phiPtr_;
         }
 
         //- Return the volumetric flux of the phase
diff --git a/applications/solvers/multiphase/twoPhaseEulerFoam/twoPhaseSystem/twoPhaseSystem.C b/applications/solvers/multiphase/twoPhaseEulerFoam/twoPhaseSystem/twoPhaseSystem.C
index 5a99c32ae2d..4750293fe81 100644
--- a/applications/solvers/multiphase/twoPhaseEulerFoam/twoPhaseSystem/twoPhaseSystem.C
+++ b/applications/solvers/multiphase/twoPhaseEulerFoam/twoPhaseSystem/twoPhaseSystem.C
@@ -177,12 +177,12 @@ Foam::twoPhaseSystem::twoPhaseSystem
             lookup("drag"),
             (
                 blendingMethods_.found("drag")
-              ? blendingMethods_["drag"]
-              : blendingMethods_["default"]
+              ? *(blendingMethods_["drag"])
+              : *(blendingMethods_["default"])
             ),
-            pair_,
-            pair1In2_,
-            pair2In1_,
+            *pair_,
+            *pair1In2_,
+            *pair2In1_,
             false // Do not zero drag coefficent at fixed-flux BCs
         )
     );
@@ -194,12 +194,12 @@ Foam::twoPhaseSystem::twoPhaseSystem
             lookup("virtualMass"),
             (
                 blendingMethods_.found("virtualMass")
-              ? blendingMethods_["virtualMass"]
-              : blendingMethods_["default"]
+              ? *(blendingMethods_["virtualMass"])
+              : *(blendingMethods_["default"])
             ),
-            pair_,
-            pair1In2_,
-            pair2In1_
+            *pair_,
+            *pair1In2_,
+            *pair2In1_
         )
     );
 
@@ -210,12 +210,12 @@ Foam::twoPhaseSystem::twoPhaseSystem
             lookup("heatTransfer"),
             (
                 blendingMethods_.found("heatTransfer")
-              ? blendingMethods_["heatTransfer"]
-              : blendingMethods_["default"]
+              ? *(blendingMethods_["heatTransfer"])
+              : *(blendingMethods_["default"])
             ),
-            pair_,
-            pair1In2_,
-            pair2In1_
+            *pair_,
+            *pair1In2_,
+            *pair2In1_
         )
     );
 
@@ -226,12 +226,12 @@ Foam::twoPhaseSystem::twoPhaseSystem
             lookup("lift"),
             (
                 blendingMethods_.found("lift")
-              ? blendingMethods_["lift"]
-              : blendingMethods_["default"]
+              ? *(blendingMethods_["lift"])
+              : *(blendingMethods_["default"])
             ),
-            pair_,
-            pair1In2_,
-            pair2In1_
+            *pair_,
+            *pair1In2_,
+            *pair2In1_
         )
     );
 
@@ -242,12 +242,12 @@ Foam::twoPhaseSystem::twoPhaseSystem
             lookup("wallLubrication"),
             (
                 blendingMethods_.found("wallLubrication")
-              ? blendingMethods_["wallLubrication"]
-              : blendingMethods_["default"]
+              ? *(blendingMethods_["wallLubrication"])
+              : *(blendingMethods_["default"])
             ),
-            pair_,
-            pair1In2_,
-            pair2In1_
+            *pair_,
+            *pair1In2_,
+            *pair2In1_
         )
     );
 
@@ -258,12 +258,12 @@ Foam::twoPhaseSystem::twoPhaseSystem
             lookup("turbulentDispersion"),
             (
                 blendingMethods_.found("turbulentDispersion")
-              ? blendingMethods_["turbulentDispersion"]
-              : blendingMethods_["default"]
+              ? *(blendingMethods_["turbulentDispersion"])
+              : *(blendingMethods_["default"])
             ),
-            pair_,
-            pair1In2_,
-            pair2In1_
+            *pair_,
+            *pair1In2_,
+            *pair2In1_
         )
     );
 }
@@ -272,7 +272,7 @@ Foam::twoPhaseSystem::twoPhaseSystem
 // * * * * * * * * * * * * * * * * Destructor  * * * * * * * * * * * * * * * //
 
 Foam::twoPhaseSystem::~twoPhaseSystem()
-{}
+{} // Define here (incomplete type in header)
 
 
 // * * * * * * * * * * * * * * Member Functions  * * * * * * * * * * * * * * //
diff --git a/applications/solvers/stressAnalysis/solidDisplacementFoam/createFields.H b/applications/solvers/stressAnalysis/solidDisplacementFoam/createFields.H
index fd97d416f90..8d9ef025c81 100644
--- a/applications/solvers/stressAnalysis/solidDisplacementFoam/createFields.H
+++ b/applications/solvers/stressAnalysis/solidDisplacementFoam/createFields.H
@@ -16,7 +16,7 @@ volVectorField D
 );
 
 
-autoPtr<volScalarField> Tptr(nullptr);
+autoPtr<volScalarField> Tptr;
 
 if (thermalStress)
 {
diff --git a/applications/test/autoPtr/Make/files b/applications/test/autoPtr/Make/files
new file mode 100644
index 00000000000..a89ae354187
--- /dev/null
+++ b/applications/test/autoPtr/Make/files
@@ -0,0 +1,3 @@
+Test-autoPtr.C
+
+EXE = $(FOAM_USER_APPBIN)/Test-autoPtr
diff --git a/applications/test/autoPtr/Make/options b/applications/test/autoPtr/Make/options
new file mode 100644
index 00000000000..3ed98294028
--- /dev/null
+++ b/applications/test/autoPtr/Make/options
@@ -0,0 +1,5 @@
+EXE_INC = \
+    -I$(LIB_SRC)/thermophysicalModels/thermophysicalProperties/lnInclude
+
+EXE_LIBS = \
+    -lthermophysicalProperties
diff --git a/applications/test/autoPtr/Test-autoPtr.C b/applications/test/autoPtr/Test-autoPtr.C
new file mode 100644
index 00000000000..edd7f222e82
--- /dev/null
+++ b/applications/test/autoPtr/Test-autoPtr.C
@@ -0,0 +1,219 @@
+/*---------------------------------------------------------------------------*\
+  =========                 |
+  \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox
+   \\    /   O peration     |
+    \\  /    A nd           | Copyright (C) 2018 OpenCFD Ltd.
+     \\/     M anipulation  |
+-------------------------------------------------------------------------------
+License
+    This file is part of OpenFOAM.
+
+    OpenFOAM is free software: you can redistribute it and/or modify it
+    under the terms of the GNU General Public License as published by
+    the Free Software Foundation, either version 3 of the License, or
+    (at your option) any later version.
+
+    OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
+    ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+    FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+    for more details.
+
+    You should have received a copy of the GNU General Public License
+    along with OpenFOAM.  If not, see <http://www.gnu.org/licenses/>.
+
+\*---------------------------------------------------------------------------*/
+
+#include "autoPtr.H"
+#include "labelList.H"
+#include "ListOps.H"
+#include "IOstreams.H"
+#include "Switch.H"
+
+#include "C7H16.H"
+
+using namespace Foam;
+
+
+// An example of bad use, since our autoPtr is too generous when being passed
+// around
+void testTransfer1(autoPtr<labelList> ap)
+{
+    // Passed in copy, so automatically removes content
+    // Transfer would be nice, but not actually needed
+
+    Info<< "recv " << Switch(ap.valid()).c_str() << nl;
+}
+
+
+// An example of good use. We are allowed to manage the memory (or not)
+// and not automatically start losing things.
+void testTransfer2(autoPtr<labelList>&& ap)
+{
+    // As rvalue, so this time we actually get to manage content
+    Info<< "recv " << Switch(ap.valid()).c_str() << nl;
+}
+
+
+// Constructor from literal nullptr is implicit
+template<class T>
+autoPtr<T> testNullReturn1()
+{
+    return nullptr;
+}
+
+
+// Constructor from raw pointer is explicit
+template<class T>
+autoPtr<T> testNullReturn2()
+{
+    T* p = new T;
+
+    return p;
+}
+
+
+// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
+//  Main program:
+
+int main(int argc, char *argv[])
+{
+    {
+        auto list = autoPtr<labelList>::New(10, label(-1));
+
+        Info<<"create: " << list() << nl;
+
+        Info<<"create: " << autoPtr<labelList>::New(10, label(-1))()
+            << nl << nl;
+    }
+
+    // Confirm that forwarding with move construct actually works as expected
+    {
+        auto source = identity(8);
+        Info<<"move construct from "
+            << flatOutput(source) << " @ " << long(source.cdata())
+            << nl << nl;
+
+        auto list = autoPtr<labelList>::New(std::move(source));
+
+        Info<<"created: " << flatOutput(*list) << " @ " << long(list->cdata())
+            << nl << nl;
+
+        Info<<"orig: "
+            << flatOutput(source) << " @ " << long(source.cdata())
+            << nl << nl;
+    }
+
+    // Explicit construct Base from Derived
+    {
+        autoPtr<liquidProperties> liqProp
+        (
+            autoPtr<C7H16>::New()
+        );
+
+        Info<<"liq 1: " << liqProp() << nl << nl;
+    }
+
+    // Construct Base from Derived
+    {
+        autoPtr<liquidProperties> liqProp =
+            autoPtr<liquidProperties>::NewFrom<C7H16>();
+
+        Info<<"liq 2: " << liqProp() << nl << nl;
+    }
+
+    // Construct Base from Derived
+    {
+        const autoPtr<liquidProperties> liqProp(autoPtr<C7H16>::New());
+
+        Info<<"liq: " << liqProp() << nl << nl;
+        Info<<"liq-type: " << liqProp->type() << nl << nl;
+        Info<<"type: " << typeid(liqProp.get()).name() << nl;
+    }
+
+    // Memory transfer
+    {
+        Info<< nl << nl;
+
+        auto list = autoPtr<labelList>::New(identity(8));
+        Info<<"forward to function from "
+            << flatOutput(*list) << " @ " << long(list->cdata())
+            << nl << nl;
+
+        testTransfer2(std::move(list));
+
+        Info<<"now have valid=" << Switch(list.valid()).c_str();
+
+        if (list.valid())
+        {
+            Info<< nl
+                << flatOutput(*list) << " @ " << long(list->cdata())
+                << nl;
+        }
+        else
+        {
+            Info<< nl;
+        }
+    }
+
+    // Memory transfer
+    {
+        Info<< nl << nl;
+
+        testTransfer2(autoPtr<labelList>::New(identity(8)));
+    }
+
+    // Memory transfer
+    {
+        Info<< nl << nl;
+
+        auto list = autoPtr<labelList>::New(identity(8));
+        Info<<"forward to function from "
+            << flatOutput(*list) << " @ " << long(list->cdata())
+            << nl << nl;
+
+        testTransfer2(std::move(list));
+
+        Info<<"now have valid=" << Switch(list.valid()).c_str();
+
+        if (list.valid())
+        {
+            Info<< nl
+                << flatOutput(*list) << " @ " << long(list->cdata())
+                << nl;
+        }
+        else
+        {
+            Info<< nl;
+        }
+    }
+
+
+    // Memory transfer
+    {
+        auto ptr1 = autoPtr<labelList>::New();
+        auto ptr2 = autoPtr<labelList>::New();
+
+        Info<<"ptr valid: " << ptr1.valid() << nl;
+
+        // Refuses to compile (good!):   ptr1 = new labelList(10);
+
+        // Does compile (good!):   ptr1 = nullptr;
+
+        ptr1.reset(std::move(ptr2));
+    }
+
+
+    {
+        // Good this work:
+        autoPtr<labelList> ptr1 = testNullReturn1<labelList>();
+
+        // Good this does not compile:
+        // autoPtr<labelList> ptr2 = testNullReturn2<labelList>();
+    }
+
+
+    return 0;
+}
+
+
+// ************************************************************************* //
diff --git a/applications/test/fieldMapping/Test-fieldMapping.C b/applications/test/fieldMapping/Test-fieldMapping.C
index a641819d7ea..0ca3052e4ce 100644
--- a/applications/test/fieldMapping/Test-fieldMapping.C
+++ b/applications/test/fieldMapping/Test-fieldMapping.C
@@ -202,7 +202,7 @@ int main(int argc, char *argv[])
         autoPtr<mapPolyMesh> morphMap = meshMod.changeMesh(mesh, inflate);
 
         Info<< "Mapping fields" << nl << endl;
-        mesh.updateMesh(morphMap);
+        mesh.updateMesh(morphMap());
 
         // Move mesh (since morphing does not do this)
         if (morphMap().hasMotionPoints())
@@ -212,7 +212,7 @@ int main(int argc, char *argv[])
         }
 
         // Update numbering of cells/vertices.
-        faceRemover.updateMesh(morphMap);
+        faceRemover.updateMesh(morphMap());
 
 
         Info<< "Writing fields" << nl << endl;
diff --git a/applications/test/hexRef8/Test-hexRef8.C b/applications/test/hexRef8/Test-hexRef8.C
index 66a55fbafcb..d34ff23c423 100644
--- a/applications/test/hexRef8/Test-hexRef8.C
+++ b/applications/test/hexRef8/Test-hexRef8.C
@@ -276,7 +276,7 @@ int main(int argc, char *argv[])
 
             // Update fields
             Info<< nl << "-- mapping mesh data" << endl;
-            mesh.updateMesh(map);
+            mesh.updateMesh(map());
 
             // Inflate mesh
             if (map().hasMotionPoints())
@@ -287,7 +287,7 @@ int main(int argc, char *argv[])
 
             // Update numbering of cells/vertices.
             Info<< nl << "-- mapping hexRef8 data" << endl;
-            meshCutter.updateMesh(map);
+            meshCutter.updateMesh(map());
         }
 
 
diff --git a/applications/utilities/mesh/advanced/PDRMesh/PDRMesh.C b/applications/utilities/mesh/advanced/PDRMesh/PDRMesh.C
index f6bac7844ac..6bd47c6bf7d 100644
--- a/applications/utilities/mesh/advanced/PDRMesh/PDRMesh.C
+++ b/applications/utilities/mesh/advanced/PDRMesh/PDRMesh.C
@@ -1155,7 +1155,9 @@ int main(int argc, char *argv[])
     }
 
     // Change the mesh. Change points directly (no inflation).
-    autoPtr<mapPolyMesh> map = meshMod.changeMesh(subsetter.subMesh(), false);
+    autoPtr<mapPolyMesh> mapPtr =
+        meshMod.changeMesh(subsetter.subMesh(), false);
+    mapPolyMesh& map = *mapPtr;
 
     // Update fields
     subsetter.subMesh().updateMesh(map);
@@ -1231,9 +1233,9 @@ int main(int argc, char *argv[])
 
 
     // Move mesh (since morphing might not do this)
-    if (map().hasMotionPoints())
+    if (map.hasMotionPoints())
     {
-        subsetter.subMesh().movePoints(map().preMotionPoints());
+        subsetter.subMesh().movePoints(map.preMotionPoints());
     }
 
     Info<< "Writing mesh with split blockedFaces to time " << runTime.value()
diff --git a/applications/utilities/mesh/advanced/collapseEdges/collapseEdges.C b/applications/utilities/mesh/advanced/collapseEdges/collapseEdges.C
index fa307d05e69..f4d889d28ab 100644
--- a/applications/utilities/mesh/advanced/collapseEdges/collapseEdges.C
+++ b/applications/utilities/mesh/advanced/collapseEdges/collapseEdges.C
@@ -186,7 +186,7 @@ int main(int argc, char *argv[])
                 polyMeshFilter::copySets(newMesh(), mesh);
             }
 
-            pointPriority = meshFilter.pointPriority();
+            pointPriority = *(meshFilter.pointPriority());
         }
 
         if (collapseFaceSet)
@@ -203,14 +203,14 @@ int main(int argc, char *argv[])
             // from the previous edge filtering to use as a stopping criterion.
             meshFilter.filter(indirectPatchFaces);
             {
-                polyTopoChange meshMod(newMesh);
+                polyTopoChange meshMod(newMesh());
 
                 meshMod.changeMesh(mesh, false);
 
                 polyMeshFilter::copySets(newMesh(), mesh);
             }
 
-            pointPriority = meshFilter.pointPriority();
+            pointPriority = *(meshFilter.pointPriority());
         }
 
         if (collapseFaces)
@@ -227,14 +227,14 @@ int main(int argc, char *argv[])
             // from the previous edge filtering to use as a stopping criterion.
             meshFilter.filter(nBadFaces);
             {
-                polyTopoChange meshMod(newMesh);
+                polyTopoChange meshMod(newMesh());
 
                 meshMod.changeMesh(mesh, false);
 
                 polyMeshFilter::copySets(newMesh(), mesh);
             }
 
-            pointPriority = meshFilter.pointPriority();
+            pointPriority = *(meshFilter.pointPriority());
         }
 
         // Write resulting mesh
diff --git a/applications/utilities/mesh/advanced/combinePatchFaces/combinePatchFaces.C b/applications/utilities/mesh/advanced/combinePatchFaces/combinePatchFaces.C
index f1e32185406..3423d698654 100644
--- a/applications/utilities/mesh/advanced/combinePatchFaces/combinePatchFaces.C
+++ b/applications/utilities/mesh/advanced/combinePatchFaces/combinePatchFaces.C
@@ -113,7 +113,7 @@ label mergePatchFaces
             map = meshMod.changeMesh(mesh, false, true);
 
             // Update fields
-            mesh.updateMesh(map);
+            mesh.updateMesh(map());
 
             // Move mesh (since morphing does not do this)
             if (map().hasMotionPoints())
@@ -269,7 +269,7 @@ label mergePatchFaces
             map = meshMod.changeMesh(mesh, false, true);
 
             // Update fields
-            mesh.updateMesh(map);
+            mesh.updateMesh(map());
 
             // Move mesh (since morphing does not do this)
             if (map().hasMotionPoints())
@@ -322,7 +322,7 @@ label mergeEdges(const scalar minCos, polyMesh& mesh)
         autoPtr<mapPolyMesh> map = meshMod.changeMesh(mesh, false, true);
 
         // Update fields
-        mesh.updateMesh(map);
+        mesh.updateMesh(map());
 
         // Move mesh (since morphing does not do this)
         if (map().hasMotionPoints())
diff --git a/applications/utilities/mesh/advanced/refineHexMesh/refineHexMesh.C b/applications/utilities/mesh/advanced/refineHexMesh/refineHexMesh.C
index 5b123d64e22..6901fcd8dab 100644
--- a/applications/utilities/mesh/advanced/refineHexMesh/refineHexMesh.C
+++ b/applications/utilities/mesh/advanced/refineHexMesh/refineHexMesh.C
@@ -174,10 +174,10 @@ int main(int argc, char *argv[])
     autoPtr<mapPolyMesh> map = meshMod.changeMesh(mesh, false);
 
     // Update fields
-    mesh.updateMesh(map);
+    mesh.updateMesh(map());
 
     // Update numbering of cells/vertices.
-    meshCutter.updateMesh(map);
+    meshCutter.updateMesh(map());
 
     // Optionally inflate mesh
     if (map().hasMotionPoints())
diff --git a/applications/utilities/mesh/advanced/removeFaces/removeFaces.C b/applications/utilities/mesh/advanced/removeFaces/removeFaces.C
index 2578a37e9b0..bb78ffc8273 100644
--- a/applications/utilities/mesh/advanced/removeFaces/removeFaces.C
+++ b/applications/utilities/mesh/advanced/removeFaces/removeFaces.C
@@ -155,18 +155,18 @@ int main(int argc, char *argv[])
         meshMod
     );
 
-    autoPtr<mapPolyMesh> morphMap = meshMod.changeMesh(mesh, false);
+    autoPtr<mapPolyMesh> map = meshMod.changeMesh(mesh, false);
 
-    mesh.updateMesh(morphMap);
+    mesh.updateMesh(map());
 
     // Move mesh (since morphing does not do this)
-    if (morphMap().hasMotionPoints())
+    if (map().hasMotionPoints())
     {
-        mesh.movePoints(morphMap().preMotionPoints());
+        mesh.movePoints(map().preMotionPoints());
     }
 
     // Update numbering of cells/vertices.
-    faceRemover.updateMesh(morphMap);
+    faceRemover.updateMesh(map());
 
     if (!overwrite)
     {
diff --git a/applications/utilities/mesh/advanced/selectCells/selectCells.C b/applications/utilities/mesh/advanced/selectCells/selectCells.C
index 8b4b2dcaf2c..fef71bbd874 100644
--- a/applications/utilities/mesh/advanced/selectCells/selectCells.C
+++ b/applications/utilities/mesh/advanced/selectCells/selectCells.C
@@ -416,20 +416,14 @@ int main(int argc, char *argv[])
     );
 
 
-    // Surface
-    autoPtr<triSurface> surf(nullptr);
-    // Search engine on surface.
-    autoPtr<triSurfaceSearch> querySurf(nullptr);
-
     if (useSurface)
     {
-        surf.reset(new triSurface(surfName));
+        triSurface surf(surfName);
 
         // Dump some stats
-        surf().writeStats(Info);
+        surf.writeStats(Info);
 
-        // Search engine on surface.
-        querySurf.reset(new triSurfaceSearch(surf));
+        triSurfaceSearch querySurf(surf);
 
         // Set cellType[celli] according to relation to surface
         cutBySurface
diff --git a/applications/utilities/mesh/conversion/ccm/ccmToFoam/ccmToFoam.C b/applications/utilities/mesh/conversion/ccm/ccmToFoam/ccmToFoam.C
index 8596ca8f9c8..98fa7d42a9f 100644
--- a/applications/utilities/mesh/conversion/ccm/ccmToFoam/ccmToFoam.C
+++ b/applications/utilities/mesh/conversion/ccm/ccmToFoam/ccmToFoam.C
@@ -266,7 +266,7 @@ int main(int argc, char *argv[])
         Info<< nl << "Bounding box size: " << mesh().bounds().span() << nl;
 
         // check number of regions
-        regionSplit rs(mesh);
+        regionSplit rs(mesh());
 
         Info<< "Number of regions: " << rs.nRegions();
         if (rs.nRegions() == 1)
@@ -281,7 +281,7 @@ int main(int argc, char *argv[])
                 << "**************************************************" << nl;
         }
         Info<< endl;
-        reader.writeMesh(mesh, format);
+        reader.writeMesh(mesh(), format);
 
         // exportName only has a size when export is in effect
         if (exportName.size())
diff --git a/applications/utilities/mesh/conversion/star4ToFoam/star4ToFoam.C b/applications/utilities/mesh/conversion/star4ToFoam/star4ToFoam.C
index c3ffaf04f00..806ded99fb1 100644
--- a/applications/utilities/mesh/conversion/star4ToFoam/star4ToFoam.C
+++ b/applications/utilities/mesh/conversion/star4ToFoam/star4ToFoam.C
@@ -119,7 +119,7 @@ int main(int argc, char *argv[])
 
 
     autoPtr<polyMesh> mesh = reader.mesh(runTime);
-    reader.writeMesh(mesh, format);
+    reader.writeMesh(mesh(), format);
 
 
     Info<< "\nEnd\n" << endl;
diff --git a/applications/utilities/mesh/conversion/tetgenToFoam/tetgenToFoam.C b/applications/utilities/mesh/conversion/tetgenToFoam/tetgenToFoam.C
index 6d9295dd931..7d459ec82d9 100644
--- a/applications/utilities/mesh/conversion/tetgenToFoam/tetgenToFoam.C
+++ b/applications/utilities/mesh/conversion/tetgenToFoam/tetgenToFoam.C
@@ -338,7 +338,7 @@ int main(int argc, char *argv[])
             wordList(0)
         )
     );
-    const polyMesh& mesh = meshPtr;
+    const polyMesh& mesh = *meshPtr;
 
 
     if (readFaceFile)
diff --git a/applications/utilities/mesh/generation/extrude/extrudeMesh/extrudeMesh.C b/applications/utilities/mesh/generation/extrude/extrudeMesh/extrudeMesh.C
index 9051a84db5a..f4bc4c55e88 100644
--- a/applications/utilities/mesh/generation/extrude/extrudeMesh/extrudeMesh.C
+++ b/applications/utilities/mesh/generation/extrude/extrudeMesh/extrudeMesh.C
@@ -433,7 +433,7 @@ int main(int argc, char *argv[])
             autoPtr<mapPolyMesh> map = meshMod.changeMesh(mesh, false);
 
             // Update fields
-            mesh.updateMesh(map);
+            mesh.updateMesh(map());
 
             // Move mesh (since morphing does not do this)
             if (map().hasMotionPoints())
@@ -788,7 +788,7 @@ int main(int argc, char *argv[])
             (
                 layerExtrude.addedCells
                 (
-                    meshFromMesh,
+                    *meshFromMesh,
                     layerExtrude.layerFaces()
                 )
             );
@@ -937,7 +937,7 @@ int main(int argc, char *argv[])
             autoPtr<mapPolyMesh> map = meshMod.changeMesh(mesh, false);
 
             // Update fields
-            mesh.updateMesh(map);
+            mesh.updateMesh(map());
 
             // Update stored data
             updateFaceLabels(map(), frontPatchFaces);
@@ -1074,7 +1074,7 @@ int main(int argc, char *argv[])
         autoPtr<mapPolyMesh> map = meshMod.changeMesh(mesh, false);
 
         // Update fields
-        mesh.updateMesh(map);
+        mesh.updateMesh(map());
 
         // Update local data
         updateCellSet(map(), addedCellsSet);
diff --git a/applications/utilities/mesh/generation/extrude/extrudeToRegionMesh/extrudeToRegionMesh.C b/applications/utilities/mesh/generation/extrude/extrudeToRegionMesh/extrudeToRegionMesh.C
index db1b8c2480e..869d54d80a1 100644
--- a/applications/utilities/mesh/generation/extrude/extrudeToRegionMesh/extrudeToRegionMesh.C
+++ b/applications/utilities/mesh/generation/extrude/extrudeToRegionMesh/extrudeToRegionMesh.C
@@ -2470,7 +2470,7 @@ int main(int argc, char *argv[])
 
 
     // Update numbering on extruder.
-    extruder.updateMesh(shellMap);
+    extruder.updateMesh(shellMap());
 
 
     // Calculate offsets from shell mesh back to original mesh
@@ -2818,7 +2818,7 @@ int main(int argc, char *argv[])
         addBafflesMap = meshMod.changeMesh(mesh, false);
 
         // Update fields
-        mesh.updateMesh(addBafflesMap);
+        mesh.updateMesh(addBafflesMap());
 
 
 //XXXXXX
diff --git a/applications/utilities/mesh/generation/extrude2DMesh/extrude2DMeshApp.C b/applications/utilities/mesh/generation/extrude2DMesh/extrude2DMeshApp.C
index d6d87e4c8fd..10fda1151cb 100644
--- a/applications/utilities/mesh/generation/extrude2DMesh/extrude2DMeshApp.C
+++ b/applications/utilities/mesh/generation/extrude2DMesh/extrude2DMeshApp.C
@@ -251,7 +251,7 @@ int main(int argc, char *argv[])
     // Create a mesh from topo changes.
     autoPtr<mapPolyMesh> morphMap = meshMod().changeMesh(mesh(), false);
 
-    mesh().updateMesh(morphMap);
+    mesh().updateMesh(morphMap());
 
     {
         edgeCollapser collapser(mesh());
@@ -302,7 +302,7 @@ int main(int argc, char *argv[])
         autoPtr<mapPolyMesh> morphMap
             = meshModCollapse.changeMesh(mesh(), false);
 
-        mesh().updateMesh(morphMap);
+        mesh().updateMesh(morphMap());
     }
 
     if (!overwrite)
diff --git a/applications/utilities/mesh/generation/foamyMesh/conformalVoronoiMesh/DelaunayMesh/DistributedDelaunayMesh.C b/applications/utilities/mesh/generation/foamyMesh/conformalVoronoiMesh/DelaunayMesh/DistributedDelaunayMesh.C
index 97311eef3cb..c053ce9e7bb 100644
--- a/applications/utilities/mesh/generation/foamyMesh/conformalVoronoiMesh/DelaunayMesh/DistributedDelaunayMesh.C
+++ b/applications/utilities/mesh/generation/foamyMesh/conformalVoronoiMesh/DelaunayMesh/DistributedDelaunayMesh.C
@@ -142,13 +142,6 @@ Foam::DistributedDelaunayMesh<Triangulation>::DistributedDelaunayMesh
 {}
 
 
-// * * * * * * * * * * * * * * * * Destructor  * * * * * * * * * * * * * * * //
-
-template<class Triangulation>
-Foam::DistributedDelaunayMesh<Triangulation>::~DistributedDelaunayMesh()
-{}
-
-
 // * * * * * * * * * * * * * Private Member Functions  * * * * * * * * * * * //
 
 template<class Triangulation>
@@ -491,7 +484,8 @@ Foam::label Foam::DistributedDelaunayMesh<Triangulation>::referVertices
 
     const label preDistributionSize = parallelVertices.size();
 
-    mapDistribute pointMap = buildMap(targetProcessor);
+    autoPtr<mapDistribute> pointMapPtr = buildMap(targetProcessor);
+    mapDistribute& pointMap = *pointMapPtr;
 
     // Make a copy of the original list.
     DynamicList<Vb> originalParallelVertices(parallelVertices);
diff --git a/applications/utilities/mesh/generation/foamyMesh/conformalVoronoiMesh/DelaunayMesh/DistributedDelaunayMesh.H b/applications/utilities/mesh/generation/foamyMesh/conformalVoronoiMesh/DelaunayMesh/DistributedDelaunayMesh.H
index 35b0859b53c..07954827b89 100644
--- a/applications/utilities/mesh/generation/foamyMesh/conformalVoronoiMesh/DelaunayMesh/DistributedDelaunayMesh.H
+++ b/applications/utilities/mesh/generation/foamyMesh/conformalVoronoiMesh/DelaunayMesh/DistributedDelaunayMesh.H
@@ -141,7 +141,7 @@ public:
 
 
     //- Destructor
-    ~DistributedDelaunayMesh();
+    ~DistributedDelaunayMesh() = default;
 
 
     // Queries
diff --git a/applications/utilities/mesh/generation/foamyMesh/conformalVoronoiMesh/backgroundMeshDecomposition/backgroundMeshDecomposition.C b/applications/utilities/mesh/generation/foamyMesh/conformalVoronoiMesh/backgroundMeshDecomposition/backgroundMeshDecomposition.C
index 25d9188e015..210d027fe62 100644
--- a/applications/utilities/mesh/generation/foamyMesh/conformalVoronoiMesh/backgroundMeshDecomposition/backgroundMeshDecomposition.C
+++ b/applications/utilities/mesh/generation/foamyMesh/conformalVoronoiMesh/backgroundMeshDecomposition/backgroundMeshDecomposition.C
@@ -248,10 +248,10 @@ void Foam::backgroundMeshDecomposition::initialRefinement()
                 );
 
                 // Update fields
-                mesh_.updateMesh(map);
+                mesh_.updateMesh(map());
 
                 // Update numbering of cells/vertices.
-                meshCutter_.updateMesh(map);
+                meshCutter_.updateMesh(map());
 
                 {
                     // Map volumeStatus
@@ -357,11 +357,11 @@ void Foam::backgroundMeshDecomposition::initialRefinement()
                 );
 
                 // Update fields
-                mesh_.updateMesh(map);
+                mesh_.updateMesh(map());
 
                 // Update numbering of cells/vertices.
-                meshCutter_.updateMesh(map);
-                cellRemover.updateMesh(map);
+                meshCutter_.updateMesh(map());
+                cellRemover.updateMesh(map());
 
                 {
                     // Map volumeStatus
@@ -416,7 +416,7 @@ void Foam::backgroundMeshDecomposition::initialRefinement()
                 newDecomp
             );
 
-            meshCutter_.distribute(mapDist);
+            meshCutter_.distribute(mapDist());
 
             mapDist().distributeCellData(volumeStatus);
 
@@ -840,12 +840,6 @@ Foam::backgroundMeshDecomposition::backgroundMeshDecomposition
 }
 
 
-// * * * * * * * * * * * * * * * * Destructor  * * * * * * * * * * * * * * * //
-
-Foam::backgroundMeshDecomposition::~backgroundMeshDecomposition()
-{}
-
-
 // * * * * * * * * * * * * * * Member Functions  * * * * * * * * * * * * * * //
 
 Foam::autoPtr<Foam::mapDistributePolyMesh>
@@ -954,10 +948,10 @@ Foam::backgroundMeshDecomposition::distribute
         );
 
         // Update fields
-        mesh_.updateMesh(map);
+        mesh_.updateMesh(map());
 
         // Update numbering of cells/vertices.
-        meshCutter_.updateMesh(map);
+        meshCutter_.updateMesh(map());
 
         Info<< "    Background mesh refined from "
             << returnReduce(map().nOldCells(), sumOp<label>())
@@ -1000,7 +994,7 @@ Foam::backgroundMeshDecomposition::distribute
 
     autoPtr<mapDistributePolyMesh> mapDist = distributor.distribute(newDecomp);
 
-    meshCutter_.distribute(mapDist);
+    meshCutter_.distribute(mapDist());
 
     if (debug)
     {
diff --git a/applications/utilities/mesh/generation/foamyMesh/conformalVoronoiMesh/backgroundMeshDecomposition/backgroundMeshDecomposition.H b/applications/utilities/mesh/generation/foamyMesh/conformalVoronoiMesh/backgroundMeshDecomposition/backgroundMeshDecomposition.H
index aec8cce0c2a..864822e088a 100644
--- a/applications/utilities/mesh/generation/foamyMesh/conformalVoronoiMesh/backgroundMeshDecomposition/backgroundMeshDecomposition.H
+++ b/applications/utilities/mesh/generation/foamyMesh/conformalVoronoiMesh/backgroundMeshDecomposition/backgroundMeshDecomposition.H
@@ -204,7 +204,7 @@ public:
 
 
     //- Destructor
-    ~backgroundMeshDecomposition();
+    ~backgroundMeshDecomposition() = default;
 
 
     // Member Functions
diff --git a/applications/utilities/mesh/generation/foamyMesh/conformalVoronoiMesh/backgroundMeshDecomposition/backgroundMeshDecompositionI.H b/applications/utilities/mesh/generation/foamyMesh/conformalVoronoiMesh/backgroundMeshDecomposition/backgroundMeshDecompositionI.H
index b8dcb5187f1..34f25547c07 100644
--- a/applications/utilities/mesh/generation/foamyMesh/conformalVoronoiMesh/backgroundMeshDecomposition/backgroundMeshDecompositionI.H
+++ b/applications/utilities/mesh/generation/foamyMesh/conformalVoronoiMesh/backgroundMeshDecomposition/backgroundMeshDecompositionI.H
@@ -34,7 +34,7 @@ const Foam::fvMesh& Foam::backgroundMeshDecomposition::mesh() const
 const Foam::indexedOctree<Foam::treeDataBPatch>&
 Foam::backgroundMeshDecomposition::tree() const
 {
-    return bFTreePtr_();
+    return *bFTreePtr_;
 }
 
 
diff --git a/applications/utilities/mesh/generation/foamyMesh/conformalVoronoiMesh/conformalVoronoiMesh/conformalVoronoiMesh.C b/applications/utilities/mesh/generation/foamyMesh/conformalVoronoiMesh/conformalVoronoiMesh/conformalVoronoiMesh.C
index cc87adcb702..66759a3adaf 100644
--- a/applications/utilities/mesh/generation/foamyMesh/conformalVoronoiMesh/conformalVoronoiMesh/conformalVoronoiMesh.C
+++ b/applications/utilities/mesh/generation/foamyMesh/conformalVoronoiMesh/conformalVoronoiMesh/conformalVoronoiMesh.C
@@ -509,7 +509,7 @@ void Foam::conformalVoronoiMesh::buildCellSizeAndAlignmentMesh()
         if (!distributeBackground(cellSizeMesh))
         {
             // Synchronise the cell size mesh if it has not been distributed
-            cellSizeMesh.distribute(decomposition_);
+            cellSizeMesh.distribute(decomposition_());
         }
     }
 
@@ -531,7 +531,7 @@ void Foam::conformalVoronoiMesh::buildCellSizeAndAlignmentMesh()
 
         if (Pstream::parRun())
         {
-            cellSizeMesh.distribute(decomposition_);
+            cellSizeMesh.distribute(decomposition_());
         }
 
         Info<< "    Iteration " << i
@@ -549,7 +549,7 @@ void Foam::conformalVoronoiMesh::buildCellSizeAndAlignmentMesh()
         // Need to distribute the cell size mesh to cover the background mesh
         if (!distributeBackground(cellSizeMesh))
         {
-            cellSizeMesh.distribute(decomposition_);
+            cellSizeMesh.distribute(decomposition_());
         }
     }
 
diff --git a/applications/utilities/mesh/generation/foamyMesh/conformalVoronoiMesh/conformalVoronoiMesh/conformalVoronoiMeshI.H b/applications/utilities/mesh/generation/foamyMesh/conformalVoronoiMesh/conformalVoronoiMesh/conformalVoronoiMeshI.H
index 7f458dbed69..3f6220b526a 100644
--- a/applications/utilities/mesh/generation/foamyMesh/conformalVoronoiMesh/conformalVoronoiMesh/conformalVoronoiMeshI.H
+++ b/applications/utilities/mesh/generation/foamyMesh/conformalVoronoiMesh/conformalVoronoiMesh/conformalVoronoiMeshI.H
@@ -563,7 +563,7 @@ Foam::conformalVoronoiMesh::decomposition() const
             << exit(FatalError) << endl;
     }
 
-    return decomposition_();
+    return *decomposition_;
 }
 
 
diff --git a/applications/utilities/mesh/generation/foamyMesh/conformalVoronoiMesh/conformalVoronoiMesh/conformalVoronoiMeshTemplates.C b/applications/utilities/mesh/generation/foamyMesh/conformalVoronoiMesh/conformalVoronoiMesh/conformalVoronoiMeshTemplates.C
index c4fdca83d88..3edd639318b 100644
--- a/applications/utilities/mesh/generation/foamyMesh/conformalVoronoiMesh/conformalVoronoiMesh/conformalVoronoiMeshTemplates.C
+++ b/applications/utilities/mesh/generation/foamyMesh/conformalVoronoiMesh/conformalVoronoiMesh/conformalVoronoiMeshTemplates.C
@@ -132,7 +132,7 @@ bool Foam::conformalVoronoiMesh::distributeBackground(const Triangulation& mesh)
             cellWeights
         );
 
-        cellShapeControl_.shapeControlMesh().distribute(decomposition_);
+        cellShapeControl_.shapeControlMesh().distribute(decomposition_());
 
         distribute();
 
diff --git a/applications/utilities/mesh/generation/foamyMesh/conformalVoronoiMesh/initialPointsMethod/initialPointsMethod/initialPointsMethod.C b/applications/utilities/mesh/generation/foamyMesh/conformalVoronoiMesh/initialPointsMethod/initialPointsMethod/initialPointsMethod.C
index 48e45954fb7..7ffba4ad14c 100644
--- a/applications/utilities/mesh/generation/foamyMesh/conformalVoronoiMesh/initialPointsMethod/initialPointsMethod/initialPointsMethod.C
+++ b/applications/utilities/mesh/generation/foamyMesh/conformalVoronoiMesh/initialPointsMethod/initialPointsMethod/initialPointsMethod.C
@@ -113,10 +113,4 @@ Foam::autoPtr<Foam::initialPointsMethod> Foam::initialPointsMethod::New
 }
 
 
-// * * * * * * * * * * * * * * * * Destructor  * * * * * * * * * * * * * * * //
-
-Foam::initialPointsMethod::~initialPointsMethod()
-{}
-
-
 // ************************************************************************* //
diff --git a/applications/utilities/mesh/generation/foamyMesh/conformalVoronoiMesh/initialPointsMethod/initialPointsMethod/initialPointsMethod.H b/applications/utilities/mesh/generation/foamyMesh/conformalVoronoiMesh/initialPointsMethod/initialPointsMethod/initialPointsMethod.H
index 276526543b2..5c7a940996a 100644
--- a/applications/utilities/mesh/generation/foamyMesh/conformalVoronoiMesh/initialPointsMethod/initialPointsMethod/initialPointsMethod.H
+++ b/applications/utilities/mesh/generation/foamyMesh/conformalVoronoiMesh/initialPointsMethod/initialPointsMethod/initialPointsMethod.H
@@ -156,7 +156,7 @@ public:
 
 
     //- Destructor
-    virtual ~initialPointsMethod();
+    virtual ~initialPointsMethod() = default;
 
 
     // Member Functions
@@ -185,7 +185,7 @@ public:
 
             const backgroundMeshDecomposition& decomposition() const
             {
-                return decomposition_;
+                return *decomposition_;
             }
 
             //- Const access to the details dictionary
diff --git a/applications/utilities/mesh/generation/foamyMesh/conformalVoronoiMesh/searchableSurfaceFeatures/searchableSurfaceFeatures.H b/applications/utilities/mesh/generation/foamyMesh/conformalVoronoiMesh/searchableSurfaceFeatures/searchableSurfaceFeatures.H
index 3b7335d6205..fe1c509207a 100644
--- a/applications/utilities/mesh/generation/foamyMesh/conformalVoronoiMesh/searchableSurfaceFeatures/searchableSurfaceFeatures.H
+++ b/applications/utilities/mesh/generation/foamyMesh/conformalVoronoiMesh/searchableSurfaceFeatures/searchableSurfaceFeatures.H
@@ -101,7 +101,7 @@ public:
         virtual autoPtr<searchableSurfaceFeatures> clone() const
         {
             NotImplemented;
-            return autoPtr<searchableSurfaceFeatures>(nullptr);
+            return autoPtr<searchableSurfaceFeatures>();
         }
 
 
diff --git a/applications/utilities/mesh/generation/foamyMesh/foamyQuadMesh/foamyQuadMesh.C b/applications/utilities/mesh/generation/foamyMesh/foamyQuadMesh/foamyQuadMesh.C
index 39e905bd314..c7035642175 100644
--- a/applications/utilities/mesh/generation/foamyMesh/foamyQuadMesh/foamyQuadMesh.C
+++ b/applications/utilities/mesh/generation/foamyMesh/foamyQuadMesh/foamyQuadMesh.C
@@ -200,7 +200,7 @@ int main(int argc, char *argv[])
 
             autoPtr<mapPolyMesh> morphMap = meshMod.changeMesh(pMesh, false);
 
-            pMesh.updateMesh(morphMap);
+            pMesh.updateMesh(morphMap());
         }
     }
 
diff --git a/applications/utilities/mesh/manipulation/checkMesh/checkGeometry.C b/applications/utilities/mesh/manipulation/checkMesh/checkGeometry.C
index e34823f1887..b645b090b02 100644
--- a/applications/utilities/mesh/manipulation/checkMesh/checkGeometry.C
+++ b/applications/utilities/mesh/manipulation/checkMesh/checkGeometry.C
@@ -544,7 +544,7 @@ Foam::label Foam::checkGeometry
                 nonAlignedPoints.write();
                 if (setWriter.valid())
                 {
-                    mergeAndWrite(setWriter, nonAlignedPoints);
+                    mergeAndWrite(setWriter(), nonAlignedPoints);
                 }
             }
         }
@@ -786,7 +786,7 @@ Foam::label Foam::checkGeometry
                 points.write();
                 if (setWriter.valid())
                 {
-                    mergeAndWrite(setWriter, points);
+                    mergeAndWrite(setWriter(), points);
                 }
             }
         }
@@ -809,7 +809,7 @@ Foam::label Foam::checkGeometry
                 nearPoints.write();
                 if (setWriter.valid())
                 {
-                    mergeAndWrite(setWriter, nearPoints);
+                    mergeAndWrite(setWriter(), nearPoints);
                 }
             }
         }
diff --git a/applications/utilities/mesh/manipulation/checkMesh/checkTopology.C b/applications/utilities/mesh/manipulation/checkMesh/checkTopology.C
index a936fb993b4..f5e94023f3b 100644
--- a/applications/utilities/mesh/manipulation/checkMesh/checkTopology.C
+++ b/applications/utilities/mesh/manipulation/checkMesh/checkTopology.C
@@ -225,7 +225,7 @@ Foam::label Foam::checkTopology
             points.write();
             if (setWriter.valid())
             {
-                mergeAndWrite(setWriter, points);
+                mergeAndWrite(setWriter(), points);
             }
         }
     }
@@ -528,7 +528,7 @@ Foam::label Foam::checkTopology
                 points.write();
                 if (setWriter.valid())
                 {
-                    mergeAndWrite(setWriter, points);
+                    mergeAndWrite(setWriter(), points);
                 }
             }
         }
@@ -639,7 +639,7 @@ Foam::label Foam::checkTopology
         points.write();
         if (setWriter.valid())
         {
-            mergeAndWrite(setWriter, points);
+            mergeAndWrite(setWriter(), points);
         }
     }
 
diff --git a/applications/utilities/mesh/manipulation/createBaffles/createBaffles.C b/applications/utilities/mesh/manipulation/createBaffles/createBaffles.C
index e7702b69ddc..9e3f2ca574a 100644
--- a/applications/utilities/mesh/manipulation/createBaffles/createBaffles.C
+++ b/applications/utilities/mesh/manipulation/createBaffles/createBaffles.C
@@ -824,14 +824,13 @@ int main(int argc, char *argv[])
     autoPtr<mapPolyMesh> map = meshMod.changeMesh(mesh, false);
 
     // Update fields
-    mesh.updateMesh(map);
-
+    mesh.updateMesh(map());
 
 
     // Correct boundary faces mapped-out-of-nothing.
     // This is just a hack to correct the value field.
     {
-        fvMeshMapper mapper(mesh, map);
+        fvMeshMapper mapper(mesh, map());
         bool hasWarned = false;
 
         forAllConstIter(wordHashSet, bafflePatches, iter)
diff --git a/applications/utilities/mesh/manipulation/createBaffles/faceSelection/faceSelection.H b/applications/utilities/mesh/manipulation/createBaffles/faceSelection/faceSelection.H
index 41eb0b63154..b17f016212c 100644
--- a/applications/utilities/mesh/manipulation/createBaffles/faceSelection/faceSelection.H
+++ b/applications/utilities/mesh/manipulation/createBaffles/faceSelection/faceSelection.H
@@ -109,7 +109,7 @@ public:
         autoPtr<faceSelection> clone() const
         {
             NotImplemented;
-            return autoPtr<faceSelection>(nullptr);
+            return autoPtr<faceSelection>();
         }
 
 
diff --git a/applications/utilities/mesh/manipulation/createBaffles/faceSelection/faceZoneSelection.H b/applications/utilities/mesh/manipulation/createBaffles/faceSelection/faceZoneSelection.H
index 10b7f377ed2..20e7f66fe5d 100644
--- a/applications/utilities/mesh/manipulation/createBaffles/faceSelection/faceZoneSelection.H
+++ b/applications/utilities/mesh/manipulation/createBaffles/faceSelection/faceZoneSelection.H
@@ -86,7 +86,7 @@ public:
         autoPtr<faceSelection> clone() const
         {
             NotImplemented;
-            return autoPtr<faceSelection>(nullptr);
+            return autoPtr<faceSelection>();
         }
 
 
diff --git a/applications/utilities/mesh/manipulation/createBaffles/faceSelection/searchableSurfaceSelection.H b/applications/utilities/mesh/manipulation/createBaffles/faceSelection/searchableSurfaceSelection.H
index 30262ef8a98..8f934ae3c3f 100644
--- a/applications/utilities/mesh/manipulation/createBaffles/faceSelection/searchableSurfaceSelection.H
+++ b/applications/utilities/mesh/manipulation/createBaffles/faceSelection/searchableSurfaceSelection.H
@@ -79,7 +79,7 @@ public:
         autoPtr<faceSelection> clone() const
         {
             NotImplemented;
-            return autoPtr<faceSelection>(nullptr);
+            return autoPtr<faceSelection>();
         }
 
 
diff --git a/applications/utilities/mesh/manipulation/mergeOrSplitBaffles/mergeOrSplitBaffles.C b/applications/utilities/mesh/manipulation/mergeOrSplitBaffles/mergeOrSplitBaffles.C
index 5fbbae586f3..bd0522caa9e 100644
--- a/applications/utilities/mesh/manipulation/mergeOrSplitBaffles/mergeOrSplitBaffles.C
+++ b/applications/utilities/mesh/manipulation/mergeOrSplitBaffles/mergeOrSplitBaffles.C
@@ -450,7 +450,7 @@ int main(int argc, char *argv[])
         autoPtr<mapPolyMesh> map = meshMod.changeMesh(mesh, false);
 
         // Update fields
-        mesh.updateMesh(map);
+        mesh.updateMesh(map());
 
         // Move mesh (since morphing does not do this)
         if (map().hasMotionPoints())
@@ -520,7 +520,7 @@ int main(int argc, char *argv[])
         autoPtr<mapPolyMesh> map = meshMod.changeMesh(mesh, false);
 
         // Update fields
-        mesh.updateMesh(map);
+        mesh.updateMesh(map());
 
         // Move mesh (since morphing does not do this)
         if (map().hasMotionPoints())
diff --git a/applications/utilities/mesh/manipulation/polyDualMesh/polyDualMeshApp.C b/applications/utilities/mesh/manipulation/polyDualMesh/polyDualMeshApp.C
index 0234ce16d7a..bb4cd5d5ad7 100644
--- a/applications/utilities/mesh/manipulation/polyDualMesh/polyDualMeshApp.C
+++ b/applications/utilities/mesh/manipulation/polyDualMesh/polyDualMeshApp.C
@@ -531,7 +531,7 @@ int main(int argc, char *argv[])
     autoPtr<mapPolyMesh> map = meshMod.changeMesh(mesh, false);
 
     // Update fields
-    mesh.updateMesh(map);
+    mesh.updateMesh(map());
 
     // Optionally inflate mesh
     if (map().hasMotionPoints())
diff --git a/applications/utilities/mesh/manipulation/renumberMesh/renumberMesh.C b/applications/utilities/mesh/manipulation/renumberMesh/renumberMesh.C
index f681501641e..6ddc7cda15e 100644
--- a/applications/utilities/mesh/manipulation/renumberMesh/renumberMesh.C
+++ b/applications/utilities/mesh/manipulation/renumberMesh/renumberMesh.C
@@ -1089,7 +1089,7 @@ int main(int argc, char *argv[])
 
 
     // Update fields
-    mesh.updateMesh(map);
+    mesh.updateMesh(map());
 
     // Update proc maps
     if (cellProcAddressing.headerOk())
diff --git a/applications/utilities/mesh/manipulation/setSet/setSet.C b/applications/utilities/mesh/manipulation/setSet/setSet.C
index 6141bec908b..18f5ab5b34a 100644
--- a/applications/utilities/mesh/manipulation/setSet/setSet.C
+++ b/applications/utilities/mesh/manipulation/setSet/setSet.C
@@ -472,7 +472,7 @@ bool doCommand
                         setSource().applyToSet(topoSetSource::NEW, currentSet);
 
                         // Combine new value of currentSet with old one.
-                        currentSet.subset(oldSet);
+                        currentSet.subset(oldSet());
                     }
                     break;
                 }
@@ -814,7 +814,7 @@ int main(int argc, char *argv[])
         // Main command read & execute loop
         // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 
-        autoPtr<IFstream> fileStreamPtr(nullptr);
+        autoPtr<IFstream> fileStreamPtr;
 
         if (batch)
         {
diff --git a/applications/utilities/parallelProcessing/reconstructParMesh/reconstructParMesh.C b/applications/utilities/parallelProcessing/reconstructParMesh/reconstructParMesh.C
index e42eecb04f1..1842fd24902 100644
--- a/applications/utilities/parallelProcessing/reconstructParMesh/reconstructParMesh.C
+++ b/applications/utilities/parallelProcessing/reconstructParMesh/reconstructParMesh.C
@@ -257,7 +257,7 @@ autoPtr<mapPolyMesh> mergeSharedPoints
 
     if (returnReduce(pointToMaster.size(), sumOp<label>()) == 0)
     {
-        return autoPtr<mapPolyMesh>(nullptr);
+        return autoPtr<mapPolyMesh>();
     }
 
     polyTopoChange meshMod(mesh);
@@ -268,7 +268,7 @@ autoPtr<mapPolyMesh> mergeSharedPoints
     autoPtr<mapPolyMesh> map = meshMod.changeMesh(mesh, false, true);
 
     // Update fields. No inflation, parallel sync.
-    mesh.updateMesh(map);
+    mesh.updateMesh(map());
 
     // pointProcAddressing give indices into the master mesh so adapt them
     // for changed point numbering.
@@ -699,7 +699,7 @@ int main(int argc, char *argv[])
                 (
                     masterMesh[proci],
                     meshToAdd,
-                    couples
+                    couples()
                 );
 
                 // Added processor
@@ -738,7 +738,7 @@ int main(int argc, char *argv[])
                     (
                         masterMesh[proci],
                         masterMesh[next],
-                        couples
+                        couples()
                     );
 
                     // Processors that were already in masterMesh
diff --git a/applications/utilities/parallelProcessing/redistributePar/redistributePar.C b/applications/utilities/parallelProcessing/redistributePar/redistributePar.C
index 10c3ea80c5a..ea1c13be715 100644
--- a/applications/utilities/parallelProcessing/redistributePar/redistributePar.C
+++ b/applications/utilities/parallelProcessing/redistributePar/redistributePar.C
@@ -1810,18 +1810,20 @@ void reconstructLagrangian
             );
         }
         const parLagrangianRedistributor& lagrangianReconstructor =
-            lagrangianReconstructorPtr();
+            *lagrangianReconstructorPtr;
 
         for (const word& cloudName : cloudNames)
         {
             Info<< "Reconstructing lagrangian fields for cloud "
                 << cloudName << nl << endl;
 
-            autoPtr<mapDistributeBase> lagrangianMap =
+            autoPtr<mapDistributeBase> lagrangianMapPtr =
             lagrangianReconstructor.redistributeLagrangianPositions
             (
                 cloudName
             );
+            const mapDistributeBase& lagrangianMap = *lagrangianMapPtr;
+
             IOobjectList sprayObjs
             (
                 mesh,
@@ -2129,8 +2131,9 @@ void redistributeLagrangian
 
         forAll(clouds, i)
         {
-            autoPtr<mapDistributeBase> lagrangianMap =
-            distributor.redistributeLagrangianPositions(clouds[i]);
+            autoPtr<mapDistributeBase> lagrangianMapPtr =
+                distributor.redistributeLagrangianPositions(clouds[i]);
+            const mapDistributeBase& lagrangianMap = *lagrangianMapPtr;
 
             distributor.redistributeStoredLagrangianFields
             <IOField<label>>
@@ -2694,7 +2697,7 @@ int main(int argc, char *argv[])
             (
                 baseMeshPtr(),
                 mesh,
-                distMap,
+                distMap(),
                 Pstream::master()       // do I need to write?
             )
         );
@@ -2778,7 +2781,7 @@ int main(int argc, char *argv[])
                     (
                         baseMeshPtr(),
                         mesh,
-                        distMap,
+                        distMap(),
                         Pstream::master()
                     )
                 );
@@ -2804,7 +2807,7 @@ int main(int argc, char *argv[])
                 lagrangianReconstructorPtr,
                 baseMeshPtr(),
                 mesh,
-                distMap,
+                distMap(),
                 selectedLagrangianFields
             );
 
@@ -3012,7 +3015,7 @@ int main(int argc, char *argv[])
             lagrangianReconstructorPtr,
             mesh,
             nOldCells,
-            distMap,
+            distMap(),
             clouds
         );
 
diff --git a/applications/utilities/postProcessing/dataConversion/foamToEnsight/ensightOutputCloudTemplates.C b/applications/utilities/postProcessing/dataConversion/foamToEnsight/ensightOutputCloudTemplates.C
index 04fd865c2ca..fb318c062d3 100644
--- a/applications/utilities/postProcessing/dataConversion/foamToEnsight/ensightOutputCloudTemplates.C
+++ b/applications/utilities/postProcessing/dataConversion/foamToEnsight/ensightOutputCloudTemplates.C
@@ -142,7 +142,7 @@ bool Foam::ensightCloud::writeCloudField
         IOField<Type> field(fieldObject);
         fieldObject.readOpt() = rOpt;
 
-        writeCloudField(field, output.rawRef());
+        writeCloudField(field, output.ref());
     }
 
     return true;
diff --git a/applications/utilities/postProcessing/dataConversion/foamToEnsightParts/ensightOutputSerialCloudTemplates.C b/applications/utilities/postProcessing/dataConversion/foamToEnsightParts/ensightOutputSerialCloudTemplates.C
index 42034d0a1e8..060e139b7a0 100644
--- a/applications/utilities/postProcessing/dataConversion/foamToEnsightParts/ensightOutputSerialCloudTemplates.C
+++ b/applications/utilities/postProcessing/dataConversion/foamToEnsightParts/ensightOutputSerialCloudTemplates.C
@@ -83,7 +83,7 @@ bool Foam::ensightSerialCloud::writeCloudField
 )
 {
     IOField<Type> field(fieldObject);
-    return writeCloudField(field, output.rawRef());
+    return writeCloudField(field, output.ref());
 }
 
 
diff --git a/applications/utilities/postProcessing/dataConversion/foamToEnsightParts/foamToEnsightParts.C b/applications/utilities/postProcessing/dataConversion/foamToEnsightParts/foamToEnsightParts.C
index 7722eedbabb..f21a8dc5c72 100644
--- a/applications/utilities/postProcessing/dataConversion/foamToEnsightParts/foamToEnsightParts.C
+++ b/applications/utilities/postProcessing/dataConversion/foamToEnsightParts/foamToEnsightParts.C
@@ -269,7 +269,7 @@ int main(int argc, char *argv[])
             if (!optNoMesh)
             {
                 autoPtr<ensightGeoFile> os = ensCase.newGeometry(meshMoving);
-                partsList.write(os.rawRef());
+                partsList.write(os.ref());
             }
         }
 
diff --git a/applications/utilities/postProcessing/dataConversion/foamToVTK/foamVtkLagrangianWriter.H b/applications/utilities/postProcessing/dataConversion/foamToVTK/foamVtkLagrangianWriter.H
index 5e6d2fc9c7b..bbfbb6e4db1 100644
--- a/applications/utilities/postProcessing/dataConversion/foamToVTK/foamVtkLagrangianWriter.H
+++ b/applications/utilities/postProcessing/dataConversion/foamToVTK/foamVtkLagrangianWriter.H
@@ -127,7 +127,7 @@ public:
 
         inline vtk::formatter& format()
         {
-            return format_();
+            return *format_;
         }
 
         inline label nParcels() const
diff --git a/applications/utilities/postProcessing/miscellaneous/pdfPlot/createFields.H b/applications/utilities/postProcessing/miscellaneous/pdfPlot/createFields.H
index 860d7c2eb9a..9c663017f51 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(nullptr);
+    autoPtr<OFstream> filePtr;
     if (writeData)
     {
         fileName fName = pdfPath/(p->type() + ".data");
diff --git a/applications/utilities/surface/surfacePatch/searchableSurfaceModifier/autoPatch.H b/applications/utilities/surface/surfacePatch/searchableSurfaceModifier/autoPatch.H
index c50c6ebb112..40d23bbb963 100644
--- a/applications/utilities/surface/surfacePatch/searchableSurfaceModifier/autoPatch.H
+++ b/applications/utilities/surface/surfacePatch/searchableSurfaceModifier/autoPatch.H
@@ -76,7 +76,7 @@ public:
         autoPtr<searchableSurfaceModifier> clone() const
         {
             NotImplemented;
-            return autoPtr<searchableSurfaceModifier>(nullptr);
+            return autoPtr<searchableSurfaceModifier>();
         }
 
 
diff --git a/applications/utilities/surface/surfacePatch/searchableSurfaceModifier/cut.H b/applications/utilities/surface/surfacePatch/searchableSurfaceModifier/cut.H
index 413e69b935a..1024e5e44b0 100644
--- a/applications/utilities/surface/surfacePatch/searchableSurfaceModifier/cut.H
+++ b/applications/utilities/surface/surfacePatch/searchableSurfaceModifier/cut.H
@@ -100,7 +100,7 @@ public:
         autoPtr<searchableSurfaceModifier> clone() const
         {
             NotImplemented;
-            return autoPtr<searchableSurfaceModifier>(nullptr);
+            return autoPtr<searchableSurfaceModifier>();
         }
 
 
diff --git a/applications/utilities/surface/surfacePatch/searchableSurfaceModifier/searchableSurfaceModifier.H b/applications/utilities/surface/surfacePatch/searchableSurfaceModifier/searchableSurfaceModifier.H
index b8329f366cd..897bad68a0f 100644
--- a/applications/utilities/surface/surfacePatch/searchableSurfaceModifier/searchableSurfaceModifier.H
+++ b/applications/utilities/surface/surfacePatch/searchableSurfaceModifier/searchableSurfaceModifier.H
@@ -96,7 +96,7 @@ public:
         autoPtr<searchableSurfaceModifier> clone() const
         {
             NotImplemented;
-            return autoPtr<searchableSurfaceModifier>(nullptr);
+            return autoPtr<searchableSurfaceModifier>();
         }
 
 
diff --git a/src/OpenFOAM/algorithms/dynamicIndexedOctree/dynamicIndexedOctree.C b/src/OpenFOAM/algorithms/dynamicIndexedOctree/dynamicIndexedOctree.C
index 20475acead2..b1909bc78aa 100644
--- a/src/OpenFOAM/algorithms/dynamicIndexedOctree/dynamicIndexedOctree.C
+++ b/src/OpenFOAM/algorithms/dynamicIndexedOctree/dynamicIndexedOctree.C
@@ -220,7 +220,7 @@ Foam::dynamicIndexedOctree<Type>::divide
         {
             if (!replaced)
             {
-                contents_[contentI]().transfer(subIndices());
+                contents_[contentI]->transfer(subIndices());
                 nod.subNodes_[octant] = contentPlusOctant(contentI, octant);
 
                 replaced = true;
@@ -239,7 +239,7 @@ Foam::dynamicIndexedOctree<Type>::divide
                     )
                 );
 
-                contents_[sz]().transfer(subIndices());
+                contents_[sz]->transfer(subIndices());
 
                 nod.subNodes_[octant] = contentPlusOctant(sz, octant);
             }
@@ -280,7 +280,7 @@ void Foam::dynamicIndexedOctree<Type>::recursiveSubDivision
 {
     if
     (
-        contents_[contentI]().size() > minSize_
+        contents_[contentI]->size() > minSize_
      && nLevels < maxLevels_
     )
     {
@@ -524,7 +524,7 @@ void Foam::dynamicIndexedOctree<Type>::findNearest
             {
                 shapes_.findNearest
                 (
-                    contents_[getContent(index)],
+                    *(contents_[getContent(index)]),
                     sample,
 
                     nearestDistSqr,
@@ -589,7 +589,7 @@ void Foam::dynamicIndexedOctree<Type>::findNearest
             {
                 shapes_.findNearest
                 (
-                    contents_[getContent(index)],
+                    *(contents_[getContent(index)]),
                     ln,
 
                     tightest,
@@ -1341,7 +1341,7 @@ void Foam::dynamicIndexedOctree<Type>::traverseNode
 
     if (isContent(index))
     {
-        const labelList& indices = contents_[getContent(index)];
+        const labelList& indices = *(contents_[getContent(index)]);
 
         if (indices.size())
         {
@@ -1755,7 +1755,7 @@ void Foam::dynamicIndexedOctree<Type>::findBox
 
             if (subBb.overlaps(searchBox))
             {
-                const labelList& indices = contents_[getContent(index)];
+                const labelList& indices = *(contents_[getContent(index)]);
 
                 forAll(indices, i)
                 {
@@ -1803,7 +1803,7 @@ void Foam::dynamicIndexedOctree<Type>::findSphere
 
             if (subBb.overlaps(centre, radiusSqr))
             {
-                const labelList& indices = contents_[getContent(index)];
+                const labelList& indices = *(contents_[getContent(index)]);
 
                 forAll(indices, i)
                 {
@@ -2016,7 +2016,7 @@ Foam::label Foam::dynamicIndexedOctree<Type>::countElements
     }
     else if (isContent(index))
     {
-        nElems += contents_[getContent(index)]().size();
+        nElems += contents_[getContent(index)]->size();
     }
     else
     {
@@ -2302,7 +2302,7 @@ Foam::label Foam::dynamicIndexedOctree<Type>::findInside
     // Need to check for the presence of content, in-case the node is empty
     if (isContent(contentIndex))
     {
-        labelList indices = contents_[getContent(contentIndex)];
+        const labelList& indices = *(contents_[getContent(contentIndex)]);
 
         forAll(indices, elemI)
         {
@@ -2334,12 +2334,10 @@ const Foam::labelList& Foam::dynamicIndexedOctree<Type>::findIndices
     // Need to check for the presence of content, in-case the node is empty
     if (isContent(contentIndex))
     {
-        return contents_[getContent(contentIndex)];
-    }
-    else
-    {
-        return emptyList<label>();
+        return *(contents_[getContent(contentIndex)]);
     }
+
+    return emptyList<label>();
 }
 
 
@@ -2454,7 +2452,7 @@ bool Foam::dynamicIndexedOctree<Type>::insert(label startIndex, label endIndex)
             )
         );
 
-        contents_[0]().append(0);
+        contents_[0]->append(0);
 
         // Create topnode.
         node topNode = divide(bb_, 0, -1, 0);
@@ -2518,7 +2516,7 @@ bool Foam::dynamicIndexedOctree<Type>::insertIndex
             {
                 const label contentI = getContent(subNodeLabel);
 
-                contents_[contentI]().append(index);
+                contents_[contentI]->append(index);
 
                 recursiveSubDivision
                 (
@@ -2545,7 +2543,7 @@ bool Foam::dynamicIndexedOctree<Type>::insertIndex
                     autoPtr<DynamicList<label>>(new DynamicList<label>(1))
                 );
 
-                contents_[sz]().append(index);
+                contents_[sz]->append(index);
 
                 nodes_[nodIndex].subNodes_[octant]
                     = contentPlusOctant(sz, octant);
@@ -2618,7 +2616,7 @@ Foam::label Foam::dynamicIndexedOctree<Type>::removeIndex
 
             if (shapes().overlaps(index, subBb))
             {
-                DynamicList<label>& contentList = contents_[contentI]();
+                DynamicList<label>& contentList = *(contents_[contentI]);
 
                 DynamicList<label> newContent(contentList.size());
 
@@ -2644,7 +2642,7 @@ Foam::label Foam::dynamicIndexedOctree<Type>::removeIndex
                 contentList.transfer(newContent);
             }
 
-            totalContents += contents_[contentI]().size();
+            totalContents += contents_[contentI]->size();
         }
         else
         {
@@ -2695,7 +2693,7 @@ void Foam::dynamicIndexedOctree<Type>::print
         }
         else if (isContent(index))
         {
-            const labelList& indices = contents_[getContent(index)];
+            const labelList& indices = *(contents_[getContent(index)]);
 
             if (false) //debug)
             {
@@ -2735,7 +2733,7 @@ void Foam::dynamicIndexedOctree<Type>::writeTreeInfo() const
     label nEntries = 0;
     forAll(contents_, i)
     {
-        nEntries += contents_[i]().size();
+        nEntries += contents_[i]->size();
     }
 
     Pout<< "indexedOctree<Type>::indexedOctree"
diff --git a/src/OpenFOAM/algorithms/dynamicIndexedOctree/dynamicIndexedOctree.H b/src/OpenFOAM/algorithms/dynamicIndexedOctree/dynamicIndexedOctree.H
index 8017a943fb5..c76391fe06d 100644
--- a/src/OpenFOAM/algorithms/dynamicIndexedOctree/dynamicIndexedOctree.H
+++ b/src/OpenFOAM/algorithms/dynamicIndexedOctree/dynamicIndexedOctree.H
@@ -50,7 +50,7 @@ SourceFiles
 namespace Foam
 {
 
-typedef DynamicList<autoPtr<DynamicList<label >>> contentListList;
+typedef DynamicList<autoPtr<DynamicList<label>>> contentListList;
 
 // Forward declaration of classes
 template<class Type> class dynamicIndexedOctree;
diff --git a/src/OpenFOAM/db/IOobjects/decomposedBlockData/decomposedBlockData.C b/src/OpenFOAM/db/IOobjects/decomposedBlockData/decomposedBlockData.C
index 6d315cd7a6b..1604a31e576 100644
--- a/src/OpenFOAM/db/IOobjects/decomposedBlockData/decomposedBlockData.C
+++ b/src/OpenFOAM/db/IOobjects/decomposedBlockData/decomposedBlockData.C
@@ -262,12 +262,15 @@ Foam::autoPtr<Foam::ISstream> Foam::decomposedBlockData::readBlock
         is.fatalCheck("read(Istream&) : reading entry");
 
         string buf(data.begin(), data.size());
-        realIsPtr = new IStringStream
+        realIsPtr.reset
         (
-            buf,
-            IOstream::ASCII,
-            IOstream::currentVersion,
-            is.name()
+            new IStringStream
+            (
+                buf,
+                IOstream::ASCII,
+                IOstream::currentVersion,
+                is.name()
+            )
         );
 
         // Read header
@@ -314,12 +317,15 @@ Foam::autoPtr<Foam::ISstream> Foam::decomposedBlockData::readBlock
             is.fatalCheck("read(Istream&) : reading entry");
         }
         string buf(data.begin(), data.size());
-        realIsPtr = new IStringStream
+        realIsPtr.reset
         (
-            buf,
-            IOstream::ASCII,
-            IOstream::currentVersion,
-            is.name()
+            new IStringStream
+            (
+                buf,
+                IOstream::ASCII,
+                IOstream::currentVersion,
+                is.name()
+            )
         );
 
         // Apply master stream settings to realIsPtr
@@ -484,12 +490,15 @@ Foam::autoPtr<Foam::ISstream> Foam::decomposedBlockData::readBlocks
                 is.fatalCheck("read(Istream&) : reading entry");
 
                 string buf(data.begin(), data.size());
-                realIsPtr = new IStringStream
+                realIsPtr.reset
                 (
-                    buf,
-                    IOstream::ASCII,
-                    IOstream::currentVersion,
-                    fName
+                    new IStringStream
+                    (
+                        buf,
+                        IOstream::ASCII,
+                        IOstream::currentVersion,
+                        fName
+                    )
                 );
 
                 // Read header
@@ -538,12 +547,15 @@ Foam::autoPtr<Foam::ISstream> Foam::decomposedBlockData::readBlocks
             is >> data;
 
             string buf(data.begin(), data.size());
-            realIsPtr = new IStringStream
+            realIsPtr.reset
             (
-                buf,
-                IOstream::ASCII,
-                IOstream::currentVersion,
-                fName
+                new IStringStream
+                (
+                    buf,
+                    IOstream::ASCII,
+                    IOstream::currentVersion,
+                    fName
+                )
             );
         }
     }
@@ -567,12 +579,15 @@ Foam::autoPtr<Foam::ISstream> Foam::decomposedBlockData::readBlocks
                 is.fatalCheck("read(Istream&) : reading entry");
 
                 string buf(data.begin(), data.size());
-                realIsPtr = new IStringStream
+                realIsPtr.reset
                 (
-                    buf,
-                    IOstream::ASCII,
-                    IOstream::currentVersion,
-                    fName
+                    new IStringStream
+                    (
+                        buf,
+                        IOstream::ASCII,
+                        IOstream::currentVersion,
+                        fName
+                    )
                 );
 
                 // Read header
@@ -611,12 +626,15 @@ Foam::autoPtr<Foam::ISstream> Foam::decomposedBlockData::readBlocks
             is >> data;
 
             string buf(data.begin(), data.size());
-            realIsPtr = new IStringStream
+            realIsPtr.reset
             (
-                buf,
-                IOstream::ASCII,
-                IOstream::currentVersion,
-                fName
+                new IStringStream
+                (
+                    buf,
+                    IOstream::ASCII,
+                    IOstream::currentVersion,
+                    fName
+                )
             );
         }
     }
diff --git a/src/OpenFOAM/db/IOstreams/token/token.C b/src/OpenFOAM/db/IOstreams/token/token.C
index c082df43cc9..dbe34e6aa0d 100644
--- a/src/OpenFOAM/db/IOstreams/token/token.C
+++ b/src/OpenFOAM/db/IOstreams/token/token.C
@@ -48,12 +48,6 @@ void Foam::token::parseError(const char* expected) const
 }
 
 
-// * * * * * * * * * * * * * * * * Destructor  * * * * * * * * * * * * * * * //
-
-Foam::token::compound::~compound()
-{}
-
-
 // * * * * * * * * * * * * * * * * Selectors * * * * * * * * * * * * * * * * //
 
 Foam::autoPtr<Foam::token::compound> Foam::token::compound::New
diff --git a/src/OpenFOAM/db/IOstreams/token/token.H b/src/OpenFOAM/db/IOstreams/token/token.H
index 868019ba3af..ad3c39c4024 100644
--- a/src/OpenFOAM/db/IOstreams/token/token.H
+++ b/src/OpenFOAM/db/IOstreams/token/token.H
@@ -143,9 +143,13 @@ public:
     :
         public refCount
     {
-        // Private data
+        bool empty_;
 
-            bool empty_;
+        //- No default copy construct
+        compound(const compound&) = delete;
+
+        //- No default assign operator
+        compound& operator=(const compound&) = delete;
 
     public:
 
@@ -171,25 +175,22 @@ public:
                 empty_(false)
             {}
 
-            //- No default copy construct
-            compound(const compound&) = delete;
-
 
         // Selectors
 
             //- Select null constructed
             static autoPtr<compound> New(const word& type, Istream& is);
 
+            //- Return true if name is a known (registered) compound type
+            static bool isCompound(const word& name);
+
 
         //- Destructor
-        virtual ~compound();
+        virtual ~compound() = default;
 
 
         // Member Functions
 
-            //- Return true if name is a known compound type
-            static bool isCompound(const word& name);
-
             bool empty() const
             {
                 return empty_;
@@ -207,9 +208,6 @@ public:
 
         // Operators
 
-            //- No default assign operator
-            compound& operator=(const compound&) = delete;
-
             //- Output operator
             friend Ostream& operator<<(Ostream& os, const compound& ct);
     };
diff --git a/src/OpenFOAM/db/Time/Time.H b/src/OpenFOAM/db/Time/Time.H
index 16b78f40c3e..608e835a0d1 100644
--- a/src/OpenFOAM/db/Time/Time.H
+++ b/src/OpenFOAM/db/Time/Time.H
@@ -466,7 +466,7 @@ public:
             //- Return previous TimeState if time is being sub-cycled
             const TimeState& prevTimeState() const
             {
-                return prevTimeState_();
+                return *prevTimeState_;
             }
 
 
diff --git a/src/OpenFOAM/db/dictionary/entry/entryIO.C b/src/OpenFOAM/db/dictionary/entry/entryIO.C
index b1fb4b92baa..aea73192715 100644
--- a/src/OpenFOAM/db/dictionary/entry/entryIO.C
+++ b/src/OpenFOAM/db/dictionary/entry/entryIO.C
@@ -437,7 +437,7 @@ Foam::autoPtr<Foam::entry> Foam::entry::New(Istream& is)
 {
     is.fatalCheck(FUNCTION_NAME);
 
-    autoPtr<entry> ptr(nullptr);
+    autoPtr<entry> ptr;
 
     // Get the next keyword and if invalid return false
     keyType keyword;
diff --git a/src/OpenFOAM/db/functionObjects/functionObject/functionObject.H b/src/OpenFOAM/db/functionObjects/functionObject/functionObject.H
index 3f47feba8c4..825b562af75 100644
--- a/src/OpenFOAM/db/functionObjects/functionObject/functionObject.H
+++ b/src/OpenFOAM/db/functionObjects/functionObject/functionObject.H
@@ -197,7 +197,7 @@ public:
         autoPtr<functionObject> clone() const
         {
             NotImplemented;
-            return autoPtr<functionObject>(nullptr);
+            return autoPtr<functionObject>();
         }
 
 
diff --git a/src/OpenFOAM/db/functionObjects/functionObjectList/functionObjectList.C b/src/OpenFOAM/db/functionObjects/functionObjectList/functionObjectList.C
index d6ec115a0f4..76ee09ff27f 100644
--- a/src/OpenFOAM/db/functionObjects/functionObjectList/functionObjectList.C
+++ b/src/OpenFOAM/db/functionObjects/functionObjectList/functionObjectList.C
@@ -483,7 +483,7 @@ Foam::IOdictionary& Foam::functionObjectList::stateDict()
         createStateDict();
     }
 
-    return stateDictPtr_();
+    return *stateDictPtr_;
 }
 
 
@@ -494,7 +494,7 @@ const Foam::IOdictionary& Foam::functionObjectList::stateDict() const
         createStateDict();
     }
 
-    return stateDictPtr_();
+    return *stateDictPtr_;
 }
 
 
diff --git a/src/OpenFOAM/db/functionObjects/timeControl/timeControlFunctionObjectI.H b/src/OpenFOAM/db/functionObjects/timeControl/timeControlFunctionObjectI.H
index e759243b5c5..7fddc48b550 100644
--- a/src/OpenFOAM/db/functionObjects/timeControl/timeControlFunctionObjectI.H
+++ b/src/OpenFOAM/db/functionObjects/timeControl/timeControlFunctionObjectI.H
@@ -54,7 +54,7 @@ Foam::functionObjects::timeControl::writeControl() const
 inline const Foam::functionObject&
 Foam::functionObjects::timeControl::filter() const
 {
-    return foPtr_();
+    return *foPtr_;
 }
 
 
diff --git a/src/OpenFOAM/db/functionObjects/writeFile/writeFile.C b/src/OpenFOAM/db/functionObjects/writeFile/writeFile.C
index a4156499a89..9c8e6f40563 100644
--- a/src/OpenFOAM/db/functionObjects/writeFile/writeFile.C
+++ b/src/OpenFOAM/db/functionObjects/writeFile/writeFile.C
@@ -214,7 +214,7 @@ Foam::OFstream& Foam::functionObjects::writeFile::file()
             << "File pointer not allocated";
     }
 
-    return filePtr_();
+    return *filePtr_;
 }
 
 
diff --git a/src/OpenFOAM/db/regIOobject/regIOobjectRead.C b/src/OpenFOAM/db/regIOobject/regIOobjectRead.C
index 2bd29561b51..bdabea53525 100644
--- a/src/OpenFOAM/db/regIOobject/regIOobjectRead.C
+++ b/src/OpenFOAM/db/regIOobject/regIOobjectRead.C
@@ -131,7 +131,7 @@ Foam::Istream& Foam::regIOobject::readStream(const bool valid)
         isPtr_ = fileHandler().readStream(*this, objPath, type(), valid);
     }
 
-    return isPtr_();
+    return *isPtr_;
 }
 
 
@@ -174,7 +174,7 @@ Foam::Istream& Foam::regIOobject::readStream
         }
     }
 
-    return isPtr_();
+    return *isPtr_;
 }
 
 
diff --git a/src/OpenFOAM/fields/pointPatchFields/derived/codedFixedValue/codedFixedValuePointPatchField.C b/src/OpenFOAM/fields/pointPatchFields/derived/codedFixedValue/codedFixedValuePointPatchField.C
index df0062d38a3..755ca039672 100644
--- a/src/OpenFOAM/fields/pointPatchFields/derived/codedFixedValue/codedFixedValuePointPatchField.C
+++ b/src/OpenFOAM/fields/pointPatchFields/derived/codedFixedValue/codedFixedValuePointPatchField.C
@@ -285,7 +285,7 @@ Foam::codedFixedValuePointPatchField<Type>::redirectPatchField() const
             ).ptr()
         );
     }
-    return redirectPatchFieldPtr_();
+    return *redirectPatchFieldPtr_;
 }
 
 
diff --git a/src/OpenFOAM/fields/pointPatchFields/derived/uniformFixedValue/uniformFixedValuePointPatchField.C b/src/OpenFOAM/fields/pointPatchFields/derived/uniformFixedValue/uniformFixedValuePointPatchField.C
index cd0b7ec418d..a68d0e82d07 100644
--- a/src/OpenFOAM/fields/pointPatchFields/derived/uniformFixedValue/uniformFixedValuePointPatchField.C
+++ b/src/OpenFOAM/fields/pointPatchFields/derived/uniformFixedValue/uniformFixedValuePointPatchField.C
@@ -78,7 +78,7 @@ uniformFixedValuePointPatchField
 )
 :
     fixedValuePointPatchField<Type>(ptf, p, iF, mapper),
-    uniformValue_(ptf.uniformValue_, false)
+    uniformValue_(ptf.uniformValue_.clone())
 {
     // For safety re-evaluate
     const scalar t = this->db().time().timeOutputValue();
@@ -94,7 +94,7 @@ uniformFixedValuePointPatchField
 )
 :
     fixedValuePointPatchField<Type>(ptf),
-    uniformValue_(ptf.uniformValue_, false)
+    uniformValue_(ptf.uniformValue_.clone())
 {}
 
 
@@ -107,7 +107,7 @@ uniformFixedValuePointPatchField
 )
 :
     fixedValuePointPatchField<Type>(ptf, iF),
-    uniformValue_(ptf.uniformValue_, false)
+    uniformValue_(ptf.uniformValue_.clone())
 {
     // For safety re-evaluate
     const scalar t = this->db().time().timeOutputValue();
diff --git a/src/OpenFOAM/global/fileOperations/fileOperation/fileOperation.C b/src/OpenFOAM/global/fileOperations/fileOperation/fileOperation.C
index a21c334ff56..3da0f018a0a 100644
--- a/src/OpenFOAM/global/fileOperations/fileOperation/fileOperation.C
+++ b/src/OpenFOAM/global/fileOperations/fileOperation/fileOperation.C
@@ -74,7 +74,7 @@ Foam::fileMonitor& Foam::fileOperation::monitor() const
             )
         );
     }
-    return monitorPtr_();
+    return *monitorPtr_;
 }
 
 
@@ -597,7 +597,8 @@ const Foam::fileOperation& Foam::fileHandler()
 
         fileOperation::fileHandlerPtr_ = fileOperation::New(handler, true);
     }
-    return fileOperation::fileHandlerPtr_();
+
+    return *fileOperation::fileHandlerPtr_;
 }
 
 
@@ -618,7 +619,7 @@ void Foam::fileHandler(autoPtr<fileOperation>& newHandlerPtr)
 
     if (newHandlerPtr.valid())
     {
-        fileOperation::fileHandlerPtr_ = newHandlerPtr;
+        fileOperation::fileHandlerPtr_ = std::move(newHandlerPtr);
     }
 }
 
diff --git a/src/OpenFOAM/matrices/LUscalarMatrix/procLduInterface.H b/src/OpenFOAM/matrices/LUscalarMatrix/procLduInterface.H
index 7f99e76a9f2..4026e203bdf 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>(nullptr);
+            return autoPtr<procLduInterface>();
         }
 
         static autoPtr<procLduInterface> New(Istream& is)
diff --git a/src/OpenFOAM/matrices/lduMatrix/lduMatrix/lduMatrixPreconditioner.C b/src/OpenFOAM/matrices/lduMatrix/lduMatrix/lduMatrixPreconditioner.C
index 2d85cca0ae0..4fd508c6bfc 100644
--- a/src/OpenFOAM/matrices/lduMatrix/lduMatrix/lduMatrixPreconditioner.C
+++ b/src/OpenFOAM/matrices/lduMatrix/lduMatrix/lduMatrixPreconditioner.C
@@ -139,7 +139,7 @@ Foam::lduMatrix::preconditioner::New
                "no diagonal or off-diagonal coefficient"
             << exit(FatalIOError);
 
-        return autoPtr<lduMatrix::preconditioner>(nullptr);
+        return autoPtr<lduMatrix::preconditioner>();
     }
 }
 
diff --git a/src/OpenFOAM/matrices/lduMatrix/lduMatrix/lduMatrixSmoother.C b/src/OpenFOAM/matrices/lduMatrix/lduMatrix/lduMatrixSmoother.C
index 0edeea6a9cb..71c9475d396 100644
--- a/src/OpenFOAM/matrices/lduMatrix/lduMatrix/lduMatrixSmoother.C
+++ b/src/OpenFOAM/matrices/lduMatrix/lduMatrix/lduMatrixSmoother.C
@@ -143,7 +143,7 @@ Foam::autoPtr<Foam::lduMatrix::smoother> Foam::lduMatrix::smoother::New
                "no diagonal or off-diagonal coefficient"
             << exit(FatalIOError);
 
-        return autoPtr<lduMatrix::smoother>(nullptr);
+        return autoPtr<lduMatrix::smoother>();
     }
 }
 
diff --git a/src/OpenFOAM/matrices/lduMatrix/lduMatrix/lduMatrixSolver.C b/src/OpenFOAM/matrices/lduMatrix/lduMatrix/lduMatrixSolver.C
index 0bcd04bf4ee..38e10b12e52 100644
--- a/src/OpenFOAM/matrices/lduMatrix/lduMatrix/lduMatrixSolver.C
+++ b/src/OpenFOAM/matrices/lduMatrix/lduMatrix/lduMatrixSolver.C
@@ -123,7 +123,7 @@ Foam::autoPtr<Foam::lduMatrix::solver> Foam::lduMatrix::solver::New
                "no diagonal or off-diagonal coefficient"
             << exit(FatalIOError);
 
-        return autoPtr<lduMatrix::solver>(nullptr);
+        return autoPtr<lduMatrix::solver>();
     }
 }
 
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 ee20d9b461b..d3b63e7b9d7 100644
--- a/src/OpenFOAM/matrices/lduMatrix/solvers/GAMG/GAMGAgglomerations/GAMGAgglomeration/GAMGAgglomeration.C
+++ b/src/OpenFOAM/matrices/lduMatrix/solvers/GAMG/GAMGAgglomerations/GAMGAgglomeration/GAMGAgglomeration.C
@@ -252,7 +252,7 @@ Foam::GAMGAgglomeration::GAMGAgglomeration
             *this,
             controlDict
         )
-      : autoPtr<GAMGProcAgglomeration>(nullptr)
+      : autoPtr<GAMGProcAgglomeration>()
     ),
 
     nCells_(maxLevels_),
diff --git a/src/OpenFOAM/memory/autoPtr/autoPtr.H b/src/OpenFOAM/memory/autoPtr/autoPtr.H
index 78c8651d482..a46ba0d0d1d 100644
--- a/src/OpenFOAM/memory/autoPtr/autoPtr.H
+++ b/src/OpenFOAM/memory/autoPtr/autoPtr.H
@@ -3,7 +3,7 @@
   \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox
    \\    /   O peration     |
     \\  /    A nd           | Copyright (C) 2011-2017 OpenFOAM Foundation
-     \\/     M anipulation  | Copyright (C) 2016 OpenCFD Ltd.
+     \\/     M anipulation  | Copyright (C) 2016-2018 OpenCFD Ltd.
 -------------------------------------------------------------------------------
 License
     This file is part of OpenFOAM.
@@ -25,8 +25,15 @@ Class
     Foam::autoPtr
 
 Description
-    An auto-pointer similar to the STL auto_ptr but with automatic casting
-    to a reference to the type and with pointer allocation checking on access.
+    Pointer management similar to std::unique_ptr, with some additional
+    methods and type checking.
+
+Note
+    Parts of the interface now mirror std::unique_ptr, but since it pre-dates
+    both C++11 and std::unique_ptr, it has some additional idiosyncrasies.
+    The const-reference constructors and assignment operators
+    actually use move semantics to allow their participation in
+    default constructible, default assignable classes.
 
 SourceFiles
     autoPtrI.H
@@ -36,6 +43,13 @@ SourceFiles
 #ifndef autoPtr_H
 #define autoPtr_H
 
+// Transitional features/misfeatures:
+#define Foam_autoPtr_copyConstruct
+#define Foam_autoPtr_copyAssign
+#define Foam_autoPtr_castOperator
+
+#include <utility>
+
 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
 
 namespace Foam
@@ -48,114 +62,217 @@ namespace Foam
 template<class T>
 class autoPtr
 {
-    // Public data
-
-        //- Pointer to object
-        mutable T* ptr_;
+    //- Pointer to managed object
+    T* ptr_;
 
 
 public:
 
-    typedef T Type;
+    // STL type definitions
+
+        //- Type of object being managed
+        typedef T element_type;
+
+        //- Pointer to type of object being managed
+        typedef T* pointer;
+
+
+    // Factory Methods
+
+        //- Construct autoPtr of T with forwarding arguments
+        //  \param args list of arguments with which an instance of T
+        //      will be constructed.
+        //
+        //  \note Similar to std::make_unique, but the overload for
+        //      array types is not disabled.
+        template<class... Args>
+        inline static autoPtr<T> New(Args&&... args);
+
+        //- Construct autoPtr from derived type with forwarding arguments
+        //  \param args list of arguments with which an instance of U
+        //      will be constructed.
+        //
+        //  \note Similar to New but for derived types.
+        //  In the future check for is_convertible on the pointer types
+        template<class U, class... Args>
+        inline static autoPtr<T> NewFrom(Args&&... args);
 
 
     // Constructors
 
-        //- Construct null with nullptr
-        inline explicit autoPtr();
+        //- Construct with no managed object.
+        inline constexpr autoPtr() noexcept;
+
+        //- Construct with no managed object (literal nullptr).
+        inline constexpr autoPtr(std::nullptr_t) noexcept;
+
+        //- Construct, taking ownership of the pointer.
+        inline explicit autoPtr(T* p) noexcept;
 
-        //- Store object pointer
-        inline explicit autoPtr(T* p);
+        //- Move construct, transferring ownership.
+        inline autoPtr(autoPtr<T>&& ap) noexcept;
 
-        //- Construct as copy by transferring pointer to this autoPtr and
-        //- setting the arguments pointer to nullptr
-        inline autoPtr(const autoPtr<T>& ap);
+        //- Move construct, transferring ownership from derived type.
+        //  U must be derivable from T
+        //  \note In the future check for is_convertible on the pointer types
+        template<class U>
+        inline explicit autoPtr(autoPtr<U>&& ap);
 
-        //- Construct either by transferring pointer or cloning.
-        //  Should only be called with type that supports cloning
-        inline autoPtr(const autoPtr<T>& ap, const bool reuse);
+        //- A move construct disguised as a copy construct (transfers ownership)
+        //  \remark This is a non-standard definition, and should ideally be
+        //      marked as deleted - pending cleanup of code currently relying
+        //      on this behaviour.
+        #ifdef Foam_autoPtr_copyConstruct
+        inline autoPtr(const autoPtr<T>& ap) noexcept;
+        #else
+        autoPtr(const autoPtr<T>& ap) = delete;
+        #endif
 
 
-    //- Destructor, delete object if pointer is not nullptr
-    inline ~autoPtr();
+    //- Destructs the managed object if such is present
+    inline ~autoPtr() noexcept;
 
 
     // Member Functions
 
-        // Check
+    // Check
+
+        //- True if the managed pointer is null
+        inline bool empty() const noexcept;
+
+        //- True if the managed pointer is non-null
+        inline bool valid() const noexcept;
+
 
-            //- Return true if the autoPtr is empty (ie, no pointer set)
-            inline bool empty() const;
+    // Access
 
-            //- Return true if the autoPtr valid (ie, the pointer is set)
-            inline bool valid() const;
+        //- Return pointer to managed object without nullptr checking.
+        //  Pointer remains under autoPtr management.
+        inline T* get() noexcept;
 
+        //- Return const pointer to managed object without nullptr checking.
+        //  Pointer remains under autoPtr management.
+        inline const T* get() const noexcept;
 
-        // Edit
+        //- Return reference to the managed object without nullptr checking.
+        //  When get() == nullptr, additional guards may be required to avoid
+        //  inadvertent access to a nullptr.
+        inline T& ref();
 
-            //- Release ownership of the object pointer and return the pointer
-            inline T* ptr();
 
-            //- Set pointer to that given.
-            //  If object pointer already set issue a FatalError
-            inline void set(T* p);
+    // Edit
 
-            //- If object pointer already set, delete object and set to given
-            //- pointer
-            inline void reset(T* p = nullptr);
+        //- Return pointer to the managed object and release ownership.
+        inline T* release() noexcept;
 
-            //- Delete object (if the pointer is valid)
-            //- and set pointer to nullptr
-            inline void clear();
+        //- Return pointer to the managed object and release ownership.
+        //- Identical behaviour to release().
+        //  \note Provided for method naming consistent with Foam::tmp
+        inline T* ptr() noexcept;
 
+        //- Delete managed object and set pointer to nullptr
+        inline void clear() noexcept;
 
-        // Access
+        //- Delete managed object and set to new given pointer
+        inline void reset(T* p = nullptr) noexcept;
 
-            //- Return the pointer, without nullptr checking.
-            //  Pointer remains under autoPtr management.
-            inline T* rawPtr();
+        //- Delete managed object and set to new given pointer
+        //  \remark This is a non-standard definition, but may provide better
+        //      code documentation than a simple move assign would.
+        inline void reset(autoPtr<T>&& other) noexcept;
 
-            //- Const access to the pointer, without nullptr checking.
-            //  Pointer remains under autoPtr management.
-            inline const T* rawPtr() const;
+        //- Delete managed object and set to new given pointer
+        //- Identical behaviour to reset().
+        //  \note Provided for backward compatibility - the older version
+        //      enforced a run-time check (Fatal if pointer was already set)
+        //      but this was rarely used.
+        inline void set(T* p) noexcept;
 
-            //- Return the reference, without nullptr checking.
-            inline T& rawRef();
+        //- Swaps the managed object with other autoPtr.
+        inline void swap(autoPtr<T>& other) noexcept;
 
-            //- Return the const reference, without nullptr checking.
-            inline const T& rawRef() const;
 
+    // Other
 
-        // Member operators
+        //- Construct copy by invoking clone on underlying managed object
+        //  \param args list of arguments for clone
+        template<class... Args>
+        inline autoPtr<T> clone(Args&&... args) const;
 
-            //- Return reference to the object data.
-            //  Fatal if no pointer is allocated.
-            inline T& operator()();
 
-            //- Return const reference to the object data
-            //  Fatal if no pointer is allocated.
-            inline const T& operator()() const;
+    // Member Operators
 
-            //- Const cast to the underlying type reference
-            //  Fatal if no pointer is allocated.
-            inline operator const T&() const;
+        //- Return reference to the managed object.
+        //  Fatal error if no pointer is managed
+        inline T& operator*();
 
-            //- Dereferences (non-const) pointer to the managed object
-            //  Fatal if no pointer is allocated.
-            inline T* operator->();
+        //- Return const reference to the object.
+        //  Fatal error if no pointer is managed
+        inline const T& operator*() const;
 
-            //- Dereferences (const) pointer to the managed object
-            //  Fatal if no pointer is allocated.
-            inline const T* operator->() const;
+        //- Dereferences (non-const) pointer to the managed object
+        //  Fatal error if no pointer is managed
+        inline T* operator->();
 
-            //- Take over the object pointer from parameter
-            inline void operator=(T* p);
+        //- Dereferences (const) pointer to the managed object
+        //  Fatal error if no pointer is managed
+        inline const T* operator->() const;
 
-            //- Take over the object pointer from parameter
-            inline void operator=(const autoPtr<T>& ap);
+        //- Return reference to the object data.
+        //  Fatal error if no pointer is managed
+        inline T& operator()();
+
+        //- Return const reference to the object data
+        //  Fatal error if no pointer is managed
+        inline const T& operator()() const;
+
+        //- Automatic cast conversion to the underlying type reference
+        //  Fatal error if no pointer is managed
+        #ifdef Foam_autoPtr_castOperator
+        inline operator const T&() const { return operator*(); }
+        #else
+        operator const T&() const = delete;
+        #endif
+
+
+        //- Transfer object ownership from parameter
+        inline void operator=(autoPtr<T>&& ap) noexcept;
+
+        //- Transfer object ownership from parameter
+        template<class U>
+        inline void operator=(autoPtr<U>&& ap) noexcept;
+
+        #ifdef Foam_autoPtr_copyAssign
+        //- A move assignment disguised as a copy assignment
+        //  \remark Non-standard definition - should just be movable
+        inline void operator=(const autoPtr<T>& ap) noexcept;
+        #else
+        void operator=(const autoPtr<T>& ap) = delete;
+        #endif
+
+        //- Allow reset via assignment from literal nullptr
+        inline void operator=(std::nullptr_t) noexcept;
+
+
+    // Housekeeping
+
+        //- Disallow assignment from plain pointer
+        //  \deprecated Convenient, but uncontrolled access (FEB-2018)
+        void operator=(T* p) = delete;
 };
 
 
+// Global Functions
+
+//- Specializes the Swap algorithm for autoPtr.
+//  Swaps the pointers of lhs and rhs. Calls \c lhs.swap(rhs)
+template<class T>
+void Swap(autoPtr<T>& lhs, autoPtr<T>& rhs)
+{
+    lhs.swap(rhs);
+}
+
+
 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
 
 } // End namespace Foam
diff --git a/src/OpenFOAM/memory/autoPtr/autoPtrI.H b/src/OpenFOAM/memory/autoPtr/autoPtrI.H
index a09209caa9c..128fabe5abd 100644
--- a/src/OpenFOAM/memory/autoPtr/autoPtrI.H
+++ b/src/OpenFOAM/memory/autoPtr/autoPtrI.H
@@ -3,7 +3,7 @@
   \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox
    \\    /   O peration     |
     \\  /    A nd           | Copyright (C) 2011-2017 OpenFOAM Foundation
-     \\/     M anipulation  | Copyright (C) 2016 OpenCFD Ltd.
+     \\/     M anipulation  | Copyright (C) 2016-2018 OpenCFD Ltd.
 -------------------------------------------------------------------------------
 License
     This file is part of OpenFOAM.
@@ -26,180 +26,203 @@ License
 #include "error.H"
 #include <typeinfo>
 
+// * * * * * * * * * * * * * Static Member Functions * * * * * * * * * * * * //
+
+template<class T>
+template<class... Args>
+inline Foam::autoPtr<T> Foam::autoPtr<T>::New(Args&&... args)
+{
+    return autoPtr<T>(new T(std::forward<Args>(args)...));
+}
+
+
+template<class T>
+template<class U, class... Args>
+inline Foam::autoPtr<T> Foam::autoPtr<T>::NewFrom(Args&&... args)
+{
+    return autoPtr<T>(new U(std::forward<Args>(args)...));
+}
+
+
 // * * * * * * * * * * * * * * * * Constructors  * * * * * * * * * * * * * * //
 
 template<class T>
-inline Foam::autoPtr<T>::autoPtr()
+inline constexpr Foam::autoPtr<T>::autoPtr() noexcept
+:
+    ptr_(nullptr)
+{}
+
+
+template<class T>
+inline constexpr Foam::autoPtr<T>::autoPtr(std::nullptr_t) noexcept
 :
     ptr_(nullptr)
 {}
 
 
 template<class T>
-inline Foam::autoPtr<T>::autoPtr(T* p)
+inline Foam::autoPtr<T>::autoPtr(T* p) noexcept
 :
     ptr_(p)
 {}
 
 
 template<class T>
-inline Foam::autoPtr<T>::autoPtr(const autoPtr<T>& ap)
+inline Foam::autoPtr<T>::autoPtr(autoPtr<T>&& ap) noexcept
 :
-    ptr_(ap.ptr_)
-{
-    ap.ptr_ = nullptr;
-}
+    ptr_(ap.release())
+{}
 
 
 template<class T>
-inline Foam::autoPtr<T>::autoPtr(const autoPtr<T>& ap, const bool reuse)
-{
-    if (reuse)
-    {
-        ptr_ = ap.ptr_;
-        ap.ptr_ = nullptr;
-    }
-    else if (ap.valid())
-    {
-        ptr_ = ap().clone().ptr();
-    }
-    else
-    {
-        ptr_ = nullptr;
-    }
-}
+template<class U>
+inline Foam::autoPtr<T>::autoPtr(autoPtr<U>&& ap)
+:
+    ptr_(ap.release())
+{}
+
+
+#ifdef Foam_autoPtr_copyConstruct
+template<class T>
+inline Foam::autoPtr<T>::autoPtr(const autoPtr<T>& ap) noexcept
+:
+    ptr_(const_cast<autoPtr<T>&>(ap).release())
+{}
+#endif
 
 
+// * * * * * * * * * * * * * * * * Destructor  * * * * * * * * * * * * * * * //
+
 template<class T>
-inline Foam::autoPtr<T>::~autoPtr()
+inline Foam::autoPtr<T>::~autoPtr() noexcept
 {
-    clear();
+    reset(nullptr);
 }
 
 
 // * * * * * * * * * * * * * * * Member Functions  * * * * * * * * * * * * * //
 
 template<class T>
-inline bool Foam::autoPtr<T>::empty() const
+inline bool Foam::autoPtr<T>::empty() const noexcept
 {
     return !ptr_;
 }
 
 
 template<class T>
-inline bool Foam::autoPtr<T>::valid() const
+inline bool Foam::autoPtr<T>::valid() const noexcept
 {
     return ptr_;
 }
 
 
 template<class T>
-inline T* Foam::autoPtr<T>::ptr()
+inline T* Foam::autoPtr<T>::get() noexcept
 {
-    T* p = ptr_;
-    ptr_ = nullptr;
-    return p;
+    return ptr_;
 }
 
 
 template<class T>
-inline void Foam::autoPtr<T>::set(T* p)
+inline const T* Foam::autoPtr<T>::get() const noexcept
 {
-    if (ptr_)
-    {
-        FatalErrorInFunction
-            << "object of type " << typeid(T).name()
-            << " already allocated"
-            << abort(FatalError);
-    }
+    return ptr_;
+}
 
-    ptr_ = p;
+
+template<class T>
+inline T& Foam::autoPtr<T>::ref()
+{
+    return *ptr_;
 }
 
 
 template<class T>
-inline void Foam::autoPtr<T>::reset(T* p)
+inline T* Foam::autoPtr<T>::release() noexcept
 {
-    if (ptr_)
-    {
-        delete ptr_;
-    }
+    T* p = ptr_;
+    ptr_ = nullptr;
+    return p;
+}
 
-    ptr_ = p;
+
+template<class T>
+inline T* Foam::autoPtr<T>::ptr() noexcept
+{
+    return release();
 }
 
 
 template<class T>
-inline void Foam::autoPtr<T>::clear()
+inline void Foam::autoPtr<T>::clear() noexcept
 {
     reset(nullptr);
 }
 
 
 template<class T>
-inline T* Foam::autoPtr<T>::rawPtr()
+inline void Foam::autoPtr<T>::reset(T* p) noexcept
 {
-    return ptr_;
+    if (ptr_) delete ptr_;
+    ptr_ = p;
 }
 
 
 template<class T>
-inline const T* Foam::autoPtr<T>::rawPtr() const
+inline void Foam::autoPtr<T>::reset(autoPtr<T>&& ap) noexcept
 {
-    return ptr_;
+    reset(ap.release());
 }
 
 
 template<class T>
-inline T& Foam::autoPtr<T>::rawRef()
+inline void Foam::autoPtr<T>::set(T* p) noexcept
 {
-    return *ptr_;
+    reset(p);
 }
 
 
 template<class T>
-inline const T& Foam::autoPtr<T>::rawRef() const
+inline void Foam::autoPtr<T>::swap(autoPtr<T>& other) noexcept
 {
-    return *ptr_;
+    T* p = ptr_;
+    ptr_ = other.ptr_;
+    other.ptr_ = p;
 }
 
 
-// * * * * * * * * * * * * * * * Member Operators  * * * * * * * * * * * * * //
-
 template<class T>
-inline T& Foam::autoPtr<T>::operator()()
+template<class... Args>
+inline Foam::autoPtr<T> Foam::autoPtr<T>::clone(Args&&... args) const
 {
-    if (!ptr_)
+    if (ptr_)
     {
-        FatalErrorInFunction
-            << "object of type " << typeid(T).name()
-            << " is not allocated"
-            << abort(FatalError);
+        return autoPtr<T>(ptr_->clone(std::forward<Args>(args)...).ptr());
     }
 
-    return *ptr_;
+    return autoPtr<T>();
 }
 
 
+// * * * * * * * * * * * * * * * Member Operators  * * * * * * * * * * * * * //
+
 template<class T>
-inline const T& Foam::autoPtr<T>::operator()() const
+inline T& Foam::autoPtr<T>::operator*()
 {
     if (!ptr_)
     {
         FatalErrorInFunction
-            << "object of type " << typeid(T).name()
-            << " is not allocated"
+            << "object of type " << typeid(T).name() << " is unallocated"
             << abort(FatalError);
     }
-
     return *ptr_;
 }
 
 
 template<class T>
-inline Foam::autoPtr<T>::operator const T&() const
+inline const T& Foam::autoPtr<T>::operator*() const
 {
-    return operator()();
+    return const_cast<autoPtr<T>*>(this)->operator*();
 }
 
 
@@ -209,11 +232,9 @@ inline T* Foam::autoPtr<T>::operator->()
     if (!ptr_)
     {
         FatalErrorInFunction
-            << "object of type " << typeid(T).name()
-            << " is not allocated"
+            << "object of type " << typeid(T).name() << " is unallocated"
             << abort(FatalError);
     }
-
     return ptr_;
 }
 
@@ -221,25 +242,59 @@ inline T* Foam::autoPtr<T>::operator->()
 template<class T>
 inline const T* Foam::autoPtr<T>::operator->() const
 {
-    return const_cast<autoPtr<T>&>(*this).operator->();
+    return const_cast<autoPtr<T>*>(this)->operator->();
 }
 
 
 template<class T>
-inline void Foam::autoPtr<T>::operator=(T* p)
+inline T& Foam::autoPtr<T>::operator()()
 {
-    reset(p);
+    return operator*();
+}
+
+
+template<class T>
+inline const T& Foam::autoPtr<T>::operator()() const
+{
+    return operator*();
 }
 
 
 template<class T>
-inline void Foam::autoPtr<T>::operator=(const autoPtr<T>& ap)
+inline void Foam::autoPtr<T>::operator=(autoPtr<T>&& ap) noexcept
 {
     if (this != &ap)
     {
-        reset(const_cast<autoPtr<T>&>(ap).ptr());
+        reset(ap.release());
     }
 }
 
 
+template<class T>
+template<class U>
+inline void Foam::autoPtr<T>::operator=(autoPtr<U>&& ap) noexcept
+{
+    if (this != &ap)
+    {
+        reset(ap.release());
+    }
+}
+
+
+#ifdef Foam_autoPtr_copyAssign
+template<class T>
+inline void Foam::autoPtr<T>::operator=(const autoPtr<T>& ap) noexcept
+{
+    operator=(std::move(const_cast<autoPtr<T>&>(ap)));
+}
+#endif
+
+
+template<class T>
+inline void Foam::autoPtr<T>::operator=(std::nullptr_t) noexcept
+{
+    reset();
+}
+
+
 // ************************************************************************* //
diff --git a/src/OpenFOAM/meshes/polyMesh/globalMeshData/globalMeshData.C b/src/OpenFOAM/meshes/polyMesh/globalMeshData/globalMeshData.C
index 3492a115b70..6a57e0a0d05 100644
--- a/src/OpenFOAM/meshes/polyMesh/globalMeshData/globalMeshData.C
+++ b/src/OpenFOAM/meshes/polyMesh/globalMeshData/globalMeshData.C
@@ -1888,7 +1888,8 @@ const Foam::labelList& Foam::globalMeshData::sharedPointGlobalLabels() const
             sharedPointGlobalLabels = -1;
         }
     }
-    return sharedPointGlobalLabelsPtr_();
+
+    return *sharedPointGlobalLabelsPtr_;
 }
 
 
@@ -2025,7 +2026,7 @@ const Foam::labelList& Foam::globalMeshData::sharedPointLabels() const
     {
         calcSharedPoints();
     }
-    return sharedPointLabelsPtr_();
+    return *sharedPointLabelsPtr_;
 }
 
 
@@ -2035,7 +2036,7 @@ const Foam::labelList& Foam::globalMeshData::sharedPointAddr() const
     {
         calcSharedPoints();
     }
-    return sharedPointAddrPtr_();
+    return *sharedPointAddrPtr_;
 }
 
 
@@ -2055,7 +2056,7 @@ const Foam::labelList& Foam::globalMeshData::sharedEdgeLabels() const
     {
         calcSharedEdges();
     }
-    return sharedEdgeLabelsPtr_();
+    return *sharedEdgeLabelsPtr_;
 }
 
 
@@ -2065,7 +2066,7 @@ const Foam::labelList& Foam::globalMeshData::sharedEdgeAddr() const
     {
         calcSharedEdges();
     }
-    return sharedEdgeAddrPtr_();
+    return *sharedEdgeAddrPtr_;
 }
 
 
@@ -2126,7 +2127,7 @@ const Foam::indirectPrimitivePatch& Foam::globalMeshData::coupledPatch() const
                 << endl;
         }
     }
-    return coupledPatchPtr_();
+    return *coupledPatchPtr_;
 }
 
 
@@ -2146,7 +2147,7 @@ const Foam::labelList& Foam::globalMeshData::coupledPatchMeshEdges() const
             )
         );
     }
-    return coupledPatchMeshEdgesPtr_();
+    return *coupledPatchMeshEdgesPtr_;
 }
 
 
@@ -2165,7 +2166,7 @@ const
             em.insert(me[i], i);
         }
     }
-    return coupledPatchMeshEdgeMapPtr_();
+    return *coupledPatchMeshEdgeMapPtr_;
 }
 
 
@@ -2178,7 +2179,7 @@ const Foam::globalIndex& Foam::globalMeshData::globalPointNumbering() const
             new globalIndex(coupledPatch().nPoints())
         );
     }
-    return globalPointNumberingPtr_();
+    return *globalPointNumberingPtr_;
 }
 
 
@@ -2189,7 +2190,7 @@ Foam::globalMeshData::globalTransforms() const
     {
         globalTransformsPtr_.reset(new globalIndexAndTransform(mesh_));
     }
-    return globalTransformsPtr_();
+    return *globalTransformsPtr_;
 }
 
 
@@ -2199,7 +2200,7 @@ const Foam::labelListList& Foam::globalMeshData::globalPointSlaves() const
     {
         calcGlobalPointSlaves();
     }
-    return globalPointSlavesPtr_();
+    return *globalPointSlavesPtr_;
 }
 
 
@@ -2210,7 +2211,7 @@ const
     {
         calcGlobalPointSlaves();
     }
-    return globalPointTransformedSlavesPtr_();
+    return *globalPointTransformedSlavesPtr_;
 }
 
 
@@ -2220,7 +2221,7 @@ const Foam::mapDistribute& Foam::globalMeshData::globalPointSlavesMap() const
     {
         calcGlobalPointSlaves();
     }
-    return globalPointSlavesMapPtr_();
+    return *globalPointSlavesMapPtr_;
 }
 
 
@@ -2233,7 +2234,7 @@ const Foam::globalIndex& Foam::globalMeshData::globalEdgeNumbering() const
             new globalIndex(coupledPatch().nEdges())
         );
     }
-    return globalEdgeNumberingPtr_();
+    return *globalEdgeNumberingPtr_;
 }
 
 
@@ -2243,7 +2244,7 @@ const Foam::labelListList& Foam::globalMeshData::globalEdgeSlaves() const
     {
         calcGlobalEdgeSlaves();
     }
-    return globalEdgeSlavesPtr_();
+    return *globalEdgeSlavesPtr_;
 }
 
 
@@ -2254,7 +2255,7 @@ const
     {
         calcGlobalEdgeSlaves();
     }
-    return globalEdgeTransformedSlavesPtr_();
+    return *globalEdgeTransformedSlavesPtr_;
 }
 
 
@@ -2264,7 +2265,7 @@ const Foam::PackedBoolList& Foam::globalMeshData::globalEdgeOrientation() const
     {
         calcGlobalEdgeOrientation();
     }
-    return globalEdgeOrientationPtr_();
+    return *globalEdgeOrientationPtr_;
 }
 
 
@@ -2274,7 +2275,7 @@ const Foam::mapDistribute& Foam::globalMeshData::globalEdgeSlavesMap() const
     {
         calcGlobalEdgeSlaves();
     }
-    return globalEdgeSlavesMapPtr_();
+    return *globalEdgeSlavesMapPtr_;
 }
 
 
@@ -2285,7 +2286,7 @@ const
     {
         calcGlobalPointBoundaryFaces();
     }
-    return globalBoundaryFaceNumberingPtr_();
+    return *globalBoundaryFaceNumberingPtr_;
 }
 
 
@@ -2296,7 +2297,7 @@ const
     {
         calcGlobalPointBoundaryFaces();
     }
-    return globalPointBoundaryFacesPtr_();
+    return *globalPointBoundaryFacesPtr_;
 }
 
 
@@ -2307,7 +2308,7 @@ Foam::globalMeshData::globalPointTransformedBoundaryFaces() const
     {
         calcGlobalPointBoundaryFaces();
     }
-    return globalPointTransformedBoundaryFacesPtr_();
+    return *globalPointTransformedBoundaryFacesPtr_;
 }
 
 
@@ -2318,7 +2319,7 @@ const
     {
         calcGlobalPointBoundaryFaces();
     }
-    return globalPointBoundaryFacesMapPtr_();
+    return *globalPointBoundaryFacesMapPtr_;
 }
 
 
@@ -2328,7 +2329,7 @@ const Foam::labelList& Foam::globalMeshData::boundaryCells() const
     {
         calcGlobalPointBoundaryCells();
     }
-    return boundaryCellsPtr_();
+    return *boundaryCellsPtr_;
 }
 
 
@@ -2339,7 +2340,7 @@ const
     {
         calcGlobalPointBoundaryCells();
     }
-    return globalBoundaryCellNumberingPtr_();
+    return *globalBoundaryCellNumberingPtr_;
 }
 
 
@@ -2350,7 +2351,7 @@ const
     {
         calcGlobalPointBoundaryCells();
     }
-    return globalPointBoundaryCellsPtr_();
+    return *globalPointBoundaryCellsPtr_;
 }
 
 
@@ -2361,7 +2362,7 @@ Foam::globalMeshData::globalPointTransformedBoundaryCells() const
     {
         calcGlobalPointBoundaryCells();
     }
-    return globalPointTransformedBoundaryCellsPtr_();
+    return *globalPointTransformedBoundaryCellsPtr_;
 }
 
 
@@ -2372,7 +2373,7 @@ const
     {
         calcGlobalPointBoundaryCells();
     }
-    return globalPointBoundaryCellsMapPtr_();
+    return *globalPointBoundaryCellsMapPtr_;
 }
 
 
@@ -2382,7 +2383,7 @@ const Foam::labelListList& Foam::globalMeshData::globalCoPointSlaves() const
     {
         calcGlobalCoPointSlaves();
     }
-    return globalCoPointSlavesPtr_();
+    return *globalCoPointSlavesPtr_;
 }
 
 
@@ -2392,7 +2393,7 @@ const Foam::mapDistribute& Foam::globalMeshData::globalCoPointSlavesMap() const
     {
         calcGlobalCoPointSlaves();
     }
-    return globalCoPointSlavesMapPtr_();
+    return *globalCoPointSlavesMapPtr_;
 }
 
 
diff --git a/src/OpenFOAM/meshes/polyMesh/globalMeshData/globalPoints.H b/src/OpenFOAM/meshes/polyMesh/globalMeshData/globalPoints.H
index 20dbd3bc1c6..cfb4f53eea7 100644
--- a/src/OpenFOAM/meshes/polyMesh/globalMeshData/globalPoints.H
+++ b/src/OpenFOAM/meshes/polyMesh/globalMeshData/globalPoints.H
@@ -347,13 +347,13 @@ public:
             //- Corresponding map
             const mapDistribute& map() const
             {
-                return map_();
+                return *map_;
             }
 
             //- Corresponding map
             mapDistribute& map()
             {
-                return map_();
+                return *map_;
             }
 
             //- From (mesh or patch) point to index in procPoints
diff --git a/src/OpenFOAM/meshes/polyMesh/mapPolyMesh/mapDistribute/mapDistributeBase.C b/src/OpenFOAM/meshes/polyMesh/mapPolyMesh/mapDistribute/mapDistributeBase.C
index 67c436c4b89..9968377c540 100644
--- a/src/OpenFOAM/meshes/polyMesh/mapPolyMesh/mapDistribute/mapDistributeBase.C
+++ b/src/OpenFOAM/meshes/polyMesh/mapPolyMesh/mapDistribute/mapDistributeBase.C
@@ -183,7 +183,7 @@ const Foam::List<Foam::labelPair>& Foam::mapDistributeBase::schedule() const
             )
         );
     }
-    return schedulePtr_();
+    return *schedulePtr_;
 }
 
 
diff --git a/src/OpenFOAM/meshes/polyMesh/mapPolyMesh/mapPolyMesh.C b/src/OpenFOAM/meshes/polyMesh/mapPolyMesh/mapPolyMesh.C
index 45a15633428..a8dcb1886f5 100644
--- a/src/OpenFOAM/meshes/polyMesh/mapPolyMesh/mapPolyMesh.C
+++ b/src/OpenFOAM/meshes/polyMesh/mapPolyMesh/mapPolyMesh.C
@@ -174,8 +174,18 @@ Foam::mapPolyMesh::mapPolyMesh
     oldPatchSizes_(oldPatchStarts.size()),
     oldPatchStarts_(oldPatchStarts, reuse),
     oldPatchNMeshPoints_(oldPatchNMeshPoints, reuse),
-    oldCellVolumesPtr_(oldCellVolumesPtr, reuse)
+    oldCellVolumesPtr_()
 {
+    // Reuse old content or clone
+    if (reuse)
+    {
+        oldCellVolumesPtr_ = std::move(oldCellVolumesPtr);
+    }
+    else
+    {
+        oldCellVolumesPtr_ = oldCellVolumesPtr.clone();
+    }
+
     if (oldPatchStarts_.size() > 0)
     {
         // Calculate old patch sizes
diff --git a/src/OpenFOAM/meshes/polyMesh/mapPolyMesh/mapPolyMesh.H b/src/OpenFOAM/meshes/polyMesh/mapPolyMesh/mapPolyMesh.H
index 03f1c8a55d3..5fd06739848 100644
--- a/src/OpenFOAM/meshes/polyMesh/mapPolyMesh/mapPolyMesh.H
+++ b/src/OpenFOAM/meshes/polyMesh/mapPolyMesh/mapPolyMesh.H
@@ -645,7 +645,7 @@ public:
 
                 const scalarField& oldCellVolumes() const
                 {
-                    return oldCellVolumesPtr_();
+                    return *oldCellVolumesPtr_;
                 }
 
 };
diff --git a/src/OpenFOAM/meshes/polyMesh/polyBoundaryMesh/polyBoundaryMesh.C b/src/OpenFOAM/meshes/polyMesh/polyBoundaryMesh/polyBoundaryMesh.C
index 6b36461924d..3f75be93e5d 100644
--- a/src/OpenFOAM/meshes/polyMesh/polyBoundaryMesh/polyBoundaryMesh.C
+++ b/src/OpenFOAM/meshes/polyMesh/polyBoundaryMesh/polyBoundaryMesh.C
@@ -365,7 +365,7 @@ Foam::polyBoundaryMesh::neighbourEdges() const
         }
     }
 
-    return neighbourEdgesPtr_();
+    return *neighbourEdgesPtr_;
 }
 
 
@@ -394,7 +394,8 @@ const Foam::labelList& Foam::polyBoundaryMesh::patchID() const
             }
         }
     }
-    return patchIDPtr_();
+
+    return *patchIDPtr_;
 }
 
 
@@ -446,7 +447,7 @@ Foam::polyBoundaryMesh::groupPatchIDs() const
         }
     }
 
-    return groupPatchIDsPtr_();
+    return *groupPatchIDsPtr_;
 }
 
 
diff --git a/src/OpenFOAM/meshes/polyMesh/polyMesh.C b/src/OpenFOAM/meshes/polyMesh/polyMesh.C
index de8d164ef75..b840b7d8d8f 100644
--- a/src/OpenFOAM/meshes/polyMesh/polyMesh.C
+++ b/src/OpenFOAM/meshes/polyMesh/polyMesh.C
@@ -151,10 +151,8 @@ Foam::autoPtr<Foam::labelIOList> Foam::polyMesh::readTetBasePtIs() const
     {
         return autoPtr<labelIOList>(new labelIOList(io));
     }
-    else
-    {
-        return autoPtr<labelIOList>(nullptr);
-    }
+
+    return autoPtr<labelIOList>();
 }
 
 
@@ -873,7 +871,7 @@ const Foam::labelIOList& Foam::polyMesh::tetBasePtIs() const
         );
     }
 
-    return tetBasePtIsPtr_();
+    return *tetBasePtIsPtr_;
 }
 
 
@@ -1078,7 +1076,7 @@ const Foam::pointField& Foam::polyMesh::oldPoints() const
         curMotionTimeIndex_ = time().timeIndex();
     }
 
-    return oldPointsPtr_();
+    return *oldPointsPtr_;
 }
 
 
@@ -1231,7 +1229,7 @@ const Foam::globalMeshData& Foam::polyMesh::globalData() const
         globalMeshDataPtr_.reset(new globalMeshData(*this));
     }
 
-    return globalMeshDataPtr_();
+    return *globalMeshDataPtr_;
 }
 
 
diff --git a/src/OpenFOAM/meshes/polyMesh/polyMeshIO.C b/src/OpenFOAM/meshes/polyMesh/polyMeshIO.C
index e290c689f96..a88f5b12f30 100644
--- a/src/OpenFOAM/meshes/polyMesh/polyMeshIO.C
+++ b/src/OpenFOAM/meshes/polyMesh/polyMeshIO.C
@@ -452,7 +452,7 @@ Foam::polyMesh::readUpdateState Foam::polyMesh::readUpdate()
         autoPtr<labelIOList> newTetBasePtIsPtr = readTetBasePtIs();
         if (newTetBasePtIsPtr.valid())
         {
-            tetBasePtIsPtr_ = newTetBasePtIsPtr;
+            tetBasePtIsPtr_ = std::move(newTetBasePtIsPtr);
         }
 
         // Calculate the geometry for the patches (transformation tensors etc.)
diff --git a/src/OpenFOAM/meshes/polyMesh/polyPatches/constraint/processor/processorPolyPatch.C b/src/OpenFOAM/meshes/polyMesh/polyPatches/constraint/processor/processorPolyPatch.C
index 0c5b7284659..201b3cddbea 100644
--- a/src/OpenFOAM/meshes/polyMesh/polyPatches/constraint/processor/processorPolyPatch.C
+++ b/src/OpenFOAM/meshes/polyMesh/polyPatches/constraint/processor/processorPolyPatch.C
@@ -511,7 +511,7 @@ const Foam::labelList& Foam::processorPolyPatch::neighbPoints() const
             << "No extended addressing calculated for patch " << name()
             << abort(FatalError);
     }
-    return neighbPointsPtr_();
+    return *neighbPointsPtr_;
 }
 
 
@@ -523,7 +523,7 @@ const Foam::labelList& Foam::processorPolyPatch::neighbEdges() const
             << "No extended addressing calculated for patch " << name()
             << abort(FatalError);
     }
-    return neighbEdgesPtr_();
+    return *neighbEdgesPtr_;
 }
 
 
diff --git a/src/OpenFOAM/primitives/functions/Function1/Scale/Scale.C b/src/OpenFOAM/primitives/functions/Function1/Scale/Scale.C
index c952a6f6c84..54a00469969 100644
--- a/src/OpenFOAM/primitives/functions/Function1/Scale/Scale.C
+++ b/src/OpenFOAM/primitives/functions/Function1/Scale/Scale.C
@@ -52,8 +52,8 @@ template<class Type>
 Foam::Function1Types::Scale<Type>::Scale(const Scale<Type>& se)
 :
     Function1<Type>(se),
-    scale_(se.scale_, false),
-    value_(se.value_, false)
+    scale_(se.scale_.clone()),
+    value_(se.value_.clone())
 {}
 
 
diff --git a/src/OpenFOAM/primitives/functions/Function1/Sine/Sine.C b/src/OpenFOAM/primitives/functions/Function1/Sine/Sine.C
index 7fa813c79d6..732f329147a 100644
--- a/src/OpenFOAM/primitives/functions/Function1/Sine/Sine.C
+++ b/src/OpenFOAM/primitives/functions/Function1/Sine/Sine.C
@@ -56,10 +56,10 @@ Foam::Function1Types::Sine<Type>::Sine(const Sine<Type>& se)
 :
     Function1<Type>(se),
     t0_(se.t0_),
-    amplitude_(se.amplitude_, false),
-    frequency_(se.frequency_, false),
-    scale_(se.scale_, false),
-    level_(se.level_, false)
+    amplitude_(se.amplitude_.clone()),
+    frequency_(se.frequency_.clone()),
+    scale_(se.scale_.clone()),
+    level_(se.level_.clone())
 {}
 
 
diff --git a/src/OpenFOAM/primitives/functions/Function1/Square/Square.C b/src/OpenFOAM/primitives/functions/Function1/Square/Square.C
index e18ed2da7c5..d9f06f5bc50 100644
--- a/src/OpenFOAM/primitives/functions/Function1/Square/Square.C
+++ b/src/OpenFOAM/primitives/functions/Function1/Square/Square.C
@@ -58,10 +58,10 @@ Foam::Function1Types::Square<Type>::Square(const Square<Type>& se)
     Function1<Type>(se),
     t0_(se.t0_),
     markSpace_(se.markSpace_),
-    amplitude_(se.amplitude_, false),
-    frequency_(se.frequency_, false),
-    scale_(se.scale_, false),
-    level_(se.level_, false)
+    amplitude_(se.amplitude_.clone()),
+    frequency_(se.frequency_.clone()),
+    scale_(se.scale_.clone()),
+    level_(se.level_.clone())
 {}
 
 
diff --git a/src/OpenFOAM/primitives/functions/Function1/Table/TableBase.C b/src/OpenFOAM/primitives/functions/Function1/Table/TableBase.C
index 5a6e5104114..c068e240c27 100644
--- a/src/OpenFOAM/primitives/functions/Function1/Table/TableBase.C
+++ b/src/OpenFOAM/primitives/functions/Function1/Table/TableBase.C
@@ -49,7 +49,7 @@ Foam::Function1Types::TableBase<Type>::interpolator() const
         );
     }
 
-    return interpolatorPtr_();
+    return *interpolatorPtr_;
 }
 
 
diff --git a/src/TurbulenceModels/compressible/turbulentFluidThermoModels/derivedFvPatchFields/externalWallHeatFluxTemperature/externalWallHeatFluxTemperatureFvPatchScalarField.C b/src/TurbulenceModels/compressible/turbulentFluidThermoModels/derivedFvPatchFields/externalWallHeatFluxTemperature/externalWallHeatFluxTemperatureFvPatchScalarField.C
index dbd12911720..5fb7fffe506 100644
--- a/src/TurbulenceModels/compressible/turbulentFluidThermoModels/derivedFvPatchFields/externalWallHeatFluxTemperature/externalWallHeatFluxTemperatureFvPatchScalarField.C
+++ b/src/TurbulenceModels/compressible/turbulentFluidThermoModels/derivedFvPatchFields/externalWallHeatFluxTemperature/externalWallHeatFluxTemperatureFvPatchScalarField.C
@@ -177,7 +177,7 @@ externalWallHeatFluxTemperatureFvPatchScalarField
     Q_(ptf.Q_),
     q_(ptf.q_, mapper),
     h_(ptf.h_, mapper),
-    Ta_(ptf.Ta_, false),
+    Ta_(ptf.Ta_.clone()),
     relaxation_(ptf.relaxation_),
     emissivity_(ptf.emissivity_),
     qrPrevious_(ptf.qrPrevious_, mapper),
@@ -225,7 +225,7 @@ externalWallHeatFluxTemperatureFvPatchScalarField
     Q_(ewhftpsf.Q_),
     q_(ewhftpsf.q_),
     h_(ewhftpsf.h_),
-    Ta_(ewhftpsf.Ta_, false),
+    Ta_(ewhftpsf.Ta_.clone()),
     relaxation_(ewhftpsf.relaxation_),
     emissivity_(ewhftpsf.emissivity_),
     qrPrevious_(ewhftpsf.qrPrevious_),
@@ -249,7 +249,7 @@ externalWallHeatFluxTemperatureFvPatchScalarField
     Q_(ewhftpsf.Q_),
     q_(ewhftpsf.q_),
     h_(ewhftpsf.h_),
-    Ta_(ewhftpsf.Ta_, false),
+    Ta_(ewhftpsf.Ta_.clone()),
     relaxation_(ewhftpsf.relaxation_),
     emissivity_(ewhftpsf.emissivity_),
     qrPrevious_(ewhftpsf.qrPrevious_),
diff --git a/src/TurbulenceModels/compressible/turbulentFluidThermoModels/derivedFvPatchFields/thermalBaffle1D/thermalBaffle1DFvPatchScalarField.C b/src/TurbulenceModels/compressible/turbulentFluidThermoModels/derivedFvPatchFields/thermalBaffle1D/thermalBaffle1DFvPatchScalarField.C
index 00883665e82..1ebdbcf59d4 100644
--- a/src/TurbulenceModels/compressible/turbulentFluidThermoModels/derivedFvPatchFields/thermalBaffle1D/thermalBaffle1DFvPatchScalarField.C
+++ b/src/TurbulenceModels/compressible/turbulentFluidThermoModels/derivedFvPatchFields/thermalBaffle1D/thermalBaffle1DFvPatchScalarField.C
@@ -204,7 +204,7 @@ const solidType& thermalBaffle1DFvPatchScalarField<solidType>::solid() const
         {
             solidPtr_.reset(new solidType(solidDict_));
         }
-        return solidPtr_();
+        return *solidPtr_;
     }
     else
     {
diff --git a/src/TurbulenceModels/turbulenceModels/LES/LESModel/LESModel.H b/src/TurbulenceModels/turbulenceModels/LES/LESModel/LESModel.H
index 297e86b3d30..b3a57319aa8 100644
--- a/src/TurbulenceModels/turbulenceModels/LES/LESModel/LESModel.H
+++ b/src/TurbulenceModels/turbulenceModels/LES/LESModel/LESModel.H
@@ -201,7 +201,7 @@ public:
             //- Access function to filter width
             inline const volScalarField& delta() const
             {
-                return delta_();
+                return *delta_;
             }
 
 
diff --git a/src/TurbulenceModels/turbulenceModels/LES/LESdeltas/IDDESDelta/IDDESDelta.H b/src/TurbulenceModels/turbulenceModels/LES/LESdeltas/IDDESDelta/IDDESDelta.H
index 82acfff3a62..7b9769a948f 100644
--- a/src/TurbulenceModels/turbulenceModels/LES/LESdeltas/IDDESDelta/IDDESDelta.H
+++ b/src/TurbulenceModels/turbulenceModels/LES/LESdeltas/IDDESDelta/IDDESDelta.H
@@ -104,7 +104,7 @@ public:
         //- Return the hmax delta field
         const volScalarField& hmax() const
         {
-            return hmaxPtr_();
+            return *hmaxPtr_;
         }
 
         // Correct values
diff --git a/src/TurbulenceModels/turbulenceModels/RAS/kOmegaSSTSAS/kOmegaSSTSAS.H b/src/TurbulenceModels/turbulenceModels/RAS/kOmegaSSTSAS/kOmegaSSTSAS.H
index 0840a264502..19b9db63c72 100644
--- a/src/TurbulenceModels/turbulenceModels/RAS/kOmegaSSTSAS/kOmegaSSTSAS.H
+++ b/src/TurbulenceModels/turbulenceModels/RAS/kOmegaSSTSAS/kOmegaSSTSAS.H
@@ -177,7 +177,7 @@ public:
         //- Access function to filter width
         inline const volScalarField& delta() const
         {
-            return delta_();
+            return *delta_;
         }
 };
 
diff --git a/src/TurbulenceModels/turbulenceModels/derivedFvPatchFields/porousBafflePressure/porousBafflePressureFvPatchField.C b/src/TurbulenceModels/turbulenceModels/derivedFvPatchFields/porousBafflePressure/porousBafflePressureFvPatchField.C
index 486581871a9..be957dcaac1 100644
--- a/src/TurbulenceModels/turbulenceModels/derivedFvPatchFields/porousBafflePressure/porousBafflePressureFvPatchField.C
+++ b/src/TurbulenceModels/turbulenceModels/derivedFvPatchFields/porousBafflePressure/porousBafflePressureFvPatchField.C
@@ -59,7 +59,7 @@ Foam::porousBafflePressureFvPatchField::porousBafflePressureFvPatchField
     D_(Function1<scalar>::New("D", dict)),
     I_(Function1<scalar>::New("I", dict)),
     length_(readScalar(dict.lookup("length"))),
-    uniformJump_(dict.lookupOrDefault<bool>("uniformJump", false))
+    uniformJump_(dict.lookupOrDefault("uniformJump", false))
 {
     fvPatchField<scalar>::operator=
     (
@@ -79,8 +79,8 @@ Foam::porousBafflePressureFvPatchField::porousBafflePressureFvPatchField
     fixedJumpFvPatchField<scalar>(ptf, p, iF, mapper),
     phiName_(ptf.phiName_),
     rhoName_(ptf.rhoName_),
-    D_(ptf.D_, false),
-    I_(ptf.I_, false),
+    D_(ptf.D_.clone()),
+    I_(ptf.I_.clone()),
     length_(ptf.length_),
     uniformJump_(ptf.uniformJump_)
 {}
@@ -95,8 +95,8 @@ Foam::porousBafflePressureFvPatchField::porousBafflePressureFvPatchField
     fixedJumpFvPatchField<scalar>(ptf),
     phiName_(ptf.phiName_),
     rhoName_(ptf.rhoName_),
-    D_(ptf.D_, false),
-    I_(ptf.I_, false),
+    D_(ptf.D_.clone()),
+    I_(ptf.I_.clone()),
     length_(ptf.length_),
     uniformJump_(ptf.uniformJump_)
 {}
@@ -111,8 +111,8 @@ Foam::porousBafflePressureFvPatchField::porousBafflePressureFvPatchField
     fixedJumpFvPatchField<scalar>(ptf, iF),
     phiName_(ptf.phiName_),
     rhoName_(ptf.rhoName_),
-    D_(ptf.D_, false),
-    I_(ptf.I_, false),
+    D_(ptf.D_.clone()),
+    I_(ptf.I_.clone()),
     length_(ptf.length_),
     uniformJump_(ptf.uniformJump_)
 {}
diff --git a/src/combustionModels/psiCombustionModel/psiThermoCombustion/psiThermoCombustion.C b/src/combustionModels/psiCombustionModel/psiThermoCombustion/psiThermoCombustion.C
index e2b2440b5a4..72171d8a91f 100644
--- a/src/combustionModels/psiCombustionModel/psiThermoCombustion/psiThermoCombustion.C
+++ b/src/combustionModels/psiCombustionModel/psiThermoCombustion/psiThermoCombustion.C
@@ -50,14 +50,14 @@ Foam::combustionModels::psiThermoCombustion::~psiThermoCombustion()
 Foam::psiReactionThermo&
 Foam::combustionModels::psiThermoCombustion::thermo()
 {
-    return thermoPtr_();
+    return *thermoPtr_;
 }
 
 
 const Foam::psiReactionThermo&
 Foam::combustionModels::psiThermoCombustion::thermo() const
 {
-    return thermoPtr_();
+    return *thermoPtr_;
 }
 
 
diff --git a/src/combustionModels/rhoCombustionModel/rhoThermoCombustion/rhoThermoCombustion.C b/src/combustionModels/rhoCombustionModel/rhoThermoCombustion/rhoThermoCombustion.C
index a4a5be12c5a..e9b0e301c76 100644
--- a/src/combustionModels/rhoCombustionModel/rhoThermoCombustion/rhoThermoCombustion.C
+++ b/src/combustionModels/rhoCombustionModel/rhoThermoCombustion/rhoThermoCombustion.C
@@ -50,14 +50,14 @@ Foam::combustionModels::rhoThermoCombustion::~rhoThermoCombustion()
 Foam::rhoReactionThermo&
 Foam::combustionModels::rhoThermoCombustion::thermo()
 {
-    return thermoPtr_();
+    return *thermoPtr_;
 }
 
 
 const Foam::rhoReactionThermo&
 Foam::combustionModels::rhoThermoCombustion::thermo() const
 {
-    return thermoPtr_();
+    return *thermoPtr_;
 }
 
 
diff --git a/src/conversion/common/reader/meshReader.C b/src/conversion/common/reader/meshReader.C
index dd3650db67a..deb60d8b524 100644
--- a/src/conversion/common/reader/meshReader.C
+++ b/src/conversion/common/reader/meshReader.C
@@ -91,7 +91,7 @@ Foam::autoPtr<Foam::polyMesh> Foam::meshReader::mesh
     createPolyBoundary();
     clearExtraStorage();
 
-    autoPtr<polyMesh> mesh
+    autoPtr<polyMesh> meshPtr
     (
         new polyMesh
         (
@@ -106,16 +106,17 @@ Foam::autoPtr<Foam::polyMesh> Foam::meshReader::mesh
             xferMove(cellPolys_)
         )
     );
+    polyMesh& mesh = meshPtr();
 
-    // adding patches also checks the mesh
-    mesh().addPatches(polyBoundaryPatches(mesh));
+    // Adding patches also checks the mesh
+    mesh.addPatches(polyBoundaryPatches(mesh));
 
-    warnDuplicates("boundaries", mesh().boundaryMesh().names());
+    warnDuplicates("boundaries", mesh.boundaryMesh().names());
 
-    addCellZones(mesh());
-    addFaceZones(mesh());
+    addCellZones(mesh);
+    addFaceZones(mesh);
 
-    return mesh;
+    return meshPtr;
 }
 
 
diff --git a/src/conversion/ensight/mesh/ensightMeshI.H b/src/conversion/ensight/mesh/ensightMeshI.H
index 8213182e274..7b7fd206d26 100644
--- a/src/conversion/ensight/mesh/ensightMeshI.H
+++ b/src/conversion/ensight/mesh/ensightMeshI.H
@@ -77,7 +77,7 @@ Foam::ensightMesh::faceZoneFaces() const
 
 inline void Foam::ensightMesh::write(autoPtr<ensightGeoFile>& os) const
 {
-    write(os.rawRef());
+    write(os.ref());
 }
 
 
diff --git a/src/conversion/ensight/mesh/ensightMeshOptions.C b/src/conversion/ensight/mesh/ensightMeshOptions.C
index 573ddeee718..7dbafafab2e 100644
--- a/src/conversion/ensight/mesh/ensightMeshOptions.C
+++ b/src/conversion/ensight/mesh/ensightMeshOptions.C
@@ -136,7 +136,7 @@ const Foam::wordRes& Foam::ensightMesh::options::patchSelection() const
 {
     if (usePatchSelection())
     {
-        return patchPatterns_();
+        return *patchPatterns_;
     }
 
     return wordRes::null();
@@ -147,7 +147,7 @@ const Foam::wordRes& Foam::ensightMesh::options::faceZoneSelection() const
 {
     if (faceZonePatterns_.valid())
     {
-        return faceZonePatterns_();
+        return *faceZonePatterns_;
     }
 
     return wordRes::null();
diff --git a/src/conversion/ensight/output/ensightOutput.H b/src/conversion/ensight/output/ensightOutput.H
index bdead411f4f..168b11d5e0b 100644
--- a/src/conversion/ensight/output/ensightOutput.H
+++ b/src/conversion/ensight/output/ensightOutput.H
@@ -143,7 +143,7 @@ public:
         const bool nodeValues = false
     )
     {
-        return writeField(vf, ensMesh, output.rawRef(), nodeValues);
+        return writeField(vf, ensMesh, output.ref(), nodeValues);
     }
 
 };
diff --git a/src/conversion/ensight/output/ensightSerialOutput.H b/src/conversion/ensight/output/ensightSerialOutput.H
index 823c7ba5bf3..22c47bf3be5 100644
--- a/src/conversion/ensight/output/ensightSerialOutput.H
+++ b/src/conversion/ensight/output/ensightSerialOutput.H
@@ -112,7 +112,7 @@ public:
         autoPtr<ensightFile>& output
     )
     {
-        return writeField(vf, part, output.rawRef());
+        return writeField(vf, part, output.ref());
     }
 
 
@@ -125,7 +125,7 @@ public:
         autoPtr<ensightFile>& output
     )
     {
-        return writeField(vf, list, output.rawRef());
+        return writeField(vf, list, output.ref());
     }
 
 };
diff --git a/src/conversion/vtk/output/foamVtkInternalWriter.H b/src/conversion/vtk/output/foamVtkInternalWriter.H
index 7fd4aa4f5da..f793adab1f6 100644
--- a/src/conversion/vtk/output/foamVtkInternalWriter.H
+++ b/src/conversion/vtk/output/foamVtkInternalWriter.H
@@ -127,7 +127,7 @@ public:
 
         inline vtk::formatter& format()
         {
-            return format_();
+            return *format_;
         }
 
 
diff --git a/src/conversion/vtk/output/foamVtkPatchWriter.H b/src/conversion/vtk/output/foamVtkPatchWriter.H
index 627b8478821..e7bcd15dbe6 100644
--- a/src/conversion/vtk/output/foamVtkPatchWriter.H
+++ b/src/conversion/vtk/output/foamVtkPatchWriter.H
@@ -133,7 +133,7 @@ public:
 
         inline vtk::formatter& format()
         {
-            return format_();
+            return *format_;
         }
 
         inline label nPoints() const
diff --git a/src/conversion/vtk/output/foamVtkSurfaceMeshWriter.H b/src/conversion/vtk/output/foamVtkSurfaceMeshWriter.H
index ea463c41c2c..feb241f134f 100644
--- a/src/conversion/vtk/output/foamVtkSurfaceMeshWriter.H
+++ b/src/conversion/vtk/output/foamVtkSurfaceMeshWriter.H
@@ -122,7 +122,7 @@ public:
 
         inline vtk::formatter& format()
         {
-            return format_();
+            return *format_;
         }
 
         //- Open write for CellData of count fields.
diff --git a/src/dynamicFvMesh/dynamicMotionSolverFvMesh/dynamicMotionSolverFvMesh.C b/src/dynamicFvMesh/dynamicMotionSolverFvMesh/dynamicMotionSolverFvMesh.C
index 307c32488ad..e46a3b95e81 100644
--- a/src/dynamicFvMesh/dynamicMotionSolverFvMesh/dynamicMotionSolverFvMesh.C
+++ b/src/dynamicFvMesh/dynamicMotionSolverFvMesh/dynamicMotionSolverFvMesh.C
@@ -61,7 +61,7 @@ Foam::dynamicMotionSolverFvMesh::~dynamicMotionSolverFvMesh()
 
 const Foam::motionSolver& Foam::dynamicMotionSolverFvMesh::motion() const
 {
-    return motionPtr_();
+    return *motionPtr_;
 }
 
 
diff --git a/src/dynamicFvMesh/dynamicRefineFvMesh/dynamicRefineFvMesh.C b/src/dynamicFvMesh/dynamicRefineFvMesh/dynamicRefineFvMesh.C
index 409f5332697..12d6f45d53a 100644
--- a/src/dynamicFvMesh/dynamicRefineFvMesh/dynamicRefineFvMesh.C
+++ b/src/dynamicFvMesh/dynamicRefineFvMesh/dynamicRefineFvMesh.C
@@ -223,11 +223,11 @@ Foam::dynamicRefineFvMesh::refine
     meshCutter_.setRefinement(cellsToRefine, meshMod);
 
     // Create mesh (with inflation), return map from old to new mesh.
-    //autoPtr<mapPolyMesh> map = meshMod.changeMesh(*this, true);
-    autoPtr<mapPolyMesh> map = meshMod.changeMesh(*this, false);
+    autoPtr<mapPolyMesh> mapPtr = meshMod.changeMesh(*this, false);
+    mapPolyMesh& map = *mapPtr;
 
     Info<< "Refined from "
-        << returnReduce(map().nOldCells(), sumOp<label>())
+        << returnReduce(map.nOldCells(), sumOp<label>())
         << " to " << globalData().nTotalCells() << " cells." << endl;
 
     if (debug)
@@ -235,7 +235,7 @@ Foam::dynamicRefineFvMesh::refine
         // Check map.
         for (label facei = 0; facei < nInternalFaces(); facei++)
         {
-            label oldFacei = map().faceMap()[facei];
+            label oldFacei = map.faceMap()[facei];
 
             if (oldFacei >= nInternalFaces())
             {
@@ -256,26 +256,11 @@ Foam::dynamicRefineFvMesh::refine
     // Update fields
     updateMesh(map);
 
-
-    // Move mesh
-    /*
-    pointField newPoints;
-    if (map().hasMotionPoints())
-    {
-        newPoints = map().preMotionPoints();
-    }
-    else
-    {
-        newPoints = points();
-    }
-    movePoints(newPoints);
-    */
-
     // Correct the flux for modified/added faces. All the faces which only
     // have been renumbered will already have been handled by the mapping.
     {
-        const labelList& faceMap = map().faceMap();
-        const labelList& reverseFaceMap = map().reverseFaceMap();
+        const labelList& faceMap = map.faceMap();
+        const labelList& reverseFaceMap = map.reverseFaceMap();
 
         // Storage for any master faces. These will be the original faces
         // on the coarse cell that get split into four (or rather the
@@ -437,7 +422,6 @@ Foam::dynamicRefineFvMesh::refine
     }
 
 
-
     // Update numbering of cells/vertices.
     meshCutter_.updateMesh(map);
 
@@ -448,7 +432,7 @@ Foam::dynamicRefineFvMesh::refine
 
         forAll(newProtectedCell, celli)
         {
-            label oldCelli = map().cellMap()[celli];
+            const label oldCelli = map.cellMap()[celli];
             newProtectedCell.set(celli, protectedCell_.get(oldCelli));
         }
         protectedCell_.transfer(newProtectedCell);
@@ -457,7 +441,7 @@ Foam::dynamicRefineFvMesh::refine
     // Debug: Check refinement levels (across faces only)
     meshCutter_.checkRefinementLevels(-1, labelList(0));
 
-    return map;
+    return mapPtr;
 }
 
 
@@ -504,36 +488,21 @@ Foam::dynamicRefineFvMesh::unrefine
 
 
     // Change mesh and generate map.
-    //autoPtr<mapPolyMesh> map = meshMod.changeMesh(*this, true);
-    autoPtr<mapPolyMesh> map = meshMod.changeMesh(*this, false);
+    autoPtr<mapPolyMesh> mapPtr = meshMod.changeMesh(*this, false);
+    mapPolyMesh& map = *mapPtr;
 
     Info<< "Unrefined from "
-        << returnReduce(map().nOldCells(), sumOp<label>())
+        << returnReduce(map.nOldCells(), sumOp<label>())
         << " to " << globalData().nTotalCells() << " cells."
         << endl;
 
     // Update fields
     updateMesh(map);
 
-
-    // Move mesh
-    /*
-    pointField newPoints;
-    if (map().hasMotionPoints())
-    {
-        newPoints = map().preMotionPoints();
-    }
-    else
-    {
-        newPoints = points();
-    }
-    movePoints(newPoints);
-    */
-
     // Correct the flux for modified faces.
     {
-        const labelList& reversePointMap = map().reversePointMap();
-        const labelList& reverseFaceMap = map().reverseFaceMap();
+        const labelList& reversePointMap = map.reversePointMap();
+        const labelList& reverseFaceMap = map.reverseFaceMap();
 
         HashTable<surfaceScalarField*> fluxes
         (
@@ -626,7 +595,7 @@ Foam::dynamicRefineFvMesh::unrefine
 
         forAll(newProtectedCell, celli)
         {
-            label oldCelli = map().cellMap()[celli];
+            label oldCelli = map.cellMap()[celli];
             if (oldCelli >= 0)
             {
                 newProtectedCell.set(celli, protectedCell_.get(oldCelli));
@@ -638,7 +607,7 @@ Foam::dynamicRefineFvMesh::unrefine
     // Debug: Check refinement levels (across faces only)
     meshCutter_.checkRefinementLevels(-1, labelList(0));
 
-    return map;
+    return mapPtr;
 }
 
 
diff --git a/src/dynamicMesh/extrudePatchMesh/extrudePatchMesh.C b/src/dynamicMesh/extrudePatchMesh/extrudePatchMesh.C
index 7873504aa8b..3f03825504d 100644
--- a/src/dynamicMesh/extrudePatchMesh/extrudePatchMesh.C
+++ b/src/dynamicMesh/extrudePatchMesh/extrudePatchMesh.C
@@ -145,7 +145,6 @@ extrudePatchMesh::extrudePatchMesh
     }
 
     extrudeMesh(regionPatches);
-
 }
 
 
@@ -341,7 +340,7 @@ void extrudePatchMesh::extrudeMesh(const List<polyPatch*>& regionPatches)
         );
 
         // Update numbering on extruder.
-        extruder.updateMesh(map);
+        extruder.updateMesh(map());
 
         this->setInstance(this->thisDb().time().constant());
         this->write();
@@ -349,15 +348,6 @@ void extrudePatchMesh::extrudeMesh(const List<polyPatch*>& regionPatches)
 }
 
 
-// * * * * * * * * * * * * * * * * Destructor  * * * * * * * * * * * * * * * //
-
-extrudePatchMesh::~extrudePatchMesh()
-{}
-
-
-// * * * * * * * * * * * * * * * Member Functions  * * * * * * * * * * * * * //
-
-
 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
 
 } // End namespace Foam
diff --git a/src/dynamicMesh/extrudePatchMesh/extrudePatchMesh.H b/src/dynamicMesh/extrudePatchMesh/extrudePatchMesh.H
index 2a6a719afc4..6ff5933f39d 100644
--- a/src/dynamicMesh/extrudePatchMesh/extrudePatchMesh.H
+++ b/src/dynamicMesh/extrudePatchMesh/extrudePatchMesh.H
@@ -148,7 +148,7 @@ public:
 
 
     //- Destructor
-    virtual ~extrudePatchMesh();
+    virtual ~extrudePatchMesh() = default;
 
 
     // Member functions
diff --git a/src/dynamicMesh/fvMeshAdder/fvMeshAdder.C b/src/dynamicMesh/fvMeshAdder/fvMeshAdder.C
index 0dac84ea7e3..b3aa15ff3f2 100644
--- a/src/dynamicMesh/fvMeshAdder/fvMeshAdder.C
+++ b/src/dynamicMesh/fvMeshAdder/fvMeshAdder.C
@@ -87,6 +87,7 @@ Foam::autoPtr<Foam::mapAddedPolyMesh> Foam::fvMeshAdder::add
             validBoundary
         )
     );
+    mapAddedPolyMesh& map = *mapPtr;
 
     // Adjust the fvMesh part.
     const polyBoundaryMesh& patches = mesh0.boundaryMesh();
@@ -100,23 +101,23 @@ Foam::autoPtr<Foam::mapAddedPolyMesh> Foam::fvMeshAdder::add
 
     // Do the mapping of the stored fields
     // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-    fvMeshAdder::MapVolFields<scalar>(mapPtr, mesh0, mesh1);
-    fvMeshAdder::MapVolFields<vector>(mapPtr, mesh0, mesh1);
-    fvMeshAdder::MapVolFields<sphericalTensor>(mapPtr, mesh0, mesh1);
-    fvMeshAdder::MapVolFields<symmTensor>(mapPtr, mesh0, mesh1);
-    fvMeshAdder::MapVolFields<tensor>(mapPtr, mesh0, mesh1);
-
-    fvMeshAdder::MapSurfaceFields<scalar>(mapPtr, mesh0, mesh1);
-    fvMeshAdder::MapSurfaceFields<vector>(mapPtr, mesh0, mesh1);
-    fvMeshAdder::MapSurfaceFields<sphericalTensor>(mapPtr, mesh0, mesh1);
-    fvMeshAdder::MapSurfaceFields<symmTensor>(mapPtr, mesh0, mesh1);
-    fvMeshAdder::MapSurfaceFields<tensor>(mapPtr, mesh0, mesh1);
-
-    fvMeshAdder::MapDimFields<scalar>(mapPtr, mesh0, mesh1);
-    fvMeshAdder::MapDimFields<vector>(mapPtr, mesh0, mesh1);
-    fvMeshAdder::MapDimFields<sphericalTensor>(mapPtr, mesh0, mesh1);
-    fvMeshAdder::MapDimFields<symmTensor>(mapPtr, mesh0, mesh1);
-    fvMeshAdder::MapDimFields<tensor>(mapPtr, mesh0, mesh1);
+    fvMeshAdder::MapVolFields<scalar>(map, mesh0, mesh1);
+    fvMeshAdder::MapVolFields<vector>(map, mesh0, mesh1);
+    fvMeshAdder::MapVolFields<sphericalTensor>(map, mesh0, mesh1);
+    fvMeshAdder::MapVolFields<symmTensor>(map, mesh0, mesh1);
+    fvMeshAdder::MapVolFields<tensor>(map, mesh0, mesh1);
+
+    fvMeshAdder::MapSurfaceFields<scalar>(map, mesh0, mesh1);
+    fvMeshAdder::MapSurfaceFields<vector>(map, mesh0, mesh1);
+    fvMeshAdder::MapSurfaceFields<sphericalTensor>(map, mesh0, mesh1);
+    fvMeshAdder::MapSurfaceFields<symmTensor>(map, mesh0, mesh1);
+    fvMeshAdder::MapSurfaceFields<tensor>(map, mesh0, mesh1);
+
+    fvMeshAdder::MapDimFields<scalar>(map, mesh0, mesh1);
+    fvMeshAdder::MapDimFields<vector>(map, mesh0, mesh1);
+    fvMeshAdder::MapDimFields<sphericalTensor>(map, mesh0, mesh1);
+    fvMeshAdder::MapDimFields<symmTensor>(map, mesh0, mesh1);
+    fvMeshAdder::MapDimFields<tensor>(map, mesh0, mesh1);
 
     return mapPtr;
 }
diff --git a/src/dynamicMesh/fvMeshDistribute/fvMeshDistribute.C b/src/dynamicMesh/fvMeshDistribute/fvMeshDistribute.C
index 355c8333494..beb3af4346c 100644
--- a/src/dynamicMesh/fvMeshDistribute/fvMeshDistribute.C
+++ b/src/dynamicMesh/fvMeshDistribute/fvMeshDistribute.C
@@ -632,7 +632,8 @@ Foam::autoPtr<Foam::mapPolyMesh> Foam::fvMeshDistribute::repatch
     // shared points (see mergeSharedPoints below). So temporarily points
     // and edges do not match!
 
-    autoPtr<mapPolyMesh> map = meshMod.changeMesh(mesh_, false, true);
+    autoPtr<mapPolyMesh> mapPtr = meshMod.changeMesh(mesh_, false, true);
+    mapPolyMesh& map = *mapPtr;
 
     // Update fields. No inflation, parallel sync.
     mesh_.updateMesh(map);
@@ -647,16 +648,16 @@ Foam::autoPtr<Foam::mapPolyMesh> Foam::fvMeshDistribute::repatch
 
 
     // Move mesh (since morphing does not do this)
-    if (map().hasMotionPoints())
+    if (map.hasMotionPoints())
     {
-        mesh_.movePoints(map().preMotionPoints());
+        mesh_.movePoints(map.preMotionPoints());
     }
 
     // Adapt constructMaps.
 
     if (debug)
     {
-        label index = map().reverseFaceMap().find(-1);
+        label index = map.reverseFaceMap().find(-1);
 
         if (index != -1)
         {
@@ -672,14 +673,14 @@ Foam::autoPtr<Foam::mapPolyMesh> Foam::fvMeshDistribute::repatch
     {
         inplaceRenumberWithFlip
         (
-            map().reverseFaceMap(),
+            map.reverseFaceMap(),
             false,
             true,
             constructFaceMap[proci]
         );
     }
 
-    return map;
+    return mapPtr;
 }
 
 
@@ -706,7 +707,7 @@ Foam::autoPtr<Foam::mapPolyMesh> Foam::fvMeshDistribute::mergeSharedPoints
 
     if (returnReduce(pointToMaster.size(), sumOp<label>()) == 0)
     {
-        return autoPtr<mapPolyMesh>(nullptr);
+        return autoPtr<mapPolyMesh>();
     }
 
     polyTopoChange meshMod(mesh_);
@@ -714,7 +715,8 @@ Foam::autoPtr<Foam::mapPolyMesh> Foam::fvMeshDistribute::mergeSharedPoints
     fvMeshAdder::mergePoints(mesh_, pointToMaster, meshMod);
 
     // Change the mesh (no inflation). Note: parallel comms allowed.
-    autoPtr<mapPolyMesh> map = meshMod.changeMesh(mesh_, false, true);
+    autoPtr<mapPolyMesh> mapPtr = meshMod.changeMesh(mesh_, false, true);
+    mapPolyMesh& map = *mapPtr;
 
     // Update fields. No inflation, parallel sync.
     mesh_.updateMesh(map);
@@ -728,7 +730,7 @@ Foam::autoPtr<Foam::mapPolyMesh> Foam::fvMeshDistribute::mergeSharedPoints
         {
             label oldPointi = constructMap[i];
 
-            label newPointi = map().reversePointMap()[oldPointi];
+            label newPointi = map.reversePointMap()[oldPointi];
 
             if (newPointi < -1)
             {
@@ -746,7 +748,8 @@ Foam::autoPtr<Foam::mapPolyMesh> Foam::fvMeshDistribute::mergeSharedPoints
             }
         }
     }
-    return map;
+
+    return mapPtr;
 }
 
 
@@ -1124,7 +1127,7 @@ Foam::autoPtr<Foam::mapPolyMesh> Foam::fvMeshDistribute::doRemoveCells
     autoPtr<mapPolyMesh> map = meshMod.changeMesh(mesh_, false, false);
 
     // Update fields
-    mesh_.updateMesh(map);
+    mesh_.updateMesh(map());
 
 
     // Any exposed faces in a surfaceField will not be mapped. Map the value
diff --git a/src/dynamicMesh/fvMeshSubset/fvMeshSubset.C b/src/dynamicMesh/fvMeshSubset/fvMeshSubset.C
index dfb166aeb97..5e83a25098e 100644
--- a/src/dynamicMesh/fvMeshSubset/fvMeshSubset.C
+++ b/src/dynamicMesh/fvMeshSubset/fvMeshSubset.C
@@ -1488,7 +1488,7 @@ const fvMesh& Foam::fvMeshSubset::subMesh() const
 {
     checkCellSubset();
 
-    return fvMeshSubsetPtr_();
+    return *fvMeshSubsetPtr_;
 }
 
 
@@ -1496,7 +1496,7 @@ fvMesh& Foam::fvMeshSubset::subMesh()
 {
     checkCellSubset();
 
-    return fvMeshSubsetPtr_();
+    return *fvMeshSubsetPtr_;
 }
 
 
@@ -1550,7 +1550,7 @@ const labelList& Foam::fvMeshSubset::faceFlipMap() const
         }
     }
 
-    return faceFlipMapPtr_();
+    return *faceFlipMapPtr_;
 }
 
 
diff --git a/src/dynamicMesh/meshCut/cellCuts/cellCuts.H b/src/dynamicMesh/meshCut/cellCuts/cellCuts.H
index 90dbd212ff8..a59db7a54d0 100644
--- a/src/dynamicMesh/meshCut/cellCuts/cellCuts.H
+++ b/src/dynamicMesh/meshCut/cellCuts/cellCuts.H
@@ -575,7 +575,7 @@ public:
                 {
                     calcFaceCuts();
                 }
-                return faceCutsPtr_();
+                return *faceCutsPtr_;
             }
 
             //- Gives for split face the two cuts that split the face into two.
diff --git a/src/dynamicMesh/meshCut/cellLooper/cellLooper.H b/src/dynamicMesh/meshCut/cellLooper/cellLooper.H
index 065edef71f9..02ade8a4383 100644
--- a/src/dynamicMesh/meshCut/cellLooper/cellLooper.H
+++ b/src/dynamicMesh/meshCut/cellLooper/cellLooper.H
@@ -145,7 +145,7 @@ public:
         autoPtr<cellLooper> clone() const
         {
             NotImplemented;
-            return autoPtr<cellLooper>(nullptr);
+            return autoPtr<cellLooper>();
         }
 
 
diff --git a/src/dynamicMesh/meshCut/meshModifiers/multiDirRefinement/multiDirRefinement.C b/src/dynamicMesh/meshCut/meshModifiers/multiDirRefinement/multiDirRefinement.C
index 83fdea84102..0b4c3c90434 100644
--- a/src/dynamicMesh/meshCut/meshModifiers/multiDirRefinement/multiDirRefinement.C
+++ b/src/dynamicMesh/meshCut/meshModifiers/multiDirRefinement/multiDirRefinement.C
@@ -452,7 +452,7 @@ void Foam::multiDirRefinement::refineFromDict
     // How to walk cell circumference.
     Switch pureGeomCut(dict.lookup("geometricCut"));
 
-    autoPtr<cellLooper> cellWalker(nullptr);
+    autoPtr<cellLooper> cellWalker;
     if (pureGeomCut)
     {
         cellWalker.reset(new geomCellLooper(mesh));
diff --git a/src/dynamicMesh/motionSolvers/displacement/solidBody/pointPatchFields/derived/solidBodyMotionDisplacement/solidBodyMotionDisplacementPointPatchVectorField.C b/src/dynamicMesh/motionSolvers/displacement/solidBody/pointPatchFields/derived/solidBodyMotionDisplacement/solidBodyMotionDisplacementPointPatchVectorField.C
index 86043002269..e7460ee9dd5 100644
--- a/src/dynamicMesh/motionSolvers/displacement/solidBody/pointPatchFields/derived/solidBodyMotionDisplacement/solidBodyMotionDisplacementPointPatchVectorField.C
+++ b/src/dynamicMesh/motionSolvers/displacement/solidBody/pointPatchFields/derived/solidBodyMotionDisplacement/solidBodyMotionDisplacementPointPatchVectorField.C
@@ -146,7 +146,7 @@ solidBodyMotionDisplacementPointPatchVectorField::localPoints0() const
 
         localPoints0Ptr_.reset(new pointField(points0, patch().meshPoints()));
     }
-    return localPoints0Ptr_();
+    return *localPoints0Ptr_;
 }
 
 
diff --git a/src/dynamicMesh/motionSolvers/displacement/solidBody/pointPatchFields/derived/solidBodyMotionDisplacement/solidBodyMotionDisplacementPointPatchVectorField.H b/src/dynamicMesh/motionSolvers/displacement/solidBody/pointPatchFields/derived/solidBodyMotionDisplacement/solidBodyMotionDisplacementPointPatchVectorField.H
index 07090724914..c8f349a6aa2 100644
--- a/src/dynamicMesh/motionSolvers/displacement/solidBody/pointPatchFields/derived/solidBodyMotionDisplacement/solidBodyMotionDisplacementPointPatchVectorField.H
+++ b/src/dynamicMesh/motionSolvers/displacement/solidBody/pointPatchFields/derived/solidBodyMotionDisplacement/solidBodyMotionDisplacementPointPatchVectorField.H
@@ -142,7 +142,7 @@ public:
             //- Return the fluctuation scale
             const solidBodyMotionFunction& motion() const
             {
-                return SBMFPtr_();
+                return *SBMFPtr_;
             }
 
             const pointField& localPoints0() const;
diff --git a/src/dynamicMesh/motionSolvers/motionSolver/motionSolver.C b/src/dynamicMesh/motionSolvers/motionSolver/motionSolver.C
index 6e5decf0355..7efaf9cd5b8 100644
--- a/src/dynamicMesh/motionSolvers/motionSolver/motionSolver.C
+++ b/src/dynamicMesh/motionSolvers/motionSolver/motionSolver.C
@@ -92,7 +92,7 @@ Foam::motionSolver::motionSolver
 Foam::autoPtr<Foam::motionSolver> Foam::motionSolver::clone() const
 {
     NotImplemented;
-    return autoPtr<motionSolver>(nullptr);
+    return autoPtr<motionSolver>();
 }
 
 
diff --git a/src/dynamicMesh/polyMeshAdder/faceCoupleInfo.H b/src/dynamicMesh/polyMeshAdder/faceCoupleInfo.H
index b5d7b1fe28f..e406bb852f8 100644
--- a/src/dynamicMesh/polyMeshAdder/faceCoupleInfo.H
+++ b/src/dynamicMesh/polyMeshAdder/faceCoupleInfo.H
@@ -441,19 +441,19 @@ public:
             //- Addressing engine for coupled faces on mesh0
             const indirectPrimitivePatch& masterPatch() const
             {
-                return masterPatchPtr_();
+                return *masterPatchPtr_;
             }
 
             //- Addressing engine for coupled faces on mesh1
             const indirectPrimitivePatch& slavePatch() const
             {
-                return slavePatchPtr_();
+                return *slavePatchPtr_;
             }
 
             //- Addressing engine for combined set of faces.
             const primitiveFacePatch& cutFaces() const
             {
-                return cutFacesPtr_();
+                return *cutFacesPtr_;
             }
 
             //- Points for combined set of faces.
diff --git a/src/dynamicMesh/polyTopoChange/polyTopoChange/hexRef8/hexRef8.C b/src/dynamicMesh/polyTopoChange/polyTopoChange/hexRef8/hexRef8.C
index 1f87a21ef11..863d7dfeb9c 100644
--- a/src/dynamicMesh/polyTopoChange/polyTopoChange/hexRef8/hexRef8.C
+++ b/src/dynamicMesh/polyTopoChange/polyTopoChange/hexRef8/hexRef8.C
@@ -5110,7 +5110,7 @@ const Foam::cellShapeList& Foam::hexRef8::cellShapes() const
                 << endl;
         }
     }
-    return cellShapesPtr_();
+    return *cellShapesPtr_;
 }
 
 
diff --git a/src/dynamicMesh/polyTopoChange/polyTopoChanger/polyTopoChanger.C b/src/dynamicMesh/polyTopoChange/polyTopoChanger/polyTopoChanger.C
index ee40ecc48a9..2d9f9ecf557 100644
--- a/src/dynamicMesh/polyTopoChange/polyTopoChanger/polyTopoChanger.C
+++ b/src/dynamicMesh/polyTopoChange/polyTopoChanger/polyTopoChanger.C
@@ -286,7 +286,7 @@ Foam::autoPtr<Foam::mapPolyMesh> Foam::polyTopoChanger::changeMesh
     else
     {
         mesh_.topoChanging(false);
-        return autoPtr<mapPolyMesh>(nullptr);
+        return autoPtr<mapPolyMesh>();
     }
 }
 
diff --git a/src/dynamicMesh/polyTopoChange/repatchPolyTopoChanger/repatchPolyTopoChanger.C b/src/dynamicMesh/polyTopoChange/repatchPolyTopoChanger/repatchPolyTopoChanger.C
index 2de1c3619a0..2ccb4da9cae 100644
--- a/src/dynamicMesh/polyTopoChange/repatchPolyTopoChanger/repatchPolyTopoChanger.C
+++ b/src/dynamicMesh/polyTopoChange/repatchPolyTopoChanger/repatchPolyTopoChanger.C
@@ -43,7 +43,7 @@ Foam::polyTopoChange& Foam::repatchPolyTopoChanger::meshMod()
     {
         meshModPtr_.reset(new polyTopoChange(mesh_));
     }
-    return meshModPtr_();
+    return *meshModPtr_;
 }
 
 
diff --git a/src/engine/enginePiston/enginePiston.H b/src/engine/enginePiston/enginePiston.H
index 5904ce36f3b..1cf9c5bde7d 100644
--- a/src/engine/enginePiston/enginePiston.H
+++ b/src/engine/enginePiston/enginePiston.H
@@ -120,7 +120,7 @@ public:
         //- Return coordinate system
         const coordinateSystem& cs() const
         {
-            return csPtr_();
+            return *csPtr_;
         }
 
         //- Return ID of piston patch
diff --git a/src/engine/engineValve/engineValve.H b/src/engine/engineValve/engineValve.H
index 069257badbe..be702aa9e88 100644
--- a/src/engine/engineValve/engineValve.H
+++ b/src/engine/engineValve/engineValve.H
@@ -197,7 +197,7 @@ public:
         //- Return coordinate system
         const coordinateSystem& cs() const
         {
-            return csPtr_();
+            return *csPtr_;
         }
 
         //- Return lift profile
diff --git a/src/finiteVolume/cfdTools/general/MRF/MRFZone.H b/src/finiteVolume/cfdTools/general/MRF/MRFZone.H
index cc18a818b4b..236bef78370 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>(nullptr);
+            return autoPtr<MRFZone>();
         }
 
 
diff --git a/src/finiteVolume/cfdTools/general/fvOptions/fvOption.H b/src/finiteVolume/cfdTools/general/fvOptions/fvOption.H
index cab11123685..45be00daa8d 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>(nullptr);
+            return autoPtr<option>();
         }
 
         //- Return pointer to new fvOption object created
diff --git a/src/finiteVolume/cfdTools/general/porosityModel/porosityModel/porosityModel.C b/src/finiteVolume/cfdTools/general/porosityModel/porosityModel/porosityModel.C
index 4ca403cdf07..d2d43053763 100644
--- a/src/finiteVolume/cfdTools/general/porosityModel/porosityModel/porosityModel.C
+++ b/src/finiteVolume/cfdTools/general/porosityModel/porosityModel/porosityModel.C
@@ -101,7 +101,7 @@ Foam::porosityModel::porosityModel
     active_(true),
     zoneName_(cellZoneName),
     cellZoneIDs_(),
-    coordSys_(coordinateSystem::New(mesh, coeffs_))
+    coordSys_(*(coordinateSystem::New(mesh, coeffs_)))
 {
     if (zoneName_ == word::null)
     {
diff --git a/src/finiteVolume/fields/fvPatchFields/derived/codedFixedValue/codedFixedValueFvPatchField.C b/src/finiteVolume/fields/fvPatchFields/derived/codedFixedValue/codedFixedValueFvPatchField.C
index 513056ab6b4..95c50f56aaa 100644
--- a/src/finiteVolume/fields/fvPatchFields/derived/codedFixedValue/codedFixedValueFvPatchField.C
+++ b/src/finiteVolume/fields/fvPatchFields/derived/codedFixedValue/codedFixedValueFvPatchField.C
@@ -283,7 +283,7 @@ Foam::codedFixedValueFvPatchField<Type>::redirectPatchField() const
             ).ptr()
         );
     }
-    return redirectPatchFieldPtr_();
+    return *redirectPatchFieldPtr_;
 }
 
 
diff --git a/src/finiteVolume/fields/fvPatchFields/derived/codedMixed/codedMixedFvPatchField.C b/src/finiteVolume/fields/fvPatchFields/derived/codedMixed/codedMixedFvPatchField.C
index d122e90f892..f03e966e152 100644
--- a/src/finiteVolume/fields/fvPatchFields/derived/codedMixed/codedMixedFvPatchField.C
+++ b/src/finiteVolume/fields/fvPatchFields/derived/codedMixed/codedMixedFvPatchField.C
@@ -291,7 +291,7 @@ Foam::codedMixedFvPatchField<Type>::redirectPatchField() const
             )
         );
     }
-    return redirectPatchFieldPtr_();
+    return *redirectPatchFieldPtr_;
 }
 
 
diff --git a/src/finiteVolume/fields/fvPatchFields/derived/cylindricalInletVelocity/cylindricalInletVelocityFvPatchVectorField.C b/src/finiteVolume/fields/fvPatchFields/derived/cylindricalInletVelocity/cylindricalInletVelocityFvPatchVectorField.C
index 31a67024a51..6e053a21e25 100644
--- a/src/finiteVolume/fields/fvPatchFields/derived/cylindricalInletVelocity/cylindricalInletVelocityFvPatchVectorField.C
+++ b/src/finiteVolume/fields/fvPatchFields/derived/cylindricalInletVelocity/cylindricalInletVelocityFvPatchVectorField.C
@@ -60,9 +60,9 @@ cylindricalInletVelocityFvPatchVectorField
     fixedValueFvPatchField<vector>(ptf, p, iF, mapper),
     centre_(ptf.centre_),
     axis_(ptf.axis_),
-    axialVelocity_(ptf.axialVelocity_, false),
-    radialVelocity_(ptf.radialVelocity_, false),
-    rpm_(ptf.rpm_, false)
+    axialVelocity_(ptf.axialVelocity_.clone()),
+    radialVelocity_(ptf.radialVelocity_.clone()),
+    rpm_(ptf.rpm_.clone())
 {}
 
 
@@ -92,9 +92,9 @@ cylindricalInletVelocityFvPatchVectorField
     fixedValueFvPatchField<vector>(ptf),
     centre_(ptf.centre_),
     axis_(ptf.axis_),
-    axialVelocity_(ptf.axialVelocity_, false),
-    radialVelocity_(ptf.radialVelocity_, false),
-    rpm_(ptf.rpm_, false)
+    axialVelocity_(ptf.axialVelocity_.clone()),
+    radialVelocity_(ptf.radialVelocity_.clone()),
+    rpm_(ptf.rpm_.clone())
 {}
 
 
@@ -108,9 +108,9 @@ cylindricalInletVelocityFvPatchVectorField
     fixedValueFvPatchField<vector>(ptf, iF),
     centre_(ptf.centre_),
     axis_(ptf.axis_),
-    axialVelocity_(ptf.axialVelocity_, false),
-    radialVelocity_(ptf.radialVelocity_, false),
-    rpm_(ptf.rpm_, false)
+    axialVelocity_(ptf.axialVelocity_.clone()),
+    radialVelocity_(ptf.radialVelocity_.clone()),
+    rpm_(ptf.rpm_.clone())
 {}
 
 
diff --git a/src/finiteVolume/fields/fvPatchFields/derived/fixedMean/fixedMeanFvPatchField.C b/src/finiteVolume/fields/fvPatchFields/derived/fixedMean/fixedMeanFvPatchField.C
index 648b7169666..7ff37d287e8 100644
--- a/src/finiteVolume/fields/fvPatchFields/derived/fixedMean/fixedMeanFvPatchField.C
+++ b/src/finiteVolume/fields/fvPatchFields/derived/fixedMean/fixedMeanFvPatchField.C
@@ -65,7 +65,7 @@ Foam::fixedMeanFvPatchField<Type>::fixedMeanFvPatchField
 )
 :
     fixedValueFvPatchField<Type>(ptf, p, iF, mapper),
-    meanValue_(ptf.meanValue_, false)
+    meanValue_(ptf.meanValue_.clone())
 {}
 
 
@@ -76,7 +76,7 @@ Foam::fixedMeanFvPatchField<Type>::fixedMeanFvPatchField
 )
 :
     fixedValueFvPatchField<Type>(ptf),
-    meanValue_(ptf.meanValue_, false)
+    meanValue_(ptf.meanValue_.clone())
 {}
 
 
@@ -88,7 +88,7 @@ Foam::fixedMeanFvPatchField<Type>::fixedMeanFvPatchField
 )
 :
     fixedValueFvPatchField<Type>(ptf, iF),
-    meanValue_(ptf.meanValue_, false)
+    meanValue_(ptf.meanValue_.clone())
 {}
 
 
diff --git a/src/finiteVolume/fields/fvPatchFields/derived/fixedProfile/fixedProfileFvPatchField.C b/src/finiteVolume/fields/fvPatchFields/derived/fixedProfile/fixedProfileFvPatchField.C
index 1deba5890f7..0d97a44926b 100644
--- a/src/finiteVolume/fields/fvPatchFields/derived/fixedProfile/fixedProfileFvPatchField.C
+++ b/src/finiteVolume/fields/fvPatchFields/derived/fixedProfile/fixedProfileFvPatchField.C
@@ -94,7 +94,7 @@ Foam::fixedProfileFvPatchField<Type>::fixedProfileFvPatchField
 )
 :
     fixedValueFvPatchField<Type>(p, iF),  // Don't map
-    profile_(ptf.profile_, false),
+    profile_(ptf.profile_.clone()),
     dir_(ptf.dir_),
     origin_(ptf.origin_)
 {
@@ -110,7 +110,7 @@ Foam::fixedProfileFvPatchField<Type>::fixedProfileFvPatchField
 )
 :
     fixedValueFvPatchField<Type>(ptf),
-    profile_(ptf.profile_, false),
+    profile_(ptf.profile_.clone()),
     dir_(ptf.dir_),
     origin_(ptf.origin_)
 {}
@@ -124,7 +124,7 @@ Foam::fixedProfileFvPatchField<Type>::fixedProfileFvPatchField
 )
 :
     fixedValueFvPatchField<Type>(ptf, iF),
-    profile_(ptf.profile_, false),
+    profile_(ptf.profile_.clone()),
     dir_(ptf.dir_),
     origin_(ptf.origin_)
 {
diff --git a/src/finiteVolume/fields/fvPatchFields/derived/flowRateInletVelocity/flowRateInletVelocityFvPatchVectorField.C b/src/finiteVolume/fields/fvPatchFields/derived/flowRateInletVelocity/flowRateInletVelocityFvPatchVectorField.C
index f40f399ad34..5f4122b704d 100644
--- a/src/finiteVolume/fields/fvPatchFields/derived/flowRateInletVelocity/flowRateInletVelocityFvPatchVectorField.C
+++ b/src/finiteVolume/fields/fvPatchFields/derived/flowRateInletVelocity/flowRateInletVelocityFvPatchVectorField.C
@@ -107,7 +107,7 @@ flowRateInletVelocityFvPatchVectorField
 )
 :
     fixedValueFvPatchField<vector>(ptf, p, iF, mapper),
-    flowRate_(ptf.flowRate_, false),
+    flowRate_(ptf.flowRate_.clone()),
     volumetric_(ptf.volumetric_),
     rhoName_(ptf.rhoName_),
     rhoInlet_(ptf.rhoInlet_),
@@ -122,7 +122,7 @@ flowRateInletVelocityFvPatchVectorField
 )
 :
     fixedValueFvPatchField<vector>(ptf),
-    flowRate_(ptf.flowRate_, false),
+    flowRate_(ptf.flowRate_.clone()),
     volumetric_(ptf.volumetric_),
     rhoName_(ptf.rhoName_),
     rhoInlet_(ptf.rhoInlet_),
@@ -138,7 +138,7 @@ flowRateInletVelocityFvPatchVectorField
 )
 :
     fixedValueFvPatchField<vector>(ptf, iF),
-    flowRate_(ptf.flowRate_, false),
+    flowRate_(ptf.flowRate_.clone()),
     volumetric_(ptf.volumetric_),
     rhoName_(ptf.rhoName_),
     rhoInlet_(ptf.rhoInlet_),
diff --git a/src/finiteVolume/fields/fvPatchFields/derived/flowRateOutletVelocity/flowRateOutletVelocityFvPatchVectorField.C b/src/finiteVolume/fields/fvPatchFields/derived/flowRateOutletVelocity/flowRateOutletVelocityFvPatchVectorField.C
index ed9d095a2a1..88e9c9848c1 100644
--- a/src/finiteVolume/fields/fvPatchFields/derived/flowRateOutletVelocity/flowRateOutletVelocityFvPatchVectorField.C
+++ b/src/finiteVolume/fields/fvPatchFields/derived/flowRateOutletVelocity/flowRateOutletVelocityFvPatchVectorField.C
@@ -102,7 +102,7 @@ flowRateOutletVelocityFvPatchVectorField
 )
 :
     fixedValueFvPatchField<vector>(ptf, p, iF, mapper),
-    flowRate_(ptf.flowRate_, false),
+    flowRate_(ptf.flowRate_.clone()),
     volumetric_(ptf.volumetric_),
     rhoName_(ptf.rhoName_),
     rhoOutlet_(ptf.rhoOutlet_)
@@ -116,7 +116,7 @@ flowRateOutletVelocityFvPatchVectorField
 )
 :
     fixedValueFvPatchField<vector>(ptf),
-    flowRate_(ptf.flowRate_, false),
+    flowRate_(ptf.flowRate_.clone()),
     volumetric_(ptf.volumetric_),
     rhoName_(ptf.rhoName_),
     rhoOutlet_(ptf.rhoOutlet_)
@@ -131,7 +131,7 @@ flowRateOutletVelocityFvPatchVectorField
 )
 :
     fixedValueFvPatchField<vector>(ptf, iF),
-    flowRate_(ptf.flowRate_, false),
+    flowRate_(ptf.flowRate_.clone()),
     volumetric_(ptf.volumetric_),
     rhoName_(ptf.rhoName_),
     rhoOutlet_(ptf.rhoOutlet_)
diff --git a/src/finiteVolume/fields/fvPatchFields/derived/rotatingPressureInletOutletVelocity/rotatingPressureInletOutletVelocityFvPatchVectorField.C b/src/finiteVolume/fields/fvPatchFields/derived/rotatingPressureInletOutletVelocity/rotatingPressureInletOutletVelocityFvPatchVectorField.C
index edaca467e2e..39532ed2f07 100644
--- a/src/finiteVolume/fields/fvPatchFields/derived/rotatingPressureInletOutletVelocity/rotatingPressureInletOutletVelocityFvPatchVectorField.C
+++ b/src/finiteVolume/fields/fvPatchFields/derived/rotatingPressureInletOutletVelocity/rotatingPressureInletOutletVelocityFvPatchVectorField.C
@@ -71,7 +71,7 @@ rotatingPressureInletOutletVelocityFvPatchVectorField
 )
 :
     pressureInletOutletVelocityFvPatchVectorField(ptf, p, iF, mapper),
-    omega_(ptf.omega_, false)
+    omega_(ptf.omega_.clone())
 {
     calcTangentialVelocity();
 }
@@ -100,7 +100,7 @@ rotatingPressureInletOutletVelocityFvPatchVectorField
 )
 :
     pressureInletOutletVelocityFvPatchVectorField(rppvf),
-    omega_(rppvf.omega_, false)
+    omega_(rppvf.omega_.clone())
 {
     calcTangentialVelocity();
 }
@@ -114,7 +114,7 @@ rotatingPressureInletOutletVelocityFvPatchVectorField
 )
 :
     pressureInletOutletVelocityFvPatchVectorField(rppvf, iF),
-    omega_(rppvf.omega_, false)
+    omega_(rppvf.omega_.clone())
 {
     calcTangentialVelocity();
 }
diff --git a/src/finiteVolume/fields/fvPatchFields/derived/rotatingPressureInletOutletVelocity/rotatingPressureInletOutletVelocityFvPatchVectorField.H b/src/finiteVolume/fields/fvPatchFields/derived/rotatingPressureInletOutletVelocity/rotatingPressureInletOutletVelocityFvPatchVectorField.H
index ddb6cc5df4e..c46d3b6edb6 100644
--- a/src/finiteVolume/fields/fvPatchFields/derived/rotatingPressureInletOutletVelocity/rotatingPressureInletOutletVelocityFvPatchVectorField.H
+++ b/src/finiteVolume/fields/fvPatchFields/derived/rotatingPressureInletOutletVelocity/rotatingPressureInletOutletVelocityFvPatchVectorField.H
@@ -38,7 +38,7 @@ Usage
         Property     | Description             | Required    | Default value
         phi          | flux field name         | no          | phi
         tangentialVelocity | tangential velocity field | no  |
-        omega        | angular velocty of the frame [rad/s] | yes    |
+        omega        | angular velocity of the frame [rad/s] | yes    |
     \endtable
 
     Example of the boundary condition specification:
diff --git a/src/finiteVolume/fields/fvPatchFields/derived/rotatingTotalPressure/rotatingTotalPressureFvPatchScalarField.C b/src/finiteVolume/fields/fvPatchFields/derived/rotatingTotalPressure/rotatingTotalPressureFvPatchScalarField.C
index 5d1df66c792..c5fdd786397 100644
--- a/src/finiteVolume/fields/fvPatchFields/derived/rotatingTotalPressure/rotatingTotalPressureFvPatchScalarField.C
+++ b/src/finiteVolume/fields/fvPatchFields/derived/rotatingTotalPressure/rotatingTotalPressureFvPatchScalarField.C
@@ -53,7 +53,7 @@ rotatingTotalPressureFvPatchScalarField
 )
 :
     totalPressureFvPatchScalarField(ptf, p, iF, mapper),
-    omega_(ptf.omega_, false)
+    omega_(ptf.omega_.clone())
 {}
 
 
@@ -77,7 +77,7 @@ rotatingTotalPressureFvPatchScalarField
 )
 :
     totalPressureFvPatchScalarField(rtppsf),
-    omega_(rtppsf.omega_, false)
+    omega_(rtppsf.omega_.clone())
 {}
 
 
@@ -89,7 +89,7 @@ rotatingTotalPressureFvPatchScalarField
 )
 :
     totalPressureFvPatchScalarField(rtppsf, iF),
-    omega_(rtppsf.omega_, false)
+    omega_(rtppsf.omega_.clone())
 {}
 
 
diff --git a/src/finiteVolume/fields/fvPatchFields/derived/rotatingWallVelocity/rotatingWallVelocityFvPatchVectorField.C b/src/finiteVolume/fields/fvPatchFields/derived/rotatingWallVelocity/rotatingWallVelocityFvPatchVectorField.C
index d322862f4a6..c35b7a3c3ff 100644
--- a/src/finiteVolume/fields/fvPatchFields/derived/rotatingWallVelocity/rotatingWallVelocityFvPatchVectorField.C
+++ b/src/finiteVolume/fields/fvPatchFields/derived/rotatingWallVelocity/rotatingWallVelocityFvPatchVectorField.C
@@ -40,7 +40,7 @@ rotatingWallVelocityFvPatchVectorField
     fixedValueFvPatchField<vector>(p, iF),
     origin_(),
     axis_(Zero),
-    omega_(0)
+    omega_(nullptr)
 {}
 
 
@@ -84,7 +84,7 @@ rotatingWallVelocityFvPatchVectorField
     fixedValueFvPatchField<vector>(ptf, p, iF, mapper),
     origin_(ptf.origin_),
     axis_(ptf.axis_),
-    omega_(ptf.omega_, false)
+    omega_(ptf.omega_.clone())
 {}
 
 
@@ -97,7 +97,7 @@ rotatingWallVelocityFvPatchVectorField
     fixedValueFvPatchField<vector>(rwvpvf),
     origin_(rwvpvf.origin_),
     axis_(rwvpvf.axis_),
-    omega_(rwvpvf.omega_, false)
+    omega_(rwvpvf.omega_.clone())
 {}
 
 
@@ -111,7 +111,7 @@ rotatingWallVelocityFvPatchVectorField
     fixedValueFvPatchField<vector>(rwvpvf, iF),
     origin_(rwvpvf.origin_),
     axis_(rwvpvf.axis_),
-    omega_(rwvpvf.omega_, false)
+    omega_(rwvpvf.omega_.clone())
 {}
 
 
diff --git a/src/finiteVolume/fields/fvPatchFields/derived/swirlFlowRateInletVelocity/swirlFlowRateInletVelocityFvPatchVectorField.C b/src/finiteVolume/fields/fvPatchFields/derived/swirlFlowRateInletVelocity/swirlFlowRateInletVelocityFvPatchVectorField.C
index cba888cc6b9..ebe4ebdd58a 100644
--- a/src/finiteVolume/fields/fvPatchFields/derived/swirlFlowRateInletVelocity/swirlFlowRateInletVelocityFvPatchVectorField.C
+++ b/src/finiteVolume/fields/fvPatchFields/derived/swirlFlowRateInletVelocity/swirlFlowRateInletVelocityFvPatchVectorField.C
@@ -99,8 +99,8 @@ swirlFlowRateInletVelocityFvPatchVectorField
     rhoName_(ptf.rhoName_),
     origin_(ptf.origin_),
     axis_(ptf.axis_),
-    flowRate_(ptf.flowRate_, false),
-    rpm_(ptf.rpm_, false)
+    flowRate_(ptf.flowRate_.clone()),
+    rpm_(ptf.rpm_.clone())
 {}
 
 
@@ -115,8 +115,8 @@ swirlFlowRateInletVelocityFvPatchVectorField
     rhoName_(ptf.rhoName_),
     origin_(ptf.origin_),
     axis_(ptf.axis_),
-    flowRate_(ptf.flowRate_, false),
-    rpm_(ptf.rpm_, false)
+    flowRate_(ptf.flowRate_.clone()),
+    rpm_(ptf.rpm_.clone())
 {}
 
 
@@ -132,8 +132,8 @@ swirlFlowRateInletVelocityFvPatchVectorField
     rhoName_(ptf.rhoName_),
     origin_(ptf.origin_),
     axis_(ptf.axis_),
-    flowRate_(ptf.flowRate_, false),
-    rpm_(ptf.rpm_, false)
+    flowRate_(ptf.flowRate_.clone()),
+    rpm_(ptf.rpm_.clone())
 {}
 
 
diff --git a/src/finiteVolume/fields/fvPatchFields/derived/swirlInletVelocity/swirlInletVelocityFvPatchVectorField.C b/src/finiteVolume/fields/fvPatchFields/derived/swirlInletVelocity/swirlInletVelocityFvPatchVectorField.C
index 4b76142d9f6..21c42908ddc 100644
--- a/src/finiteVolume/fields/fvPatchFields/derived/swirlInletVelocity/swirlInletVelocityFvPatchVectorField.C
+++ b/src/finiteVolume/fields/fvPatchFields/derived/swirlInletVelocity/swirlInletVelocityFvPatchVectorField.C
@@ -56,9 +56,9 @@ swirlInletVelocityFvPatchVectorField
     fixedValueFvPatchField<vector>(ptf, p, iF, mapper),
     origin_(ptf.origin_),
     axis_(ptf.axis_),
-    axialVelocity_(ptf.axialVelocity_, false),
-    radialVelocity_(ptf.radialVelocity_, false),
-    tangentialVelocity_(ptf.tangentialVelocity_, false)
+    axialVelocity_(ptf.axialVelocity_.clone()),
+    radialVelocity_(ptf.radialVelocity_.clone()),
+    tangentialVelocity_(ptf.tangentialVelocity_.clone())
 {}
 
 
@@ -88,9 +88,9 @@ swirlInletVelocityFvPatchVectorField
     fixedValueFvPatchField<vector>(ptf),
     origin_(ptf.origin_),
     axis_(ptf.axis_),
-    axialVelocity_(ptf.axialVelocity_, false),
-    radialVelocity_(ptf.radialVelocity_, false),
-    tangentialVelocity_(ptf.tangentialVelocity_, false)
+    axialVelocity_(ptf.axialVelocity_.clone()),
+    radialVelocity_(ptf.radialVelocity_.clone()),
+    tangentialVelocity_(ptf.tangentialVelocity_.clone())
 {}
 
 
@@ -104,9 +104,9 @@ swirlInletVelocityFvPatchVectorField
     fixedValueFvPatchField<vector>(ptf, iF),
     origin_(ptf.origin_),
     axis_(ptf.axis_),
-    axialVelocity_(ptf.axialVelocity_, false),
-    radialVelocity_(ptf.radialVelocity_, false),
-    tangentialVelocity_(ptf.tangentialVelocity_, false)
+    axialVelocity_(ptf.axialVelocity_.clone()),
+    radialVelocity_(ptf.radialVelocity_.clone()),
+    tangentialVelocity_(ptf.tangentialVelocity_.clone())
 {}
 
 
diff --git a/src/finiteVolume/fields/fvPatchFields/derived/timeVaryingMappedFixedValue/timeVaryingMappedFixedValueFvPatchField.C b/src/finiteVolume/fields/fvPatchFields/derived/timeVaryingMappedFixedValue/timeVaryingMappedFixedValueFvPatchField.C
index af626c2c5e4..0d0e4e0a219 100644
--- a/src/finiteVolume/fields/fvPatchFields/derived/timeVaryingMappedFixedValue/timeVaryingMappedFixedValueFvPatchField.C
+++ b/src/finiteVolume/fields/fvPatchFields/derived/timeVaryingMappedFixedValue/timeVaryingMappedFixedValueFvPatchField.C
@@ -141,7 +141,7 @@ timeVaryingMappedFixedValueFvPatchField
     endSampleTime_(-1),
     endSampledValues_(0),
     endAverage_(Zero),
-    offset_(ptf.offset_, false)
+    offset_(ptf.offset_.clone())
 {}
 
 
@@ -165,7 +165,7 @@ timeVaryingMappedFixedValueFvPatchField
     endSampleTime_(ptf.endSampleTime_),
     endSampledValues_(ptf.endSampledValues_),
     endAverage_(ptf.endAverage_),
-    offset_(ptf.offset_, false)
+    offset_(ptf.offset_.clone())
 {}
 
 
@@ -190,7 +190,7 @@ timeVaryingMappedFixedValueFvPatchField
     endSampleTime_(ptf.endSampleTime_),
     endSampledValues_(ptf.endSampledValues_),
     endAverage_(ptf.endAverage_),
-    offset_(ptf.offset_, false)
+    offset_(ptf.offset_.clone())
 {}
 
 
diff --git a/src/finiteVolume/fields/fvPatchFields/derived/translatingWallVelocity/translatingWallVelocityFvPatchVectorField.C b/src/finiteVolume/fields/fvPatchFields/derived/translatingWallVelocity/translatingWallVelocityFvPatchVectorField.C
index d41a4247017..b9cb8fa6a56 100644
--- a/src/finiteVolume/fields/fvPatchFields/derived/translatingWallVelocity/translatingWallVelocityFvPatchVectorField.C
+++ b/src/finiteVolume/fields/fvPatchFields/derived/translatingWallVelocity/translatingWallVelocityFvPatchVectorField.C
@@ -37,7 +37,7 @@ translatingWallVelocityFvPatchVectorField
 )
 :
     fixedValueFvPatchField<vector>(p, iF),
-    U_(0)
+    U_(nullptr)
 {}
 
 
@@ -67,7 +67,7 @@ translatingWallVelocityFvPatchVectorField
 )
 :
     fixedValueFvPatchField<vector>(ptf, p, iF, mapper),
-    U_(ptf.U_, false)
+    U_(ptf.U_.clone())
 {}
 
 
@@ -78,7 +78,7 @@ translatingWallVelocityFvPatchVectorField
 )
 :
     fixedValueFvPatchField<vector>(twvpvf),
-    U_(twvpvf.U_, false)
+    U_(twvpvf.U_.clone())
 {}
 
 
@@ -90,7 +90,7 @@ translatingWallVelocityFvPatchVectorField
 )
 :
     fixedValueFvPatchField<vector>(twvpvf, iF),
-    U_(twvpvf.U_, false)
+    U_(twvpvf.U_.clone())
 {}
 
 
diff --git a/src/finiteVolume/fields/fvPatchFields/derived/turbulentDFSEMInlet/turbulentDFSEMInletFvPatchVectorField.C b/src/finiteVolume/fields/fvPatchFields/derived/turbulentDFSEMInlet/turbulentDFSEMInletFvPatchVectorField.C
index 22cd511d186..a23ffef19fb 100644
--- a/src/finiteVolume/fields/fvPatchFields/derived/turbulentDFSEMInlet/turbulentDFSEMInletFvPatchVectorField.C
+++ b/src/finiteVolume/fields/fvPatchFields/derived/turbulentDFSEMInlet/turbulentDFSEMInletFvPatchVectorField.C
@@ -235,7 +235,7 @@ Foam::turbulentDFSEMInletFvPatchVectorField::patchMapper() const
         );
     }
 
-    return mapperPtr_();
+    return *mapperPtr_;
 }
 
 
diff --git a/src/finiteVolume/fields/fvPatchFields/derived/uniformFixedGradient/uniformFixedGradientFvPatchField.C b/src/finiteVolume/fields/fvPatchFields/derived/uniformFixedGradient/uniformFixedGradientFvPatchField.C
index 1bf1f7b0814..c08fd07f3de 100644
--- a/src/finiteVolume/fields/fvPatchFields/derived/uniformFixedGradient/uniformFixedGradientFvPatchField.C
+++ b/src/finiteVolume/fields/fvPatchFields/derived/uniformFixedGradient/uniformFixedGradientFvPatchField.C
@@ -78,7 +78,7 @@ Foam::uniformFixedGradientFvPatchField<Type>::uniformFixedGradientFvPatchField
 )
 :
     fixedGradientFvPatchField<Type>(ptf, p, iF, mapper),
-    uniformGradient_(ptf.uniformGradient_, false)
+    uniformGradient_(ptf.uniformGradient_.clone())
 {}
 
 
@@ -89,7 +89,7 @@ Foam::uniformFixedGradientFvPatchField<Type>::uniformFixedGradientFvPatchField
 )
 :
     fixedGradientFvPatchField<Type>(ptf),
-    uniformGradient_(ptf.uniformGradient_, false)
+    uniformGradient_(ptf.uniformGradient_.clone())
 {}
 
 
@@ -101,7 +101,7 @@ Foam::uniformFixedGradientFvPatchField<Type>::uniformFixedGradientFvPatchField
 )
 :
     fixedGradientFvPatchField<Type>(ptf, iF),
-    uniformGradient_(ptf.uniformGradient_, false)
+    uniformGradient_(ptf.uniformGradient_.clone())
 {
     // Evaluate the profile if defined
     if (ptf.uniformGradient_.valid())
diff --git a/src/finiteVolume/fields/fvPatchFields/derived/uniformFixedValue/uniformFixedValueFvPatchField.C b/src/finiteVolume/fields/fvPatchFields/derived/uniformFixedValue/uniformFixedValueFvPatchField.C
index e79df9bec06..dc4d7c8a932 100644
--- a/src/finiteVolume/fields/fvPatchFields/derived/uniformFixedValue/uniformFixedValueFvPatchField.C
+++ b/src/finiteVolume/fields/fvPatchFields/derived/uniformFixedValue/uniformFixedValueFvPatchField.C
@@ -77,7 +77,7 @@ Foam::uniformFixedValueFvPatchField<Type>::uniformFixedValueFvPatchField
 )
 :
     fixedValueFvPatchField<Type>(p, iF),   // Don't map
-    uniformValue_(ptf.uniformValue_, false)
+    uniformValue_(ptf.uniformValue_.clone())
 {
     // Evaluate since value not mapped
     this->evaluate();
@@ -91,7 +91,7 @@ Foam::uniformFixedValueFvPatchField<Type>::uniformFixedValueFvPatchField
 )
 :
     fixedValueFvPatchField<Type>(ptf),
-    uniformValue_(ptf.uniformValue_, false)
+    uniformValue_(ptf.uniformValue_.clone())
 {}
 
 
@@ -103,7 +103,7 @@ Foam::uniformFixedValueFvPatchField<Type>::uniformFixedValueFvPatchField
 )
 :
     fixedValueFvPatchField<Type>(ptf, iF),
-    uniformValue_(ptf.uniformValue_, false)
+    uniformValue_(ptf.uniformValue_.clone())
 {
     // Evaluate the profile if defined
     if (ptf.uniformValue_.valid())
diff --git a/src/finiteVolume/fields/fvPatchFields/derived/uniformInletOutlet/uniformInletOutletFvPatchField.C b/src/finiteVolume/fields/fvPatchFields/derived/uniformInletOutlet/uniformInletOutletFvPatchField.C
index 647398f4b05..28f623544df 100644
--- a/src/finiteVolume/fields/fvPatchFields/derived/uniformInletOutlet/uniformInletOutletFvPatchField.C
+++ b/src/finiteVolume/fields/fvPatchFields/derived/uniformInletOutlet/uniformInletOutletFvPatchField.C
@@ -87,7 +87,7 @@ Foam::uniformInletOutletFvPatchField<Type>::uniformInletOutletFvPatchField
 :
     mixedFvPatchField<Type>(p, iF),  // Don't map
     phiName_(ptf.phiName_),
-    uniformInletValue_(ptf.uniformInletValue_, false)
+    uniformInletValue_(ptf.uniformInletValue_.clone())
 {
     this->patchType() = ptf.patchType();
 
@@ -113,7 +113,7 @@ Foam::uniformInletOutletFvPatchField<Type>::uniformInletOutletFvPatchField
 :
     mixedFvPatchField<Type>(ptf),
     phiName_(ptf.phiName_),
-    uniformInletValue_(ptf.uniformInletValue_, false)
+    uniformInletValue_(ptf.uniformInletValue_.clone())
 {}
 
 
@@ -126,7 +126,7 @@ Foam::uniformInletOutletFvPatchField<Type>::uniformInletOutletFvPatchField
 :
     mixedFvPatchField<Type>(ptf, iF),
     phiName_(ptf.phiName_),
-    uniformInletValue_(ptf.uniformInletValue_, false)
+    uniformInletValue_(ptf.uniformInletValue_.clone())
 {}
 
 
diff --git a/src/finiteVolume/fields/fvPatchFields/derived/uniformJump/uniformJumpFvPatchField.C b/src/finiteVolume/fields/fvPatchFields/derived/uniformJump/uniformJumpFvPatchField.C
index 31350e62301..67e199cf424 100644
--- a/src/finiteVolume/fields/fvPatchFields/derived/uniformJump/uniformJumpFvPatchField.C
+++ b/src/finiteVolume/fields/fvPatchFields/derived/uniformJump/uniformJumpFvPatchField.C
@@ -49,7 +49,7 @@ Foam::uniformJumpFvPatchField<Type>::uniformJumpFvPatchField
 )
 :
     fixedJumpFvPatchField<Type>(ptf, p, iF, mapper),
-    jumpTable_(ptf.jumpTable_, false)
+    jumpTable_(ptf.jumpTable_.clone())
 {}
 
 
@@ -90,7 +90,7 @@ Foam::uniformJumpFvPatchField<Type>::uniformJumpFvPatchField
 )
 :
     fixedJumpFvPatchField<Type>(ptf),
-    jumpTable_(ptf.jumpTable_, false)
+    jumpTable_(ptf.jumpTable_.clone())
 {}
 
 
@@ -102,7 +102,7 @@ Foam::uniformJumpFvPatchField<Type>::uniformJumpFvPatchField
 )
 :
     fixedJumpFvPatchField<Type>(ptf, iF),
-    jumpTable_(ptf.jumpTable_, false)
+    jumpTable_(ptf.jumpTable_.clone())
 {}
 
 
diff --git a/src/finiteVolume/fields/fvPatchFields/derived/uniformJumpAMI/uniformJumpAMIFvPatchField.C b/src/finiteVolume/fields/fvPatchFields/derived/uniformJumpAMI/uniformJumpAMIFvPatchField.C
index 033afb572af..acf0f8358d9 100644
--- a/src/finiteVolume/fields/fvPatchFields/derived/uniformJumpAMI/uniformJumpAMIFvPatchField.C
+++ b/src/finiteVolume/fields/fvPatchFields/derived/uniformJumpAMI/uniformJumpAMIFvPatchField.C
@@ -49,7 +49,7 @@ Foam::uniformJumpAMIFvPatchField<Type>::uniformJumpAMIFvPatchField
 )
 :
     fixedJumpAMIFvPatchField<Type>(ptf, p, iF, mapper),
-    jumpTable_(ptf.jumpTable_, false)
+    jumpTable_(ptf.jumpTable_.clone())
 {}
 
 
@@ -87,7 +87,7 @@ Foam::uniformJumpAMIFvPatchField<Type>::uniformJumpAMIFvPatchField
 )
 :
     fixedJumpAMIFvPatchField<Type>(ptf),
-    jumpTable_(ptf.jumpTable_, false)
+    jumpTable_(ptf.jumpTable_.clone())
 {}
 
 
@@ -99,7 +99,7 @@ Foam::uniformJumpAMIFvPatchField<Type>::uniformJumpAMIFvPatchField
 )
 :
     fixedJumpAMIFvPatchField<Type>(ptf, iF),
-    jumpTable_(ptf.jumpTable_, false)
+    jumpTable_(ptf.jumpTable_.clone())
 {}
 
 
diff --git a/src/finiteVolume/fields/fvPatchFields/derived/uniformTotalPressure/uniformTotalPressureFvPatchScalarField.C b/src/finiteVolume/fields/fvPatchFields/derived/uniformTotalPressure/uniformTotalPressureFvPatchScalarField.C
index ea3c1705c6c..eee8af784c1 100644
--- a/src/finiteVolume/fields/fvPatchFields/derived/uniformTotalPressure/uniformTotalPressureFvPatchScalarField.C
+++ b/src/finiteVolume/fields/fvPatchFields/derived/uniformTotalPressure/uniformTotalPressureFvPatchScalarField.C
@@ -94,7 +94,7 @@ uniformTotalPressureFvPatchScalarField
     rhoName_(ptf.rhoName_),
     psiName_(ptf.psiName_),
     gamma_(ptf.gamma_),
-    p0_(ptf.p0_, false)
+    p0_(ptf.p0_.clone())
 {
     patchType() = ptf.patchType();
 
@@ -117,7 +117,7 @@ uniformTotalPressureFvPatchScalarField
     rhoName_(ptf.rhoName_),
     psiName_(ptf.psiName_),
     gamma_(ptf.gamma_),
-    p0_(ptf.p0_, false)
+    p0_(ptf.p0_.clone())
 {}
 
 
@@ -134,7 +134,7 @@ uniformTotalPressureFvPatchScalarField
     rhoName_(ptf.rhoName_),
     psiName_(ptf.psiName_),
     gamma_(ptf.gamma_),
-    p0_(ptf.p0_, false)
+    p0_(ptf.p0_.clone())
 {}
 
 
diff --git a/src/finiteVolume/fields/fvPatchFields/derived/variableHeightFlowRateInletVelocity/variableHeightFlowRateInletVelocityFvPatchVectorField.C b/src/finiteVolume/fields/fvPatchFields/derived/variableHeightFlowRateInletVelocity/variableHeightFlowRateInletVelocityFvPatchVectorField.C
index 40a7ce65d96..56f99f5067f 100644
--- a/src/finiteVolume/fields/fvPatchFields/derived/variableHeightFlowRateInletVelocity/variableHeightFlowRateInletVelocityFvPatchVectorField.C
+++ b/src/finiteVolume/fields/fvPatchFields/derived/variableHeightFlowRateInletVelocity/variableHeightFlowRateInletVelocityFvPatchVectorField.C
@@ -66,7 +66,7 @@ Foam::variableHeightFlowRateInletVelocityFvPatchVectorField
 )
 :
     fixedValueFvPatchField<vector>(ptf, p, iF, mapper),
-    flowRate_(ptf.flowRate_, false),
+    flowRate_(ptf.flowRate_.clone()),
     alphaName_(ptf.alphaName_)
 {}
 
@@ -78,7 +78,7 @@ Foam::variableHeightFlowRateInletVelocityFvPatchVectorField
 )
 :
     fixedValueFvPatchField<vector>(ptf),
-    flowRate_(ptf.flowRate_, false),
+    flowRate_(ptf.flowRate_.clone()),
     alphaName_(ptf.alphaName_)
 {}
 
@@ -91,7 +91,7 @@ Foam::variableHeightFlowRateInletVelocityFvPatchVectorField
 )
 :
     fixedValueFvPatchField<vector>(ptf, iF),
-    flowRate_(ptf.flowRate_, false),
+    flowRate_(ptf.flowRate_.clone()),
     alphaName_(ptf.alphaName_)
 {}
 
diff --git a/src/finiteVolume/finiteVolume/ddtSchemes/CrankNicolsonDdtScheme/CrankNicolsonDdtScheme.C b/src/finiteVolume/finiteVolume/ddtSchemes/CrankNicolsonDdtScheme/CrankNicolsonDdtScheme.C
index a8632062e45..f6e4482031f 100644
--- a/src/finiteVolume/finiteVolume/ddtSchemes/CrankNicolsonDdtScheme/CrankNicolsonDdtScheme.C
+++ b/src/finiteVolume/finiteVolume/ddtSchemes/CrankNicolsonDdtScheme/CrankNicolsonDdtScheme.C
@@ -320,10 +320,9 @@ CrankNicolsonDdtScheme<Type>::CrankNicolsonDdtScheme
                 << exit(FatalIOError);
         }
 
-        ocCoeff_ = new Function1Types::Constant<scalar>
+        ocCoeff_.reset
         (
-            "ocCoeff",
-            ocCoeff
+            new Function1Types::Constant<scalar>("ocCoeff", ocCoeff)
         );
     }
     else
diff --git a/src/finiteVolume/fvMesh/extendedStencil/cellToCell/extendedCentredCellToCellStencil.H b/src/finiteVolume/fvMesh/extendedStencil/cellToCell/extendedCentredCellToCellStencil.H
index b38e5359412..68a0256bf51 100644
--- a/src/finiteVolume/fvMesh/extendedStencil/cellToCell/extendedCentredCellToCellStencil.H
+++ b/src/finiteVolume/fvMesh/extendedStencil/cellToCell/extendedCentredCellToCellStencil.H
@@ -86,7 +86,7 @@ public:
         //- Return reference to the parallel distribution map
         const mapDistribute& map() const
         {
-            return mapPtr_();
+            return *mapPtr_;
         }
 
         //- Return reference to the stencil
diff --git a/src/finiteVolume/fvMesh/extendedStencil/cellToFace/extendedCentredCellToFaceStencil.H b/src/finiteVolume/fvMesh/extendedStencil/cellToFace/extendedCentredCellToFaceStencil.H
index f1a7ce9ebac..5db34ecacfd 100644
--- a/src/finiteVolume/fvMesh/extendedStencil/cellToFace/extendedCentredCellToFaceStencil.H
+++ b/src/finiteVolume/fvMesh/extendedStencil/cellToFace/extendedCentredCellToFaceStencil.H
@@ -85,7 +85,7 @@ public:
         //- Return reference to the parallel distribution map
         const mapDistribute& map() const
         {
-            return mapPtr_();
+            return *mapPtr_;
         }
 
         //- Return reference to the stencil
diff --git a/src/finiteVolume/fvMesh/extendedStencil/cellToFace/extendedUpwindCellToFaceStencil.H b/src/finiteVolume/fvMesh/extendedStencil/cellToFace/extendedUpwindCellToFaceStencil.H
index 1ce6ca12097..67824801c31 100644
--- a/src/finiteVolume/fvMesh/extendedStencil/cellToFace/extendedUpwindCellToFaceStencil.H
+++ b/src/finiteVolume/fvMesh/extendedStencil/cellToFace/extendedUpwindCellToFaceStencil.H
@@ -152,13 +152,13 @@ public:
         //- Return reference to the parallel distribution map
         const mapDistribute& ownMap() const
         {
-            return ownMapPtr_();
+            return *ownMapPtr_;
         }
 
         //- Return reference to the parallel distribution map
         const mapDistribute& neiMap() const
         {
-            return neiMapPtr_();
+            return *neiMapPtr_;
         }
 
         //- Return reference to the stencil
diff --git a/src/finiteVolume/fvMesh/extendedStencil/faceToCell/extendedCentredFaceToCellStencil.H b/src/finiteVolume/fvMesh/extendedStencil/faceToCell/extendedCentredFaceToCellStencil.H
index 3e3f01f50e2..0c6d6beb01d 100644
--- a/src/finiteVolume/fvMesh/extendedStencil/faceToCell/extendedCentredFaceToCellStencil.H
+++ b/src/finiteVolume/fvMesh/extendedStencil/faceToCell/extendedCentredFaceToCellStencil.H
@@ -85,7 +85,7 @@ public:
         //- Return reference to the parallel distribution map
         const mapDistribute& map() const
         {
-            return mapPtr_();
+            return *mapPtr_;
         }
 
         //- Return reference to the stencil
diff --git a/src/functionObjects/field/streamLine/streamLineBase.C b/src/functionObjects/field/streamLine/streamLineBase.C
index d6a49bcce5b..d5730ec1ba4 100644
--- a/src/functionObjects/field/streamLine/streamLineBase.C
+++ b/src/functionObjects/field/streamLine/streamLineBase.C
@@ -75,7 +75,7 @@ Foam::functionObjects::streamLineBase::sampledSetPoints() const
         sampledSetAxis_ = sampledSetPtr_->axis();
     }
 
-    return sampledSetPtr_();
+    return *sampledSetPtr_;
 }
 
 
diff --git a/src/functionObjects/utilities/codedFunctionObject/codedFunctionObject.C b/src/functionObjects/utilities/codedFunctionObject/codedFunctionObject.C
index 51917aa5549..8e2c1c1ffb0 100644
--- a/src/functionObjects/utilities/codedFunctionObject/codedFunctionObject.C
+++ b/src/functionObjects/utilities/codedFunctionObject/codedFunctionObject.C
@@ -162,7 +162,7 @@ Foam::functionObjects::codedFunctionObject::redirectFunctionObject() const
             constructDict
         );
     }
-    return redirectFunctionObjectPtr_();
+    return *redirectFunctionObjectPtr_;
 }
 
 
diff --git a/src/functionObjects/utilities/ensightWrite/ensightWrite.H b/src/functionObjects/utilities/ensightWrite/ensightWrite.H
index 0386625fb6a..0d61f4dfab2 100644
--- a/src/functionObjects/utilities/ensightWrite/ensightWrite.H
+++ b/src/functionObjects/utilities/ensightWrite/ensightWrite.H
@@ -140,13 +140,13 @@ class ensightWrite
         //- Ensight case handler
         ensightCase& ensCase()
         {
-            return ensCase_();
+            return *ensCase_;
         }
 
         //- Ensight mesh handler
         ensightMesh& ensMesh()
         {
-            return ensMesh_();
+            return *ensMesh_;
         }
 
 
diff --git a/src/fvMotionSolver/fvMotionSolvers/displacement/SBRStress/displacementSBRStressFvMotionSolver.H b/src/fvMotionSolver/fvMotionSolvers/displacement/SBRStress/displacementSBRStressFvMotionSolver.H
index bb03b888386..7bd9737556f 100644
--- a/src/fvMotionSolver/fvMotionSolvers/displacement/SBRStress/displacementSBRStressFvMotionSolver.H
+++ b/src/fvMotionSolver/fvMotionSolvers/displacement/SBRStress/displacementSBRStressFvMotionSolver.H
@@ -130,7 +130,7 @@ public:
         //- Return diffusivity
         motionDiffusivity& diffusivity()
         {
-            return diffusivityPtr_();
+            return *diffusivityPtr_;
         }
 
         //- Return point location obtained from the current motion field
diff --git a/src/fvMotionSolver/fvMotionSolvers/displacement/laplacian/displacementLaplacianFvMotionSolver.C b/src/fvMotionSolver/fvMotionSolvers/displacement/laplacian/displacementLaplacianFvMotionSolver.C
index 96d035e68ae..b656a355735 100644
--- a/src/fvMotionSolver/fvMotionSolvers/displacement/laplacian/displacementLaplacianFvMotionSolver.C
+++ b/src/fvMotionSolver/fvMotionSolvers/displacement/laplacian/displacementLaplacianFvMotionSolver.C
@@ -253,7 +253,8 @@ Foam::displacementLaplacianFvMotionSolver::diffusivity()
             coeffDict().lookup("diffusivity")
         );
     }
-    return diffusivityPtr_();
+
+    return *diffusivityPtr_;
 }
 
 
diff --git a/src/fvMotionSolver/fvMotionSolvers/displacement/solidBodyDisplacementLaplacian/solidBodyDisplacementLaplacianFvMotionSolver.C b/src/fvMotionSolver/fvMotionSolvers/displacement/solidBodyDisplacementLaplacian/solidBodyDisplacementLaplacianFvMotionSolver.C
index 277593506b1..cd6fb4caf71 100644
--- a/src/fvMotionSolver/fvMotionSolvers/displacement/solidBodyDisplacementLaplacian/solidBodyDisplacementLaplacianFvMotionSolver.C
+++ b/src/fvMotionSolver/fvMotionSolvers/displacement/solidBodyDisplacementLaplacian/solidBodyDisplacementLaplacianFvMotionSolver.C
@@ -258,7 +258,8 @@ Foam::solidBodyDisplacementLaplacianFvMotionSolver::diffusivity()
             coeffDict().lookup("diffusivity")
         );
     }
-    return diffusivityPtr_();
+
+    return *diffusivityPtr_;
 }
 
 
diff --git a/src/fvMotionSolver/pointPatchFields/derived/surfaceDisplacement/surfaceDisplacementPointPatchVectorField.C b/src/fvMotionSolver/pointPatchFields/derived/surfaceDisplacement/surfaceDisplacementPointPatchVectorField.C
index 5e2053ef990..3d0f31a4462 100644
--- a/src/fvMotionSolver/pointPatchFields/derived/surfaceDisplacement/surfaceDisplacementPointPatchVectorField.C
+++ b/src/fvMotionSolver/pointPatchFields/derived/surfaceDisplacement/surfaceDisplacementPointPatchVectorField.C
@@ -411,7 +411,8 @@ Foam::surfaceDisplacementPointPatchVectorField::surfaces() const
             )
         );
     }
-    return surfacesPtr_();
+
+    return *surfacesPtr_;
 }
 
 
diff --git a/src/fvMotionSolver/pointPatchFields/derived/surfaceSlipDisplacement/surfaceSlipDisplacementPointPatchVectorField.C b/src/fvMotionSolver/pointPatchFields/derived/surfaceSlipDisplacement/surfaceSlipDisplacementPointPatchVectorField.C
index 469cebfb79b..2f3de5ce6a8 100644
--- a/src/fvMotionSolver/pointPatchFields/derived/surfaceSlipDisplacement/surfaceSlipDisplacementPointPatchVectorField.C
+++ b/src/fvMotionSolver/pointPatchFields/derived/surfaceSlipDisplacement/surfaceSlipDisplacementPointPatchVectorField.C
@@ -397,7 +397,8 @@ Foam::surfaceSlipDisplacementPointPatchVectorField::surfaces() const
             )
         );
     }
-    return surfacesPtr_();
+
+    return *surfacesPtr_;
 }
 
 
diff --git a/src/fvMotionSolver/pointPatchFields/derived/timeVaryingMappedFixedValue/timeVaryingMappedFixedValuePointPatchField.C b/src/fvMotionSolver/pointPatchFields/derived/timeVaryingMappedFixedValue/timeVaryingMappedFixedValuePointPatchField.C
index 1fbcb49f96b..93025bfbd1e 100644
--- a/src/fvMotionSolver/pointPatchFields/derived/timeVaryingMappedFixedValue/timeVaryingMappedFixedValuePointPatchField.C
+++ b/src/fvMotionSolver/pointPatchFields/derived/timeVaryingMappedFixedValue/timeVaryingMappedFixedValuePointPatchField.C
@@ -146,7 +146,7 @@ timeVaryingMappedFixedValuePointPatchField
     endSampleTime_(-1),
     endSampledValues_(0),
     endAverage_(Zero),
-    offset_(ptf.offset_, false)
+    offset_(ptf.offset_.clone())
 {}
 
 
@@ -170,7 +170,7 @@ timeVaryingMappedFixedValuePointPatchField
     endSampleTime_(ptf.endSampleTime_),
     endSampledValues_(ptf.endSampledValues_),
     endAverage_(ptf.endAverage_),
-    offset_(ptf.offset_, false)
+    offset_(ptf.offset_.clone())
 {}
 
 
@@ -195,7 +195,7 @@ timeVaryingMappedFixedValuePointPatchField
     endSampleTime_(ptf.endSampleTime_),
     endSampledValues_(ptf.endSampledValues_),
     endAverage_(ptf.endAverage_),
-    offset_(ptf.offset_, false)
+    offset_(ptf.offset_.clone())
 {}
 
 
diff --git a/src/fvOptions/interRegionOption/interRegionOptionI.H b/src/fvOptions/interRegionOption/interRegionOptionI.H
index 738b6993469..55d0aa941c0 100644
--- a/src/fvOptions/interRegionOption/interRegionOptionI.H
+++ b/src/fvOptions/interRegionOption/interRegionOptionI.H
@@ -42,7 +42,7 @@ Foam::fv::interRegionOption::meshInterp() const
             << abort(FatalError);
     }
 
-    return meshInterpPtr_();
+    return *meshInterpPtr_;
 }
 
 
diff --git a/src/fvOptions/sources/derived/jouleHeatingSource/jouleHeatingSource.C b/src/fvOptions/sources/derived/jouleHeatingSource/jouleHeatingSource.C
index 7a7a8ccde7d..963c0c72fee 100644
--- a/src/fvOptions/sources/derived/jouleHeatingSource/jouleHeatingSource.C
+++ b/src/fvOptions/sources/derived/jouleHeatingSource/jouleHeatingSource.C
@@ -63,7 +63,7 @@ const Foam::coordinateSystem& Foam::fv::jouleHeatingSource::coordSys() const
             << abort(FatalError);
     }
 
-    return coordSysPtr_();
+    return *coordSysPtr_;
 }
 
 
diff --git a/src/fvOptions/sources/general/codedSource/CodedSource.C b/src/fvOptions/sources/general/codedSource/CodedSource.C
index 2ea05cf09a8..567e7d666eb 100644
--- a/src/fvOptions/sources/general/codedSource/CodedSource.C
+++ b/src/fvOptions/sources/general/codedSource/CodedSource.C
@@ -143,7 +143,7 @@ Foam::fv::option& Foam::fv::CodedSource<Type>::redirectFvOption() const
             mesh_
         );
     }
-    return redirectFvOptionPtr_();
+    return *redirectFvOptionPtr_;
 }
 
 
diff --git a/src/fvOptions/sources/interRegion/interRegionHeatTransfer/interRegionHeatTransferModel/interRegionHeatTransferModelI.H b/src/fvOptions/sources/interRegion/interRegionHeatTransfer/interRegionHeatTransferModel/interRegionHeatTransferModelI.H
index c9a57a05d1a..4fd5ded0fbb 100644
--- a/src/fvOptions/sources/interRegion/interRegionHeatTransfer/interRegionHeatTransferModel/interRegionHeatTransferModelI.H
+++ b/src/fvOptions/sources/interRegion/interRegionHeatTransfer/interRegionHeatTransferModel/interRegionHeatTransferModelI.H
@@ -42,14 +42,14 @@ Foam::fv::interRegionHeatTransferModel::meshInterp() const
             << abort(FatalError);
     }
 
-    return meshInterpPtr_();
+    return *meshInterpPtr_;
 }
 
 
 inline const Foam::volScalarField&
 Foam::fv::interRegionHeatTransferModel::htc() const
 {
-    return  htc_;
+    return htc_;
 }
 
 
diff --git a/src/fvOptions/sources/interRegion/interRegionHeatTransfer/tabulatedHeatTransfer/tabulatedHeatTransfer.C b/src/fvOptions/sources/interRegion/interRegionHeatTransfer/tabulatedHeatTransfer/tabulatedHeatTransfer.C
index 86de071e8f9..4362a4065a6 100644
--- a/src/fvOptions/sources/interRegion/interRegionHeatTransfer/tabulatedHeatTransfer/tabulatedHeatTransfer.C
+++ b/src/fvOptions/sources/interRegion/interRegionHeatTransfer/tabulatedHeatTransfer/tabulatedHeatTransfer.C
@@ -53,7 +53,7 @@ Foam::fv::tabulatedHeatTransfer::hTable()
         hTable_.reset(new interpolation2DTable<scalar>(coeffs_));
     }
 
-    return hTable_();
+    return *hTable_;
 }
 
 
@@ -78,7 +78,7 @@ const Foam::volScalarField& Foam::fv::tabulatedHeatTransfer::AoV()
         );
     }
 
-    return AoV_();
+    return *AoV_;
 }
 
 
diff --git a/src/fvOptions/sources/interRegion/interRegionHeatTransfer/tabulatedNTUHeatTransfer/tabulatedNTUHeatTransfer.C b/src/fvOptions/sources/interRegion/interRegionHeatTransfer/tabulatedNTUHeatTransfer/tabulatedNTUHeatTransfer.C
index 2ba95833c19..7bb32e152b3 100644
--- a/src/fvOptions/sources/interRegion/interRegionHeatTransfer/tabulatedNTUHeatTransfer/tabulatedNTUHeatTransfer.C
+++ b/src/fvOptions/sources/interRegion/interRegionHeatTransfer/tabulatedNTUHeatTransfer/tabulatedNTUHeatTransfer.C
@@ -64,7 +64,7 @@ Foam::fv::tabulatedNTUHeatTransfer::ntuTable()
         ntuTable_.reset(new interpolation2DTable<scalar>(coeffs_));
     }
 
-    return ntuTable_();
+    return *ntuTable_;
 }
 
 
diff --git a/src/fvOptions/sources/interRegion/interRegionHeatTransfer/variableHeatTransfer/variableHeatTransfer.C b/src/fvOptions/sources/interRegion/interRegionHeatTransfer/variableHeatTransfer/variableHeatTransfer.C
index 7fe1bc1a30c..d1d67441742 100644
--- a/src/fvOptions/sources/interRegion/interRegionHeatTransfer/variableHeatTransfer/variableHeatTransfer.C
+++ b/src/fvOptions/sources/interRegion/interRegionHeatTransfer/variableHeatTransfer/variableHeatTransfer.C
@@ -89,12 +89,6 @@ Foam::fv::variableHeatTransfer::variableHeatTransfer
 }
 
 
-// * * * * * * * * * * * * * * * * Destructor  * * * * * * * * * * * * * * * //
-
-Foam::fv::variableHeatTransfer::~variableHeatTransfer()
-{}
-
-
 // * * * * * * * * * * * * * * * Member Functions  * * * * * * * * * * * * * //
 
 void Foam::fv::variableHeatTransfer::calculateHtc()
@@ -122,7 +116,7 @@ void Foam::fv::variableHeatTransfer::calculateHtc()
 
     const scalarField htcNbrMapped(interpolate(htcNbr));
 
-    htc_.primitiveFieldRef() = htcNbrMapped*AoV_;
+    htc_.primitiveFieldRef() = htcNbrMapped * AoV_();
 }
 
 
diff --git a/src/fvOptions/sources/interRegion/interRegionHeatTransfer/variableHeatTransfer/variableHeatTransfer.H b/src/fvOptions/sources/interRegion/interRegionHeatTransfer/variableHeatTransfer/variableHeatTransfer.H
index e639fc07928..e580cdae201 100644
--- a/src/fvOptions/sources/interRegion/interRegionHeatTransfer/variableHeatTransfer/variableHeatTransfer.H
+++ b/src/fvOptions/sources/interRegion/interRegionHeatTransfer/variableHeatTransfer/variableHeatTransfer.H
@@ -105,7 +105,7 @@ public:
 
 
     //- Destructor
-    virtual ~variableHeatTransfer();
+    virtual ~variableHeatTransfer() = default;
 
 
     // Public Functions
@@ -113,11 +113,8 @@ public:
         //- Calculate the heat transfer coefficient
         virtual void calculateHtc();
 
-
-        // IO
-
-            //- Read dictionary
-            virtual bool read(const dictionary& dict) ;
+        //- Read dictionary
+        virtual bool read(const dictionary& dict);
 };
 
 
diff --git a/src/lagrangian/DSMC/clouds/Templates/DSMCCloud/DSMCCloudI.H b/src/lagrangian/DSMC/clouds/Templates/DSMCCloud/DSMCCloudI.H
index 38c9fd3a390..5d4d63f2796 100644
--- a/src/lagrangian/DSMC/clouds/Templates/DSMCCloud/DSMCCloudI.H
+++ b/src/lagrangian/DSMC/clouds/Templates/DSMCCloud/DSMCCloudI.H
@@ -216,7 +216,7 @@ template<class ParcelType>
 inline Foam::BinaryCollisionModel<Foam::DSMCCloud<ParcelType>>&
 Foam::DSMCCloud<ParcelType>::binaryCollision()
 {
-    return binaryCollisionModel_();
+    return *binaryCollisionModel_;
 }
 
 
@@ -224,7 +224,7 @@ template<class ParcelType>
 inline const Foam::WallInteractionModel<Foam::DSMCCloud<ParcelType>>&
 Foam::DSMCCloud<ParcelType>::wallInteraction() const
 {
-    return wallInteractionModel_;
+    return *wallInteractionModel_;
 }
 
 
@@ -232,7 +232,7 @@ template<class ParcelType>
 inline Foam::WallInteractionModel<Foam::DSMCCloud<ParcelType>>&
 Foam::DSMCCloud<ParcelType>::wallInteraction()
 {
-    return wallInteractionModel_();
+    return *wallInteractionModel_;
 }
 
 
@@ -240,7 +240,7 @@ template<class ParcelType>
 inline const Foam::InflowBoundaryModel<Foam::DSMCCloud<ParcelType>>&
 Foam::DSMCCloud<ParcelType>::inflowBoundary() const
 {
-    return inflowBoundaryModel_;
+    return *inflowBoundaryModel_;
 }
 
 
@@ -248,7 +248,7 @@ template<class ParcelType>
 inline Foam::InflowBoundaryModel<Foam::DSMCCloud<ParcelType>>&
 Foam::DSMCCloud<ParcelType>::inflowBoundary()
 {
-    return inflowBoundaryModel_();
+    return *inflowBoundaryModel_;
 }
 
 
diff --git a/src/lagrangian/basic/InteractionLists/InteractionListsI.H b/src/lagrangian/basic/InteractionLists/InteractionListsI.H
index 979367cd377..6882cc9d802 100644
--- a/src/lagrangian/basic/InteractionLists/InteractionListsI.H
+++ b/src/lagrangian/basic/InteractionLists/InteractionListsI.H
@@ -38,7 +38,7 @@ template<class ParticleType>
 const Foam::mapDistribute&
 Foam::InteractionLists<ParticleType>::cellMap() const
 {
-    return cellMapPtr_();
+    return *cellMapPtr_;
 }
 
 
@@ -46,7 +46,7 @@ template<class ParticleType>
 const Foam::mapDistribute&
 Foam::InteractionLists<ParticleType>::wallFaceMap() const
 {
-    return wallFaceMapPtr_();
+    return *wallFaceMapPtr_;
 }
 
 
diff --git a/src/lagrangian/intermediate/clouds/Templates/CollidingCloud/CollidingCloudI.H b/src/lagrangian/intermediate/clouds/Templates/CollidingCloud/CollidingCloudI.H
index cb4ec402a1d..d5320d44fe9 100644
--- a/src/lagrangian/intermediate/clouds/Templates/CollidingCloud/CollidingCloudI.H
+++ b/src/lagrangian/intermediate/clouds/Templates/CollidingCloud/CollidingCloudI.H
@@ -29,7 +29,7 @@ template<class CloudType>
 inline const Foam::CollidingCloud<CloudType>&
 Foam::CollidingCloud<CloudType>::cloudCopy() const
 {
-    return cloudCopyPtr_();
+    return *cloudCopyPtr_;
 }
 
 
@@ -45,7 +45,7 @@ template<class CloudType>
 inline const Foam::CollisionModel<Foam::CollidingCloud<CloudType>>&
 Foam::CollidingCloud<CloudType>::collision() const
 {
-    return collisionModel_();
+    return *collisionModel_;
 }
 
 
@@ -53,7 +53,7 @@ template<class CloudType>
 inline Foam::CollisionModel<Foam::CollidingCloud<CloudType>>&
 Foam::CollidingCloud<CloudType>::collision()
 {
-    return collisionModel_();
+    return *collisionModel_;
 }
 
 
diff --git a/src/lagrangian/intermediate/clouds/Templates/KinematicCloud/KinematicCloud.C b/src/lagrangian/intermediate/clouds/Templates/KinematicCloud/KinematicCloud.C
index 3e229fa1e65..84c7b853152 100644
--- a/src/lagrangian/intermediate/clouds/Templates/KinematicCloud/KinematicCloud.C
+++ b/src/lagrangian/intermediate/clouds/Templates/KinematicCloud/KinematicCloud.C
@@ -539,13 +539,6 @@ Foam::KinematicCloud<CloudType>::KinematicCloud
 {}
 
 
-// * * * * * * * * * * * * * * * * Destructor  * * * * * * * * * * * * * * * //
-
-template<class CloudType>
-Foam::KinematicCloud<CloudType>::~KinematicCloud()
-{}
-
-
 // * * * * * * * * * * * * * * * Member Functions  * * * * * * * * * * * * * //
 
 template<class CloudType>
diff --git a/src/lagrangian/intermediate/clouds/Templates/KinematicCloud/KinematicCloud.H b/src/lagrangian/intermediate/clouds/Templates/KinematicCloud/KinematicCloud.H
index 4b93cd33292..fdfb60c0870 100644
--- a/src/lagrangian/intermediate/clouds/Templates/KinematicCloud/KinematicCloud.H
+++ b/src/lagrangian/intermediate/clouds/Templates/KinematicCloud/KinematicCloud.H
@@ -325,7 +325,7 @@ public:
 
 
     //- Destructor
-    virtual ~KinematicCloud();
+    virtual ~KinematicCloud() = default;
 
 
     // Member Functions
diff --git a/src/lagrangian/intermediate/clouds/Templates/KinematicCloud/KinematicCloudI.H b/src/lagrangian/intermediate/clouds/Templates/KinematicCloud/KinematicCloudI.H
index f5ac343730d..bdb245e6e5d 100644
--- a/src/lagrangian/intermediate/clouds/Templates/KinematicCloud/KinematicCloudI.H
+++ b/src/lagrangian/intermediate/clouds/Templates/KinematicCloud/KinematicCloudI.H
@@ -32,7 +32,7 @@ template<class CloudType>
 inline const Foam::KinematicCloud<CloudType>&
 Foam::KinematicCloud<CloudType>::cloudCopy() const
 {
-    return cloudCopyPtr_();
+    return *cloudCopyPtr_;
 }
 
 
@@ -192,7 +192,7 @@ template<class CloudType>
 inline const Foam::DispersionModel<Foam::KinematicCloud<CloudType>>&
 Foam::KinematicCloud<CloudType>::dispersion() const
 {
-    return dispersionModel_;
+    return *dispersionModel_;
 }
 
 
@@ -200,7 +200,7 @@ template<class CloudType>
 inline Foam::DispersionModel<Foam::KinematicCloud<CloudType>>&
 Foam::KinematicCloud<CloudType>::dispersion()
 {
-    return dispersionModel_();
+    return *dispersionModel_;
 }
 
 
@@ -208,7 +208,7 @@ template<class CloudType>
 inline const Foam::PatchInteractionModel<Foam::KinematicCloud<CloudType>>&
 Foam::KinematicCloud<CloudType>::patchInteraction() const
 {
-    return patchInteractionModel_;
+    return *patchInteractionModel_;
 }
 
 
@@ -216,7 +216,7 @@ template<class CloudType>
 inline Foam::PatchInteractionModel<Foam::KinematicCloud<CloudType>>&
 Foam::KinematicCloud<CloudType>::patchInteraction()
 {
-    return patchInteractionModel_();
+    return *patchInteractionModel_;
 }
 
 
@@ -224,7 +224,7 @@ template<class CloudType>
 inline const Foam::StochasticCollisionModel<Foam::KinematicCloud<CloudType>>&
 Foam::KinematicCloud<CloudType>::stochasticCollision() const
 {
-    return stochasticCollisionModel_();
+    return *stochasticCollisionModel_;
 }
 
 
@@ -232,7 +232,7 @@ template<class CloudType>
 inline Foam::StochasticCollisionModel<Foam::KinematicCloud<CloudType>>&
 Foam::KinematicCloud<CloudType>::stochasticCollision()
 {
-    return stochasticCollisionModel_();
+    return *stochasticCollisionModel_;
 }
 
 
@@ -240,7 +240,7 @@ template<class CloudType>
 inline const Foam::SurfaceFilmModel<Foam::KinematicCloud<CloudType>>&
 Foam::KinematicCloud<CloudType>::surfaceFilm() const
 {
-    return surfaceFilmModel_();
+    return *surfaceFilmModel_;
 }
 
 
@@ -248,7 +248,7 @@ template<class CloudType>
 inline Foam::SurfaceFilmModel<Foam::KinematicCloud<CloudType>>&
 Foam::KinematicCloud<CloudType>::surfaceFilm()
 {
-    return surfaceFilmModel_();
+    return *surfaceFilmModel_;
 }
 
 
@@ -256,7 +256,7 @@ template<class CloudType>
 inline const Foam::vectorIntegrationScheme&
 Foam::KinematicCloud<CloudType>::UIntegrator() const
 {
-    return UIntegrator_;
+    return *UIntegrator_;
 }
 
 
@@ -371,7 +371,7 @@ Foam::KinematicCloud<CloudType>::cellOccupancy()
         buildCellOccupancy();
     }
 
-    return cellOccupancyPtr_();
+    return *cellOccupancyPtr_;
 }
 
 
@@ -387,7 +387,7 @@ template<class CloudType>
 inline Foam::DimensionedField<Foam::vector, Foam::volMesh>&
 Foam::KinematicCloud<CloudType>::UTrans()
 {
-    return UTrans_();
+    return *UTrans_;
 }
 
 
@@ -395,7 +395,7 @@ template<class CloudType>
 inline const Foam::DimensionedField<Foam::vector, Foam::volMesh>&
 Foam::KinematicCloud<CloudType>::UTrans() const
 {
-    return UTrans_();
+    return *UTrans_;
 }
 
 
@@ -403,7 +403,7 @@ template<class CloudType>
 inline Foam::DimensionedField<Foam::scalar, Foam::volMesh>&
 Foam::KinematicCloud<CloudType>::UCoeff()
 {
-    return UCoeff_();
+    return *UCoeff_;
 }
 
 
@@ -411,7 +411,7 @@ template<class CloudType>
 inline const Foam::DimensionedField<Foam::scalar, Foam::volMesh>&
 Foam::KinematicCloud<CloudType>::UCoeff() const
 {
-    return UCoeff_();
+    return *UCoeff_;
 }
 
 
diff --git a/src/lagrangian/intermediate/clouds/Templates/MPPICCloud/MPPICCloudI.H b/src/lagrangian/intermediate/clouds/Templates/MPPICCloud/MPPICCloudI.H
index 7d8dee80b97..ee65971bf9d 100644
--- a/src/lagrangian/intermediate/clouds/Templates/MPPICCloud/MPPICCloudI.H
+++ b/src/lagrangian/intermediate/clouds/Templates/MPPICCloud/MPPICCloudI.H
@@ -29,7 +29,7 @@ template<class CloudType>
 inline const Foam::MPPICCloud<CloudType>&
 Foam::MPPICCloud<CloudType>::cloudCopy() const
 {
-    return cloudCopyPtr_();
+    return *cloudCopyPtr_;
 }
 
 
@@ -37,7 +37,7 @@ template<class CloudType>
 inline const Foam::PackingModel<Foam::MPPICCloud<CloudType>>&
 Foam::MPPICCloud<CloudType>::packingModel() const
 {
-    return packingModel_();
+    return *packingModel_;
 }
 
 
@@ -45,7 +45,7 @@ template<class CloudType>
 inline Foam::PackingModel<Foam::MPPICCloud<CloudType>>&
 Foam::MPPICCloud<CloudType>::packingModel()
 {
-    return packingModel_();
+    return *packingModel_;
 }
 
 
@@ -53,7 +53,7 @@ template<class CloudType>
 inline const Foam::DampingModel<Foam::MPPICCloud<CloudType>>&
 Foam::MPPICCloud<CloudType>::dampingModel() const
 {
-    return dampingModel_();
+    return *dampingModel_;
 }
 
 
@@ -61,7 +61,7 @@ template<class CloudType>
 inline Foam::DampingModel<Foam::MPPICCloud<CloudType>>&
 Foam::MPPICCloud<CloudType>::dampingModel()
 {
-    return dampingModel_();
+    return *dampingModel_;
 }
 
 
@@ -69,7 +69,7 @@ template<class CloudType>
 inline const Foam::IsotropyModel<Foam::MPPICCloud<CloudType>>&
 Foam::MPPICCloud<CloudType>::isotropyModel() const
 {
-    return isotropyModel_();
+    return *isotropyModel_;
 }
 
 
@@ -77,7 +77,7 @@ template<class CloudType>
 inline Foam::IsotropyModel<Foam::MPPICCloud<CloudType>>&
 Foam::MPPICCloud<CloudType>::isotropyModel()
 {
-    return isotropyModel_();
+    return *isotropyModel_;
 }
 
 
diff --git a/src/lagrangian/intermediate/clouds/Templates/ReactingCloud/ReactingCloud.C b/src/lagrangian/intermediate/clouds/Templates/ReactingCloud/ReactingCloud.C
index fc52c1abaf9..ffb70989bcd 100644
--- a/src/lagrangian/intermediate/clouds/Templates/ReactingCloud/ReactingCloud.C
+++ b/src/lagrangian/intermediate/clouds/Templates/ReactingCloud/ReactingCloud.C
@@ -203,13 +203,6 @@ Foam::ReactingCloud<CloudType>::ReactingCloud
 {}
 
 
-// * * * * * * * * * * * * * * * * Destructor  * * * * * * * * * * * * * * * //
-
-template<class CloudType>
-Foam::ReactingCloud<CloudType>::~ReactingCloud()
-{}
-
-
 // * * * * * * * * * * * * * * * Member Functions  * * * * * * * * * * * * * //
 
 template<class CloudType>
diff --git a/src/lagrangian/intermediate/clouds/Templates/ReactingCloud/ReactingCloud.H b/src/lagrangian/intermediate/clouds/Templates/ReactingCloud/ReactingCloud.H
index bfb0952677b..22ab3b5b38c 100644
--- a/src/lagrangian/intermediate/clouds/Templates/ReactingCloud/ReactingCloud.H
+++ b/src/lagrangian/intermediate/clouds/Templates/ReactingCloud/ReactingCloud.H
@@ -195,7 +195,7 @@ public:
 
 
     //- Destructor
-    virtual ~ReactingCloud();
+    virtual ~ReactingCloud() = default;
 
 
     // Member Functions
diff --git a/src/lagrangian/intermediate/clouds/Templates/ReactingCloud/ReactingCloudI.H b/src/lagrangian/intermediate/clouds/Templates/ReactingCloud/ReactingCloudI.H
index 667cff55fdd..7aa240ba2ae 100644
--- a/src/lagrangian/intermediate/clouds/Templates/ReactingCloud/ReactingCloudI.H
+++ b/src/lagrangian/intermediate/clouds/Templates/ReactingCloud/ReactingCloudI.H
@@ -29,7 +29,7 @@ template<class CloudType>
 inline const Foam::ReactingCloud<CloudType>&
 Foam::ReactingCloud<CloudType>::cloudCopy() const
 {
-    return cloudCopyPtr_();
+    return *cloudCopyPtr_;
 }
 
 
@@ -53,7 +53,7 @@ template<class CloudType>
 inline const Foam::CompositionModel<Foam::ReactingCloud<CloudType>>&
 Foam::ReactingCloud<CloudType>::composition() const
 {
-    return compositionModel_;
+    return *compositionModel_;
 }
 
 
@@ -61,7 +61,7 @@ template<class CloudType>
 inline const Foam::PhaseChangeModel<Foam::ReactingCloud<CloudType>>&
 Foam::ReactingCloud<CloudType>::phaseChange() const
 {
-    return phaseChangeModel_;
+    return *phaseChangeModel_;
 }
 
 
@@ -69,7 +69,7 @@ template<class CloudType>
 inline Foam::PhaseChangeModel<Foam::ReactingCloud<CloudType>>&
 Foam::ReactingCloud<CloudType>::phaseChange()
 {
-    return phaseChangeModel_();
+    return *phaseChangeModel_;
 }
 
 
diff --git a/src/lagrangian/intermediate/clouds/Templates/ReactingMultiphaseCloud/ReactingMultiphaseCloudI.H b/src/lagrangian/intermediate/clouds/Templates/ReactingMultiphaseCloud/ReactingMultiphaseCloudI.H
index c7aa0e4aaff..20816c1f195 100644
--- a/src/lagrangian/intermediate/clouds/Templates/ReactingMultiphaseCloud/ReactingMultiphaseCloudI.H
+++ b/src/lagrangian/intermediate/clouds/Templates/ReactingMultiphaseCloud/ReactingMultiphaseCloudI.H
@@ -29,7 +29,7 @@ template<class CloudType>
 inline const Foam::ReactingMultiphaseCloud<CloudType>&
 Foam::ReactingMultiphaseCloud<CloudType>::cloudCopy() const
 {
-    return cloudCopyPtr_();
+    return *cloudCopyPtr_;
 }
 
 
@@ -67,7 +67,7 @@ inline Foam::DevolatilisationModel
 >&
 Foam::ReactingMultiphaseCloud<CloudType>::devolatilisation()
 {
-    return devolatilisationModel_();
+    return *devolatilisationModel_;
 }
 
 
@@ -89,7 +89,7 @@ inline Foam::SurfaceReactionModel
 >&
 Foam::ReactingMultiphaseCloud<CloudType>::surfaceReaction()
 {
-    return surfaceReactionModel_();
+    return *surfaceReactionModel_;
 }
 
 
diff --git a/src/lagrangian/intermediate/clouds/Templates/ThermoCloud/ThermoCloud.C b/src/lagrangian/intermediate/clouds/Templates/ThermoCloud/ThermoCloud.C
index 2f1248ae2f2..85e26f49dbe 100644
--- a/src/lagrangian/intermediate/clouds/Templates/ThermoCloud/ThermoCloud.C
+++ b/src/lagrangian/intermediate/clouds/Templates/ThermoCloud/ThermoCloud.C
@@ -346,13 +346,6 @@ Foam::ThermoCloud<CloudType>::ThermoCloud
 {}
 
 
-// * * * * * * * * * * * * * * * * Destructor  * * * * * * * * * * * * * * * //
-
-template<class CloudType>
-Foam::ThermoCloud<CloudType>::~ThermoCloud()
-{}
-
-
 // * * * * * * * * * * * * * * * Member Functions  * * * * * * * * * * * * * //
 
 template<class CloudType>
diff --git a/src/lagrangian/intermediate/clouds/Templates/ThermoCloud/ThermoCloud.H b/src/lagrangian/intermediate/clouds/Templates/ThermoCloud/ThermoCloud.H
index fa99a67d86a..c2111c4617b 100644
--- a/src/lagrangian/intermediate/clouds/Templates/ThermoCloud/ThermoCloud.H
+++ b/src/lagrangian/intermediate/clouds/Templates/ThermoCloud/ThermoCloud.H
@@ -214,7 +214,7 @@ public:
 
 
     //- Destructor
-    virtual ~ThermoCloud();
+    virtual ~ThermoCloud() = default;
 
 
     // Member Functions
diff --git a/src/lagrangian/intermediate/clouds/Templates/ThermoCloud/ThermoCloudI.H b/src/lagrangian/intermediate/clouds/Templates/ThermoCloud/ThermoCloudI.H
index e61c2e99012..d36a15421b6 100644
--- a/src/lagrangian/intermediate/clouds/Templates/ThermoCloud/ThermoCloudI.H
+++ b/src/lagrangian/intermediate/clouds/Templates/ThermoCloud/ThermoCloudI.H
@@ -33,7 +33,7 @@ template<class CloudType>
 inline const Foam::ThermoCloud<CloudType>&
 Foam::ThermoCloud<CloudType>::cloudCopy() const
 {
-    return cloudCopyPtr_();
+    return *cloudCopyPtr_;
 }
 
 
@@ -78,7 +78,7 @@ template<class CloudType>
 inline const Foam::HeatTransferModel<Foam::ThermoCloud<CloudType>>&
 Foam::ThermoCloud<CloudType>::heatTransfer() const
 {
-    return heatTransferModel_;
+    return *heatTransferModel_;
 }
 
 
@@ -86,7 +86,7 @@ template<class CloudType>
 inline const Foam::scalarIntegrationScheme&
 Foam::ThermoCloud<CloudType>::TIntegrator() const
 {
-    return TIntegrator_;
+    return *TIntegrator_;
 }
 
 
@@ -108,7 +108,7 @@ Foam::ThermoCloud<CloudType>::radAreaP()
             << abort(FatalError);
     }
 
-    return radAreaP_();
+    return *radAreaP_;
 }
 
 
@@ -123,7 +123,7 @@ Foam::ThermoCloud<CloudType>::radAreaP() const
             << abort(FatalError);
     }
 
-    return radAreaP_();
+    return *radAreaP_;
 }
 
 
@@ -138,7 +138,7 @@ Foam::ThermoCloud<CloudType>::radT4()
             << abort(FatalError);
     }
 
-    return radT4_();
+    return *radT4_;
 }
 
 
@@ -153,7 +153,7 @@ Foam::ThermoCloud<CloudType>::radT4() const
             << abort(FatalError);
     }
 
-    return radT4_();
+    return *radT4_;
 }
 
 
@@ -168,7 +168,7 @@ Foam::ThermoCloud<CloudType>::radAreaPT4()
             << abort(FatalError);
     }
 
-    return radAreaPT4_();
+    return *radAreaPT4_;
 }
 
 
@@ -183,7 +183,7 @@ Foam::ThermoCloud<CloudType>::radAreaPT4() const
             << abort(FatalError);
     }
 
-    return radAreaPT4_();
+    return *radAreaPT4_;
 }
 
 
@@ -191,7 +191,7 @@ template<class CloudType>
 inline Foam::DimensionedField<Foam::scalar, Foam::volMesh>&
 Foam::ThermoCloud<CloudType>::hsTrans()
 {
-    return hsTrans_();
+    return *hsTrans_;
 }
 
 
@@ -199,7 +199,7 @@ template<class CloudType>
 inline const Foam::DimensionedField<Foam::scalar, Foam::volMesh>&
 Foam::ThermoCloud<CloudType>::hsTrans() const
 {
-    return hsTrans_();
+    return *hsTrans_;
 }
 
 
@@ -207,7 +207,7 @@ template<class CloudType>
 inline Foam::DimensionedField<Foam::scalar, Foam::volMesh>&
 Foam::ThermoCloud<CloudType>::hsCoeff()
 {
-    return hsCoeff_();
+    return *hsCoeff_;
 }
 
 
@@ -215,7 +215,7 @@ template<class CloudType>
 inline const Foam::DimensionedField<Foam::scalar, Foam::volMesh>&
 Foam::ThermoCloud<CloudType>::hsCoeff() const
 {
-    return hsCoeff_();
+    return *hsCoeff_;
 }
 
 
@@ -388,10 +388,8 @@ inline Foam::scalar Foam::ThermoCloud<CloudType>::Tmax() const
     {
         return T;
     }
-    else
-    {
-        return 0.0;
-    }
+
+    return 0.0;
 }
 
 
@@ -414,10 +412,8 @@ inline Foam::scalar Foam::ThermoCloud<CloudType>::Tmin() const
     {
         return T;
     }
-    else
-    {
-        return 0.0;
-    }
+
+    return 0.0;
 }
 
 
diff --git a/src/lagrangian/intermediate/parcels/Templates/KinematicParcel/KinematicParcelTrackingDataI.H b/src/lagrangian/intermediate/parcels/Templates/KinematicParcel/KinematicParcelTrackingDataI.H
index 72806a9fe39..84f26210093 100644
--- a/src/lagrangian/intermediate/parcels/Templates/KinematicParcel/KinematicParcelTrackingDataI.H
+++ b/src/lagrangian/intermediate/parcels/Templates/KinematicParcel/KinematicParcelTrackingDataI.H
@@ -68,7 +68,7 @@ template<class ParcelType>
 inline const Foam::interpolation<Foam::scalar>&
 Foam::KinematicParcel<ParcelType>::trackingData::rhoInterp() const
 {
-    return rhoInterp_();
+    return *rhoInterp_;
 }
 
 
@@ -76,7 +76,7 @@ template<class ParcelType>
 inline const Foam::interpolation<Foam::vector>&
 Foam::KinematicParcel<ParcelType>::trackingData::UInterp() const
 {
-    return UInterp_();
+    return *UInterp_;
 }
 
 
@@ -84,7 +84,7 @@ template<class ParcelType>
 inline const Foam::interpolation<Foam::scalar>&
 Foam::KinematicParcel<ParcelType>::trackingData::muInterp() const
 {
-    return muInterp_();
+    return *muInterp_;
 }
 
 
diff --git a/src/lagrangian/intermediate/parcels/Templates/MPPICParcel/MPPICParcelTrackingDataI.H b/src/lagrangian/intermediate/parcels/Templates/MPPICParcel/MPPICParcelTrackingDataI.H
index 532f22ea7a2..b6bf5cd4521 100644
--- a/src/lagrangian/intermediate/parcels/Templates/MPPICParcel/MPPICParcelTrackingDataI.H
+++ b/src/lagrangian/intermediate/parcels/Templates/MPPICParcel/MPPICParcelTrackingDataI.H
@@ -186,8 +186,8 @@ inline void Foam::MPPICParcel<ParcelType>::trackingData::updateAverages
     }
     volumeAverage_->average();
     massAverage_->average();
-    rhoAverage_->average(massAverage_);
-    uAverage_->average(massAverage_);
+    rhoAverage_->average(*massAverage_);
+    uAverage_->average(*massAverage_);
 
     // squared velocity deviation
     forAllConstIter(typename TrackCloudType, cloud, iter)
@@ -204,7 +204,7 @@ inline void Foam::MPPICParcel<ParcelType>::trackingData::updateAverages
             p.nParticle()*p.mass()*magSqr(p.U() - u)
         );
     }
-    uSqrAverage_->average(massAverage_);
+    uSqrAverage_->average(*massAverage_);
 
     // sauter mean radius
     radiusAverage_() = volumeAverage_();
diff --git a/src/lagrangian/intermediate/parcels/Templates/ReactingParcel/ReactingParcelTrackingDataI.H b/src/lagrangian/intermediate/parcels/Templates/ReactingParcel/ReactingParcelTrackingDataI.H
index 80bccae5d3b..964a7f35816 100644
--- a/src/lagrangian/intermediate/parcels/Templates/ReactingParcel/ReactingParcelTrackingDataI.H
+++ b/src/lagrangian/intermediate/parcels/Templates/ReactingParcel/ReactingParcelTrackingDataI.H
@@ -48,7 +48,7 @@ template<class ParcelType>
 inline const Foam::interpolation<Foam::scalar>&
 Foam::ReactingParcel<ParcelType>::trackingData::pInterp() const
 {
-    return pInterp_();
+    return *pInterp_;
 }
 
 
diff --git a/src/lagrangian/intermediate/parcels/Templates/ThermoParcel/ThermoParcelTrackingDataI.H b/src/lagrangian/intermediate/parcels/Templates/ThermoParcel/ThermoParcelTrackingDataI.H
index 5ea8189bce9..0b1c008c5e5 100644
--- a/src/lagrangian/intermediate/parcels/Templates/ThermoParcel/ThermoParcelTrackingDataI.H
+++ b/src/lagrangian/intermediate/parcels/Templates/ThermoParcel/ThermoParcelTrackingDataI.H
@@ -97,7 +97,7 @@ template<class ParcelType>
 inline const Foam::interpolation<Foam::scalar>&
 Foam::ThermoParcel<ParcelType>::trackingData::TInterp() const
 {
-    return TInterp_();
+    return *TInterp_;
 }
 
 
@@ -105,7 +105,7 @@ template<class ParcelType>
 inline const Foam::interpolation<Foam::scalar>&
 Foam::ThermoParcel<ParcelType>::trackingData::CpInterp() const
 {
-    return CpInterp_();
+    return *CpInterp_;
 }
 
 
@@ -113,7 +113,7 @@ template<class ParcelType>
 inline const Foam::interpolation<Foam::scalar>&
 Foam::ThermoParcel<ParcelType>::trackingData::kappaInterp() const
 {
-    return kappaInterp_();
+    return *kappaInterp_;
 }
 
 
@@ -128,7 +128,7 @@ Foam::ThermoParcel<ParcelType>::trackingData::GInterp() const
             << abort(FatalError);
     }
 
-    return GInterp_();
+    return *GInterp_;
 }
 
 
diff --git a/src/lagrangian/intermediate/submodels/CloudFunctionObjects/ParticleTracks/ParticleTracksI.H b/src/lagrangian/intermediate/submodels/CloudFunctionObjects/ParticleTracks/ParticleTracksI.H
index 8e64611fbf6..c2fc4632221 100644
--- a/src/lagrangian/intermediate/submodels/CloudFunctionObjects/ParticleTracks/ParticleTracksI.H
+++ b/src/lagrangian/intermediate/submodels/CloudFunctionObjects/ParticleTracks/ParticleTracksI.H
@@ -60,7 +60,7 @@ template<class CloudType>
 inline const Foam::Cloud<typename CloudType::parcelType>&
 Foam::ParticleTracks<CloudType>::cloud() const
 {
-    return cloudPtr_();
+    return *cloudPtr_;
 }
 
 
diff --git a/src/lagrangian/intermediate/submodels/Kinematic/InjectionModel/CellZoneInjection/CellZoneInjection.C b/src/lagrangian/intermediate/submodels/Kinematic/InjectionModel/CellZoneInjection/CellZoneInjection.C
index 1e39c9050ac..4c38895e323 100644
--- a/src/lagrangian/intermediate/submodels/Kinematic/InjectionModel/CellZoneInjection/CellZoneInjection.C
+++ b/src/lagrangian/intermediate/submodels/Kinematic/InjectionModel/CellZoneInjection/CellZoneInjection.C
@@ -204,7 +204,7 @@ Foam::CellZoneInjection<CloudType>::CellZoneInjection
     injectorTetPts_(im.injectorTetPts_),
     diameters_(im.diameters_),
     U0_(im.U0_),
-    sizeDistribution_(im.sizeDistribution_, false)
+    sizeDistribution_(im.sizeDistribution_.clone())
 {}
 
 
diff --git a/src/lagrangian/intermediate/submodels/Kinematic/InjectionModel/ConeInjection/ConeInjection.C b/src/lagrangian/intermediate/submodels/Kinematic/InjectionModel/ConeInjection/ConeInjection.C
index 6651a9573fe..d141ce77fec 100644
--- a/src/lagrangian/intermediate/submodels/Kinematic/InjectionModel/ConeInjection/ConeInjection.C
+++ b/src/lagrangian/intermediate/submodels/Kinematic/InjectionModel/ConeInjection/ConeInjection.C
@@ -147,7 +147,7 @@ Foam::ConeInjection<CloudType>::ConeInjection
     Umag_(im.Umag_),
     thetaInner_(im.thetaInner_),
     thetaOuter_(im.thetaOuter_),
-    sizeDistribution_(im.sizeDistribution_, false),
+    sizeDistribution_(im.sizeDistribution_.clone()),
     nInjected_(im.nInjected_),
     tanVec1_(im.tanVec1_),
     tanVec2_(im.tanVec2_)
diff --git a/src/lagrangian/intermediate/submodels/Kinematic/InjectionModel/ConeNozzleInjection/ConeNozzleInjection.C b/src/lagrangian/intermediate/submodels/Kinematic/InjectionModel/ConeNozzleInjection/ConeNozzleInjection.C
index 6ac062ee574..4e9e3b3002d 100644
--- a/src/lagrangian/intermediate/submodels/Kinematic/InjectionModel/ConeNozzleInjection/ConeNozzleInjection.C
+++ b/src/lagrangian/intermediate/submodels/Kinematic/InjectionModel/ConeNozzleInjection/ConeNozzleInjection.C
@@ -223,7 +223,7 @@ Foam::ConeNozzleInjection<CloudType>::ConeNozzleInjection
     flowRateProfile_(im.flowRateProfile_),
     thetaInner_(im.thetaInner_),
     thetaOuter_(im.thetaOuter_),
-    sizeDistribution_(im.sizeDistribution_, false),
+    sizeDistribution_(im.sizeDistribution_.clone()),
     tanVec1_(im.tanVec1_),
     tanVec2_(im.tanVec2_),
     normal_(im.normal_),
diff --git a/src/lagrangian/intermediate/submodels/Kinematic/InjectionModel/FieldActivatedInjection/FieldActivatedInjection.C b/src/lagrangian/intermediate/submodels/Kinematic/InjectionModel/FieldActivatedInjection/FieldActivatedInjection.C
index 70daf04625d..0c457d1ad8a 100644
--- a/src/lagrangian/intermediate/submodels/Kinematic/InjectionModel/FieldActivatedInjection/FieldActivatedInjection.C
+++ b/src/lagrangian/intermediate/submodels/Kinematic/InjectionModel/FieldActivatedInjection/FieldActivatedInjection.C
@@ -119,7 +119,7 @@ Foam::FieldActivatedInjection<CloudType>::FieldActivatedInjection
     nParcelsInjected_(im.nParcelsInjected_),
     U0_(im.U0_),
     diameters_(im.diameters_),
-    sizeDistribution_(im.sizeDistribution_, false)
+    sizeDistribution_(im.sizeDistribution_.clone())
 {}
 
 
diff --git a/src/lagrangian/intermediate/submodels/Kinematic/InjectionModel/InflationInjection/InflationInjection.C b/src/lagrangian/intermediate/submodels/Kinematic/InjectionModel/InflationInjection/InflationInjection.C
index 98bd08e71da..aa978877f97 100644
--- a/src/lagrangian/intermediate/submodels/Kinematic/InjectionModel/InflationInjection/InflationInjection.C
+++ b/src/lagrangian/intermediate/submodels/Kinematic/InjectionModel/InflationInjection/InflationInjection.C
@@ -140,7 +140,7 @@ Foam::InflationInjection<CloudType>::InflationInjection
     fraction_(im.fraction_),
     selfSeed_(im.selfSeed_),
     dSeed_(im.dSeed_),
-    sizeDistribution_(im.sizeDistribution_, false)
+    sizeDistribution_(im.sizeDistribution_.clone())
 {}
 
 
diff --git a/src/lagrangian/intermediate/submodels/Kinematic/InjectionModel/ManualInjection/ManualInjection.C b/src/lagrangian/intermediate/submodels/Kinematic/InjectionModel/ManualInjection/ManualInjection.C
index 4898bc12da5..8a15f16d574 100644
--- a/src/lagrangian/intermediate/submodels/Kinematic/InjectionModel/ManualInjection/ManualInjection.C
+++ b/src/lagrangian/intermediate/submodels/Kinematic/InjectionModel/ManualInjection/ManualInjection.C
@@ -97,7 +97,7 @@ Foam::ManualInjection<CloudType>::ManualInjection
     injectorTetFaces_(im.injectorTetFaces_),
     injectorTetPts_(im.injectorTetPts_),
     U0_(im.U0_),
-    sizeDistribution_(im.sizeDistribution_, false),
+    sizeDistribution_(im.sizeDistribution_.clone()),
     ignoreOutOfBounds_(im.ignoreOutOfBounds_)
 {}
 
diff --git a/src/lagrangian/intermediate/submodels/Kinematic/InjectionModel/PatchFlowRateInjection/PatchFlowRateInjection.C b/src/lagrangian/intermediate/submodels/Kinematic/InjectionModel/PatchFlowRateInjection/PatchFlowRateInjection.C
index a7ad2372dd4..a9527d01901 100644
--- a/src/lagrangian/intermediate/submodels/Kinematic/InjectionModel/PatchFlowRateInjection/PatchFlowRateInjection.C
+++ b/src/lagrangian/intermediate/submodels/Kinematic/InjectionModel/PatchFlowRateInjection/PatchFlowRateInjection.C
@@ -90,7 +90,7 @@ Foam::PatchFlowRateInjection<CloudType>::PatchFlowRateInjection
     duration_(im.duration_),
     concentration_(im.concentration_),
     parcelConcentration_(im.parcelConcentration_),
-    sizeDistribution_(im.sizeDistribution_, false)
+    sizeDistribution_(im.sizeDistribution_.clone())
 {}
 
 
diff --git a/src/lagrangian/intermediate/submodels/Kinematic/InjectionModel/PatchInjection/PatchInjection.C b/src/lagrangian/intermediate/submodels/Kinematic/InjectionModel/PatchInjection/PatchInjection.C
index a56d81e3cef..1c9524078e5 100644
--- a/src/lagrangian/intermediate/submodels/Kinematic/InjectionModel/PatchInjection/PatchInjection.C
+++ b/src/lagrangian/intermediate/submodels/Kinematic/InjectionModel/PatchInjection/PatchInjection.C
@@ -84,7 +84,7 @@ Foam::PatchInjection<CloudType>::PatchInjection
     parcelsPerSecond_(im.parcelsPerSecond_),
     U0_(im.U0_),
     flowRateProfile_(im.flowRateProfile_),
-    sizeDistribution_(im.sizeDistribution_, false)
+    sizeDistribution_(im.sizeDistribution_.clone())
 {}
 
 
diff --git a/src/lagrangian/intermediate/submodels/Kinematic/ParticleForces/Lift/LiftForce/LiftForceI.H b/src/lagrangian/intermediate/submodels/Kinematic/ParticleForces/Lift/LiftForce/LiftForceI.H
index 6c4aeab5968..dac24d0004c 100644
--- a/src/lagrangian/intermediate/submodels/Kinematic/ParticleForces/Lift/LiftForce/LiftForceI.H
+++ b/src/lagrangian/intermediate/submodels/Kinematic/ParticleForces/Lift/LiftForce/LiftForceI.H
@@ -36,7 +36,7 @@ Foam::LiftForce<CloudType>::curlUcInterp() const
             << abort(FatalError);
     }
 
-    return curlUcInterpPtr_();
+    return *curlUcInterpPtr_;
 }
 
 
diff --git a/src/lagrangian/intermediate/submodels/Kinematic/ParticleForces/PressureGradient/PressureGradientForceI.H b/src/lagrangian/intermediate/submodels/Kinematic/ParticleForces/PressureGradient/PressureGradientForceI.H
index c9813d8ee02..d13c6be47a3 100644
--- a/src/lagrangian/intermediate/submodels/Kinematic/ParticleForces/PressureGradient/PressureGradientForceI.H
+++ b/src/lagrangian/intermediate/submodels/Kinematic/ParticleForces/PressureGradient/PressureGradientForceI.H
@@ -36,7 +36,7 @@ Foam::PressureGradientForce<CloudType>::DUcDtInterp() const
             << abort(FatalError);
     }
 
-    return DUcDtInterpPtr_();
+    return *DUcDtInterpPtr_;
 }
 
 
diff --git a/src/lagrangian/intermediate/submodels/Kinematic/PatchInteractionModel/LocalInteraction/LocalInteraction.C b/src/lagrangian/intermediate/submodels/Kinematic/PatchInteractionModel/LocalInteraction/LocalInteraction.C
index 946564c1b88..7d6af59b41f 100644
--- a/src/lagrangian/intermediate/submodels/Kinematic/PatchInteractionModel/LocalInteraction/LocalInteraction.C
+++ b/src/lagrangian/intermediate/submodels/Kinematic/PatchInteractionModel/LocalInteraction/LocalInteraction.C
@@ -152,7 +152,7 @@ Foam::volScalarField& Foam::LocalInteraction<CloudType>::massEscape()
         );
     }
 
-    return massEscapePtr_();
+    return *massEscapePtr_;
 }
 
 
@@ -181,7 +181,7 @@ Foam::volScalarField& Foam::LocalInteraction<CloudType>::massStick()
         );
     }
 
-    return massStickPtr_();
+    return *massStickPtr_;
 }
 
 
diff --git a/src/lagrangian/intermediate/submodels/MPPIC/AveragingMethods/AveragingMethod/AveragingMethod.C b/src/lagrangian/intermediate/submodels/MPPIC/AveragingMethods/AveragingMethod/AveragingMethod.C
index c7c18285a36..906c89be7ce 100644
--- a/src/lagrangian/intermediate/submodels/MPPIC/AveragingMethods/AveragingMethod/AveragingMethod.C
+++ b/src/lagrangian/intermediate/submodels/MPPIC/AveragingMethods/AveragingMethod/AveragingMethod.C
@@ -105,13 +105,6 @@ Foam::AveragingMethod<Type>::New
 }
 
 
-// * * * * * * * * * * * * * * * * Destructor  * * * * * * * * * * * * * * * //
-
-template<class Type>
-Foam::AveragingMethod<Type>::~AveragingMethod()
-{}
-
-
 // * * * * * * * * * * * * * * * Member Functions  * * * * * * * * * * * * * //
 
 template<class Type>
diff --git a/src/lagrangian/intermediate/submodels/MPPIC/AveragingMethods/AveragingMethod/AveragingMethod.H b/src/lagrangian/intermediate/submodels/MPPIC/AveragingMethods/AveragingMethod/AveragingMethod.H
index 39e084c9e2a..550479e5685 100644
--- a/src/lagrangian/intermediate/submodels/MPPIC/AveragingMethods/AveragingMethod/AveragingMethod.H
+++ b/src/lagrangian/intermediate/submodels/MPPIC/AveragingMethods/AveragingMethod/AveragingMethod.H
@@ -130,7 +130,7 @@ public:
 
 
     //- Destructor
-    virtual ~AveragingMethod();
+    virtual ~AveragingMethod() = default;
 
 
     //- Member Functions
diff --git a/src/lagrangian/intermediate/submodels/MPPIC/AveragingMethods/Dual/Dual.C b/src/lagrangian/intermediate/submodels/MPPIC/AveragingMethods/Dual/Dual.C
index bbc44a98b8a..f7be290024b 100644
--- a/src/lagrangian/intermediate/submodels/MPPIC/AveragingMethods/Dual/Dual.C
+++ b/src/lagrangian/intermediate/submodels/MPPIC/AveragingMethods/Dual/Dual.C
@@ -29,15 +29,12 @@ License
 // * * * * * * * * * * * * * Static Member Functions * * * * * * * * * * * * //
 
 template<class Type>
-Foam::autoPtr<Foam::labelList> Foam::AveragingMethods::Dual<Type>::size
-(
-    const fvMesh& mesh
-)
+Foam::labelList Foam::AveragingMethods::Dual<Type>::sizing(const fvMesh& mesh)
 {
-    autoPtr<labelList> s(new labelList(2));
-    s()[0] = mesh.nCells();
-    s()[1] = mesh.nPoints();
-    return s;
+    labelList sizes(2);
+    sizes[0] = mesh.nCells();
+    sizes[1] = mesh.nPoints();
+    return sizes;
 }
 
 
@@ -51,9 +48,9 @@ Foam::AveragingMethods::Dual<Type>::Dual
     const fvMesh& mesh
 )
 :
-    AveragingMethod<Type>(io, dict, mesh, size(mesh)),
+    AveragingMethod<Type>(io, dict, mesh, sizing(mesh)),
     volumeCell_(mesh.V()),
-    volumeDual_(mesh.nPoints(), 0.0),
+    volumeDual_(mesh.nPoints(), Zero),
     dataCell_(FieldField<Field, Type>::operator[](0)),
     dataDual_(FieldField<Field, Type>::operator[](1))
 {
@@ -95,13 +92,6 @@ Foam::AveragingMethods::Dual<Type>::Dual
 {}
 
 
-// * * * * * * * * * * * * * * * * Destructor  * * * * * * * * * * * * * * * //
-
-template<class Type>
-Foam::AveragingMethods::Dual<Type>::~Dual()
-{}
-
-
 // * * * * * * * * * * * * * Private Member Functions  * * * * * * * * * * * //
 
 template<class Type>
@@ -132,7 +122,7 @@ void Foam::AveragingMethods::Dual<Type>::add
         coordinates[0]*value
       / (0.25*volumeCell_[tetIs.cell()]);
 
-    for(label i = 0; i < 3; i ++)
+    for (label i = 0; i < 3; ++i)
     {
         dataDual_[triIs[i]] +=
             coordinates[i+1]*value
diff --git a/src/lagrangian/intermediate/submodels/MPPIC/AveragingMethods/Dual/Dual.H b/src/lagrangian/intermediate/submodels/MPPIC/AveragingMethods/Dual/Dual.H
index 1850b0d9baa..b8837f85342 100644
--- a/src/lagrangian/intermediate/submodels/MPPIC/AveragingMethods/Dual/Dual.H
+++ b/src/lagrangian/intermediate/submodels/MPPIC/AveragingMethods/Dual/Dual.H
@@ -94,14 +94,12 @@ private:
         Field<Type>& dataDual_;
 
 
-    //- Private static member functions
+    //- Private Member Functions
 
-        //- Return the size of the FieldField parts
-        static autoPtr<labelList> size(const fvMesh &mesh);
+        //- The sizing for the FieldField parts
+        static labelList sizing(const fvMesh& mesh);
 
 
-    //- Private member functions
-
         //- Sync point data over processor boundaries
         void syncDualData();
 
@@ -119,7 +117,7 @@ public:
         (
             const IOobject& io,
             const dictionary& dict,
-            const fvMesh &mesh
+            const fvMesh& mesh
         );
 
         //- Construct a copy
@@ -136,7 +134,7 @@ public:
 
 
     //- Destructor
-    virtual ~Dual();
+    virtual ~Dual() = default;
 
 
     //- Member Functions
diff --git a/src/lagrangian/molecularDynamics/potential/pairPotential/pairPotentialList/pairPotentialListI.H b/src/lagrangian/molecularDynamics/potential/pairPotential/pairPotentialList/pairPotentialListI.H
index 04fb468871f..10e31dfd428 100644
--- a/src/lagrangian/molecularDynamics/potential/pairPotential/pairPotentialList/pairPotentialListI.H
+++ b/src/lagrangian/molecularDynamics/potential/pairPotential/pairPotentialList/pairPotentialListI.H
@@ -37,7 +37,6 @@ inline Foam::label Foam::pairPotentialList::pairPotentialIndex
     {
         index = a*(2*nIds_ - a - 1)/2 + b;
     }
-
     else
     {
         index = b*(2*nIds_ - b - 1)/2 + a;
@@ -72,7 +71,7 @@ inline Foam::scalar Foam::pairPotentialList::rCutMaxSqr() const
 
 inline const Foam::pairPotential& Foam::pairPotentialList::electrostatic() const
 {
-    return electrostaticPotential_;
+    return *electrostaticPotential_;
 }
 
 
diff --git a/src/lagrangian/spray/clouds/Templates/SprayCloud/SprayCloudI.H b/src/lagrangian/spray/clouds/Templates/SprayCloud/SprayCloudI.H
index 8ff701eea8d..077e50bf9d4 100644
--- a/src/lagrangian/spray/clouds/Templates/SprayCloud/SprayCloudI.H
+++ b/src/lagrangian/spray/clouds/Templates/SprayCloud/SprayCloudI.H
@@ -29,7 +29,7 @@ template<class CloudType>
 inline const Foam::SprayCloud<CloudType>&
 Foam::SprayCloud<CloudType>::cloudCopy() const
 {
-    return cloudCopyPtr_();
+    return *cloudCopyPtr_;
 }
 
 
@@ -45,7 +45,7 @@ template<class CloudType>
 inline Foam::AtomizationModel<Foam::SprayCloud<CloudType>>&
 Foam::SprayCloud<CloudType>::atomization()
 {
-    return atomizationModel_();
+    return *atomizationModel_;
 }
 
 
@@ -61,7 +61,7 @@ template<class CloudType>
 inline Foam::BreakupModel<Foam::SprayCloud<CloudType>>&
 Foam::SprayCloud<CloudType>::breakup()
 {
-    return breakupModel_();
+    return *breakupModel_;
 }
 
 
diff --git a/src/lumpedPointMotion/lumpedPointMovement.C b/src/lumpedPointMotion/lumpedPointMovement.C
index 21cd34dc33f..a1df8e61b46 100644
--- a/src/lumpedPointMotion/lumpedPointMovement.C
+++ b/src/lumpedPointMotion/lumpedPointMovement.C
@@ -787,7 +787,7 @@ Foam::lumpedPointMovement::interpolator() const
         );
     }
 
-    return interpolatorPtr_();
+    return *interpolatorPtr_;
 }
 
 
diff --git a/src/mesh/blockMesh/blockEdges/blockEdge/blockEdge.C b/src/mesh/blockMesh/blockEdges/blockEdge/blockEdge.C
index 04ea707fa81..1d48424208a 100644
--- a/src/mesh/blockMesh/blockEdges/blockEdge/blockEdge.C
+++ b/src/mesh/blockMesh/blockEdges/blockEdge/blockEdge.C
@@ -67,7 +67,7 @@ Foam::blockEdge::blockEdge
 Foam::autoPtr<Foam::blockEdge> Foam::blockEdge::clone() const
 {
     NotImplemented;
-    return autoPtr<blockEdge>(nullptr);
+    return autoPtr<blockEdge>();
 }
 
 
diff --git a/src/mesh/blockMesh/blockFaces/blockFace/blockFace.C b/src/mesh/blockMesh/blockFaces/blockFace/blockFace.C
index dd194b52c40..812fb52fb31 100644
--- a/src/mesh/blockMesh/blockFaces/blockFace/blockFace.C
+++ b/src/mesh/blockMesh/blockFaces/blockFace/blockFace.C
@@ -65,7 +65,7 @@ Foam::blockFace::blockFace
 Foam::autoPtr<Foam::blockFace> Foam::blockFace::clone() const
 {
     NotImplemented;
-    return autoPtr<blockFace>(nullptr);
+    return autoPtr<blockFace>();
 }
 
 
diff --git a/src/mesh/blockMesh/blockVertices/blockVertex/blockVertex.C b/src/mesh/blockMesh/blockVertices/blockVertex/blockVertex.C
index e40ff63751e..9dcf58c9b07 100644
--- a/src/mesh/blockMesh/blockVertices/blockVertex/blockVertex.C
+++ b/src/mesh/blockMesh/blockVertices/blockVertex/blockVertex.C
@@ -45,7 +45,7 @@ Foam::blockVertex::blockVertex()
 Foam::autoPtr<Foam::blockVertex> Foam::blockVertex::clone() const
 {
     NotImplemented;
-    return autoPtr<blockVertex>(nullptr);
+    return autoPtr<blockVertex>();
 }
 
 
@@ -99,7 +99,7 @@ Foam::autoPtr<Foam::blockVertex> Foam::blockVertex::New
             << firstToken.info()
             << exit(FatalIOError);
 
-        return autoPtr<blockVertex>(nullptr);
+        return autoPtr<blockVertex>();
     }
 }
 
diff --git a/src/mesh/blockMesh/blocks/block/block.H b/src/mesh/blockMesh/blocks/block/block.H
index fb3012016d5..b0941d3462e 100644
--- a/src/mesh/blockMesh/blocks/block/block.H
+++ b/src/mesh/blockMesh/blocks/block/block.H
@@ -134,7 +134,7 @@ public:
         autoPtr<block> clone() const
         {
             NotImplemented;
-            return autoPtr<block>(nullptr);
+            return autoPtr<block>();
         }
 
         //- New function which constructs and returns pointer to a block
diff --git a/src/mesh/snappyHexMesh/externalDisplacementMeshMover/displacementMeshMoverMotionSolver.C b/src/mesh/snappyHexMesh/externalDisplacementMeshMover/displacementMeshMoverMotionSolver.C
index 267ba41c122..7e40b1e95f5 100644
--- a/src/mesh/snappyHexMesh/externalDisplacementMeshMover/displacementMeshMoverMotionSolver.C
+++ b/src/mesh/snappyHexMesh/externalDisplacementMeshMover/displacementMeshMoverMotionSolver.C
@@ -79,7 +79,7 @@ Foam::displacementMeshMoverMotionSolver::meshMover() const
             pointDisplacement_
         );
     }
-    return meshMoverPtr_();
+    return *meshMoverPtr_;
 }
 
 
diff --git a/src/mesh/snappyHexMesh/externalDisplacementMeshMover/medialAxisMeshMover.C b/src/mesh/snappyHexMesh/externalDisplacementMeshMover/medialAxisMeshMover.C
index f68aa1d09af..d018e5703ee 100644
--- a/src/mesh/snappyHexMesh/externalDisplacementMeshMover/medialAxisMeshMover.C
+++ b/src/mesh/snappyHexMesh/externalDisplacementMeshMover/medialAxisMeshMover.C
@@ -1291,7 +1291,7 @@ void Foam::medialAxisMeshMover::calculateDisplacement
 {
     Info<< typeName << " : Smoothing using Medial Axis ..." << endl;
 
-    const indirectPrimitivePatch& pp = adaptPatchPtr_;
+    const indirectPrimitivePatch& pp = *adaptPatchPtr_;
     const labelList& meshPoints = pp.meshPoints();
 
 
@@ -1336,7 +1336,7 @@ void Foam::medialAxisMeshMover::calculateDisplacement
     );
 
     //- Use strict extrusionIsland detection
-    const Switch detectExtrusionIsland = coeffDict.lookupOrDefault<Switch>
+    const bool detectExtrusionIsland = coeffDict.lookupOrDefault
     (
         "detectExtrusionIsland",
         false
diff --git a/src/mesh/snappyHexMesh/meshRefinement/meshRefinement.C b/src/mesh/snappyHexMesh/meshRefinement/meshRefinement.C
index 5c9528786f7..84c895a95a8 100644
--- a/src/mesh/snappyHexMesh/meshRefinement/meshRefinement.C
+++ b/src/mesh/snappyHexMesh/meshRefinement/meshRefinement.C
@@ -672,15 +672,16 @@ Foam::autoPtr<Foam::mapPolyMesh> Foam::meshRefinement::doRemoveCells
     );
 
     // Change the mesh (no inflation)
-    autoPtr<mapPolyMesh> map = meshMod.changeMesh(mesh_, false, true);
+    autoPtr<mapPolyMesh> mapPtr = meshMod.changeMesh(mesh_, false, true);
+    mapPolyMesh& map = *mapPtr;
 
     // Update fields
     mesh_.updateMesh(map);
 
     // Move mesh (since morphing might not do this)
-    if (map().hasMotionPoints())
+    if (map.hasMotionPoints())
     {
-        mesh_.movePoints(map().preMotionPoints());
+        mesh_.movePoints(map.preMotionPoints());
     }
     else
     {
@@ -698,7 +699,7 @@ Foam::autoPtr<Foam::mapPolyMesh> Foam::meshRefinement::doRemoveCells
     // Update intersections. Recalculate intersections for exposed faces.
     labelList newExposedFaces = renumber
     (
-        map().reverseFaceMap(),
+        map.reverseFaceMap(),
         exposedFaces
     );
 
@@ -707,7 +708,7 @@ Foam::autoPtr<Foam::mapPolyMesh> Foam::meshRefinement::doRemoveCells
 
     updateMesh(map, newExposedFaces);
 
-    return map;
+    return mapPtr;
 }
 
 
@@ -863,15 +864,16 @@ Foam::label Foam::meshRefinement::splitFacesUndo
         doSplitFaces(splitFaces, splits, meshMod);
 
         // Change the mesh (no inflation)
-        autoPtr<mapPolyMesh> map = meshMod.changeMesh(mesh_, false, true);
+        autoPtr<mapPolyMesh> mapPtr = meshMod.changeMesh(mesh_, false, true);
+        mapPolyMesh& map = *mapPtr;
 
         // Update fields
         mesh_.updateMesh(map);
 
         // Move mesh (since morphing might not do this)
-        if (map().hasMotionPoints())
+        if (map.hasMotionPoints())
         {
-            mesh_.movePoints(map().preMotionPoints());
+            mesh_.movePoints(map.preMotionPoints());
         }
 
         // Reset the instance for if in overwrite mode
@@ -884,7 +886,7 @@ Foam::label Foam::meshRefinement::splitFacesUndo
 
         forAll(originalFaces, i)
         {
-            inplaceRenumber(map().reversePointMap(), originalFaces[i]);
+            inplaceRenumber(map.reversePointMap(), originalFaces[i]);
         }
 
         {
@@ -894,9 +896,9 @@ Foam::label Foam::meshRefinement::splitFacesUndo
                 splitFaceToIndex.insert(splitFaces[i], i);
             }
 
-            forAll(map().faceMap(), facei)
+            forAll(map.faceMap(), facei)
             {
-                label oldFacei = map().faceMap()[facei];
+                label oldFacei = map.faceMap()[facei];
                 Map<label>::iterator oldFaceFnd = splitFaceToIndex.find
                 (
                     oldFacei
@@ -930,13 +932,13 @@ Foam::label Foam::meshRefinement::splitFacesUndo
         {
             meshRefinement::updateList
             (
-                map().faceMap(),
+                map.faceMap(),
                 label(-1),
                 duplicateFace
             );
         }
 
-        const labelList& oldToNewFaces = map().reverseFaceMap();
+        const labelList& oldToNewFaces = map.reverseFaceMap();
         forAll(baffles, i)
         {
             labelPair& baffle = baffles[i];
@@ -1090,15 +1092,16 @@ Foam::label Foam::meshRefinement::splitFacesUndo
 
 
         // Change the mesh (no inflation)
-        autoPtr<mapPolyMesh> map = meshMod.changeMesh(mesh_, false, true);
+        autoPtr<mapPolyMesh> mapPtr = meshMod.changeMesh(mesh_, false, true);
+        mapPolyMesh& map = *mapPtr;
 
         // Update fields
         mesh_.updateMesh(map);
 
         // Move mesh (since morphing might not do this)
-        if (map().hasMotionPoints())
+        if (map.hasMotionPoints())
         {
-            mesh_.movePoints(map().preMotionPoints());
+            mesh_.movePoints(map.preMotionPoints());
         }
 
         // Reset the instance for if in overwrite mode
@@ -1110,8 +1113,8 @@ Foam::label Foam::meshRefinement::splitFacesUndo
         // ~~~~~~~~~~~~~~~~~~~~~~
 
         {
-            const labelList& oldToNewFaces = map().reverseFaceMap();
-            const labelList& oldToNewPoints = map().reversePointMap();
+            const labelList& oldToNewFaces = map.reverseFaceMap();
+            const labelList& oldToNewPoints = map.reversePointMap();
 
             // Compact out merged faces
             DynamicList<label> changedFaces(mergedIndices.size());
@@ -1171,13 +1174,13 @@ Foam::label Foam::meshRefinement::splitFacesUndo
             {
                 meshRefinement::updateList
                 (
-                    map().faceMap(),
+                    map.faceMap(),
                     label(-1),
                     duplicateFace
                 );
             }
 
-            const labelList& reverseFaceMap = map().reverseFaceMap();
+            const labelList& reverseFaceMap = map.reverseFaceMap();
             forAll(baffles, i)
             {
                 labelPair& baffle = baffles[i];
@@ -1478,14 +1481,13 @@ Foam::autoPtr<Foam::mapDistributePolyMesh> Foam::meshRefinement::balance
         map = distributor.distribute(distribution);
 
         // Update numbering of meshRefiner
-        distribute(map);
+        distribute(map());
 
         // Set correct instance (for if overwrite)
         mesh_.setInstance(timeName());
         setInstance(mesh_.facesInstance());
 
 
-
         if (debug && keepZoneFaces)
         {
             const faceZoneMesh& fZones = mesh_.faceZones();
diff --git a/src/mesh/snappyHexMesh/meshRefinement/meshRefinementBaffles.C b/src/mesh/snappyHexMesh/meshRefinement/meshRefinementBaffles.C
index 0d7a72c24f4..b0e31ebe7d8 100644
--- a/src/mesh/snappyHexMesh/meshRefinement/meshRefinementBaffles.C
+++ b/src/mesh/snappyHexMesh/meshRefinement/meshRefinementBaffles.C
@@ -584,19 +584,20 @@ Foam::autoPtr<Foam::mapPolyMesh> Foam::meshRefinement::createBaffles
     }
 
 
-    autoPtr<mapPolyMesh> map;
+    autoPtr<mapPolyMesh> mapPtr;
     if (returnReduce(nBaffles, sumOp<label>()))
     {
         // Change the mesh (no inflation, parallel sync)
-        map = meshMod.changeMesh(mesh_, false, true);
+        mapPtr = meshMod.changeMesh(mesh_, false, true);
+        mapPolyMesh& map = *mapPtr;
 
         // Update fields
         mesh_.updateMesh(map);
 
         // Move mesh if in inflation mode
-        if (map().hasMotionPoints())
+        if (map.hasMotionPoints())
         {
-            mesh_.movePoints(map().preMotionPoints());
+            mesh_.movePoints(map.preMotionPoints());
         }
         else
         {
@@ -612,8 +613,8 @@ Foam::autoPtr<Foam::mapPolyMesh> Foam::meshRefinement::createBaffles
         //  this changes also the cell centre positions.
         faceSet baffledFacesSet(mesh_, "baffledFacesSet", 2*nBaffles);
 
-        const labelList& reverseFaceMap = map().reverseFaceMap();
-        const labelList& faceMap = map().faceMap();
+        const labelList& reverseFaceMap = map.reverseFaceMap();
+        const labelList& faceMap = map.faceMap();
 
         // Pick up owner side of baffle
         forAll(ownPatch, oldFaceI)
@@ -650,7 +651,7 @@ Foam::autoPtr<Foam::mapPolyMesh> Foam::meshRefinement::createBaffles
         updateMesh(map, baffledFacesSet.toc());
     }
 
-    return map;
+    return mapPtr;
 }
 
 
@@ -1154,7 +1155,7 @@ Foam::autoPtr<Foam::mapPolyMesh> Foam::meshRefinement::mergeBaffles
     const Map<label>& faceToPatch
 )
 {
-    autoPtr<mapPolyMesh> map;
+    autoPtr<mapPolyMesh> mapPtr;
 
     if (returnReduce(couples.size()+faceToPatch.size(), sumOp<label>()))
     {
@@ -1280,15 +1281,16 @@ Foam::autoPtr<Foam::mapPolyMesh> Foam::meshRefinement::mergeBaffles
 
 
         // Change the mesh (no inflation)
-        map = meshMod.changeMesh(mesh_, false, true);
+        mapPtr = meshMod.changeMesh(mesh_, false, true);
+        mapPolyMesh& map = *mapPtr;
 
         // Update fields
         mesh_.updateMesh(map);
 
         // Move mesh (since morphing does not do this)
-        if (map().hasMotionPoints())
+        if (map.hasMotionPoints())
         {
-            mesh_.movePoints(map().preMotionPoints());
+            mesh_.movePoints(map.preMotionPoints());
         }
         else
         {
@@ -1307,13 +1309,13 @@ Foam::autoPtr<Foam::mapPolyMesh> Foam::meshRefinement::mergeBaffles
 
         forAll(couples, i)
         {
-            label newFace0 = map().reverseFaceMap()[couples[i].first()];
+            const label newFace0 = map.reverseFaceMap()[couples[i].first()];
             if (newFace0 != -1)
             {
                 newExposedFaces[newI++] = newFace0;
             }
 
-            label newFace1 = map().reverseFaceMap()[couples[i].second()];
+            const label newFace1 = map.reverseFaceMap()[couples[i].second()];
             if (newFace1 != -1)
             {
                 newExposedFaces[newI++] = newFace1;
@@ -1323,7 +1325,7 @@ Foam::autoPtr<Foam::mapPolyMesh> Foam::meshRefinement::mergeBaffles
         updateMesh(map, newExposedFaces);
     }
 
-    return map;
+    return mapPtr;
 }
 
 
@@ -4114,7 +4116,7 @@ Foam::autoPtr<Foam::mapPolyMesh> Foam::meshRefinement::dupNonManifoldPoints
         << ')' << endl;
 
 
-    autoPtr<mapPolyMesh> map;
+    autoPtr<mapPolyMesh> mapPtr;
 
     if (nNonManifPoints)
     {
@@ -4125,15 +4127,16 @@ Foam::autoPtr<Foam::mapPolyMesh> Foam::meshRefinement::dupNonManifoldPoints
         pointDuplicator.setRefinement(regionSide, meshMod);
 
         // Change the mesh (no inflation, parallel sync)
-        map = meshMod.changeMesh(mesh_, false, true);
+        mapPtr = meshMod.changeMesh(mesh_, false, true);
+        mapPolyMesh& map = *mapPtr;
 
         // Update fields
         mesh_.updateMesh(map);
 
         // Move mesh if in inflation mode
-        if (map().hasMotionPoints())
+        if (map.hasMotionPoints())
         {
-            mesh_.movePoints(map().preMotionPoints());
+            mesh_.movePoints(map.preMotionPoints());
         }
         else
         {
@@ -4146,10 +4149,10 @@ Foam::autoPtr<Foam::mapPolyMesh> Foam::meshRefinement::dupNonManifoldPoints
 
         // Update intersections. Is mapping only (no faces created, positions
         // stay same) so no need to recalculate intersections.
-        updateMesh(map, labelList(0));
+        updateMesh(map, labelList());
     }
 
-    return map;
+    return mapPtr;
 }
 
 
@@ -4177,7 +4180,7 @@ Foam::autoPtr<Foam::mapPolyMesh> Foam::meshRefinement::mergePoints
         }
     }
 
-    autoPtr<mapPolyMesh> map;
+    autoPtr<mapPolyMesh> mapPtr;
 
     if (returnReduce(nPointPairs, sumOp<label>()))
     {
@@ -4199,15 +4202,16 @@ Foam::autoPtr<Foam::mapPolyMesh> Foam::meshRefinement::mergePoints
         polyMeshAdder::mergePoints(mesh_, pointToMaster, meshMod);
 
         // Change the mesh (no inflation, parallel sync)
-        map = meshMod.changeMesh(mesh_, false, true);
+        mapPtr = meshMod.changeMesh(mesh_, false, true);
+        mapPolyMesh& map = *mapPtr;
 
         // Update fields
         mesh_.updateMesh(map);
 
         // Move mesh if in inflation mode
-        if (map().hasMotionPoints())
+        if (map.hasMotionPoints())
         {
-            mesh_.movePoints(map().preMotionPoints());
+            mesh_.movePoints(map.preMotionPoints());
         }
         else
         {
@@ -4220,10 +4224,10 @@ Foam::autoPtr<Foam::mapPolyMesh> Foam::meshRefinement::mergePoints
 
         // Update intersections. Is mapping only (no faces created, positions
         // stay same) so no need to recalculate intersections.
-        updateMesh(map, labelList(0));
+        updateMesh(map, labelList());
     }
 
-    return map;
+    return mapPtr;
 }
 
 
@@ -4764,7 +4768,7 @@ Foam::autoPtr<Foam::mapPolyMesh> Foam::meshRefinement::zonify
     autoPtr<mapPolyMesh> map = meshMod.changeMesh(mesh_, false, true);
 
     // Update fields
-    mesh_.updateMesh(map);
+    mesh_.updateMesh(map());
 
     // Move mesh if in inflation mode
     if (map().hasMotionPoints())
@@ -4807,7 +4811,7 @@ Foam::autoPtr<Foam::mapPolyMesh> Foam::meshRefinement::zonify
     }
 
     // None of the faces has changed, only the zones. Still...
-    updateMesh(map, labelList());
+    updateMesh(map(), labelList());
 
     return map;
 }
diff --git a/src/mesh/snappyHexMesh/meshRefinement/meshRefinementMerge.C b/src/mesh/snappyHexMesh/meshRefinement/meshRefinementMerge.C
index 3027ac71f12..aecae526748 100644
--- a/src/mesh/snappyHexMesh/meshRefinement/meshRefinementMerge.C
+++ b/src/mesh/snappyHexMesh/meshRefinement/meshRefinementMerge.C
@@ -106,15 +106,16 @@ Foam::label Foam::meshRefinement::mergePatchFaces
         faceCombiner.setRefinement(mergeSets, meshMod);
 
         // Change the mesh (no inflation)
-        autoPtr<mapPolyMesh> map = meshMod.changeMesh(mesh_, false, true);
+        autoPtr<mapPolyMesh> mapPtr = meshMod.changeMesh(mesh_, false, true);
+        mapPolyMesh& map = *mapPtr;
 
         // Update fields
         mesh_.updateMesh(map);
 
         // Move mesh (since morphing does not do this)
-        if (map().hasMotionPoints())
+        if (map.hasMotionPoints())
         {
-            mesh_.movePoints(map().preMotionPoints());
+            mesh_.movePoints(map.preMotionPoints());
         }
         else
         {
@@ -135,7 +136,7 @@ Foam::label Foam::meshRefinement::mergePatchFaces
         forAll(mergeSets, setI)
         {
             label oldMasterI = mergeSets[setI][0];
-            retestFaces.insert(map().reverseFaceMap()[oldMasterI]);
+            retestFaces.insert(map.reverseFaceMap()[oldMasterI]);
         }
         updateMesh(map, growFaceCellFace(retestFaces));
     }
@@ -143,8 +144,7 @@ Foam::label Foam::meshRefinement::mergePatchFaces
     return nFaceSets;
 }
 
-//
-//
+
 //// Remove points not used by any face or points used by only two faces where
 //// the edges are in line
 //Foam::autoPtr<Foam::mapPolyMesh> Foam::meshRefinement::mergeEdges
@@ -369,7 +369,7 @@ Foam::label Foam::meshRefinement::mergePatchFacesUndo
         autoPtr<mapPolyMesh> map = meshMod.changeMesh(mesh_, false, true);
 
         // Update fields
-        mesh_.updateMesh(map);
+        mesh_.updateMesh(map());
 
         // Move mesh (since morphing does not do this)
         if (map().hasMotionPoints())
@@ -385,7 +385,7 @@ Foam::label Foam::meshRefinement::mergePatchFacesUndo
         // Reset the instance for if in overwrite mode
         mesh_.setInstance(timeName());
 
-        faceCombiner.updateMesh(map);
+        faceCombiner.updateMesh(map());
 
         // Get the kept faces that need to be recalculated.
         // Merging two boundary faces might shift the cell centre
@@ -397,7 +397,7 @@ Foam::label Foam::meshRefinement::mergePatchFacesUndo
             label oldMasterI = allFaceSets[setI][0];
             retestFaces.insert(map().reverseFaceMap()[oldMasterI]);
         }
-        updateMesh(map, growFaceCellFace(retestFaces));
+        updateMesh(map(), growFaceCellFace(retestFaces));
 
         if (debug&meshRefinement::MESH)
         {
@@ -558,7 +558,7 @@ Foam::label Foam::meshRefinement::mergePatchFacesUndo
             autoPtr<mapPolyMesh> map = meshMod.changeMesh(mesh_, false, true);
 
             // Update fields
-            mesh_.updateMesh(map);
+            mesh_.updateMesh(map());
 
             // Move mesh (since morphing does not do this)
             if (map().hasMotionPoints())
@@ -575,7 +575,7 @@ Foam::label Foam::meshRefinement::mergePatchFacesUndo
             // Reset the instance for if in overwrite mode
             mesh_.setInstance(timeName());
 
-            faceCombiner.updateMesh(map);
+            faceCombiner.updateMesh(map());
 
             // Renumber restore maps
             inplaceMapKey(map().reversePointMap(), restoredPoints);
@@ -596,7 +596,7 @@ Foam::label Foam::meshRefinement::mergePatchFacesUndo
             // Experimental:restore all points/face/cells in maps
             updateMesh
             (
-                map,
+                map(),
                 growFaceCellFace(retestFaces),
                 restoredPoints,
                 restoredFaces,
@@ -640,15 +640,16 @@ Foam::autoPtr<Foam::mapPolyMesh> Foam::meshRefinement::doRemovePoints
     pointRemover.setRefinement(pointCanBeDeleted, meshMod);
 
     // Change the mesh (no inflation)
-    autoPtr<mapPolyMesh> map = meshMod.changeMesh(mesh_, false, true);
+    autoPtr<mapPolyMesh> mapPtr = meshMod.changeMesh(mesh_, false, true);
+    mapPolyMesh& map = *mapPtr;
 
     // Update fields
     mesh_.updateMesh(map);
 
     // Move mesh (since morphing does not do this)
-    if (map().hasMotionPoints())
+    if (map.hasMotionPoints())
     {
-        mesh_.movePoints(map().preMotionPoints());
+        mesh_.movePoints(map.preMotionPoints());
     }
     else
     {
@@ -681,7 +682,7 @@ Foam::autoPtr<Foam::mapPolyMesh> Foam::meshRefinement::doRemovePoints
         checkData();
     }
 
-    return map;
+    return mapPtr;
 }
 
 
@@ -713,15 +714,16 @@ Foam::autoPtr<Foam::mapPolyMesh> Foam::meshRefinement::doRestorePoints
     );
 
     // Change the mesh (no inflation)
-    autoPtr<mapPolyMesh> map = meshMod.changeMesh(mesh_, false, true);
+    autoPtr<mapPolyMesh> mapPtr = meshMod.changeMesh(mesh_, false, true);
+    mapPolyMesh& map = *mapPtr;
 
     // Update fields
     mesh_.updateMesh(map);
 
     // Move mesh (since morphing does not do this)
-    if (map().hasMotionPoints())
+    if (map.hasMotionPoints())
     {
-        mesh_.movePoints(map().preMotionPoints());
+        mesh_.movePoints(map.preMotionPoints());
     }
     else
     {
@@ -737,7 +739,7 @@ Foam::autoPtr<Foam::mapPolyMesh> Foam::meshRefinement::doRestorePoints
     labelHashSet retestFaces(2*facesToRestore.size());
     forAll(facesToRestore, i)
     {
-        label faceI = map().reverseFaceMap()[facesToRestore[i]];
+        label faceI = map.reverseFaceMap()[facesToRestore[i]];
         if (faceI >= 0)
         {
             retestFaces.insert(faceI);
@@ -753,7 +755,7 @@ Foam::autoPtr<Foam::mapPolyMesh> Foam::meshRefinement::doRestorePoints
         checkData();
     }
 
-    return map;
+    return mapPtr;
 }
 
 
diff --git a/src/mesh/snappyHexMesh/meshRefinement/meshRefinementRefine.C b/src/mesh/snappyHexMesh/meshRefinement/meshRefinementRefine.C
index e7f9994f869..f66627f01ed 100644
--- a/src/mesh/snappyHexMesh/meshRefinement/meshRefinementRefine.C
+++ b/src/mesh/snappyHexMesh/meshRefinement/meshRefinementRefine.C
@@ -2340,15 +2340,16 @@ Foam::autoPtr<Foam::mapPolyMesh> Foam::meshRefinement::refine
     meshCutter_.setRefinement(cellsToRefine, meshMod);
 
     // Create mesh (no inflation), return map from old to new mesh.
-    autoPtr<mapPolyMesh> map = meshMod.changeMesh(mesh_, false);
+    autoPtr<mapPolyMesh> mapPtr = meshMod.changeMesh(mesh_, false);
+    mapPolyMesh& map = *mapPtr;
 
     // Update fields
     mesh_.updateMesh(map);
 
     // Optionally inflate mesh
-    if (map().hasMotionPoints())
+    if (map.hasMotionPoints())
     {
-        mesh_.movePoints(map().preMotionPoints());
+        mesh_.movePoints(map.preMotionPoints());
     }
     else
     {
@@ -2362,7 +2363,7 @@ Foam::autoPtr<Foam::mapPolyMesh> Foam::meshRefinement::refine
     // Update intersection info
     updateMesh(map, getChangedFaces(map, cellsToRefine));
 
-    return map;
+    return mapPtr;
 }
 
 
diff --git a/src/mesh/snappyHexMesh/refinementFeatures/refinementFeatures.C b/src/mesh/snappyHexMesh/refinementFeatures/refinementFeatures.C
index aa05d3b8cba..8665ee4d381 100644
--- a/src/mesh/snappyHexMesh/refinementFeatures/refinementFeatures.C
+++ b/src/mesh/snappyHexMesh/refinementFeatures/refinementFeatures.C
@@ -423,7 +423,8 @@ Foam::refinementFeatures::regionEdgeTrees() const
             );
         }
     }
-    return regionEdgeTreesPtr_();
+
+    return *regionEdgeTreesPtr_;
 }
 
 
diff --git a/src/mesh/snappyHexMesh/snappyHexMeshDriver/snappyLayerDriver.C b/src/mesh/snappyHexMesh/snappyHexMeshDriver/snappyLayerDriver.C
index 7b4db14feca..41597249d93 100644
--- a/src/mesh/snappyHexMesh/snappyHexMeshDriver/snappyLayerDriver.C
+++ b/src/mesh/snappyHexMesh/snappyHexMeshDriver/snappyLayerDriver.C
@@ -3361,7 +3361,7 @@ void Foam::snappyLayerDriver::addLayers
             (
                 numLayers,              // per patch the num layers
                 patchIDs,               // patches that are being moved
-                pp,                     // indirectpatch for all faces moving
+                *pp,                    // indirectpatch for all faces moving
 
                 patchDisp,
                 patchNLayers,
@@ -3373,7 +3373,7 @@ void Foam::snappyLayerDriver::addLayers
             // of the patchDisp here.
             syncPatchDisplacement
             (
-                pp,
+                *pp,
                 scalarField(patchDisp.size(), 0.0), //minThickness,
                 patchDisp,
                 patchNLayers,
@@ -3555,7 +3555,7 @@ void Foam::snappyLayerDriver::addLayers
         (
             mesh,
             globalFaces,
-            pp
+            *pp
         )
     );
 
@@ -3570,7 +3570,7 @@ void Foam::snappyLayerDriver::addLayers
     (
         globalFaces,
         edgeGlobalFaces,
-        pp,
+        *pp,
 
         edgePatchID,
         edgeZoneID,
@@ -3605,7 +3605,7 @@ void Foam::snappyLayerDriver::addLayers
         (
             numLayers,                  // per patch the num layers
             patchIDs,                   // patches that are being moved
-            pp,                         // indirectpatch for all faces moving
+            *pp,                        // indirectpatch for all faces moving
 
             patchDisp,
             patchNLayers,
@@ -3622,7 +3622,7 @@ void Foam::snappyLayerDriver::addLayers
 
         handleNonStringConnected
         (
-            pp,
+            *pp,
             patchDisp,
             patchNLayers,
             extrudeStatus
@@ -3634,7 +3634,7 @@ void Foam::snappyLayerDriver::addLayers
 
         handleNonManifolds
         (
-            pp,
+            *pp,
             meshEdges,
             edgeGlobalFaces,
 
@@ -3648,7 +3648,7 @@ void Foam::snappyLayerDriver::addLayers
 
         handleFeatureAngle
         (
-            pp,
+            *pp,
             meshEdges,
             layerParams.featureAngle(),
 
@@ -3670,7 +3670,7 @@ void Foam::snappyLayerDriver::addLayers
 
             handleWarpedFaces
             (
-                pp,
+                *pp,
                 layerParams.maxFaceThicknessRatio(),
                 edge0Len,
                 cellLevel,
@@ -3686,7 +3686,7 @@ void Foam::snappyLayerDriver::addLayers
         //
         //handleMultiplePatchFaces
         //(
-        //    pp,
+        //    *pp,
         //
         //    patchDisp,
         //    patchNLayers,
@@ -3700,7 +3700,7 @@ void Foam::snappyLayerDriver::addLayers
         {
             growNoExtrusion
             (
-                pp,
+                *pp,
                 patchDisp,
                 patchNLayers,
                 extrudeStatus
@@ -3730,7 +3730,7 @@ void Foam::snappyLayerDriver::addLayers
     scalarField expansionRatio(pp().nPoints());
     calculateLayerThickness
     (
-        pp,
+        *pp,
         patchIDs,
         layerParams,
         cellLevel,
@@ -3754,8 +3754,8 @@ void Foam::snappyLayerDriver::addLayers
     // Per face wanted overall layer thickness
     scalarField faceWantedThickness(mesh.nFaces(), 0.0);
     {
-        UIndirectList<scalar>(faceWantedThickness, pp().addressing()) =
-            avgPointData(pp, thickness);
+        UIndirectList<scalar>(faceWantedThickness, pp->addressing()) =
+            avgPointData(*pp, thickness);
     }
 
 
@@ -3838,7 +3838,7 @@ void Foam::snappyLayerDriver::addLayers
             // that.
             syncPatchDisplacement
             (
-                pp,
+                *pp,
                 minThickness,
                 patchDisp,
                 patchNLayers,
@@ -3848,7 +3848,7 @@ void Foam::snappyLayerDriver::addLayers
             // Displacement acc. to pointnormals
             getPatchDisplacement
             (
-                pp,
+                *pp,
                 thickness,
                 minThickness,
                 patchDisp,
@@ -3872,7 +3872,7 @@ void Foam::snappyLayerDriver::addLayers
                 motionSmootherAlgo::setDisplacement
                 (
                     patchIDs,
-                    pp,
+                    *pp,
                     patchDisp,
                     displacement
                 );
@@ -3912,7 +3912,7 @@ void Foam::snappyLayerDriver::addLayers
             (
                 globalFaces,
                 edgeGlobalFaces,
-                pp,
+                *pp,
                 minThickness,
                 dummySet,
                 patchDisp,
@@ -3966,7 +3966,7 @@ void Foam::snappyLayerDriver::addLayers
             labelList nPatchFaceLayers(pp().size(), -1);
             setupLayerInfoTruncation
             (
-                pp,
+                *pp,
                 patchNLayers,
                 extrudeStatus,
                 layerParams.nBufferCellsNoExtrude(),
@@ -4027,7 +4027,7 @@ void Foam::snappyLayerDriver::addLayers
             // undo if neccesary.
 
             autoPtr<fvMesh> newMeshPtr;
-            autoPtr<mapPolyMesh> map = meshMod.makeMesh
+            autoPtr<mapPolyMesh> mapPtr = meshMod.makeMesh
             (
                 newMeshPtr,
                 IOobject
@@ -4042,7 +4042,8 @@ void Foam::snappyLayerDriver::addLayers
                 mesh,           // original mesh
                 true            // parallel sync
             );
-            fvMesh& newMesh = newMeshPtr();
+            fvMesh& newMesh = *newMeshPtr;
+            mapPolyMesh& map = *mapPtr;
 
             // Get timing, but more importantly get memory information
             addProfiling(grow, "snappyHexMesh::layers::updateMesh");
@@ -4067,7 +4068,7 @@ void Foam::snappyLayerDriver::addLayers
             (
                 newMesh,
                 addLayer,
-                avgPointData(pp, mag(patchDisp))(), // current thickness
+                avgPointData(*pp, mag(patchDisp))(), // current thickness
 
                 cellNLayers,
                 faceRealThickness
@@ -4113,7 +4114,7 @@ void Foam::snappyLayerDriver::addLayers
                     facei++
                 )
                 {
-                    label newMeshFacei = map().faceMap()[facei];
+                    label newMeshFacei = map.faceMap()[facei];
                     if (newMeshFacei != -1)
                     {
                         meshToNewMesh[newMeshFacei] = facei;
@@ -4164,7 +4165,7 @@ void Foam::snappyLayerDriver::addLayers
                 extrudeStatus
             );
 
-            label nTotExtruded = countExtrusion(pp, extrudeStatus);
+            label nTotExtruded = countExtrusion(*pp, extrudeStatus);
             label nTotFaces = returnReduce(pp().size(), sumOp<label>());
             label nTotAddedCells = returnReduce(nAddedCells, sumOp<label>());
 
@@ -4193,7 +4194,7 @@ void Foam::snappyLayerDriver::addLayers
             {
                 growNoExtrusion
                 (
-                    pp,
+                    *pp,
                     patchDisp,
                     patchNLayers,
                     extrudeStatus
@@ -4211,7 +4212,8 @@ void Foam::snappyLayerDriver::addLayers
 
     {
         // Apply the stored topo changes to the current mesh.
-        autoPtr<mapPolyMesh> map = savedMeshMod.changeMesh(mesh, false);
+        autoPtr<mapPolyMesh> mapPtr = savedMeshMod.changeMesh(mesh, false);
+        mapPolyMesh& map = *mapPtr;
 
         // Hack to remove meshPhi - mapped incorrectly. TBD.
         mesh.clearOut();
@@ -4220,9 +4222,9 @@ void Foam::snappyLayerDriver::addLayers
         mesh.updateMesh(map);
 
         // Move mesh (since morphing does not do this)
-        if (map().hasMotionPoints())
+        if (map.hasMotionPoints())
         {
-            mesh.movePoints(map().preMotionPoints());
+            mesh.movePoints(map.preMotionPoints());
         }
         else
         {
@@ -4238,7 +4240,7 @@ void Foam::snappyLayerDriver::addLayers
         // Update numbering of faceWantedThickness
         meshRefinement::updateList
         (
-            map().faceMap(),
+            map.faceMap(),
             scalar(0),
             faceWantedThickness
         );
@@ -4283,7 +4285,7 @@ void Foam::snappyLayerDriver::addLayers
             DynamicList<label> candidates(baffles.size()*4);
 
             // Mark whether old face was on baffle
-            PackedBoolList oldBaffleFace(map().nOldFaces());
+            PackedBoolList oldBaffleFace(map.nOldFaces());
             forAll(baffles, i)
             {
                 const labelPair& baffle = baffles[i];
@@ -4301,14 +4303,14 @@ void Foam::snappyLayerDriver::addLayers
                 facei++
             )
             {
-                label oldFacei = map().faceMap()[facei];
+                label oldFacei = map.faceMap()[facei];
                 if (oldFacei != -1 && oldBaffleFace[oldFacei])
                 {
                     const face& f = mesh.faces()[facei];
                     forAll(f, fp)
                     {
                         label pointi = f[fp];
-                        label oldPointi = map().pointMap()[pointi];
+                        label oldPointi = map.pointMap()[pointi];
 
                         if (pointToMaster[oldPointi] != -1)
                         {
diff --git a/src/meshTools/AMIInterpolation/AMIInterpolation/AMIInterpolationI.H b/src/meshTools/AMIInterpolation/AMIInterpolation/AMIInterpolationI.H
index 007085e244c..72556d3737f 100644
--- a/src/meshTools/AMIInterpolation/AMIInterpolation/AMIInterpolationI.H
+++ b/src/meshTools/AMIInterpolation/AMIInterpolation/AMIInterpolationI.H
@@ -116,7 +116,7 @@ template<class SourcePatch, class TargetPatch>
 inline const Foam::mapDistribute&
 Foam::AMIInterpolation<SourcePatch, TargetPatch>::srcMap() const
 {
-    return srcMapPtr_();
+    return *srcMapPtr_;
 }
 
 
@@ -188,7 +188,7 @@ template<class SourcePatch, class TargetPatch>
 inline const Foam::mapDistribute&
 Foam::AMIInterpolation<SourcePatch, TargetPatch>::tgtMap() const
 {
-    return tgtMapPtr_();
+    return *tgtMapPtr_;
 }
 
 
diff --git a/src/meshTools/AMIInterpolation/GAMG/interfaces/cyclicACMIGAMGInterface/cyclicACMIGAMGInterface.H b/src/meshTools/AMIInterpolation/GAMG/interfaces/cyclicACMIGAMGInterface/cyclicACMIGAMGInterface.H
index 08d9b114c1c..b430bf819ce 100644
--- a/src/meshTools/AMIInterpolation/GAMG/interfaces/cyclicACMIGAMGInterface/cyclicACMIGAMGInterface.H
+++ b/src/meshTools/AMIInterpolation/GAMG/interfaces/cyclicACMIGAMGInterface/cyclicACMIGAMGInterface.H
@@ -132,7 +132,7 @@ public:
 
             virtual const AMIPatchToPatchInterpolation& AMI() const
             {
-                return amiPtr_();
+                return *amiPtr_;
             }
 
             //- Return face transformation tensor
diff --git a/src/meshTools/AMIInterpolation/GAMG/interfaces/cyclicAMIGAMGInterface/cyclicAMIGAMGInterface.H b/src/meshTools/AMIInterpolation/GAMG/interfaces/cyclicAMIGAMGInterface/cyclicAMIGAMGInterface.H
index 6cc7600cac1..1e2d3241e23 100644
--- a/src/meshTools/AMIInterpolation/GAMG/interfaces/cyclicAMIGAMGInterface/cyclicAMIGAMGInterface.H
+++ b/src/meshTools/AMIInterpolation/GAMG/interfaces/cyclicAMIGAMGInterface/cyclicAMIGAMGInterface.H
@@ -132,7 +132,7 @@ public:
 
             virtual const AMIPatchToPatchInterpolation& AMI() const
             {
-                return amiPtr_();
+                return *amiPtr_;
             }
 
             //- Return face transformation tensor
diff --git a/src/meshTools/AMIInterpolation/patches/cyclicACMI/cyclicACMIPointPatchField/cyclicACMIPointPatchField.H b/src/meshTools/AMIInterpolation/patches/cyclicACMI/cyclicACMIPointPatchField/cyclicACMIPointPatchField.H
index 2c108b2451a..935a5411806 100644
--- a/src/meshTools/AMIInterpolation/patches/cyclicACMI/cyclicACMIPointPatchField/cyclicACMIPointPatchField.H
+++ b/src/meshTools/AMIInterpolation/patches/cyclicACMI/cyclicACMIPointPatchField/cyclicACMIPointPatchField.H
@@ -82,7 +82,7 @@ class cyclicACMIPointPatchField
                 );
             }
 
-            return ppiPtr_();
+            return *ppiPtr_;
         }
 
         //- Neighbour side patch interpolation
@@ -99,7 +99,7 @@ class cyclicACMIPointPatchField
                 );
             }
 
-            return nbrPpiPtr_();
+            return *nbrPpiPtr_;
         }
 
 
diff --git a/src/meshTools/AMIInterpolation/patches/cyclicAMI/cyclicAMIPointPatchField/cyclicAMIPointPatchField.H b/src/meshTools/AMIInterpolation/patches/cyclicAMI/cyclicAMIPointPatchField/cyclicAMIPointPatchField.H
index 64765e52f74..e508719bdd6 100644
--- a/src/meshTools/AMIInterpolation/patches/cyclicAMI/cyclicAMIPointPatchField/cyclicAMIPointPatchField.H
+++ b/src/meshTools/AMIInterpolation/patches/cyclicAMI/cyclicAMIPointPatchField/cyclicAMIPointPatchField.H
@@ -82,7 +82,7 @@ class cyclicAMIPointPatchField
                 );
             }
 
-            return ppiPtr_();
+            return *ppiPtr_;
         }
 
         //- Neighbour side patch interpolation
@@ -99,7 +99,7 @@ class cyclicAMIPointPatchField
                 );
             }
 
-            return nbrPpiPtr_();
+            return *nbrPpiPtr_;
         }
 
 
diff --git a/src/meshTools/AMIInterpolation/patches/cyclicAMI/cyclicAMIPolyPatch/cyclicAMIPolyPatch.C b/src/meshTools/AMIInterpolation/patches/cyclicAMI/cyclicAMIPolyPatch/cyclicAMIPolyPatch.C
index 12f9546fcab..76a80cfefc6 100644
--- a/src/meshTools/AMIInterpolation/patches/cyclicAMI/cyclicAMIPolyPatch/cyclicAMIPolyPatch.C
+++ b/src/meshTools/AMIInterpolation/patches/cyclicAMI/cyclicAMIPolyPatch/cyclicAMIPolyPatch.C
@@ -810,7 +810,7 @@ const Foam::AMIPatchToPatchInterpolation& Foam::cyclicAMIPolyPatch::AMI() const
         resetAMI(AMIMethod_);
     }
 
-    return AMIPtr_();
+    return *AMIPtr_;
 }
 
 
diff --git a/src/meshTools/coordinateSystems/coordinateRotation/cylindrical.C b/src/meshTools/coordinateSystems/coordinateRotation/cylindrical.C
index 481f15f71bf..de8b54f4024 100644
--- a/src/meshTools/coordinateSystems/coordinateRotation/cylindrical.C
+++ b/src/meshTools/coordinateSystems/coordinateRotation/cylindrical.C
@@ -94,7 +94,7 @@ void Foam::cylindrical::init
 
 Foam::cylindrical::cylindrical(const cylindrical& r)
 :
-    Rptr_(r.Rptr_, false),  // clone
+    Rptr_(r.Rptr_.clone()),
     origin_(r.origin_),
     e3_(r.e3_)
 {}
@@ -177,15 +177,11 @@ Foam::cylindrical::cylindrical
 }
 
 
-
 // * * * * * * * * * * * * * * Member Functions  * * * * * * * * * * * * * * //
 
 void Foam::cylindrical::clear()
 {
-    if (!Rptr_.empty())
-    {
-        Rptr_.clear();
-    }
+    Rptr_.clear();
 }
 
 
diff --git a/src/meshTools/coordinateSystems/coordinateRotation/cylindrical.H b/src/meshTools/coordinateSystems/coordinateRotation/cylindrical.H
index b8502d8aabf..bf2c57879b8 100644
--- a/src/meshTools/coordinateSystems/coordinateRotation/cylindrical.H
+++ b/src/meshTools/coordinateSystems/coordinateRotation/cylindrical.H
@@ -181,7 +181,7 @@ public:
 
         virtual const tensorField& Tr() const
         {
-            return Rptr_();
+            return *Rptr_;
         }
 
         //- Transform vectorField using transformation tensor field
diff --git a/src/meshTools/coordinateSystems/coordinateSystem.C b/src/meshTools/coordinateSystems/coordinateSystem.C
index b4a9e788200..cb638dd4530 100644
--- a/src/meshTools/coordinateSystems/coordinateSystem.C
+++ b/src/meshTools/coordinateSystems/coordinateSystem.C
@@ -3,7 +3,7 @@
   \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox
    \\    /   O peration     |
     \\  /    A nd           | Copyright (C) 2011-2016 OpenFOAM Foundation
-     \\/     M anipulation  |
+     \\/     M anipulation  | Copyright (C) 2018 OpenCFD Ltd.
 -------------------------------------------------------------------------------
 License
     This file is part of OpenFOAM.
@@ -48,6 +48,24 @@ Foam::coordinateSystem::coordinateSystem()
 {}
 
 
+Foam::coordinateSystem::coordinateSystem(const coordinateSystem& cs)
+:
+    name_(cs.name_),
+    note_(cs.note_),
+    origin_(cs.origin_),
+    R_(cs.R_.clone())
+{}
+
+
+Foam::coordinateSystem::coordinateSystem(coordinateSystem&& cs)
+:
+    name_(std::move(cs.name_)),
+    note_(std::move(cs.note_)),
+    origin_(std::move(cs.origin_)),
+    R_(std::move(cs.R_))
+{}
+
+
 Foam::coordinateSystem::coordinateSystem
 (
     const word& name,
@@ -55,9 +73,9 @@ Foam::coordinateSystem::coordinateSystem
 )
 :
     name_(name),
-    note_(),
+    note_(cs.note_),
     origin_(cs.origin_),
-    R_(cs.R().clone())
+    R_(cs.R_.clone())
 {}
 
 
@@ -176,12 +194,6 @@ Foam::coordinateSystem::coordinateSystem(Istream& is)
 }
 
 
-// * * * * * * * * * * * * * * * * Destructor  * * * * * * * * * * * * * * * //
-
-Foam::coordinateSystem::~coordinateSystem()
-{}
-
-
 // * * * * * * * * * * * * * * * Member Functions  * * * * * * * * * * * * * //
 
 Foam::dictionary Foam::coordinateSystem::dict(bool ignoreType) const
@@ -220,10 +232,8 @@ Foam::vector Foam::coordinateSystem::localToGlobal
     {
         return (R_->transform(local)) + origin_;
     }
-    else
-    {
-        return R_->transform(local);
-    }
+
+    return R_->transform(local);
 }
 
 
@@ -237,10 +247,8 @@ Foam::tmp<Foam::vectorField> Foam::coordinateSystem::localToGlobal
     {
         return (R_->transform(local)) + origin_;
     }
-    else
-    {
-        return R_->transform(local);
-    }
+
+    return R_->transform(local);
 }
 
 
@@ -254,10 +262,8 @@ Foam::vector Foam::coordinateSystem::globalToLocal
     {
         return R_->invTransform(global - origin_);
     }
-    else
-    {
-        return R_->invTransform(global);
-    }
+
+    return R_->invTransform(global);
 }
 
 
@@ -271,10 +277,8 @@ Foam::tmp<Foam::vectorField> Foam::coordinateSystem::globalToLocal
     {
         return R_->invTransform(global - origin_);
     }
-    else
-    {
-        return R_->invTransform(global);
-    }
+
+    return R_->invTransform(global);
 }
 
 
@@ -286,6 +290,17 @@ void Foam::coordinateSystem::clear()
 }
 
 
+void Foam::coordinateSystem::transfer(coordinateSystem& cs)
+{
+    name_ = std::move(cs.name_);
+    note_ = std::move(cs.note_);
+    origin_ = std::move(cs.origin_);
+    R_ = std::move(cs.R_);
+
+    cs.clear();
+}
+
+
 void Foam::coordinateSystem::write(Ostream& os) const
 {
     os  << type() << " origin: " << origin() << nl;
@@ -304,7 +319,7 @@ void Foam::coordinateSystem::writeDict(Ostream& os, bool subDict) const
 
     if (note_.size())
     {
-        // note is optional
+        // The 'note' is optional
         os.writeEntry("note", note_);
     }
 
@@ -320,12 +335,26 @@ void Foam::coordinateSystem::writeDict(Ostream& os, bool subDict) const
 
 // * * * * * * * * * * * * * * * Member Operators  * * * * * * * * * * * * * //
 
+void Foam::coordinateSystem::operator=(const coordinateSystem& cs)
+{
+    name_ = cs.name_;
+    note_ = cs.note_;
+    origin_ = cs.origin_;
+    R_ = cs.R_.clone();
+}
+
+void Foam::coordinateSystem::operator=(coordinateSystem&& cs)
+{
+    transfer(cs);
+}
+
+
 void Foam::coordinateSystem::init(const dictionary& rhs)
 {
     rhs.lookup("origin") >> origin_;
     note_.clear();
     rhs.readIfPresent("note", note_);
-    R_.reset(coordinateRotation::New(rhs.subDict("coordinateRotation")).ptr());
+    R_ = coordinateRotation::New(rhs.subDict("coordinateRotation"));
 }
 
 
@@ -347,14 +376,11 @@ void Foam::coordinateSystem::init
 
     rhs.lookup("origin") >> origin_;
 
-    // The note entry is optional
+    // The 'note' entry is optional
     note_.clear();
     rhs.readIfPresent("note", note_);
 
-    R_.reset
-    (
-        coordinateRotation::New(rhs.subDict("coordinateRotation"), obr).ptr()
-    );
+    R_ = coordinateRotation::New(rhs.subDict("coordinateRotation"), obr);
 }
 
 
@@ -365,8 +391,8 @@ bool Foam::operator!=(const coordinateSystem& a, const coordinateSystem& b)
     return
     (
         a.origin() != b.origin()
-     || a.R().R() != b.R().R()
      || a.type() != b.type()
+     || a.R().R() != b.R().R()
     );
 }
 
diff --git a/src/meshTools/coordinateSystems/coordinateSystem.H b/src/meshTools/coordinateSystems/coordinateSystem.H
index ee81ee365a8..4d148b08142 100644
--- a/src/meshTools/coordinateSystems/coordinateSystem.H
+++ b/src/meshTools/coordinateSystems/coordinateSystem.H
@@ -3,7 +3,7 @@
   \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox
    \\    /   O peration     |
     \\  /    A nd           | Copyright (C) 2011-2016 OpenFOAM Foundation
-     \\/     M anipulation  |
+     \\/     M anipulation  | Copyright (C) 2018 OpenCFD Ltd.
 -------------------------------------------------------------------------------
 License
     This file is part of OpenFOAM.
@@ -151,11 +151,17 @@ public:
         //- Construct null. This is equivalent to an identity coordinateSystem
         coordinateSystem();
 
-        //- Construct copy with a different name
+        //- Copy construct
+        coordinateSystem(const coordinateSystem& cs);
+
+        //- Move construct
+        coordinateSystem(coordinateSystem&& cs);
+
+        //- Copy construct with a different name
         coordinateSystem
         (
             const word& name,
-            const coordinateSystem&
+            const coordinateSystem& cs
         );
 
         //- Construct from origin and rotation
@@ -231,7 +237,7 @@ public:
 
 
     //- Destructor
-    virtual ~coordinateSystem();
+    virtual ~coordinateSystem() = default;
 
 
     // Member Functions
@@ -265,13 +271,13 @@ public:
             //- Return const reference to co-ordinate rotation
             const coordinateRotation& R() const
             {
-                return R_();
+                return *R_;
             }
 
             //- Return non const reference to co-ordinate rotation
             coordinateRotation& R()
             {
-                return R_();
+                return *R_;
             }
 
             //- Update and return the co-ordinate rotation for a list of cells
@@ -282,7 +288,7 @@ public:
             )
             {
                 R_->updateCells(mesh, cells);
-                return R_();
+                return *R_;
             }
 
             //- Return as dictionary of entries
@@ -309,6 +315,9 @@ public:
             //  Also resets the note
             virtual void clear();
 
+            //- Transfer contents from parameter
+            void transfer(coordinateSystem& cs);
+
 
         // Write
 
@@ -380,12 +389,19 @@ public:
 
     // Member Operators
 
+        //- Copy assignment
+        void operator=(const coordinateSystem& cs);
+
+        //- Move assignment
+        void operator=(coordinateSystem&& cs);
+
+
         // friend Operators
 
             friend bool operator!=
             (
-                const coordinateSystem&,
-                const coordinateSystem&
+                const coordinateSystem& a,
+                const coordinateSystem& b
             );
 
 
diff --git a/src/meshTools/edgeMesh/edgeMesh.C b/src/meshTools/edgeMesh/edgeMesh.C
index f91f5a1a817..801e53bb6f5 100644
--- a/src/meshTools/edgeMesh/edgeMesh.C
+++ b/src/meshTools/edgeMesh/edgeMesh.C
@@ -202,7 +202,7 @@ void Foam::edgeMesh::transfer(edgeMesh& mesh)
 {
     points_.transfer(mesh.points_);
     edges_.transfer(mesh.edges_);
-    pointEdgesPtr_ = mesh.pointEdgesPtr_;
+    pointEdgesPtr_ = std::move(mesh.pointEdgesPtr_);
 }
 
 
diff --git a/src/meshTools/edgeMesh/extendedEdgeMesh/extendedEdgeMesh.C b/src/meshTools/edgeMesh/extendedEdgeMesh/extendedEdgeMesh.C
index e27bdbabd46..114cf26f4cf 100644
--- a/src/meshTools/edgeMesh/extendedEdgeMesh/extendedEdgeMesh.C
+++ b/src/meshTools/edgeMesh/extendedEdgeMesh/extendedEdgeMesh.C
@@ -965,7 +965,7 @@ Foam::extendedEdgeMesh::pointTree() const
         );
     }
 
-    return pointTree_();
+    return *pointTree_;
 }
 
 
@@ -1007,7 +1007,7 @@ Foam::extendedEdgeMesh::edgeTree() const
         );
     }
 
-    return edgeTree_();
+    return *edgeTree_;
 }
 
 
@@ -1095,8 +1095,8 @@ void Foam::extendedEdgeMesh::transfer(extendedEdgeMesh& mesh)
     featurePointNormals_.transfer(mesh.featurePointNormals_);
     featurePointEdges_.transfer(mesh.featurePointEdges_);
     regionEdges_.transfer(mesh.regionEdges_);
-    pointTree_ = mesh.pointTree_;
-    edgeTree_ = mesh.edgeTree_;
+    pointTree_ = std::move(mesh.pointTree_);
+    edgeTree_ = std::move(mesh.edgeTree_);
     edgeTreesByType_.transfer(mesh.edgeTreesByType_);
 }
 
diff --git a/src/meshTools/mappedPatches/mappedPolyPatch/mappedPatchBaseI.H b/src/meshTools/mappedPatches/mappedPolyPatch/mappedPatchBaseI.H
index fc392dfaaf2..9a42db9dfa3 100644
--- a/src/meshTools/mappedPatches/mappedPolyPatch/mappedPatchBaseI.H
+++ b/src/meshTools/mappedPatches/mappedPolyPatch/mappedPatchBaseI.H
@@ -148,7 +148,7 @@ inline const Foam::mapDistribute& Foam::mappedPatchBase::map() const
         calcMapping();
     }
 
-    return mapPtr_();
+    return *mapPtr_;
 }
 
 
@@ -162,7 +162,7 @@ inline const Foam::AMIPatchToPatchInterpolation& Foam::mappedPatchBase::AMI
         calcAMI();
     }
 
-    return AMIPtr_();
+    return *AMIPtr_;
 }
 
 
diff --git a/src/meshTools/meshSearch/meshSearch.C b/src/meshTools/meshSearch/meshSearch.C
index c0e4cb2fa88..e49b2a76752 100644
--- a/src/meshTools/meshSearch/meshSearch.C
+++ b/src/meshTools/meshSearch/meshSearch.C
@@ -591,7 +591,7 @@ Foam::meshSearch::boundaryTree() const
         );
     }
 
-    return boundaryTreePtr_();
+    return *boundaryTreePtr_;
 }
 
 
@@ -637,7 +637,7 @@ Foam::meshSearch::cellTree() const
         );
     }
 
-    return cellTreePtr_();
+    return *cellTreePtr_;
 }
 
 
diff --git a/src/meshTools/regionCoupled/GAMG/interfaces/regionCoupledGAMGInterface/regionCoupledBaseGAMGInterface.H b/src/meshTools/regionCoupled/GAMG/interfaces/regionCoupledGAMGInterface/regionCoupledBaseGAMGInterface.H
index 4b850c645af..343d5520de6 100644
--- a/src/meshTools/regionCoupled/GAMG/interfaces/regionCoupledGAMGInterface/regionCoupledBaseGAMGInterface.H
+++ b/src/meshTools/regionCoupled/GAMG/interfaces/regionCoupledGAMGInterface/regionCoupledBaseGAMGInterface.H
@@ -130,7 +130,7 @@ public:
 
             //virtual const AMIPatchToPatchInterpolation& AMI() const
             //{
-            //    return amiPtr_();
+            //    return *amiPtr_;
             //}
 
             virtual const polyMesh& nbrMesh() const
diff --git a/src/meshTools/regionCoupled/patches/regionCoupledPolyPatch/regionCoupledBase.C b/src/meshTools/regionCoupled/patches/regionCoupledPolyPatch/regionCoupledBase.C
index 9defb4090bd..68260786e06 100644
--- a/src/meshTools/regionCoupled/patches/regionCoupledPolyPatch/regionCoupledBase.C
+++ b/src/meshTools/regionCoupled/patches/regionCoupledPolyPatch/regionCoupledBase.C
@@ -293,7 +293,7 @@ const Foam::AMIPatchToPatchInterpolation& Foam::regionCoupledBase::AMI() const
         resetAMI();
     }
 
-    return AMIPtr_();
+    return *AMIPtr_;
 }
 
 
diff --git a/src/meshTools/regionSplit/regionSplit.H b/src/meshTools/regionSplit/regionSplit.H
index 637a9593ec6..e24fe96ed42 100644
--- a/src/meshTools/regionSplit/regionSplit.H
+++ b/src/meshTools/regionSplit/regionSplit.H
@@ -189,7 +189,7 @@ public:
         //- Return global region numbering
         const globalIndex& globalNumbering() const
         {
-            return globalNumberingPtr_();
+            return *globalNumberingPtr_;
         }
 
         //- Return local number of regions
diff --git a/src/meshTools/searchableSurfaces/searchableSurface/searchableSurface.H b/src/meshTools/searchableSurfaces/searchableSurface/searchableSurface.H
index 8dd26867a01..9f67882eb8f 100644
--- a/src/meshTools/searchableSurfaces/searchableSurface/searchableSurface.H
+++ b/src/meshTools/searchableSurfaces/searchableSurface/searchableSurface.H
@@ -139,7 +139,7 @@ public:
         virtual autoPtr<searchableSurface> clone() const
         {
             NotImplemented;
-            return autoPtr<searchableSurface>(nullptr);
+            return autoPtr<searchableSurface>();
         }
 
 
diff --git a/src/meshTools/searchableSurfaces/triSurfaceMesh/triSurfaceMesh.C b/src/meshTools/searchableSurfaces/triSurfaceMesh/triSurfaceMesh.C
index 496b5c22dda..473fc1b9643 100644
--- a/src/meshTools/searchableSurfaces/triSurfaceMesh/triSurfaceMesh.C
+++ b/src/meshTools/searchableSurfaces/triSurfaceMesh/triSurfaceMesh.C
@@ -613,7 +613,8 @@ Foam::triSurfaceMesh::edgeTree() const
 
         indexedOctree<treeDataEdge>::perturbTol() = oldTol;
     }
-    return edgeTree_();
+
+    return *edgeTree_;
 }
 
 
diff --git a/src/meshTools/sets/topoSetSource/topoSetSource.H b/src/meshTools/sets/topoSetSource/topoSetSource.H
index 0957df277dc..293474c1ccb 100644
--- a/src/meshTools/sets/topoSetSource/topoSetSource.H
+++ b/src/meshTools/sets/topoSetSource/topoSetSource.H
@@ -243,7 +243,7 @@ public:
         autoPtr<topoSetSource> clone() const
         {
             NotImplemented;
-            return autoPtr<topoSetSource>(nullptr);
+            return autoPtr<topoSetSource>();
         }
 
 
diff --git a/src/meshTools/sets/topoSets/topoSet.H b/src/meshTools/sets/topoSets/topoSet.H
index adde26e085a..2fde875cece 100644
--- a/src/meshTools/sets/topoSets/topoSet.H
+++ b/src/meshTools/sets/topoSets/topoSet.H
@@ -254,7 +254,7 @@ public:
         autoPtr<topoSet> clone() const
         {
             NotImplemented;
-            return autoPtr<topoSet>(nullptr);
+            return autoPtr<topoSet>();
         }
 
 
diff --git a/src/meshTools/triSurface/triSurfaceSearch/triSurfaceSearch.C b/src/meshTools/triSurface/triSurfaceSearch/triSurfaceSearch.C
index fe699056547..4ef1974fe50 100644
--- a/src/meshTools/triSurface/triSurfaceSearch/triSurfaceSearch.C
+++ b/src/meshTools/triSurface/triSurfaceSearch/triSurfaceSearch.C
@@ -250,7 +250,7 @@ Foam::triSurfaceSearch::tree() const
         indexedOctree<treeDataTriSurface>::perturbTol() = oldTol;
     }
 
-    return treePtr_();
+    return *treePtr_;
 }
 
 
diff --git a/src/overset/dynamicOversetFvMesh/dynamicOversetFvMesh.C b/src/overset/dynamicOversetFvMesh/dynamicOversetFvMesh.C
index 526e813b6c6..6c7f8574d21 100644
--- a/src/overset/dynamicOversetFvMesh/dynamicOversetFvMesh.C
+++ b/src/overset/dynamicOversetFvMesh/dynamicOversetFvMesh.C
@@ -253,7 +253,7 @@ const Foam::lduAddressing& Foam::dynamicOversetFvMesh::lduAddr() const
         // Build extended addressing
         updateAddressing();
     }
-    return lduPtr_();
+    return *lduPtr_;
 }
 
 
@@ -266,7 +266,7 @@ Foam::dynamicOversetFvMesh::primitiveLduAddr() const
             << "Extended addressing not allocated" << abort(FatalError);
     }
 
-    return lduPtr_();
+    return *lduPtr_;
 }
 
 
diff --git a/src/overset/oversetPolyPatch/oversetGAMGInterface.H b/src/overset/oversetPolyPatch/oversetGAMGInterface.H
index 3f9105b612e..477368a2e61 100644
--- a/src/overset/oversetPolyPatch/oversetGAMGInterface.H
+++ b/src/overset/oversetPolyPatch/oversetGAMGInterface.H
@@ -152,7 +152,7 @@ public:
             //- Map for obtaining data in stencil order
             virtual const mapDistribute& cellInterpolationMap() const
             {
-                return mapPtr_();
+                return *mapPtr_;
             }
 
             //- Weights in stencil order
diff --git a/src/parallel/decompose/decompose/decompositionModel.H b/src/parallel/decompose/decompose/decompositionModel.H
index 2cbfa4d2496..9503bcf0781 100644
--- a/src/parallel/decompose/decompose/decompositionModel.H
+++ b/src/parallel/decompose/decompose/decompositionModel.H
@@ -123,7 +123,7 @@ public:
                         this->mesh().name()  // Name of mesh region
                     );
             }
-            return decomposerPtr_();
+            return *decomposerPtr_;
         }
 
         //- Helper: return IOobject with optionally absolute path provided
diff --git a/src/parallel/distributed/distributedTriSurfaceMesh/distributedTriSurfaceMesh.C b/src/parallel/distributed/distributedTriSurfaceMesh/distributedTriSurfaceMesh.C
index 0206840ef71..247082f5ee3 100644
--- a/src/parallel/distributed/distributedTriSurfaceMesh/distributedTriSurfaceMesh.C
+++ b/src/parallel/distributed/distributedTriSurfaceMesh/distributedTriSurfaceMesh.C
@@ -1473,7 +1473,7 @@ const Foam::globalIndex& Foam::distributedTriSurfaceMesh::globalTris() const
     {
         globalTris_.reset(new globalIndex(triSurface::size()));
     }
-    return globalTris_;
+    return *globalTris_;
 }
 
 
diff --git a/src/regionModels/pyrolysisModels/pyrolysisModel/pyrolysisModel.H b/src/regionModels/pyrolysisModels/pyrolysisModel/pyrolysisModel.H
index 9f3ee2a2892..daa2938e722 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>(nullptr);
+            return autoPtr<pyrolysisModel>();
         }
 
 
diff --git a/src/regionModels/regionModel/regionModel/regionModelI.H b/src/regionModels/regionModel/regionModel/regionModelI.H
index 471eb9e3769..b841f0165f6 100644
--- a/src/regionModels/regionModel/regionModel/regionModelI.H
+++ b/src/regionModels/regionModel/regionModel/regionModelI.H
@@ -70,7 +70,7 @@ inline const Foam::fvMesh& Foam::regionModels::regionModel::regionMesh() const
          << "Region mesh not available" << abort(FatalError);
     }
 
-    return regionMeshPtr_();
+    return *regionMeshPtr_;
 }
 
 
@@ -89,7 +89,7 @@ inline Foam::fvMesh& Foam::regionModels::regionModel::regionMesh()
          << "Region mesh not available" << abort(FatalError);
     }
 
-    return regionMeshPtr_();
+    return *regionMeshPtr_;
 }
 
 
@@ -116,7 +116,7 @@ Foam::regionModels::regionModel::outputProperties() const
             << abort(FatalError);
     }
 
-    return outputPropertiesPtr_();
+    return *outputPropertiesPtr_;
 }
 
 
@@ -130,7 +130,7 @@ Foam::regionModels::regionModel::outputProperties()
             << abort(FatalError);
     }
 
-    return outputPropertiesPtr_();
+    return *outputPropertiesPtr_;
 }
 
 
diff --git a/src/regionModels/regionModel/regionModel1D/regionModel1DI.H b/src/regionModels/regionModel/regionModel1D/regionModel1DI.H
index fcc918fb646..25b55701b41 100644
--- a/src/regionModels/regionModel/regionModel1D/regionModel1DI.H
+++ b/src/regionModels/regionModel/regionModel1D/regionModel1DI.H
@@ -57,7 +57,7 @@ Foam::regionModels::regionModel1D::nMagSf() const
          << "Face normal areas not available" << abort(FatalError);
     }
 
-    return nMagSfPtr_();
+    return *nMagSfPtr_;
 }
 
 
diff --git a/src/regionModels/regionModel/singleLayerRegion/singleLayerRegion.C b/src/regionModels/regionModel/singleLayerRegion/singleLayerRegion.C
index 0c3571ef307..1d687519340 100644
--- a/src/regionModels/regionModel/singleLayerRegion/singleLayerRegion.C
+++ b/src/regionModels/regionModel/singleLayerRegion/singleLayerRegion.C
@@ -213,7 +213,7 @@ const Foam::volVectorField& Foam::regionModels::singleLayerRegion::nHat() const
             << abort(FatalError);
     }
 
-    return nHatPtr_();
+    return *nHatPtr_;
 }
 
 
@@ -226,7 +226,7 @@ const Foam::volScalarField& Foam::regionModels::singleLayerRegion::magSf() const
             << abort(FatalError);
     }
 
-    return magSfPtr_();
+    return *magSfPtr_;
 }
 
 
diff --git a/src/regionModels/surfaceFilmModels/derivedFvPatchFields/inclinedFilmNusseltHeight/inclinedFilmNusseltHeightFvPatchScalarField.C b/src/regionModels/surfaceFilmModels/derivedFvPatchFields/inclinedFilmNusseltHeight/inclinedFilmNusseltHeightFvPatchScalarField.C
index c2f1c552a5b..15512eb9e12 100644
--- a/src/regionModels/surfaceFilmModels/derivedFvPatchFields/inclinedFilmNusseltHeight/inclinedFilmNusseltHeightFvPatchScalarField.C
+++ b/src/regionModels/surfaceFilmModels/derivedFvPatchFields/inclinedFilmNusseltHeight/inclinedFilmNusseltHeightFvPatchScalarField.C
@@ -56,9 +56,9 @@ inclinedFilmNusseltHeightFvPatchScalarField
 :
     fixedValueFvPatchScalarField(ptf, p, iF, mapper),
     filmRegionName_(ptf.filmRegionName_),
-    GammaMean_(ptf.GammaMean_, false),
-    a_(ptf.a_, false),
-    omega_(ptf.omega_, false)
+    GammaMean_(ptf.GammaMean_.clone()),
+    a_(ptf.a_.clone()),
+    omega_(ptf.omega_.clone())
 {}
 
 
@@ -89,9 +89,9 @@ inclinedFilmNusseltHeightFvPatchScalarField
 :
     fixedValueFvPatchScalarField(wmfrhpsf),
     filmRegionName_(wmfrhpsf.filmRegionName_),
-    GammaMean_(wmfrhpsf.GammaMean_, false),
-    a_(wmfrhpsf.a_, false),
-    omega_(wmfrhpsf.omega_, false)
+    GammaMean_(wmfrhpsf.GammaMean_.clone()),
+    a_(wmfrhpsf.a_.clone()),
+    omega_(wmfrhpsf.omega_.clone())
 {}
 
 
@@ -104,9 +104,9 @@ inclinedFilmNusseltHeightFvPatchScalarField
 :
     fixedValueFvPatchScalarField(wmfrhpsf, iF),
     filmRegionName_(wmfrhpsf.filmRegionName_),
-    GammaMean_(wmfrhpsf.GammaMean_, false),
-    a_(wmfrhpsf.a_, false),
-    omega_(wmfrhpsf.omega_, false)
+    GammaMean_(wmfrhpsf.GammaMean_.clone()),
+    a_(wmfrhpsf.a_.clone()),
+    omega_(wmfrhpsf.omega_.clone())
 {}
 
 
diff --git a/src/regionModels/surfaceFilmModels/derivedFvPatchFields/inclinedFilmNusseltInletVelocity/inclinedFilmNusseltInletVelocityFvPatchVectorField.C b/src/regionModels/surfaceFilmModels/derivedFvPatchFields/inclinedFilmNusseltInletVelocity/inclinedFilmNusseltInletVelocityFvPatchVectorField.C
index 084e4ad6dfd..6bbf834e4e9 100644
--- a/src/regionModels/surfaceFilmModels/derivedFvPatchFields/inclinedFilmNusseltInletVelocity/inclinedFilmNusseltInletVelocityFvPatchVectorField.C
+++ b/src/regionModels/surfaceFilmModels/derivedFvPatchFields/inclinedFilmNusseltInletVelocity/inclinedFilmNusseltInletVelocityFvPatchVectorField.C
@@ -56,9 +56,9 @@ inclinedFilmNusseltInletVelocityFvPatchVectorField
 :
     fixedValueFvPatchVectorField(ptf, p, iF, mapper),
     filmRegionName_(ptf.filmRegionName_),
-    GammaMean_(ptf.GammaMean_, false),
-    a_(ptf.a_, false),
-    omega_(ptf.omega_, false)
+    GammaMean_(ptf.GammaMean_.clone()),
+    a_(ptf.a_.clone()),
+    omega_(ptf.omega_.clone())
 {}
 
 
@@ -89,9 +89,9 @@ inclinedFilmNusseltInletVelocityFvPatchVectorField
 :
     fixedValueFvPatchVectorField(fmfrpvf),
     filmRegionName_(fmfrpvf.filmRegionName_),
-    GammaMean_(fmfrpvf.GammaMean_, false),
-    a_(fmfrpvf.a_, false),
-    omega_(fmfrpvf.omega_, false)
+    GammaMean_(fmfrpvf.GammaMean_.clone()),
+    a_(fmfrpvf.a_.clone()),
+    omega_(fmfrpvf.omega_.clone())
 {}
 
 
@@ -104,9 +104,9 @@ inclinedFilmNusseltInletVelocityFvPatchVectorField
 :
     fixedValueFvPatchVectorField(fmfrpvf, iF),
     filmRegionName_(fmfrpvf.filmRegionName_),
-    GammaMean_(fmfrpvf.GammaMean_, false),
-    a_(fmfrpvf.a_, false),
-    omega_(fmfrpvf.omega_, false)
+    GammaMean_(fmfrpvf.GammaMean_.clone()),
+    a_(fmfrpvf.a_.clone()),
+    omega_(fmfrpvf.omega_.clone())
 {}
 
 
diff --git a/src/regionModels/surfaceFilmModels/kinematicSingleLayer/kinematicSingleLayerI.H b/src/regionModels/surfaceFilmModels/kinematicSingleLayer/kinematicSingleLayerI.H
index 2619ccf1c6e..2a3983eb556 100644
--- a/src/regionModels/surfaceFilmModels/kinematicSingleLayer/kinematicSingleLayerI.H
+++ b/src/regionModels/surfaceFilmModels/kinematicSingleLayer/kinematicSingleLayerI.H
@@ -172,7 +172,7 @@ inline const volScalarField& kinematicSingleLayer::muPrimary() const
 
 inline const filmThermoModel& kinematicSingleLayer::filmThermo() const
 {
-    return filmThermo_();
+    return *filmThermo_;
 }
 
 
@@ -190,7 +190,7 @@ inline transferModelList& kinematicSingleLayer::transfer()
 
 inline const filmTurbulenceModel& kinematicSingleLayer::turbulence() const
 {
-    return turbulence_();
+    return *turbulence_;
 }
 
 
diff --git a/src/regionModels/surfaceFilmModels/thermoSingleLayer/thermoSingleLayerI.H b/src/regionModels/surfaceFilmModels/thermoSingleLayer/thermoSingleLayerI.H
index 5597b871822..c211c7ed928 100644
--- a/src/regionModels/surfaceFilmModels/thermoSingleLayer/thermoSingleLayerI.H
+++ b/src/regionModels/surfaceFilmModels/thermoSingleLayer/thermoSingleLayerI.H
@@ -133,25 +133,25 @@ inline const PtrList<volScalarField>& thermoSingleLayer::YPrimary() const
 
 inline const heatTransferModel& thermoSingleLayer::htcs() const
 {
-    return htcs_();
+    return *htcs_;
 }
 
 
 inline const heatTransferModel& thermoSingleLayer::htcw() const
 {
-    return htcw_();
+    return *htcw_;
 }
 
 
 inline const phaseChangeModel& thermoSingleLayer::phaseChange() const
 {
-    return phaseChange_();
+    return *phaseChange_;
 }
 
 
 inline const filmRadiationModel& thermoSingleLayer::radiation() const
 {
-    return radiation_();
+    return *radiation_;
 }
 
 
diff --git a/src/regionModels/thermalBaffleModels/thermalBaffle/thermalBaffle.C b/src/regionModels/thermalBaffleModels/thermalBaffle/thermalBaffle.C
index 61475876004..ec37bb8cf93 100644
--- a/src/regionModels/thermalBaffleModels/thermalBaffle/thermalBaffle.C
+++ b/src/regionModels/thermalBaffleModels/thermalBaffle/thermalBaffle.C
@@ -348,7 +348,7 @@ const volScalarField& thermalBaffle::T() const
 
 const solidThermo& thermalBaffle::thermo() const
 {
-    return thermo_;
+    return *thermo_;
 }
 
 
diff --git a/src/rigidBodyDynamics/bodies/compositeBody/compositeBodyI.H b/src/rigidBodyDynamics/bodies/compositeBody/compositeBodyI.H
index dee27aec8cd..fa9a444d8c2 100644
--- a/src/rigidBodyDynamics/bodies/compositeBody/compositeBodyI.H
+++ b/src/rigidBodyDynamics/bodies/compositeBody/compositeBodyI.H
@@ -39,7 +39,7 @@ inline Foam::RBD::compositeBody::compositeBody
 
 inline const Foam::RBD::rigidBody& Foam::RBD::compositeBody::body() const
 {
-    return body_();
+    return *body_;
 }
 
 
diff --git a/src/rigidBodyDynamics/bodies/subBody/subBodyI.H b/src/rigidBodyDynamics/bodies/subBody/subBodyI.H
index 767ffc96126..103330d58e9 100644
--- a/src/rigidBodyDynamics/bodies/subBody/subBodyI.H
+++ b/src/rigidBodyDynamics/bodies/subBody/subBodyI.H
@@ -50,7 +50,7 @@ inline Foam::autoPtr<Foam::RBD::subBody> Foam::RBD::subBody::clone() const
 
 inline const Foam::RBD::rigidBody& Foam::RBD::subBody::body() const
 {
-    return body_();
+    return *body_;
 }
 
 
diff --git a/src/rigidBodyDynamics/joints/floating/floatingJoint.C b/src/rigidBodyDynamics/joints/floating/floatingJoint.C
index 766e6504f69..909ccde0a12 100644
--- a/src/rigidBodyDynamics/joints/floating/floatingJoint.C
+++ b/src/rigidBodyDynamics/joints/floating/floatingJoint.C
@@ -54,8 +54,7 @@ namespace joints
 
 // * * * * * * * * * * * * Private Member Functions  * * * * * * * * * * * * //
 
-Foam::autoPtr<Foam::RBD::joints::composite>
-Foam::RBD::joints::floating::sixDoF()
+Foam::RBD::joints::composite Foam::RBD::joints::floating::sixDoF()
 {
     PtrList<joint> cj(2);
     cj.set(0, new joints::Pxyz());
@@ -67,7 +66,7 @@ Foam::RBD::joints::floating::sixDoF()
     // Alternatively the Euler-angle joint can be used
     cj.set(1, new joints::Rzyx());
 
-    return autoPtr<composite>(new composite(cj));
+    return composite(cj);
 }
 
 
@@ -81,7 +80,7 @@ Foam::RBD::joints::floating::floating()
 
 Foam::RBD::joints::floating::floating(const dictionary& dict)
 :
-    composite(sixDoF())
+    floating()
 {}
 
 
@@ -91,12 +90,6 @@ Foam::autoPtr<Foam::RBD::joint> Foam::RBD::joints::floating::clone() const
 }
 
 
-// * * * * * * * * * * * * * * * * Destructor  * * * * * * * * * * * * * * * //
-
-Foam::RBD::joints::floating::~floating()
-{}
-
-
 // * * * * * * * * * * * * * * Member Functions  * * * * * * * * * * * * * * //
 
 void Foam::RBD::joints::floating::write(Ostream& os) const
diff --git a/src/rigidBodyDynamics/joints/floating/floatingJoint.H b/src/rigidBodyDynamics/joints/floating/floatingJoint.H
index 78507775591..b1a7f745ab1 100644
--- a/src/rigidBodyDynamics/joints/floating/floatingJoint.H
+++ b/src/rigidBodyDynamics/joints/floating/floatingJoint.H
@@ -68,7 +68,7 @@ class floating
     // Private member functions
 
         //- Return a list of joints needed to emulate a floating body
-        static autoPtr<composite> sixDoF();
+        static composite sixDoF();
 
 
 public:
@@ -90,7 +90,7 @@ public:
 
 
     //- Destructor
-    virtual ~floating();
+    virtual ~floating() = default;
 
 
     // Member Functions
diff --git a/src/rigidBodyMeshMotion/rigidBodyMeshMotion/rigidBodyMeshMotion.C b/src/rigidBodyMeshMotion/rigidBodyMeshMotion/rigidBodyMeshMotion.C
index e6cb7c9f95f..3acf80c9164 100644
--- a/src/rigidBodyMeshMotion/rigidBodyMeshMotion/rigidBodyMeshMotion.C
+++ b/src/rigidBodyMeshMotion/rigidBodyMeshMotion/rigidBodyMeshMotion.C
@@ -130,7 +130,7 @@ Foam::rigidBodyMeshMotion::rigidBodyMeshMotion
     }
     else
     {
-        ramp_ = new Function1Types::OneConstant<scalar>("ramp");
+        ramp_.reset(new Function1Types::OneConstant<scalar>("ramp"));
     }
 
     const dictionary& bodiesDict = coeffDict().subDict("bodies");
diff --git a/src/sampling/sampledSet/sampledSet/sampledSet.H b/src/sampling/sampledSet/sampledSet/sampledSet.H
index 1f146c9a867..079ee5fe1ac 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>(nullptr);
+            return autoPtr<sampledSet>();
         }
 
 
diff --git a/src/sampling/sampledSurface/distanceSurface/distanceSurface.H b/src/sampling/sampledSurface/distanceSurface/distanceSurface.H
index 8a7a0507d75..138d9d49d67 100644
--- a/src/sampling/sampledSurface/distanceSurface/distanceSurface.H
+++ b/src/sampling/sampledSurface/distanceSurface/distanceSurface.H
@@ -209,12 +209,10 @@ public:
         {
             if (cell_)
             {
-                return isoSurfCellPtr_();
-            }
-            else
-            {
-                return isoSurfPtr_();
+                return *isoSurfCellPtr_;
             }
+
+            return *isoSurfPtr_;
         }
 
 
diff --git a/src/sampling/sampledSurface/isoSurface/sampledIsoSurface.H b/src/sampling/sampledSurface/isoSurface/sampledIsoSurface.H
index 1f7c2cb1bdc..97a2d5eb39b 100644
--- a/src/sampling/sampledSurface/isoSurface/sampledIsoSurface.H
+++ b/src/sampling/sampledSurface/isoSurface/sampledIsoSurface.H
@@ -157,7 +157,7 @@ public:
 
         const isoSurface& surface() const
         {
-            return surfPtr_();
+            return *surfPtr_;
         }
 
         //- Does the surface need an update?
diff --git a/src/sampling/sampledSurface/sampledCuttingPlane/sampledCuttingPlane.H b/src/sampling/sampledSurface/sampledCuttingPlane/sampledCuttingPlane.H
index 756ee7ba9da..1b868d2a6cb 100644
--- a/src/sampling/sampledSurface/sampledCuttingPlane/sampledCuttingPlane.H
+++ b/src/sampling/sampledSurface/sampledCuttingPlane/sampledCuttingPlane.H
@@ -141,7 +141,7 @@ public:
         //const isoSurfaceCell& surface() const
         const isoSurface& surface() const
         {
-            return isoSurfPtr_();
+            return *isoSurfPtr_;
         }
 
         //- Does the surface need an update?
diff --git a/src/sampling/sampledSurface/sampledSurface/sampledSurface.H b/src/sampling/sampledSurface/sampledSurface/sampledSurface.H
index f0148f8ca64..1080c96d5d1 100644
--- a/src/sampling/sampledSurface/sampledSurface/sampledSurface.H
+++ b/src/sampling/sampledSurface/sampledSurface/sampledSurface.H
@@ -205,7 +205,7 @@ public:
         autoPtr<sampledSurface> clone() const
         {
             NotImplemented;
-            return autoPtr<sampledSurface>(nullptr);
+            return autoPtr<sampledSurface>();
         }
 
 
diff --git a/src/sampling/sampledSurface/sampledTriSurfaceMesh/sampledTriSurfaceMesh.C b/src/sampling/sampledSurface/sampledTriSurfaceMesh/sampledTriSurfaceMesh.C
index 8c736658387..0421ee931d1 100644
--- a/src/sampling/sampledSurface/sampledTriSurfaceMesh/sampledTriSurfaceMesh.C
+++ b/src/sampling/sampledSurface/sampledTriSurfaceMesh/sampledTriSurfaceMesh.C
@@ -158,7 +158,7 @@ Foam::sampledTriSurfaceMesh::nonCoupledboundaryTree() const
         );
     }
 
-    return boundaryTreePtr_();
+    return *boundaryTreePtr_;
 }
 
 
diff --git a/src/sampling/surfMeshSampler/surfMeshSampler/surfMeshSampler.H b/src/sampling/surfMeshSampler/surfMeshSampler/surfMeshSampler.H
index c8edec3b692..a4f8d5c45fd 100644
--- a/src/sampling/surfMeshSampler/surfMeshSampler/surfMeshSampler.H
+++ b/src/sampling/surfMeshSampler/surfMeshSampler/surfMeshSampler.H
@@ -181,7 +181,7 @@ public:
         autoPtr<surfMeshSampler> clone() const
         {
             NotImplemented;
-            return autoPtr<surfMeshSampler>(nullptr);
+            return autoPtr<surfMeshSampler>();
         }
 
 
diff --git a/src/sampling/surface/triSurfaceMesh/discreteSurface.C b/src/sampling/surface/triSurfaceMesh/discreteSurface.C
index f41c323a6da..e04f2b8abda 100644
--- a/src/sampling/surface/triSurfaceMesh/discreteSurface.C
+++ b/src/sampling/surface/triSurfaceMesh/discreteSurface.C
@@ -152,7 +152,7 @@ Foam::discreteSurface::nonCoupledboundaryTree() const
         );
     }
 
-    return boundaryTreePtr_();
+    return *boundaryTreePtr_;
 }
 
 
diff --git a/src/sixDoFRigidBodyMotion/sixDoFRigidBodyMotion/sixDoFRigidBodyMotion.C b/src/sixDoFRigidBodyMotion/sixDoFRigidBodyMotion/sixDoFRigidBodyMotion.C
index 53b0d331464..8e51d68c7de 100644
--- a/src/sixDoFRigidBodyMotion/sixDoFRigidBodyMotion/sixDoFRigidBodyMotion.C
+++ b/src/sixDoFRigidBodyMotion/sixDoFRigidBodyMotion/sixDoFRigidBodyMotion.C
@@ -123,7 +123,7 @@ Foam::sixDoFRigidBodyMotion::sixDoFRigidBodyMotion
     momentOfInertia_(dict.lookup("momentOfInertia")),
     aRelax_(dict.lookupOrDefault<scalar>("accelerationRelaxation", 1.0)),
     aDamp_(dict.lookupOrDefault<scalar>("accelerationDamping", 1.0)),
-    report_(dict.lookupOrDefault<Switch>("report", false)),
+    report_(dict.lookupOrDefault("report", false)),
     solver_(sixDoFSolver::New(dict.subDict("solver"), *this))
 {
     addRestraints(dict);
@@ -171,14 +171,14 @@ Foam::sixDoFRigidBodyMotion::sixDoFRigidBodyMotion
     aRelax_(sDoFRBM.aRelax_),
     aDamp_(sDoFRBM.aDamp_),
     report_(sDoFRBM.report_),
-    solver_(sDoFRBM.solver_, false)
+    solver_(sDoFRBM.solver_.clone())
 {}
 
 
 // * * * * * * * * * * * * * * * * Destructor  * * * * * * * * * * * * * * * //
 
 Foam::sixDoFRigidBodyMotion::~sixDoFRigidBodyMotion()
-{}
+{} // Define here (incomplete type in header)
 
 
 // * * * * * * * * * * * * * * Member Functions  * * * * * * * * * * * * * * //
diff --git a/src/sixDoFRigidBodyMotion/sixDoFRigidBodyMotion/sixDoFRigidBodyMotion.H b/src/sixDoFRigidBodyMotion/sixDoFRigidBodyMotion/sixDoFRigidBodyMotion.H
index dc1e864eccc..1d5a1e99931 100644
--- a/src/sixDoFRigidBodyMotion/sixDoFRigidBodyMotion/sixDoFRigidBodyMotion.H
+++ b/src/sixDoFRigidBodyMotion/sixDoFRigidBodyMotion/sixDoFRigidBodyMotion.H
@@ -111,8 +111,8 @@ class sixDoFRigidBodyMotion
         //- Acceleration damping coefficient (for steady-state simulations)
         scalar aDamp_;
 
-        //- Switch to turn reporting of motion data on and off
-        Switch report_;
+        //- Reporting of motion data (on or off)
+        bool report_;
 
         //- Motion solver
         autoPtr<sixDoFSolver> solver_;
diff --git a/src/sixDoFRigidBodyState/sixDoFRigidBodyState.C b/src/sixDoFRigidBodyState/sixDoFRigidBodyState.C
index a77e0dc024d..7a88136a8e1 100644
--- a/src/sixDoFRigidBodyState/sixDoFRigidBodyState.C
+++ b/src/sixDoFRigidBodyState/sixDoFRigidBodyState.C
@@ -57,7 +57,6 @@ Foam::functionObjects::sixDoFRigidBodyState::angleTypeNames_
 };
 
 
-
 // * * * * * * * * * * * * Protected Member Functions  * * * * * * * * * * * //
 
 void Foam::functionObjects::sixDoFRigidBodyState::writeFileHeader(Ostream& os)
@@ -93,12 +92,6 @@ Foam::functionObjects::sixDoFRigidBodyState::sixDoFRigidBodyState
 }
 
 
-// * * * * * * * * * * * * * * * * Destructor  * * * * * * * * * * * * * * * //
-
-Foam::functionObjects::sixDoFRigidBodyState::~sixDoFRigidBodyState()
-{}
-
-
 // * * * * * * * * * * * * * * * Member Functions  * * * * * * * * * * * * * //
 
 bool Foam::functionObjects::sixDoFRigidBodyState::read(const dictionary& dict)
diff --git a/src/sixDoFRigidBodyState/sixDoFRigidBodyState.H b/src/sixDoFRigidBodyState/sixDoFRigidBodyState.H
index e35e14044a0..c260dbb4d04 100644
--- a/src/sixDoFRigidBodyState/sixDoFRigidBodyState.H
+++ b/src/sixDoFRigidBodyState/sixDoFRigidBodyState.H
@@ -129,7 +129,7 @@ public:
 
 
     //- Destructor
-    virtual ~sixDoFRigidBodyState();
+    virtual ~sixDoFRigidBodyState() = default;
 
 
     // Member Functions
diff --git a/src/surfMesh/surfZone/surfZone/surfZone.H b/src/surfMesh/surfZone/surfZone/surfZone.H
index 40a43486542..95685f11c24 100644
--- a/src/surfMesh/surfZone/surfZone/surfZone.H
+++ b/src/surfMesh/surfZone/surfZone/surfZone.H
@@ -115,7 +115,7 @@ public:
         autoPtr<surfZone> clone() const
         {
             NotImplemented;
-            return autoPtr<surfZone>(nullptr);
+            return autoPtr<surfZone>();
         }
 
         static autoPtr<surfZone> New(Istream& is)
diff --git a/src/thermophysicalModels/SLGThermo/SLGThermo/SLGThermo.C b/src/thermophysicalModels/SLGThermo/SLGThermo/SLGThermo.C
index b307c820c5d..9b32adcd51d 100644
--- a/src/thermophysicalModels/SLGThermo/SLGThermo/SLGThermo.C
+++ b/src/thermophysicalModels/SLGThermo/SLGThermo/SLGThermo.C
@@ -127,7 +127,7 @@ const Foam::liquidMixtureProperties& Foam::SLGThermo::liquids() const
             << abort(FatalError);
     }
 
-    return liquids_();
+    return *liquids_;
 }
 
 
@@ -140,7 +140,7 @@ const Foam::solidMixtureProperties& Foam::SLGThermo::solids() const
             << abort(FatalError);
     }
 
-    return solids_();
+    return *solids_;
 }
 
 
diff --git a/src/thermophysicalModels/chemistryModel/chemistryModel/psiChemistryModel/psiChemistryModelI.H b/src/thermophysicalModels/chemistryModel/chemistryModel/psiChemistryModel/psiChemistryModelI.H
index b34e0b10b32..511d1a906c7 100644
--- a/src/thermophysicalModels/chemistryModel/chemistryModel/psiChemistryModel/psiChemistryModelI.H
+++ b/src/thermophysicalModels/chemistryModel/chemistryModel/psiChemistryModel/psiChemistryModelI.H
@@ -27,13 +27,13 @@ License
 
 inline Foam::psiReactionThermo& Foam::psiChemistryModel::thermo()
 {
-    return thermo_();
+    return *thermo_;
 }
 
 
 inline const Foam::psiReactionThermo& Foam::psiChemistryModel::thermo() const
 {
-    return thermo_();
+    return *thermo_;
 }
 
 
diff --git a/src/thermophysicalModels/chemistryModel/chemistryModel/rhoChemistryModel/rhoChemistryModelI.H b/src/thermophysicalModels/chemistryModel/chemistryModel/rhoChemistryModel/rhoChemistryModelI.H
index 9664bd77466..9553c80d326 100644
--- a/src/thermophysicalModels/chemistryModel/chemistryModel/rhoChemistryModel/rhoChemistryModelI.H
+++ b/src/thermophysicalModels/chemistryModel/chemistryModel/rhoChemistryModel/rhoChemistryModelI.H
@@ -27,13 +27,13 @@ License
 
 inline Foam::rhoReactionThermo& Foam::rhoChemistryModel::thermo()
 {
-    return thermo_();
+    return *thermo_;
 }
 
 
 inline const Foam::rhoReactionThermo& Foam::rhoChemistryModel::thermo() const
 {
-    return thermo_();
+    return *thermo_;
 }
 
 
diff --git a/src/thermophysicalModels/radiation/radiationModels/fvDOM/fvDOM/fvDOM.C b/src/thermophysicalModels/radiation/radiationModels/fvDOM/fvDOM/fvDOM.C
index 3250cc66b00..fcd820e2521 100644
--- a/src/thermophysicalModels/radiation/radiationModels/fvDOM/fvDOM/fvDOM.C
+++ b/src/thermophysicalModels/radiation/radiationModels/fvDOM/fvDOM/fvDOM.C
@@ -75,7 +75,7 @@ void Foam::radiation::fvDOM::initialise()
                         deltaPhi,
                         deltaTheta,
                         nLambda_,
-                        absorptionEmission_,
+                        *absorptionEmission_,
                         blackBody_,
                         i
                     )
@@ -108,7 +108,7 @@ void Foam::radiation::fvDOM::initialise()
                     deltaPhi,
                     deltaTheta,
                     nLambda_,
-                    absorptionEmission_,
+                    *absorptionEmission_,
                     blackBody_,
                     i
                 )
@@ -140,7 +140,7 @@ void Foam::radiation::fvDOM::initialise()
                     deltaPhi,
                     deltaTheta,
                     nLambda_,
-                    absorptionEmission_,
+                    *absorptionEmission_,
                     blackBody_,
                     i
                 )
diff --git a/src/thermophysicalModels/radiation/radiationModels/radiationModel/radiationModel.C b/src/thermophysicalModels/radiation/radiationModels/radiationModel/radiationModel.C
index b8de0f96bcd..a3069566531 100644
--- a/src/thermophysicalModels/radiation/radiationModels/radiationModel/radiationModel.C
+++ b/src/thermophysicalModels/radiation/radiationModels/radiationModel/radiationModel.C
@@ -275,7 +275,7 @@ Foam::radiation::radiationModel::absorptionEmission() const
             << "not activate" << abort(FatalError);
     }
 
-    return absorptionEmission_();
+    return *absorptionEmission_;
 }
 
 
@@ -289,7 +289,7 @@ Foam::radiation::radiationModel::soot() const
             << "not activate" << abort(FatalError);
     }
 
-    return soot_();
+    return *soot_;
 }
 
 
@@ -303,7 +303,7 @@ Foam::radiation::radiationModel::transmissivity() const
             << "not activate" << abort(FatalError);
     }
 
-    return transmissivity_();
+    return *transmissivity_;
 }
 
 
diff --git a/src/thermophysicalModels/radiation/submodels/boundaryRadiationProperties/boundaryRadiationPropertiesPatch.C b/src/thermophysicalModels/radiation/submodels/boundaryRadiationProperties/boundaryRadiationPropertiesPatch.C
index 12569bda351..6d9ef2a18d1 100644
--- a/src/thermophysicalModels/radiation/submodels/boundaryRadiationProperties/boundaryRadiationPropertiesPatch.C
+++ b/src/thermophysicalModels/radiation/submodels/boundaryRadiationProperties/boundaryRadiationPropertiesPatch.C
@@ -131,14 +131,14 @@ Foam::radiation::boundaryRadiationPropertiesPatch::
 const Foam::radiation::absorptionEmissionModel&
 Foam::radiation::boundaryRadiationPropertiesPatch::absorptionEmission() const
 {
-    return absorptionEmission_();
+    return *absorptionEmission_;
 }
 
 
 const Foam::radiation::transmissivityModel&
 Foam::radiation::boundaryRadiationPropertiesPatch::transmissiveModel() const
 {
-    return transmissivity_();
+    return *transmissivity_;
 }
 
 
diff --git a/src/thermophysicalModels/radiation/submodels/solarCalculator/solarCalculator.H b/src/thermophysicalModels/radiation/submodels/solarCalculator/solarCalculator.H
index fb9b8eb6a76..4f99f59c92e 100644
--- a/src/thermophysicalModels/radiation/submodels/solarCalculator/solarCalculator.H
+++ b/src/thermophysicalModels/radiation/submodels/solarCalculator/solarCalculator.H
@@ -296,7 +296,7 @@ public:
             //- Return coordinateSystem
             const coordinateSystem& coord()
             {
-                return coord_();
+                return *coord_;
             }
 
             //- Return sunTrackingUpdateInterval
diff --git a/src/thermophysicalModels/solidChemistryModel/basicSolidChemistryModel/basicSolidChemistryModelI.H b/src/thermophysicalModels/solidChemistryModel/basicSolidChemistryModel/basicSolidChemistryModelI.H
index 48aa40841fb..d425477c04f 100644
--- a/src/thermophysicalModels/solidChemistryModel/basicSolidChemistryModel/basicSolidChemistryModelI.H
+++ b/src/thermophysicalModels/solidChemistryModel/basicSolidChemistryModel/basicSolidChemistryModelI.H
@@ -27,14 +27,14 @@ License
 
 inline Foam::solidReactionThermo& Foam::basicSolidChemistryModel::solidThermo()
 {
-    return solidThermo_();
+    return *solidThermo_;
 }
 
 
 inline const Foam::solidReactionThermo&
 Foam::basicSolidChemistryModel::solidThermo() const
 {
-    return solidThermo_();
+    return *solidThermo_;
 }
 
 
diff --git a/src/thermophysicalModels/thermophysicalProperties/thermophysicalPropertiesSelector/thermophysicalPropertiesSelectorI.H b/src/thermophysicalModels/thermophysicalProperties/thermophysicalPropertiesSelector/thermophysicalPropertiesSelectorI.H
index 16aa85ee1a6..dfe42cf57d6 100644
--- a/src/thermophysicalModels/thermophysicalProperties/thermophysicalPropertiesSelector/thermophysicalPropertiesSelectorI.H
+++ b/src/thermophysicalModels/thermophysicalProperties/thermophysicalPropertiesSelector/thermophysicalPropertiesSelectorI.H
@@ -30,7 +30,7 @@ inline const ThermophysicalProperties&
 Foam::thermophysicalPropertiesSelector<ThermophysicalProperties>
 ::properties() const
 {
-    return propertiesPtr_();
+    return *propertiesPtr_;
 }
 
 
diff --git a/src/thermophysicalModels/thermophysicalPropertiesFvPatchFields/liquidProperties/humidityTemperatureCoupledMixed/humidityTemperatureCoupledMixedFvPatchScalarField.C b/src/thermophysicalModels/thermophysicalPropertiesFvPatchFields/liquidProperties/humidityTemperatureCoupledMixed/humidityTemperatureCoupledMixedFvPatchScalarField.C
index 3f7bf842d0d..bfcf0d43684 100644
--- a/src/thermophysicalModels/thermophysicalPropertiesFvPatchFields/liquidProperties/humidityTemperatureCoupledMixed/humidityTemperatureCoupledMixedFvPatchScalarField.C
+++ b/src/thermophysicalModels/thermophysicalPropertiesFvPatchFields/liquidProperties/humidityTemperatureCoupledMixed/humidityTemperatureCoupledMixedFvPatchScalarField.C
@@ -183,7 +183,7 @@ humidityTemperatureCoupledMixedFvPatchScalarField
     qrNbrName_(psf.qrNbrName_),
     qrName_(psf.qrName_),
     specieName_(psf.specieName_),
-    liquid_(psf.liquid_, false),
+    liquid_(psf.liquid_.clone()),
     liquidDict_(psf.liquidDict_),
     mass_(psf.mass_, mapper),
     Tvap_(psf.Tvap_),
@@ -342,7 +342,7 @@ humidityTemperatureCoupledMixedFvPatchScalarField
     qrNbrName_(psf.qrNbrName_),
     qrName_(psf.qrName_),
     specieName_(psf.specieName_),
-    liquid_(psf.liquid_, false),
+    liquid_(psf.liquid_.clone()),
     liquidDict_(psf.liquidDict_),
     mass_(psf.mass_),
     Tvap_(psf.Tvap_),
diff --git a/src/topoChangerFvMesh/mixerFvMesh/mixerFvMesh.H b/src/topoChangerFvMesh/mixerFvMesh/mixerFvMesh.H
index f1552e29051..8f4136f3c0e 100644
--- a/src/topoChangerFvMesh/mixerFvMesh/mixerFvMesh.H
+++ b/src/topoChangerFvMesh/mixerFvMesh/mixerFvMesh.H
@@ -108,7 +108,7 @@ public:
         //- Return coordinate system
         const coordinateSystem& cs() const
         {
-            return csPtr_();
+            return *csPtr_;
         }
 
         //- Update the mesh for both mesh motion and topology change
diff --git a/src/transportModels/incompressible/incompressibleTwoPhaseMixture/incompressibleTwoPhaseMixture.H b/src/transportModels/incompressible/incompressibleTwoPhaseMixture/incompressibleTwoPhaseMixture.H
index 7821b2d9fb0..6b69e96c1bc 100644
--- a/src/transportModels/incompressible/incompressibleTwoPhaseMixture/incompressibleTwoPhaseMixture.H
+++ b/src/transportModels/incompressible/incompressibleTwoPhaseMixture/incompressibleTwoPhaseMixture.H
@@ -103,13 +103,13 @@ public:
         //- Return const-access to phase1 viscosityModel
         const viscosityModel& nuModel1() const
         {
-            return nuModel1_();
+            return *nuModel1_;
         }
 
         //- Return const-access to phase2 viscosityModel
         const viscosityModel& nuModel2() const
         {
-            return nuModel2_();
+            return *nuModel2_;
         }
 
         //- Return const-access to phase1 density
diff --git a/src/transportModels/twoPhaseProperties/alphaContactAngle/temperatureDependentAlphaContactAngle/temperatureDependentAlphaContactAngleFvPatchScalarField.C b/src/transportModels/twoPhaseProperties/alphaContactAngle/temperatureDependentAlphaContactAngle/temperatureDependentAlphaContactAngleFvPatchScalarField.C
index 8dfa30a477c..1c1714285f5 100644
--- a/src/transportModels/twoPhaseProperties/alphaContactAngle/temperatureDependentAlphaContactAngle/temperatureDependentAlphaContactAngleFvPatchScalarField.C
+++ b/src/transportModels/twoPhaseProperties/alphaContactAngle/temperatureDependentAlphaContactAngle/temperatureDependentAlphaContactAngleFvPatchScalarField.C
@@ -70,7 +70,7 @@ temperatureDependentAlphaContactAngleFvPatchScalarField
 :
     alphaContactAngleFvPatchScalarField(psf, p, iF, mapper),
     TName_(psf.TName_),
-    theta0_(psf.theta0_, false)
+    theta0_(psf.theta0_.clone())
 {}
 
 
@@ -82,7 +82,7 @@ temperatureDependentAlphaContactAngleFvPatchScalarField
 :
     alphaContactAngleFvPatchScalarField(psf),
     TName_(psf.TName_),
-    theta0_(psf.theta0_, false)
+    theta0_(psf.theta0_.clone())
 {}
 
 
@@ -95,7 +95,7 @@ temperatureDependentAlphaContactAngleFvPatchScalarField
 :
     alphaContactAngleFvPatchScalarField(psf, iF),
     TName_(psf.TName_),
-    theta0_(psf.theta0_, false)
+    theta0_(psf.theta0_.clone())
 {}
 
 
-- 
GitLab