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