| 2151 | } |
| 2152 | |
| 2153 | int |
| 2154 | Domain::commit(void) |
| 2155 | { |
| 2156 | // |
| 2157 | // first invoke commit on all nodes and elements in the domain |
| 2158 | // |
| 2159 | Node *nodePtr; |
| 2160 | NodeIter &theNodeIter = this->getNodes(); |
| 2161 | while ((nodePtr = theNodeIter()) != 0) { |
| 2162 | nodePtr->commitState(); |
| 2163 | } |
| 2164 | |
| 2165 | Element *elePtr; |
| 2166 | ElementIter &theElemIter = this->getElements(); |
| 2167 | while ((elePtr = theElemIter()) != 0) { |
| 2168 | elePtr->commitState(); |
| 2169 | } |
| 2170 | |
| 2171 | // set the new committed time in the domain |
| 2172 | committedTime = currentTime; |
| 2173 | dT = 0.0; |
| 2174 | |
| 2175 | // invoke record on all recorders |
| 2176 | for (int i=0; i<numRecorders; i++) |
| 2177 | if (theRecorders[i] != 0) |
| 2178 | theRecorders[i]->record(commitTag, currentTime); |
| 2179 | |
| 2180 | // update the commitTag |
| 2181 | commitTag++; |
| 2182 | return 0; |
| 2183 | } |
| 2184 | |
| 2185 | int |
| 2186 | Domain::revertToLastCommit(void) |