STYLE: prefer REGISTER/NO_REGISTER instead of true/false for IOobject

- self-documenting
This commit is contained in:
Mark Olesen
2023-03-10 13:44:46 +00:00
parent 20566a87f5
commit 25bc7d65f7
333 changed files with 706 additions and 740 deletions

View File

@ -67,7 +67,7 @@ Foam::decompositionModel::decompositionModel
mesh.thisDb(),
(fallback ? IOobject::READ_IF_PRESENT : IOobject::MUST_READ),
IOobject::NO_WRITE,
false, //io.registerObject(),
IOobject::NO_REGISTER,
true //io.globalObject()
),
decompDictFile

View File

@ -51,7 +51,7 @@ Foam::dimFieldDecomposer::decomposeField
procMesh_.thisDb(),
IOobject::NO_READ,
IOobject::NO_WRITE,
false
IOobject::NO_REGISTER
),
procMesh_,
field.dimensions(),

View File

@ -58,7 +58,7 @@ Foam::fvFieldDecomposer::decomposeField
procMesh_.thisDb(),
IOobject::NO_READ,
IOobject::NO_WRITE,
false
IOobject::NO_REGISTER
),
procMesh_,
field.dimensions(),

View File

@ -50,7 +50,7 @@ Foam::lagrangianFieldDecomposer::decomposeField
procMesh_,
IOobject::NO_READ,
IOobject::NO_WRITE,
false
IOobject::NO_REGISTER
),
// Mapping internal field values
Field<Type>(field, particleIndices_)
@ -77,7 +77,7 @@ Foam::lagrangianFieldDecomposer::decomposeFieldField
procMesh_,
IOobject::NO_READ,
IOobject::NO_WRITE,
false
IOobject::NO_REGISTER
),
// Mapping internal field values
Field<Field<Type>>(field, particleIndices_)

View File

@ -86,7 +86,7 @@ Foam::pointFieldDecomposer::decomposeField
procMesh_.thisDb(),
IOobject::NO_READ,
IOobject::NO_WRITE,
false
IOobject::NO_REGISTER
),
procMesh_,
field.dimensions(),

View File

@ -69,16 +69,17 @@ Foam::labelList Foam::manualDecomp::decompose
const scalarField& pointWeights
) const
{
labelIOList finalDecomp
labelList finalDecomp
(
IOobject
labelIOList::readContents
(
dataFile_,
mesh.facesInstance(),
mesh,
IOobject::MUST_READ,
IOobject::AUTO_WRITE,
false
IOobject
(
dataFile_,
mesh.facesInstance(),
mesh.thisDb(),
IOobject::MUST_READ
)
)
);
@ -95,21 +96,21 @@ Foam::labelList Foam::manualDecomp::decompose
<< exit(FatalError);
}
const label minVal = min(finalDecomp);
const label maxVal = max(finalDecomp);
if (minVal < 0 || maxVal >= nDomains_)
const MinMax<label> range = minMax(finalDecomp);
if (range.min() < 0 || range.max() >= nDomains_)
{
FatalErrorInFunction
<< "According to the decomposition, cells assigned to "
<< "impossible processor numbers. Min processor = "
<< minVal << " Max processor = " << maxVal
<< range.min() << " Max processor = " << range.max()
<< ".\n" << "Manual decomposition data read from file "
<< dataFile_ << "." << endl
<< exit(FatalError);
}
return std::move(finalDecomp);
return finalDecomp;
}

View File

@ -74,7 +74,7 @@ void Foam::faMeshDecomposition::distributeFaces()
procFvMesh,
IOobject::MUST_READ,
IOobject::NO_WRITE,
false // not registered
IOobject::NO_REGISTER
);
@ -256,7 +256,7 @@ void Foam::faMeshDecomposition::decomposeMesh()
procFvMesh,
IOobject::MUST_READ,
IOobject::NO_WRITE,
false // not registered
IOobject::NO_REGISTER
);
@ -1326,7 +1326,7 @@ bool Foam::faMeshDecomposition::writeDecomposition()
procMesh.thisDb(),
IOobject::NO_READ,
IOobject::NO_WRITE,
false // not registered
IOobject::NO_REGISTER
);
// pointProcAddressing

View File

@ -672,7 +672,7 @@ void Foam::faMeshReconstructor::writeAddressing(const word& timeName) const
procMesh_.thisDb(),
IOobject::NO_READ,
IOobject::NO_WRITE,
false // not registered
IOobject::NO_REGISTER
);
// boundaryProcAddressing

View File

@ -195,7 +195,7 @@ void Foam::processorMeshes::reconstructPoints(fvMesh& mesh)
meshes_[proci].thisDb(),
IOobject::MUST_READ,
IOobject::NO_WRITE,
false // not registered
IOobject::NO_REGISTER
)
)
);