[cig-commits] [commit] rajesh-petsc-schur: Changed the shape of the eco member of the All_variables struct as part of caps_per_proc removal (ab583a6)

cig_noreply at geodynamics.org cig_noreply at geodynamics.org
Wed Nov 5 19:10:23 PST 2014


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

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

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

commit ab583a6bc7296ec20f5606d2863dc0d42c8c9a5c
Author: Rajesh Kommu <rajesh.kommu at gmail.com>
Date:   Thu Sep 18 13:58:13 2014 -0700

    Changed the shape of the eco member of the All_variables struct as part of caps_per_proc removal


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

ab583a6bc7296ec20f5606d2863dc0d42c8c9a5c
 lib/Advection_diffusion.c | 12 ++++++------
 lib/Composition_related.c |  2 +-
 lib/Global_operations.c   | 22 +++++++++++-----------
 lib/Instructions.c        |  2 +-
 lib/Petsc_citcoms.c       |  4 ++--
 lib/Process_buoyancy.c    | 10 +++++-----
 lib/Size_does_matter.c    | 14 +++++++-------
 lib/Topo_gravity.c        | 16 ++++++++--------
 lib/global_defs.h         |  2 +-
 9 files changed, 42 insertions(+), 42 deletions(-)

diff --git a/lib/Advection_diffusion.c b/lib/Advection_diffusion.c
index 5cc2e1b..c2e3ea6 100644
--- a/lib/Advection_diffusion.c
+++ b/lib/Advection_diffusion.c
@@ -165,7 +165,7 @@ void std_timestep(struct All_variables *E)
         uc2 += E->N.ppt[GNPINDEX(i,1)]*VV[2][i];
         uc3 += E->N.ppt[GNPINDEX(i,1)]*VV[3][i];
       }
-      uc = fabs(uc1)/E->eco[CPPR][el].size[1] + fabs(uc2)/E->eco[CPPR][el].size[2] + fabs(uc3)/E->eco[CPPR][el].size[3];
+      uc = fabs(uc1)/E->eco[el].size[1] + fabs(uc2)/E->eco[el].size[2] + fabs(uc3)/E->eco[el].size[3];
 
       step = (0.5/uc);
       adv_timestep = min(adv_timestep,step);
@@ -298,7 +298,7 @@ static void set_diffusion_timestep(struct All_variables *E)
   diff_timestep = 1.0e8;
     for(el=1;el<=E->lmesh.nel;el++)  {
       for(d=1;d<=E->mesh.nsd;d++)    {
-	ts = E->eco[CPPR][el].size[d] * E->eco[CPPR][el].size[d];
+	ts = E->eco[el].size[d] * E->eco[el].size[d];
 	diff_timestep = min(diff_timestep,ts);
       }
     }
@@ -437,9 +437,9 @@ static void pg_shape_fn(struct All_variables *E, int el,
       uc3 +=  E->N.ppt[GNPINDEX(i,1)]*VV[3][i];
       }
 
-    uxse = fabs(uc1*E->eco[CPPR][el].size[1]);
-    ueta = fabs(uc2*E->eco[CPPR][el].size[2]);
-    ufai = fabs(uc3*E->eco[CPPR][el].size[3]);
+    uxse = fabs(uc1*E->eco[el].size[1]);
+    ueta = fabs(uc2*E->eco[el].size[2]);
+    ufai = fabs(uc3*E->eco[el].size[3]);
 
     xse = (uxse>twodiff)? (1.0-twodiff/uxse):0.0;
     eta = (ueta>twodiff)? (1.0-twodiff/ueta):0.0;
@@ -862,7 +862,7 @@ static double total_heating(struct All_variables *E, double **heating)
     /* sum up within each processor */
     sum = 0;
     for(e=1; e<=E->lmesh.nel; e++)
-        sum += heating[CPPR][e] * E->eco[CPPR][e].area;
+        sum += heating[CPPR][e] * E->eco[e].area;
 
     /* sum up for all processors */
     MPI_Allreduce(&sum, &total, 1, MPI_DOUBLE, MPI_SUM, E->parallel.world);
diff --git a/lib/Composition_related.c b/lib/Composition_related.c
index 28a671b..eb65981 100644
--- a/lib/Composition_related.c
+++ b/lib/Composition_related.c
@@ -385,7 +385,7 @@ static void compute_elemental_composition_absolute_method(struct All_variables *
             for(i=0;i<E->composition.ncomp;i++) {
                 flavor = i;
                 comp =
-                    E->trace.ntracer_flavor[CPPR][flavor][e] / E->eco[j][e].area
+                    E->trace.ntracer_flavor[CPPR][flavor][e] / E->eco[e].area
                     * domain_volume / E->trace.number_of_tracers;
 
                 /* truncate composition at 1.0 */
diff --git a/lib/Global_operations.c b/lib/Global_operations.c
index 35b35a5..43ca355 100644
--- a/lib/Global_operations.c
+++ b/lib/Global_operations.c
@@ -599,8 +599,8 @@ double global_p_norm2(struct All_variables *E,  double **P)
     prod = 0.0;
     for (i=0; i<E->lmesh.npno; i++) {
         /* L2 norm */ 
-        /* should be E->eco[CPPR][i].area after E->eco hase been made 0-based */
-        temp += P[CPPR][i] * P[CPPR][i] * E->eco[CPPR][i+1].area;
+        /* should be E->eco[i].area after E->eco hase been made 0-based */
+        temp += P[CPPR][i] * P[CPPR][i] * E->eco[i+1].area;
     }
 
     MPI_Allreduce(&temp, &prod, 1, MPI_DOUBLE, MPI_SUM, E->parallel.world);
@@ -619,8 +619,8 @@ double global_div_norm2(struct All_variables *E,  double **A)
     prod = 0.0;
     for (i=0; i<E->lmesh.npno; i++) {
         /* L2 norm of div(u) */
-        /* should be E->eco[CPPR][i].area after E->eco hase been made 0-based */
-        temp += A[CPPR][i] * A[CPPR][i] / E->eco[CPPR][i+1].area;
+        /* should be E->eco[i].area after E->eco hase been made 0-based */
+        temp += A[CPPR][i] * A[CPPR][i] / E->eco[i+1].area;
 
         /* L1 norm */
         /*temp += fabs(A[m][i]);*/
@@ -894,12 +894,12 @@ void remove_rigid_rot(struct All_variables *E)
     
       for (e=1;e<=E->lmesh.nel;e++) {
 #ifdef ALLOW_ELLIPTICAL
-	t = theta_g(E->eco[CPPR][e].centre[1],E);
+	t = theta_g(E->eco[e].centre[1],E);
 #else
-	t = E->eco[CPPR][e].centre[1];
+	t = E->eco[e].centre[1];
 #endif
-	f = E->eco[CPPR][e].centre[2];
-	r = E->eco[CPPR][e].centre[3];
+	f = E->eco[e].centre[2];
+	r = E->eco[e].centre[3];
 	
 	cos_t = cos(t);sin_t = sin(t);
 	sin_f = sin(f);cos_f = cos(f);
@@ -925,9 +925,9 @@ void remove_rigid_rot(struct All_variables *E)
         } else {
             rho = 1;
         }
-	exyz[1] += (wx*cos_t*cos_f - wy*sin_f) * E->eco[CPPR][e].area * rho;
-	exyz[2] += (wx*cos_t*sin_f + wy*cos_f) * E->eco[CPPR][e].area * rho;
-	exyz[3] -= (wx*sin_t                 ) * E->eco[CPPR][e].area * rho;
+	exyz[1] += (wx*cos_t*cos_f - wy*sin_f) * E->eco[e].area * rho;
+	exyz[2] += (wx*cos_t*sin_f + wy*cos_f) * E->eco[e].area * rho;
+	exyz[3] -= (wx*sin_t                 ) * E->eco[e].area * rho;
       }
     
     MPI_Allreduce(exyz,fxyz,4,MPI_DOUBLE,MPI_SUM,E->parallel.world);
diff --git a/lib/Instructions.c b/lib/Instructions.c
index 107fc1f..1b8cb09 100644
--- a/lib/Instructions.c
+++ b/lib/Instructions.c
@@ -1351,7 +1351,7 @@ void set_up_nonmg_aliases(struct All_variables *E)
 
   int i;
 
-  E->eco[CPPR] = E->ECO[E->mesh.levmax][CPPR];
+  E->eco = E->ECO[E->mesh.levmax][CPPR];
   E->ien = E->IEN[E->mesh.levmax][CPPR];
   E->id[CPPR] = E->ID[E->mesh.levmax][CPPR];
   E->Vi[CPPR] = E->VI[E->mesh.levmax][CPPR];
diff --git a/lib/Petsc_citcoms.c b/lib/Petsc_citcoms.c
index 1d2f14f..00fb850 100644
--- a/lib/Petsc_citcoms.c
+++ b/lib/Petsc_citcoms.c
@@ -42,7 +42,7 @@ double global_p_norm2_PETSc( struct All_variables *E,  Vec p )
 
     for (i=0; i<E->lmesh.npno; i++) {
         /* L2 norm */
-        temp += P[i] * P[i] * E->eco[CPPR][i+1].area;
+        temp += P[i] * P[i] * E->eco[i+1].area;
     }
     ierr = VecRestoreArray( p, &P ); CHKERRQ( ierr );
 
@@ -64,7 +64,7 @@ double global_div_norm2_PETSc( struct All_variables *E,  Vec a )
 
     for (i=0; i<E->lmesh.npno; i++) {
         /* L2 norm of div(u) */
-        temp += A[i] * A[i] / E->eco[CPPR][i+1].area;
+        temp += A[i] * A[i] / E->eco[i+1].area;
 
         /* L1 norm */
         /*temp += fabs(A[i]);*/
diff --git a/lib/Process_buoyancy.c b/lib/Process_buoyancy.c
index b76421e..fe673fa 100644
--- a/lib/Process_buoyancy.c
+++ b/lib/Process_buoyancy.c
@@ -105,7 +105,7 @@ void heat_flux(E)
         uT += rho[i]*u[i]*T[i]*E->gDA[CPPR][e].vpt[i] + dTdz[i]*E->gDA[CPPR][e].vpt[i];
         }
 
-      uT /= E->eco[CPPR][e].area;
+      uT /= E->eco[e].area;
 
       for(j=1;j<=ends;j++)
         flux[CPPR][E->ien[e].node[j]] += uT*E->TWW[lev][CPPR][e].node[j];
@@ -133,16 +133,16 @@ void heat_flux(E)
               E->slice.shflux[CPPR][E->sien[e].node[3]] +
               E->slice.shflux[CPPR][E->sien[e].node[4]])*0.25;
          el = e*E->lmesh.elz;
-         sum_h[0] += uT*E->eco[CPPR][el].area;
-         sum_h[1] += E->eco[CPPR][el].area;
+         sum_h[0] += uT*E->eco[el].area;
+         sum_h[1] += E->eco[el].area;
 
          uT =(E->slice.bhflux[CPPR][E->sien[e].node[1]] +
               E->slice.bhflux[CPPR][E->sien[e].node[2]] +
               E->slice.bhflux[CPPR][E->sien[e].node[3]] +
               E->slice.bhflux[CPPR][E->sien[e].node[4]])*0.25;
          el = (e-1)*E->lmesh.elz+1;
-         sum_h[2] += uT*E->eco[CPPR][el].area;
-         sum_h[3] += E->eco[CPPR][el].area;
+         sum_h[2] += uT*E->eco[el].area;
+         sum_h[3] += E->eco[el].area;
          }
 
   sum_across_surface(E,sum_h,4);
diff --git a/lib/Size_does_matter.c b/lib/Size_does_matter.c
index 2a1553e..e14c487 100644
--- a/lib/Size_does_matter.c
+++ b/lib/Size_does_matter.c
@@ -248,12 +248,12 @@ void get_side_x_cart(struct All_variables *E, double xx[4][5], int el, int side)
   const int oned = onedvpoints[E->mesh.nsd];
 
 #ifdef ALLOW_ELLIPTICAL
-  to = theta_g(E->eco[CPPR][el].centre[1],E);
+  to = theta_g(E->eco[el].centre[1],E);
 #else
-  to = E->eco[CPPR][el].centre[1];	
+  to = E->eco[el].centre[1];	
 #endif
 
-  fo = E->eco[CPPR][el].centre[2];
+  fo = E->eco[el].centre[2];
 
   dxdy[1][1] = cos(to)*cos(fo);
   dxdy[1][2] = cos(to)*sin(fo);
@@ -429,11 +429,11 @@ void get_global_1d_shape_fn_L(E,el,GM,dGammax,top)
     double to,fo,xx[4][5],dxdy[4][4],dxda[4][4],cof[4][4];
 
 #ifdef ALLOW_ELLIPTICAL
-    to = theta_g(E->eco[CPPR][el].centre[1],E);
+    to = theta_g(E->eco[el].centre[1],E);
 #else
-    to = E->eco[CPPR][el].centre[1]; 
+    to = E->eco[el].centre[1]; 
 #endif
-    fo = E->eco[CPPR][el].centre[2];
+    fo = E->eco[el].centre[2];
 
     dxdy[1][1] = cos(to)*cos(fo);
     dxdy[1][2] = cos(to)*sin(fo);
@@ -1089,7 +1089,7 @@ void mass_matrix(struct All_variables *E)
     E->mesh.volume = 0;
 
     for(e=1;e<=E->lmesh.nel;e++)
-        E->lmesh.volume += E->eco[CPPR][e].area;
+        E->lmesh.volume += E->eco[e].area;
 
     MPI_Allreduce(&E->lmesh.volume, &E->mesh.volume, 1, MPI_DOUBLE,
                   MPI_SUM, E->parallel.world);
diff --git a/lib/Topo_gravity.c b/lib/Topo_gravity.c
index 8bc6ebd..e3d22f7 100644
--- a/lib/Topo_gravity.c
+++ b/lib/Topo_gravity.c
@@ -363,14 +363,14 @@ void compute_nodal_stress(struct All_variables *E,
     }
 #endif
       /* normalize by volume */
-      Sxx /= E->eco[CPPR][e].area;
-      Syy /= E->eco[CPPR][e].area;
-      Szz /= E->eco[CPPR][e].area;
-      Sxy /= E->eco[CPPR][e].area;
-      Sxz /= E->eco[CPPR][e].area;
-      Szy /= E->eco[CPPR][e].area;
-      div /= E->eco[CPPR][e].area;
-      vor /= E->eco[CPPR][e].area;
+      Sxx /= E->eco[e].area;
+      Syy /= E->eco[e].area;
+      Szz /= E->eco[e].area;
+      Sxy /= E->eco[e].area;
+      Sxz /= E->eco[e].area;
+      Szy /= E->eco[e].area;
+      div /= E->eco[e].area;
+      vor /= E->eco[e].area;
 
       /* add the pressure term */
       Szz -= E->P[CPPR][e-1]; /* E->P is now 0-based. Change e-1 to e */
diff --git a/lib/global_defs.h b/lib/global_defs.h
index 150da08..07a1673 100644
--- a/lib/global_defs.h
+++ b/lib/global_defs.h
@@ -796,7 +796,7 @@ struct All_variables {
     struct CITCOM_GNOMONIC *gnomonic;
     double gnomonic_reference_phi;
 
-    struct COORD *eco[NCS];
+    struct COORD *eco;
     struct IEN *ien;  /* global */
     struct SIEN *sien;
     struct ID *id[NCS];



More information about the CIG-COMMITS mailing list