Hi Josh
THanks for the quick reply.
I don't have any further error message to show. Both times it happened over night. So maybe some program is trying to back it up like you suggested. Or my PC is going into sleep mode or something. It is a new PC running windows 11 which I haven't used much yet so I don't know if that is the issue. It just seems strange that it stopped with the same file size and more or less in the same place within the loop. To be more clear the second time I ran I started my new loop from where the previous one failed. So it seems after the same number of loops its failed.
Here is the script.
deg:=pi/180
Nx := 512
Ny := 256
Nz := 1
SetGridSize(Nx,Ny,Nz)
cell_xy := 4e-9
cell_z := 2e-9
SetCellSize(cell_xy,cell_xy,cell_z)
//SetPBC(10,10,0)
alpha = 0.07
EnableDemag= False
anisU = vector(0,0,1)
Ku1 = -1.2e4
Pol = 0.22
Lambda = 1
FixedLayer = vector(0,-1,0)
Msat = 600e3
Aex = 15e-12
H:=0.1
maxdt=1e-11
pause:=0e-9
exc_time:=10e-9
// ===== USER INPUT =====
theta:=0.0*deg
theta_min := 80.0*deg
theta_max := 355*deg
n_theta := 56
curr:=0.0
curr_min := -3e11
curr_max := 3e11
n_curr := 31
mx2 := 0.0;my2 := 0.0;mz2 := 0.0
tableaddvar(H*1000,"mu0H"," mT")
tableaddvar(theta/deg,"theta","deg")
tableaddvar(curr,"current","A")
tableaddvar(mx2,"mx^2","")
tableaddvar(my2,"my^2","")
tableaddvar(mz2,"mz^2","")
count:=0
// ===== LOOPS =====
for i := 0; i < n_theta; i++ {
theta = (theta_min + (theta_max - theta_min) * (i) / (n_theta - 1))
if n_theta == 1 {
theta = theta_min
}
for jj := 0; jj < n_curr; jj++ {
curr = curr_min + (curr_max - curr_min) * (jj) / (n_curr - 1)
if n_curr == 1 {
curr = curr_min
}
print(sprintf("H = %04.0f mT theta = %03.0f and current = %f", trunc(H*1000),trunc(theta/deg),curr))
t = 0
J = vector(0,0,0)
Temp = 300
m = randommag()
run(pause)
B_ext = vector(H*cos(theta), H*sin(theta), 0)
J = vector(0,0,curr)
dt := 1e-11
t_end := exc_time
for t < t_end {
step := dt
if t + dt > t_end {
step = t_end - t
}
run(step)
//Calculate m^2 by cells
// Total number of cells
N := Nx * Ny * Nz
mx2 = sum(Mul(m.comp(0), m.comp(0)))/N
my2 = sum(Mul(m.comp(1), m.comp(1)))/N
mz2 = sum(Mul(m.comp(2), m.comp(2)))/N
tablesave()
progress := 100.0 * t / t_end
print(sprintf("Time progress: %.1f%%", progress))
}
filename:=sprintf("M%04d_M%04.0fmT_%03.0fdeg_%06.0fGJ.png",count,trunc(H*1000),trunc(theta/deg),trunc(curr*1e-9))
snapshotas(m,filename)
count++
}
}