[cig-commits] [commit] rajesh-petsc-schur: cleaned up global_div_norm2; all results match master branch (e7c69cc)

cig_noreply at geodynamics.org cig_noreply at geodynamics.org
Wed Sep 10 13:06:21 PDT 2014


Repository : https://github.com/geodynamics/citcoms

On branch  : rajesh-petsc-schur
Link       : https://github.com/geodynamics/citcoms/compare/7217daed18fa112656d9a8d5d7d860292f08a6de...e7c69cc098d5529fe6555bd5a981517fa631e8d0

>---------------------------------------------------------------

commit e7c69cc098d5529fe6555bd5a981517fa631e8d0
Author: Rajesh Kommu <rajesh.kommu at gmail.com>
Date:   Wed Sep 10 13:06:14 2014 -0700

    cleaned up global_div_norm2; all results match master branch


>---------------------------------------------------------------

e7c69cc098d5529fe6555bd5a981517fa631e8d0
 lib/Global_operations.c  |  4 ++--
 lib/Stokes_flow_Incomp.c | 23 +++++++++++------------
 2 files changed, 13 insertions(+), 14 deletions(-)

diff --git a/lib/Global_operations.c b/lib/Global_operations.c
index 207aaca..e1649ae 100644
--- a/lib/Global_operations.c
+++ b/lib/Global_operations.c
@@ -643,9 +643,9 @@ double global_div_norm2(struct All_variables *E,  double **A)
     temp = 0.0;
     prod = 0.0;
     for (m=1; m<=E->sphere.caps_per_proc; m++)
-        for (i=1; i<=E->lmesh.npno; i++) {
+        for (i=0; i<E->lmesh.npno; i++) {
             /* L2 norm of div(u) */
-            temp += A[m][i] * A[m][i] / E->eco[m][i].area;
+            temp += A[m][i] * A[m][i] / E->eco[m][i+1].area;
 
             /* L1 norm */
             /*temp += fabs(A[m][i]);*/
diff --git a/lib/Stokes_flow_Incomp.c b/lib/Stokes_flow_Incomp.c
index b119458..7d25128 100644
--- a/lib/Stokes_flow_Incomp.c
+++ b/lib/Stokes_flow_Incomp.c
@@ -1152,16 +1152,16 @@ static void solve_Ahat_p_fhat_BiCG(struct All_variables *E,
 
     for (m=1; m<=E->sphere.caps_per_proc; m++)   {
         F[m] = (double *)malloc(neq*sizeof(double));
-        r1[m] = (double *)malloc((npno)*sizeof(double));
-        r2[m] = (double *)malloc((npno)*sizeof(double));
-        pt[m] = (double *)malloc((npno)*sizeof(double));
-        p1[m] = (double *)malloc((npno)*sizeof(double));
-        p2[m] = (double *)malloc((npno)*sizeof(double));
-        rt[m] = (double *)malloc((npno)*sizeof(double));
-        v0[m] = (double *)malloc((npno)*sizeof(double));
-        s0[m] = (double *)malloc((npno)*sizeof(double));
-        st[m] = (double *)malloc((npno)*sizeof(double));
-        t0[m] = (double *)malloc((npno)*sizeof(double));
+        r1[m] = (double *)malloc(npno*sizeof(double));
+        r2[m] = (double *)malloc(npno*sizeof(double));
+        pt[m] = (double *)malloc(npno*sizeof(double));
+        p1[m] = (double *)malloc(npno*sizeof(double));
+        p2[m] = (double *)malloc(npno*sizeof(double));
+        rt[m] = (double *)malloc(npno*sizeof(double));
+        v0[m] = (double *)malloc(npno*sizeof(double));
+        s0[m] = (double *)malloc(npno*sizeof(double));
+        st[m] = (double *)malloc(npno*sizeof(double));
+        t0[m] = (double *)malloc(npno*sizeof(double));
 
         u0[m] = (double *)malloc(neq*sizeof(double));
     }
@@ -1235,8 +1235,7 @@ static void solve_Ahat_p_fhat_BiCG(struct All_variables *E,
             beta = (r1dotrt / r0dotrt) * (alpha / omega);
             for(m=1; m<=E->sphere.caps_per_proc; m++)
                 for(j=0; j<npno; j++)
-                    p2[m][j] = r1[m][j] + beta
-                        * (p1[m][j] - omega * v0[m][j]);
+                    p2[m][j] = r1[m][j] + beta*(p1[m][j] - omega*v0[m][j]);
         }
 
 



More information about the CIG-COMMITS mailing list