MCPcopy Create free account
hub / github.com/OpenFOAM/OpenFOAM-dev / read

Function read

src/OpenFOAM/db/functionObjects/timeControl/timeControl.C:80–137  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

78// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
79
80void Foam::timeControl::read(const dictionary& dict)
81{
82 word controlName(prefix_ + "Control");
83 word intervalName(prefix_ + "Interval");
84
85 // For backward compatibility support the deprecated 'outputControl' option
86 // now superseded by 'writeControl' for compatibility with Time
87 if (prefix_ == "write" && dict.found("outputControl"))
88 {
89 IOWarningInFunction(dict)
90 << "Using deprecated 'outputControl'" << nl
91 << " Please use 'writeControl' with 'writeInterval'"
92 << endl;
93
94 // Change to the old names for this option
95 controlName = "outputControl";
96 intervalName = "outputInterval";
97 }
98
99 if (dict.found(controlName))
100 {
101 timeControl_ = timeControlNames_.read(dict.lookup(controlName));
102 }
103 else
104 {
105 timeControl_ = ocTimeStep;
106 }
107
108 switch (timeControl_)
109 {
110 case ocTimeStep:
111 {
112 intervalSteps_ = dict.lookupOrDefault<label>(intervalName, 0);
113 break;
114 }
115
116 case ocWriteTime:
117 case ocOutputTime:
118 {
119 intervalSteps_ = dict.lookupOrDefault<label>(intervalName, 1);
120 break;
121 }
122
123 case ocClockTime:
124 case ocRunTime:
125 case ocCpuTime:
126 case ocAdjustableRunTime:
127 {
128 interval_ = readScalar(dict.lookup(intervalName));
129 break;
130 }
131
132 default:
133 {
134 break;
135 }
136 }
137}

Callers 2

timeControl.CFile · 0.70
IOOutputFilter.CFile · 0.50

Calls 4

lookupMethod · 0.80
readScalarFunction · 0.50
foundMethod · 0.45
readMethod · 0.45

Tested by

no test coverage detected