BUG: scaleFactor for fieldValue function-objects is 'sticky' (issue #331)

- if set in a dictionary and later removed, the intermediate value is
  retained rather than reverting to a normal default value.

- same applies for a few other function objects and their variables
This commit is contained in:
Mark Olesen
2016-12-08 11:33:39 +00:00
parent b4182c60a3
commit b6d79ed4ce
6 changed files with 15 additions and 10 deletions

View File

@ -97,7 +97,7 @@ bool Foam::functionObjects::fieldValue::read(const dictionary& dict)
dict.lookup("fields") >> fields_;
dict.lookup("writeFields") >> writeFields_;
dict.readIfPresent("scaleFactor", scaleFactor_);
scaleFactor_ = dict.lookupOrDefault<scalar>("scaleFactor", 1.0);
return true;
}

View File

@ -70,7 +70,7 @@ protected:
// Protected data
//- Optional scale value
//- Optional scaling factor
scalar scaleFactor_;
//- Construction dictionary