diff --git a/integrators/tps2.py b/integrators/tps2.py index 19baab4b25476674382c402edc553573cc2a2c18..56cc1add2f8875c002de1a788cc8a15cc3e5a970 100644 --- a/integrators/tps2.py +++ b/integrators/tps2.py @@ -219,25 +219,22 @@ class TPS2(_tpsx.TPSX, \ or self.parameters.maxwellCoupling == "strayField" ): self._Mag.v.hs.SetZero() - # assemble blf and lf - A = self._A_stat + self._A_instat - itnr = 0 oldIterate = np.array( self._Mag.v.gf.vec.FV() ) diff_gf = GridFunction(self._X) diff_cf = diff_gf + # assemble blf and lf self._Assemble_f_fix() for itnr in range(self._maxiter): self._Assemble_f_iter() f = self._f_fix.vec.FV().NumPy() + self._f_iter.vec.FV().NumPy() - LHS = self._Q.dot( A.dot( self._Q.transpose() ) ) RHS = self._Q.dot( f ) - w, succ = scipy.sparse.linalg.gmres(LHS, RHS , x0=None \ + w, succ = scipy.sparse.linalg.gmres(self._LHS, RHS , x0=None \ , tol=self._solvetol, maxiter=4000, M=None) self._Mag.v.gf.vec.FV().NumPy()[:] = self._Q.transpose().dot(w)