src: Changed tmp<volField> construction to use the new simpler "New" method

avoiding unnecessary database registration of temporary fields
This commit is contained in:
Henry Weller
2018-12-21 07:14:52 +00:00
parent d6a13f6425
commit 819eb06657
66 changed files with 406 additions and 1408 deletions

View File

@ -75,14 +75,9 @@ bool Foam::functionObjects::CourantNo::calc()
tmp<volScalarField> tCo
(
new volScalarField
volScalarField::New
(
IOobject
(
resultName_,
mesh_.time().timeName(),
mesh_
),
resultName_,
mesh_,
dimensionedScalar(dimless, 0),
zeroGradientFvPatchScalarField::typeName

View File

@ -76,14 +76,9 @@ bool Foam::functionObjects::processorField::execute()
tmp<volScalarField> tprocField
(
new volScalarField
volScalarField::New
(
IOobject
(
name,
mesh_.time().timeName(),
mesh_
),
name,
mesh_,
dimensionedScalar(name, dimless, Pstream::myProcNo())
)

View File

@ -67,14 +67,9 @@ Foam::functionObjects::wallHeatFlux::calcWallHeatFlux
{
tmp<volScalarField> twallHeatFlux
(
new volScalarField
volScalarField::New
(
IOobject
(
type(),
mesh_.time().timeName(),
mesh_
),
type(),
mesh_,
dimensionedScalar(dimMass/pow3(dimTime), 0)
)

View File

@ -72,14 +72,9 @@ Foam::functionObjects::wallHeatTransferCoeff::calcHeatTransferCoeff
{
tmp<volScalarField> twallHeatTransferCoeff
(
new volScalarField
volScalarField::New
(
IOobject
(
type(),
mesh_.time().timeName(),
mesh_
),
type(),
mesh_,
dimensionedScalar
(

View File

@ -65,14 +65,9 @@ Foam::functionObjects::wallShearStress::calcShearStress
{
tmp<volVectorField> twallShearStress
(
new volVectorField
volVectorField::New
(
IOobject
(
type(),
mesh_.time().timeName(),
mesh_
),
type(),
mesh_,
dimensionedVector("0", Reff.dimensions(), Zero)
)

View File

@ -69,14 +69,9 @@ Foam::tmp<Foam::volScalarField> Foam::functionObjects::yPlus::calcYPlus
{
tmp<volScalarField> tyPlus
(
new volScalarField
volScalarField::New
(
IOobject
(
type(),
mesh_.time().timeName(),
mesh_
),
type(),
mesh_,
dimensionedScalar(dimless, 0)
)

View File

@ -331,19 +331,11 @@ Foam::tmp<Foam::volScalarField> Foam::functionObjects::forces::rho() const
{
if (rhoName_ == "rhoInf")
{
return tmp<volScalarField>
return volScalarField::New
(
new volScalarField
(
IOobject
(
"rho",
mesh_.time().timeName(),
mesh_
),
mesh_,
dimensionedScalar(dimDensity, rhoRef_)
)
"rho",
mesh_,
dimensionedScalar(dimDensity, rhoRef_)
);
}
else

View File

@ -65,21 +65,11 @@ Foam::tmp<Foam::volScalarField> Foam::functionObjects::scalarTransport::D
if (constantD_)
{
return tmp<volScalarField>
return volScalarField::New
(
new volScalarField
(
IOobject
(
Dname,
mesh_.time().timeName(),
mesh_.time(),
IOobject::NO_READ,
IOobject::NO_WRITE
),
mesh_,
dimensionedScalar(Dname, phi.dimensions()/dimLength, D_)
)
Dname,
mesh_,
dimensionedScalar(Dname, phi.dimensions()/dimLength, D_)
);
}
else if (mesh_.foundObject<icoModel>(turbulenceModel::propertiesName))
@ -102,21 +92,11 @@ Foam::tmp<Foam::volScalarField> Foam::functionObjects::scalarTransport::D
}
else
{
return tmp<volScalarField>
return volScalarField::New
(
new volScalarField
(
IOobject
(
Dname,
mesh_.time().timeName(),
mesh_.time(),
IOobject::NO_READ,
IOobject::NO_WRITE
),
mesh_,
dimensionedScalar(Dname, phi.dimensions()/dimLength, 0)
)
Dname,
mesh_,
dimensionedScalar(Dname, phi.dimensions()/dimLength, 0)
);
}
}