diff --git a/applications/solvers/multiphase/compressibleMultiphaseInterFoam/multiphaseMixtureThermo/phaseModel/phaseModel.H b/applications/solvers/multiphase/compressibleMultiphaseInterFoam/multiphaseMixtureThermo/phaseModel/phaseModel.H index 44310e4df36408ae514b4c9cbaf7d82a05d5570f..253b7fb07abdcdb07e4906a387fbdc5b897be620 100644 --- a/applications/solvers/multiphase/compressibleMultiphaseInterFoam/multiphaseMixtureThermo/phaseModel/phaseModel.H +++ b/applications/solvers/multiphase/compressibleMultiphaseInterFoam/multiphaseMixtureThermo/phaseModel/phaseModel.H @@ -100,7 +100,7 @@ public: autoPtr<phaseModel> operator()(Istream& is) const { - return autoPtr<phaseModel>(new phaseModel(is, p_, T_)); + return autoPtr<phaseModel>::New(is, p_, T_); } }; diff --git a/applications/test/PtrList/Test-PtrList.C b/applications/test/PtrList/Test-PtrList.C index 043cfe5c37645f7cc80586b539cd7654d06db70b..2c21975835fcf3734a5bce89505c45a31f211f6d 100644 --- a/applications/test/PtrList/Test-PtrList.C +++ b/applications/test/PtrList/Test-PtrList.C @@ -60,7 +60,7 @@ public: autoPtr<Scalar> clone() const { - return autoPtr<Scalar>(new Scalar(data_)); + return autoPtr<Scalar>::New(data_); } friend Ostream& operator<<(Ostream& os, const Scalar& val) diff --git a/applications/utilities/mesh/generation/foamyMesh/conformalVoronoiMesh/cellShapeControl/smoothAlignmentSolver/smoothAlignmentSolver.C b/applications/utilities/mesh/generation/foamyMesh/conformalVoronoiMesh/cellShapeControl/smoothAlignmentSolver/smoothAlignmentSolver.C index 33abcb622c45a43e2d4f3367103fefba0f764fe1..676ef0ab61615c932f7fce9df4eabbb0d1fe5714 100644 --- a/applications/utilities/mesh/generation/foamyMesh/conformalVoronoiMesh/cellShapeControl/smoothAlignmentSolver/smoothAlignmentSolver.C +++ b/applications/utilities/mesh/generation/foamyMesh/conformalVoronoiMesh/cellShapeControl/smoothAlignmentSolver/smoothAlignmentSolver.C @@ -93,14 +93,11 @@ Foam::autoPtr<Foam::mapDistribute> Foam::smoothAlignmentSolver::buildReferredMap indices.transfer(dynIndices); List<Map<label>> compactMap; - return autoPtr<mapDistribute> + return autoPtr<mapDistribute>::New ( - new mapDistribute - ( - globalIndexing, - indices, - compactMap - ) + globalIndexing, + indices, + compactMap ); } @@ -157,14 +154,11 @@ Foam::autoPtr<Foam::mapDistribute> Foam::smoothAlignmentSolver::buildMap } List<Map<label>> compactMap; - return autoPtr<mapDistribute> + return autoPtr<mapDistribute>::New ( - new mapDistribute - ( - globalIndexing, - pointPoints, - compactMap - ) + globalIndexing, + pointPoints, + compactMap ); } diff --git a/applications/utilities/mesh/manipulation/renumberMesh/renumberMesh.C b/applications/utilities/mesh/manipulation/renumberMesh/renumberMesh.C index 6ddc7cda15eaf8cf34c36bf34ac78c930b4629aa..5f176118c45f2cb9307b37fdfecffc7f8169c49c 100644 --- a/applications/utilities/mesh/manipulation/renumberMesh/renumberMesh.C +++ b/applications/utilities/mesh/manipulation/renumberMesh/renumberMesh.C @@ -518,39 +518,36 @@ autoPtr<mapPolyMesh> reorderMesh } - return autoPtr<mapPolyMesh> + return autoPtr<mapPolyMesh>::New ( - new mapPolyMesh - ( - mesh, // const polyMesh& mesh, - mesh.nPoints(), // nOldPoints, - mesh.nFaces(), // nOldFaces, - mesh.nCells(), // nOldCells, - identity(mesh.nPoints()), // pointMap, - List<objectMap>(0), // pointsFromPoints, - faceOrder, // faceMap, - List<objectMap>(0), // facesFromPoints, - List<objectMap>(0), // facesFromEdges, - List<objectMap>(0), // facesFromFaces, - cellOrder, // cellMap, - List<objectMap>(0), // cellsFromPoints, - List<objectMap>(0), // cellsFromEdges, - List<objectMap>(0), // cellsFromFaces, - List<objectMap>(0), // cellsFromCells, - identity(mesh.nPoints()), // reversePointMap, - reverseFaceOrder, // reverseFaceMap, - reverseCellOrder, // reverseCellMap, - flipFaceFlux, // flipFaceFlux, - patchPointMap, // patchPointMap, - labelListList(0), // pointZoneMap, - labelListList(0), // faceZonePointMap, - labelListList(0), // faceZoneFaceMap, - labelListList(0), // cellZoneMap, - pointField(0), // preMotionPoints, - patchStarts, // oldPatchStarts, - oldPatchNMeshPoints, // oldPatchNMeshPoints - autoPtr<scalarField>() // oldCellVolumes - ) + mesh, // const polyMesh& mesh, + mesh.nPoints(), // nOldPoints, + mesh.nFaces(), // nOldFaces, + mesh.nCells(), // nOldCells, + identity(mesh.nPoints()), // pointMap, + List<objectMap>(), // pointsFromPoints, + faceOrder, // faceMap, + List<objectMap>(), // facesFromPoints, + List<objectMap>(), // facesFromEdges, + List<objectMap>(), // facesFromFaces, + cellOrder, // cellMap, + List<objectMap>(), // cellsFromPoints, + List<objectMap>(), // cellsFromEdges, + List<objectMap>(), // cellsFromFaces, + List<objectMap>(), // cellsFromCells, + identity(mesh.nPoints()), // reversePointMap, + reverseFaceOrder, // reverseFaceMap, + reverseCellOrder, // reverseCellMap, + flipFaceFlux, // flipFaceFlux, + patchPointMap, // patchPointMap, + labelListList(), // pointZoneMap, + labelListList(), // faceZonePointMap, + labelListList(), // faceZoneFaceMap, + labelListList(), // cellZoneMap, + pointField(), // preMotionPoints, + patchStarts, // oldPatchStarts, + oldPatchNMeshPoints, // oldPatchNMeshPoints + autoPtr<scalarField>() // oldCellVolumes ); } diff --git a/applications/utilities/parallelProcessing/reconstructParMesh/reconstructParMesh.C b/applications/utilities/parallelProcessing/reconstructParMesh/reconstructParMesh.C index 1842fd24902349e526a044f05f98f1db4ab54963..905d61f2d7d2c73dca899100938dc2a0987c1621 100644 --- a/applications/utilities/parallelProcessing/reconstructParMesh/reconstructParMesh.C +++ b/applications/utilities/parallelProcessing/reconstructParMesh/reconstructParMesh.C @@ -98,15 +98,12 @@ autoPtr<faceCoupleInfo> determineCoupledFaces { if (fullMatch || masterMesh.nCells() == 0) { - return autoPtr<faceCoupleInfo> + return autoPtr<faceCoupleInfo>::New ( - new faceCoupleInfo - ( - masterMesh, - meshToAdd, - mergeDist, // Absolute merging distance - true // Matching faces identical - ) + masterMesh, + meshToAdd, + mergeDist, // Absolute merging distance + true // Matching faces identical ); } else @@ -215,20 +212,17 @@ autoPtr<faceCoupleInfo> determineCoupledFaces } addFaces.shrink(); - return autoPtr<faceCoupleInfo> + return autoPtr<faceCoupleInfo>::New ( - new faceCoupleInfo - ( - masterMesh, - masterFaces, - meshToAdd, - addFaces, - mergeDist, // Absolute merging distance - true, // Matching faces identical? - false, // If perfect match are faces already ordered - // (e.g. processor patches) - false // are faces each on separate patch? - ) + masterMesh, + masterFaces, + meshToAdd, + addFaces, + mergeDist, // Absolute merging distance + true, // Matching faces identical? + false, // If perfect match are faces already ordered + // (e.g. processor patches) + false // are faces each on separate patch? ); } } diff --git a/applications/utilities/postProcessing/lagrangian/steadyParticleTracks/steadyParticleTracksTemplates.C b/applications/utilities/postProcessing/lagrangian/steadyParticleTracks/steadyParticleTracksTemplates.C index f54b9b04a4a20a15918af14437168ae8a88d034a..18e10d75be9fef9af6315cf12224baefb4fdaded 100644 --- a/applications/utilities/postProcessing/lagrangian/steadyParticleTracks/steadyParticleTracksTemplates.C +++ b/applications/utilities/postProcessing/lagrangian/steadyParticleTracks/steadyParticleTracksTemplates.C @@ -49,7 +49,7 @@ Foam::tmp<Foam::Field<Type>> Foam::readParticleField if (obj != nullptr) { IOField<Type> newField(*obj); - return tmp<Field<Type>>(new Field<Type>(newField.xfer())); + return tmp<Field<Type>>::New(newField.xfer()); } FatalErrorInFunction diff --git a/applications/utilities/postProcessing/lumped/lumpedPointForces/lumpedPointForces.C b/applications/utilities/postProcessing/lumped/lumpedPointForces/lumpedPointForces.C index 95f2e85d22fb91eefea95a3b47591bde5ddac107..c45dce76aecd5a177f68ba27911e772affb276c3 100644 --- a/applications/utilities/postProcessing/lumped/lumpedPointForces/lumpedPointForces.C +++ b/applications/utilities/postProcessing/lumped/lumpedPointForces/lumpedPointForces.C @@ -55,22 +55,19 @@ autoPtr<GeoFieldType> loadField Info<< "Reading " << GeoFieldType::typeName << ' ' << io->name() << endl; - return autoPtr<GeoFieldType> + return autoPtr<GeoFieldType>::New ( - new GeoFieldType + IOobject ( - IOobject - ( - io->name(), - io->instance(), - io->local(), - io->db(), - IOobject::MUST_READ, - IOobject::AUTO_WRITE, - io->registerObject() - ), - mesh - ) + io->name(), + io->instance(), + io->local(), + io->db(), + IOobject::MUST_READ, + IOobject::AUTO_WRITE, + io->registerObject() + ), + mesh ); } diff --git a/applications/utilities/preProcessing/applyBoundaryLayer/applyBoundaryLayer.C b/applications/utilities/preProcessing/applyBoundaryLayer/applyBoundaryLayer.C index 4355608576e7ac62c5d1f2d87d05bf3bf6f9309b..4f63381fbe5740d80fed72ce9956ee3dedf941ec 100644 --- a/applications/utilities/preProcessing/applyBoundaryLayer/applyBoundaryLayer.C +++ b/applications/utilities/preProcessing/applyBoundaryLayer/applyBoundaryLayer.C @@ -244,7 +244,7 @@ tmp<volScalarField> calcNut // Correct nut turbulence->validate(); - return tmp<volScalarField>(new volScalarField(turbulence->nut())); + return tmp<volScalarField>::New(turbulence->nut()); } else { @@ -264,7 +264,7 @@ tmp<volScalarField> calcNut // Correct nut turbulence->validate(); - return tmp<volScalarField>(new volScalarField(turbulence->nut())); + return tmp<volScalarField>::New(turbulence->nut()); } } diff --git a/applications/utilities/preProcessing/setFields/setFields.C b/applications/utilities/preProcessing/setFields/setFields.C index 0510d50bb9066a93178704aa95ea71806d67d73c..f7578ee9de09e655e6edef6ebaca7227f7edab8f 100644 --- a/applications/utilities/preProcessing/setFields/setFields.C +++ b/applications/utilities/preProcessing/setFields/setFields.C @@ -141,7 +141,7 @@ public: autoPtr<setCellField> clone() const { - return autoPtr<setCellField>(new setCellField()); + return autoPtr<setCellField>::New(); } class iNew @@ -182,7 +182,7 @@ public: << endl; } - return autoPtr<setCellField>(new setCellField()); + return autoPtr<setCellField>::New(); } }; }; @@ -332,7 +332,7 @@ public: autoPtr<setFaceField> clone() const { - return autoPtr<setFaceField>(new setFaceField()); + return autoPtr<setFaceField>::New(); } class iNew @@ -373,7 +373,7 @@ public: << endl; } - return autoPtr<setFaceField>(new setFaceField()); + return autoPtr<setFaceField>::New(); } }; }; diff --git a/applications/utilities/surface/surfaceBooleanFeatures/surfaceBooleanFeatures.C b/applications/utilities/surface/surfaceBooleanFeatures/surfaceBooleanFeatures.C index 939895cb0ff89219d2f42be392718f1b52e0a5cf..4449929a20c8112bf88931f39566db6dc54d0834 100644 --- a/applications/utilities/surface/surfaceBooleanFeatures/surfaceBooleanFeatures.C +++ b/applications/utilities/surface/surfaceBooleanFeatures/surfaceBooleanFeatures.C @@ -1480,33 +1480,30 @@ autoPtr<extendedFeatureEdgeMesh> createEdgeMesh //calcFeaturePoints(inter.cutPoints(), inter.cutEdges()); - return autoPtr<extendedFeatureEdgeMesh> + return autoPtr<extendedFeatureEdgeMesh>::New ( - new extendedFeatureEdgeMesh - ( - io, - inter.cutPoints(), - inter.cutEdges(), - - 0, // concaveStart, - 0, // mixedStart, - 0, // nonFeatureStart, - - internalStart, // internalStart, - nIntOrExt, // flatStart, - nIntOrExt + nFlat, // openStart, - nIntOrExt + nFlat + nOpen, // multipleStart, - - normalsTmp, - normalVolumeTypesTmp, - edgeDirections, - normalDirectionsTmp, - edgeNormalsTmp, - - labelListList(0), // featurePointNormals, - labelListList(0), // featurePointEdges, - labelList(0) // regionEdges - ) + io, + inter.cutPoints(), + inter.cutEdges(), + + 0, // concaveStart, + 0, // mixedStart, + 0, // nonFeatureStart, + + internalStart, // internalStart, + nIntOrExt, // flatStart, + nIntOrExt + nFlat, // openStart, + nIntOrExt + nFlat + nOpen, // multipleStart, + + normalsTmp, + normalVolumeTypesTmp, + edgeDirections, + normalDirectionsTmp, + edgeNormalsTmp, + + labelListList(), // featurePointNormals, + labelListList(), // featurePointEdges, + labelList() // regionEdges ); } diff --git a/applications/utilities/surface/surfaceFeatureExtract/extractionMethod/extractFromFile.C b/applications/utilities/surface/surfaceFeatureExtract/extractionMethod/extractFromFile.C index 5dd577420fc18f6c462d500dd86f17518423ab9d..7cb51d0ccf1d70d7d50ad75c90266637ddf5dbcf 100644 --- a/applications/utilities/surface/surfaceFeatureExtract/extractionMethod/extractFromFile.C +++ b/applications/utilities/surface/surfaceFeatureExtract/extractionMethod/extractFromFile.C @@ -86,16 +86,13 @@ Foam::surfaceFeaturesExtraction::extractFromFile::features << "Selecting edges based purely on geometric tests: " << geometricTestOnly().c_str() << endl; - return autoPtr<surfaceFeatures> + return autoPtr<surfaceFeatures>::New ( - new surfaceFeatures - ( - surf, - eMesh.points(), - eMesh.edges(), - 1e-6, // mergeTol - geometricTestOnly() - ) + surf, + eMesh.points(), + eMesh.edges(), + 1e-6, // mergeTol + geometricTestOnly() ); } diff --git a/applications/utilities/surface/surfaceFeatureExtract/extractionMethod/extractFromNone.C b/applications/utilities/surface/surfaceFeatureExtract/extractionMethod/extractFromNone.C index 45061472c462af117a88ff10e10bfe7466299b2d..032f6763063c29507b47fba50bc43a6689ece2a7 100644 --- a/applications/utilities/surface/surfaceFeatureExtract/extractionMethod/extractFromNone.C +++ b/applications/utilities/surface/surfaceFeatureExtract/extractionMethod/extractFromNone.C @@ -73,7 +73,7 @@ Foam::surfaceFeaturesExtraction::extractFromNone::features const triSurface& surf ) const { - return autoPtr<surfaceFeatures>(new surfaceFeatures(surf)); + return autoPtr<surfaceFeatures>::New(surf); } diff --git a/applications/utilities/surface/surfaceFeatureExtract/extractionMethod/extractFromSurface.C b/applications/utilities/surface/surfaceFeatureExtract/extractionMethod/extractFromSurface.C index f5a0354b623f7d6b1dd7a18a392ab7a1037fc0d4..6635a95a3e4dcd04db067b1b809ca3aa1ff5978d 100644 --- a/applications/utilities/surface/surfaceFeatureExtract/extractionMethod/extractFromSurface.C +++ b/applications/utilities/surface/surfaceFeatureExtract/extractionMethod/extractFromSurface.C @@ -80,16 +80,13 @@ Foam::surfaceFeaturesExtraction::extractFromSurface::features << "Selecting edges based purely on geometric tests: " << geometricTestOnly().c_str() << endl; - return autoPtr<surfaceFeatures> + return autoPtr<surfaceFeatures>::New ( - new surfaceFeatures - ( - surf, - includedAngle(), - 0, // minLen - 0, // minElems - geometricTestOnly() - ) + surf, + includedAngle(), + 0, // minLen + 0, // minElems + geometricTestOnly() ); } diff --git a/src/OpenFOAM/algorithms/dynamicIndexedOctree/dynamicIndexedOctree.H b/src/OpenFOAM/algorithms/dynamicIndexedOctree/dynamicIndexedOctree.H index c76391fe06da997a4230ed655f920ef83bf38f0f..3b4705320eeb709cca8040f232bb982cb2149050 100644 --- a/src/OpenFOAM/algorithms/dynamicIndexedOctree/dynamicIndexedOctree.H +++ b/src/OpenFOAM/algorithms/dynamicIndexedOctree/dynamicIndexedOctree.H @@ -418,10 +418,7 @@ public: //- Clone autoPtr<dynamicIndexedOctree<Type>> clone() const { - return autoPtr<dynamicIndexedOctree<Type>> - ( - new dynamicIndexedOctree<Type>(*this) - ); + return autoPtr<dynamicIndexedOctree<Type>>::New(*this); } diff --git a/src/OpenFOAM/algorithms/indexedOctree/indexedOctree.H b/src/OpenFOAM/algorithms/indexedOctree/indexedOctree.H index 1d4c7d844f46b7079f4b64b724865749ce1448f7..762c0a4548d3925ddd9edf08e731e3d34b0d8667 100644 --- a/src/OpenFOAM/algorithms/indexedOctree/indexedOctree.H +++ b/src/OpenFOAM/algorithms/indexedOctree/indexedOctree.H @@ -432,10 +432,7 @@ public: //- Clone autoPtr<indexedOctree<Type>> clone() const { - return autoPtr<indexedOctree<Type>> - ( - new indexedOctree<Type>(*this) - ); + return autoPtr<indexedOctree<Type>>::New(*this); } // Member Functions diff --git a/src/OpenFOAM/containers/Lists/CompactListList/CompactListListI.H b/src/OpenFOAM/containers/Lists/CompactListList/CompactListListI.H index 65ae222f6e6933c11f93a7c69b50586a4f53351c..3f3cc4b622c32ca35ef2b8994dd5d1413a1a5586 100644 --- a/src/OpenFOAM/containers/Lists/CompactListList/CompactListListI.H +++ b/src/OpenFOAM/containers/Lists/CompactListList/CompactListListI.H @@ -101,10 +101,7 @@ template<class T, class Container> inline Foam::autoPtr<Foam::CompactListList<T, Container>> Foam::CompactListList<T, Container>::clone() const { - return autoPtr<CompactListList<T, Container>> - ( - new CompactListList<T, Container>(*this) - ); + return autoPtr<CompactListList<T, Container>>::New(*this); } diff --git a/src/OpenFOAM/containers/Lists/FixedList/FixedListI.H b/src/OpenFOAM/containers/Lists/FixedList/FixedListI.H index 385765aade39532b9a19c975643339bafc8780bf..db4d46fffc6e79d45a8eb52f03b6f05d67b7db09 100644 --- a/src/OpenFOAM/containers/Lists/FixedList/FixedListI.H +++ b/src/OpenFOAM/containers/Lists/FixedList/FixedListI.H @@ -135,7 +135,7 @@ template<class T, unsigned Size> inline Foam::autoPtr<Foam::FixedList<T, Size>> Foam::FixedList<T, Size>::clone() const { - return autoPtr<FixedList<T, Size>>(new FixedList<T, Size>(*this)); + return autoPtr<FixedList<T, Size>>::New(*this); } diff --git a/src/OpenFOAM/containers/Lists/List/ListI.H b/src/OpenFOAM/containers/Lists/List/ListI.H index 742500554d64fc16c0efc833bde9df5b55551143..46e24e1d73019c0b0b82b15f8d891f2f6cdfb0ca 100644 --- a/src/OpenFOAM/containers/Lists/List/ListI.H +++ b/src/OpenFOAM/containers/Lists/List/ListI.H @@ -95,7 +95,7 @@ inline constexpr Foam::List<T>::List() noexcept template<class T> inline Foam::autoPtr<Foam::List<T>> Foam::List<T>::clone() const { - return autoPtr<List<T>>(new List<T>(*this)); + return autoPtr<List<T>>::New(*this); } diff --git a/src/OpenFOAM/containers/Lists/PackedList/PackedBoolListI.H b/src/OpenFOAM/containers/Lists/PackedList/PackedBoolListI.H index bd596dbf2bce8e3d3d5fe2719ef6d431634a6430..c1d4e7156f12b8db65a25851672094157f88cdbd 100644 --- a/src/OpenFOAM/containers/Lists/PackedList/PackedBoolListI.H +++ b/src/OpenFOAM/containers/Lists/PackedList/PackedBoolListI.H @@ -125,7 +125,7 @@ inline Foam::PackedBoolList::PackedBoolList inline Foam::autoPtr<Foam::PackedBoolList> Foam::PackedBoolList::clone() const { - return autoPtr<PackedBoolList>(new PackedBoolList(*this)); + return autoPtr<PackedBoolList>::New(*this); } diff --git a/src/OpenFOAM/containers/Lists/PackedList/PackedListI.H b/src/OpenFOAM/containers/Lists/PackedList/PackedListI.H index 9696290f925ceff51c96ed3fa02d4c1c62fbd138..9a3e0a8a4194973618598db2cf6e4e0a900c6dbc 100644 --- a/src/OpenFOAM/containers/Lists/PackedList/PackedListI.H +++ b/src/OpenFOAM/containers/Lists/PackedList/PackedListI.H @@ -267,7 +267,7 @@ template<unsigned nBits> inline Foam::autoPtr<Foam::PackedList<nBits>> Foam::PackedList<nBits>::clone() const { - return autoPtr<PackedList<nBits>>(new PackedList<nBits>(*this)); + return autoPtr<PackedList<nBits>>::New(*this); } diff --git a/src/OpenFOAM/db/IOobject/IOobject.H b/src/OpenFOAM/db/IOobject/IOobject.H index c520fbd890917ceb590e64c15a1fdc651a2f4c98..e25d715b9bf60f2234e048b61a9c7333cd51096c 100644 --- a/src/OpenFOAM/db/IOobject/IOobject.H +++ b/src/OpenFOAM/db/IOobject/IOobject.H @@ -279,13 +279,13 @@ public: //- Clone autoPtr<IOobject> clone() const { - return autoPtr<IOobject>(new IOobject(*this)); + return autoPtr<IOobject>::New(*this); } //- Clone resetting registry autoPtr<IOobject> clone(const objectRegistry& registry) const { - return autoPtr<IOobject>(new IOobject(*this, registry)); + return autoPtr<IOobject>::New(*this, registry); } diff --git a/src/OpenFOAM/db/dictionary/dictionary.C b/src/OpenFOAM/db/dictionary/dictionary.C index d015a464678cf37d9b6dc7630684f6795b7f9059..a5a926df25015717f12f10d785d2acf735b608f5 100644 --- a/src/OpenFOAM/db/dictionary/dictionary.C +++ b/src/OpenFOAM/db/dictionary/dictionary.C @@ -150,7 +150,7 @@ Foam::dictionary::dictionary Foam::autoPtr<Foam::dictionary> Foam::dictionary::clone() const { - return autoPtr<dictionary>(new dictionary(*this)); + return autoPtr<dictionary>::New(*this); } diff --git a/src/OpenFOAM/db/dictionary/dictionaryIO.C b/src/OpenFOAM/db/dictionary/dictionaryIO.C index d608b74e6893bd94ad23b8cba0fd2ae2fa58d9f9..2453f3760b5d474447e77c5109e978e3ce9b01b9 100644 --- a/src/OpenFOAM/db/dictionary/dictionaryIO.C +++ b/src/OpenFOAM/db/dictionary/dictionaryIO.C @@ -71,7 +71,7 @@ Foam::dictionary::dictionary(Istream& is, bool keepHeader) Foam::autoPtr<Foam::dictionary> Foam::dictionary::New(Istream& is) { - return autoPtr<dictionary>(new dictionary(is)); + return autoPtr<dictionary>::New(is); } diff --git a/src/OpenFOAM/dimensionSet/dimensionSet.H b/src/OpenFOAM/dimensionSet/dimensionSet.H index ca18178fee6b04e8f1b5bc4e82cac279a675bce0..fa078273823ff82b2d92110c6d2659fa64b90467 100644 --- a/src/OpenFOAM/dimensionSet/dimensionSet.H +++ b/src/OpenFOAM/dimensionSet/dimensionSet.H @@ -250,7 +250,7 @@ public: //- Construct and return a clone autoPtr<dimensionSet> clone() const { - return autoPtr<dimensionSet>(new dimensionSet(*this)); + return autoPtr<dimensionSet>::New(*this); } //- Construct from Istream diff --git a/src/OpenFOAM/fields/FieldFields/FieldField/FieldField.C b/src/OpenFOAM/fields/FieldFields/FieldField/FieldField.C index 48610c8f97c4727fad5038aead84dda776997649..17a9ce9170b1dae5395db536f4add132b8f523a3 100644 --- a/src/OpenFOAM/fields/FieldFields/FieldField/FieldField.C +++ b/src/OpenFOAM/fields/FieldFields/FieldField/FieldField.C @@ -177,7 +177,7 @@ FieldField<Field, Type>::FieldField(Istream& is) template<template<class> class Field, class Type> tmp<FieldField<Field, Type>> FieldField<Field, Type>::clone() const { - return tmp<FieldField<Field, Type>>(new FieldField<Field, Type>(*this)); + return tmp<FieldField<Field, Type>>::New(*this); } diff --git a/src/OpenFOAM/fields/Fields/Field/Field.C b/src/OpenFOAM/fields/Fields/Field/Field.C index 321fdb10292f85f997b6ee9a1dd40927109262bc..1cb7cacf839d92aca69d98f61a82caa526c486ef 100644 --- a/src/OpenFOAM/fields/Fields/Field/Field.C +++ b/src/OpenFOAM/fields/Fields/Field/Field.C @@ -348,7 +348,7 @@ Foam::Field<Type>::Field template<class Type> Foam::tmp<Foam::Field<Type>> Foam::Field<Type>::clone() const { - return tmp<Field<Type>>(new Field<Type>(*this)); + return tmp<Field<Type>>::New(*this); } diff --git a/src/OpenFOAM/fields/Fields/Field/Field.H b/src/OpenFOAM/fields/Fields/Field/Field.H index 6fcab57ea0d4b7e842c54e8f3cfae341dd5023f1..1af0dbdc59ed5d95a2b160aa7fbb494145d4932b 100644 --- a/src/OpenFOAM/fields/Fields/Field/Field.H +++ b/src/OpenFOAM/fields/Fields/Field/Field.H @@ -241,7 +241,7 @@ public: template<class Type2> static tmp<Field<Type>> NewCalculatedType(const Field<Type2>& f) { - return tmp<Field<Type>>(new Field<Type>(f.size())); + return tmp<Field<Type>>::New(f.size()); } diff --git a/src/OpenFOAM/fields/Fields/Field/FieldMapper.H b/src/OpenFOAM/fields/Fields/Field/FieldMapper.H index c09b3ad56324cc5bd7c978f5b3b39ad3d5053f95..de5dd948bfb25897ccc128d10d3e2257ee18153a 100644 --- a/src/OpenFOAM/fields/Fields/Field/FieldMapper.H +++ b/src/OpenFOAM/fields/Fields/Field/FieldMapper.H @@ -118,7 +118,7 @@ public: template<class Type> tmp<Field<Type>> operator()(const Field<Type>& f) const { - return tmp<Field<Type>>(new Field<Type>(f, *this)); + return tmp<Field<Type>>::New(f, *this); } }; diff --git a/src/OpenFOAM/fields/pointPatchFields/pointPatchField/pointPatchField.C b/src/OpenFOAM/fields/pointPatchFields/pointPatchField/pointPatchField.C index b2016d79a3a7a8916a4ecce4926b634ca47ece8f..19dcfab13459fbd05961ea7e3604361c979b3f8d 100644 --- a/src/OpenFOAM/fields/pointPatchFields/pointPatchField/pointPatchField.C +++ b/src/OpenFOAM/fields/pointPatchFields/pointPatchField/pointPatchField.C @@ -149,7 +149,7 @@ Foam::pointPatchField<Type>::patchInternalField << abort(FatalError); } - return tmp<Field<Type1>>(new Field<Type1>(iF, meshPoints)); + return tmp<Field<Type1>>::New(iF, meshPoints); } diff --git a/src/OpenFOAM/graph/curve/curve.H b/src/OpenFOAM/graph/curve/curve.H index 2d8a8c9941b78ac6c2b42fd9f8b89b189192e42e..c9a34374c80598b9258e798b89a2aeae53ad35fe 100644 --- a/src/OpenFOAM/graph/curve/curve.H +++ b/src/OpenFOAM/graph/curve/curve.H @@ -145,7 +145,7 @@ public: autoPtr<curve> clone() const { - return autoPtr<curve>(new curve(*this)); + return autoPtr<curve>::New(*this); } diff --git a/src/OpenFOAM/matrices/LUscalarMatrix/procLduInterface.H b/src/OpenFOAM/matrices/LUscalarMatrix/procLduInterface.H index 4026e203bdff866d97ef26be25b058c29e48bafb..56de4eb76a6dad86b9c72670246f87af1455ae4c 100644 --- a/src/OpenFOAM/matrices/LUscalarMatrix/procLduInterface.H +++ b/src/OpenFOAM/matrices/LUscalarMatrix/procLduInterface.H @@ -98,7 +98,7 @@ public: static autoPtr<procLduInterface> New(Istream& is) { - return autoPtr<procLduInterface>(new procLduInterface(is)); + return autoPtr<procLduInterface>::New(is); } diff --git a/src/OpenFOAM/matrices/LduMatrix/LduMatrix/LduMatrixPreconditioner.C b/src/OpenFOAM/matrices/LduMatrix/LduMatrix/LduMatrixPreconditioner.C index ad3de4764ce68b4bb42e5f00c208eebad6b26166..468297c2a5f974b421933e98229db0ef70c58c94 100644 --- a/src/OpenFOAM/matrices/LduMatrix/LduMatrix/LduMatrixPreconditioner.C +++ b/src/OpenFOAM/matrices/LduMatrix/LduMatrix/LduMatrixPreconditioner.C @@ -89,20 +89,15 @@ Foam::LduMatrix<Type, DType, LUType>::preconditioner::New ) ); } - else - { - FatalIOErrorInFunction - ( - preconditionerDict - ) << "cannot preconditione incomplete matrix, " - "no diagonal or off-diagonal coefficient" - << exit(FatalIOError); - return autoPtr<typename LduMatrix<Type, DType, LUType>::preconditioner> - ( - nullptr - ); - } + FatalIOErrorInFunction + ( + preconditionerDict + ) << "cannot preconditione incomplete matrix, " + "no diagonal or off-diagonal coefficient" + << exit(FatalIOError); + + return autoPtr<typename LduMatrix<Type, DType, LUType>::preconditioner>(); } diff --git a/src/OpenFOAM/matrices/LduMatrix/LduMatrix/LduMatrixSmoother.C b/src/OpenFOAM/matrices/LduMatrix/LduMatrix/LduMatrixSmoother.C index 758dafff9a518989772484dd56bdf2583dc08ebb..dd27fc51c2be623e01331635a8278d0b3f5b85a1 100644 --- a/src/OpenFOAM/matrices/LduMatrix/LduMatrix/LduMatrixSmoother.C +++ b/src/OpenFOAM/matrices/LduMatrix/LduMatrix/LduMatrixSmoother.C @@ -84,17 +84,12 @@ Foam::LduMatrix<Type, DType, LUType>::smoother::New ) ); } - else - { - FatalIOErrorInFunction(smootherDict) - << "cannot solve incomplete matrix, no off-diagonal coefficients" - << exit(FatalIOError); - return autoPtr<typename LduMatrix<Type, DType, LUType>::smoother> - ( - nullptr - ); - } + FatalIOErrorInFunction(smootherDict) + << "cannot solve incomplete matrix, no off-diagonal coefficients" + << exit(FatalIOError); + + return autoPtr<typename LduMatrix<Type, DType, LUType>::smoother>(); } diff --git a/src/OpenFOAM/matrices/LduMatrix/LduMatrix/LduMatrixSolver.C b/src/OpenFOAM/matrices/LduMatrix/LduMatrix/LduMatrixSolver.C index 6ca7b2a64ce30ed5690e40c6cd2396b69c6d503d..626301066e6232e8a2cbf583b038818024b7a174 100644 --- a/src/OpenFOAM/matrices/LduMatrix/LduMatrix/LduMatrixSolver.C +++ b/src/OpenFOAM/matrices/LduMatrix/LduMatrix/LduMatrixSolver.C @@ -99,18 +99,13 @@ Foam::LduMatrix<Type, DType, LUType>::solver::New ) ); } - else - { - FatalIOErrorInFunction(solverDict) - << "cannot solve incomplete matrix, " - "no diagonal or off-diagonal coefficient" - << exit(FatalIOError); - return autoPtr<typename LduMatrix<Type, DType, LUType>::solver> - ( - nullptr - ); - } + FatalIOErrorInFunction(solverDict) + << "cannot solve incomplete matrix, " + "no diagonal or off-diagonal coefficient" + << exit(FatalIOError); + + return autoPtr<typename LduMatrix<Type, DType, LUType>::solver>(); } diff --git a/src/OpenFOAM/matrices/Matrix/MatrixI.H b/src/OpenFOAM/matrices/Matrix/MatrixI.H index deed75bd45fcf60bc14d8941fc9bf76010f1ca14..d8503b5ce1d73c74bb64ef33db322d0d8a1ba8ef 100644 --- a/src/OpenFOAM/matrices/Matrix/MatrixI.H +++ b/src/OpenFOAM/matrices/Matrix/MatrixI.H @@ -40,7 +40,7 @@ template<class Form, class Type> inline Foam::autoPtr<Foam::Matrix<Form, Type>> Foam::Matrix<Form, Type>:: clone() const { - return autoPtr<Matrix<Form, Type>>(new Matrix<Form, Type>(*this)); + return autoPtr<Matrix<Form, Type>>::New(*this); } diff --git a/src/OpenFOAM/matrices/RectangularMatrix/RectangularMatrixI.H b/src/OpenFOAM/matrices/RectangularMatrix/RectangularMatrixI.H index e07888e25b220b672ad809dd04fcef960677dae1..47843ac299492e486d44b561c6b6bf0a5ec356fb 100644 --- a/src/OpenFOAM/matrices/RectangularMatrix/RectangularMatrixI.H +++ b/src/OpenFOAM/matrices/RectangularMatrix/RectangularMatrixI.H @@ -110,10 +110,7 @@ template<class Type> inline Foam::autoPtr<Foam::RectangularMatrix<Type>> Foam::RectangularMatrix<Type>::clone() const { - return autoPtr<RectangularMatrix<Type>> - ( - new RectangularMatrix<Type>(*this) - ); + return autoPtr<RectangularMatrix<Type>>::New(*this); } diff --git a/src/OpenFOAM/matrices/SquareMatrix/SquareMatrixI.H b/src/OpenFOAM/matrices/SquareMatrix/SquareMatrixI.H index b85715ff07e07aac0b4fc50676eabb99fddf265e..375492b25095a1cc8cf4ce5b343e732c74df25b3 100644 --- a/src/OpenFOAM/matrices/SquareMatrix/SquareMatrixI.H +++ b/src/OpenFOAM/matrices/SquareMatrix/SquareMatrixI.H @@ -148,7 +148,7 @@ template<class Type> inline Foam::autoPtr<Foam::SquareMatrix<Type>> Foam::SquareMatrix<Type>::clone() const { - return autoPtr<SquareMatrix<Type>>(new SquareMatrix<Type>(*this)); + return autoPtr<SquareMatrix<Type>>::New(*this); } diff --git a/src/OpenFOAM/matrices/SymmetricSquareMatrix/SymmetricSquareMatrixI.H b/src/OpenFOAM/matrices/SymmetricSquareMatrix/SymmetricSquareMatrixI.H index 333da73f5d4a6139eede13f0953c478333c9903c..4fd590411dee4281d952827355d4f27f9f73487d 100644 --- a/src/OpenFOAM/matrices/SymmetricSquareMatrix/SymmetricSquareMatrixI.H +++ b/src/OpenFOAM/matrices/SymmetricSquareMatrix/SymmetricSquareMatrixI.H @@ -88,10 +88,7 @@ template<class Type> inline Foam::autoPtr<Foam::SymmetricSquareMatrix<Type>> Foam::SymmetricSquareMatrix<Type>::clone() const { - return autoPtr<SymmetricSquareMatrix<Type>> - ( - new SymmetricSquareMatrix<Type>(*this) - ); + return autoPtr<SymmetricSquareMatrix<Type>>::New(*this); } diff --git a/src/OpenFOAM/matrices/lduMatrix/lduMatrix/lduMatrixPreconditioner.C b/src/OpenFOAM/matrices/lduMatrix/lduMatrix/lduMatrixPreconditioner.C index 4fd508c6bfccaf4f8138407e7472d294f130e61d..27f8c3687d21577b4ce5d117ac9b8bf1b479c8c7 100644 --- a/src/OpenFOAM/matrices/lduMatrix/lduMatrix/lduMatrixPreconditioner.C +++ b/src/OpenFOAM/matrices/lduMatrix/lduMatrix/lduMatrixPreconditioner.C @@ -130,17 +130,15 @@ Foam::lduMatrix::preconditioner::New ) ); } - else - { - FatalIOErrorInFunction - ( - controls - ) << "cannot solve incomplete matrix, " - "no diagonal or off-diagonal coefficient" - << exit(FatalIOError); - return autoPtr<lduMatrix::preconditioner>(); - } + FatalIOErrorInFunction + ( + controls + ) << "cannot solve incomplete matrix, " + "no diagonal or off-diagonal coefficient" + << exit(FatalIOError); + + return autoPtr<lduMatrix::preconditioner>(); } diff --git a/src/OpenFOAM/matrices/lduMatrix/lduMatrix/lduMatrixSmoother.C b/src/OpenFOAM/matrices/lduMatrix/lduMatrix/lduMatrixSmoother.C index 71c9475d396b9ab4e59a67fdf13bbe8a66a88a60..731d4c89b303fe964fcf41694a8203cb26bcd481 100644 --- a/src/OpenFOAM/matrices/lduMatrix/lduMatrix/lduMatrixSmoother.C +++ b/src/OpenFOAM/matrices/lduMatrix/lduMatrix/lduMatrixSmoother.C @@ -136,15 +136,13 @@ Foam::autoPtr<Foam::lduMatrix::smoother> Foam::lduMatrix::smoother::New ) ); } - else - { - FatalIOErrorInFunction(solverControls) - << "cannot solve incomplete matrix, " - "no diagonal or off-diagonal coefficient" - << exit(FatalIOError); - return autoPtr<lduMatrix::smoother>(); - } + FatalIOErrorInFunction(solverControls) + << "cannot solve incomplete matrix, " + "no diagonal or off-diagonal coefficient" + << exit(FatalIOError); + + return autoPtr<lduMatrix::smoother>(); } diff --git a/src/OpenFOAM/matrices/lduMatrix/lduMatrix/lduMatrixSolver.C b/src/OpenFOAM/matrices/lduMatrix/lduMatrix/lduMatrixSolver.C index 38e10b12e52962171f4870be59eef5b14bc9ac83..4b0a2092ec73d5d787471ff4a7955485e7e16de2 100644 --- a/src/OpenFOAM/matrices/lduMatrix/lduMatrix/lduMatrixSolver.C +++ b/src/OpenFOAM/matrices/lduMatrix/lduMatrix/lduMatrixSolver.C @@ -116,15 +116,13 @@ Foam::autoPtr<Foam::lduMatrix::solver> Foam::lduMatrix::solver::New ) ); } - else - { - FatalIOErrorInFunction(solverControls) - << "cannot solve incomplete matrix, " - "no diagonal or off-diagonal coefficient" - << exit(FatalIOError); - return autoPtr<lduMatrix::solver>(); - } + FatalIOErrorInFunction(solverControls) + << "cannot solve incomplete matrix, " + "no diagonal or off-diagonal coefficient" + << exit(FatalIOError); + + return autoPtr<lduMatrix::solver>(); } diff --git a/src/OpenFOAM/meshes/meshShapes/cellModel/cellModel.H b/src/OpenFOAM/meshes/meshShapes/cellModel/cellModel.H index d1f08405fcdfeac2aba43c74b9fb98c3bd6e7950..9c8998ac1c3e94db67e6a0b68deeeec270cdf4d2 100644 --- a/src/OpenFOAM/meshes/meshShapes/cellModel/cellModel.H +++ b/src/OpenFOAM/meshes/meshShapes/cellModel/cellModel.H @@ -157,13 +157,13 @@ public: //- Return a new cellModel on free-store created from Istream static autoPtr<cellModel> New(Istream& is) { - return autoPtr<cellModel>(new cellModel(is)); + return autoPtr<cellModel>::New(is); } //- Return clone autoPtr<cellModel> clone() const { - return autoPtr<cellModel>(new cellModel(*this)); + return autoPtr<cellModel>::New(*this); } diff --git a/src/OpenFOAM/meshes/meshShapes/cellShape/cellShapeI.H b/src/OpenFOAM/meshes/meshShapes/cellShape/cellShapeI.H index ad1443b679660585144750adb9b33c58156cac26..42dfd3f4e832510a8d48ff626d5e7db26dc50960 100644 --- a/src/OpenFOAM/meshes/meshShapes/cellShape/cellShapeI.H +++ b/src/OpenFOAM/meshes/meshShapes/cellShape/cellShapeI.H @@ -77,7 +77,7 @@ inline Foam::cellShape::cellShape(Istream& is) inline Foam::autoPtr<Foam::cellShape> Foam::cellShape::clone() const { - return autoPtr<cellShape>(new cellShape(*this)); + return autoPtr<cellShape>::New(*this); } diff --git a/src/OpenFOAM/meshes/polyMesh/mapPolyMesh/mapDistribute/mapDistribute.C b/src/OpenFOAM/meshes/polyMesh/mapPolyMesh/mapDistribute/mapDistribute.C index d1fc64caea5147836a5dd2123e566399580cdef0..b97a0c81e122ee86c7c79a6bc0244768080f29d4 100644 --- a/src/OpenFOAM/meshes/polyMesh/mapPolyMesh/mapDistribute/mapDistribute.C +++ b/src/OpenFOAM/meshes/polyMesh/mapPolyMesh/mapDistribute/mapDistribute.C @@ -498,7 +498,7 @@ Foam::mapDistribute::mapDistribute(Istream& is) Foam::autoPtr<Foam::mapDistribute> Foam::mapDistribute::clone() const { - return autoPtr<mapDistribute>(new mapDistribute(*this)); + return autoPtr<mapDistribute>::New(*this); } diff --git a/src/OpenFOAM/meshes/polyMesh/polyMesh.C b/src/OpenFOAM/meshes/polyMesh/polyMesh.C index b840b7d8d8f83e5cd8390429daf979417189d4d8..5010532693b0ab999290017a341c4690502e8c22 100644 --- a/src/OpenFOAM/meshes/polyMesh/polyMesh.C +++ b/src/OpenFOAM/meshes/polyMesh/polyMesh.C @@ -149,7 +149,7 @@ Foam::autoPtr<Foam::labelIOList> Foam::polyMesh::readTetBasePtIs() const if (io.typeHeaderOk<labelIOList>(true)) { - return autoPtr<labelIOList>(new labelIOList(io)); + return autoPtr<labelIOList>::New(io); } return autoPtr<labelIOList>(); diff --git a/src/OpenFOAM/meshes/polyMesh/polyPatches/polyPatch/polyPatch.H b/src/OpenFOAM/meshes/polyMesh/polyPatches/polyPatch/polyPatch.H index 7759f9c546ad81f3e14dc6eef9402820492fba75..ef2ec98080c1e8fd661c5b8846e2d7edb884631d 100644 --- a/src/OpenFOAM/meshes/polyMesh/polyPatches/polyPatch/polyPatch.H +++ b/src/OpenFOAM/meshes/polyMesh/polyPatches/polyPatch/polyPatch.H @@ -231,7 +231,7 @@ public: //- Construct and return a clone, resetting the boundary mesh virtual autoPtr<polyPatch> clone(const polyBoundaryMesh& bm) const { - return autoPtr<polyPatch>(new polyPatch(*this, bm)); + return autoPtr<polyPatch>::New(*this, bm); } //- Construct and return a clone, resetting the face list @@ -244,10 +244,7 @@ public: const label newStart ) const { - return autoPtr<polyPatch> - ( - new polyPatch(*this, bm, index, newSize, newStart) - ); + return autoPtr<polyPatch>::New(*this, bm, index, newSize, newStart); } //- Construct and return a clone, resetting the face list @@ -260,10 +257,8 @@ public: const label newStart ) const { - return autoPtr<polyPatch> - ( - new polyPatch(*this, bm, index, mapAddressing, newStart) - ); + return autoPtr<polyPatch>::New + (*this, bm, index, mapAddressing, newStart); } diff --git a/src/OpenFOAM/meshes/polyMesh/zones/cellZone/cellZone.H b/src/OpenFOAM/meshes/polyMesh/zones/cellZone/cellZone.H index fe39d79d24cce2ed6f5a2c21cdc91f6b38a1ef10..7f6f4e9785e14918cb11fc57e630f9884932e046 100644 --- a/src/OpenFOAM/meshes/polyMesh/zones/cellZone/cellZone.H +++ b/src/OpenFOAM/meshes/polyMesh/zones/cellZone/cellZone.H @@ -182,10 +182,7 @@ public: //- Construct and return a clone, resetting the zone mesh virtual autoPtr<cellZone> clone(const cellZoneMesh& zm) const { - return autoPtr<cellZone> - ( - new cellZone(*this, *this, index(), zm) - ); + return autoPtr<cellZone>::New(*this, *this, index(), zm); } //- Construct and return a clone, @@ -197,10 +194,7 @@ public: const cellZoneMesh& zm ) const { - return autoPtr<cellZone> - ( - new cellZone(*this, addr, index, zm) - ); + return autoPtr<cellZone>::New(*this, addr, index, zm); } diff --git a/src/OpenFOAM/meshes/polyMesh/zones/faceZone/faceZone.H b/src/OpenFOAM/meshes/polyMesh/zones/faceZone/faceZone.H index 0d1d6607eb201f946ba2d1bc1edc2c098c6bb561..25688b3a99b2ad5707dd312a959f4b3f48a64267 100644 --- a/src/OpenFOAM/meshes/polyMesh/zones/faceZone/faceZone.H +++ b/src/OpenFOAM/meshes/polyMesh/zones/faceZone/faceZone.H @@ -228,10 +228,7 @@ public: //- Construct and return a clone, resetting the zone mesh virtual autoPtr<faceZone> clone(const faceZoneMesh& zm) const { - return autoPtr<faceZone> - ( - new faceZone(*this, *this, flipMap(), index(), zm) - ); + return autoPtr<faceZone>::New(*this, *this, flipMap(), index(), zm); } //- Construct and return a clone, @@ -244,10 +241,7 @@ public: const faceZoneMesh& zm ) const { - return autoPtr<faceZone> - ( - new faceZone(*this, addr, fm, index, zm) - ); + return autoPtr<faceZone>::New(*this, addr, fm, index, zm); } diff --git a/src/OpenFOAM/meshes/polyMesh/zones/pointZone/pointZone.H b/src/OpenFOAM/meshes/polyMesh/zones/pointZone/pointZone.H index a42d49e1c987d11daef32f9c28ef25b8204f67d2..4979d83d381d86974ac52e974106d44d4c4fc438 100644 --- a/src/OpenFOAM/meshes/polyMesh/zones/pointZone/pointZone.H +++ b/src/OpenFOAM/meshes/polyMesh/zones/pointZone/pointZone.H @@ -183,10 +183,7 @@ public: //- Construct and return a clone, resetting the zone mesh virtual autoPtr<pointZone> clone(const pointZoneMesh& zm) const { - return autoPtr<pointZone> - ( - new pointZone(*this, *this, index(), zm) - ); + return autoPtr<pointZone>::New(*this, *this, index(), zm); } //- Construct and return a clone, resetting the point list @@ -198,10 +195,7 @@ public: const labelUList& addr ) const { - return autoPtr<pointZone> - ( - new pointZone(*this, addr, index, zm) - ); + return autoPtr<pointZone>::New(*this, addr, index, zm); } diff --git a/src/OpenFOAM/primitives/functions/Function1/Constant/Constant.C b/src/OpenFOAM/primitives/functions/Function1/Constant/Constant.C index d72e0c0de746b143c897de1db454c6d27d8138c8..aa2312d27acf74bd6e21296f7f432d768e8f0a8b 100644 --- a/src/OpenFOAM/primitives/functions/Function1/Constant/Constant.C +++ b/src/OpenFOAM/primitives/functions/Function1/Constant/Constant.C @@ -90,7 +90,7 @@ Foam::tmp<Foam::Field<Type>> Foam::Function1Types::Constant<Type>::value const scalarField& x ) const { - return tmp<Field<Type>>(new Field<Type>(x.size(), value_)); + return tmp<Field<Type>>::New(x.size(), value_); } diff --git a/src/OpenFOAM/primitives/functions/Function1/One/OneConstant.C b/src/OpenFOAM/primitives/functions/Function1/One/OneConstant.C index 707abfc1c1b5e38c71a39b97da6fce04a81d8f59..31f0972ac9505862cd863c4acc2d5630dd569984 100644 --- a/src/OpenFOAM/primitives/functions/Function1/One/OneConstant.C +++ b/src/OpenFOAM/primitives/functions/Function1/One/OneConstant.C @@ -60,7 +60,7 @@ Foam::tmp<Foam::Field<Type>> Foam::Function1Types::OneConstant<Type>::value const scalarField& x ) const { - return tmp<Field<Type>>(new Field<Type>(x.size(), pTraits<Type>::one)); + return tmp<Field<Type>>::New(x.size(), pTraits<Type>::one); } diff --git a/src/OpenFOAM/primitives/functions/Function1/makeFunction1s.C b/src/OpenFOAM/primitives/functions/Function1/makeFunction1s.C index 3dff56b9a067f13639250aed5971d973fc1f3172..139a9b78dd4a4ed273765fc9f99f9cbbd36b79cb 100644 --- a/src/OpenFOAM/primitives/functions/Function1/makeFunction1s.C +++ b/src/OpenFOAM/primitives/functions/Function1/makeFunction1s.C @@ -75,7 +75,7 @@ Foam::Function1Types::Constant<Foam::label>::integrate ) const { NotImplemented; - return tmp<Field<label>>(new Field<label>(x1.size())); + return tmp<Field<label>>::New(x1.size()); } diff --git a/src/TurbulenceModels/turbulenceModels/derivedFvPatchFields/wallFunctions/nutWallFunctions/nutLowReWallFunction/nutLowReWallFunctionFvPatchScalarField.C b/src/TurbulenceModels/turbulenceModels/derivedFvPatchFields/wallFunctions/nutWallFunctions/nutLowReWallFunction/nutLowReWallFunctionFvPatchScalarField.C index bf65cced1df6ef773dc1fa076c9459d6af5f09f8..81b1ac9076b3544713f885eefbb3c18c3e857706 100644 --- a/src/TurbulenceModels/turbulenceModels/derivedFvPatchFields/wallFunctions/nutWallFunctions/nutLowReWallFunction/nutLowReWallFunctionFvPatchScalarField.C +++ b/src/TurbulenceModels/turbulenceModels/derivedFvPatchFields/wallFunctions/nutWallFunctions/nutLowReWallFunction/nutLowReWallFunctionFvPatchScalarField.C @@ -38,7 +38,7 @@ namespace Foam tmp<scalarField> nutLowReWallFunctionFvPatchScalarField::calcNut() const { - return tmp<scalarField>(new scalarField(patch().size(), 0.0)); + return tmp<scalarField>::New(patch().size(), 0.0); } diff --git a/src/conversion/ccm/reader/ccmReaderSolution.C b/src/conversion/ccm/reader/ccmReaderSolution.C index 76c6fb363a43d1fc7155ea42363d7a61c5d244be..7abc4ab3e0dc63cdb7bc7fa0fe02adb478795e0e 100644 --- a/src/conversion/ccm/reader/ccmReaderSolution.C +++ b/src/conversion/ccm/reader/ccmReaderSolution.C @@ -377,7 +377,7 @@ Foam::ccm::reader::readField || !fieldTable_.found(fieldName) ) { - return tmp<scalarField>(new Field<scalar>()); + return tmp<scalarField>::New(); } CCMIODataLocation requestedLocation = kCCMIOCell; @@ -395,7 +395,7 @@ Foam::ccm::reader::readField // we can skip empty fields immediately if (!maxId) { - return tmp<scalarField>(new Field<scalar>()); + return tmp<scalarField>::New(); } char shortName[kCCMIOProstarShortNameLength+1]; diff --git a/src/dynamicMesh/boundaryPatch/boundaryPatch.C b/src/dynamicMesh/boundaryPatch/boundaryPatch.C index 38c1d6b91eea399c7aa00b78d77dbc00e8f989ec..9655b995bb93b8a6ba56f5a840370b5451ca6fe1 100644 --- a/src/dynamicMesh/boundaryPatch/boundaryPatch.C +++ b/src/dynamicMesh/boundaryPatch/boundaryPatch.C @@ -75,7 +75,7 @@ Foam::boundaryPatch::boundaryPatch(const boundaryPatch& p, const label index) Foam::autoPtr<Foam::boundaryPatch> Foam::boundaryPatch::clone() const { - return autoPtr<boundaryPatch>(new boundaryPatch(*this)); + return autoPtr<boundaryPatch>::New(*this); } diff --git a/src/dynamicMesh/polyTopoChange/polyTopoChange/polyTopoChange.C b/src/dynamicMesh/polyTopoChange/polyTopoChange/polyTopoChange.C index 8414ab51cf99d42d0048430bceb93ebedd6f15c9..9ae35e31e74cd34bca74f0619d87014d8a05db86 100644 --- a/src/dynamicMesh/polyTopoChange/polyTopoChange/polyTopoChange.C +++ b/src/dynamicMesh/polyTopoChange/polyTopoChange/polyTopoChange.C @@ -3204,51 +3204,48 @@ Foam::autoPtr<Foam::mapPolyMesh> Foam::polyTopoChange::changeMesh labelHashSet flipFaceFluxSet(getSetIndices(flipFaceFlux_)); - return autoPtr<mapPolyMesh> + return autoPtr<mapPolyMesh>::New ( - new mapPolyMesh - ( - mesh, - nOldPoints, - nOldFaces, - nOldCells, + mesh, + nOldPoints, + nOldFaces, + nOldCells, - pointMap_, - pointsFromPoints, + pointMap_, + pointsFromPoints, - faceMap_, - facesFromPoints, - facesFromEdges, - facesFromFaces, + faceMap_, + facesFromPoints, + facesFromEdges, + facesFromFaces, - cellMap_, - cellsFromPoints, - cellsFromEdges, - cellsFromFaces, - cellsFromCells, + cellMap_, + cellsFromPoints, + cellsFromEdges, + cellsFromFaces, + cellsFromCells, - reversePointMap_, - reverseFaceMap_, - reverseCellMap_, + reversePointMap_, + reverseFaceMap_, + reverseCellMap_, - flipFaceFluxSet, + flipFaceFluxSet, - patchPointMap, + patchPointMap, - pointZoneMap, + pointZoneMap, - faceZonePointMap, - faceZoneFaceMap, - cellZoneMap, + faceZonePointMap, + faceZoneFaceMap, + cellZoneMap, - newPoints, // if empty signals no inflation. - oldPatchStarts, - oldPatchNMeshPoints, + newPoints, // if empty signals no inflation. + oldPatchStarts, + oldPatchNMeshPoints, - oldCellVolumes, + oldCellVolumes, - true // steal storage. - ) + true // steal storage. ); // At this point all member DynamicList (pointMap_, cellMap_ etc.) will @@ -3498,49 +3495,46 @@ Foam::autoPtr<Foam::mapPolyMesh> Foam::polyTopoChange::makeMesh labelHashSet flipFaceFluxSet(getSetIndices(flipFaceFlux_)); - return autoPtr<mapPolyMesh> + return autoPtr<mapPolyMesh>::New ( - new mapPolyMesh - ( - newMesh, - nOldPoints, - nOldFaces, - nOldCells, + newMesh, + nOldPoints, + nOldFaces, + nOldCells, - pointMap_, - pointsFromPoints, + pointMap_, + pointsFromPoints, - faceMap_, - facesFromPoints, - facesFromEdges, - facesFromFaces, + faceMap_, + facesFromPoints, + facesFromEdges, + facesFromFaces, - cellMap_, - cellsFromPoints, - cellsFromEdges, - cellsFromFaces, - cellsFromCells, + cellMap_, + cellsFromPoints, + cellsFromEdges, + cellsFromFaces, + cellsFromCells, - reversePointMap_, - reverseFaceMap_, - reverseCellMap_, + reversePointMap_, + reverseFaceMap_, + reverseCellMap_, - flipFaceFluxSet, + flipFaceFluxSet, - patchPointMap, + patchPointMap, - pointZoneMap, + pointZoneMap, - faceZonePointMap, - faceZoneFaceMap, - cellZoneMap, + faceZonePointMap, + faceZoneFaceMap, + cellZoneMap, - newPoints, // if empty signals no inflation. - oldPatchStarts, - oldPatchNMeshPoints, - oldCellVolumes, - true // steal storage. - ) + newPoints, // if empty signals no inflation. + oldPatchStarts, + oldPatchNMeshPoints, + oldCellVolumes, + true // steal storage. ); // At this point all member DynamicList (pointMap_, cellMap_ etc.) will diff --git a/src/engine/ignition/ignitionSite.H b/src/engine/ignition/ignitionSite.H index e8d3db5340019c4502fc0e76a4686011fa0c545e..6a8959f40ccba46d47c398ec61cf66d6feb9c1ab 100644 --- a/src/engine/ignition/ignitionSite.H +++ b/src/engine/ignition/ignitionSite.H @@ -105,7 +105,7 @@ public: autoPtr<ignitionSite> operator()(Istream& is) const { - return autoPtr<ignitionSite>(new ignitionSite(is, db_, mesh_)); + return autoPtr<ignitionSite>::New(is, db_, mesh_); } }; @@ -121,7 +121,7 @@ public: //- Clone autoPtr<ignitionSite> clone() const { - return autoPtr<ignitionSite>(new ignitionSite(*this)); + return autoPtr<ignitionSite>::New(*this); } diff --git a/src/finiteArea/faMesh/faPatches/faPatch/faPatch.C b/src/finiteArea/faMesh/faPatches/faPatch/faPatch.C index 92662f998218ff162a67bd20e275f46089924d75..2646b427d14c16137052ad42298c903c694c5707 100644 --- a/src/finiteArea/faMesh/faPatches/faPatch/faPatch.C +++ b/src/finiteArea/faMesh/faPatches/faPatch/faPatch.C @@ -337,7 +337,7 @@ Foam::tmp<Foam::vectorField> Foam::faPatch::ngbPolyPatchPointNormals() const { if (ngbPolyPatchIndex() == -1) { - return tmp<vectorField>(new vectorField()); + return tmp<vectorField>::New(); } const labelListList& pntEdges = pointEdges(); diff --git a/src/finiteArea/faMesh/faPatches/faPatch/faPatch.H b/src/finiteArea/faMesh/faPatches/faPatch/faPatch.H index 2ba2a591168c40b7eee334791287d21564e130d5..0f1e25ebdfe681e9a9738f5b26ab1bd482d3b081 100644 --- a/src/finiteArea/faMesh/faPatches/faPatch/faPatch.H +++ b/src/finiteArea/faMesh/faPatches/faPatch/faPatch.H @@ -196,10 +196,9 @@ public: const label ngbPolyPatchIndex ) const { - return autoPtr<faPatch> - ( - new faPatch(name(), edgeLabels, index, bm, ngbPolyPatchIndex) - ); + return + autoPtr<faPatch>::New + (name(), edgeLabels, index, bm, ngbPolyPatchIndex); } diff --git a/src/finiteArea/fields/faPatchFields/basic/basicSymmetry/basicSymmetryFaPatchScalarField.C b/src/finiteArea/fields/faPatchFields/basic/basicSymmetry/basicSymmetryFaPatchScalarField.C index 78d9f156a7a68089d6ff8d499d91aa262561003c..6439771b88d332bdb2bb84c896d1525e4558af83 100644 --- a/src/finiteArea/fields/faPatchFields/basic/basicSymmetry/basicSymmetryFaPatchScalarField.C +++ b/src/finiteArea/fields/faPatchFields/basic/basicSymmetry/basicSymmetryFaPatchScalarField.C @@ -34,7 +34,7 @@ template<> Foam::tmp<Foam::scalarField> Foam::basicSymmetryFaPatchField<Foam::scalar>::snGrad() const { - return tmp<scalarField>(new scalarField(size(), 0.0)); + return tmp<scalarField>::New(size(), 0.0); } diff --git a/src/finiteArea/fields/faPatchFields/basic/fixedGradient/fixedGradientFaPatchField.C b/src/finiteArea/fields/faPatchFields/basic/fixedGradient/fixedGradientFaPatchField.C index 1a23e05ebe360f820d3d851faa40c088ac6c060c..415ef4341737b88e23af44d554e2b4719aba3c45 100644 --- a/src/finiteArea/fields/faPatchFields/basic/fixedGradient/fixedGradientFaPatchField.C +++ b/src/finiteArea/fields/faPatchFields/basic/fixedGradient/fixedGradientFaPatchField.C @@ -146,7 +146,7 @@ Foam::fixedGradientFaPatchField<Type>::valueInternalCoeffs const tmp<scalarField>& ) const { - return tmp<Field<Type>>(new Field<Type>(this->size(), pTraits<Type>::one)); + return tmp<Field<Type>>::New(this->size(), pTraits<Type>::one); } @@ -165,10 +165,7 @@ template<class Type> Foam::tmp<Foam::Field<Type>> Foam::fixedGradientFaPatchField<Type>::gradientInternalCoeffs() const { - return tmp<Field<Type>> - ( - new Field<Type>(this->size(), pTraits<Type>::zero) - ); + return tmp<Field<Type>>::New(this->size(), pTraits<Type>::zero); } diff --git a/src/finiteArea/fields/faPatchFields/basic/transform/transformFaPatchScalarField.C b/src/finiteArea/fields/faPatchFields/basic/transform/transformFaPatchScalarField.C index bb88cbb7c4dba1565c47c60291cfa7d2521db9d2..a5426721359b8e6c6a9a09f9f3de13c92c13cb0b 100644 --- a/src/finiteArea/fields/faPatchFields/basic/transform/transformFaPatchScalarField.C +++ b/src/finiteArea/fields/faPatchFields/basic/transform/transformFaPatchScalarField.C @@ -33,7 +33,7 @@ template<> Foam::tmp<Foam::scalarField> Foam::transformFaPatchField<Foam::scalar>::gradientInternalCoeffs() const { - return tmp<scalarField>(new scalarField(size(), 0.0)); + return tmp<scalarField>::New(size(), 0.0); } diff --git a/src/finiteArea/fields/faPatchFields/constraint/empty/emptyFaPatchField.H b/src/finiteArea/fields/faPatchFields/constraint/empty/emptyFaPatchField.H index 1fcfcc0020a5a3c57f73c1d9a48e01e0e7b1c7c1..2aec133972474df9427450d8bd238689634e7b6c 100644 --- a/src/finiteArea/fields/faPatchFields/constraint/empty/emptyFaPatchField.H +++ b/src/finiteArea/fields/faPatchFields/constraint/empty/emptyFaPatchField.H @@ -165,7 +165,7 @@ public: const tmp<scalarField>& ) const { - return tmp<Field<Type>>(new Field<Type>(0)); + return tmp<Field<Type>>::New(); } //- Return the matrix source coefficients corresponding to the @@ -175,21 +175,21 @@ public: const tmp<scalarField>& ) const { - return tmp<Field<Type>>(new Field<Type>(0)); + return tmp<Field<Type>>::New(); } //- Return the matrix diagonal coefficients corresponding to the // evaluation of the gradient of this patchField tmp<Field<Type>> gradientInternalCoeffs() const { - return tmp<Field<Type>>(new Field<Type>(0)); + return tmp<Field<Type>>::New(); } //- Return the matrix source coefficients corresponding to the // evaluation of the gradient of this patchField tmp<Field<Type>> gradientBoundaryCoeffs() const { - return tmp<Field<Type>>(new Field<Type>(0)); + return tmp<Field<Type>>::New(); } }; diff --git a/src/finiteArea/fields/faPatchFields/constraint/wedge/wedgeFaPatchScalarField.C b/src/finiteArea/fields/faPatchFields/constraint/wedge/wedgeFaPatchScalarField.C index 0b4fa844eae3a1130ece412c3c627ddc385911ab..0752c8b6d2dccc7ad1fedf49768c8c5090b8f25c 100644 --- a/src/finiteArea/fields/faPatchFields/constraint/wedge/wedgeFaPatchScalarField.C +++ b/src/finiteArea/fields/faPatchFields/constraint/wedge/wedgeFaPatchScalarField.C @@ -34,7 +34,7 @@ template<> Foam::tmp<Foam::scalarField> Foam::wedgeFaPatchField<Foam::scalar>::snGrad() const { - return tmp<scalarField>(new scalarField(size(), 0.0)); + return tmp<scalarField>::New(size(), 0.0); } diff --git a/src/finiteVolume/fields/fvPatchFields/basic/basicSymmetry/basicSymmetryFvPatchScalarField.C b/src/finiteVolume/fields/fvPatchFields/basic/basicSymmetry/basicSymmetryFvPatchScalarField.C index 40f3f5467fb4990d62566e781ce5b6718a21d4d9..df339b13f84803a9178dd5895617bec70b592437 100644 --- a/src/finiteVolume/fields/fvPatchFields/basic/basicSymmetry/basicSymmetryFvPatchScalarField.C +++ b/src/finiteVolume/fields/fvPatchFields/basic/basicSymmetry/basicSymmetryFvPatchScalarField.C @@ -32,7 +32,7 @@ template<> Foam::tmp<Foam::scalarField> Foam::basicSymmetryFvPatchField<Foam::scalar>::snGrad() const { - return tmp<scalarField >(new scalarField(size(), 0.0)); + return tmp<scalarField>::New(size(), 0.0); } diff --git a/src/finiteVolume/fields/fvPatchFields/basic/fixedGradient/fixedGradientFvPatchField.C b/src/finiteVolume/fields/fvPatchFields/basic/fixedGradient/fixedGradientFvPatchField.C index a7a8a8562fe61036da82d69aa9ee6287d4521a8b..29fca32ad73602dff5c55b75762d1877cfce330b 100644 --- a/src/finiteVolume/fields/fvPatchFields/basic/fixedGradient/fixedGradientFvPatchField.C +++ b/src/finiteVolume/fields/fvPatchFields/basic/fixedGradient/fixedGradientFvPatchField.C @@ -155,7 +155,7 @@ Foam::fixedGradientFvPatchField<Type>::valueInternalCoeffs const tmp<scalarField>& ) const { - return tmp<Field<Type>>(new Field<Type>(this->size(), pTraits<Type>::one)); + return tmp<Field<Type>>::New(this->size(), pTraits<Type>::one); } @@ -174,10 +174,7 @@ template<class Type> Foam::tmp<Foam::Field<Type>> Foam::fixedGradientFvPatchField<Type>::gradientInternalCoeffs() const { - return tmp<Field<Type>> - ( - new Field<Type>(this->size(), Zero) - ); + return tmp<Field<Type>>::New(this->size(), Zero); } diff --git a/src/finiteVolume/fields/fvPatchFields/basic/transform/transformFvPatchScalarField.C b/src/finiteVolume/fields/fvPatchFields/basic/transform/transformFvPatchScalarField.C index 81947be896ad53f277bc34954314dfe840a52989..16adba3f61722de927ceba85fc17b5ed058bffa4 100644 --- a/src/finiteVolume/fields/fvPatchFields/basic/transform/transformFvPatchScalarField.C +++ b/src/finiteVolume/fields/fvPatchFields/basic/transform/transformFvPatchScalarField.C @@ -34,7 +34,7 @@ Foam::transformFvPatchField<Foam::scalar>::valueInternalCoeffs const tmp<scalarField>& ) const { - return tmp<scalarField>(new scalarField(size(), 1.0)); + return tmp<scalarField>::New(size(), 1.0); } @@ -42,7 +42,7 @@ template<> Foam::tmp<Foam::scalarField> Foam::transformFvPatchField<Foam::scalar>::gradientInternalCoeffs() const { - return tmp<scalarField>(new scalarField(size(), 0.0)); + return tmp<scalarField>::New(size(), 0.0); } diff --git a/src/finiteVolume/fields/fvPatchFields/constraint/empty/emptyFvPatchField.H b/src/finiteVolume/fields/fvPatchFields/constraint/empty/emptyFvPatchField.H index b6b90e98a7f61a17e880bdaa52c584ee3e9a5f6a..47aae49ccdb47e3f15a26898e8ede6b21a7c1467 100644 --- a/src/finiteVolume/fields/fvPatchFields/constraint/empty/emptyFvPatchField.H +++ b/src/finiteVolume/fields/fvPatchFields/constraint/empty/emptyFvPatchField.H @@ -170,7 +170,7 @@ public: const tmp<scalarField>& ) const { - return tmp<Field<Type>>(new Field<Type>(0)); + return tmp<Field<Type>>::New(); } //- Return the matrix source coefficients corresponding to the @@ -180,21 +180,21 @@ public: const tmp<scalarField>& ) const { - return tmp<Field<Type>>(new Field<Type>(0)); + return tmp<Field<Type>>::New(); } //- Return the matrix diagonal coefficients corresponding to the // evaluation of the gradient of this patchField tmp<Field<Type>> gradientInternalCoeffs() const { - return tmp<Field<Type>>(new Field<Type>(0)); + return tmp<Field<Type>>::New(); } //- Return the matrix source coefficients corresponding to the // evaluation of the gradient of this patchField tmp<Field<Type>> gradientBoundaryCoeffs() const { - return tmp<Field<Type>>(new Field<Type>(0)); + return tmp<Field<Type>>::New(); } }; diff --git a/src/finiteVolume/fields/fvPatchFields/constraint/symmetryPlane/symmetryPlaneFvPatchScalarField.C b/src/finiteVolume/fields/fvPatchFields/constraint/symmetryPlane/symmetryPlaneFvPatchScalarField.C index 4f439406268e9fdbcf3b1bc799188e776aeaab42..8a330b9b7eadd437c87de929b3c8e5b8cf6b0ad9 100644 --- a/src/finiteVolume/fields/fvPatchFields/constraint/symmetryPlane/symmetryPlaneFvPatchScalarField.C +++ b/src/finiteVolume/fields/fvPatchFields/constraint/symmetryPlane/symmetryPlaneFvPatchScalarField.C @@ -32,7 +32,7 @@ template<> Foam::tmp<Foam::scalarField> Foam::symmetryPlaneFvPatchField<Foam::scalar>::snGrad() const { - return tmp<scalarField >(new scalarField(size(), 0.0)); + return tmp<scalarField>::New(size(), 0.0); } diff --git a/src/finiteVolume/fields/fvPatchFields/constraint/wedge/wedgeFvPatchScalarField.C b/src/finiteVolume/fields/fvPatchFields/constraint/wedge/wedgeFvPatchScalarField.C index c82ed7f7a6706ed7c6bf4d27c7ce8a7893781c66..4a95611c80d8f9580d8d81f696847895a8a5539a 100644 --- a/src/finiteVolume/fields/fvPatchFields/constraint/wedge/wedgeFvPatchScalarField.C +++ b/src/finiteVolume/fields/fvPatchFields/constraint/wedge/wedgeFvPatchScalarField.C @@ -36,7 +36,7 @@ namespace Foam template<> tmp<scalarField> wedgeFvPatchField<scalar>::snGrad() const { - return tmp<scalarField >(new scalarField(size(), 0.0)); + return tmp<scalarField>::New(size(), 0.0); } diff --git a/src/finiteVolume/fields/fvPatchFields/fvPatchField/fvPatchField.H b/src/finiteVolume/fields/fvPatchFields/fvPatchField/fvPatchField.H index 71d4a8ffd6fb915e0d0950dce3e719c5ddba8cf2..fa8c5fb42d585acfadcbf9a79f3abf10ccd6ffb9 100644 --- a/src/finiteVolume/fields/fvPatchFields/fvPatchField/fvPatchField.H +++ b/src/finiteVolume/fields/fvPatchFields/fvPatchField/fvPatchField.H @@ -219,7 +219,7 @@ public: //- Construct and return a clone virtual tmp<fvPatchField<Type>> clone() const { - return tmp<fvPatchField<Type>>(new fvPatchField<Type>(*this)); + return tmp<fvPatchField<Type>>::New(*this); } //- Construct as copy setting internal field reference @@ -235,7 +235,7 @@ public: const DimensionedField<Type, volMesh>& iF ) const { - return tmp<fvPatchField<Type>>(new fvPatchField<Type>(*this, iF)); + return tmp<fvPatchField<Type>>::New(*this, iF); } diff --git a/src/finiteVolume/fields/fvsPatchFields/fvsPatchField/fvsPatchField.H b/src/finiteVolume/fields/fvsPatchFields/fvsPatchField/fvsPatchField.H index 1b9f0aa2acaf3ca7a966c2dc0a6174256d26e295..3be7ba351c7062c2f3b06d69f3a3c1f77c964580 100644 --- a/src/finiteVolume/fields/fvsPatchFields/fvsPatchField/fvsPatchField.H +++ b/src/finiteVolume/fields/fvsPatchFields/fvsPatchField/fvsPatchField.H @@ -185,7 +185,7 @@ public: //- Construct and return a clone virtual tmp<fvsPatchField<Type>> clone() const { - return tmp<fvsPatchField<Type>>(new fvsPatchField<Type>(*this)); + return tmp<fvsPatchField<Type>>::New(*this); } //- Construct as copy setting internal field reference @@ -201,10 +201,7 @@ public: const DimensionedField<Type, surfaceMesh>& iF ) const { - return tmp<fvsPatchField<Type>> - ( - new fvsPatchField<Type>(*this, iF) - ); + return tmp<fvsPatchField<Type>>::New(*this, iF); } diff --git a/src/finiteVolume/fvMesh/extendedStencil/cellToCell/globalIndexStencils/cellToCellStencil.C b/src/finiteVolume/fvMesh/extendedStencil/cellToCell/globalIndexStencils/cellToCellStencil.C index b6820ee887cb58c3a2a7a7f4d75958698b3dd1c2..afbb8a90feff8af340af0d1f25151fe1b492b0c3 100644 --- a/src/finiteVolume/fvMesh/extendedStencil/cellToCell/globalIndexStencils/cellToCellStencil.C +++ b/src/finiteVolume/fvMesh/extendedStencil/cellToCell/globalIndexStencils/cellToCellStencil.C @@ -221,17 +221,14 @@ Foam::cellToCellStencil::allCoupledFacesPatch() const } } - return autoPtr<indirectPrimitivePatch> + return autoPtr<indirectPrimitivePatch>::New ( - new indirectPrimitivePatch + IndirectList<face> ( - IndirectList<face> - ( - mesh().faces(), - coupledFaces - ), - mesh().points() - ) + mesh().faces(), + coupledFaces + ), + mesh().points() ); } diff --git a/src/finiteVolume/fvMesh/extendedStencil/cellToFace/globalIndexStencils/cellToFaceStencil.C b/src/finiteVolume/fvMesh/extendedStencil/cellToFace/globalIndexStencils/cellToFaceStencil.C index 4b0aa39c00acbfec7fd7a2fd5182a5ce91ad5601..46275af0ffb7b7dfe182fd299aaf93adce6772ca 100644 --- a/src/finiteVolume/fvMesh/extendedStencil/cellToFace/globalIndexStencils/cellToFaceStencil.C +++ b/src/finiteVolume/fvMesh/extendedStencil/cellToFace/globalIndexStencils/cellToFaceStencil.C @@ -222,17 +222,14 @@ Foam::cellToFaceStencil::allCoupledFacesPatch() const } } - return autoPtr<indirectPrimitivePatch> + return autoPtr<indirectPrimitivePatch>::New ( - new indirectPrimitivePatch + IndirectList<face> ( - IndirectList<face> - ( - mesh().faces(), - coupledFaces - ), - mesh().points() - ) + mesh().faces(), + coupledFaces + ), + mesh().points() ); } diff --git a/src/finiteVolume/fvMesh/fvPatches/derived/regionCoupled/regionCoupledFvPatch.C b/src/finiteVolume/fvMesh/fvPatches/derived/regionCoupled/regionCoupledFvPatch.C index dce9cc4759a6aa1e32cabfe1f4335af01be208ea..dc4736817a14a5ad8ac40649d80b983a0d257ea2 100644 --- a/src/finiteVolume/fvMesh/fvPatches/derived/regionCoupled/regionCoupledFvPatch.C +++ b/src/finiteVolume/fvMesh/fvPatches/derived/regionCoupled/regionCoupledFvPatch.C @@ -57,7 +57,7 @@ Foam::tmp<Foam::labelField> Foam::regionCoupledFvPatch::internalFieldTransfer return neighbFvPatch().patchInternalField(iF); } - return tmp<labelField>(new labelField(iF.size(), 0)); + return tmp<labelField>::New(iF.size(), 0); } diff --git a/src/finiteVolume/fvMesh/fvPatches/derived/regionCoupled/regionCoupledWallFvPatch.C b/src/finiteVolume/fvMesh/fvPatches/derived/regionCoupled/regionCoupledWallFvPatch.C index 5662a8103e74779158cd085588404565a9e77d13..e7b694722d1d986d752b18b74b9a41ac4d7bf5eb 100644 --- a/src/finiteVolume/fvMesh/fvPatches/derived/regionCoupled/regionCoupledWallFvPatch.C +++ b/src/finiteVolume/fvMesh/fvPatches/derived/regionCoupled/regionCoupledWallFvPatch.C @@ -59,7 +59,8 @@ internalFieldTransfer return neighbFvPatch().patchInternalField(iF); } - return tmp<labelField>(new labelField(iF.size(), 0)); + return tmp<labelField>::New(iF.size(), 0); } + // ************************************************************************* // diff --git a/src/functionObjects/field/fieldValues/surfaceFieldValue/surfaceFieldValueTemplates.C b/src/functionObjects/field/fieldValues/surfaceFieldValue/surfaceFieldValueTemplates.C index 58520474880794af81c3513bcd7044512c82c343..cdc54e8afb50655447b3ea350b55d75b5ce9a4c4 100644 --- a/src/functionObjects/field/fieldValues/surfaceFieldValue/surfaceFieldValueTemplates.C +++ b/src/functionObjects/field/fieldValues/surfaceFieldValue/surfaceFieldValueTemplates.C @@ -136,7 +136,7 @@ Foam::functionObjects::fieldValues::surfaceFieldValue::getFieldValues << abort(FatalError); } - return tmp<Field<Type>>(new Field<Type>(0)); + return tmp<Field<Type>>::New(); } diff --git a/src/functionObjects/field/fieldValues/volFieldValue/volFieldValueTemplates.C b/src/functionObjects/field/fieldValues/volFieldValue/volFieldValueTemplates.C index 09b9931808f26262cf50606542c5eb4c1df394a9..c74056862c67a8ea2d7c661f8207d04e6fb467e3 100644 --- a/src/functionObjects/field/fieldValues/volFieldValue/volFieldValueTemplates.C +++ b/src/functionObjects/field/fieldValues/volFieldValue/volFieldValueTemplates.C @@ -67,7 +67,7 @@ Foam::functionObjects::fieldValues::volFieldValue::getFieldValues << abort(FatalError); } - return tmp<Field<Type>>(new Field<Type>(0.0)); + return tmp<Field<Type>>::New(Zero); } @@ -266,7 +266,7 @@ Foam::functionObjects::fieldValues::volFieldValue::filterField } else { - return tmp<Field<Type>>(new Field<Type>(field, cellIDs())); + return tmp<Field<Type>>::New(field, cellIDs()); } } diff --git a/src/functionObjects/field/heatTransferCoeff/heatTransferCoeffModels/ReynoldsAnalogy/ReynoldsAnalogy.C b/src/functionObjects/field/heatTransferCoeff/heatTransferCoeffModels/ReynoldsAnalogy/ReynoldsAnalogy.C index 9dc7ba2ea83be256fee595512fa7be4e04372b7b..b6fcdc31378b7c3fb2f9897a4b13f44968b24410 100644 --- a/src/functionObjects/field/heatTransferCoeff/heatTransferCoeffModels/ReynoldsAnalogy/ReynoldsAnalogy.C +++ b/src/functionObjects/field/heatTransferCoeff/heatTransferCoeffModels/ReynoldsAnalogy/ReynoldsAnalogy.C @@ -54,7 +54,7 @@ Foam::heatTransferCoeffModels::ReynoldsAnalogy::rho(const label patchi) const if (rhoName_ == "rhoInf") { const label n = mesh_.boundary()[patchi].size(); - return tmp<Field<scalar>>(new Field<scalar>(n, rhoRef_)); + return tmp<Field<scalar>>::New(n, rhoRef_); } else if (mesh_.foundObject<volScalarField>(rhoName_, false)) { @@ -77,7 +77,7 @@ Foam::heatTransferCoeffModels::ReynoldsAnalogy::Cp(const label patchi) const if (CpName_ == "CpInf") { const label n = mesh_.boundary()[patchi].size(); - return tmp<Field<scalar>>(new Field<scalar>(n, CpRef_)); + return tmp<Field<scalar>>::New(n, CpRef_); } else if (mesh_.foundObject<fluidThermo>(fluidThermo::typeName)) { diff --git a/src/functionObjects/field/streamLine/streamLineBase.C b/src/functionObjects/field/streamLine/streamLineBase.C index d5730ec1ba457bb35c9803d35e0d7316392d8e0d..7d2a8d3ea64df3c38fd58bdb2fbce7de39dd22b7 100644 --- a/src/functionObjects/field/streamLine/streamLineBase.C +++ b/src/functionObjects/field/streamLine/streamLineBase.C @@ -111,17 +111,14 @@ Foam::functionObjects::streamLineBase::wallPatch() const } } - return autoPtr<indirectPrimitivePatch> + return autoPtr<indirectPrimitivePatch>::New ( - new indirectPrimitivePatch + IndirectList<face> ( - IndirectList<face> - ( - mesh_.faces(), - addressing - ), - mesh_.points() - ) + mesh_.faces(), + addressing + ), + mesh_.points() ); } diff --git a/src/fvAgglomerationMethods/MGridGenGamgAgglomeration/MGridGenGAMGAgglomerate.C b/src/fvAgglomerationMethods/MGridGenGamgAgglomeration/MGridGenGAMGAgglomerate.C index 311df77f7dac967114acf8f507ac77c994423e14..479af608a58fb1de69901b726ac752a14abf9853 100644 --- a/src/fvAgglomerationMethods/MGridGenGamgAgglomeration/MGridGenGAMGAgglomerate.C +++ b/src/fvAgglomerationMethods/MGridGenGamgAgglomeration/MGridGenGAMGAgglomerate.C @@ -170,7 +170,7 @@ Foam::tmp<Foam::labelField> Foam::MGridGenGAMGAgglomeration::agglomerate } } - return tmp<labelField>(new labelField(finalAgglom)); + return tmp<labelField>::New(finalAgglom); } diff --git a/src/fvMotionSolver/motionInterpolation/motionInterpolation/motionInterpolation.C b/src/fvMotionSolver/motionInterpolation/motionInterpolation/motionInterpolation.C index 5210b6e2862b159790e462094d2cc7d30f9bd5c8..932618bf4d055a7b3368ec2e53990c3a5ea60a67 100644 --- a/src/fvMotionSolver/motionInterpolation/motionInterpolation/motionInterpolation.C +++ b/src/fvMotionSolver/motionInterpolation/motionInterpolation/motionInterpolation.C @@ -62,7 +62,7 @@ Foam::motionInterpolation::motionInterpolation Foam::autoPtr<Foam::motionInterpolation> Foam::motionInterpolation::New(const fvMesh& mesh) { - return autoPtr<motionInterpolation>(new motionInterpolation(mesh)); + return autoPtr<motionInterpolation>::New(mesh); } diff --git a/src/fvOptions/sources/derived/rotorDiskSource/rotorDiskSource.C b/src/fvOptions/sources/derived/rotorDiskSource/rotorDiskSource.C index 73ad3e2c899bff295f96c00b89e7b136e56e6ad3..ac8bcf0c378f53c7c72e0ac54abd8f705bead9b7 100644 --- a/src/fvOptions/sources/derived/rotorDiskSource/rotorDiskSource.C +++ b/src/fvOptions/sources/derived/rotorDiskSource/rotorDiskSource.C @@ -441,10 +441,7 @@ Foam::tmp<Foam::vectorField> Foam::fv::rotorDiskSource::inflowVelocity case ifFixed: case ifSurfaceNormal: { - return tmp<vectorField> - ( - new vectorField(mesh_.nCells(), inletVelocity_) - ); + return tmp<vectorField>::New(mesh_.nCells(), inletVelocity_); break; } @@ -461,7 +458,7 @@ Foam::tmp<Foam::vectorField> Foam::fv::rotorDiskSource::inflowVelocity } } - return tmp<vectorField>(new vectorField(mesh_.nCells(), Zero)); + return tmp<vectorField>::New(mesh_.nCells(), Zero); } diff --git a/src/lagrangian/basic/particle/particle.H b/src/lagrangian/basic/particle/particle.H index ef9feafde3fc570a7e2177bebf49eaaf7591f59a..44d8d079ee71d7e2a0aa61d47e7ffef695fa8d31 100644 --- a/src/lagrangian/basic/particle/particle.H +++ b/src/lagrangian/basic/particle/particle.H @@ -419,7 +419,7 @@ public: //- Construct a clone virtual autoPtr<particle> clone() const { - return autoPtr<particle>(new particle(*this)); + return autoPtr<particle>::New(*this); } //- Factory class to read-construct particles used for @@ -437,7 +437,7 @@ public: autoPtr<particle> operator()(Istream& is) const { - return autoPtr<particle>(new particle(mesh_, is, true)); + return autoPtr<particle>::New(mesh_, is, true); } }; diff --git a/src/lagrangian/intermediate/clouds/Templates/KinematicCloud/KinematicCloudI.H b/src/lagrangian/intermediate/clouds/Templates/KinematicCloud/KinematicCloudI.H index bdb245e6e5d9d04c846de1e496326137fd23a1ae..5d3d8d233f38f8aed9c8c8dbb5ceba763713bdf6 100644 --- a/src/lagrangian/intermediate/clouds/Templates/KinematicCloud/KinematicCloudI.H +++ b/src/lagrangian/intermediate/clouds/Templates/KinematicCloud/KinematicCloudI.H @@ -447,7 +447,7 @@ Foam::KinematicCloud<CloudType>::SU(volVectorField& U) const } } - return tmp<fvVectorMatrix>(new fvVectorMatrix(U, dimForce)); + return tmp<fvVectorMatrix>::New(U, dimForce); } diff --git a/src/lagrangian/intermediate/clouds/Templates/ReactingCloud/ReactingCloudI.H b/src/lagrangian/intermediate/clouds/Templates/ReactingCloud/ReactingCloudI.H index 7aa240ba2ae053c992e98273871d5ece2862415e..167c44cc00e0a046686e403182e9de378a66b48f 100644 --- a/src/lagrangian/intermediate/clouds/Templates/ReactingCloud/ReactingCloudI.H +++ b/src/lagrangian/intermediate/clouds/Templates/ReactingCloud/ReactingCloudI.H @@ -149,7 +149,7 @@ inline Foam::tmp<Foam::fvScalarMatrix> Foam::ReactingCloud<CloudType>::SYi } } - return tmp<fvScalarMatrix>(new fvScalarMatrix(Yi, dimMass/dimTime)); + return tmp<fvScalarMatrix>::New(Yi, dimMass/dimTime); } @@ -285,7 +285,7 @@ Foam::ReactingCloud<CloudType>::Srho(volScalarField& rho) const } } - return tmp<fvScalarMatrix>(new fvScalarMatrix(rho, dimMass/dimTime)); + return tmp<fvScalarMatrix>::New(rho, dimMass/dimTime); } diff --git a/src/lagrangian/intermediate/clouds/Templates/ThermoCloud/ThermoCloudI.H b/src/lagrangian/intermediate/clouds/Templates/ThermoCloud/ThermoCloudI.H index d36a15421b6ad2a72e50594d1ad90e8951da7d9f..66a9b2df9bf1b030726208384fdd0b618342fea6 100644 --- a/src/lagrangian/intermediate/clouds/Templates/ThermoCloud/ThermoCloudI.H +++ b/src/lagrangian/intermediate/clouds/Templates/ThermoCloud/ThermoCloudI.H @@ -255,7 +255,7 @@ Foam::ThermoCloud<CloudType>::Sh(volScalarField& hs) const } } - return tmp<fvScalarMatrix>(new fvScalarMatrix(hs, dimEnergy/dimTime)); + return tmp<fvScalarMatrix>::New(hs, dimEnergy/dimTime); } diff --git a/src/lagrangian/molecularDynamics/molecule/molecule/molecule.H b/src/lagrangian/molecularDynamics/molecule/molecule/molecule.H index a33f20ed2d5f8e5d57b4fd116db50d3a59e12828..f59575c80963180f5ece351f1e5f33da7bbf3a51 100644 --- a/src/lagrangian/molecularDynamics/molecule/molecule/molecule.H +++ b/src/lagrangian/molecularDynamics/molecule/molecule/molecule.H @@ -301,7 +301,7 @@ public: autoPtr<molecule> operator()(Istream& is) const { - return autoPtr<molecule>(new molecule(mesh_, is, true)); + return autoPtr<molecule>::New(mesh_, is, true); } }; diff --git a/src/lumpedPointMotion/lumpedPointIOMovement.C b/src/lumpedPointMotion/lumpedPointIOMovement.C index dbe1fde102a8f9c34ea08ceac8d00db933c8cbb0..03b005d107623596259259791b09cb85e696b822 100644 --- a/src/lumpedPointMotion/lumpedPointIOMovement.C +++ b/src/lumpedPointMotion/lumpedPointIOMovement.C @@ -53,21 +53,18 @@ Foam::lumpedPointIOMovement::New label ownerId ) { - return autoPtr<lumpedPointIOMovement> + return autoPtr<lumpedPointIOMovement>::New ( - new lumpedPointIOMovement + IOobject ( - IOobject - ( - lumpedPointMovement::dictionaryName, - obr.time().caseSystem(), - obr, - IOobject::MUST_READ, - IOobject::NO_WRITE, - true // register object - ), - ownerId // tag this patch as owner too - ) + lumpedPointMovement::dictionaryName, + obr.time().caseSystem(), + obr, + IOobject::MUST_READ, + IOobject::NO_WRITE, + true // register object + ), + ownerId // tag this patch as owner too ); } diff --git a/src/lumpedPointMotion/lumpedPointTools.C b/src/lumpedPointMotion/lumpedPointTools.C index fa4e741d01233679a6ad176ff50fa9c827bea284..e842aa8c50f86825dc16e60b513f24db2b15d058 100644 --- a/src/lumpedPointMotion/lumpedPointTools.C +++ b/src/lumpedPointMotion/lumpedPointTools.C @@ -46,22 +46,19 @@ namespace Foam Info<< "Reading " << GeoFieldType::typeName << ' ' << io->name() << endl; - return autoPtr<GeoFieldType> + return autoPtr<GeoFieldType>::New ( - new GeoFieldType + IOobject ( - IOobject - ( - io->name(), - io->instance(), - io->local(), - io->db(), - IOobject::MUST_READ, - IOobject::AUTO_WRITE, - io->registerObject() - ), - mesh - ) + io->name(), + io->instance(), + io->local(), + io->db(), + IOobject::MUST_READ, + IOobject::AUTO_WRITE, + io->registerObject() + ), + mesh ); } diff --git a/src/mesh/blockMesh/blockVertices/blockVertex/blockVertex.C b/src/mesh/blockMesh/blockVertices/blockVertex/blockVertex.C index 9dcf58c9b07af48170a11d5d57bc6ec62a45da61..902295182e470c72166d6c12c260349369ee04fe 100644 --- a/src/mesh/blockMesh/blockVertices/blockVertex/blockVertex.C +++ b/src/mesh/blockMesh/blockVertices/blockVertex/blockVertex.C @@ -92,15 +92,13 @@ Foam::autoPtr<Foam::blockVertex> Foam::blockVertex::New return autoPtr<blockVertex>(cstrIter()(dict, index, geometry, is)); } - else - { - FatalIOErrorInFunction(is) - << "incorrect first token, expected <word> or '(', found " - << firstToken.info() - << exit(FatalIOError); - return autoPtr<blockVertex>(); - } + FatalIOErrorInFunction(is) + << "incorrect first token, expected <word> or '(', found " + << firstToken.info() + << exit(FatalIOError); + + return autoPtr<blockVertex>(); } diff --git a/src/mesh/blockMesh/blocks/block/block.C b/src/mesh/blockMesh/blocks/block/block.C index 481e2ed8802b95c99823e5fbe8f5e43ec030fa53..143994ab5575a81e5327600a099d31f01349ed8d 100644 --- a/src/mesh/blockMesh/blocks/block/block.C +++ b/src/mesh/blockMesh/blocks/block/block.C @@ -78,28 +78,15 @@ Foam::autoPtr<Foam::block> Foam::block::New const word blockOrCellShapeType(is); - auto cstrIter = IstreamConstructorTablePtr_->cfind(blockOrCellShapeType); + auto cstr = IstreamConstructorTablePtr_->cfind(blockOrCellShapeType); - if (!cstrIter.found()) + if (!cstr.found()) { is.putBack(token(blockOrCellShapeType)); - return autoPtr<block>(new block(dict, index, points, edges, faces, is)); - } - else - { - return autoPtr<block> - ( - cstrIter() - ( - dict, - index, - points, - edges, - faces, - is - ) - ); + return autoPtr<block>::New(dict, index, points, edges, faces, is); } + + return autoPtr<block>(cstr()(dict, index, points, edges, faces, is)); } diff --git a/src/mesh/snappyHexMesh/externalDisplacementMeshMover/displacementMeshMoverMotionSolver.C b/src/mesh/snappyHexMesh/externalDisplacementMeshMover/displacementMeshMoverMotionSolver.C index 7e40b1e95f55e88a115b0b5fcb40b5591280607e..5f4d80140344c4f48cf1ad856ce4c37b596c257f 100644 --- a/src/mesh/snappyHexMesh/externalDisplacementMeshMover/displacementMeshMoverMotionSolver.C +++ b/src/mesh/snappyHexMesh/externalDisplacementMeshMover/displacementMeshMoverMotionSolver.C @@ -88,7 +88,7 @@ Foam::displacementMeshMoverMotionSolver::curPoints() const { // Return actual points. Cannot do a reference since complains about // assignment to self in polyMesh::movePoints - return tmp<pointField>(new pointField(mesh().points())); + return tmp<pointField>::New(mesh().points()); } diff --git a/src/mesh/snappyHexMesh/externalDisplacementMeshMover/externalDisplacementMeshMover.C b/src/mesh/snappyHexMesh/externalDisplacementMeshMover/externalDisplacementMeshMover.C index 4da5721d72eb8a2e8f318aff0e7f7acf2560a56b..43ee2771ad44aacbaf1ded79e9a233c8b3b5b67a 100644 --- a/src/mesh/snappyHexMesh/externalDisplacementMeshMover/externalDisplacementMeshMover.C +++ b/src/mesh/snappyHexMesh/externalDisplacementMeshMover/externalDisplacementMeshMover.C @@ -103,13 +103,10 @@ Foam::externalDisplacementMeshMover::getPatch } } - return autoPtr<indirectPrimitivePatch> + return autoPtr<indirectPrimitivePatch>::New ( - new indirectPrimitivePatch - ( - IndirectList<face>(mesh.faces(), addressing), - mesh.points() - ) + IndirectList<face>(mesh.faces(), addressing), + mesh.points() ); } diff --git a/src/mesh/snappyHexMesh/meshRefinement/meshRefinement.C b/src/mesh/snappyHexMesh/meshRefinement/meshRefinement.C index 84c895a95a84bb53ec965465382d5b6be84babb6..89f27066c8ce57117ac9cea91d54aa30b052b161 100644 --- a/src/mesh/snappyHexMesh/meshRefinement/meshRefinement.C +++ b/src/mesh/snappyHexMesh/meshRefinement/meshRefinement.C @@ -1648,13 +1648,10 @@ Foam::autoPtr<Foam::indirectPrimitivePatch> Foam::meshRefinement::makePatch } } - return autoPtr<indirectPrimitivePatch> + return autoPtr<indirectPrimitivePatch>::New ( - new indirectPrimitivePatch - ( - IndirectList<face>(mesh.faces(), addressing), - mesh.points() - ) + IndirectList<face>(mesh.faces(), addressing), + mesh.points() ); } diff --git a/src/mesh/snappyHexMesh/refinementSurfaces/surfaceZonesInfo.H b/src/mesh/snappyHexMesh/refinementSurfaces/surfaceZonesInfo.H index c99c7251ed8dd9d393edf4adfa1ef0a72add8faf..94ce042ab35e95eac5b3561d7f1a13d457254c23 100644 --- a/src/mesh/snappyHexMesh/refinementSurfaces/surfaceZonesInfo.H +++ b/src/mesh/snappyHexMesh/refinementSurfaces/surfaceZonesInfo.H @@ -137,7 +137,7 @@ public: //- Return clone autoPtr<surfaceZonesInfo> clone() const { - return autoPtr<surfaceZonesInfo>(new surfaceZonesInfo(*this)); + return autoPtr<surfaceZonesInfo>::New(*this); } diff --git a/src/mesh/snappyHexMesh/trackedParticle/trackedParticle.H b/src/mesh/snappyHexMesh/trackedParticle/trackedParticle.H index d5266f4a66dc21071c1273f86416b31d075a56c3..bb683ac52b7280841d97987cbb936a404d9cf2b9 100644 --- a/src/mesh/snappyHexMesh/trackedParticle/trackedParticle.H +++ b/src/mesh/snappyHexMesh/trackedParticle/trackedParticle.H @@ -160,7 +160,7 @@ public: //- Construct and return a clone autoPtr<particle> clone() const { - return autoPtr<particle>(new trackedParticle(*this)); + return autoPtr<particle>::NewFrom<trackedParticle>(*this); } //- Factory class to read-construct particles used for @@ -178,10 +178,7 @@ public: autoPtr<trackedParticle> operator()(Istream& is) const { - return autoPtr<trackedParticle> - ( - new trackedParticle(mesh_, is, true) - ); + return autoPtr<trackedParticle>::New(mesh_, is, true); } }; diff --git a/src/meshTools/AMIInterpolation/patches/cyclicACMI/cyclicACMIPolyPatch/cyclicACMIPolyPatch.H b/src/meshTools/AMIInterpolation/patches/cyclicACMI/cyclicACMIPolyPatch/cyclicACMIPolyPatch.H index 5e21fb5be5a5beff6c697d412ba2b8a205b98081..50c2009c341b7c2813c61760eb0581e85320c707 100644 --- a/src/meshTools/AMIInterpolation/patches/cyclicACMI/cyclicACMIPolyPatch/cyclicACMIPolyPatch.H +++ b/src/meshTools/AMIInterpolation/patches/cyclicACMI/cyclicACMIPolyPatch/cyclicACMIPolyPatch.H @@ -179,7 +179,7 @@ public: //- Construct and return a clone, resetting the boundary mesh virtual autoPtr<polyPatch> clone(const polyBoundaryMesh& bm) const { - return autoPtr<polyPatch>(new cyclicACMIPolyPatch(*this, bm)); + return autoPtr<polyPatch>::NewFrom<cyclicACMIPolyPatch>(*this, bm); } //- Construct and return a clone, resetting the face list diff --git a/src/meshTools/AMIInterpolation/patches/cyclicAMI/cyclicAMIPolyPatch/cyclicAMIPolyPatch.H b/src/meshTools/AMIInterpolation/patches/cyclicAMI/cyclicAMIPolyPatch/cyclicAMIPolyPatch.H index 6963aa9d253e5dc091f6c21fad62accb8089653f..287ea33f837747671774509e45b4ae61f905a015 100644 --- a/src/meshTools/AMIInterpolation/patches/cyclicAMI/cyclicAMIPolyPatch/cyclicAMIPolyPatch.H +++ b/src/meshTools/AMIInterpolation/patches/cyclicAMI/cyclicAMIPolyPatch/cyclicAMIPolyPatch.H @@ -220,7 +220,7 @@ public: //- Construct and return a clone, resetting the boundary mesh virtual autoPtr<polyPatch> clone(const polyBoundaryMesh& bm) const { - return autoPtr<polyPatch>(new cyclicAMIPolyPatch(*this, bm)); + return autoPtr<polyPatch>::NewFrom<cyclicAMIPolyPatch>(*this, bm); } //- Construct and return a clone, resetting the face list diff --git a/src/meshTools/coordinateSystems/coordinateRotation/EulerCoordinateRotation.H b/src/meshTools/coordinateSystems/coordinateRotation/EulerCoordinateRotation.H index 53ee185b68e95af8bb8bbf27d6c4f6cfb4d5215e..6b2c44f809a1d880d14881dc0ba9016a5ceb3c08 100644 --- a/src/meshTools/coordinateSystems/coordinateRotation/EulerCoordinateRotation.H +++ b/src/meshTools/coordinateSystems/coordinateRotation/EulerCoordinateRotation.H @@ -138,13 +138,9 @@ public: //- Return clone autoPtr<coordinateRotation> clone() const { - return autoPtr<coordinateRotation> - ( - new EulerCoordinateRotation - ( - *this - ) - ); + return + autoPtr<coordinateRotation>::NewFrom + <EulerCoordinateRotation>(*this); } diff --git a/src/meshTools/coordinateSystems/coordinateRotation/STARCDCoordinateRotation.H b/src/meshTools/coordinateSystems/coordinateRotation/STARCDCoordinateRotation.H index b76da859d196abac32fc384206676baa5660108a..13625e34ba7569f64e64a34c9893efbd3db6e9b2 100644 --- a/src/meshTools/coordinateSystems/coordinateRotation/STARCDCoordinateRotation.H +++ b/src/meshTools/coordinateSystems/coordinateRotation/STARCDCoordinateRotation.H @@ -131,13 +131,9 @@ public: //- Return clone autoPtr<coordinateRotation> clone() const { - return autoPtr<coordinateRotation> - ( - new STARCDCoordinateRotation - ( - *this - ) - ); + return + autoPtr<coordinateRotation>::NewFrom + <STARCDCoordinateRotation>(*this); } diff --git a/src/meshTools/coordinateSystems/coordinateRotation/axesRotation.H b/src/meshTools/coordinateSystems/coordinateRotation/axesRotation.H index ca974fc0e9760aeeb3d93b251afe5bd16f96f67f..4ac0a04928863905126f8d314277101a064c9760 100644 --- a/src/meshTools/coordinateSystems/coordinateRotation/axesRotation.H +++ b/src/meshTools/coordinateSystems/coordinateRotation/axesRotation.H @@ -132,13 +132,12 @@ public: //- Return clone autoPtr<coordinateRotation> clone() const { - return autoPtr<coordinateRotation>(new axesRotation(*this)); + return autoPtr<coordinateRotation>::NewFrom<axesRotation>(*this); } //- Destructor - virtual ~axesRotation() - {} + virtual ~axesRotation() = default; // Member Functions diff --git a/src/meshTools/coordinateSystems/coordinateRotation/cylindrical.H b/src/meshTools/coordinateSystems/coordinateRotation/cylindrical.H index bf2c57879b82e2f817936b0076a880676ddcb824..1c3cd012cf1b946171673edcdeac78c751ab68f5 100644 --- a/src/meshTools/coordinateSystems/coordinateRotation/cylindrical.H +++ b/src/meshTools/coordinateSystems/coordinateRotation/cylindrical.H @@ -128,13 +128,12 @@ public: //- Return clone autoPtr<coordinateRotation> clone() const { - return autoPtr<coordinateRotation>(new cylindrical(*this)); + return autoPtr<coordinateRotation>::NewFrom<cylindrical>(*this); } //- Destructor - virtual ~cylindrical() - {} + virtual ~cylindrical() = default; // Member Functions diff --git a/src/meshTools/coordinateSystems/coordinateSystem.H b/src/meshTools/coordinateSystems/coordinateSystem.H index 4d148b08142b1a9da19623bf45089e68f2fef876..52ee69f1d347345e18035412debd124b351b556f 100644 --- a/src/meshTools/coordinateSystems/coordinateSystem.H +++ b/src/meshTools/coordinateSystems/coordinateSystem.H @@ -199,7 +199,7 @@ public: //- Return clone autoPtr<coordinateSystem> clone() const { - return autoPtr<coordinateSystem>(new coordinateSystem(*this)); + return autoPtr<coordinateSystem>::New(*this); } diff --git a/src/meshTools/coordinateSystems/coordinateSystemNew.C b/src/meshTools/coordinateSystems/coordinateSystemNew.C index 486a12bc8901c69c0fe77cb77a67588fac92c973..bb4c5e9138f0da0f8b7c30357c493c2253d5b013 100644 --- a/src/meshTools/coordinateSystems/coordinateSystemNew.C +++ b/src/meshTools/coordinateSystems/coordinateSystemNew.C @@ -62,7 +62,7 @@ Foam::autoPtr<Foam::coordinateSystem> Foam::coordinateSystem::New { const dictionary& coordDict = dict.subDict(typeName_()); - return autoPtr<coordinateSystem>(new coordinateSystem(coordDict)); + return autoPtr<coordinateSystem>::New(coordDict); } @@ -74,7 +74,7 @@ Foam::autoPtr<Foam::coordinateSystem> Foam::coordinateSystem::New const word name(is); const dictionary dict(is); - return autoPtr<coordinateSystem>(new coordinateSystem(name, dict)); + return autoPtr<coordinateSystem>::New(name, dict); } diff --git a/src/meshTools/edgeMesh/edgeMeshFormats/edgeMesh/edgeMeshFormat.H b/src/meshTools/edgeMesh/edgeMeshFormats/edgeMesh/edgeMeshFormat.H index 8f9d1a6bf6c9d218ccd7499a7e1aea403cf6e624..3a39a1d5f5468c71a9d03c8cda963d9050d621ba 100644 --- a/src/meshTools/edgeMesh/edgeMeshFormats/edgeMesh/edgeMeshFormat.H +++ b/src/meshTools/edgeMesh/edgeMeshFormats/edgeMesh/edgeMeshFormat.H @@ -92,16 +92,12 @@ public: //- Read file and return edgeMesh static autoPtr<edgeMesh> New(const fileName& name) { - return autoPtr<edgeMesh> - ( - new edgeMeshFormat(name) - ); + return autoPtr<edgeMesh>::NewFrom<edgeMeshFormat>(name); } //- Destructor - virtual ~edgeMeshFormat() - {} + virtual ~edgeMeshFormat() = default; // Member Functions diff --git a/src/meshTools/edgeMesh/edgeMeshFormats/extendedFeatureEdgeMesh/extendedFeatureEdgeMeshFormat.H b/src/meshTools/edgeMesh/edgeMeshFormats/extendedFeatureEdgeMesh/extendedFeatureEdgeMeshFormat.H index 3582b2f59f193147ea8050954935a27283a9d5e2..876140ff5e0e5e4520d2f58a7399ac4be822c251 100644 --- a/src/meshTools/edgeMesh/edgeMeshFormats/extendedFeatureEdgeMesh/extendedFeatureEdgeMeshFormat.H +++ b/src/meshTools/edgeMesh/edgeMeshFormats/extendedFeatureEdgeMesh/extendedFeatureEdgeMeshFormat.H @@ -74,16 +74,14 @@ public: //- Read file and return surface static autoPtr<edgeMesh> New(const fileName& name) { - return autoPtr<edgeMesh> - ( - new extendedFeatureEdgeMeshFormat(name) - ); + return + autoPtr<edgeMesh>::NewFrom + <extendedFeatureEdgeMeshFormat>(name); } //- Destructor - virtual ~extendedFeatureEdgeMeshFormat() - {} + virtual ~extendedFeatureEdgeMeshFormat() = default; // Member Functions diff --git a/src/meshTools/edgeMesh/edgeMeshFormats/nas/NASedgeFormat.H b/src/meshTools/edgeMesh/edgeMeshFormats/nas/NASedgeFormat.H index c82d470acfedfac3489d2b5d1049e46b16165445..d5cd410c9d0a069ba2c91963f549ed50da3559e6 100644 --- a/src/meshTools/edgeMesh/edgeMeshFormats/nas/NASedgeFormat.H +++ b/src/meshTools/edgeMesh/edgeMeshFormats/nas/NASedgeFormat.H @@ -82,10 +82,7 @@ public: //- Read file and return edge mesh static autoPtr<edgeMesh> New(const fileName& name) { - return autoPtr<edgeMesh> - ( - new NASedgeFormat(name) - ); + return autoPtr<edgeMesh>::NewFrom<NASedgeFormat>(name); } diff --git a/src/meshTools/edgeMesh/edgeMeshFormats/obj/OBJedgeFormat.H b/src/meshTools/edgeMesh/edgeMeshFormats/obj/OBJedgeFormat.H index 4035782b31c4659cf0756baaecf8d10d6610d371..1b7ff59b9ae1afcae7aee92a2bea0ad1b5ad2ca0 100644 --- a/src/meshTools/edgeMesh/edgeMeshFormats/obj/OBJedgeFormat.H +++ b/src/meshTools/edgeMesh/edgeMeshFormats/obj/OBJedgeFormat.H @@ -78,10 +78,7 @@ public: //- Read file and return surface static autoPtr<edgeMesh> New(const fileName& name) { - return autoPtr<edgeMesh> - ( - new OBJedgeFormat(name) - ); + return autoPtr<edgeMesh>::NewFrom<OBJedgeFormat>(name); } diff --git a/src/meshTools/edgeMesh/edgeMeshFormats/starcd/STARCDedgeFormat.H b/src/meshTools/edgeMesh/edgeMeshFormats/starcd/STARCDedgeFormat.H index 7bed5b3d43bf742503d96b1d849cc6653a865c49..246028b1fa5987bf01b99b9a7ada2cec06c055b8 100644 --- a/src/meshTools/edgeMesh/edgeMeshFormats/starcd/STARCDedgeFormat.H +++ b/src/meshTools/edgeMesh/edgeMeshFormats/starcd/STARCDedgeFormat.H @@ -100,16 +100,12 @@ public: //- Read file and return edgeMesh static autoPtr<edgeMesh> New(const fileName& name) { - return autoPtr<edgeMesh> - ( - new STARCDedgeFormat(name) - ); + return autoPtr<edgeMesh>::NewFrom<STARCDedgeFormat>(name); } //- Destructor - virtual ~STARCDedgeFormat() - {} + virtual ~STARCDedgeFormat() = default; // Member Functions diff --git a/src/meshTools/edgeMesh/edgeMeshFormats/vtk/VTKedgeFormat.H b/src/meshTools/edgeMesh/edgeMeshFormats/vtk/VTKedgeFormat.H index b85e134d757714f4a1cbef7c237a9ce8a831cffb..3cbe13b8124cf8bf2c4d7bbf447090cc44c495cd 100644 --- a/src/meshTools/edgeMesh/edgeMeshFormats/vtk/VTKedgeFormat.H +++ b/src/meshTools/edgeMesh/edgeMeshFormats/vtk/VTKedgeFormat.H @@ -90,16 +90,12 @@ public: //- Read file and return surface static autoPtr<edgeMesh> New(const fileName& name) { - return autoPtr<edgeMesh> - ( - new VTKedgeFormat(name) - ); + return autoPtr<edgeMesh>::NewFrom<VTKedgeFormat>(name); } //- Destructor - virtual ~VTKedgeFormat() - {} + virtual ~VTKedgeFormat() = default; // Member Functions diff --git a/src/meshTools/regionSplit/regionSplit.C b/src/meshTools/regionSplit/regionSplit.C index 2c169ff2443ee8c3f2aae2b5da08e42491a722cb..3a1d74b9497cbcacccce50dc62eda90a5a0ecf95 100644 --- a/src/meshTools/regionSplit/regionSplit.C +++ b/src/meshTools/regionSplit/regionSplit.C @@ -215,7 +215,7 @@ Foam::autoPtr<Foam::globalIndex> Foam::regionSplit::calcRegionSplit compactOffsets[i] = globalToCompact.size(); } - return autoPtr<globalIndex>(new globalIndex(std::move(compactOffsets))); + return autoPtr<globalIndex>::New(std::move(compactOffsets)); } diff --git a/src/meshTools/searchableSurfaces/searchablePlate/searchablePlate.C b/src/meshTools/searchableSurfaces/searchablePlate/searchablePlate.C index 650bb1f3e82b49db53389747471d367700276ccb..5d168e6c0f7a128de22e46e6367b2e71b678dd01 100644 --- a/src/meshTools/searchableSurfaces/searchablePlate/searchablePlate.C +++ b/src/meshTools/searchableSurfaces/searchablePlate/searchablePlate.C @@ -274,7 +274,7 @@ const Foam::wordList& Foam::searchablePlate::regions() const Foam::tmp<Foam::pointField> Foam::searchablePlate::coordinates() const { - return tmp<pointField>(new pointField(1, origin_ + 0.5*span_)); + return tmp<pointField>::New(1, origin_ + 0.5*span_); } diff --git a/src/meshTools/triSurface/triSurfaceTools/pointToPointPlanarInterpolation.C b/src/meshTools/triSurface/triSurfaceTools/pointToPointPlanarInterpolation.C index 38551410c002f726e4181838c2499bd7280630e8..5f87ba232edf27a987664b68ef5f1d90af251b7b 100644 --- a/src/meshTools/triSurface/triSurfaceTools/pointToPointPlanarInterpolation.C +++ b/src/meshTools/triSurface/triSurfaceTools/pointToPointPlanarInterpolation.C @@ -374,17 +374,14 @@ Foam::pointToPointPlanarInterpolation::pointToPointPlanarInterpolation Foam::autoPtr<Foam::pointToPointPlanarInterpolation> Foam::pointToPointPlanarInterpolation::clone() const { - return autoPtr<pointToPointPlanarInterpolation> + return autoPtr<pointToPointPlanarInterpolation>::New ( - new pointToPointPlanarInterpolation - ( - perturb_, - nearestOnly_, - referenceCS_, - nPoints_, - nearestVertex_, - nearestVertexWeight_ - ) + perturb_, + nearestOnly_, + referenceCS_, + nPoints_, + nearestVertex_, + nearestVertexWeight_ ); } diff --git a/src/overset/oversetPolyPatch/oversetGAMGInterface.C b/src/overset/oversetPolyPatch/oversetGAMGInterface.C index e4155338355d434b00f7517e9f023ae57436d132..cae275f9574ea882b3edd1992a49b4e9dcd7a1ac 100644 --- a/src/overset/oversetPolyPatch/oversetGAMGInterface.C +++ b/src/overset/oversetPolyPatch/oversetGAMGInterface.C @@ -257,7 +257,7 @@ Foam::tmp<Foam::labelField> Foam::oversetGAMGInterface::internalFieldTransfer restrictMap_ = restrictMap; } - return tmp<labelField>(new labelField(restrictMap, faceCells())); + return tmp<labelField>::New(restrictMap, faceCells()); } diff --git a/src/regionModels/regionModel/regionModelFunctionObject/regionModelFunctionObject/regionModelFunctionObject.H b/src/regionModels/regionModel/regionModelFunctionObject/regionModelFunctionObject/regionModelFunctionObject.H index e39918ed61b553c7e292505a8f932feca2a76406..fbc9a87dbd8d1cc32180d8865d3242a05901d875 100644 --- a/src/regionModels/regionModel/regionModelFunctionObject/regionModelFunctionObject/regionModelFunctionObject.H +++ b/src/regionModels/regionModel/regionModelFunctionObject/regionModelFunctionObject/regionModelFunctionObject.H @@ -108,10 +108,7 @@ public: //- Construct and return a clone virtual autoPtr<regionModelFunctionObject> clone() const { - return autoPtr<regionModelFunctionObject> - ( - new regionModelFunctionObject(*this) - ); + return autoPtr<regionModelFunctionObject>::New(*this); } diff --git a/src/rigidBodyDynamics/bodies/rigidBody/rigidBody.C b/src/rigidBodyDynamics/bodies/rigidBody/rigidBody.C index 51831470059432141750aa2c2ead1b7caa027edd..262f3898b364c5ddbd68133c7f7882b265e13f82 100644 --- a/src/rigidBodyDynamics/bodies/rigidBody/rigidBody.C +++ b/src/rigidBodyDynamics/bodies/rigidBody/rigidBody.C @@ -50,7 +50,7 @@ namespace RBD Foam::autoPtr<Foam::RBD::rigidBody> Foam::RBD::rigidBody::clone() const { - return autoPtr<rigidBody>(new rigidBody(*this)); + return autoPtr<rigidBody>::New(*this); } @@ -64,7 +64,7 @@ Foam::autoPtr<Foam::RBD::rigidBody> Foam::RBD::rigidBody::New const symmTensor& Ic ) { - return autoPtr<rigidBody>(new rigidBody(name, m, c, Ic)); + return autoPtr<rigidBody>::New(name, m, c, Ic); } diff --git a/src/rigidBodyDynamics/bodies/subBody/subBodyI.H b/src/rigidBodyDynamics/bodies/subBody/subBodyI.H index 103330d58e9070cc2a899e7ef7af98076c3baccf..386912c1d76490a68dfb5755b5869d0fa7319a7b 100644 --- a/src/rigidBodyDynamics/bodies/subBody/subBodyI.H +++ b/src/rigidBodyDynamics/bodies/subBody/subBodyI.H @@ -42,7 +42,7 @@ inline Foam::RBD::subBody::subBody inline Foam::autoPtr<Foam::RBD::subBody> Foam::RBD::subBody::clone() const { - return autoPtr<subBody>(new subBody(*this)); + return autoPtr<subBody>::New(*this); } diff --git a/src/sampling/sampledSurface/isoSurface/sampledIsoSurfaceCellTemplates.C b/src/sampling/sampledSurface/isoSurface/sampledIsoSurfaceCellTemplates.C index 13a7fde3cf08e506abd3e8938e27ca81b66fdd6c..ffaa1ff8c049b0d966e6675abd94e9117a94f4af 100644 --- a/src/sampling/sampledSurface/isoSurface/sampledIsoSurfaceCellTemplates.C +++ b/src/sampling/sampledSurface/isoSurface/sampledIsoSurfaceCellTemplates.C @@ -41,7 +41,7 @@ Foam::sampledIsoSurfaceCell::sampleField // Recreate geometry if time has changed updateGeometry(); - return tmp<Field<Type>>(new Field<Type>(vField, meshCells_)); + return tmp<Field<Type>>::New(vField, meshCells_); } diff --git a/src/sampling/sampledSurface/isoSurface/sampledIsoSurfaceTemplates.C b/src/sampling/sampledSurface/isoSurface/sampledIsoSurfaceTemplates.C index 55acd17b19dc2e2678d3f650c8549855eebc88ac..859c82c741eb26b652ed673314b789e714cfb5e2 100644 --- a/src/sampling/sampledSurface/isoSurface/sampledIsoSurfaceTemplates.C +++ b/src/sampling/sampledSurface/isoSurface/sampledIsoSurfaceTemplates.C @@ -40,7 +40,7 @@ Foam::sampledIsoSurface::sampleField // Recreate geometry if time has changed updateGeometry(); - return tmp<Field<Type>>(new Field<Type>(vField, surface().meshCells())); + return tmp<Field<Type>>::New(vField, surface().meshCells()); } diff --git a/src/sampling/sampledSurface/sampledCuttingPlane/sampledCuttingPlaneTemplates.C b/src/sampling/sampledSurface/sampledCuttingPlane/sampledCuttingPlaneTemplates.C index 8756deabd0ad3947499ede17531e08935be6981a..27dade962d3438992c8a26baca7d75e4c36c5e43 100644 --- a/src/sampling/sampledSurface/sampledCuttingPlane/sampledCuttingPlaneTemplates.C +++ b/src/sampling/sampledSurface/sampledCuttingPlane/sampledCuttingPlaneTemplates.C @@ -37,7 +37,7 @@ Foam::sampledCuttingPlane::sampleField const GeometricField<Type, fvPatchField, volMesh>& vField ) const { - return tmp<Field<Type>>(new Field<Type>(vField, surface().meshCells())); + return tmp<Field<Type>>::New(vField, surface().meshCells()); } diff --git a/src/sampling/sampledSurface/sampledPlane/sampledPlaneTemplates.C b/src/sampling/sampledSurface/sampledPlane/sampledPlaneTemplates.C index f081e27d747e8b99ee7e3ef7e31ecd9a3476e997..070408490e1bbad91114c08a1e35c9543ed55da5 100644 --- a/src/sampling/sampledSurface/sampledPlane/sampledPlaneTemplates.C +++ b/src/sampling/sampledSurface/sampledPlane/sampledPlaneTemplates.C @@ -34,7 +34,7 @@ Foam::sampledPlane::sampleField const GeometricField<Type, fvPatchField, volMesh>& vField ) const { - return tmp<Field<Type>>(new Field<Type>(vField, meshCells())); + return tmp<Field<Type>>::New(vField, meshCells()); } diff --git a/src/sampling/sampledSurface/thresholdCellFaces/sampledThresholdCellFacesTemplates.C b/src/sampling/sampledSurface/thresholdCellFaces/sampledThresholdCellFacesTemplates.C index 5058dcff4ad47a4871e6b37b4bb66a212c35231b..5e8bcb4cd04e8d1894e99f7a3c34943407d5e4c5 100644 --- a/src/sampling/sampledSurface/thresholdCellFaces/sampledThresholdCellFacesTemplates.C +++ b/src/sampling/sampledSurface/thresholdCellFaces/sampledThresholdCellFacesTemplates.C @@ -42,7 +42,7 @@ Foam::sampledThresholdCellFaces::sampleField // Recreate geometry if time has changed updateGeometry(); - return tmp<Field<Type>>(new Field<Type>(vField, meshCells_)); + return tmp<Field<Type>>::New(vField, meshCells_); } diff --git a/src/sampling/surface/cuttingPlane/cuttingPlaneTemplates.C b/src/sampling/surface/cuttingPlane/cuttingPlaneTemplates.C index b774e1e2542f8babcb67578555ceabc6d059d601..a7e82cf14da95e233dfd56296d5b565b4cfc34d8 100644 --- a/src/sampling/surface/cuttingPlane/cuttingPlaneTemplates.C +++ b/src/sampling/surface/cuttingPlane/cuttingPlaneTemplates.C @@ -36,7 +36,7 @@ Foam::tmp<Foam::Field<Type>> Foam::cuttingPlane::sample const Field<Type>& fld ) const { - return tmp<Field<Type>>(new Field<Type>(fld, meshCells())); + return tmp<Field<Type>>::New(fld, meshCells()); } diff --git a/src/sixDoFRigidBodyMotion/sixDoFSolvers/CrankNicolson/CrankNicolson.H b/src/sixDoFRigidBodyMotion/sixDoFSolvers/CrankNicolson/CrankNicolson.H index 4d6a2b82599b207739c9eea0b8f636fa7166c215..83aae25a9b924bef95f265e7a25b5678814c0a8a 100644 --- a/src/sixDoFRigidBodyMotion/sixDoFSolvers/CrankNicolson/CrankNicolson.H +++ b/src/sixDoFRigidBodyMotion/sixDoFSolvers/CrankNicolson/CrankNicolson.H @@ -101,10 +101,7 @@ public: //- Construct and return a clone virtual autoPtr<sixDoFSolver> clone() const { - return autoPtr<sixDoFSolver> - ( - new CrankNicolson(dict_, body_) - ); + return autoPtr<sixDoFSolver>::NewFrom<CrankNicolson>(dict_, body_); } diff --git a/src/sixDoFRigidBodyMotion/sixDoFSolvers/Newmark/Newmark.H b/src/sixDoFRigidBodyMotion/sixDoFSolvers/Newmark/Newmark.H index 2b1241a7196914427cc1ac3953026d87544303d6..80882e7cd9c3f4c7b47322279e0d6428c45edca5 100644 --- a/src/sixDoFRigidBodyMotion/sixDoFSolvers/Newmark/Newmark.H +++ b/src/sixDoFRigidBodyMotion/sixDoFSolvers/Newmark/Newmark.H @@ -99,10 +99,7 @@ public: //- Construct and return a clone virtual autoPtr<sixDoFSolver> clone() const { - return autoPtr<sixDoFSolver> - ( - new Newmark(dict_, body_) - ); + return autoPtr<sixDoFSolver>::NewFrom<Newmark>(dict_, body_); } diff --git a/src/sixDoFRigidBodyMotion/sixDoFSolvers/symplectic/symplectic.H b/src/sixDoFRigidBodyMotion/sixDoFSolvers/symplectic/symplectic.H index 3e360fddd1cda2a15ace0fa8985ba544e7d5718f..32295aef24ae2a57f90f9ebda4c11b10001fa622 100644 --- a/src/sixDoFRigidBodyMotion/sixDoFSolvers/symplectic/symplectic.H +++ b/src/sixDoFRigidBodyMotion/sixDoFSolvers/symplectic/symplectic.H @@ -98,10 +98,7 @@ public: //- Construct and return a clone virtual autoPtr<sixDoFSolver> clone() const { - return autoPtr<sixDoFSolver> - ( - new symplectic(dict_, body_) - ); + return autoPtr<sixDoFSolver>::NewFrom<symplectic>(dict_, body_); } diff --git a/src/surfMesh/surfZone/surfZone/surfZone.H b/src/surfMesh/surfZone/surfZone/surfZone.H index 95685f11c24edee1655521c73c4b5867d5066db8..7507845397382ea5a19dd4537355db354d7cfa74 100644 --- a/src/surfMesh/surfZone/surfZone/surfZone.H +++ b/src/surfMesh/surfZone/surfZone/surfZone.H @@ -123,7 +123,7 @@ public: word name(is); dictionary dict(is); - return autoPtr<surfZone>(new surfZone(name, dict, 0)); + return autoPtr<surfZone>::New(name, dict, 0); } diff --git a/src/thermophysicalModels/chemistryModel/chemistryModel/TDACChemistryModel/TDACChemistryModelI.H b/src/thermophysicalModels/chemistryModel/chemistryModel/TDACChemistryModel/TDACChemistryModelI.H index c76129763568aa2af3fef4e6fb32ae3c86ef6eaf..9d41ffee12916d3fd4b0093bdf4e2ed73890b641 100644 --- a/src/thermophysicalModels/chemistryModel/chemistryModel/TDACChemistryModel/TDACChemistryModelI.H +++ b/src/thermophysicalModels/chemistryModel/chemistryModel/TDACChemistryModel/TDACChemistryModelI.H @@ -46,13 +46,7 @@ inline Foam::autoPtr<Foam::OFstream> Foam::TDACChemistryModel<CompType, ThermoType>::logFile(const word& name) const { mkDir(this->mesh().time().path()/"TDAC"); - return autoPtr<OFstream> - ( - new OFstream - ( - this->mesh().time().path()/"TDAC"/name - ) - ); + return autoPtr<OFstream>::New(this->mesh().time().path()/"TDAC"/name); } diff --git a/src/thermophysicalModels/radiation/submodels/boundaryRadiationProperties/boundaryRadiationProperties.C b/src/thermophysicalModels/radiation/submodels/boundaryRadiationProperties/boundaryRadiationProperties.C index f583e438241ddb3b63bac9ef003bcafb6a51b1c1..7e1f8d06c1169b892094ec6e5ee8c1e8c978f50b 100644 --- a/src/thermophysicalModels/radiation/submodels/boundaryRadiationProperties/boundaryRadiationProperties.C +++ b/src/thermophysicalModels/radiation/submodels/boundaryRadiationProperties/boundaryRadiationProperties.C @@ -96,16 +96,14 @@ Foam::radiation::boundaryRadiationProperties::emissivity { return radBoundaryPropertiesPtrList_[patchi]->emissivity(bandi); } - else - { - FatalErrorInFunction - << "Patch : " << mesh().boundaryMesh()[patchi].name() - << " is not found in the boundaryRadiationProperties. " - << "Please add it" - << exit(FatalError); - return tmp<scalarField>(new scalarField()); - } + FatalErrorInFunction + << "Patch : " << mesh().boundaryMesh()[patchi].name() + << " is not found in the boundaryRadiationProperties. " + << "Please add it" + << exit(FatalError); + + return tmp<scalarField>::New(); } @@ -120,16 +118,14 @@ Foam::radiation::boundaryRadiationProperties::absorptivity { return radBoundaryPropertiesPtrList_[patchi]->absorptivity(bandi); } - else - { - FatalErrorInFunction - << "Patch : " << mesh().boundaryMesh()[patchi].name() - << " is not found in the boundaryRadiationProperties. " - << "Please add it" - << exit(FatalError); - return tmp<scalarField>(new scalarField()); - } + FatalErrorInFunction + << "Patch : " << mesh().boundaryMesh()[patchi].name() + << " is not found in the boundaryRadiationProperties. " + << "Please add it" + << exit(FatalError); + + return tmp<scalarField>::New(); } @@ -144,16 +140,14 @@ Foam::radiation::boundaryRadiationProperties::transmissivity { return radBoundaryPropertiesPtrList_[patchi]->transmissivity(bandi); } - else - { - FatalErrorInFunction - << "Patch : " << mesh().boundaryMesh()[patchi].name() - << " is not found in the boundaryRadiationProperties. " - << "Please add it" - << exit(FatalError); - return tmp<scalarField>(new scalarField()); - } + FatalErrorInFunction + << "Patch : " << mesh().boundaryMesh()[patchi].name() + << " is not found in the boundaryRadiationProperties. " + << "Please add it" + << exit(FatalError); + + return tmp<scalarField>::New(); } @@ -168,16 +162,14 @@ Foam::radiation::boundaryRadiationProperties::reflectivity { return radBoundaryPropertiesPtrList_[patchi]->reflectivity(bandi); } - else - { - FatalErrorInFunction - << "Patch : " << mesh().boundaryMesh()[patchi].name() - << " is not found in the boundaryRadiationProperties. " - << "Please add it" - << exit(FatalError); - return tmp<scalarField>(new scalarField()); - } + FatalErrorInFunction + << "Patch : " << mesh().boundaryMesh()[patchi].name() + << " is not found in the boundaryRadiationProperties. " + << "Please add it" + << exit(FatalError); + + return tmp<scalarField>::New(); } diff --git a/src/thermophysicalModels/solidSpecie/transport/const/constAnIsoSolidTransportI.H b/src/thermophysicalModels/solidSpecie/transport/const/constAnIsoSolidTransportI.H index ee58b30acecc7eacf170cd89c21d715b715b073a..9a03c082543894ec1cda9d0d4d351cbe1274dcac 100644 --- a/src/thermophysicalModels/solidSpecie/transport/const/constAnIsoSolidTransportI.H +++ b/src/thermophysicalModels/solidSpecie/transport/const/constAnIsoSolidTransportI.H @@ -56,10 +56,7 @@ Foam::constAnIsoSolidTransport<Thermo>::New const dictionary& dict ) { - return autoPtr<constAnIsoSolidTransport<Thermo>> - ( - new constAnIsoSolidTransport<Thermo>(dict) - ); + return autoPtr<constAnIsoSolidTransport<Thermo>>::New(dict); } // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // diff --git a/src/thermophysicalModels/solidSpecie/transport/const/constIsoSolidTransportI.H b/src/thermophysicalModels/solidSpecie/transport/const/constIsoSolidTransportI.H index 0065451548a6ad23ff4f06261eb110b33c2e8fe4..dcc6d724e375ae32a05e4e1e961a97ecaf054688 100644 --- a/src/thermophysicalModels/solidSpecie/transport/const/constIsoSolidTransportI.H +++ b/src/thermophysicalModels/solidSpecie/transport/const/constIsoSolidTransportI.H @@ -56,10 +56,7 @@ Foam::constIsoSolidTransport<Thermo>::New const dictionary& dict ) { - return autoPtr<constIsoSolidTransport<Thermo>> - ( - new constIsoSolidTransport<Thermo>(dict) - ); + return autoPtr<constIsoSolidTransport<Thermo>>::New(dict); } // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // diff --git a/src/thermophysicalModels/solidSpecie/transport/exponential/exponentialSolidTransportI.H b/src/thermophysicalModels/solidSpecie/transport/exponential/exponentialSolidTransportI.H index dd5e5e526f26a058a738900cdf5a2d4abe6dac63..dccc02bf6b08cc9d1b6c88d92131dc92990ebb5b 100644 --- a/src/thermophysicalModels/solidSpecie/transport/exponential/exponentialSolidTransportI.H +++ b/src/thermophysicalModels/solidSpecie/transport/exponential/exponentialSolidTransportI.H @@ -62,10 +62,7 @@ Foam::exponentialSolidTransport<Thermo>::New const dictionary& dict ) { - return autoPtr<exponentialSolidTransport<Thermo>> - ( - new exponentialSolidTransport<Thermo>(dict) - ); + return autoPtr<exponentialSolidTransport<Thermo>>::New(dict); } // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // diff --git a/src/thermophysicalModels/solidSpecie/transport/polynomial/polynomialSolidTransportI.H b/src/thermophysicalModels/solidSpecie/transport/polynomial/polynomialSolidTransportI.H index b0cc6e03840f74c77b554274b5f72b8b9e87f3b1..2a60c520cd21fb9a0365c2a0b47a4227ca971b08 100644 --- a/src/thermophysicalModels/solidSpecie/transport/polynomial/polynomialSolidTransportI.H +++ b/src/thermophysicalModels/solidSpecie/transport/polynomial/polynomialSolidTransportI.H @@ -57,10 +57,7 @@ template<class Thermo, int PolySize> inline Foam::autoPtr<Foam::polynomialSolidTransport<Thermo, PolySize>> Foam::polynomialSolidTransport<Thermo, PolySize>::clone() const { - return autoPtr<polynomialSolidTransport<Thermo, PolySize>> - ( - new polynomialSolidTransport<Thermo, PolySize>(*this) - ); + return autoPtr<polynomialSolidTransport<Thermo, PolySize>>::New(*this); } @@ -68,10 +65,7 @@ template<class Thermo, int PolySize> inline Foam::autoPtr<Foam::polynomialSolidTransport<Thermo, PolySize>> Foam::polynomialSolidTransport<Thermo, PolySize>::New(const dictionary& dict) { - return autoPtr<polynomialSolidTransport<Thermo, PolySize>> - ( - new polynomialSolidTransport<Thermo, PolySize>(dict) - ); + return autoPtr<polynomialSolidTransport<Thermo, PolySize>>::New(dict); } diff --git a/src/thermophysicalModels/specie/equationOfState/Boussinesq/BoussinesqI.H b/src/thermophysicalModels/specie/equationOfState/Boussinesq/BoussinesqI.H index 814a9a1e82f5c0f23c68b17cbb1d17adfe579fed..5fbd6313236dc60fba8b5bf391e4f0e51d7a82bc 100644 --- a/src/thermophysicalModels/specie/equationOfState/Boussinesq/BoussinesqI.H +++ b/src/thermophysicalModels/specie/equationOfState/Boussinesq/BoussinesqI.H @@ -59,10 +59,7 @@ template<class Specie> inline Foam::autoPtr<Foam::Boussinesq<Specie>> Foam::Boussinesq<Specie>::clone() const { - return autoPtr<Boussinesq<Specie>> - ( - new Boussinesq<Specie>(*this) - ); + return autoPtr<Boussinesq<Specie>>::New(*this); } @@ -73,10 +70,7 @@ Foam::Boussinesq<Specie>::New const dictionary& dict ) { - return autoPtr<Boussinesq<Specie>> - ( - new Boussinesq<Specie>(dict) - ); + return autoPtr<Boussinesq<Specie>>::New(dict); } diff --git a/src/thermophysicalModels/specie/equationOfState/PengRobinsonGas/PengRobinsonGasI.H b/src/thermophysicalModels/specie/equationOfState/PengRobinsonGas/PengRobinsonGasI.H index 85df8cea5a21fcd0708bb82b45554c987c5beaa7..747f512e674be0cd9ca6a1eb85c929e5eb4dd219 100644 --- a/src/thermophysicalModels/specie/equationOfState/PengRobinsonGas/PengRobinsonGasI.H +++ b/src/thermophysicalModels/specie/equationOfState/PengRobinsonGas/PengRobinsonGasI.H @@ -70,10 +70,7 @@ template<class Specie> inline Foam::autoPtr<Foam::PengRobinsonGas <Specie>> Foam::PengRobinsonGas<Specie>::clone() const { - return autoPtr<PengRobinsonGas<Specie>> - ( - new PengRobinsonGas<Specie>(*this) - ); + return autoPtr<PengRobinsonGas<Specie>>::New(*this); } @@ -84,10 +81,7 @@ Foam::PengRobinsonGas<Specie>::New const dictionary& dict ) { - return autoPtr<PengRobinsonGas<Specie>> - ( - new PengRobinsonGas<Specie>(dict) - ); + return autoPtr<PengRobinsonGas<Specie>>::New(dict); } diff --git a/src/thermophysicalModels/specie/equationOfState/adiabaticPerfectFluid/adiabaticPerfectFluidI.H b/src/thermophysicalModels/specie/equationOfState/adiabaticPerfectFluid/adiabaticPerfectFluidI.H index 57424a902e5b98f48ed83278bf794555990e55a2..41e0ecbc2ab0b4ee4099ebb1f3a0b973a1c59032 100644 --- a/src/thermophysicalModels/specie/equationOfState/adiabaticPerfectFluid/adiabaticPerfectFluidI.H +++ b/src/thermophysicalModels/specie/equationOfState/adiabaticPerfectFluid/adiabaticPerfectFluidI.H @@ -66,10 +66,7 @@ template<class Specie> inline Foam::autoPtr<Foam::adiabaticPerfectFluid<Specie>> Foam::adiabaticPerfectFluid<Specie>::clone() const { - return autoPtr<adiabaticPerfectFluid<Specie>> - ( - new adiabaticPerfectFluid<Specie>(*this) - ); + return autoPtr<adiabaticPerfectFluid<Specie>>::New(*this); } @@ -80,10 +77,7 @@ Foam::adiabaticPerfectFluid<Specie>::New const dictionary& dict ) { - return autoPtr<adiabaticPerfectFluid<Specie>> - ( - new adiabaticPerfectFluid<Specie>(dict) - ); + return autoPtr<adiabaticPerfectFluid<Specie>>::New(dict); } diff --git a/src/thermophysicalModels/specie/equationOfState/icoPolynomial/icoPolynomialI.H b/src/thermophysicalModels/specie/equationOfState/icoPolynomial/icoPolynomialI.H index 66edf3f842a62c4daa73ad2245767e50e3240ea2..2c1550c8f2cde716042d9126373b1d98ceadce13 100644 --- a/src/thermophysicalModels/specie/equationOfState/icoPolynomial/icoPolynomialI.H +++ b/src/thermophysicalModels/specie/equationOfState/icoPolynomial/icoPolynomialI.H @@ -57,10 +57,7 @@ template<class Specie, int PolySize> inline Foam::autoPtr<Foam::icoPolynomial<Specie, PolySize>> Foam::icoPolynomial<Specie, PolySize>::clone() const { - return autoPtr<icoPolynomial<Specie, PolySize>> - ( - new icoPolynomial<Specie, PolySize>(*this) - ); + return autoPtr<icoPolynomial<Specie, PolySize>>::New(*this); } @@ -68,10 +65,7 @@ template<class Specie, int PolySize> inline Foam::autoPtr<Foam::icoPolynomial<Specie, PolySize>> Foam::icoPolynomial<Specie, PolySize>::New(const dictionary& dict) { - return autoPtr<icoPolynomial<Specie, PolySize>> - ( - new icoPolynomial<Specie, PolySize>(dict) - ); + return autoPtr<icoPolynomial<Specie, PolySize>>::New(dict); } diff --git a/src/thermophysicalModels/specie/equationOfState/incompressiblePerfectGas/incompressiblePerfectGasI.H b/src/thermophysicalModels/specie/equationOfState/incompressiblePerfectGas/incompressiblePerfectGasI.H index d04880a6db48b5965a98a04d52a4ea0c62b7e609..2d1b800522da99fb09f19dc273cad1cb8be5924c 100644 --- a/src/thermophysicalModels/specie/equationOfState/incompressiblePerfectGas/incompressiblePerfectGasI.H +++ b/src/thermophysicalModels/specie/equationOfState/incompressiblePerfectGas/incompressiblePerfectGasI.H @@ -55,10 +55,7 @@ template<class Specie> inline Foam::autoPtr<Foam::incompressiblePerfectGas<Specie>> Foam::incompressiblePerfectGas<Specie>::clone() const { - return autoPtr<incompressiblePerfectGas<Specie>> - ( - new incompressiblePerfectGas<Specie>(*this) - ); + return autoPtr<incompressiblePerfectGas<Specie>>::New(*this); } @@ -69,10 +66,7 @@ Foam::incompressiblePerfectGas<Specie>::New const dictionary& dict ) { - return autoPtr<incompressiblePerfectGas<Specie>> - ( - new incompressiblePerfectGas<Specie>(dict) - ); + return autoPtr<incompressiblePerfectGas<Specie>>::New(dict); } diff --git a/src/thermophysicalModels/specie/equationOfState/linear/linearI.H b/src/thermophysicalModels/specie/equationOfState/linear/linearI.H index c3d361d2dc8d2fd3ee2e0b9f010fcee9e937b867..6ca2857ca724c2422ee42055872e3df6d07e5694 100644 --- a/src/thermophysicalModels/specie/equationOfState/linear/linearI.H +++ b/src/thermophysicalModels/specie/equationOfState/linear/linearI.H @@ -60,7 +60,7 @@ template<class Specie> inline Foam::autoPtr<Foam::linear<Specie>> Foam::linear<Specie>::clone() const { - return autoPtr<linear<Specie>>(new linear<Specie>(*this)); + return autoPtr<linear<Specie>>::New(*this); } @@ -71,7 +71,7 @@ Foam::linear<Specie>::New const dictionary& dict ) { - return autoPtr<linear<Specie>>(new linear<Specie>(dict)); + return autoPtr<linear<Specie>>::New(dict); } diff --git a/src/thermophysicalModels/specie/equationOfState/perfectFluid/perfectFluidI.H b/src/thermophysicalModels/specie/equationOfState/perfectFluid/perfectFluidI.H index a16c06c151351470ed350003f5defe0d4f0e9b57..a6019b611a11010cef82ef1f2b8f32f4dab2eaa8 100644 --- a/src/thermophysicalModels/specie/equationOfState/perfectFluid/perfectFluidI.H +++ b/src/thermophysicalModels/specie/equationOfState/perfectFluid/perfectFluidI.H @@ -61,7 +61,7 @@ template<class Specie> inline Foam::autoPtr<Foam::perfectFluid<Specie>> Foam::perfectFluid<Specie>::clone() const { - return autoPtr<perfectFluid<Specie>>(new perfectFluid<Specie>(*this)); + return autoPtr<perfectFluid<Specie>>::New(*this); } @@ -72,7 +72,7 @@ Foam::perfectFluid<Specie>::New const dictionary& dict ) { - return autoPtr<perfectFluid<Specie>>(new perfectFluid<Specie>(dict)); + return autoPtr<perfectFluid<Specie>>::New(dict); } diff --git a/src/thermophysicalModels/specie/equationOfState/perfectGas/perfectGasI.H b/src/thermophysicalModels/specie/equationOfState/perfectGas/perfectGasI.H index e3baad391aa5784614b3a70b7400bd542f45e549..263d2ecca2573dd7fdbb858ae09f0c1fe9d036d9 100644 --- a/src/thermophysicalModels/specie/equationOfState/perfectGas/perfectGasI.H +++ b/src/thermophysicalModels/specie/equationOfState/perfectGas/perfectGasI.H @@ -54,7 +54,7 @@ template<class Specie> inline Foam::autoPtr<Foam::perfectGas<Specie>> Foam::perfectGas<Specie>::clone() const { - return autoPtr<perfectGas<Specie>>(new perfectGas<Specie>(*this)); + return autoPtr<perfectGas<Specie>>::New(*this); } @@ -64,7 +64,7 @@ inline Foam::autoPtr<Foam::perfectGas<Specie>> Foam::perfectGas<Specie>::New const dictionary& dict ) { - return autoPtr<perfectGas<Specie>>(new perfectGas<Specie>(dict)); + return autoPtr<perfectGas<Specie>>::New(dict); } diff --git a/src/thermophysicalModels/specie/equationOfState/rhoConst/rhoConstI.H b/src/thermophysicalModels/specie/equationOfState/rhoConst/rhoConstI.H index ee41587e8a5e20f481bc7bdfe1354c24eee99751..941e3fe86daa54fd351e01dcf41d51434da83da0 100644 --- a/src/thermophysicalModels/specie/equationOfState/rhoConst/rhoConstI.H +++ b/src/thermophysicalModels/specie/equationOfState/rhoConst/rhoConstI.H @@ -57,7 +57,7 @@ template<class Specie> inline Foam::autoPtr<Foam::rhoConst<Specie>> Foam::rhoConst<Specie>::clone() const { - return autoPtr<rhoConst<Specie>>(new rhoConst<Specie>(*this)); + return autoPtr<rhoConst<Specie>>::New(*this); } diff --git a/src/thermophysicalModels/specie/reaction/Reactions/Reaction/Reaction.H b/src/thermophysicalModels/specie/reaction/Reactions/Reaction/Reaction.H index 7b3b8ea571e823e22ecb26e69770ef9ae0c5694f..521ef9987910bdbf6014eac361c8e4e3ae1ce702 100644 --- a/src/thermophysicalModels/specie/reaction/Reactions/Reaction/Reaction.H +++ b/src/thermophysicalModels/specie/reaction/Reactions/Reaction/Reaction.H @@ -212,10 +212,7 @@ public: //- Construct and return a clone virtual autoPtr<Reaction<ReactionThermo>> clone() const // { - return autoPtr<Reaction<ReactionThermo>> - ( - new Reaction<ReactionThermo>(*this) - ); + return autoPtr<Reaction<ReactionThermo>>::New(*this); } //- Construct and return a clone with new speciesTable @@ -224,10 +221,7 @@ public: const speciesTable& species ) const { - return autoPtr<Reaction<ReactionThermo>> - ( - new Reaction<ReactionThermo>(*this, species) - ); + return autoPtr<Reaction<ReactionThermo>>::New(*this, species); } @@ -243,8 +237,7 @@ public: //- Destructor - virtual ~Reaction() - {} + virtual ~Reaction() = default; // Member Functions diff --git a/src/thermophysicalModels/specie/thermo/eConst/eConstThermoI.H b/src/thermophysicalModels/specie/thermo/eConst/eConstThermoI.H index 4b5ba8005a1710870af0095f8203ced1869b1e79..db097b2d64f0f56030793bc5fc42246b3c9e97c4 100644 --- a/src/thermophysicalModels/specie/thermo/eConst/eConstThermoI.H +++ b/src/thermophysicalModels/specie/thermo/eConst/eConstThermoI.H @@ -58,10 +58,7 @@ template<class EquationOfState> inline Foam::autoPtr<Foam::eConstThermo<EquationOfState>> Foam::eConstThermo<EquationOfState>::clone() const { - return autoPtr<eConstThermo<EquationOfState>> - ( - new eConstThermo<EquationOfState>(*this) - ); + return autoPtr<eConstThermo<EquationOfState>>::New(*this); } @@ -69,10 +66,7 @@ template<class EquationOfState> inline Foam::autoPtr<Foam::eConstThermo<EquationOfState>> Foam::eConstThermo<EquationOfState>::New(const dictionary& dict) { - return autoPtr<eConstThermo<EquationOfState>> - ( - new eConstThermo<EquationOfState>(dict) - ); + return autoPtr<eConstThermo<EquationOfState>>::New(dict); } diff --git a/src/thermophysicalModels/specie/thermo/hConst/hConstThermoI.H b/src/thermophysicalModels/specie/thermo/hConst/hConstThermoI.H index 09dcb9860336f2b7599dd2959203e75a05c54fe0..e86b3dd4d5c395c50f7549fb4fb8b7251d352782 100644 --- a/src/thermophysicalModels/specie/thermo/hConst/hConstThermoI.H +++ b/src/thermophysicalModels/specie/thermo/hConst/hConstThermoI.H @@ -58,10 +58,7 @@ template<class EquationOfState> inline Foam::autoPtr<Foam::hConstThermo<EquationOfState>> Foam::hConstThermo<EquationOfState>::clone() const { - return autoPtr<hConstThermo<EquationOfState>> - ( - new hConstThermo<EquationOfState>(*this) - ); + return autoPtr<hConstThermo<EquationOfState>>::New(*this); } @@ -69,10 +66,7 @@ template<class EquationOfState> inline Foam::autoPtr<Foam::hConstThermo<EquationOfState>> Foam::hConstThermo<EquationOfState>::New(const dictionary& dict) { - return autoPtr<hConstThermo<EquationOfState>> - ( - new hConstThermo<EquationOfState>(dict) - ); + return autoPtr<hConstThermo<EquationOfState>>::New(dict); } diff --git a/src/thermophysicalModels/specie/thermo/hPower/hPowerThermoI.H b/src/thermophysicalModels/specie/thermo/hPower/hPowerThermoI.H index 3f22215dbf0314d9611ef67bbec976ee1427ccff..1b79b5582e130dcae18b81ff9776586b2b1b72d4 100644 --- a/src/thermophysicalModels/specie/thermo/hPower/hPowerThermoI.H +++ b/src/thermophysicalModels/specie/thermo/hPower/hPowerThermoI.H @@ -83,10 +83,7 @@ template<class EquationOfState> inline Foam::autoPtr<Foam::hPowerThermo<EquationOfState>> Foam::hPowerThermo<EquationOfState>::clone() const { - return autoPtr<hPowerThermo<EquationOfState>> - ( - new hPowerThermo<EquationOfState>(*this) - ); + return autoPtr<hPowerThermo<EquationOfState>>::New(*this); } @@ -94,10 +91,7 @@ template<class EquationOfState> inline Foam::autoPtr<Foam::hPowerThermo<EquationOfState>> Foam::hPowerThermo<EquationOfState>::New(const dictionary& dict) { - return autoPtr<hPowerThermo<EquationOfState>> - ( - new hPowerThermo<EquationOfState>(dict) - ); + return autoPtr<hPowerThermo<EquationOfState>>::New(dict); } diff --git a/src/thermophysicalModels/specie/thermo/hRefConst/hRefConstThermoI.H b/src/thermophysicalModels/specie/thermo/hRefConst/hRefConstThermoI.H index 575a648ddf12f70319b29aa11b5eaa2aca36b27e..0074b7fa36d44aac53a2945e382ac72d67296d84 100644 --- a/src/thermophysicalModels/specie/thermo/hRefConst/hRefConstThermoI.H +++ b/src/thermophysicalModels/specie/thermo/hRefConst/hRefConstThermoI.H @@ -64,10 +64,7 @@ template<class EquationOfState> inline Foam::autoPtr<Foam::hRefConstThermo<EquationOfState>> Foam::hRefConstThermo<EquationOfState>::clone() const { - return autoPtr<hRefConstThermo<EquationOfState>> - ( - new hRefConstThermo<EquationOfState>(*this) - ); + return autoPtr<hRefConstThermo<EquationOfState>>::New(*this); } @@ -75,10 +72,7 @@ template<class EquationOfState> inline Foam::autoPtr<Foam::hRefConstThermo<EquationOfState>> Foam::hRefConstThermo<EquationOfState>::New(const dictionary& dict) { - return autoPtr<hRefConstThermo<EquationOfState>> - ( - new hRefConstThermo<EquationOfState>(dict) - ); + return autoPtr<hRefConstThermo<EquationOfState>>::New(dict); } diff --git a/src/thermophysicalModels/specie/transport/const/constTransportI.H b/src/thermophysicalModels/specie/transport/const/constTransportI.H index ab865dd9abb5fbb7cb29b43a2bb71c1ae89a1633..0aecbc9687315999d938c0671a5919c1231ae710 100644 --- a/src/thermophysicalModels/specie/transport/const/constTransportI.H +++ b/src/thermophysicalModels/specie/transport/const/constTransportI.H @@ -56,10 +56,7 @@ template<class Thermo> inline Foam::autoPtr<Foam::constTransport<Thermo>> Foam::constTransport<Thermo>::clone() const { - return autoPtr<constTransport<Thermo>> - ( - new constTransport<Thermo>(*this) - ); + return autoPtr<constTransport<Thermo>>::New(*this); } @@ -70,10 +67,7 @@ Foam::constTransport<Thermo>::New const dictionary& dict ) { - return autoPtr<constTransport<Thermo>> - ( - new constTransport<Thermo>(dict) - ); + return autoPtr<constTransport<Thermo>>::New(dict); } diff --git a/src/thermophysicalModels/specie/transport/logPolynomial/logPolynomialTransportI.H b/src/thermophysicalModels/specie/transport/logPolynomial/logPolynomialTransportI.H index 558c41eb481603b76eb452424f43e369d22edccf..3a95c68bc4a11f743c7dfa7b9c49f92d5c1fb095 100644 --- a/src/thermophysicalModels/specie/transport/logPolynomial/logPolynomialTransportI.H +++ b/src/thermophysicalModels/specie/transport/logPolynomial/logPolynomialTransportI.H @@ -58,10 +58,7 @@ template<class Thermo, int PolySize> inline Foam::autoPtr<Foam::logPolynomialTransport<Thermo, PolySize>> Foam::logPolynomialTransport<Thermo, PolySize>::clone() const { - return autoPtr<logPolynomialTransport<Thermo, PolySize>> - ( - new logPolynomialTransport<Thermo, PolySize>(*this) - ); + return autoPtr<logPolynomialTransport<Thermo, PolySize>>::New(*this); } @@ -69,10 +66,7 @@ template<class Thermo, int PolySize> inline Foam::autoPtr<Foam::logPolynomialTransport<Thermo, PolySize>> Foam::logPolynomialTransport<Thermo, PolySize>::New(const dictionary& dict) { - return autoPtr<logPolynomialTransport<Thermo, PolySize>> - ( - new logPolynomialTransport<Thermo, PolySize>(dict) - ); + return autoPtr<logPolynomialTransport<Thermo, PolySize>>::New(dict); } diff --git a/src/thermophysicalModels/specie/transport/polynomial/polynomialTransportI.H b/src/thermophysicalModels/specie/transport/polynomial/polynomialTransportI.H index 6540d00ed44e034d011dd996a5eb263bab6ae6e4..6f6caaea451ea725b1f2ed2a05eb426ffc60752e 100644 --- a/src/thermophysicalModels/specie/transport/polynomial/polynomialTransportI.H +++ b/src/thermophysicalModels/specie/transport/polynomial/polynomialTransportI.H @@ -58,10 +58,7 @@ template<class Thermo, int PolySize> inline Foam::autoPtr<Foam::polynomialTransport<Thermo, PolySize>> Foam::polynomialTransport<Thermo, PolySize>::clone() const { - return autoPtr<polynomialTransport<Thermo, PolySize>> - ( - new polynomialTransport<Thermo, PolySize>(*this) - ); + return autoPtr<polynomialTransport<Thermo, PolySize>>::New(*this); } @@ -69,10 +66,7 @@ template<class Thermo, int PolySize> inline Foam::autoPtr<Foam::polynomialTransport<Thermo, PolySize>> Foam::polynomialTransport<Thermo, PolySize>::New(const dictionary& dict) { - return autoPtr<polynomialTransport<Thermo, PolySize>> - ( - new polynomialTransport<Thermo, PolySize>(dict) - ); + return autoPtr<polynomialTransport<Thermo, PolySize>>::New(dict); } diff --git a/src/thermophysicalModels/specie/transport/sutherland/sutherlandTransportI.H b/src/thermophysicalModels/specie/transport/sutherland/sutherlandTransportI.H index e9a16c4ca11de75ccfa8922219c1c07b54ec4883..213036534188a376fbcdcc7b92cf592e858c0c2a 100644 --- a/src/thermophysicalModels/specie/transport/sutherland/sutherlandTransportI.H +++ b/src/thermophysicalModels/specie/transport/sutherland/sutherlandTransportI.H @@ -91,10 +91,7 @@ template<class Thermo> inline Foam::autoPtr<Foam::sutherlandTransport<Thermo>> Foam::sutherlandTransport<Thermo>::clone() const { - return autoPtr<sutherlandTransport<Thermo>> - ( - new sutherlandTransport<Thermo>(*this) - ); + return autoPtr<sutherlandTransport<Thermo>>::New(*this); } @@ -105,10 +102,7 @@ Foam::sutherlandTransport<Thermo>::New const dictionary& dict ) { - return autoPtr<sutherlandTransport<Thermo>> - ( - new sutherlandTransport<Thermo>(dict) - ); + return autoPtr<sutherlandTransport<Thermo>>::New(dict); } diff --git a/src/thermophysicalModels/thermophysicalProperties/liquidProperties/Ar/Ar.H b/src/thermophysicalModels/thermophysicalProperties/liquidProperties/Ar/Ar.H index a84320b96dd412fa4400fc00b83a8c44c0201113..cff78c96761c8c68d768a339b969cf3253223e97 100644 --- a/src/thermophysicalModels/thermophysicalProperties/liquidProperties/Ar/Ar.H +++ b/src/thermophysicalModels/thermophysicalProperties/liquidProperties/Ar/Ar.H @@ -115,7 +115,7 @@ public: //- Construct and return clone virtual autoPtr<liquidProperties> clone() const { - return autoPtr<liquidProperties>(new Ar(*this)); + return autoPtr<liquidProperties>::NewFrom<Ar>(*this); } diff --git a/src/thermophysicalModels/thermophysicalProperties/liquidProperties/C10H22/C10H22.H b/src/thermophysicalModels/thermophysicalProperties/liquidProperties/C10H22/C10H22.H index 216acbf1581655e882d78b569622e7683170d820..3938c90d267d336d88278cf6b782de8fdadee0a9 100644 --- a/src/thermophysicalModels/thermophysicalProperties/liquidProperties/C10H22/C10H22.H +++ b/src/thermophysicalModels/thermophysicalProperties/liquidProperties/C10H22/C10H22.H @@ -115,7 +115,7 @@ public: //- Construct and return clone virtual autoPtr<liquidProperties> clone() const { - return autoPtr<liquidProperties>(new C10H22(*this)); + return autoPtr<liquidProperties>::NewFrom<C10H22>(*this); } diff --git a/src/thermophysicalModels/thermophysicalProperties/liquidProperties/C12H26/C12H26.H b/src/thermophysicalModels/thermophysicalProperties/liquidProperties/C12H26/C12H26.H index e50af5035fc5c854d1bc29c7fdc967702cd9ab58..f2214a0049b1d9aa494fa9776770f317bf516d55 100644 --- a/src/thermophysicalModels/thermophysicalProperties/liquidProperties/C12H26/C12H26.H +++ b/src/thermophysicalModels/thermophysicalProperties/liquidProperties/C12H26/C12H26.H @@ -115,7 +115,7 @@ public: //- Construct and return clone virtual autoPtr<liquidProperties> clone() const { - return autoPtr<liquidProperties>(new C12H26(*this)); + return autoPtr<liquidProperties>::NewFrom<C12H26>(*this); } diff --git a/src/thermophysicalModels/thermophysicalProperties/liquidProperties/C13H28/C13H28.H b/src/thermophysicalModels/thermophysicalProperties/liquidProperties/C13H28/C13H28.H index c8ebfdfdb0a2c0ef92d74e1b1b8233104197e033..d250ca4ef1fd23c122d1a3ca798027a46a76a14c 100644 --- a/src/thermophysicalModels/thermophysicalProperties/liquidProperties/C13H28/C13H28.H +++ b/src/thermophysicalModels/thermophysicalProperties/liquidProperties/C13H28/C13H28.H @@ -115,7 +115,7 @@ public: //- Construct and return clone virtual autoPtr<liquidProperties> clone() const { - return autoPtr<liquidProperties>(new C13H28(*this)); + return autoPtr<liquidProperties>::NewFrom<C13H28>(*this); } diff --git a/src/thermophysicalModels/thermophysicalProperties/liquidProperties/C14H30/C14H30.H b/src/thermophysicalModels/thermophysicalProperties/liquidProperties/C14H30/C14H30.H index 68351c2d4111d725c985a8804571d56cc12549e8..74db926556fbb817c3e5bbcb29c0fa631973d991 100644 --- a/src/thermophysicalModels/thermophysicalProperties/liquidProperties/C14H30/C14H30.H +++ b/src/thermophysicalModels/thermophysicalProperties/liquidProperties/C14H30/C14H30.H @@ -115,7 +115,7 @@ public: //- Construct and return clone virtual autoPtr<liquidProperties> clone() const { - return autoPtr<liquidProperties>(new C14H30(*this)); + return autoPtr<liquidProperties>::NewFrom<C14H30>(*this); } diff --git a/src/thermophysicalModels/thermophysicalProperties/liquidProperties/C16H34/C16H34.H b/src/thermophysicalModels/thermophysicalProperties/liquidProperties/C16H34/C16H34.H index a42139cc5aed0e0be5085c344a3d88e2ee952e35..aca1e87f9deb3994035a85c9a28dc0f233a1f26d 100644 --- a/src/thermophysicalModels/thermophysicalProperties/liquidProperties/C16H34/C16H34.H +++ b/src/thermophysicalModels/thermophysicalProperties/liquidProperties/C16H34/C16H34.H @@ -115,7 +115,7 @@ public: //- Construct and return clone virtual autoPtr<liquidProperties> clone() const { - return autoPtr<liquidProperties>(new C16H34(*this)); + return autoPtr<liquidProperties>::NewFrom<C16H34>(*this); } diff --git a/src/thermophysicalModels/thermophysicalProperties/liquidProperties/C2H5OH/C2H5OH.H b/src/thermophysicalModels/thermophysicalProperties/liquidProperties/C2H5OH/C2H5OH.H index 4d06bdb04219881403934adb075461ec676d24a8..b97524a6adc9db4db755115e018016eaf41ae481 100644 --- a/src/thermophysicalModels/thermophysicalProperties/liquidProperties/C2H5OH/C2H5OH.H +++ b/src/thermophysicalModels/thermophysicalProperties/liquidProperties/C2H5OH/C2H5OH.H @@ -115,7 +115,7 @@ public: //- Construct and return clone virtual autoPtr<liquidProperties> clone() const { - return autoPtr<liquidProperties>(new C2H5OH(*this)); + return autoPtr<liquidProperties>::NewFrom<C2H5OH>(*this); } diff --git a/src/thermophysicalModels/thermophysicalProperties/liquidProperties/C2H6/C2H6.H b/src/thermophysicalModels/thermophysicalProperties/liquidProperties/C2H6/C2H6.H index 9f69f702988b6d500a5895ef6f2ce1e776f70acc..b672b6183497dd4a4eb05b15638e1bd4f2889a4f 100644 --- a/src/thermophysicalModels/thermophysicalProperties/liquidProperties/C2H6/C2H6.H +++ b/src/thermophysicalModels/thermophysicalProperties/liquidProperties/C2H6/C2H6.H @@ -115,7 +115,7 @@ public: //- Construct and return clone virtual autoPtr<liquidProperties> clone() const { - return autoPtr<liquidProperties>(new C2H6(*this)); + return autoPtr<liquidProperties>::NewFrom<C2H6>(*this); } diff --git a/src/thermophysicalModels/thermophysicalProperties/liquidProperties/C2H6O/C2H6O.H b/src/thermophysicalModels/thermophysicalProperties/liquidProperties/C2H6O/C2H6O.H index ec54cee6c30e715c167e005c0fee6769be808ba4..dec9e8377a7453fe5d8dca80e0e246d7c895557b 100644 --- a/src/thermophysicalModels/thermophysicalProperties/liquidProperties/C2H6O/C2H6O.H +++ b/src/thermophysicalModels/thermophysicalProperties/liquidProperties/C2H6O/C2H6O.H @@ -115,7 +115,7 @@ public: //- Construct and return clone virtual autoPtr<liquidProperties> clone() const { - return autoPtr<liquidProperties>(new C2H6O(*this)); + return autoPtr<liquidProperties>::NewFrom<C2H6O>(*this); } diff --git a/src/thermophysicalModels/thermophysicalProperties/liquidProperties/C3H6O/C3H6O.H b/src/thermophysicalModels/thermophysicalProperties/liquidProperties/C3H6O/C3H6O.H index f1f770a5244f1ada723d0034b26860d66234e9d9..ae10112eb3ecdbc08530d45ac1f109f08915ae7e 100644 --- a/src/thermophysicalModels/thermophysicalProperties/liquidProperties/C3H6O/C3H6O.H +++ b/src/thermophysicalModels/thermophysicalProperties/liquidProperties/C3H6O/C3H6O.H @@ -115,7 +115,7 @@ public: //- Construct and return clone virtual autoPtr<liquidProperties> clone() const { - return autoPtr<liquidProperties>(new C3H6O(*this)); + return autoPtr<liquidProperties>::NewFrom<C3H6O>(*this); } diff --git a/src/thermophysicalModels/thermophysicalProperties/liquidProperties/C3H8/C3H8.H b/src/thermophysicalModels/thermophysicalProperties/liquidProperties/C3H8/C3H8.H index 950b6e6085c08f1af5770d65bc697c62e7ab7ce1..682cf3d5232e267667b8339bdd05e90dfdd765eb 100644 --- a/src/thermophysicalModels/thermophysicalProperties/liquidProperties/C3H8/C3H8.H +++ b/src/thermophysicalModels/thermophysicalProperties/liquidProperties/C3H8/C3H8.H @@ -115,7 +115,7 @@ public: //- Construct and return clone virtual autoPtr<liquidProperties> clone() const { - return autoPtr<liquidProperties>(new C3H8(*this)); + return autoPtr<liquidProperties>::NewFrom<C3H8>(*this); } diff --git a/src/thermophysicalModels/thermophysicalProperties/liquidProperties/C4H10O/C4H10O.H b/src/thermophysicalModels/thermophysicalProperties/liquidProperties/C4H10O/C4H10O.H index 1049d3692fa27dc4216383d7b507e555f030a275..b9983114f576a67e1fdf5183ce5567919cae5727 100644 --- a/src/thermophysicalModels/thermophysicalProperties/liquidProperties/C4H10O/C4H10O.H +++ b/src/thermophysicalModels/thermophysicalProperties/liquidProperties/C4H10O/C4H10O.H @@ -115,7 +115,7 @@ public: //- Construct and return clone virtual autoPtr<liquidProperties> clone() const { - return autoPtr<liquidProperties>(new C4H10O(*this)); + return autoPtr<liquidProperties>::NewFrom<C4H10O>(*this); } diff --git a/src/thermophysicalModels/thermophysicalProperties/liquidProperties/C6H14/C6H14.H b/src/thermophysicalModels/thermophysicalProperties/liquidProperties/C6H14/C6H14.H index da6301802ffbfa5a10234c97d39267241f3f1a52..bceb8ca29c2a7d71ae5146a038ab5fba265dfff1 100644 --- a/src/thermophysicalModels/thermophysicalProperties/liquidProperties/C6H14/C6H14.H +++ b/src/thermophysicalModels/thermophysicalProperties/liquidProperties/C6H14/C6H14.H @@ -115,7 +115,7 @@ public: //- Construct and return clone virtual autoPtr<liquidProperties> clone() const { - return autoPtr<liquidProperties>(new C6H14(*this)); + return autoPtr<liquidProperties>::NewFrom<C6H14>(*this); } diff --git a/src/thermophysicalModels/thermophysicalProperties/liquidProperties/C6H6/C6H6.H b/src/thermophysicalModels/thermophysicalProperties/liquidProperties/C6H6/C6H6.H index da7a6f32bea6ace32473f868d2c7528adb5d0778..c326757d7fa1db32e8e12185384de9d610ea4dae 100644 --- a/src/thermophysicalModels/thermophysicalProperties/liquidProperties/C6H6/C6H6.H +++ b/src/thermophysicalModels/thermophysicalProperties/liquidProperties/C6H6/C6H6.H @@ -115,7 +115,7 @@ public: //- Construct and return clone virtual autoPtr<liquidProperties> clone() const { - return autoPtr<liquidProperties>(new C6H6(*this)); + return autoPtr<liquidProperties>::NewFrom<C6H6>(*this); } diff --git a/src/thermophysicalModels/thermophysicalProperties/liquidProperties/C7H16/C7H16.H b/src/thermophysicalModels/thermophysicalProperties/liquidProperties/C7H16/C7H16.H index c30a0d4cdceb6dc4a24157a962216735856e2c62..62937c2f025abea8a66363ba27edd5393bed8911 100644 --- a/src/thermophysicalModels/thermophysicalProperties/liquidProperties/C7H16/C7H16.H +++ b/src/thermophysicalModels/thermophysicalProperties/liquidProperties/C7H16/C7H16.H @@ -115,7 +115,7 @@ public: //- Construct and return clone virtual autoPtr<liquidProperties> clone() const { - return autoPtr<liquidProperties>(new C7H16(*this)); + return autoPtr<liquidProperties>::NewFrom<C7H16>(*this); } diff --git a/src/thermophysicalModels/thermophysicalProperties/liquidProperties/C7H8/C7H8.H b/src/thermophysicalModels/thermophysicalProperties/liquidProperties/C7H8/C7H8.H index 16bbb8364a34ef2e0a34863b56a201ce622855c5..d8a42d6c871541cf5b56ab866cefe7daf539c6ae 100644 --- a/src/thermophysicalModels/thermophysicalProperties/liquidProperties/C7H8/C7H8.H +++ b/src/thermophysicalModels/thermophysicalProperties/liquidProperties/C7H8/C7H8.H @@ -115,7 +115,7 @@ public: //- Construct and return clone virtual autoPtr<liquidProperties> clone() const { - return autoPtr<liquidProperties>(new C7H8(*this)); + return autoPtr<liquidProperties>::NewFrom<C7H8>(*this); } diff --git a/src/thermophysicalModels/thermophysicalProperties/liquidProperties/C8H10/C8H10.H b/src/thermophysicalModels/thermophysicalProperties/liquidProperties/C8H10/C8H10.H index 856071437efc6e3b62288db6cc696f5f626c0bf4..2f89af9431eab63bf50e6f248d4dfd8faec11c4d 100644 --- a/src/thermophysicalModels/thermophysicalProperties/liquidProperties/C8H10/C8H10.H +++ b/src/thermophysicalModels/thermophysicalProperties/liquidProperties/C8H10/C8H10.H @@ -114,7 +114,7 @@ public: //- Construct and return clone virtual autoPtr<liquidProperties> clone() const { - return autoPtr<liquidProperties>(new C8H10(*this)); + return autoPtr<liquidProperties>::NewFrom<C8H10>(*this); } diff --git a/src/thermophysicalModels/thermophysicalProperties/liquidProperties/C8H18/C8H18.H b/src/thermophysicalModels/thermophysicalProperties/liquidProperties/C8H18/C8H18.H index caf1ad885a65cea5c1370b3407203fbc1e7b01a1..7406070e3bd9b2c99cdc8a4167cbfe2744781969 100644 --- a/src/thermophysicalModels/thermophysicalProperties/liquidProperties/C8H18/C8H18.H +++ b/src/thermophysicalModels/thermophysicalProperties/liquidProperties/C8H18/C8H18.H @@ -115,7 +115,7 @@ public: //- Construct and return clone virtual autoPtr<liquidProperties> clone() const { - return autoPtr<liquidProperties>(new C8H18(*this)); + return autoPtr<liquidProperties>::NewFrom<C8H18>(*this); } diff --git a/src/thermophysicalModels/thermophysicalProperties/liquidProperties/C9H20/C9H20.H b/src/thermophysicalModels/thermophysicalProperties/liquidProperties/C9H20/C9H20.H index 72d2d6f9378afe02c66f9628f0b83bb7779ed334..05e0bd83e3bd5a800f8d8d664b069afe4a25b0d5 100644 --- a/src/thermophysicalModels/thermophysicalProperties/liquidProperties/C9H20/C9H20.H +++ b/src/thermophysicalModels/thermophysicalProperties/liquidProperties/C9H20/C9H20.H @@ -115,7 +115,7 @@ public: //- Construct and return clone virtual autoPtr<liquidProperties> clone() const { - return autoPtr<liquidProperties>(new C9H20(*this)); + return autoPtr<liquidProperties>::NewFrom<C9H20>(*this); } diff --git a/src/thermophysicalModels/thermophysicalProperties/liquidProperties/CH3OH/CH3OH.H b/src/thermophysicalModels/thermophysicalProperties/liquidProperties/CH3OH/CH3OH.H index 0d359ed8311e1bb8c378469b5de68d25f9ded2cb..ccca8a2a878159abaac79b42bdfdac3c42017644 100644 --- a/src/thermophysicalModels/thermophysicalProperties/liquidProperties/CH3OH/CH3OH.H +++ b/src/thermophysicalModels/thermophysicalProperties/liquidProperties/CH3OH/CH3OH.H @@ -115,7 +115,7 @@ public: //- Construct and return clone virtual autoPtr<liquidProperties> clone() const { - return autoPtr<liquidProperties>(new CH3OH(*this)); + return autoPtr<liquidProperties>::NewFrom<CH3OH>(*this); } diff --git a/src/thermophysicalModels/thermophysicalProperties/liquidProperties/CH4N2O/CH4N2O.H b/src/thermophysicalModels/thermophysicalProperties/liquidProperties/CH4N2O/CH4N2O.H index 2e8be163aced519b04bb393ca0b7c2d88e25d616..ad71f9ec8c4e589789c8af30f5e3255d50829fd3 100644 --- a/src/thermophysicalModels/thermophysicalProperties/liquidProperties/CH4N2O/CH4N2O.H +++ b/src/thermophysicalModels/thermophysicalProperties/liquidProperties/CH4N2O/CH4N2O.H @@ -115,7 +115,7 @@ public: //- Construct and return clone virtual autoPtr<liquidProperties> clone() const { - return autoPtr<liquidProperties>(new CH4N2O(*this)); + return autoPtr<liquidProperties>::NewFrom<CH4N2O>(*this); } diff --git a/src/thermophysicalModels/thermophysicalProperties/liquidProperties/H2O/H2O.H b/src/thermophysicalModels/thermophysicalProperties/liquidProperties/H2O/H2O.H index dfa48fd32c4551f255ba91595e7fb97d147221e7..5387de64780e8e80c792ca8b68f9033aa0caab97 100644 --- a/src/thermophysicalModels/thermophysicalProperties/liquidProperties/H2O/H2O.H +++ b/src/thermophysicalModels/thermophysicalProperties/liquidProperties/H2O/H2O.H @@ -114,7 +114,7 @@ public: //- Construct and return clone virtual autoPtr<liquidProperties> clone() const { - return autoPtr<liquidProperties>(new H2O(*this)); + return autoPtr<liquidProperties>::NewFrom<H2O>(*this); } diff --git a/src/thermophysicalModels/thermophysicalProperties/liquidProperties/IC8H18/IC8H18.H b/src/thermophysicalModels/thermophysicalProperties/liquidProperties/IC8H18/IC8H18.H index 9be7f5885cd0d0d6d8eb64e057be591902dbc161..71ee57d79384546fc7270fc04faf3ec1e0072117 100644 --- a/src/thermophysicalModels/thermophysicalProperties/liquidProperties/IC8H18/IC8H18.H +++ b/src/thermophysicalModels/thermophysicalProperties/liquidProperties/IC8H18/IC8H18.H @@ -115,7 +115,7 @@ public: //- Construct and return clone virtual autoPtr<liquidProperties> clone() const { - return autoPtr<liquidProperties>(new IC8H18(*this)); + return autoPtr<liquidProperties>::NewFrom<IC8H18>(*this); } diff --git a/src/thermophysicalModels/thermophysicalProperties/liquidProperties/IDEA/IDEA.H b/src/thermophysicalModels/thermophysicalProperties/liquidProperties/IDEA/IDEA.H index dccf97c4fcc06a3a345d8a9afbc32d4cf6633e4d..361cf3f1e153d4d61ac80e6bbaea09b128777873 100644 --- a/src/thermophysicalModels/thermophysicalProperties/liquidProperties/IDEA/IDEA.H +++ b/src/thermophysicalModels/thermophysicalProperties/liquidProperties/IDEA/IDEA.H @@ -137,7 +137,7 @@ public: //- Construct and return clone virtual autoPtr<liquidProperties> clone() const { - return autoPtr<liquidProperties>(new IDEA(*this)); + return autoPtr<liquidProperties>::NewFrom<IDEA>(*this); } diff --git a/src/thermophysicalModels/thermophysicalProperties/liquidProperties/MB/MB.H b/src/thermophysicalModels/thermophysicalProperties/liquidProperties/MB/MB.H index 9b0c7fd430891accdbd2c15b84a8e0b02b382a8a..6ace085030dff35113423d1c560f0aea06b7f1e7 100644 --- a/src/thermophysicalModels/thermophysicalProperties/liquidProperties/MB/MB.H +++ b/src/thermophysicalModels/thermophysicalProperties/liquidProperties/MB/MB.H @@ -115,7 +115,7 @@ public: //- Construct and return clone virtual autoPtr<liquidProperties> clone() const { - return autoPtr<liquidProperties>(new MB(*this)); + return autoPtr<liquidProperties>::NewFrom<MB>(*this); } diff --git a/src/thermophysicalModels/thermophysicalProperties/liquidProperties/N2/N2.H b/src/thermophysicalModels/thermophysicalProperties/liquidProperties/N2/N2.H index db637e421f4e77693a4147d996bb1e4b3d9f40d6..6e374c6913ffd2b5fc58e76ed804de15d8465929 100644 --- a/src/thermophysicalModels/thermophysicalProperties/liquidProperties/N2/N2.H +++ b/src/thermophysicalModels/thermophysicalProperties/liquidProperties/N2/N2.H @@ -115,7 +115,7 @@ public: //- Construct and return clone virtual autoPtr<liquidProperties> clone() const { - return autoPtr<liquidProperties>(new N2(*this)); + return autoPtr<liquidProperties>::NewFrom<N2>(*this); } diff --git a/src/thermophysicalModels/thermophysicalProperties/liquidProperties/aC10H7CH3/aC10H7CH3.H b/src/thermophysicalModels/thermophysicalProperties/liquidProperties/aC10H7CH3/aC10H7CH3.H index 370609e2f6f6cffe8f4c956a3f20fcc7e82b881f..c32964009bd6cd5a45cb870217d2fa42b2573f47 100644 --- a/src/thermophysicalModels/thermophysicalProperties/liquidProperties/aC10H7CH3/aC10H7CH3.H +++ b/src/thermophysicalModels/thermophysicalProperties/liquidProperties/aC10H7CH3/aC10H7CH3.H @@ -115,7 +115,7 @@ public: //- Construct and return clone virtual autoPtr<liquidProperties> clone() const { - return autoPtr<liquidProperties>(new aC10H7CH3(*this)); + return autoPtr<liquidProperties>::NewFrom<aC10H7CH3>(*this); } diff --git a/src/thermophysicalModels/thermophysicalProperties/liquidProperties/bC10H7CH3/bC10H7CH3.H b/src/thermophysicalModels/thermophysicalProperties/liquidProperties/bC10H7CH3/bC10H7CH3.H index 07e700773d07a841b0fb6a9cd96207cbc4a899bb..4d705c7a55dbc276e6690855272478815086f713 100644 --- a/src/thermophysicalModels/thermophysicalProperties/liquidProperties/bC10H7CH3/bC10H7CH3.H +++ b/src/thermophysicalModels/thermophysicalProperties/liquidProperties/bC10H7CH3/bC10H7CH3.H @@ -115,7 +115,7 @@ public: //- Construct and return clone virtual autoPtr<liquidProperties> clone() const { - return autoPtr<liquidProperties>(new bC10H7CH3(*this)); + return autoPtr<liquidProperties>::NewFrom<bC10H7CH3>(*this); } diff --git a/src/thermophysicalModels/thermophysicalProperties/liquidProperties/iC3H8O/iC3H8O.H b/src/thermophysicalModels/thermophysicalProperties/liquidProperties/iC3H8O/iC3H8O.H index 4f616f79d3404285123a04bbaca8c11415648e2b..f85c27b747e71e984bb3e42d8e7e072c0c563615 100644 --- a/src/thermophysicalModels/thermophysicalProperties/liquidProperties/iC3H8O/iC3H8O.H +++ b/src/thermophysicalModels/thermophysicalProperties/liquidProperties/iC3H8O/iC3H8O.H @@ -113,7 +113,7 @@ public: //- Construct and return clone virtual autoPtr<liquidProperties> clone() const { - return autoPtr<liquidProperties>(new iC3H8O(*this)); + return autoPtr<liquidProperties>::NewFrom<iC3H8O>(*this); } diff --git a/src/thermophysicalModels/thermophysicalProperties/liquidProperties/liquidMixtureProperties/liquidMixtureProperties.C b/src/thermophysicalModels/thermophysicalProperties/liquidProperties/liquidMixtureProperties/liquidMixtureProperties.C index c07e51462f343eba652557fe86b12b346a704fb1..1dd2c6212c3dad4af90b81815affbf45f8ae3e21 100644 --- a/src/thermophysicalModels/thermophysicalProperties/liquidProperties/liquidMixtureProperties/liquidMixtureProperties.C +++ b/src/thermophysicalModels/thermophysicalProperties/liquidProperties/liquidMixtureProperties/liquidMixtureProperties.C @@ -90,10 +90,7 @@ Foam::liquidMixtureProperties::New const dictionary& thermophysicalProperties ) { - return autoPtr<liquidMixtureProperties> - ( - new liquidMixtureProperties(thermophysicalProperties) - ); + return autoPtr<liquidMixtureProperties>::New(thermophysicalProperties); } diff --git a/src/thermophysicalModels/thermophysicalProperties/liquidProperties/liquidMixtureProperties/liquidMixtureProperties.H b/src/thermophysicalModels/thermophysicalProperties/liquidProperties/liquidMixtureProperties/liquidMixtureProperties.H index d726a93dce699008f2f23d730d62e0cd7d181193..c0530ba2d07d080c3f0e2c1b16201c80cbc33e9b 100644 --- a/src/thermophysicalModels/thermophysicalProperties/liquidProperties/liquidMixtureProperties/liquidMixtureProperties.H +++ b/src/thermophysicalModels/thermophysicalProperties/liquidProperties/liquidMixtureProperties/liquidMixtureProperties.H @@ -91,16 +91,12 @@ public: //- Construct and return a clone virtual autoPtr<liquidMixtureProperties> clone() const { - return autoPtr<liquidMixtureProperties> - ( - new liquidMixtureProperties(*this) - ); + return autoPtr<liquidMixtureProperties>::New(*this); } //- Destructor - virtual ~liquidMixtureProperties() - {} + virtual ~liquidMixtureProperties() = default; // Selectors diff --git a/src/thermophysicalModels/thermophysicalProperties/liquidProperties/liquidProperties/liquidProperties.C b/src/thermophysicalModels/thermophysicalProperties/liquidProperties/liquidProperties/liquidProperties.C index e0dec535cfd56618909dc800a75e7efc8504c761..aa14a2c91f8026fc001c48b292f7679f1e2ef15c 100644 --- a/src/thermophysicalModels/thermophysicalProperties/liquidProperties/liquidProperties/liquidProperties.C +++ b/src/thermophysicalModels/thermophysicalProperties/liquidProperties/liquidProperties/liquidProperties.C @@ -154,22 +154,20 @@ Foam::autoPtr<Foam::liquidProperties> Foam::liquidProperties::New ); } } - else - { - auto cstrIter = dictionaryConstructorTablePtr_->cfind(liquidType); - if (!cstrIter.found()) - { - FatalErrorInFunction - << "Unknown liquidProperties type " - << liquidType << nl << nl - << "Valid liquidProperties types :" << nl - << dictionaryConstructorTablePtr_->sortedToc() - << exit(FatalError); - } + auto cstrIter = dictionaryConstructorTablePtr_->cfind(liquidType); - return autoPtr<liquidProperties>(cstrIter()(dict)); + if (!cstrIter.found()) + { + FatalErrorInFunction + << "Unknown liquidProperties type " + << liquidType << nl << nl + << "Valid liquidProperties types :" << nl + << dictionaryConstructorTablePtr_->sortedToc() + << exit(FatalError); } + + return autoPtr<liquidProperties>(cstrIter()(dict)); } diff --git a/src/thermophysicalModels/thermophysicalProperties/liquidProperties/nC3H8O/nC3H8O.H b/src/thermophysicalModels/thermophysicalProperties/liquidProperties/nC3H8O/nC3H8O.H index 578e57bb2243ec8681ac6450d772ee383028998d..e7559e0e8c278da9884e485eaa9d2bc2f83bb2ef 100644 --- a/src/thermophysicalModels/thermophysicalProperties/liquidProperties/nC3H8O/nC3H8O.H +++ b/src/thermophysicalModels/thermophysicalProperties/liquidProperties/nC3H8O/nC3H8O.H @@ -113,7 +113,7 @@ public: //- Construct and return clone virtual autoPtr<liquidProperties> clone() const { - return autoPtr<liquidProperties>(new nC3H8O(*this)); + return autoPtr<liquidProperties>::NewFrom<nC3H8O>(*this); } diff --git a/src/thermophysicalModels/thermophysicalProperties/solidProperties/C/C.H b/src/thermophysicalModels/thermophysicalProperties/solidProperties/C/C.H index 7937e75ae9d0ead70596b7b19d8baf143b2ad1b3..07b2ab2c00a391f739a05a692d45ede176d366ba 100644 --- a/src/thermophysicalModels/thermophysicalProperties/solidProperties/C/C.H +++ b/src/thermophysicalModels/thermophysicalProperties/solidProperties/C/C.H @@ -68,7 +68,7 @@ public: //- Construct and return clone virtual autoPtr<solidProperties> clone() const { - return autoPtr<solidProperties>(new C(*this)); + return autoPtr<solidProperties>::NewFrom<C>(*this); } diff --git a/src/thermophysicalModels/thermophysicalProperties/solidProperties/CaCO3/CaCO3.H b/src/thermophysicalModels/thermophysicalProperties/solidProperties/CaCO3/CaCO3.H index 1ffb1f6b195518f401f32ec73675dcc40a51e752..8f5868849bee5739733ea913ee1d2b15d7ccacc5 100644 --- a/src/thermophysicalModels/thermophysicalProperties/solidProperties/CaCO3/CaCO3.H +++ b/src/thermophysicalModels/thermophysicalProperties/solidProperties/CaCO3/CaCO3.H @@ -68,7 +68,7 @@ public: //- Construct and return clone virtual autoPtr<solidProperties> clone() const { - return autoPtr<solidProperties>(new CaCO3(*this)); + return autoPtr<solidProperties>::NewFrom<CaCO3>(*this); } diff --git a/src/thermophysicalModels/thermophysicalProperties/solidProperties/ash/ash.H b/src/thermophysicalModels/thermophysicalProperties/solidProperties/ash/ash.H index b80c0385a15956cf91b314b48fa2a70400ce0e7e..5df0df767f45df458cbf32193a8d1f0bf858919a 100644 --- a/src/thermophysicalModels/thermophysicalProperties/solidProperties/ash/ash.H +++ b/src/thermophysicalModels/thermophysicalProperties/solidProperties/ash/ash.H @@ -68,7 +68,7 @@ public: //- Construct and return clone virtual autoPtr<solidProperties> clone() const { - return autoPtr<solidProperties>(new ash(*this)); + return autoPtr<solidProperties>::NewFrom<ash>(*this); } diff --git a/src/thermophysicalModels/thermophysicalProperties/solidProperties/solidMixtureProperties/solidMixtureProperties.C b/src/thermophysicalModels/thermophysicalProperties/solidProperties/solidMixtureProperties/solidMixtureProperties.C index 18fa9faa7381cddad11cd1bbf0391ed4768d2b97..17b3dc4b51f696540f118e7261edaf9d8308e87d 100644 --- a/src/thermophysicalModels/thermophysicalProperties/solidProperties/solidMixtureProperties/solidMixtureProperties.C +++ b/src/thermophysicalModels/thermophysicalProperties/solidProperties/solidMixtureProperties/solidMixtureProperties.C @@ -79,10 +79,7 @@ Foam::autoPtr<Foam::solidMixtureProperties> Foam::solidMixtureProperties::New const dictionary& thermophysicalProperties ) { - return autoPtr<solidMixtureProperties> - ( - new solidMixtureProperties(thermophysicalProperties) - ); + return autoPtr<solidMixtureProperties>::New(thermophysicalProperties); } diff --git a/src/thermophysicalModels/thermophysicalProperties/solidProperties/solidMixtureProperties/solidMixtureProperties.H b/src/thermophysicalModels/thermophysicalProperties/solidProperties/solidMixtureProperties/solidMixtureProperties.H index a9cdfa732c24bd4d3c2bf2a430a325a57191f9e2..8089ae2df9861c3cfc8716546df5f8e67fbe369e 100644 --- a/src/thermophysicalModels/thermophysicalProperties/solidProperties/solidMixtureProperties/solidMixtureProperties.H +++ b/src/thermophysicalModels/thermophysicalProperties/solidProperties/solidMixtureProperties/solidMixtureProperties.H @@ -89,16 +89,12 @@ public: //- Construct and return a clone virtual autoPtr<solidMixtureProperties> clone() const { - return autoPtr<solidMixtureProperties> - ( - new solidMixtureProperties(*this) - ); + return autoPtr<solidMixtureProperties>::New(*this); } //- Destructor - virtual ~solidMixtureProperties() - {} + virtual ~solidMixtureProperties() = default; // Selectors diff --git a/src/thermophysicalModels/thermophysicalProperties/solidProperties/solidProperties/solidProperties.H b/src/thermophysicalModels/thermophysicalProperties/solidProperties/solidProperties/solidProperties.H index dce26f383e52a9b7acba5747231d6b8ed55094e2..7f9b957764e3927ffb9e113b0ca510ca5ed717dd 100644 --- a/src/thermophysicalModels/thermophysicalProperties/solidProperties/solidProperties/solidProperties.H +++ b/src/thermophysicalModels/thermophysicalProperties/solidProperties/solidProperties/solidProperties.H @@ -114,7 +114,7 @@ public: //- Construct and return clone virtual autoPtr<solidProperties> clone() const { - return autoPtr<solidProperties>(new solidProperties(*this)); + return autoPtr<solidProperties>::New(*this); } diff --git a/src/thermophysicalModels/thermophysicalProperties/solidProperties/solidProperties/solidPropertiesNew.C b/src/thermophysicalModels/thermophysicalProperties/solidProperties/solidProperties/solidPropertiesNew.C index 89c4de9b2e8a50750050d5ca38c7869a2ef485a8..6f25fc40e5502a3374c3e7357405ace72c85d263 100644 --- a/src/thermophysicalModels/thermophysicalProperties/solidProperties/solidProperties/solidPropertiesNew.C +++ b/src/thermophysicalModels/thermophysicalProperties/solidProperties/solidProperties/solidPropertiesNew.C @@ -74,30 +74,26 @@ Foam::autoPtr<Foam::solidProperties> Foam::solidProperties::New { return New(solidType); } - else - { - return autoPtr<solidProperties> - ( - new solidProperties(dict.optionalSubDict(solidType + "Coeffs")) - ); - } + + return autoPtr<solidProperties>::New + ( + dict.optionalSubDict(solidType + "Coeffs") + ); } - else - { - auto cstrIter = dictionaryConstructorTablePtr_->cfind(solidType); - if (!cstrIter.found()) - { - FatalErrorInFunction - << "Unknown solidProperties type " - << solidType << nl << nl - << "Valid solidProperties types :" << nl - << dictionaryConstructorTablePtr_->sortedToc() - << exit(FatalError); - } + auto cstrIter = dictionaryConstructorTablePtr_->cfind(solidType); - return autoPtr<solidProperties>(cstrIter()(dict)); + if (!cstrIter.found()) + { + FatalErrorInFunction + << "Unknown solidProperties type " + << solidType << nl << nl + << "Valid solidProperties types :" << nl + << dictionaryConstructorTablePtr_->sortedToc() + << exit(FatalError); } + + return autoPtr<solidProperties>(cstrIter()(dict)); } diff --git a/src/transportModels/interfaceProperties/surfaceTensionModels/surfaceTensionModel/surfaceTensionModelNew.C b/src/transportModels/interfaceProperties/surfaceTensionModels/surfaceTensionModel/surfaceTensionModelNew.C index 7abdb1a75d3f2b3a887f5c44782f0774e3c21213..e48c64445e2b49fc5ac8620a29dedddf65c8d41c 100644 --- a/src/transportModels/interfaceProperties/surfaceTensionModels/surfaceTensionModel/surfaceTensionModelNew.C +++ b/src/transportModels/interfaceProperties/surfaceTensionModels/surfaceTensionModel/surfaceTensionModelNew.C @@ -56,13 +56,11 @@ Foam::autoPtr<Foam::surfaceTensionModel> Foam::surfaceTensionModel::New return cstrIter()(sigmaDict, mesh); } - else - { - return autoPtr<surfaceTensionModel> - ( - new surfaceTensionModels::constant(dict, mesh) - ); - } + + return autoPtr<surfaceTensionModel> + ( + new surfaceTensionModels::constant(dict, mesh) + ); } diff --git a/src/transportModels/twoPhaseProperties/alphaContactAngle/constantAlphaContactAngle/constantAlphaContactAngleFvPatchScalarField.C b/src/transportModels/twoPhaseProperties/alphaContactAngle/constantAlphaContactAngle/constantAlphaContactAngleFvPatchScalarField.C index 4594202d38c2a9dfd5f206e7911de30447fc19f3..c030375845c30a06f92a8d88e50382e9a037a680 100644 --- a/src/transportModels/twoPhaseProperties/alphaContactAngle/constantAlphaContactAngle/constantAlphaContactAngleFvPatchScalarField.C +++ b/src/transportModels/twoPhaseProperties/alphaContactAngle/constantAlphaContactAngle/constantAlphaContactAngleFvPatchScalarField.C @@ -103,7 +103,7 @@ Foam::constantAlphaContactAngleFvPatchScalarField::theta const fvsPatchVectorField& ) const { - return tmp<scalarField>(new scalarField(size(), theta0_)); + return tmp<scalarField>::New(size(), theta0_); } diff --git a/src/transportModels/twoPhaseProperties/alphaContactAngle/dynamicAlphaContactAngle/dynamicAlphaContactAngleFvPatchScalarField.C b/src/transportModels/twoPhaseProperties/alphaContactAngle/dynamicAlphaContactAngle/dynamicAlphaContactAngleFvPatchScalarField.C index e488fcd9ebbaa6ffd4c24c074a2ff892e41f1d81..13301320b3fc8d9adc1615ec6a6f919626f1558d 100644 --- a/src/transportModels/twoPhaseProperties/alphaContactAngle/dynamicAlphaContactAngle/dynamicAlphaContactAngleFvPatchScalarField.C +++ b/src/transportModels/twoPhaseProperties/alphaContactAngle/dynamicAlphaContactAngle/dynamicAlphaContactAngleFvPatchScalarField.C @@ -120,7 +120,7 @@ Foam::dynamicAlphaContactAngleFvPatchScalarField::theta { if (uTheta_ < SMALL) { - return tmp<scalarField>(new scalarField(size(), theta0_)); + return tmp<scalarField>::New(size(), theta0_); } const vectorField nf(patch().nf()); diff --git a/src/transportModels/twoPhaseProperties/alphaContactAngle/timeVaryingAlphaContactAngle/timeVaryingAlphaContactAngleFvPatchScalarField.C b/src/transportModels/twoPhaseProperties/alphaContactAngle/timeVaryingAlphaContactAngle/timeVaryingAlphaContactAngleFvPatchScalarField.C index 3ed663eb687be76f75352d50d187c54e81ea8715..b02dc17c4bc327198286c87d40db55e19d8fd19d 100644 --- a/src/transportModels/twoPhaseProperties/alphaContactAngle/timeVaryingAlphaContactAngle/timeVaryingAlphaContactAngleFvPatchScalarField.C +++ b/src/transportModels/twoPhaseProperties/alphaContactAngle/timeVaryingAlphaContactAngle/timeVaryingAlphaContactAngleFvPatchScalarField.C @@ -121,7 +121,7 @@ Foam::timeVaryingAlphaContactAngleFvPatchScalarField::theta theta0 = thetaT0_ + (t - t0_)*(thetaTe_ - thetaT0_)/(te_ - t0_); } - return tmp<scalarField>(new scalarField(size(), theta0)); + return tmp<scalarField>::New(size(), theta0); }