| 33 | // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // |
| 34 | |
| 35 | void Foam::Time::readDict() |
| 36 | { |
| 37 | word application; |
| 38 | if (controlDict_.readIfPresent("application", application)) |
| 39 | { |
| 40 | // Do not override if already set so external application can override |
| 41 | setEnv("FOAM_APPLICATION", application, false); |
| 42 | } |
| 43 | |
| 44 | |
| 45 | // Check for local switches and settings |
| 46 | // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ |
| 47 | |
| 48 | // Debug switches |
| 49 | if (controlDict_.found("DebugSwitches")) |
| 50 | { |
| 51 | Info<< "Overriding DebugSwitches according to " << controlDict_.name() |
| 52 | << endl; |
| 53 | |
| 54 | simpleObjectRegistry& objects = debug::debugObjects(); |
| 55 | const dictionary& localSettings = controlDict_.subDict("DebugSwitches"); |
| 56 | forAllConstIter(dictionary, localSettings, iter) |
| 57 | { |
| 58 | const word& name = iter().keyword(); |
| 59 | |
| 60 | simpleObjectRegistryEntry* objPtr = objects.lookupPtr(name); |
| 61 | |
| 62 | if (objPtr) |
| 63 | { |
| 64 | Info<< " " << iter() << endl; |
| 65 | |
| 66 | const List<simpleRegIOobject*>& objects = *objPtr; |
| 67 | |
| 68 | if (iter().isDict()) |
| 69 | { |
| 70 | forAll(objects, i) |
| 71 | { |
| 72 | OStringStream os(IOstream::ASCII); |
| 73 | os << iter().dict(); |
| 74 | IStringStream is(os.str()); |
| 75 | objects[i]->readData(is); |
| 76 | } |
| 77 | } |
| 78 | else |
| 79 | { |
| 80 | forAll(objects, i) |
| 81 | { |
| 82 | objects[i]->readData(iter().stream()); |
| 83 | } |
| 84 | } |
| 85 | } |
| 86 | } |
| 87 | } |
| 88 | |
| 89 | // Optimisation Switches |
| 90 | if (controlDict_.found("OptimisationSwitches")) |
| 91 | { |
| 92 | Info<< "Overriding OptimisationSwitches according to " |
no test coverage detected