/[escript]/branches/symbolic_from_3470/escript/py_src/nonlinearPDE.py
ViewVC logotype

Diff of /branches/symbolic_from_3470/escript/py_src/nonlinearPDE.py

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 3876 by caltinay, Fri Mar 16 00:48:46 2012 UTC revision 3877 by gross, Mon Mar 19 00:52:00 2012 UTC
# Line 177  class NonlinearPDE(object): Line 177  class NonlinearPDE(object):
177          self._rtol=1e-6          self._rtol=1e-6
178          self._atol=0.          self._atol=0.
179          self._iteration_steps_max=100          self._iteration_steps_max=100
180          self._omega_min=0.01          self._omega_min=0.0001
181          self._quadratic_convergence_limit=0.2          self._quadratic_convergence_limit=0.2
182          self._simplified_newton_limit=0.1          self._simplified_newton_limit=0.1
183    
# Line 354  class NonlinearPDE(object): Line 354  class NonlinearPDE(object):
354              if n == 0:              if n == 0:
355                  self._updateLinearPDE(expressions, subs)                  self._updateLinearPDE(expressions, subs)
356                  defect_norm=self._getDefectNorm(self._lpde.getRightHandSide())                  defect_norm=self._getDefectNorm(self._lpde.getRightHandSide())
                 print defect_norm  
357                  LINTOL=0.1                  LINTOL=0.1
358              else:              else:
359                  if not use_simplified_Newton:                  if not use_simplified_Newton:
# Line 372  class NonlinearPDE(object): Line 371  class NonlinearPDE(object):
371              #check for reduced defect:              #check for reduced defect:
372              omega=min(2*omega, 1.) # raise omega              omega=min(2*omega, 1.) # raise omega
373              defect_reduced=False              defect_reduced=False
374                ui_old=ui
375                print defect_norm
376              while not defect_reduced:              while not defect_reduced:
377                  ui=ui-delta_u * omega                  ui=ui_old-delta_u * omega
378                  if simple_u:                  if simple_u:
379                      subs[u_syms[0]]=ui                      subs[u_syms[0]]=ui
380                  else:                  else:
# Line 384  class NonlinearPDE(object): Line 385  class NonlinearPDE(object):
385                  defect_reduced=False                  defect_reduced=False
386                  for i in xrange(len( new_defect_norm)):                  for i in xrange(len( new_defect_norm)):
387               if new_defect_norm[i] < defect_norm[i]: defect_reduced=True               if new_defect_norm[i] < defect_norm[i]: defect_reduced=True
388                    print new_defect_norm
389                            
390                  #print new_defect_norm                  #print new_defect_norm
391                  #q_defect=max(self._getSafeRatio(new_defect_norm, defect_norm))                  #q_defect=max(self._getSafeRatio(new_defect_norm, defect_norm))
# Line 651  class NonlinearPDE(object): Line 653  class NonlinearPDE(object):
653                      raise IllegalCoefficientValue("%s must have rank %d"%(name,u.getRank()+1))                      raise IllegalCoefficientValue("%s must have rank %d"%(name,u.getRank()+1))
654                  T0=time()                  T0=time()
655                  B,A=getTotalDifferential(val, u, 1)                  B,A=getTotalDifferential(val, u, 1)
656                    print A
657                  if name=='X_reduced':                  if name=='X_reduced':
658                      self.trace3("Computing A_reduced, B_reduced took %f seconds."%(time()-T0))                      self.trace3("Computing A_reduced, B_reduced took %f seconds."%(time()-T0))
659                      self._set_coeffs['A_reduced']=A                      self._set_coeffs['A_reduced']=A
# Line 1265  class VariationalProblem(object): Line 1268  class VariationalProblem(object):
1268    
1269          Z=0          Z=0
1270          if self._set_coeffs.has_key(H_key): Z+=self._set_coeffs[H_key]          if self._set_coeffs.has_key(H_key): Z+=self._set_coeffs[H_key]
         print self._set_coeffs[X_key]  
         print util.grad(self._lagrangean)  
1271          if self._set_coeffs.has_key(X_key): Z+=util.inner(self._set_coeffs[X_key], util.grad(self._lagrangean))          if self._set_coeffs.has_key(X_key): Z+=util.inner(self._set_coeffs[X_key], util.grad(self._lagrangean))
1272          if self._set_coeffs.has_key(Y_key): Z+=util.inner(self._set_coeffs[Y_key], self._lagrangean)          if self._set_coeffs.has_key(Y_key): Z+=util.inner(self._set_coeffs[Y_key], self._lagrangean)
1273    

Legend:
Removed from v.3876  
changed lines
  Added in v.3877

  ViewVC Help
Powered by ViewVC 1.1.26