diff --git a/src/OpenFOAM/matrices/LduMatrix/LduMatrix/LduMatrixATmul.C b/src/OpenFOAM/matrices/LduMatrix/LduMatrix/LduMatrixATmul.C index 50cbf806b2..1033042213 100644 --- a/src/OpenFOAM/matrices/LduMatrix/LduMatrix/LduMatrixATmul.C +++ b/src/OpenFOAM/matrices/LduMatrix/LduMatrix/LduMatrixATmul.C @@ -261,7 +261,7 @@ Foam::tmp> Foam::LduMatrix::residual const Field& psi ) const { - tmp> trA(new Field(psi.size())); + auto trA = tmp>::New(psi.size()); residual(trA.ref(), psi); return trA; } diff --git a/src/OpenFOAM/matrices/LduMatrix/LduMatrix/LduMatrixOperations.C b/src/OpenFOAM/matrices/LduMatrix/LduMatrix/LduMatrixOperations.C index 7524e15f06..7fa0cd403c 100644 --- a/src/OpenFOAM/matrices/LduMatrix/LduMatrix/LduMatrixOperations.C +++ b/src/OpenFOAM/matrices/LduMatrix/LduMatrix/LduMatrixOperations.C @@ -142,8 +142,8 @@ Foam::LduMatrix::faceH(const Field& psi) const const labelUList& l = lduAddr().lowerAddr(); const labelUList& u = lduAddr().upperAddr(); - tmp> tfaceHpsi(new Field (Lower.size())); - Field & faceHpsi = tfaceHpsi(); + auto tfaceHpsi = tmp>::New(Lower.size()); + auto& faceHpsi = tfaceHpsi.ref(); for (label face=0; face> Foam::lduMatrix::residual const direction cmpt ) const { - tmp trA(new solveScalarField(psi.size())); + auto trA = tmp::New(psi.size()); residual(trA.ref(), psi, source, interfaceBouCoeffs, interfaces, cmpt); return trA; } diff --git a/src/OpenFOAM/matrices/lduMatrix/lduMatrix/lduMatrixTemplates.C b/src/OpenFOAM/matrices/lduMatrix/lduMatrix/lduMatrixTemplates.C index d17855b89b..cafd283abb 100644 --- a/src/OpenFOAM/matrices/lduMatrix/lduMatrix/lduMatrixTemplates.C +++ b/src/OpenFOAM/matrices/lduMatrix/lduMatrix/lduMatrixTemplates.C @@ -35,16 +35,11 @@ Description template Foam::tmp> Foam::lduMatrix::H(const Field& psi) const { - tmp> tHpsi - ( - new Field(lduAddr().size(), Zero) - ); + auto tHpsi = tmp>::New(lduAddr().size(), Zero); if (lowerPtr_ || upperPtr_) { - Field & Hpsi = tHpsi.ref(); - - Type* __restrict__ HpsiPtr = Hpsi.begin(); + Type* __restrict__ HpsiPtr = tHpsi.ref().begin(); const Type* __restrict__ psiPtr = psi.begin(); @@ -88,8 +83,8 @@ Foam::lduMatrix::faceH(const Field& psi) const const labelUList& l = lduAddr().lowerAddr(); const labelUList& u = lduAddr().upperAddr(); - tmp> tfaceHpsi(new Field (Lower.size())); - Field & faceHpsi = tfaceHpsi.ref(); + auto tfaceHpsi = tmp>::New(Lower.size()); + auto& faceHpsi = tfaceHpsi.ref(); for (label face=0; face Foam::pairGAMGAgglomeration::agglomerate // go through the faces and create clusters - tmp tcoarseCellMap(new labelField(nFineCells, -1)); - labelField& coarseCellMap = tcoarseCellMap.ref(); + auto tcoarseCellMap = tmp::New(nFineCells, -1); + auto& coarseCellMap = tcoarseCellMap.ref(); nCoarseCells = 0; label celli; diff --git a/src/OpenFOAM/matrices/lduMatrix/solvers/GAMG/GAMGSolverSolve.C b/src/OpenFOAM/matrices/lduMatrix/solvers/GAMG/GAMGSolverSolve.C index ab54eb5ef9..964ecfefa6 100644 --- a/src/OpenFOAM/matrices/lduMatrix/solvers/GAMG/GAMGSolverSolve.C +++ b/src/OpenFOAM/matrices/lduMatrix/solvers/GAMG/GAMGSolverSolve.C @@ -254,7 +254,10 @@ void Foam::GAMGSolver::Vcycle ( coarseSources[leveli], coarseCorrFields[leveli], - coarseSources[leveli], + ConstPrecisionAdaptor + ( + coarseSources[leveli] + )(), interfaceLevelsBouCoeffs_[leveli], interfaceLevels_[leveli], cmpt diff --git a/src/OpenFOAM/matrices/lduMatrix/solvers/GAMG/interfaces/cyclicGAMGInterface/cyclicGAMGInterface.C b/src/OpenFOAM/matrices/lduMatrix/solvers/GAMG/interfaces/cyclicGAMGInterface/cyclicGAMGInterface.C index 994c8792f8..9b9f190ec3 100644 --- a/src/OpenFOAM/matrices/lduMatrix/solvers/GAMG/interfaces/cyclicGAMGInterface/cyclicGAMGInterface.C +++ b/src/OpenFOAM/matrices/lduMatrix/solvers/GAMG/interfaces/cyclicGAMGInterface/cyclicGAMGInterface.C @@ -173,8 +173,8 @@ Foam::tmp Foam::cyclicGAMGInterface::internalFieldTransfer const cyclicGAMGInterface& nbr = neighbPatch(); const labelUList& nbrFaceCells = nbr.faceCells(); - tmp tpnf(new labelField(size())); - labelField& pnf = tpnf.ref(); + auto tpnf = tmp::New(size()); + auto& pnf = tpnf.ref(); forAll(pnf, facei) {