Skip to content

Commit 1b5532f

Browse files
author
davidcorteso
committed
Sk number with BL method was avoiding neighbours with index 0, thus the C code was corrected
1 parent 6afb7e1 commit 1b5532f

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

fidimag/atomistic/lib/util.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -297,15 +297,15 @@ double skyrmion_number_BergLuscher(double *spin, double *charge,
297297
// Compute the spherical triangle area for the triangle formed
298298
// by the i-th spin and neighbours 0 and 2, i.e.
299299
// [i j=0 j=2]. First check that the NNs exist:
300-
if(ngbs[6 * i] > 0 && ngbs[6 * i + 2] > 0){
300+
if(ngbs[6 * i] >= 0 && ngbs[6 * i + 2] >= 0){
301301
charge[i] += compute_BergLuscher_angle(&spin[spin_index],
302302
&spin[3 * ngbs[6 * i]],
303303
&spin[3 * ngbs[6 * i + 2]]
304304
);
305305
}
306306

307307
// Triangle: [i j=1 j=3]
308-
if(ngbs[6 * i + 1] > 0 && ngbs[6 * i + 3] > 0){
308+
if(ngbs[6 * i + 1] >= 0 && ngbs[6 * i + 3] >= 0){
309309
charge[i] += compute_BergLuscher_angle(&spin[spin_index],
310310
&spin[3 * ngbs[6 * i + 1]],
311311
&spin[3 * ngbs[6 * i + 3]]

0 commit comments

Comments
 (0)