mirror of
https://develop.openfoam.com/Development/openfoam.git
synced 2025-11-28 03:28:01 +00:00
ENH: provide operator[] for accessing argList options.
- operator[] with label -> get args at index - operator[] with word -> get named option
This commit is contained in:
@ -232,14 +232,12 @@ void Foam::calcTypes::addSubtract::preCalc
|
||||
<< exit(FatalError);
|
||||
}
|
||||
|
||||
if (args.optionFound("field"))
|
||||
if (args.optionReadIfPresent("field", addSubtractFieldName_))
|
||||
{
|
||||
addSubtractFieldName_ = args.option("field");
|
||||
calcType_ = FIELD;
|
||||
}
|
||||
else if (args.optionFound("value"))
|
||||
else if (args.optionReadIfPresent("value", addSubtractValueStr_))
|
||||
{
|
||||
addSubtractValueStr_ = args.option("value");
|
||||
calcType_ = VALUE;
|
||||
}
|
||||
else
|
||||
@ -249,10 +247,7 @@ void Foam::calcTypes::addSubtract::preCalc
|
||||
<< nl << exit(FatalError);
|
||||
}
|
||||
|
||||
if (args.optionFound("resultName"))
|
||||
{
|
||||
resultName_ = args.option("resultName");
|
||||
}
|
||||
args.optionReadIfPresent("resultName", resultName_);
|
||||
}
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user