bubbleFoam: Cleaned-up createPhi

This commit is contained in:
Henry
2010-09-29 10:49:35 +01:00
parent da150065e3
commit 5a655495dc
2 changed files with 54 additions and 44 deletions

View File

@ -6,14 +6,15 @@
IOobject::NO_READ IOobject::NO_READ
); );
autoPtr<surfaceScalarField> phiaPtr(NULL);
surfaceScalarField* phiaPtr;
if (phiaHeader.headerOk()) if (phiaHeader.headerOk())
{ {
Info<< "Reading face flux field phia\n" << endl; Info<< "Reading face flux field phia\n" << endl;
phiaPtr = new surfaceScalarField phiaPtr.reset
(
new surfaceScalarField
( (
IOobject IOobject
( (
@ -24,6 +25,7 @@
IOobject::AUTO_WRITE IOobject::AUTO_WRITE
), ),
mesh mesh
)
); );
} }
else else
@ -44,7 +46,9 @@
} }
} }
phiaPtr = new surfaceScalarField phiaPtr.reset
(
new surfaceScalarField
( (
IOobject IOobject
( (
@ -56,7 +60,8 @@
), ),
fvc::interpolate(Ua) & mesh.Sf(), fvc::interpolate(Ua) & mesh.Sf(),
phiTypes phiTypes
)
); );
} }
surfaceScalarField& phia = *phiaPtr; surfaceScalarField& phia = phiaPtr();

View File

@ -6,14 +6,15 @@
IOobject::NO_READ IOobject::NO_READ
); );
autoPtr<surfaceScalarField> phibPtr(NULL);
surfaceScalarField* phibPtr;
if (phibHeader.headerOk()) if (phibHeader.headerOk())
{ {
Info<< "Reading face flux field phib\n" << endl; Info<< "Reading face flux field phib\n" << endl;
phibPtr = new surfaceScalarField phibPtr.reset
(
new surfaceScalarField
( (
IOobject IOobject
( (
@ -24,6 +25,7 @@
IOobject::AUTO_WRITE IOobject::AUTO_WRITE
), ),
mesh mesh
)
); );
} }
else else
@ -44,7 +46,9 @@
} }
} }
phibPtr = new surfaceScalarField phibPtr.reset
(
new surfaceScalarField
( (
IOobject IOobject
( (
@ -56,7 +60,8 @@
), ),
fvc::interpolate(Ub) & mesh.Sf(), fvc::interpolate(Ub) & mesh.Sf(),
phiTypes phiTypes
)
); );
} }
surfaceScalarField& phib = *phibPtr; surfaceScalarField& phib = phibPtr();