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

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

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

revision 1708 by ksteube, Thu Aug 14 22:42:24 2008 UTC revision 1811 by ksteube, Thu Sep 25 23:11:13 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 83  err_t Paso_Solver_TFQMR( Line 84  err_t Paso_Solver_TFQMR(
84    bool_t breakFlag=FALSE, maxIterFlag=FALSE, convergeFlag=FALSE;    bool_t breakFlag=FALSE, maxIterFlag=FALSE, convergeFlag=FALSE;
85    err_t status = SOLVER_NO_ERROR;    err_t status = SOLVER_NO_ERROR;
86    dim_t n = Paso_SystemMatrix_getTotalNumRows(A);    dim_t n = Paso_SystemMatrix_getTotalNumRows(A);
87    double  *u1=NULL, *u2=NULL, *y1=NULL, *y2=NULL, *d=NULL, *w=NULL, *v=NULL, *v_old=NULL, *tmp=NULL ;    double  *u1=NULL, *u2=NULL, *y1=NULL, *y2=NULL, *d=NULL, *w=NULL, *v=NULL, *v_old=NULL;
88    
89    double eta,theta,tau,rho,beta,alpha,sigma,rhon,c;    double eta,theta,tau,rho,beta,alpha,sigma,rhon,c;
90    
# Line 105  err_t Paso_Solver_TFQMR( Line 106  err_t Paso_Solver_TFQMR(
106    v=TMPMEMALLOC(n,double);    v=TMPMEMALLOC(n,double);
107    v_old=TMPMEMALLOC(n,double);    v_old=TMPMEMALLOC(n,double);
108        
     
   tmp=TMPMEMALLOC(n,double);  
     
109    
110   if (u1 ==NULL || u2== NULL || y1 == NULL || y2== NULL || d==NULL || w==NULL || v==NULL || v_old==NULL) {   if (u1 ==NULL || u2== NULL || y1 == NULL || y2== NULL || d==NULL || w==NULL || v==NULL || v_old==NULL) {
111       status=SOLVER_MEMORY_ERROR;       status=SOLVER_MEMORY_ERROR;
# Line 211  err_t Paso_Solver_TFQMR( Line 209  err_t Paso_Solver_TFQMR(
209       Paso_LinearCombination(n,y1,1.,w,beta,y2);       Paso_LinearCombination(n,y1,1.,w,beta,y2);
210    
211       Performance_stopMonitor(pp,PERFORMANCE_SOLVER);       Performance_stopMonitor(pp,PERFORMANCE_SOLVER);
212        
213       Performance_startMonitor(pp,PERFORMANCE_MVM);       Performance_startMonitor(pp,PERFORMANCE_MVM);
214       Paso_SystemMatrix_MatrixVector_CSR_OFFSET0(ONE, A, y1,ZERO,u1);       Paso_SystemMatrix_MatrixVector_CSR_OFFSET0(ONE, A, y1,ZERO,u1);
215       Performance_stopMonitor(pp,PERFORMANCE_MVM);       Performance_stopMonitor(pp,PERFORMANCE_MVM);
      Performance_startMonitor(pp,PERFORMANCE_SOLVER);  
216            
      Performance_stopMonitor(pp,PERFORMANCE_SOLVER);  
217       Performance_startMonitor(pp,PERFORMANCE_PRECONDITIONER);       Performance_startMonitor(pp,PERFORMANCE_PRECONDITIONER);
218       Paso_Solver_solvePreconditioner(A,u1,u1);       Paso_Solver_solvePreconditioner(A,u1,u1);
219       Performance_stopMonitor(pp,PERFORMANCE_PRECONDITIONER);       Performance_stopMonitor(pp,PERFORMANCE_PRECONDITIONER);
220        
221       Performance_startMonitor(pp,PERFORMANCE_SOLVER);       Performance_startMonitor(pp,PERFORMANCE_SOLVER);
222            
223       Paso_Copy(n,v_old,v);       Paso_Copy(n,v_old,v);

Legend:
Removed from v.1708  
changed lines
  Added in v.1811

  ViewVC Help
Powered by ViewVC 1.1.26