[cig-commits] [commit] rajesh-petsc-schur: Changed the shapes of MASS and TMass members of the All_variables struct as part of caps_per_proc removal (5caf2e3)

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


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

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

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

commit 5caf2e3e7e30eda9a37c52234bfb866f7a4f657e
Author: Rajesh Kommu <rajesh.kommu at gmail.com>
Date:   Mon Sep 22 12:37:52 2014 -0700

    Changed the shapes of MASS and TMass members of the All_variables struct as part of caps_per_proc removal


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

5caf2e3e7e30eda9a37c52234bfb866f7a4f657e
 lib/Advection_diffusion.c |  2 +-
 lib/Composition_related.c |  2 +-
 lib/Instructions.c        |  6 +++---
 lib/Nodal_mesh.c          |  4 ++--
 lib/Process_buoyancy.c    |  2 +-
 lib/Size_does_matter.c    | 18 +++++++++---------
 lib/Solver_multigrid.c    |  8 ++++----
 lib/global_defs.h         |  4 ++--
 8 files changed, 23 insertions(+), 23 deletions(-)

diff --git a/lib/Advection_diffusion.c b/lib/Advection_diffusion.c
index ab29303..3a5b7c4 100644
--- a/lib/Advection_diffusion.c
+++ b/lib/Advection_diffusion.c
@@ -397,7 +397,7 @@ static void pg_solver(struct All_variables *E,
 
     for(i=1;i<=E->lmesh.nno;i++) {
       if(!(E->node[CPPR][i] & (TBX | TBY | TBZ))){
-        DTdot[i] *= E->TMass[CPPR][i];         /* lumped mass matrix */
+        DTdot[i] *= E->TMass[i];         /* lumped mass matrix */
       }	else {
         DTdot[i] = 0.0;         /* lumped mass matrix */
       }
diff --git a/lib/Composition_related.c b/lib/Composition_related.c
index 90806b1..b1dfdfb 100644
--- a/lib/Composition_related.c
+++ b/lib/Composition_related.c
@@ -444,7 +444,7 @@ void map_composition_to_nodes(struct All_variables *E)
     /* Divide by nodal volume */
         for(i=0;i<E->composition.ncomp;i++)
             for (kk=1;kk<=E->lmesh.nno;kk++)
-                E->composition.comp_node[CPPR][i][kk] *= E->MASS[E->mesh.levmax][CPPR][kk];
+                E->composition.comp_node[CPPR][i][kk] *= E->MASS[E->mesh.levmax][kk];
 
         /* testing */
         /**
diff --git a/lib/Instructions.c b/lib/Instructions.c
index 811a019..6d755f1 100644
--- a/lib/Instructions.c
+++ b/lib/Instructions.c
@@ -980,7 +980,7 @@ void allocate_common_vars(E)
   E->heating_latent = (double *) malloc((nel+1)*sizeof(double));
 
   /* lump mass matrix for the energy eqn */
-  E->TMass[CPPR] = (double *) malloc((nno+1)*sizeof(double));
+  E->TMass = (double *) malloc((nno+1)*sizeof(double));
 
   /* nodal mass */
   E->NMass[CPPR] = (double *) malloc((nno+1)*sizeof(double));
@@ -1032,7 +1032,7 @@ void allocate_common_vars(E)
     E->GNX[i][CPPR] = (struct Shape_function_dx *)malloc((nel+1)*sizeof(struct Shape_function_dx));
     E->GDA[i][CPPR] = (struct Shape_function_dA *)malloc((nel+1)*sizeof(struct Shape_function_dA));
 
-    E->MASS[i][CPPR]     = (double *) malloc((nno+1)*sizeof(double));
+    E->MASS[i]     = (double *) malloc((nno+1)*sizeof(double));
     E->ECO[i][CPPR] = (struct COORD *) malloc((nno+2)*sizeof(struct COORD));
 
     E->TWW[i][CPPR] = (struct FNODE *)   malloc((nel+2)*sizeof(struct FNODE));
@@ -1359,7 +1359,7 @@ void set_up_nonmg_aliases(struct All_variables *E)
   E->node[CPPR] = E->NODE[E->mesh.levmax][CPPR];
   E->cc = E->CC[E->mesh.levmax][CPPR];
   E->ccx = E->CCX[E->mesh.levmax][CPPR];
-  E->Mass[CPPR] = E->MASS[E->mesh.levmax][CPPR];
+  E->Mass[CPPR] = E->MASS[E->mesh.levmax];
   E->gDA[CPPR] = E->GDA[E->mesh.levmax][CPPR];
   E->gNX[CPPR] = E->GNX[E->mesh.levmax][CPPR];
 
diff --git a/lib/Nodal_mesh.c b/lib/Nodal_mesh.c
index da4fc7d..91a519e 100644
--- a/lib/Nodal_mesh.c
+++ b/lib/Nodal_mesh.c
@@ -209,7 +209,7 @@ void p_to_nodes(E,P,PN,lev)
    (E->exchange_node_f)(E,PN,lev);
 
    for(node=1;node<=E->lmesh.NNO[lev];node++)
-      PN[CPPR][node] *= E->MASS[lev][CPPR][node];
+      PN[CPPR][node] *= E->MASS[lev][node];
 }
 
 
@@ -244,7 +244,7 @@ void visc_from_gint_to_nodes(E,VE,VN,lev)
     }
   (E->exchange_node_f)(E,VN,lev);
     for(n=1;n<=E->lmesh.NNO[lev];n++)
-      VN[CPPR][n] *= E->MASS[lev][CPPR][n];
+      VN[CPPR][n] *= E->MASS[lev][n];
 }
 
 /* 
diff --git a/lib/Process_buoyancy.c b/lib/Process_buoyancy.c
index c0f42a3..52563cd 100644
--- a/lib/Process_buoyancy.c
+++ b/lib/Process_buoyancy.c
@@ -116,7 +116,7 @@ void heat_flux(E)
   (E->exchange_node_f)(E,flux,lev);
 
    for(i=1;i<=nno;i++)
-     flux[i] *= E->MASS[lev][CPPR][i];
+     flux[i] *= E->MASS[lev][i];
 
   if (E->parallel.me_loc[3]==E->parallel.nprocz-1)
     for(i=1;i<=E->lmesh.nsf;i++)
diff --git a/lib/Size_does_matter.c b/lib/Size_does_matter.c
index e14c487..707563d 100644
--- a/lib/Size_does_matter.c
+++ b/lib/Size_does_matter.c
@@ -963,7 +963,7 @@ void mass_matrix(struct All_variables *E)
     for(lev=E->mesh.levmin;lev<=E->mesh.levmax;lev++)  {
 
             for(node=1;node<=E->lmesh.NNO[lev];node++)
-                E->MASS[lev][CPPR][node] = 0.0;
+                E->MASS[lev][node] = 0.0;
 
             for(e=1;e<=E->lmesh.NEL[lev];e++)  {
 
@@ -1035,7 +1035,7 @@ void mass_matrix(struct All_variables *E)
                 }
 
                 for(node=1;node<=enodes[E->mesh.nsd];node++)
-                    E->MASS[lev][CPPR][E->IEN[lev][CPPR][e].node[node]] += temp[node];
+                    E->MASS[lev][E->IEN[lev][CPPR][e].node[node]] += temp[node];
 
                 /* weight of each node, equivalent to pmass in ConMan */
                 for(node=1;node<=enodes[E->mesh.nsd];node++)
@@ -1047,19 +1047,19 @@ void mass_matrix(struct All_variables *E)
 
         if(lev == E->mesh.levmax)
             for(node=1;node<=E->lmesh.NNO[lev];node++)
-                E->NMass[CPPR][node] = E->MASS[lev][CPPR][node];
+                E->NMass[CPPR][node] = E->MASS[lev][node];
 
         if (E->control.NMULTIGRID||E->mesh.levmax==lev)
             (E->exchange_node_d)(E,E->MASS[lev],lev);
 
         for(node=1;node<=E->lmesh.NNO[lev];node++)
-            E->MASS[lev][CPPR][node] = 1.0/E->MASS[lev][CPPR][node];
+            E->MASS[lev][node] = 1.0/E->MASS[lev][node];
 
     } /* end of for lev */
 
 
         for(node=1;node<=E->lmesh.nno;node++)
-            E->TMass[CPPR][node] = 0.0;
+            E->TMass[node] = 0.0;
 
         for(e=1;e<=E->lmesh.nel;e++)  {
             for(node=1;node<=enodes[E->mesh.nsd];node++) {
@@ -1075,13 +1075,13 @@ void mass_matrix(struct All_variables *E)
 
             /* lumped mass matrix, equivalent to tmass in ConMan */
             for(node=1;node<=enodes[E->mesh.nsd];node++)
-                E->TMass[CPPR][E->ien[e].node[node]] += temp[node];
+                E->TMass[E->ien[e].node[node]] += temp[node];
 
         } /* end of for e */
 
     (E->exchange_node_d)(E,E->TMass,E->mesh.levmax);
       for(node=1;node<=E->lmesh.nno;node++)
-          E->TMass[CPPR][node] = 1.0 / E->TMass[CPPR][node];
+          E->TMass[node] = 1.0 / E->TMass[node];
 
 
     /* compute volume of this processor mesh and the whole mesh */
@@ -1105,12 +1105,12 @@ void mass_matrix(struct All_variables *E)
                 for(e=1;e<=E->lmesh.NEL[lev];e++)
                     fprintf(E->fp_out,"%d %g \n",e,E->ECO[lev][CPPR][e].area);
                 for (node=1;node<=E->lmesh.NNO[lev];node++)
-                    fprintf(E->fp_out,"Mass[%d]= %g \n",node,E->MASS[lev][CPPR][node]);
+                    fprintf(E->fp_out,"Mass[%d]= %g \n",node,E->MASS[lev][node]);
         }
 
             fprintf(E->fp_out,"m=%d %d \n",E->sphere.capid[CPPR],m);
             for (node=1;node<=E->lmesh.nno;node++)
-                fprintf(E->fp_out,"TMass[%d]= %g \n",node,E->TMass[CPPR][node]);
+                fprintf(E->fp_out,"TMass[%d]= %g \n",node,E->TMass[node]);
         fflush(E->fp_out);
     }
 }
diff --git a/lib/Solver_multigrid.c b/lib/Solver_multigrid.c
index 6a21bc2..a118a33 100644
--- a/lib/Solver_multigrid.c
+++ b/lib/Solver_multigrid.c
@@ -465,7 +465,7 @@ void project_scalar(E,start_lev,AU,AD)
    (E->exchange_node_f)(E,AD,sl_minus);
 
      for(i=1;i<=nno_minus;i++)  {
-       AD[i] *= E->MASS[sl_minus][CPPR][i];
+       AD[i] *= E->MASS[sl_minus][i];
      }
 }
 
@@ -533,9 +533,9 @@ void project_vector(E,start_lev,AU,AD,ic)
    (E->solver.exchange_id_d)(E, E->temp1, sl_minus);
 
      for(i=1;i<=nno_minus;i++)  {
-       E->temp1[E->ID[sl_minus][CPPR][i].doff[1]] *= E->MASS[sl_minus][CPPR][i];
-       E->temp1[E->ID[sl_minus][CPPR][i].doff[2]] *= E->MASS[sl_minus][CPPR][i];
-       E->temp1[E->ID[sl_minus][CPPR][i].doff[3]] *= E->MASS[sl_minus][CPPR][i];
+       E->temp1[E->ID[sl_minus][CPPR][i].doff[1]] *= E->MASS[sl_minus][i];
+       E->temp1[E->ID[sl_minus][CPPR][i].doff[2]] *= E->MASS[sl_minus][i];
+       E->temp1[E->ID[sl_minus][CPPR][i].doff[3]] *= E->MASS[sl_minus][i];
        }
 
                /* back into rtf coordinates */
diff --git a/lib/global_defs.h b/lib/global_defs.h
index c5206ca..3ed46f7 100644
--- a/lib/global_defs.h
+++ b/lib/global_defs.h
@@ -833,8 +833,8 @@ struct All_variables {
     double *T,*Tdot,*buoyancy[NCS];
     double *u1;
     double *temp,*temp1;
-    double *Mass[NCS], *MASS[MAX_LEVELS][NCS];
-    double *TMass[NCS], *NMass[NCS];
+    double *Mass[NCS], *MASS[MAX_LEVELS];
+    double *TMass, *NMass[NCS];
     double *SX[MAX_LEVELS][NCS][4],*X[MAX_LEVELS][NCS][4];
     double *sx[NCS][4],*x[NCS][4];
     double *surf_det[NCS][5];



More information about the CIG-COMMITS mailing list