MCPcopy Create free account
hub / github.com/OpenSourcePhysics/osp / stepIsingModel

Method stepIsingModel

src/debugging/physicsapps/IsingApp.java:242–260  ·  view source on GitHub ↗

Steps the ising model forward in time.

()

Source from the content-addressed store, hash-verified

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.

Callers 1

doStepMethod · 0.95

Calls 9

adjustEMethod · 0.95
flipMethod · 0.95
computeAverageMethod · 0.80
setBlockMethod · 0.65
appendMethod · 0.65
setTitleMethod · 0.65
getYPointsMethod · 0.45
getIndexMethod · 0.45
formatMethod · 0.45

Tested by

no test coverage detected