Skip to content

Issue for create_sim(mesh) and Sim(mesh;driver = "SD") #13

@Donghi007

Description

@Donghi007

Dear @ww1g11 ,

I found an issue about creating a random state by usingcreate_sim(mesh) and Sim(mesh;driver = "SD"), respectively.

if I use Sim(mesh;driver = "SD"), like this:

mesh = FDMesh(dx=2e-9, dy=2e-9, dz=2e-9, nx=256, ny=256, nz=53, pbc="xy")
sim = Sim(mesh; driver="SD", name="relax")
init_m0_random(sim)
save_ovf(sim, "save256x256x53_random", type =  Float64)
println("output finished")

The out put ovf file save256x256x53_random.ovf is not correct, it produced a ferromagnetic state not random state.
However, if I use create_sim(mesh) function, like this:

mesh = FDMesh(dx=2e-9, dy=2e-9, dz=2e-9, nx=256, ny=256, nz=53, pbc="xy")
sim = create_sim(mesh)
init_m0_random(sim)
save_ovf(sim, "save256x256x53_random", type =  Float64)
println("output finished")

The output ovf file is correct, a random state created. Similarly, I define a region for example:

#region 1
mesh = FDMesh(dx=2e-9, dy=2e-9, dz=2e-9, nx=256, ny=256, nz=53, pbc="xy")
#sim = Sim(mesh; driver="SD", name="relax")   commend this line
sim = create_sim(mesh)
function initial_layer(i,j,k, dx, dy, dz)    
    if k>3&&k<53-3
        return (0,0,1)
    else
        return (0,0,-1)
    end
end

init_m0(sim, damage_layer_initial)  # Initialize magnetization
save_ovf(sim, "save256x256x53_initial", type =  Float64)

If I use create_sim(mesh) to create this region, this region can be defined correctly. But Sim(mesh;driver = "SD") did not work well.
So, I hope to know what's the different between create_sim() and Sim().

I would be very appreciate for any help you provide :)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions