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

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


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

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

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

commit 5f38980f8680218e8147c29bf184921659f2434c
Author: Rajesh Kommu <rajesh.kommu at gmail.com>
Date:   Tue Sep 23 15:47:18 2014 -0700

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


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

5f38980f8680218e8147c29bf184921659f2434c
 lib/BC_util.c                    |  2 +-
 lib/Full_sphere_related.c        |  6 +++---
 lib/Full_version_dependent.c     | 22 +++++++++++-----------
 lib/Instructions.c               |  6 +++---
 lib/Regional_sphere_related.c    | 12 ++++++------
 lib/Regional_version_dependent.c | 12 ++++++------
 lib/Size_does_matter.c           | 28 ++++++++++++++--------------
 lib/Sphere_util.c                | 12 ++++++------
 lib/global_defs.h                |  2 +-
 9 files changed, 51 insertions(+), 51 deletions(-)

diff --git a/lib/BC_util.c b/lib/BC_util.c
index b41ceab..0c24950 100644
--- a/lib/BC_util.c
+++ b/lib/BC_util.c
@@ -209,7 +209,7 @@ void assign_internal_bc(struct All_variables *E)
 	  ontop    = ((k==noz) && (E->parallel.me_loc[3]==E->parallel.nprocz-1))?(1):(0);
 	  onbottom = ((k==1) && (E->parallel.me_loc[3]==0))?(1):(0);
 	  /* node number is k, assuming no dependence on x and y  */
-	  if(E->SX[lv][CPPR][3][k] >= E->mesh.toplayerbc_r){
+	  if(E->SX[lv][3][k] >= E->mesh.toplayerbc_r){
 	    lay = layers(E,k);
 	    if((!ontop)&&(!onbottom)&&(lv==E->mesh.gridmax))
 	      ncount++;		/* not in top or bottom */
diff --git a/lib/Full_sphere_related.c b/lib/Full_sphere_related.c
index 82b8933..377bb42 100644
--- a/lib/Full_sphere_related.c
+++ b/lib/Full_sphere_related.c
@@ -472,9 +472,9 @@ void full_coord_of_cap(struct All_variables *E, int icap)
 	   
 	   for (i=1; i<=lvnoz; i++) {
 	     /*   theta,fi,and r coordinates   */
-	     E->SX[lev][CPPR][1][node] = theta;
-	     E->SX[lev][CPPR][2][node] = fi;
-	     E->SX[lev][CPPR][3][node] = E->sphere.R[lev][i];
+	     E->SX[lev][1][node] = theta;
+	     E->SX[lev][2][node] = fi;
+	     E->SX[lev][3][node] = E->sphere.R[lev][i];
 	     
 	     /*   x,y,and z oordinates   */
 	     E->X[lev][CPPR][1][node]  = E->sphere.R[lev][i]*sint*cosf;
diff --git a/lib/Full_version_dependent.c b/lib/Full_version_dependent.c
index 0771ad1..27d8347 100644
--- a/lib/Full_version_dependent.c
+++ b/lib/Full_version_dependent.c
@@ -64,8 +64,8 @@ static void full_rotate_mesh(struct All_variables *E, double dircos[4][4], int i
             E->X[lev][CPPR][1][i] = t[0];
             E->X[lev][CPPR][2][i] = t[1];
             E->X[lev][CPPR][3][i] = t[2];
-            E->SX[lev][CPPR][1][i] = acos(t[2]/E->SX[lev][CPPR][3][i]);
-            E->SX[lev][CPPR][2][i] = myatan(t[1],t[0]);
+            E->SX[lev][1][i] = acos(t[2]/E->SX[lev][3][i]);
+            E->SX[lev][2][i] = myatan(t[1],t[0]);
         }
     }    /* lev */
 }
@@ -168,7 +168,7 @@ void full_node_locations(E)
           fprintf(E->fp_out,"output_coordinates before rotation %d \n",lev);
               for (i=1;i<=E->lmesh.NNO[lev];i++)
                   if(i%E->lmesh.NOZ[lev]==1)
-                      fprintf(E->fp_out,"%d %d %g %g %g\n",CPPR,i,E->SX[lev][CPPR][1][i],E->SX[lev][CPPR][2][i],E->SX[lev][CPPR][3][i]);
+                      fprintf(E->fp_out,"%d %d %g %g %g\n",CPPR,i,E->SX[lev][1][i],E->SX[lev][2][i],E->SX[lev][3][i]);
       }
       fflush(E->fp_out);
   }
@@ -196,7 +196,7 @@ void full_node_locations(E)
           fprintf(E->fp_out,"output_coordinates after rotation %d \n",lev);
               for (i=1;i<=E->lmesh.NNO[lev];i++)
                   if(i%E->lmesh.NOZ[lev]==1)
-                      fprintf(E->fp_out,"%d %d %g %g %g\n",CPPR,i,E->SX[lev][CPPR][1][i],E->SX[lev][CPPR][2][i],E->SX[lev][CPPR][3][i]);
+                      fprintf(E->fp_out,"%d %d %g %g %g\n",CPPR,i,E->SX[lev][1][i],E->SX[lev][2][i],E->SX[lev][3][i]);
       }
       fflush(E->fp_out);
   }
@@ -206,20 +206,20 @@ void full_node_locations(E)
   /* spherical or elliptical, correct theta to theta_g for local surface-normal theta  */
   for (lev=E->mesh.levmin;lev<=E->mesh.levmax;lev++)
       for (i=1;i<=E->lmesh.NNO[lev];i++)  {
-	tg = theta_g(E->SX[lev][CPPR][1][i],E);
+	tg = theta_g(E->SX[lev][1][i],E);
 	E->SinCos[lev][CPPR][0][i] = sin(tg); /*  */
-	E->SinCos[lev][CPPR][1][i] = sin(E->SX[lev][CPPR][2][i]);
+	E->SinCos[lev][CPPR][1][i] = sin(E->SX[lev][2][i]);
 	E->SinCos[lev][CPPR][2][i] = cos(tg);
-	E->SinCos[lev][CPPR][3][i] = cos(E->SX[lev][CPPR][2][i]);
+	E->SinCos[lev][CPPR][3][i] = cos(E->SX[lev][2][i]);
       }
 #else
   /* spherical */
   for (lev=E->mesh.levmin;lev<=E->mesh.levmax;lev++)
       for (i=1;i<=E->lmesh.NNO[lev];i++)  {
-	E->SinCos[lev][CPPR][0][i] = sin(E->SX[lev][CPPR][1][i]); /* sin(theta) */
-	E->SinCos[lev][CPPR][1][i] = sin(E->SX[lev][CPPR][2][i]); /* sin(phi) */
-	E->SinCos[lev][CPPR][2][i] = cos(E->SX[lev][CPPR][1][i]); /* cos(theta) */
-	E->SinCos[lev][CPPR][3][i] = cos(E->SX[lev][CPPR][2][i]); /* cos(phi) */
+	E->SinCos[lev][CPPR][0][i] = sin(E->SX[lev][1][i]); /* sin(theta) */
+	E->SinCos[lev][CPPR][1][i] = sin(E->SX[lev][2][i]); /* sin(phi) */
+	E->SinCos[lev][CPPR][2][i] = cos(E->SX[lev][1][i]); /* cos(theta) */
+	E->SinCos[lev][CPPR][3][i] = cos(E->SX[lev][2][i]); /* cos(phi) */
       }
 #endif
 }
diff --git a/lib/Instructions.c b/lib/Instructions.c
index 69a016b..3c0be7d 100644
--- a/lib/Instructions.c
+++ b/lib/Instructions.c
@@ -1017,7 +1017,7 @@ void allocate_common_vars(E)
 
     for(d=1;d<=E->mesh.nsd;d++)   {
       E->X[i][CPPR][d]  = (double *)  malloc((nno+1)*sizeof(double));
-      E->SX[i][CPPR][d]  = (double *)  malloc((nno+1)*sizeof(double));
+      E->SX[i][d]  = (double *)  malloc((nno+1)*sizeof(double));
       }
 
     for(d=0;d<=3;d++)
@@ -1039,7 +1039,7 @@ void allocate_common_vars(E)
 
     for(d=1;d<=E->mesh.nsd;d++)
       for(l=1;l<=E->lmesh.NNO[i];l++)  {
-        E->SX[i][CPPR][d][l] = 0.0;
+        E->SX[i][d][l] = 0.0;
         E->X[i][CPPR][d][l] = 0.0;
         }
 
@@ -1365,7 +1365,7 @@ void set_up_nonmg_aliases(struct All_variables *E)
 
   for (i=1;i<=E->mesh.nsd;i++)    {
     E->x[i] = E->X[E->mesh.levmax][CPPR][i];
-    E->sx[i] = E->SX[E->mesh.levmax][CPPR][i];
+    E->sx[i] = E->SX[E->mesh.levmax][i];
     }
 }
 
diff --git a/lib/Regional_sphere_related.c b/lib/Regional_sphere_related.c
index b677a5f..e9bcfbd 100644
--- a/lib/Regional_sphere_related.c
+++ b/lib/Regional_sphere_related.c
@@ -164,9 +164,9 @@ void regional_coord_of_cap(E,icap)
                 node = i + (j-1)*noz + (k-1)*nox*noz;
 
                      /*   theta,fi,and r coordinates   */
-                E->SX[lev][CPPR][1][node] = theta1[lev][nodesx];
-                E->SX[lev][CPPR][2][node] = fi1[lev][nodesy];
-                E->SX[lev][CPPR][3][node] = E->sphere.R[lev][i];
+                E->SX[lev][1][node] = theta1[lev][nodesx];
+                E->SX[lev][2][node] = fi1[lev][nodesy];
+                E->SX[lev][3][node] = E->sphere.R[lev][i];
 
                      /*   x,y,and z oordinates   */
                 E->X[lev][CPPR][1][node] =
@@ -247,9 +247,9 @@ void regional_coord_of_cap(E,icap)
                 node = i + (j-1)*noz + (k-1)*nox*noz;
 
                      /*   theta,fi,and r coordinates   */
-                E->SX[lev][CPPR][1][node] = SX[0][nodes];
-                E->SX[lev][CPPR][2][node] = SX[1][nodes];
-                E->SX[lev][CPPR][3][node] = E->sphere.R[lev][i];
+                E->SX[lev][1][node] = SX[0][nodes];
+                E->SX[lev][2][node] = SX[1][nodes];
+                E->SX[lev][3][node] = E->sphere.R[lev][i];
 
                      /*   x,y,and z oordinates   */
                 E->X[lev][CPPR][1][node] =
diff --git a/lib/Regional_version_dependent.c b/lib/Regional_version_dependent.c
index 85df4a5..1e42ec4 100644
--- a/lib/Regional_version_dependent.c
+++ b/lib/Regional_version_dependent.c
@@ -151,7 +151,7 @@ void regional_node_locations(E)
     fprintf(E->fp_out,"output_coordinates for cap %d %d\n",CPPR,E->lmesh.NNO[lev]);
     for (i=1;i<=E->lmesh.NNO[lev];i++)
       if(i%E->lmesh.NOZ[lev]==1)
-        fprintf(E->fp_out,"%d %d %g %g %g\n",CPPR,i,E->SX[lev][CPPR][1][i],E->SX[lev][CPPR][2][i],E->SX[lev][CPPR][3][i]);
+        fprintf(E->fp_out,"%d %d %g %g %g\n",CPPR,i,E->SX[lev][1][i],E->SX[lev][2][i],E->SX[lev][3][i]);
     }
     fflush(E->fp_out);
   }
@@ -163,10 +163,10 @@ void regional_node_locations(E)
 #endif
   for (lev=E->mesh.levmin;lev<=E->mesh.levmax;lev++)
       for (i=1;i<=E->lmesh.NNO[lev];i++)  {
-        E->SinCos[lev][CPPR][0][i] = sin(E->SX[lev][CPPR][1][i]);
-        E->SinCos[lev][CPPR][1][i] = sin(E->SX[lev][CPPR][2][i]);
-        E->SinCos[lev][CPPR][2][i] = cos(E->SX[lev][CPPR][1][i]);
-        E->SinCos[lev][CPPR][3][i] = cos(E->SX[lev][CPPR][2][i]);
+        E->SinCos[lev][CPPR][0][i] = sin(E->SX[lev][1][i]);
+        E->SinCos[lev][CPPR][1][i] = sin(E->SX[lev][2][i]);
+        E->SinCos[lev][CPPR][2][i] = cos(E->SX[lev][1][i]);
+        E->SinCos[lev][CPPR][3][i] = cos(E->SX[lev][2][i]);
       }
 
   if (E->control.verbose) {
@@ -174,7 +174,7 @@ void regional_node_locations(E)
     fprintf(E->fp_out,"output_coordinates after rotation %d \n",lev);
       for (i=1;i<=E->lmesh.NNO[lev];i++)
         if(i%E->lmesh.NOZ[lev]==1)
-             fprintf(E->fp_out,"%d %d %g %g %g\n",CPPR,i,E->SX[lev][CPPR][1][i],E->SX[lev][CPPR][2][i],E->SX[lev][CPPR][3][i]);
+             fprintf(E->fp_out,"%d %d %g %g %g\n",CPPR,i,E->SX[lev][1][i],E->SX[lev][2][i],E->SX[lev][3][i]);
       }
     fflush(E->fp_out);
   }
diff --git a/lib/Size_does_matter.c b/lib/Size_does_matter.c
index d67474c..016d11b 100644
--- a/lib/Size_does_matter.c
+++ b/lib/Size_does_matter.c
@@ -567,8 +567,8 @@ void construct_c3x3matrix_el (struct All_variables *E,int el,struct CC *cc,
       ux[2][3][1] =-sintt*sinff;  ux[2][3][2] = sintt*cosff;  ux[2][3][3] =0.0;
 
       for(a=1;a<=ends;a++)   {
-          tt = E->SX[lev][CPPR][1][E->IEN[lev][CPPR][el].node[a]];
-          ff = E->SX[lev][CPPR][2][E->IEN[lev][CPPR][el].node[a]];
+          tt = E->SX[lev][1][E->IEN[lev][CPPR][el].node[a]];
+          ff = E->SX[lev][2][E->IEN[lev][CPPR][el].node[a]];
           costt = cos(tt);
           cosff = cos(ff);
           sintt = sin(tt);
@@ -990,22 +990,22 @@ void mass_matrix(struct All_variables *E)
                 E->ECO[lev][CPPR][e].centre[3] = dx3;
 
                 /* delta(theta) of this element */
-                dx1 = max( fabs(E->SX[lev][CPPR][1][n[3]]-E->SX[lev][CPPR][1][n[1]]),
-                           fabs(E->SX[lev][CPPR][1][n[2]]-E->SX[lev][CPPR][1][n[4]]) );
+                dx1 = max( fabs(E->SX[lev][1][n[3]]-E->SX[lev][1][n[1]]),
+                           fabs(E->SX[lev][1][n[2]]-E->SX[lev][1][n[4]]) );
 
                 /* length of this element in the theta-direction */
                 E->ECO[lev][CPPR][e].size[1] = dx1*E->ECO[lev][CPPR][e].centre[3];
 
                 /* delta(phi) of this element */
-                dx1 = fabs(E->SX[lev][CPPR][2][n[3]]-E->SX[lev][CPPR][2][n[1]]);
+                dx1 = fabs(E->SX[lev][2][n[3]]-E->SX[lev][2][n[1]]);
                 if (dx1>M_PI)
-                    dx1 = min(E->SX[lev][CPPR][2][n[3]],E->SX[lev][CPPR][2][n[1]]) + 2.0*M_PI -
-                        max(E->SX[lev][CPPR][2][n[3]],E->SX[lev][CPPR][2][n[1]]) ;
+                    dx1 = min(E->SX[lev][2][n[3]],E->SX[lev][2][n[1]]) + 2.0*M_PI -
+                        max(E->SX[lev][2][n[3]],E->SX[lev][2][n[1]]) ;
 
-                dx2 = fabs(E->SX[lev][CPPR][2][n[2]]-E->SX[lev][CPPR][2][n[4]]);
+                dx2 = fabs(E->SX[lev][2][n[2]]-E->SX[lev][2][n[4]]);
                 if (dx2>M_PI)
-                    dx2 = min(E->SX[lev][CPPR][2][n[2]],E->SX[lev][CPPR][2][n[4]]) + 2.0*M_PI -
-                        max(E->SX[lev][CPPR][2][n[2]],E->SX[lev][CPPR][2][n[4]]) ;
+                    dx2 = min(E->SX[lev][2][n[2]],E->SX[lev][2][n[4]]) + 2.0*M_PI -
+                        max(E->SX[lev][2][n[2]],E->SX[lev][2][n[4]]) ;
 
                 dx2 = max(dx1,dx2);
 
@@ -1014,10 +1014,10 @@ void mass_matrix(struct All_variables *E)
                     *sin(E->ECO[lev][CPPR][e].centre[1]);
 
                 /* delta(radius) of this element */
-                dx3 = 0.25*(fabs(E->SX[lev][CPPR][3][n[5]]+E->SX[lev][CPPR][3][n[6]]
-                                 +E->SX[lev][CPPR][3][n[7]]+E->SX[lev][CPPR][3][n[8]]
-                                 -E->SX[lev][CPPR][3][n[1]]-E->SX[lev][CPPR][3][n[2]]
-                                 -E->SX[lev][CPPR][3][n[3]]-E->SX[lev][CPPR][3][n[4]]));
+                dx3 = 0.25*(fabs(E->SX[lev][3][n[5]]+E->SX[lev][3][n[6]]
+                                 +E->SX[lev][3][n[7]]+E->SX[lev][3][n[8]]
+                                 -E->SX[lev][3][n[1]]-E->SX[lev][3][n[2]]
+                                 -E->SX[lev][3][n[3]]-E->SX[lev][3][n[4]]));
 
                 /* length of this element in the radius-direction */
                 E->ECO[lev][CPPR][e].size[3] = dx3;
diff --git a/lib/Sphere_util.c b/lib/Sphere_util.c
index 13217e4..50d8db1 100644
--- a/lib/Sphere_util.c
+++ b/lib/Sphere_util.c
@@ -97,9 +97,9 @@ void compute_angle_surf_area (E)
                     ia[i] = E->IEN[lev][CPPR][el].node[i];
 
                 for (i=1;i<=4;i++)  {
-                    xx[1][i] = E->X[lev][CPPR][1][ia[i]]/E->SX[lev][CPPR][3][ia[1]];
-                    xx[2][i] = E->X[lev][CPPR][2][ia[i]]/E->SX[lev][CPPR][3][ia[1]];
-                    xx[3][i] = E->X[lev][CPPR][3][ia[i]]/E->SX[lev][CPPR][3][ia[1]];
+                    xx[1][i] = E->X[lev][CPPR][1][ia[i]]/E->SX[lev][3][ia[1]];
+                    xx[2][i] = E->X[lev][CPPR][2][ia[i]]/E->SX[lev][3][ia[1]];
+                    xx[3][i] = E->X[lev][CPPR][3][ia[i]]/E->SX[lev][3][ia[1]];
                 }
 
                 get_angle_sphere_cap(xx,angle);
@@ -183,9 +183,9 @@ double area_of_5points(E,lev,el,x,ne)
     es = (el-1)/E->lmesh.ELZ[lev]+1;
 
     for (i=1;i<=4;i++)                 {
-        xx[1] = E->X[lev][CPPR][1][ia[i]]/E->SX[lev][CPPR][3][ia[1]];
-        xx[2] = E->X[lev][CPPR][2][ia[i]]/E->SX[lev][CPPR][3][ia[1]];
-        xx[3] = E->X[lev][CPPR][3][ia[i]]/E->SX[lev][CPPR][3][ia[1]];
+        xx[1] = E->X[lev][CPPR][1][ia[i]]/E->SX[lev][3][ia[1]];
+        xx[2] = E->X[lev][CPPR][2][ia[i]]/E->SX[lev][3][ia[1]];
+        xx[3] = E->X[lev][CPPR][3][ia[i]]/E->SX[lev][3][ia[1]];
         angle[i] = get_angle(x,xx);  /* get angle bet (i,j) and other four*/
         angle1[i]= E->sphere.angle1[lev][CPPR][i][es];
     }
diff --git a/lib/global_defs.h b/lib/global_defs.h
index 2ac4b80..8a11d70 100644
--- a/lib/global_defs.h
+++ b/lib/global_defs.h
@@ -835,7 +835,7 @@ struct All_variables {
     double *temp,*temp1;
     double *Mass, *MASS[MAX_LEVELS];
     double *TMass, *NMass;
-    double *SX[MAX_LEVELS][NCS][4],*X[MAX_LEVELS][NCS][4];
+    double *SX[MAX_LEVELS][4],*X[MAX_LEVELS][NCS][4];
     double *sx[4],*x[4];
     double *surf_det[NCS][5];
     double *SinCos[MAX_LEVELS][NCS][4];



More information about the CIG-COMMITS mailing list