Steps the ising model forward in time.
()
| 240 | * |
| 241 | */ |
| 242 | public void stepIsingModel() { |
| 243 | if(fieldChanged) { |
| 244 | this.adjustE(); |
| 245 | } |
| 246 | for(int i = 0; i<flipsPerStep; i++) { |
| 247 | flip(); |
| 248 | } |
| 249 | time_counter++; |
| 250 | lattice.setBlock(0, 0, spinData); |
| 251 | if(fieldChanged) { |
| 252 | this.adjustE(); |
| 253 | } |
| 254 | enData.append(time_counter/10.0, E); |
| 255 | magData.append(time_counter/10.0, M); |
| 256 | double ave = org.opensourcephysics.numerics.Util.computeAverage(magData.getYPoints(), 0, magData.getIndex()); |
| 257 | magPanel.setTitle("<M> = "+format.format((float) ave)); |
| 258 | ave = org.opensourcephysics.numerics.Util.computeAverage(enData.getYPoints(), 0, enData.getIndex()); |
| 259 | enPanel.setTitle("<E> = "+format.format((float) ave)); |
| 260 | } |
| 261 | |
| 262 | /** |
| 263 | * Performs the animation in response to timer events. |
no test coverage detected