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:
@ -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;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user