Commits

BarryFSmith committed 4ee5817

*** empty log message ***

Comments (0)

Files changed (2)

src/sles/ksp/impls/gmres/gmres.c

-/*$Id: gmres.c,v 1.153 2000/09/02 02:49:12 bsmith Exp bsmith $*/
+/*$Id: gmres.c,v 1.154 2000/09/22 20:45:28 bsmith Exp bsmith $*/
 
 /*
     This file implements GMRES (a Generalized Minimal Residual) method.  
 
   ierr   = VecNorm(VEC_VV(0),NORM_2,&res_norm);CHKERRQ(ierr);
   res    = res_norm;
-  *RS(0) = res_norm;
+  *GRS(0) = res_norm;
 
   /* check for the convergence */
   if (!res) {
     *HES(it+1,it)   = tt;
 
     /* check for the happy breakdown */
-    hapbnd  = PetscAbsScalar(tt / *RS(it));
+    hapbnd  = PetscAbsScalar(tt / *GRS(it));
     if (hapbnd > gmres->haptol) hapbnd = gmres->haptol;
     if (tt > hapbnd) {
       tmp = 1.0/tt; ierr = VecScale(&tmp,VEC_VV(it+1));CHKERRQ(ierr);
     preconditioning from the solution
    */
   /* Form the solution (or the solution so far) */
-  ierr = BuildGmresSoln(RS(0),VEC_SOLN,VEC_SOLN,ksp,it-1);CHKERRQ(ierr);
+  ierr = BuildGmresSoln(GRS(0),VEC_SOLN,VEC_SOLN,ksp,it-1);CHKERRQ(ierr);
 
   PetscFunctionReturn(0);
 }
     }
     PetscFunctionReturn(0);
   }
-  if (*HH(it,it) == 0.0) SETERRQ1(1,1,"HH(it,it) is identically zero; RS(it) = %g",*RS(it));
+  if (*HH(it,it) == 0.0) SETERRQ1(1,1,"HH(it,it) is identically zero; GRS(it) = %g",*GRS(it));
   if (*HH(it,it) != 0.0) {
-    nrs[it] = *RS(it) / *HH(it,it);
+    nrs[it] = *GRS(it) / *HH(it,it);
   } else {
     nrs[it] = 0.0;
   }
   for (ii=1; ii<=it; ii++) {
     k   = it - ii;
-    tt  = *RS(k);
+    tt  = *GRS(k);
     for (j=k+1; j<=it; j++) tt  = tt - *HH(k,j) * nrs[j];
     nrs[k]   = tt / *HH(k,k);
   }
     if (tt == 0.0) {SETERRQ(PETSC_ERR_KSP_BRKDWN,0,"Your matrix or preconditioner is the null operator");}
     *cc       = *hh / tt;
     *ss       = *(hh+1) / tt;
-    *RS(it+1) = - (*ss * *RS(it));
+    *GRS(it+1) = - (*ss * *GRS(it));
 #if defined(PETSC_USE_COMPLEX)
-    *RS(it)   = PetscConj(*cc) * *RS(it);
+    *GRS(it)   = PetscConj(*cc) * *GRS(it);
     *hh       = PetscConj(*cc) * *hh + *ss * *(hh+1);
 #else
-    *RS(it)   = *cc * *RS(it);
+    *GRS(it)   = *cc * *GRS(it);
     *hh       = *cc * *hh + *ss * *(hh+1);
 #endif
-    *res      = PetscAbsScalar(*RS(it+1));
+    *res      = PetscAbsScalar(*GRS(it+1));
   } else {
     /* happy breakdown: HH(it+1, it) = 0, therfore we don't need to apply 
             another rotation matrix (so RH doesn't change).  The new residual is 
-            always the new sine term times the residual from last time (RS(it)), 
+            always the new sine term times the residual from last time (GRS(it)), 
             but now the new sine rotation would be zero...so the residual should
             be zero...so we will multiply "zero" by the last residual.  This might
             not be exactly what we want to do here -could just return "zero". */

src/sles/ksp/impls/gmres/gmresp.h

-/* $Id: gmresp.h,v 1.14 2000/05/05 22:17:37 balay Exp bsmith $ */
+/* $Id: gmresp.h,v 1.15 2000/08/01 20:56:55 bsmith Exp bsmith $ */
 /*
    Private data structure used by the GMRES method.
 */
 #define HES(a,b) (gmres->hes_origin + (b)*(gmres->max_k+1)+(a))
 #define CC(a)    (gmres->cc_origin + (a))
 #define SS(a)    (gmres->ss_origin + (a))
-#define RS(a)    (gmres->rs_origin + (a))
+#define GRS(a)    (gmres->rs_origin + (a))
 
 /* vector names */
 #define VEC_OFFSET     3
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.