STYLE: prefer autoPtr::reset() to autoPtr::set()

- in most cases already checked valid() so don't need additional check
  for setting an existing pointer
This commit is contained in:
Mark Olesen
2017-11-22 19:11:11 +01:00
parent e96cbd9050
commit 416a3790ea
34 changed files with 141 additions and 124 deletions

View File

@ -29,8 +29,10 @@ volVectorField U
#include "createPhi.H"
// Creating e based thermo
autoPtr<twoPhaseMixtureEThermo> thermo;
thermo.set(new twoPhaseMixtureEThermo(U, phi));
autoPtr<twoPhaseMixtureEThermo> thermo
(
new twoPhaseMixtureEThermo(U, phi)
);
// Create mixture and
Info<< "Creating temperaturePhaseChangeTwoPhaseMixture\n" << endl;

View File

@ -49,7 +49,7 @@ Foam::ThermoPhaseModel<BasePhaseModel, ThermoType>::ThermoPhaseModel
{
if (createThermo)
{
thermoPtr_.set
thermoPtr_.reset
(
ThermoType::New(fluid.mesh(), this->name()).ptr()
);

View File

@ -76,7 +76,7 @@ Foam::BlendedInterfacialModel<modelType>::BlendedInterfacialModel
{
if (modelTable.found(pair_))
{
model_.set
model_.reset
(
modelType::New
(
@ -88,7 +88,7 @@ Foam::BlendedInterfacialModel<modelType>::BlendedInterfacialModel
if (modelTable.found(pair1In2_))
{
model1In2_.set
model1In2_.reset
(
modelType::New
(
@ -100,7 +100,7 @@ Foam::BlendedInterfacialModel<modelType>::BlendedInterfacialModel
if (modelTable.found(pair2In1_))
{
model2In1_.set
model2In1_.reset
(
modelType::New
(

View File

@ -41,7 +41,7 @@ Foam::orderedPhasePair::orderedPhasePair
{
if (aspectRatioTable.found(*this))
{
aspectRatio_.set
aspectRatio_.reset
(
aspectRatioModel::New
(

View File

@ -132,7 +132,7 @@ Foam::twoPhaseSystem::twoPhaseSystem
phasePair::scalarTable sigmaTable(lookup("sigma"));
phasePair::dictTable aspectRatioTable(lookup("aspectRatio"));
pair_.set
pair_.reset
(
new phasePair
(
@ -143,7 +143,7 @@ Foam::twoPhaseSystem::twoPhaseSystem
)
);
pair1In2_.set
pair1In2_.reset
(
new orderedPhasePair
(
@ -155,7 +155,7 @@ Foam::twoPhaseSystem::twoPhaseSystem
)
);
pair2In1_.set
pair2In1_.reset
(
new orderedPhasePair
(
@ -170,7 +170,7 @@ Foam::twoPhaseSystem::twoPhaseSystem
// Models
drag_.set
drag_.reset
(
new BlendedInterfacialModel<dragModel>
(
@ -187,7 +187,7 @@ Foam::twoPhaseSystem::twoPhaseSystem
)
);
virtualMass_.set
virtualMass_.reset
(
new BlendedInterfacialModel<virtualMassModel>
(
@ -203,7 +203,7 @@ Foam::twoPhaseSystem::twoPhaseSystem
)
);
heatTransfer_.set
heatTransfer_.reset
(
new BlendedInterfacialModel<heatTransferModel>
(
@ -219,7 +219,7 @@ Foam::twoPhaseSystem::twoPhaseSystem
)
);
lift_.set
lift_.reset
(
new BlendedInterfacialModel<liftModel>
(
@ -235,7 +235,7 @@ Foam::twoPhaseSystem::twoPhaseSystem
)
);
wallLubrication_.set
wallLubrication_.reset
(
new BlendedInterfacialModel<wallLubricationModel>
(
@ -251,7 +251,7 @@ Foam::twoPhaseSystem::twoPhaseSystem
)
);
turbulentDispersion_.set
turbulentDispersion_.reset
(
new BlendedInterfacialModel<turbulentDispersionModel>
(