typeGlobal, typeGlobalFile: Changed to trait structure

This allows for partial specialisation, so the different variants of the
global IO containers do not need the function to be overloaded for each
contained type. This also fixes an ommission in providing overloads of
these functions for some of the global IO containers.

Resolves bug report https://bugs.openfoam.org/view.php?id=3890
This commit is contained in:
Will Bainbridge
2022-09-20 16:32:29 +01:00
parent 8b557d128c
commit 50aac13df5
15 changed files with 82 additions and 64 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-2021 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011-2022 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -196,14 +196,15 @@ int main(int argc, char *argv[])
if (dictIO.headerOk())
{
Info<< "Refining according to "
<< dictIO.path(typeGlobalFile<IOdictionary>()) << nl << endl;
<< dictIO.path(typeGlobalFile<IOdictionary>::global)
<< nl << endl;
refineDict = IOdictionary(dictIO);
}
else
{
FatalErrorInFunction
<< "Cannot open specified refinement dictionary "
<< dictIO.path(typeGlobalFile<IOdictionary>())
<< dictIO.path(typeGlobalFile<IOdictionary>::global)
<< exit(FatalError);
}
}
@ -212,14 +213,15 @@ int main(int argc, char *argv[])
if (dictIO.headerOk())
{
Info<< "Refining according to "
<< dictIO.path(typeGlobalFile<IOdictionary>()) << nl << endl;
<< dictIO.path(typeGlobalFile<IOdictionary>::global)
<< nl << endl;
refineDict = IOdictionary(dictIO);
}
else
{
Info<< "Refinement dictionary "
<< dictIO.path(typeGlobalFile<IOdictionary>()) << " not found"
<< nl << endl;
<< dictIO.path(typeGlobalFile<IOdictionary>::global)
<< " not found" << nl << endl;
}
}