@@ -50,26 +50,25 @@ def setup(self, mesh, spin, Ms, Ms_inv):
5050 asymptotic_radius = options ['asymptotic_radius' ]
5151 if 'dipolar_radius' in options :
5252 dipolar_radius = options ['dipolar_radius' ]
53- if 'tensor_file_name' in options :
54- tensor_file_name = options ['tensor_file_name' ]
55-
56- if tensor_file_name :
57- if not (os .path .exists (tensor_file_name + '.npz' )):
58- self .demag .compute_tensors_2dpbc (tensors , pbc_2d_error , sample_repeat_nx , sample_repeat_ny , dipolar_radius )
59- else :
60- npzfile = np .load (tensor_file_name + '.npz' )
61- geo_info = npzfile ['geo' ]
62- geo_arr = np .array ([self .nx ,self .ny , self .nz , self .dx , self .dy , self .dz ], dtype = np .float )
63- #print 'info', geo_info
64- if not np .allclose (geo_arr , geo_info ):
65- self .demag .compute_tensors_2dpbc (tensors , pbc_2d_error , sample_repeat_nx , sample_repeat_ny , dipolar_radius )
66- else :
67- tensors = npzfile ['tensors' ]
68- geo_arr = np .array ([self .nx , self .ny , self .nz , self .dx , self .dy , self .dz ], dtype = np .float )
69- np .savez (tensor_file_name + '.npz' , geo = geo_arr , tensors = tensors )
70-
71- else :
72- self .demag .compute_tensors_2dpbc (tensors , pbc_2d_error , sample_repeat_nx , sample_repeat_ny , dipolar_radius )
53+ #if 'tensor_file_name' in options:
54+ # tensor_file_name = options['tensor_file_name']
55+
56+ #if tensor_file_name:
57+ #if not (os.path.exists(tensor_file_name+'.npz')):
58+ # self.demag.compute_tensors_2dpbc(tensors, pbc_2d_error, sample_repeat_nx, sample_repeat_ny, dipolar_radius)
59+ #else:
60+ # npzfile = np.load(tensor_file_name+'.npz')
61+ # geo_info = npzfile['geo']
62+ # geo_arr = np.array([self.nx,self.ny, self.nz, self.dx, self.dy, self.dz], dtype=np.float)
63+ # #print 'info', geo_info
64+ # if not np.allclose(geo_arr, geo_info):
65+ # self.demag.compute_tensors_2dpbc(tensors, pbc_2d_error, sample_repeat_nx, sample_repeat_ny, dipolar_radius)
66+ # else:
67+ # tensors = npzfile['tensors']
68+ #geo_arr = np.array([self.nx, self.ny, self.nz, self.dx, self.dy, self.dz], dtype=np.float)
69+ #np.savez(tensor_file_name+'.npz', geo=geo_arr, tensors=tensors)
70+
71+ self .demag .compute_tensors_2dpbc (tensors , pbc_2d_error , sample_repeat_nx , sample_repeat_ny , dipolar_radius )
7372
7473 #print tensors
7574 self .demag .fill_demag_tensors (tensors )
0 commit comments