[cig-commits] [commit] rajesh-petsc-schur: Changed the shape of E->zero_resid as part of caps_per_proc removal (d0e4740)

cig_noreply at geodynamics.org cig_noreply at geodynamics.org
Wed Nov 5 19:11:48 PST 2014


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

On branch  : rajesh-petsc-schur
Link       : https://github.com/geodynamics/citcoms/compare/464e1b32299b15819f93efd98d969cddb84dfe51...f97ae655a50bdbd6dac1923a3471ee4dae178fbd

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

commit d0e47408d27b8e56032ff455d0121eae7b994ef6
Author: Rajesh Kommu <rajesh.kommu at gmail.com>
Date:   Tue Sep 23 14:41:21 2014 -0700

    Changed the shape of E->zero_resid as part of caps_per_proc removal


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

d0e47408d27b8e56032ff455d0121eae7b994ef6
 lib/BC_util.c          | 2 +-
 lib/Construct_arrays.c | 6 +++---
 lib/Instructions.c     | 2 +-
 lib/Petsc_citcoms.c    | 2 +-
 lib/global_defs.h      | 2 +-
 5 files changed, 7 insertions(+), 7 deletions(-)

diff --git a/lib/BC_util.c b/lib/BC_util.c
index 97a2375..ce76327 100644
--- a/lib/BC_util.c
+++ b/lib/BC_util.c
@@ -95,7 +95,7 @@ void strip_bcs_from_residual(E,Res,level)
 
     if (E->num_zero_resid[level])
       for(i=1;i<=E->num_zero_resid[level];i++)
-         Res[E->zero_resid[level][CPPR][i]] = 0.0;
+         Res[E->zero_resid[level][i]] = 0.0;
 
 }
 
diff --git a/lib/Construct_arrays.c b/lib/Construct_arrays.c
index 233b680..005624f 100644
--- a/lib/Construct_arrays.c
+++ b/lib/Construct_arrays.c
@@ -198,15 +198,15 @@ void get_bcs_id_for_residual(E,level)
    for(i=1;i<=nno;i++) {
       if ( (E->NODE[level][CPPR][i] & VBX) != 0 )  {
 	j++;
-        E->zero_resid[level][CPPR][j] = E->ID[level][CPPR][i].doff[1];
+        E->zero_resid[level][j] = E->ID[level][CPPR][i].doff[1];
 	}
       if ( (E->NODE[level][CPPR][i] & VBY) != 0 )  {
 	j++;
-        E->zero_resid[level][CPPR][j] = E->ID[level][CPPR][i].doff[2];
+        E->zero_resid[level][j] = E->ID[level][CPPR][i].doff[2];
 	}
       if ( (E->NODE[level][CPPR][i] & VBZ) != 0 )  {
 	j++;
-        E->zero_resid[level][CPPR][j] = E->ID[level][CPPR][i].doff[3];
+        E->zero_resid[level][j] = E->ID[level][CPPR][i].doff[3];
 	}
       }
 
diff --git a/lib/Instructions.c b/lib/Instructions.c
index 6d36d15..dff2df0 100644
--- a/lib/Instructions.c
+++ b/lib/Instructions.c
@@ -1199,7 +1199,7 @@ void allocate_velocity_vars(E)
       E->BI[l] = (double *) malloc((E->lmesh.NEQ[l])*sizeof(double));
       k = (E->lmesh.NOX[l]*E->lmesh.NOZ[l]+E->lmesh.NOX[l]*E->lmesh.NOY[l]+
           E->lmesh.NOY[l]*E->lmesh.NOZ[l])*6;
-      E->zero_resid[l][CPPR] = (int *) malloc((k+2)*sizeof(int));
+      E->zero_resid[l] = (int *) malloc((k+2)*sizeof(int));
       E->parallel.Skip_id[l][CPPR] = (int *) malloc((k+2)*sizeof(int));
 
       for(i=0;i<E->lmesh.NEQ[l];i++) {
diff --git a/lib/Petsc_citcoms.c b/lib/Petsc_citcoms.c
index 57ef8ba..7c09f25 100644
--- a/lib/Petsc_citcoms.c
+++ b/lib/Petsc_citcoms.c
@@ -125,7 +125,7 @@ void strip_bcs_from_residual_PETSc(
   ierr = VecGetArray(Res, &ResData);
     if( E->num_zero_resid[level] ) {
       for( i = 1; i <= E->num_zero_resid[level]; i++ ) {
-        ResData[E->zero_resid[level][CPPR][i]] = 0.0;
+        ResData[E->zero_resid[level][i]] = 0.0;
       }
     }
   ierr = VecRestoreArray(Res, &ResData);
diff --git a/lib/global_defs.h b/lib/global_defs.h
index 5c0ca13..7b6b519 100644
--- a/lib/global_defs.h
+++ b/lib/global_defs.h
@@ -859,7 +859,7 @@ struct All_variables {
 
 
     int num_zero_resid[MAX_LEVELS];
-    int *zero_resid[MAX_LEVELS][NCS];
+    int *zero_resid[MAX_LEVELS];
     int *surf_element,*surf_node;
     int *mat;
     float *VIP;



More information about the CIG-COMMITS mailing list