In [1]:
import oommf                     # Access oommf as Python module
Py = oommf.materials.permalloy   # Material from database

# Define the geometry:
my_geometry = oommf.geometry.Cuboid((0,0,0), (30, 30, 100), unitlength=1e-9)

# Create a simulation object
sim = oommf.Simulation(my_geometry, cellsize=5e-9, material=Py)

sim.m = [1, 1, 0]               # initialise magnetisation uniformly

In [2]:
sim                             # Show simulation info


Out[2]:
Simulation: Py(Fe80Ni20). 
	Geometry: Cuboid corner1 = (0, 0, 0), corner2 = (30, 30, 100). 
	          Cells = [6, 6, 20], total=720.

In [3]:
sim.advance_time(1e-9)          # Solve LLG for 0.1ns


Integrating ODE from 0.0s to 1e-09s

In [4]:
sim.advance_time(3e-9)          # Solve LLG for another 0.2 ns


Integrating ODE from 1e-09s to 3e-09s

In [5]:
data = oommf.DataTable()        # Open ODT file
data.m_of_t()                   # and show m(t)


Out[5]:

In [6]:
sim                             # show simulation state again


Out[6]:
Simulation: Py(Fe80Ni20). 
	Geometry: Cuboid corner1 = (0, 0, 0), corner2 = (30, 30, 100). 
	          Cells = [6, 6, 20], total=720.
	Current t = 3e-09s

In [ ]: