STYLE: use explicit REGISTER option when storing fields

This commit is contained in:
Mark Olesen
2023-04-24 12:05:55 +02:00
parent d9533e561b
commit ee39e3d276
37 changed files with 239 additions and 186 deletions

View File

@ -25,8 +25,7 @@ cellZoneID
// but is fairly low overhead anyhow
volScalarField* getZoneField(const fvMesh& mesh)
{
volScalarField* volZonePtr =
mesh.getObjectPtr<volScalarField>(fieldName);
auto* volZonePtr = mesh.getObjectPtr<volScalarField>(fieldName);
const cellZoneMesh& zones = mesh.cellZones();
@ -34,16 +33,22 @@ cellZoneID
{
if (!volZonePtr)
{
volZonePtr = &regIOobject::store
volZonePtr = new volScalarField
(
volScalarField::New
IOobject
(
fieldName,
mesh,
dimless,
fvPatchScalarField::zeroGradientType()
)
mesh.time().timeName(),
mesh.thisDb(),
IOobject::NO_READ,
IOobject::AUTO_WRITE,
IOobject::REGISTER
),
mesh,
dimless,
fvPatchFieldBase::zeroGradientType()
);
regIOobject::store(volZonePtr);
Info<< "Creating " << fieldName
<< " field for postProcessing" << nl;

View File

@ -89,7 +89,8 @@ functions
mesh().time().timeName(),
mesh(),
IOobject::NO_READ,
IOobject::AUTO_WRITE
IOobject::AUTO_WRITE,
IOobject::REGISTER
),
mesh(),
dimless

View File

@ -114,7 +114,8 @@ functions
mesh().time().timeName(),
mesh(),
IOobject::NO_READ,
IOobject::AUTO_WRITE
IOobject::AUTO_WRITE,
IOobject::REGISTER
),
mesh(),
sqr(dimLength)/pow3(dimTime)

View File

@ -114,7 +114,8 @@ functions
mesh().time().timeName(),
mesh(),
IOobject::NO_READ,
IOobject::AUTO_WRITE
IOobject::AUTO_WRITE,
IOobject::REGISTER
),
mesh(),
sqr(dimLength)/pow3(dimTime)