Skip to content

Commit 970d49f

Browse files
committed
Add other C Struct info to struct
1 parent 2415f1e commit 970d49f

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

fidimag/common/dipolar/dipolar.pyx

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ cdef extern from "dipolar.h":
5050

5151
cdef class FFTDemag(object):
5252
cdef fft_demag_plan *_c_plan
53-
cdef int total_length
53+
cdef public int total_length, lenx, leny, lenz, lenxy
5454
cdef np.float64_t[:] tensor_xx_p, tensor_xy_p, tensor_xz_p, tensor_yy_p, \
5555
tensor_yz_p, tensor_zz_p, hx_p, hy_p, hz_p, mx_p, my_p, mz_p
5656
cdef np.complex128_t[:] Nxx_p, Nxy_p, Nxz_p, Nyy_p, Nyz_p, Nzz_p, Hx_p, \
@@ -78,6 +78,10 @@ cdef class FFTDemag(object):
7878
raise Exception("Only support options 'dipolar', 'demag' and '2d_pbc'.")
7979

8080
self.total_length = int(self._c_plan.total_length)
81+
self.lenx = int(self._c_plan.lenx)
82+
self.leny = int(self._c_plan.leny)
83+
self.lenz = int(self._c_plan.lenz)
84+
self.lenxy = self.lenx*self.leny
8185
self.tensor_xx_p = <np.float64_t[:self.total_length]> self._c_plan.tensor_xx
8286
self.tensor_xx = np.asarray(self.tensor_xx_p)
8387

0 commit comments

Comments
 (0)