@@ -176,6 +176,9 @@ def __init__(self, grid, wake=None, cfln=0.5, dt=None,
176176 hstack ([self .Pz , sparse_mat ((N ,N )), - self .Px ]),
177177 hstack ([- self .Py , self .Px , sparse_mat ((N ,N ))])
178178 ], dtype = np .int8 )
179+
180+ self .S = hstack ([self .Px , self .Py , self .Pz ])
181+ print (self .S * self .C )
179182
180183 # Boundaries
181184 if verbose :
@@ -244,8 +247,8 @@ def __init__(self, grid, wake=None, cfln=0.5, dt=None,
244247 self .iDmu = diags (self .imu .toarray (), shape = (3 * N , 3 * N ), dtype = self .dtype )
245248 self .Dsigma = diags (self .sigma .toarray (), shape = (3 * N , 3 * N ), dtype = self .dtype )
246249
247- self .tDsiDmuiDaC = self .tDs * self .iDmu * self .iDa * self .C
248- self .itDaiDepsDstC = self .itDa * self . iDeps * self .Ds * self .C .transpose ()
250+ self .tDsiDmuiDaC = self .iDa * self .iDmu * self .C * self .Ds
251+ self .itDaiDepsDstC = self .iDeps * self .itDa * self .C .transpose () * self . tDs
249252
250253 if imported_mkl and not self .use_gpu : # MKL backend for CPU
251254 if verbose :
@@ -303,8 +306,8 @@ def update_tensors(self, tensor='all'):
303306
304307 if self .verbose :
305308 print ('Re-Pre-computing ...' )
306- self .tDsiDmuiDaC = self .tDs * self .iDmu * self .iDa * self .C
307- self .itDaiDepsDstC = self .itDa * self . iDeps * self .Ds * self .C .transpose ()
309+ self .tDsiDmuiDaC = self .iDa * self .iDmu * self .C * self .Ds
310+ self .itDaiDepsDstC = self .iDeps * self .itDa * self .C .transpose () * self . tDs
308311 self .step_0 = False
309312
310313 def _one_step (self ):
@@ -325,7 +328,8 @@ def _one_step(self):
325328
326329 #include current computation
327330 if self .use_conductivity :
328- self .J .fromarray (self .sigma .toarray ()* self .E .toarray ())
331+ self .J .fromarray (self .sigma .toarray ()* self .E .toarray ()
332+ )
329333
330334 def one_step_mkl (self ):
331335 if self .step_0 :
0 commit comments