@@ -5,7 +5,6 @@ cimport numpy as np
5
5
np.import_array()
6
6
7
7
cdef extern from " dipolar.h" :
8
-
9
8
# used for demag
10
9
ctypedef struct fft_demag_plan:
11
10
int nx, ny, nz
@@ -21,6 +20,9 @@ cdef extern from "dipolar.h":
21
20
double * hx
22
21
double * hy
23
22
double * hz
23
+ double * mx
24
+ double * my
25
+ double * mz
24
26
complex * Nxx
25
27
complex * Nxy
26
28
complex * Nxz
@@ -50,12 +52,12 @@ cdef class FFTDemag(object):
50
52
cdef fft_demag_plan * _c_plan
51
53
cdef int total_length
52
54
cdef np.float64_t[:] tensor_xx_p, tensor_xy_p, tensor_xz_p, tensor_yy_p, \
53
- tensor_yz_p, tensor_zz_p, hx_p, hy_p, hz_p
55
+ tensor_yz_p, tensor_zz_p, hx_p, hy_p, hz_p, mx_p, my_p, mz_p
54
56
cdef np.complex128_t[:] Nxx_p, Nxy_p, Nxz_p, Nyy_p, Nyz_p, Nzz_p, Hx_p, \
55
57
Hy_p, Hz_p, Mx_p, My_p, Mz_p
56
58
cdef public np.ndarray tensor_xx, tensor_xy, tensor_xz, tensor_yy, \
57
59
tensor_yz, tensor_zz, Nxx, Nxy, Nxz, Nyy, Nyz, Nzz, \
58
- Mx, My, Mz, Hx, Hy, Hz, hx, hy, hz
60
+ Mx, My, Mz, Hx, Hy, Hz, hx, hy, hz, mx, my, mz
59
61
# tensor_type could be 'dipolar', 'demag' or '2d_pbc'
60
62
def __cinit__ (self , dx , dy , dz , nx , ny , nz , tensor_type = ' dipolar' ):
61
63
self ._c_plan = create_plan()
@@ -113,6 +115,12 @@ cdef class FFTDemag(object):
113
115
self .hz_p = < np.float64_t[:self .total_length]> self ._c_plan.hz
114
116
self .hz = np.asarray(self .hz_p)
115
117
118
+ self .mx_p = < np.float64_t[:self .total_length]> self ._c_plan.mx
119
+ self .mx = np.asarray(self .mx_p)
120
+ self .my_p = < np.float64_t[:self .total_length]> self ._c_plan.my
121
+ self .my = np.asarray(self .my_p)
122
+ self .mz_p = < np.float64_t[:self .total_length]> self ._c_plan.mz
123
+ self .mz = np.asarray(self .mz_p)
116
124
117
125
self .tensor_xy_p = < np.float64_t[:self .total_length]> self ._c_plan.tensor_xy
118
126
self .tensor_xy = np.asarray(self .tensor_xy_p)
0 commit comments