| 133 | |
| 134 | |
| 135 | bool Foam::functionObjects::abort::execute() |
| 136 | { |
| 137 | bool hasAbort = isFile(abortFile_); |
| 138 | reduce(hasAbort, orOp<bool>()); |
| 139 | |
| 140 | if (hasAbort) |
| 141 | { |
| 142 | switch (action_) |
| 143 | { |
| 144 | case noWriteNow : |
| 145 | { |
| 146 | if (time_.stopAt(Time::saNoWriteNow)) |
| 147 | { |
| 148 | Info<< "USER REQUESTED ABORT (timeIndex=" |
| 149 | << time_.timeIndex() |
| 150 | << "): stop without writing data" |
| 151 | << endl; |
| 152 | } |
| 153 | break; |
| 154 | } |
| 155 | |
| 156 | case writeNow : |
| 157 | { |
| 158 | if (time_.stopAt(Time::saWriteNow)) |
| 159 | { |
| 160 | Info<< "USER REQUESTED ABORT (timeIndex=" |
| 161 | << time_.timeIndex() |
| 162 | << "): stop+write data" |
| 163 | << endl; |
| 164 | } |
| 165 | break; |
| 166 | } |
| 167 | |
| 168 | case nextWrite : |
| 169 | { |
| 170 | if (time_.stopAt(Time::saNextWrite)) |
| 171 | { |
| 172 | Info<< "USER REQUESTED ABORT (timeIndex=" |
| 173 | << time_.timeIndex() |
| 174 | << "): stop after next data write" |
| 175 | << endl; |
| 176 | } |
| 177 | break; |
| 178 | } |
| 179 | } |
| 180 | } |
| 181 | |
| 182 | return true; |
| 183 | } |
| 184 | |
| 185 | |
| 186 | bool Foam::functionObjects::abort::write() |