Class edu.cornell.lassp.houle.HysSym.HysLattice
All Packages Class Hierarchy This Package Previous Next Index
Class edu.cornell.lassp.houle.HysSym.HysLattice
java.lang.Object
|
+----edu.cornell.lassp.houle.HysSym.HysLattice
- public class HysLattice
- extends Object
- implements Runnable
HysLattice is a simulation of a random-field Ising model on a 2D
lattice that demonstrates
hysteresis. HysLattice is based on work by Jim Sethna and his group,
more information is availible about the physics.
HysLattice is a model under the model-view-controller (MVC) paradigm.
HysLattice is controlled through calls to the runTo() method and sends
to simulations to Consumers that are registed using the
registerConsumer() method. This method of registration
will change in the next major revision.
Source code is available.
For examples of controllers see hys and HysControlBar. For
information on consumers, see AvalancheConsumer,
RunStopConsumer, and XyConsumer.
- Version:
- 0.9a
- Author:
- Paul A. Houle (E-mail: ph18@cornell.edu )
- See Also:
- RandomElement, AvalancheConsumer, XyConsumer, RunStopConsumer, hys, HysControlBar
-
HysLattice(int, int, double)
-
-
bmax()
-
-
bmin()
-
-
getCell(int, int)
-
-
getDirection()
-
-
getGoal()
-
-
getXSize()
-
-
getYSize()
-
-
isRunning()
-
-
nDown(int, int)
-
-
registerConsumer(Object)
- Register consumer takes an object as an argument, identifies
which consumer interfaces it implements, and registers them.
-
run()
-
run implements the interface runnable, and is the main thread of execution.
-
runTo(double)
-
runTo instructs the simulation to start a thread that changes the magnetic
field from it's current value to the specified goal value.
-
stop()
- Stop execution of the HysLattice thread in an orderly manner.
HysLattice
public HysLattice(int nx,
int ny,
double R)
- Parameters:
- nx - number of spins in x direction
- ny - number of spins in y direction
- R - random field value
getXSize
public final int getXSize()
- Returns:
- the number of cells in the lattice in the X direction
getYSize
public final int getYSize()
- Returns:
- the number of cells in the lattice in the Y direction.
getCell
public final int getCell(int i,
int j)
- Returns:
- the value of the spin at coordinates (i,j) [always +1 or -1]
getDirection
public final int getDirection()
- Returns:
- the direction that the model is running in: the sign of the increment of the magnetic field.
getGoal
public final double getGoal()
- Returns:
- s the magnetic field towards which the system is evolving.
isRunning
public final boolean isRunning()
- Returns:
- true if the model is running, false if it isn't.
bmax
public double bmax()
- Returns:
- the maximum magnetic field, past which all spins will be up.
bmin
public double bmin()
- Returns:
- the minimum magnetic field, past which all spins will be down.
nDown
public final int nDown(int i,
int j)
- Parameters:
- i - i index of a spin.
- j - j index of a spin.
- Returns:
- s the number of neighbors of the spin (i,j) that are spin down.
registerConsumer
public void registerConsumer(Object o)
- Register consumer takes an object as an argument, identifies
which consumer interfaces it implements, and registers them. It will
soon be replaced by a better mechanism.
runTo
public boolean runTo(double g)
- runTo instructs the simulation to start a thread that changes the magnetic
field from it's current value to the specified goal value. The thread
continues until it reaches the specified goal or until there are no spins
left to flip
- Parameters:
- g - goal magnetic field.
- Returns:
- true if model isn't already running (and thus has been started successfully), and false if it is running (and hasn't been started successfully)
run
public void run()
- run implements the interface runnable, and is the main thread of execution.
It is not intended to be called directly. Run the simulation using the
runTo method.
stop
public void stop()
- Stop execution of the HysLattice thread in an orderly manner. Causes
HysLattice to quit once it is done executing the step it is currently on.
All Packages Class Hierarchy This Package Previous Next Index