[cig-commits] [commit] rajesh-petsc-schur: Changed the shapes of E->FasXXX and E->FasXXX_b as part of caps_per_proc_removal (03d57b6)

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


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

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

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

commit 03d57b69ea830bce17e72d9f1982981a32278b88
Author: Rajesh Kommu <rajesh.kommu at gmail.com>
Date:   Wed Sep 24 14:31:00 2014 -0700

    Changed the shapes of E->FasXXX and E->FasXXX_b as part of caps_per_proc_removal


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

03d57b69ea830bce17e72d9f1982981a32278b88
 lib/Advection_diffusion.c |  4 ++--
 lib/Phase_change.c        | 36 ++++++++++++++++++------------------
 lib/global_defs.h         |  4 ++--
 3 files changed, 22 insertions(+), 22 deletions(-)

diff --git a/lib/Advection_diffusion.c b/lib/Advection_diffusion.c
index 8806454..174708c 100644
--- a/lib/Advection_diffusion.c
+++ b/lib/Advection_diffusion.c
@@ -773,7 +773,7 @@ static void process_adi_heating(struct All_variables *E, double *heating)
 
 static void latent_heating(struct All_variables *E,
                            double *heating_latent, double *heating_adi,
-                           float **B, float Ra, float clapeyron,
+                           float *B, float Ra, float clapeyron,
                            float depth, float transT, float inv_width)
 {
     double temp, temp0, temp1, temp2, temp3, matprop;
@@ -797,7 +797,7 @@ static void latent_heating(struct All_variables *E,
         temp3 = 0;
         for(i=1; i<=ends; i++) {
             j = E->ien[e].node[i];
-            temp = (1.0 - B[CPPR][j]) * B[CPPR][j]
+            temp = (1.0 - B[j]) * B[j]
                 * (E->T[j] + E->control.surface_temp);
             temp2 += temp * E->sphere.cap[CPPR].V[3][j];
             temp3 += temp;
diff --git a/lib/Phase_change.c b/lib/Phase_change.c
index e736a4f..99c3577 100644
--- a/lib/Phase_change.c
+++ b/lib/Phase_change.c
@@ -34,14 +34,14 @@
 #include "phase_change.h"
 
 static void phase_change_apply(struct All_variables *E, double **buoy,
-			       float **B, float **B_b,
+			       float *B, float *B_b,
 			       float Ra, float clapeyron,
 			       float depth, float transT, float inv_width);
 static void calc_phase_change(struct All_variables *E,
-			      float **B, float **B_b,
+			      float *B, float *B_b,
 			      float Ra, float clapeyron,
 			      float depth, float transT, float inv_width);
-static void debug_phase_change(struct All_variables *E, float **B);
+static void debug_phase_change(struct All_variables *E, float *B);
 
 
 void phase_change_allocate(struct All_variables *E)
@@ -50,12 +50,12 @@ void phase_change_allocate(struct All_variables *E)
   int nno  = E->lmesh.nno;
   int nsf  = E->lmesh.nsf;
 
-    E->Fas410[CPPR]   = (float *) malloc((nno+1)*sizeof(float));
-    E->Fas410_b[CPPR] = (float *) malloc((nsf+1)*sizeof(float));
-    E->Fas670[CPPR]   = (float *) malloc((nno+1)*sizeof(float));
-    E->Fas670_b[CPPR] = (float *) malloc((nsf+1)*sizeof(float));
-    E->Fascmb[CPPR]   = (float *) malloc((nno+1)*sizeof(float));
-    E->Fascmb_b[CPPR] = (float *) malloc((nsf+1)*sizeof(float));
+    E->Fas410   = (float *) malloc((nno+1)*sizeof(float));
+    E->Fas410_b = (float *) malloc((nsf+1)*sizeof(float));
+    E->Fas670   = (float *) malloc((nno+1)*sizeof(float));
+    E->Fas670_b = (float *) malloc((nsf+1)*sizeof(float));
+    E->Fascmb   = (float *) malloc((nno+1)*sizeof(float));
+    E->Fascmb_b = (float *) malloc((nsf+1)*sizeof(float));
 }
 
 
@@ -127,7 +127,7 @@ void phase_change_apply_cmb(struct All_variables *E, double **buoy)
 
 
 static void phase_change_apply(struct All_variables *E, double **buoy,
-			       float **B, float **B_b,
+			       float *B, float *B_b,
 			       float Ra, float clapeyron,
 			       float depth, float transT, float inv_width)
 {
@@ -135,7 +135,7 @@ static void phase_change_apply(struct All_variables *E, double **buoy,
 
   calc_phase_change(E, B, B_b, Ra, clapeyron, depth, transT, inv_width);
     for(i=1;i<=E->lmesh.nno;i++)
-      buoy[CPPR][i] -= Ra * B[CPPR][i];
+      buoy[CPPR][i] -= Ra * B[i];
 
   if (E->control.verbose) {
     fprintf(E->fp_out, "Ra=%f, clapeyron=%f, depth=%f, transT=%f, inv_width=%f\n",
@@ -147,7 +147,7 @@ static void phase_change_apply(struct All_variables *E, double **buoy,
 
 
 static void calc_phase_change(struct All_variables *E,
-			      float **B, float **B_b,
+			      float *B, float *B_b,
 			      float Ra, float clapeyron,
 			      float depth, float transT, float inv_width)
 {
@@ -168,7 +168,7 @@ static void calc_phase_change(struct All_variables *E,
         e_pressure = dz * E->refstate.rho[nz] * E->refstate.gravity[nz]
             - clapeyron * (E->T[i] - transT);
 
-        B[CPPR][i] = pt5 * (one + tanh(inv_width * e_pressure));
+        B[i] = pt5 * (one + tanh(inv_width * e_pressure));
     }
 
     /* compute the phase boundary, defined as the depth where B==0.5 */
@@ -176,23 +176,23 @@ static void calc_phase_change(struct All_variables *E,
     for (k=1;k<=E->lmesh.noy;k++)
       for (j=1;j<=E->lmesh.nox;j++)  {
         ns++;
-        B_b[CPPR][ns]=0.0;
+        B_b[ns]=0.0;
         for (i=1;i<E->lmesh.noz;i++)   {
           n = (k-1)*E->lmesh.noz*E->lmesh.nox + (j-1)*E->lmesh.noz + i;
-          if (B[CPPR][n]>=pt5 && B[CPPR][n+1]<=pt5)
-            B_b[CPPR][ns]=(E->sx[3][n+1]-E->sx[3][n])*(pt5-B[CPPR][n])/(B[CPPR][n+1]-B[CPPR][n])+E->sx[3][n];
+          if (B[n]>=pt5 && B[n+1]<=pt5)
+            B_b[ns]=(E->sx[3][n+1]-E->sx[3][n])*(pt5-B[n])/(B[n+1]-B[n])+E->sx[3][n];
 	}
       }
 }
 
 
-static void debug_phase_change(struct All_variables *E, float **B)
+static void debug_phase_change(struct All_variables *E, float *B)
 {
   int m, j;
 
   fprintf(E->fp_out,"output_phase_change_buoyancy\n");
     fprintf(E->fp_out,"for cap %d\n",E->sphere.capid[CPPR]);
     for (j=1;j<=E->lmesh.nno;j++)
-      fprintf(E->fp_out,"Z = %.6e T = %.6e B[%06d] = %.6e \n",E->sx[3][j],E->T[j],j,B[CPPR][j]);
+      fprintf(E->fp_out,"Z = %.6e T = %.6e B[%06d] = %.6e \n",E->sx[3][j],E->T[j],j,B[j]);
   fflush(E->fp_out);
 }
diff --git a/lib/global_defs.h b/lib/global_defs.h
index 2121cc9..71b62d0 100644
--- a/lib/global_defs.h
+++ b/lib/global_defs.h
@@ -843,8 +843,8 @@ struct All_variables {
     float *NP;
   //float *stress[NCS];
     float *gstress;
-    float *Fas670[NCS],*Fas410[NCS],*Fas670_b[NCS],*Fas410_b[NCS];
-    float *Fascmb[NCS],*Fascmb_b[NCS];
+    float *Fas670,*Fas410,*Fas670_b,*Fas410_b;
+    float *Fascmb,*Fascmb_b;
 
     float *Vi,*EVi;
     float *VI[MAX_LEVELS],*EVI[MAX_LEVELS];



More information about the CIG-COMMITS mailing list