In this tutorial we will build a simple magnetic structure and save it as a cml file.  First, start JaB.  We assume that you are running JaB directly from the jar file, so type java –jar JaB.jar.  You should see the JaB main screen.



The first menuitem allows you to open and save existing files.  The second menuitem allows you to build a cml-style micromagnetics file.  The first pull down menuitem is labeled Grid... which sets up the initial grid.  The other menuitem is labeled Region… which allows you to define additional regions within the grid. For a discussion of the cml-style file please see the homepage of JaMM.  The buttons below the menu perform some of the common tasks.  You can get hints for each button by placing the mouse cursor over the button. Since the order of the buttons (and menu items) is important several of the buttons and menuitems may be “grayed-out” or inactive until other tasks have been performed. For now, click on the Grid button. You should see the following widget.



The sample is defined in terms of a rectangular grid of cells which may or may not contain various materials.  For this example we will generate a sample which is suitable for a quick micromagnetics simulation.  For micromagnetics simulations the cellsize must be chosen to be less than the exchange length of the material.  Next, we should determine a cellsize.  This is a crucial step in determining the success of the simulation.  The cellsize needs to be chosen so that the fundamental assumption that all spins in a single cell can be represented by a single spin.  This means that all spins in each cell need to be aligned in the same direction.  For this to be true the exchange interaction must be greater than the demagnetizing interaction.  Since the exchange interaction depends on the size of the cell this condition can be met by decreasing the cell size and thereby increasing the exchange interaction.  To meet this condition the cellsize should be less than the exchange length, Lex = (2 A / mo Ms2)1/2 where A is the exchange constant for the chosen materials and Ms is the saturation magnetization.  mo is the permitivity of free space mo = 4 p 10-7. For permalloy the exchange length is 5.3 nm, so we will choose the cellsize to be 5 nm .  We’ll keep the nx, ny and nz parameters at the default and change dx, dy and dz to be 5e-09.  Note that dx, dy and dz do not need to be the same.  Click on the OK button.  The main window appears with the grid drawn.  The Grid button is now inactive and the SaveAs, Region and LayerUp buttons are now active.




The LayerUp and LayerDown buttons allow you to move through the material in the z-direction.  When the first or last layers are reached the appropriate button becomes inactive.  Now that we have defined the grid we will add regions of materials to the grid.  Click on the Regions button.  The following widget appears…



First we will add a new region by clicking on the AddRegion button.  The AvailableMaterials widget appears.  Select one of the materials by clicking on the material name in the corresponding row.  This selects the default material properties for this material.  One of the other tutorials shows how to modify the material parameters or add new materials to this list.  In this tutorial we will select permalloy by highlighting the Py row and clicking on the Done button.



The RegionChooser widget has a new row.  The material is indicated by the first column. 



In this example we will fill the entire sample with permalloy.  Click on the cell in the Py row and Shape column.  A pull down combo box appears with the available shape types.  Cell allows you to set individual cells in the grid, Layer sets a layer to the given material, Sample fills the entire sample, Rectangle, Cylinder and Sphere fills shapes of those types with the material.  For this example select sample and then the Done button.  If you make a mistake in adding a region you can delete the region by selecting the row and then clicking the RemoveRegion button.



After clicking the Done button the grid is updated to show the current sample



Finally, Save the sample by clicking on the SaveAs…button..  After clicking on the Save Button the File Save Dialog should appear.




Set the filename as shown and click on the Save Button.  Note that JaB does not automatically assign filename extensions, however, it will use them in reading files, so you should use the extension cml for Chemical Markup Language Format files by explicitly typing them in the File Name edit box.  Also, we recommend that you NOT save the cml files into the JaMM root directory since JaMM stores the material files there.  While not a serious problem, this may cause confusion later. When you click save a widget will appear to allow you to choose exchange interaction parameters.



For this tutorial there is only a single region.  The exchange constant is filled in with the default value for permalloy.  Click on OK to select the default exchange constant.  The SpinEasyAxesChooser widget appears.  This allows you to set the initial spin orientations and directions of the easy axes.  Click on the cell corresponding to each column and select the orientation and direction you desire.  In this example we will choose random for both.



You will be notified that the file was saved.  Click on the Exit Button (the last button) on the builder toolbar to end the builder.


Congratulations, you have built a sample of permalloy.