[cig-commits] [commit] rajesh-petsc-schur: Changed the shapes of E->sbc.node and E->sbc.SB as part of caps_per_proc removal (ff03ffe)

cig_noreply at geodynamics.org cig_noreply at geodynamics.org
Wed Nov 5 19:14:35 PST 2014


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

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

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

commit ff03ffe490375345037629a54b83813ceb07085e
Author: Rajesh Kommu <rajesh.kommu at gmail.com>
Date:   Thu Sep 25 13:43:50 2014 -0700

    Changed the shapes of E->sbc.node and E->sbc.SB as part of caps_per_proc removal


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

ff03ffe490375345037629a54b83813ceb07085e
 lib/Element_calculations.c       |  4 ++--
 lib/Pan_problem_misc_functions.c | 14 +++++++-------
 lib/Topo_gravity.c               | 12 ++++++------
 lib/Viscosity_structures.c       | 22 +++++++++++-----------
 lib/global_defs.h                |  4 ++--
 5 files changed, 28 insertions(+), 28 deletions(-)

diff --git a/lib/Element_calculations.c b/lib/Element_calculations.c
index 0bba248..e23cd9a 100644
--- a/lib/Element_calculations.c
+++ b/lib/Element_calculations.c
@@ -1071,7 +1071,7 @@ static void get_elt_tr(struct All_variables *E, int bel, int side, double elt_tr
 		for(a=1;a<=ends1;a++)  {
 			nodea = E->ien[el].node[ sidenodes[side][a] ];
 			for(d=1;d<=dims;d++) {
-				value = E->sbc.SB[CPPR][side][d][ E->sbc.node[CPPR][nodea] ];
+				value = E->sbc.SB[side][d][ E->sbc.node[nodea] ];
 				flagged = (E->node[nodea] & sbc_flag[d]) && (value);
 				found |= flagged;
 				traction[d][a] = ( flagged ? value : 0.0 );
@@ -1153,7 +1153,7 @@ static void get_elt_tr_pseudo_surf(struct All_variables *E, int bel, int side, d
 		for(a=1;a<=ends1;a++)  {
 			nodea = E->ien[el].node[ sidenodes[side][a] ];
 			for(d=1;d<=dims;d++) {
-				value = E->sbc.SB[CPPR][side][d][ E->sbc.node[CPPR][nodea] ];
+				value = E->sbc.SB[side][d][ E->sbc.node[nodea] ];
 				flagged = (E->node[nodea] & sbc_flag[d]) && (value);
 				found |= flagged;
 				traction[d][a] = ( flagged ? value : 0.0 );
diff --git a/lib/Pan_problem_misc_functions.c b/lib/Pan_problem_misc_functions.c
index e341ae4..ae60a24 100644
--- a/lib/Pan_problem_misc_functions.c
+++ b/lib/Pan_problem_misc_functions.c
@@ -115,33 +115,33 @@ void apply_side_sbc(struct All_variables *E)
     parallel_process_termination();
   }
 
-    E->sbc.node[CPPR] = (int* ) malloc((E->lmesh.nno+1)*sizeof(int));
+    E->sbc.node = (int* ) malloc((E->lmesh.nno+1)*sizeof(int));
 
     n = 1;
     for(i=1; i<=E->lmesh.nno; i++) {
       if(E->node[i] & sbc_flags) {
-	E->sbc.node[CPPR][i] = n;
+	E->sbc.node[i] = n;
 	n++;
       }
       else
-	E->sbc.node[CPPR][i] = 0;
+	E->sbc.node[i] = 0;
 
     }
 
     for(side=SIDE_BEGIN; side<=SIDE_END; side++)
       for(d=1; d<=E->mesh.nsd; d++) {
-	E->sbc.SB[CPPR][side][d] = (double *) malloc(n*sizeof(double));
+	E->sbc.SB[side][d] = (double *) malloc(n*sizeof(double));
 
 	for(i=0; i<n; i++)
-	  E->sbc.SB[CPPR][side][d][i] = 0;
+	  E->sbc.SB[side][d][i] = 0;
       }
 
     for(d=1; d<=E->mesh.nsd; d++)
       for(i=1; i<=E->lmesh.nno; i++)
 	if(E->node[i] & sbc_flag[d] && E->sphere.cap[1].VB[d][i] != 0) {
-	  j = E->sbc.node[CPPR][i];
+	  j = E->sbc.node[i];
 	  for(side=SIDE_BOTTOM; side<=SIDE_TOP; side++)
-	    E->sbc.SB[CPPR][side][d][j] = E->sphere.cap[1].VB[d][i];
+	    E->sbc.SB[side][d][j] = E->sphere.cap[1].VB[d][i];
 	}
 }
 
diff --git a/lib/Topo_gravity.c b/lib/Topo_gravity.c
index f3d32f8..484c999 100644
--- a/lib/Topo_gravity.c
+++ b/lib/Topo_gravity.c
@@ -462,17 +462,17 @@ void stress_conform_bcs(struct All_variables *E)
 
               if(E->node[n] & sbc_flag[d]) {
                 if(i==1)
-                  E->gstress[(n-1)*6+stress_index[d][2]] = E->sbc.SB[CPPR][SIDE_WEST][d][ E->sbc.node[CPPR][n] ];
+                  E->gstress[(n-1)*6+stress_index[d][2]] = E->sbc.SB[SIDE_WEST][d][ E->sbc.node[n] ];
                 if(i==E->lmesh.noy)
-                  E->gstress[(n-1)*6+stress_index[d][2]] = E->sbc.SB[CPPR][SIDE_EAST][d][ E->sbc.node[CPPR][n] ];
+                  E->gstress[(n-1)*6+stress_index[d][2]] = E->sbc.SB[SIDE_EAST][d][ E->sbc.node[n] ];
                 if(j==1)
-                  E->gstress[(n-1)*6+stress_index[d][1]] = E->sbc.SB[CPPR][SIDE_NORTH][d][ E->sbc.node[CPPR][n] ];
+                  E->gstress[(n-1)*6+stress_index[d][1]] = E->sbc.SB[SIDE_NORTH][d][ E->sbc.node[n] ];
                 if(j==E->lmesh.nox)
-                  E->gstress[(n-1)*6+stress_index[d][1]] = E->sbc.SB[CPPR][SIDE_SOUTH][d][ E->sbc.node[CPPR][n] ];
+                  E->gstress[(n-1)*6+stress_index[d][1]] = E->sbc.SB[SIDE_SOUTH][d][ E->sbc.node[n] ];
                 if(k==1)
-                  E->gstress[(n-1)*6+stress_index[d][3]] = E->sbc.SB[CPPR][SIDE_BOTTOM][d][ E->sbc.node[CPPR][n] ];
+                  E->gstress[(n-1)*6+stress_index[d][3]] = E->sbc.SB[SIDE_BOTTOM][d][ E->sbc.node[n] ];
                 if(k==E->lmesh.noz)
-                  E->gstress[(n-1)*6+stress_index[d][3]] = E->sbc.SB[CPPR][SIDE_TOP][d][ E->sbc.node[CPPR][n] ];
+                  E->gstress[(n-1)*6+stress_index[d][3]] = E->sbc.SB[SIDE_TOP][d][ E->sbc.node[n] ];
               }
           }
 
diff --git a/lib/Viscosity_structures.c b/lib/Viscosity_structures.c
index 9a16f15..9de5a76 100644
--- a/lib/Viscosity_structures.c
+++ b/lib/Viscosity_structures.c
@@ -350,7 +350,7 @@ void get_system_viscosity(E,propogate,evisc,visc)
 
     if (E->control.verbose)  {
       fprintf(E->fp_out,"output_evisc \n");
-        fprintf(E->fp_out,"output_evisc for cap %d\n",E->sphere.capid[CPPR]);
+        fprintf(E->fp_out,"output_evisc for cap %d\n",E->sphere.capid[1]);
       for(i=1;i<=E->lmesh.nel;i++)
           fprintf(E->fp_out,"%d %d %f %f\n",i,E->mat[i],evisc[(i-1)*vpts+1],evisc[(i-1)*vpts+7]);
       fflush(E->fp_out);
@@ -1299,7 +1299,7 @@ static void apply_low_visc_wedge_channel(struct All_variables *E, float *evisc)
 static void low_viscosity_channel_factor(struct All_variables *E, float *F)
 {
     int i, ii, k, m, e, ee;
-    int nz_min[NCS], nz_max[NCS];
+    int nz_min, nz_max;
     const int flavor = 0;
     double rad_mean, rr;
 
@@ -1309,7 +1309,7 @@ static void low_viscosity_channel_factor(struct All_variables *E, float *F)
                               E->sx[3][E->ien[e].node[8]]);
             if(rad_mean >= E->viscosity.lv_min_radius) break;
         }
-        nz_min[CPPR] = e;
+        nz_min = e;
 
         /* find index of radius corresponding to lv_max_radius */
         for(e=E->lmesh.elz; e>=1; e--) {
@@ -1317,19 +1317,19 @@ static void low_viscosity_channel_factor(struct All_variables *E, float *F)
                               E->sx[3][E->ien[e].node[8]]);
             if(rad_mean <= E->viscosity.lv_max_radius) break;
         }
-        nz_max[CPPR] = e;
+        nz_max = e;
 
 
 
         for(k=1; k<=E->lmesh.elx*E->lmesh.ely; k++) {
-            for(i=nz_min[CPPR]; i<=nz_max[CPPR]; i++) {
+            for(i=nz_min; i<=nz_max; i++) {
                 e = (k-1)*E->lmesh.elz + i;
 
                 rad_mean = 0.5 * (E->sx[3][E->ien[e].node[1]] +
                                   E->sx[3][E->ien[e].node[8]]);
 
                 /* loop over elements below e */
-                for(ii=i; ii>=nz_min[CPPR]; ii--) {
+                for(ii=i; ii>=nz_min; ii--) {
                     ee = (k-1)*E->lmesh.elz + ii;
 
                     rr = 0.5 * (E->sx[3][E->ien[ee].node[1]] +
@@ -1350,7 +1350,7 @@ static void low_viscosity_channel_factor(struct All_variables *E, float *F)
 static void low_viscosity_wedge_factor(struct All_variables *E, float *F)
 {
     int i, ii, k, m, e, ee;
-    int nz_min[NCS], nz_max[NCS];
+    int nz_min, nz_max;
     const int flavor = 0;
     double rad_mean, rr;
 
@@ -1360,7 +1360,7 @@ static void low_viscosity_wedge_factor(struct All_variables *E, float *F)
                               E->sx[3][E->ien[e].node[8]]);
             if(rad_mean >= E->viscosity.lv_min_radius) break;
         }
-        nz_min[CPPR] = e;
+        nz_min = e;
 
         /* find index of radius corresponding to lv_max_radius */
         for(e=E->lmesh.elz; e>=1; e--) {
@@ -1368,19 +1368,19 @@ static void low_viscosity_wedge_factor(struct All_variables *E, float *F)
                               E->sx[3][E->ien[e].node[8]]);
             if(rad_mean <= E->viscosity.lv_max_radius) break;
         }
-        nz_max[CPPR] = e;
+        nz_max = e;
 
 
 
         for(k=1; k<=E->lmesh.elx*E->lmesh.ely; k++) {
-            for(i=nz_min[CPPR]; i<=nz_max[CPPR]; i++) {
+            for(i=nz_min; i<=nz_max; i++) {
                 e = (k-1)*E->lmesh.elz + i;
 
                 rad_mean = 0.5 * (E->sx[3][E->ien[e].node[1]] +
                                   E->sx[3][E->ien[e].node[8]]);
 
                 /* loop over elements below e */
-                for(ii=i; ii>=nz_min[CPPR]; ii--) {
+                for(ii=i; ii>=nz_min; ii--) {
                     ee = (k-1)*E->lmesh.elz + ii;
 
                     /* if ee has tracers in it */
diff --git a/lib/global_defs.h b/lib/global_defs.h
index 992814d..77c98fd 100644
--- a/lib/global_defs.h
+++ b/lib/global_defs.h
@@ -134,8 +134,8 @@ struct Bdry {
 
 struct SBC {
   /* stress (traction) boundary conditions */
-  int *node[NCS];
-  double *SB[NCS][7][4];
+  int *node;
+  double *SB[7][4];
 };
 
 



More information about the CIG-COMMITS mailing list