mirror of
https://develop.openfoam.com/Development/openfoam.git
synced 2025-11-28 03:28:01 +00:00
functionObjectList::readFunctionObject: Add support for functionObject arguments containing '()'s
This commit is contained in:
@ -26,12 +26,11 @@ Class
|
|||||||
|
|
||||||
Description
|
Description
|
||||||
Specify a functionObject dictionary file to include, expects the
|
Specify a functionObject dictionary file to include, expects the
|
||||||
functionObject name to follow (without quotes).
|
functionObject name to follow with option arguments (without quotes).
|
||||||
|
|
||||||
Search for functionObject dictionary file in
|
Searches for functionObject dictionary file in user/group/shipped
|
||||||
user/group/shipped directories.
|
directories allowing for version-specific and version-independent files
|
||||||
The search scheme allows for version-specific and
|
using the following hierarchy:
|
||||||
version-independent files using the following hierarchy:
|
|
||||||
- \b user settings:
|
- \b user settings:
|
||||||
- ~/.OpenFOAM/\<VERSION\>/caseDicts/postProcessing
|
- ~/.OpenFOAM/\<VERSION\>/caseDicts/postProcessing
|
||||||
- ~/.OpenFOAM/caseDicts/postProcessing
|
- ~/.OpenFOAM/caseDicts/postProcessing
|
||||||
@ -44,9 +43,16 @@ Description
|
|||||||
- \b other (shipped) settings:
|
- \b other (shipped) settings:
|
||||||
- $WM_PROJECT_DIR/etc/caseDicts/postProcessing
|
- $WM_PROJECT_DIR/etc/caseDicts/postProcessing
|
||||||
|
|
||||||
An example of the \c \#includeFunc directive:
|
The optional field arguments included in the name are inserted in 'field' or
|
||||||
|
'fields' entries in the functionObject dictionary and included in the name
|
||||||
|
of the functionObject entry to avoid conflict.
|
||||||
|
|
||||||
|
Examples:
|
||||||
\verbatim
|
\verbatim
|
||||||
#includeFunc <funcName>
|
#includeFunc Q
|
||||||
|
#includeFunc components(U)
|
||||||
|
#includeFunc mag(Ux)
|
||||||
|
#includeFunc mag(p)
|
||||||
\endverbatim
|
\endverbatim
|
||||||
|
|
||||||
See Also
|
See Also
|
||||||
|
|||||||
@ -113,6 +113,7 @@ bool Foam::functionObjectList::readFunctionObject
|
|||||||
string::stripInvalid<word>(funcNameArgs);
|
string::stripInvalid<word>(funcNameArgs);
|
||||||
|
|
||||||
word funcName(funcNameArgs);
|
word funcName(funcNameArgs);
|
||||||
|
int argLevel = 0;
|
||||||
wordList args;
|
wordList args;
|
||||||
|
|
||||||
word::size_type start = 0;
|
word::size_type start = 0;
|
||||||
@ -129,18 +130,29 @@ bool Foam::functionObjectList::readFunctionObject
|
|||||||
|
|
||||||
if (c == '(')
|
if (c == '(')
|
||||||
{
|
{
|
||||||
funcName.resize(i);
|
if (argLevel == 0)
|
||||||
start = i+1;
|
{
|
||||||
|
funcName.resize(i);
|
||||||
|
start = i+1;
|
||||||
|
}
|
||||||
|
++argLevel;
|
||||||
}
|
}
|
||||||
else if (c == ',')
|
else if (c == ',')
|
||||||
{
|
{
|
||||||
args.append(funcNameArgs(start, i - start));
|
if (argLevel == 1)
|
||||||
start = i+1;
|
{
|
||||||
|
args.append(funcNameArgs(start, i - start));
|
||||||
|
start = i+1;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
else if (c == ')')
|
else if (c == ')')
|
||||||
{
|
{
|
||||||
args.append(funcNameArgs(start, i - start));
|
if (argLevel == 1)
|
||||||
break;
|
{
|
||||||
|
args.append(funcNameArgs(start, i - start));
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
--argLevel;
|
||||||
}
|
}
|
||||||
|
|
||||||
++i;
|
++i;
|
||||||
|
|||||||
@ -1,34 +0,0 @@
|
|||||||
/*--------------------------------*- C++ -*----------------------------------*\
|
|
||||||
| ========= | |
|
|
||||||
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
|
|
||||||
| \\ / O peration | Version: dev |
|
|
||||||
| \\ / A nd | Web: www.OpenFOAM.org |
|
|
||||||
| \\/ M anipulation | |
|
|
||||||
\*---------------------------------------------------------------------------*/
|
|
||||||
FoamFile
|
|
||||||
{
|
|
||||||
version 2.0;
|
|
||||||
format ascii;
|
|
||||||
class volScalarField;
|
|
||||||
object magU;
|
|
||||||
}
|
|
||||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
|
||||||
|
|
||||||
dimensions [0 1 -1 0 0 0 0];
|
|
||||||
|
|
||||||
internalField uniform 0;
|
|
||||||
|
|
||||||
boundaryField
|
|
||||||
{
|
|
||||||
sides
|
|
||||||
{
|
|
||||||
type calculated;
|
|
||||||
value uniform 0;
|
|
||||||
}
|
|
||||||
empty
|
|
||||||
{
|
|
||||||
type empty;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// ************************************************************************* //
|
|
||||||
@ -1,34 +0,0 @@
|
|||||||
/*--------------------------------*- C++ -*----------------------------------*\
|
|
||||||
| ========= | |
|
|
||||||
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
|
|
||||||
| \\ / O peration | Version: dev |
|
|
||||||
| \\ / A nd | Web: www.OpenFOAM.org |
|
|
||||||
| \\/ M anipulation | |
|
|
||||||
\*---------------------------------------------------------------------------*/
|
|
||||||
FoamFile
|
|
||||||
{
|
|
||||||
version 2.0;
|
|
||||||
format ascii;
|
|
||||||
class volScalarField;
|
|
||||||
object magU;
|
|
||||||
}
|
|
||||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
|
||||||
|
|
||||||
dimensions [0 1 -1 0 0 0 0];
|
|
||||||
|
|
||||||
internalField uniform 0;
|
|
||||||
|
|
||||||
boundaryField
|
|
||||||
{
|
|
||||||
sides
|
|
||||||
{
|
|
||||||
type calculated;
|
|
||||||
value uniform 0;
|
|
||||||
}
|
|
||||||
empty
|
|
||||||
{
|
|
||||||
type empty;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// ************************************************************************* //
|
|
||||||
Reference in New Issue
Block a user