Skip to content

Commit da33e49

Browse files
committed
Fix micro_clib.pyx
1 parent 5bc83f4 commit da33e49

File tree

1 file changed

+21
-27
lines changed

1 file changed

+21
-27
lines changed

fidimag/micro/lib/micro_clib.pyx

Lines changed: 21 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,5 @@
11
import numpy as np
22
cimport numpy as np
3-
np.import_array()
4-
5-
63

74
cdef extern from "micro_clib.h":
85
void compute_exch_field_micro(double *m, double *field,
@@ -27,43 +24,44 @@ cdef extern from "micro_clib.h":
2724
int nx, int ny, int nz, int *ngbs)
2825

2926

30-
31-
def compute_exchange_field_micro(double[:] m,
32-
double[:] field,
33-
double[:] energy,
34-
double[:] Ms_inv,
27+
def compute_exchange_field_micro(double [:] m,
28+
double [:] field,
29+
double [:] energy,
30+
double [:] Ms_inv,
3531
A, dx, dy, dz, n,
36-
int ngbs[:, :]):
32+
int [:, :] ngbs):
33+
3734
compute_exch_field_micro(&m[0], &field[0], &energy[0], &Ms_inv[0], A,
3835
dx, dy, dz, n, &ngbs[0, 0])
3936

4037

41-
def compute_exchange_field_micro_rkky(double[:] m,
42-
double[:] field,
43-
double[:] energy,
44-
double[:] Ms_inv,
38+
def compute_exchange_field_micro_rkky(double [:] m,
39+
double [:] field,
40+
double [:] energy,
41+
double [:] Ms_inv,
4542
sigma, nx, ny, nz, z_bottom, z_top):
43+
4644
compute_exch_field_rkky_micro(&m[0], &field[0], &energy[0], &Ms_inv[0], sigma,
4745
nx, ny, nz, z_bottom, z_top)
4846

4947

50-
51-
def compute_dmi_field(double[:] m,
52-
double[:] field,
53-
double[:] energy,
54-
double[:] Ms_inv,
55-
double[:] D,
56-
double[:] dmi_vector,
48+
def compute_dmi_field(double [:] m,
49+
double [:] field,
50+
double [:] energy,
51+
double [:] Ms_inv,
52+
double [:] D,
53+
double [:] dmi_vector,
5754
n_dmi_ngbs,
5855
dx, dy, dz,
56+
n,
57+
int [:, :] ngbs
5958
):
6059

6160
dmi_field(&m[0], &field[0], &energy[0], &Ms_inv[0],
6261
&D[0], &dmi_vector[0], n_dmi_ngbs,
6362
dx, dy, dz, n, &ngbs[0, 0])
6463

6564

66-
6765
def compute_anisotropy_micro(double [:] m,
6866
double [:] field,
6967
double [:] energy,
@@ -75,13 +73,9 @@ def compute_anisotropy_micro(double [:] m,
7573
compute_uniaxial_anis(&m[0], &field[0], &energy[0], &Ms_inv[0],
7674
&Ku[0], &axis[0], nx, ny, nz)
7775

78-
def compute_skyrmion_number(double[:] m,
79-
double[:] charge,
80-
nx, ny, nz,
81-
int[:, :] ngbs):
82-
8376
def compute_skyrmion_number(double [:] m,
8477
double [:] charge,
8578
nx, ny, nz,
8679
int [:, :] ngbs):
87-
return skyrmion_number(&m[0], &charge[0], nx, ny, nz, &ngbs[0, 0])
80+
81+
return skyrmion_number(&m[0], &charge[0], nx, ny, nz, &ngbs[0, 0])

0 commit comments

Comments
 (0)