How to set sub-nm cell sizes

3 views
Skip to first unread message

Gabry C

unread,
Dec 17, 2025, 10:24:26 PM (3 days ago) Dec 17
to Boris Computational Spintronics
Hello,

I am trying to simulate a magnetic multilayers, like a synthetic ferrimagnet.
This is the code I am using but I cannot achieve cell sizes less than 5 nm for some reason. I want to simulate the layers with 1 nm cells in the z direction.

However when I check the result files or from the console I get that the supermesh has  6 nm cells in the z direction and the CoFeB layers have 5 and 6 nm cells too. I cannot figure why is that.

How do I set the cell size to an arbitrary size and have the program actually use it?
From the console I see the minimum cell size is 25 pm, so 1 nm should be feasible.



-----------------------------------------------
 # A. Reset & Materials
    ns.configure(True)
    ns.chdir(current_folder)
   
    # 1. Define Geometry
    # Bottom: 0 to 5nm
    ns.setmaterial('CoFeB', [100e-9, 100e-9, 5e-9])
    ns.renamemesh('CoFeB', 'Bottom')
   
    # Top: 6nm to 12nm (Thickness = 6 nm)
    ns.addmaterial('CoFeB', [0.0, 0.0, 6e-9, 100e-9, 100e-9, 12e-9])
    ns.renamemesh('CoFeB', 'Top')
   
    ns.meshfocus('supermesh')
    ns.cellsize(5e-9, 5e-9, 1e-9)

    # B. Physics
    # [IMPORTANT] Must add 'exchange' module for Aex (stiffness) to work
    ns.addmodule('Bottom', 'exchange')
    ns.addmodule('Top', 'exchange')
   
    ns.addmodule('Bottom', 'surfexchange')
    ns.addmodule('Top', 'surfexchange')
    ns.addmodule('Bottom', 'aniuni')
    ns.addmodule('Top', 'aniuni')
   
    ns.addmodule('supermesh', 'sdemag')
    ns.delmodule('Bottom', 'demag')
    ns.delmodule('Top', 'demag')

    # C. Apply Parameters
    # Set Exchange Stiffness (Intra-layer)
    ns.setparam('Bottom', 'A', curr_Aex)
    ns.setparam('Top', 'A', curr_Aex)

    # Set Coupling (Inter-layer)
    ns.setparam('Top', 'J1', curr_J1)
    ns.setparam('Top', 'J2', curr_J2)
   
    ns.setparam('Bottom', 'Ms', curr_Ms_Bottom)
    ns.setparam('Top', 'Ms', curr_Ms_Top)
   
    ns.setparam('Bottom', 'K1', curr_K1); ns.setparam('Bottom', 'ea1', [1, 0.01, 0])
    ns.setparam('Top', 'K1', curr_K1);    ns.setparam('Top', 'ea1', [1, 0.01, 0])


-------------------------

Reply all
Reply to author
Forward
0 new messages