| 43 | // * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * * // |
| 44 | |
| 45 | void Foam::solution::read(const dictionary& dict) |
| 46 | { |
| 47 | if (dict.found("cache")) |
| 48 | { |
| 49 | cache_ = dict.subDict("cache"); |
| 50 | caching_ = cache_.lookupOrDefault("active", true); |
| 51 | } |
| 52 | |
| 53 | if (dict.found("relaxationFactors")) |
| 54 | { |
| 55 | const dictionary& relaxDict(dict.subDict("relaxationFactors")); |
| 56 | if (relaxDict.found("fields") || relaxDict.found("equations")) |
| 57 | { |
| 58 | if (relaxDict.found("fields")) |
| 59 | { |
| 60 | fieldRelaxDict_ = relaxDict.subDict("fields"); |
| 61 | } |
| 62 | |
| 63 | if (relaxDict.found("equations")) |
| 64 | { |
| 65 | eqnRelaxDict_ = relaxDict.subDict("equations"); |
| 66 | } |
| 67 | } |
| 68 | else |
| 69 | { |
| 70 | // backwards compatibility |
| 71 | fieldRelaxDict_.clear(); |
| 72 | |
| 73 | const wordList entryNames(relaxDict.toc()); |
| 74 | forAll(entryNames, i) |
| 75 | { |
| 76 | const word& e = entryNames[i]; |
| 77 | scalar value = readScalar(relaxDict.lookup(e)); |
| 78 | |
| 79 | if (e(0, 1) == "p") |
| 80 | { |
| 81 | fieldRelaxDict_.add(e, value); |
| 82 | } |
| 83 | else if (e.length() >= 3) |
| 84 | { |
| 85 | if (e(0, 3) == "rho") |
| 86 | { |
| 87 | fieldRelaxDict_.add(e, value); |
| 88 | } |
| 89 | } |
| 90 | |
| 91 | } |
| 92 | |
| 93 | eqnRelaxDict_ = relaxDict; |
| 94 | } |
| 95 | |
| 96 | fieldRelaxDefault_ = |
| 97 | fieldRelaxDict_.lookupOrDefault<scalar>("default", 0.0); |
| 98 | |
| 99 | eqnRelaxDefault_ = |
| 100 | eqnRelaxDict_.lookupOrDefault<scalar>("default", 0.0); |
| 101 | |
| 102 | if (debug) |
no test coverage detected