/[escript]/trunk/paso/src/MINRES.c
ViewVC logotype

Diff of /trunk/paso/src/MINRES.c

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

revision 1797 by jfenwick, Wed Sep 17 03:39:34 2008 UTC revision 1860 by artak, Wed Oct 8 04:07:10 2008 UTC
# Line 1  Line 1 
1    
2  /*******************************************************  /*******************************************************
3   *  *
4   *           Copyright 2003-2007 by ACceSS MNRF  * Copyright (c) 2003-2008 by University of Queensland
5   *       Copyright 2007 by University of Queensland  * Earth Systems Science Computational Center (ESSCC)
6   *  * http://www.uq.edu.au/esscc
7   *                http://esscc.uq.edu.au  *
8   *        Primary Business: Queensland, Australia  * Primary Business: Queensland, Australia
9   *  Licensed under the Open Software License version 3.0  * Licensed under the Open Software License version 3.0
10   *     http://www.opensource.org/licenses/osl-3.0.php  * http://www.opensource.org/licenses/osl-3.0.php
11   *  *
12   *******************************************************/  *******************************************************/
13    
14    
15  /* TFQMR iterations */  /* TFQMR iterations */
16    
# Line 170  err_t Paso_Solver_MINRES( Line 171  err_t Paso_Solver_MINRES(
171       }       }
172    
173       alfa = Paso_InnerProduct(n,v,y,A->mpi_info);       alfa = Paso_InnerProduct(n,v,y,A->mpi_info);
174       Paso_Update(n, 1., y, -(alfa/beta), r2);       Paso_Update(n, 1., y, (-alfa/beta), r2);
175       Paso_Copy(n,r1,r2);       Paso_Copy(n,r1,r2);
176       Paso_Copy(n,r2,y);       Paso_Copy(n,r2,y);
177    
# Line 236  err_t Paso_Solver_MINRES( Line 237  err_t Paso_Solver_MINRES(
237       rnorm  = phibar;       rnorm  = phibar;
238    
239       maxIterFlag = (num_iter > maxit);       maxIterFlag = (num_iter > maxit);
240       norm_of_residual=rnorm;       norm_of_residual=rnorm/Anorm*ynorm;
241       convergeFlag=(norm_of_residual<Anorm*ynorm*(*tolerance));       convergeFlag=(norm_of_residual<(*tolerance));
242            
243            
244       if (maxIterFlag) {       if (maxIterFlag) {
# Line 246  err_t Paso_Solver_MINRES( Line 247  err_t Paso_Solver_MINRES(
247           status = SOLVER_BREAKDOWN;           status = SOLVER_BREAKDOWN;
248       }       }
249      ++(num_iter);      ++(num_iter);
     /*printf("residual norm %.10f < %.10f %.10f %.10f \n",rnorm,Anorm*ynorm*(*tolerance), Anorm*ynorm, (*tolerance));*/  
250    }    }
251      /* end of iteration */      /* end of iteration */
252            

Legend:
Removed from v.1797  
changed lines
  Added in v.1860

  ViewVC Help
Powered by ViewVC 1.1.26