typeIOobject: Template typed form of IOobject for type-checked object file and header reading

used to check the existence of and open an object file, read and check the
header without constructing the object.

'typeIOobject' operates in an equivalent and consistent manner to 'regIOobject'
but the type information is provided by the template argument rather than via
virtual functions for which the derived object would need to be constructed,
which is the case for 'regIOobject'.

'typeIOobject' replaces the previous separate functions 'typeHeaderOk' and
'typeFilePath' with a single consistent interface.
This commit is contained in:
Henry Weller
2021-08-12 10:12:03 +01:00
parent 0a3a6312e5
commit b9123328fb
114 changed files with 514 additions and 475 deletions

View File

@ -174,7 +174,7 @@ int main(int argc, char *argv[])
epsilon.write();
// Turbulence omega
IOobject omegaHeader
typeIOobject<volScalarField> omegaHeader
(
"omega",
runTime.timeName(),
@ -184,7 +184,7 @@ int main(int argc, char *argv[])
false
);
if (omegaHeader.typeHeaderOk<volScalarField>(true))
if (omegaHeader.headerOk())
{
volScalarField omega(omegaHeader, mesh);
@ -202,7 +202,7 @@ int main(int argc, char *argv[])
}
// Turbulence nuTilda
IOobject nuTildaHeader
typeIOobject<volScalarField> nuTildaHeader
(
"nuTilda",
runTime.timeName(),
@ -212,7 +212,7 @@ int main(int argc, char *argv[])
false
);
if (nuTildaHeader.typeHeaderOk<volScalarField>(true))
if (nuTildaHeader.headerOk())
{
volScalarField nuTilda(nuTildaHeader, mesh);
nuTilda = nut;