@@ -251,6 +251,8 @@ def A(self,i,j):
251251
252252 def assemblymatrix (self ):
253253 self .matrix = np .zeros ((2 * len (self .nodes ),2 * len (self .nodes )),dtype = np .double )
254+
255+
254256 for i in range (0 ,len (self .nodes )):
255257
256258 for j in self .neighbors [i ]:
@@ -281,9 +283,9 @@ def solve(self,maxIt,epsilion):
281283
282284
283285 print (" ##### Load step: " + str (iter + self .iter ) + " #####" )
284- self .residual (iter )
286+ # self.residual(iter)
285287
286- print ("Residual with intial guess" ,np .linalg .norm (self .f ))
288+ # print("Residual with intial guess",np.linalg.norm(self.f))
287289
288290
289291 residual = np .finfo (float ).max
@@ -296,7 +298,7 @@ def solve(self,maxIt,epsilion):
296298 self .assemblymatrix ()
297299
298300
299- b = np .copy (self .f + self . b )
301+ b = np .copy (self .b )
300302
301303 for i in range (0 ,len (self .fix )):
302304
@@ -336,17 +338,18 @@ def solve(self,maxIt,epsilion):
336338 #self.residual(iter)
337339 self .computeLoad (iter )
338340
339- extension = []
340-
341+ extension1 = []
342+ extension2 = []
341343
342344 for i in range (0 ,len (self .nodes )):
343345 if i in self .loadT or i in self .loadB :
344346 #extension.append(abs(iter*self.wCurrent[i])-abs(self.uCurrent[i]))
345- extension .append (self .b [i ])
347+ extension1 .append (iter * self .wCurrent [i ])
348+ extension2 .append (self .uCurrent [i ])
346349
347- # residual = np.linalg.norm(iter * self.wCurrent ) - np.linalg.norm(extension )
350+ residual = np .linalg .norm (extension1 ) - np .linalg .norm (extension2 )
348351 #residual = np.linalg.norm(iter * self.wCurrent-extension)
349- residual = np .linalg .norm (extension )
352+ # residual = np.linalg.norm(extension)
350353 #residual = np.linalg.norm(b)
351354 print ("Iteration " ,it ," Residual: " ,residual )
352355 it += 1
0 commit comments