mirror of
https://develop.openfoam.com/Development/openfoam.git
synced 2025-11-28 03:28:01 +00:00
ENH: utilities: small merge of dev functionality
This commit is contained in:
@ -3,7 +3,7 @@
|
|||||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||||
\\ / O peration |
|
\\ / O peration |
|
||||||
\\ / A nd | Copyright (C) 2011-2015 OpenFOAM Foundation
|
\\ / A nd | Copyright (C) 2011-2015 OpenFOAM Foundation
|
||||||
\\/ M anipulation |
|
\\/ M anipulation | Copyright (C) 2016 OpenCFD Ltd.
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
License
|
License
|
||||||
This file is part of OpenFOAM.
|
This file is part of OpenFOAM.
|
||||||
@ -37,6 +37,11 @@ Foam::label Foam::starMesh::readVtxLabel(IFstream& is)
|
|||||||
|
|
||||||
for (int i=0; i<15; i++)
|
for (int i=0; i<15; i++)
|
||||||
{
|
{
|
||||||
|
if (!is.good())
|
||||||
|
{
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
|
|
||||||
is.get(lcs[i]);
|
is.get(lcs[i]);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -85,12 +90,10 @@ void Foam::starMesh::readPoints(const scalar scaleFactor)
|
|||||||
|
|
||||||
if (pointsFile.good())
|
if (pointsFile.good())
|
||||||
{
|
{
|
||||||
label pointLabel;
|
|
||||||
|
|
||||||
maxLabel = -1;
|
maxLabel = -1;
|
||||||
while (pointsFile)
|
while (pointsFile)
|
||||||
{
|
{
|
||||||
pointLabel = readVtxLabel(pointsFile);
|
label pointLabel = readVtxLabel(pointsFile);
|
||||||
|
|
||||||
if (!pointsFile) break;
|
if (!pointsFile) break;
|
||||||
|
|
||||||
|
|||||||
@ -3,7 +3,7 @@
|
|||||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||||
\\ / O peration |
|
\\ / O peration |
|
||||||
\\ / A nd | Copyright (C) 2011-2015 OpenFOAM Foundation
|
\\ / A nd | Copyright (C) 2011-2015 OpenFOAM Foundation
|
||||||
\\/ M anipulation |
|
\\/ M anipulation | Copyright (C) 2016 OpenCFD Ltd.
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
License
|
License
|
||||||
This file is part of OpenFOAM.
|
This file is part of OpenFOAM.
|
||||||
@ -38,6 +38,16 @@ Description
|
|||||||
we detect the keywords in zones and redo the dictionary entries
|
we detect the keywords in zones and redo the dictionary entries
|
||||||
to be labelLists.
|
to be labelLists.
|
||||||
|
|
||||||
|
Usage
|
||||||
|
|
||||||
|
- foamFormatConvert [OPTION]
|
||||||
|
|
||||||
|
\param -noConstant \n
|
||||||
|
Exclude the constant/ directory from the times list
|
||||||
|
|
||||||
|
\param -enableFunctionEntries \n
|
||||||
|
By default all dictionary preprocessing of fields is disabled
|
||||||
|
|
||||||
\*---------------------------------------------------------------------------*/
|
\*---------------------------------------------------------------------------*/
|
||||||
|
|
||||||
#include "argList.H"
|
#include "argList.H"
|
||||||
@ -148,6 +158,11 @@ int main(int argc, char *argv[])
|
|||||||
"noConstant",
|
"noConstant",
|
||||||
"exclude the 'constant/' dir in the times list"
|
"exclude the 'constant/' dir in the times list"
|
||||||
);
|
);
|
||||||
|
argList::addBoolOption
|
||||||
|
(
|
||||||
|
"enableFunctionEntries",
|
||||||
|
"enable expansion of dictionary directives - #include, #codeStream etc"
|
||||||
|
);
|
||||||
|
|
||||||
#include "addRegionOption.H"
|
#include "addRegionOption.H"
|
||||||
#include "setRootCase.H"
|
#include "setRootCase.H"
|
||||||
@ -166,6 +181,19 @@ int main(int argc, char *argv[])
|
|||||||
|
|
||||||
#include "createTime.H"
|
#include "createTime.H"
|
||||||
|
|
||||||
|
const bool enableEntries = args.optionFound("enableFunctionEntries");
|
||||||
|
if (enableEntries)
|
||||||
|
{
|
||||||
|
Info<< "Allowing dictionary preprocessing ('#include', '#codeStream')."
|
||||||
|
<< endl;
|
||||||
|
}
|
||||||
|
|
||||||
|
int oldFlag = entry::disableFunctionEntries;
|
||||||
|
if (!enableEntries)
|
||||||
|
{
|
||||||
|
// By default disable dictionary expansion for fields
|
||||||
|
entry::disableFunctionEntries = 1;
|
||||||
|
}
|
||||||
|
|
||||||
// Make sure we do not use the master-only reading since we read
|
// Make sure we do not use the master-only reading since we read
|
||||||
// fields (different per processor) as dictionaries.
|
// fields (different per processor) as dictionaries.
|
||||||
@ -267,6 +295,8 @@ int main(int argc, char *argv[])
|
|||||||
Info<< endl;
|
Info<< endl;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
entry::disableFunctionEntries = oldFlag;
|
||||||
|
|
||||||
Info<< "End\n" << endl;
|
Info<< "End\n" << endl;
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
|
|||||||
Reference in New Issue
Block a user