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

@ -1,4 +1,4 @@
EXE_INC = \
EXE_INC = -ggdb3 \
-I$(LIB_SRC)/meshTools/lnInclude \
-I$(LIB_SRC)/lagrangian/basic/lnInclude \
-I$(LIB_SRC)/finiteVolume/lnInclude \

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
@ -59,7 +59,7 @@ void MapConsistentVolFields
// Read field
fieldType fieldSource(*fieldIter(), meshSource);
IOobject fieldTargetIOobject
typeIOobject<fieldType> fieldTargetIOobject
(
fieldIter()->name(),
meshTarget.time().timeName(),
@ -68,7 +68,7 @@ void MapConsistentVolFields
IOobject::AUTO_WRITE
);
if (fieldTargetIOobject.typeHeaderOk<fieldType>(true))
if (fieldTargetIOobject.headerOk())
{
// Read fieldTarget
fieldType fieldTarget

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
@ -53,7 +53,7 @@ void MapVolFields
forAllIter(IOobjectList, fields, fieldIter)
{
IOobject fieldTargetIOobject
typeIOobject<fieldType> fieldTargetIOobject
(
fieldIter()->name(),
meshTarget.time().timeName(),
@ -62,7 +62,7 @@ void MapVolFields
IOobject::AUTO_WRITE
);
if (fieldTargetIOobject.typeHeaderOk<fieldType>(true))
if (fieldTargetIOobject.headerOk())
{
Info<< " interpolating " << fieldIter()->name() << 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");
}
}