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

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | Website: https://openfoam.org
\\ / A nd | Copyright (C) 2011-2018 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011-2021 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -141,7 +141,7 @@ void MapVolFields
{
const fieldType fieldSource(*fieldIter(), meshSource);
IOobject targetIO
typeIOobject<fieldType> targetIO
(
fieldName,
meshTarget.time().timeName(),
@ -149,7 +149,7 @@ void MapVolFields
IOobject::MUST_READ
);
if (targetIO.typeHeaderOk<fieldType>(true))
if (targetIO.headerOk())
{
Info<< " interpolating onto existing field "
<< fieldName << endl;

View File

@ -41,7 +41,7 @@ void UnMapped(const IOobjectList& objects)
forAllConstIter(IOobjectList, fields, fieldIter)
{
mvBak(fieldIter()->objectPath<Type>(), "unmapped");
mvBak(fieldIter()->objectPath(false), "unmapped");
}
}