[cig-commits] [commit] rajesh-petsc-schur: Changed the shape of VI and EVI members of All_variables as part of caps_per_proc removal. Corrected the signatures of get_system_viscosity, visc_from_nodes_to_gint, visc_from_ele_to_gint, visc_from_gint_to_nodes, visc_from_gint_to_ele, apply_low_visc_wedge_channel, visc_from_P, visc_from_T, visc_from_S, visc_from_C, visc_from_mat (9790c04)

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


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

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

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

commit 9790c04e74b0c47cc49c91d2bd84b5c8690b2048
Author: Rajesh Kommu <rajesh.kommu at gmail.com>
Date:   Mon Sep 22 13:22:13 2014 -0700

    Changed the shape of VI and EVI members of All_variables as part of
    caps_per_proc removal. Corrected the signatures of get_system_viscosity,
    visc_from_nodes_to_gint, visc_from_ele_to_gint, visc_from_gint_to_nodes,
    visc_from_gint_to_ele, apply_low_visc_wedge_channel, visc_from_P,
    visc_from_T, visc_from_S, visc_from_C, visc_from_mat


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

9790c04e74b0c47cc49c91d2bd84b5c8690b2048
 lib/Element_calculations.c |  4 +--
 lib/Instructions.c         | 10 +++----
 lib/Nodal_mesh.c           | 30 +++++++++----------
 lib/Output.c               |  2 +-
 lib/Output_gzdir.c         |  4 +--
 lib/Output_h5.c            |  2 +-
 lib/Output_vtk.c           |  4 +--
 lib/Viscosity_structures.c | 72 +++++++++++++++++++++++-----------------------
 lib/global_defs.h          |  2 +-
 lib/prototypes.h           | 20 ++++++-------
 10 files changed, 75 insertions(+), 75 deletions(-)

diff --git a/lib/Element_calculations.c b/lib/Element_calculations.c
index 65a8002..0a92690 100644
--- a/lib/Element_calculations.c
+++ b/lib/Element_calculations.c
@@ -307,7 +307,7 @@ void get_elt_k(E,el,elt_k,lev,iconv)
     
     for(k=1;k<=vpts;k++) {
       off = (el-1)*vpts+k;
-      W[k]=g_point[k].weight[dims-1]*E->GDA[lev][CPPR][el].vpt[k]*E->EVI[lev][CPPR][off];
+      W[k]=g_point[k].weight[dims-1]*E->GDA[lev][CPPR][el].vpt[k]*E->EVI[lev][off];
 #ifdef CITCOM_ALLOW_ANISOTROPIC_VISC
       if(E->viscosity.allow_anisotropic_viscosity){
 	/* allow for a possibly anisotropic viscosity */
@@ -1247,7 +1247,7 @@ void get_aug_k(E,el,elt_k,level)
      Visc = 0.0;
      for(a=1;a<=vpts;a++) {
 	  p[a] = (a-1)*dims;
-	  Visc += E->EVI[level][CPPR][(el-1)*vpts+a];
+	  Visc += E->EVI[level][(el-1)*vpts+a];
        }
      Visc = Visc/vpts;
 
diff --git a/lib/Instructions.c b/lib/Instructions.c
index 6d755f1..d14164c 100644
--- a/lib/Instructions.c
+++ b/lib/Instructions.c
@@ -1070,11 +1070,11 @@ void allocate_common_vars(E)
     if(E->control.inv_gruneisen != 0)
         E->elt_c[i][CPPR] = (struct EC *) malloc((nel+1)*sizeof(struct EC));
 
-    E->EVI[i][CPPR] = (float *) malloc((nel+1)*vpoints[E->mesh.nsd]*sizeof(float));
+    E->EVI[i] = (float *) malloc((nel+1)*vpoints[E->mesh.nsd]*sizeof(float));
     E->BPI[i] = (double *) malloc((npno+1)*sizeof(double));
 
     E->ID[i][CPPR]  = (struct ID *)    malloc((nno+1)*sizeof(struct ID));
-    E->VI[i][CPPR]  = (float *)        malloc((nno+1)*sizeof(float));
+    E->VI[i]  = (float *)        malloc((nno+1)*sizeof(float));
     E->NODE[i][CPPR] = (unsigned int *)malloc((nno+1)*sizeof(unsigned int));
 
     nxyz = max(nox*noz,nox*noy);
@@ -1090,7 +1090,7 @@ void allocate_common_vars(E)
 
     for(l=1;l<=E->lmesh.NNO[i];l++)  {
       E->NODE[i][CPPR][l] = (INTX | INTY | INTZ);  /* and any others ... */
-      E->VI[i][CPPR][l] = 1.0;
+      E->VI[i][l] = 1.0;
       }
 
 
@@ -1354,8 +1354,8 @@ void set_up_nonmg_aliases(struct All_variables *E)
   E->eco = E->ECO[E->mesh.levmax][CPPR];
   E->ien = E->IEN[E->mesh.levmax][CPPR];
   E->id = E->ID[E->mesh.levmax][CPPR];
-  E->Vi[CPPR] = E->VI[E->mesh.levmax][CPPR];
-  E->EVi[CPPR] = E->EVI[E->mesh.levmax][CPPR];
+  E->Vi[CPPR] = E->VI[E->mesh.levmax];
+  E->EVi[CPPR] = E->EVI[E->mesh.levmax];
   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];
diff --git a/lib/Nodal_mesh.c b/lib/Nodal_mesh.c
index 91a519e..aec41b7 100644
--- a/lib/Nodal_mesh.c
+++ b/lib/Nodal_mesh.c
@@ -220,7 +220,7 @@ void p_to_nodes(E,P,PN,lev)
  */
 void visc_from_gint_to_nodes(E,VE,VN,lev)
   struct All_variables *E;
-  float **VE,**VN;
+  float *VE,*VN;
   int lev;
 {
   int m,e,i,j,k,n,off,lim;
@@ -230,21 +230,21 @@ void visc_from_gint_to_nodes(E,VE,VN,lev)
   double temp_visc;
   
     for(i=1;i<=E->lmesh.NNO[lev];i++)
-      VN[CPPR][i] = 0.0;
+      VN[i] = 0.0;
     for(e=1;e<=E->lmesh.NEL[lev];e++)   {
       temp_visc=0.0;
       for(i=1;i<=vpts;i++)
-	temp_visc += VE[CPPR][(e-1)*vpts + i];
+	temp_visc += VE[(e-1)*vpts + i];
       temp_visc = temp_visc/vpts;
       
       for(j=1;j<=ends;j++)                {
 	n = E->IEN[lev][CPPR][e].node[j];
-	VN[CPPR][n] += E->TWW[lev][CPPR][e].node[j] * temp_visc;
+	VN[n] += E->TWW[lev][CPPR][e].node[j] * temp_visc;
       }
     }
   (E->exchange_node_f)(E,VN,lev);
     for(n=1;n<=E->lmesh.NNO[lev];n++)
-      VN[CPPR][n] *= E->MASS[lev][n];
+      VN[n] *= E->MASS[lev][n];
 }
 
 /* 
@@ -254,7 +254,7 @@ interpolate viscosity from nodes to element integration points
  */
 void visc_from_nodes_to_gint(E,VN,VE,lev)
   struct All_variables *E;
-  float **VE,**VN;
+  float *VE,*VN;
   int lev;
 {
 
@@ -267,13 +267,13 @@ void visc_from_nodes_to_gint(E,VN,VE,lev)
 
     for(e=1;e<=E->lmesh.NEL[lev];e++)
       for(i=1;i<=vpts;i++)
-	VE[CPPR][(e-1)*vpts+i] = 0.0;
+	VE[(e-1)*vpts+i] = 0.0;
     for(e=1;e<=E->lmesh.NEL[lev];e++)
       for(i=1;i<=vpts;i++)      {
 	temp_visc=0.0;
 	for(j=1;j<=ends;j++)
-	  temp_visc += E->N.vpt[GNVINDEX(j,i)]*VN[CPPR][E->IEN[lev][CPPR][e].node[j]];
-	VE[CPPR][(e-1)*vpts+i] = temp_visc;
+	  temp_visc += E->N.vpt[GNVINDEX(j,i)]*VN[E->IEN[lev][CPPR][e].node[j]];
+	VE[(e-1)*vpts+i] = temp_visc;
       }
 }
 
@@ -284,7 +284,7 @@ void visc_from_nodes_to_gint(E,VN,VE,lev)
 */
 void visc_from_gint_to_ele(E,VE,VN,lev)
   struct All_variables *E;
-  float **VE,**VN;
+  float *VE,*VN;
   int lev;
   {
     int m,e,i,j,k,n,off;
@@ -294,13 +294,13 @@ void visc_from_gint_to_ele(E,VE,VN,lev)
     double temp_visc;
 
       for(i=1;i<=E->lmesh.NEL[lev];i++)
-	VN[CPPR][i] = 0.0;
+	VN[i] = 0.0;
       for(e=1;e<=E->lmesh.NEL[lev];e++)   {
 	temp_visc=0.0;
 	for(i=1;i<=vpts;i++)
-	  temp_visc += VE[CPPR][(e-1)*vpts + i];
+	  temp_visc += VE[(e-1)*vpts + i];
 	temp_visc = temp_visc/vpts;
-	VN[CPPR][e] = temp_visc;
+	VN[e] = temp_visc;
       }
 }
 
@@ -312,7 +312,7 @@ void visc_from_gint_to_ele(E,VE,VN,lev)
 
 void visc_from_ele_to_gint(E,VN,VE,lev)
   struct All_variables *E;
-  float **VE,**VN;
+  float *VE,*VN;
   int lev;
 {
   int m,e,i,j,k,n,off;
@@ -323,6 +323,6 @@ void visc_from_ele_to_gint(E,VN,VE,lev)
 
     for(e=1;e<=E->lmesh.NEL[lev];e++)
       for(i=1;i<=vpts;i++)      {
-	VE[CPPR][(e-1)*vpts+i] = VN[CPPR][e];
+	VE[(e-1)*vpts+i] = VN[e];
       }
 }
diff --git a/lib/Output.c b/lib/Output.c
index 7f943b6..8a9a54a 100644
--- a/lib/Output.c
+++ b/lib/Output.c
@@ -312,7 +312,7 @@ void output_visc(struct All_variables *E, int cycles)
 
   fprintf(fp1,"%3d %7d\n",CPPR,E->lmesh.nno);
   for(i=1;i<=E->lmesh.nno;i++)
-    fprintf(fp1,"%.4e\n",E->VI[lev][CPPR][i]);
+    fprintf(fp1,"%.4e\n",E->VI[lev][i]);
   fclose(fp1);
 }
 
diff --git a/lib/Output_gzdir.c b/lib/Output_gzdir.c
index 3171519..f18ac30 100644
--- a/lib/Output_gzdir.c
+++ b/lib/Output_gzdir.c
@@ -704,7 +704,7 @@ void gzdir_output_visc(struct All_variables *E, int cycles)
     gz1 = gzdir_output_open(output_file,"w");
       gzprintf(gz1,"%3d %7d\n",CPPR,E->lmesh.nno);
       for(i=1;i<=E->lmesh.nno;i++)
-	gzprintf(gz1,"%.4e\n",E->VI[lev][CPPR][i]);
+	gzprintf(gz1,"%.4e\n",E->VI[lev][i]);
 
     gzclose(gz1);
   }else{
@@ -723,7 +723,7 @@ void gzdir_output_visc(struct All_variables *E, int cycles)
       fp1 = output_open(output_file,"a");
     }
       for(i=1;i<=E->lmesh.nno;i++){
-	ftmp = log10(E->VI[lev][CPPR][i]);
+	ftmp = log10(E->VI[lev][i]);
 	if(fabs(ftmp) < 5e-7)ftmp = 0.0;
 	if(be_write_float_to_file(&ftmp,1,fp1)!=1)BE_WERROR;
       }
diff --git a/lib/Output_h5.c b/lib/Output_h5.c
index 7b5fcfb..ce39b50 100644
--- a/lib/Output_h5.c
+++ b/lib/Output_h5.c
@@ -589,7 +589,7 @@ void h5output_viscosity(struct All_variables *E, int cycles)
             {
                 n = k + i*nz + j*nz*nx;
                 m = k + j*mz + i*mz*my;
-                field->data[m] = E->VI[lev][CPPR][n+1];
+                field->data[m] = E->VI[lev][n+1];
             }
         }
     }
diff --git a/lib/Output_vtk.c b/lib/Output_vtk.c
index d1c6cde..6859513 100644
--- a/lib/Output_vtk.c
+++ b/lib/Output_vtk.c
@@ -167,9 +167,9 @@ static void vtk_output_visc(struct All_variables *E, FILE *fp)
 
     fprintf(fp, "        <DataArray type=\"Float32\" Name=\"viscosity\" format=\"%s\">\n", E->output.vtk_format);
         if (strcmp(E->output.vtk_format, "binary") == 0) {
-            write_binary_array(nodes,&E->VI[lev][CPPR][1],fp);
+            write_binary_array(nodes,&E->VI[lev][1],fp);
         } else {
-            write_ascii_array(nodes,1,&E->VI[lev][CPPR][1],fp);
+            write_ascii_array(nodes,1,&E->VI[lev][1],fp);
         }
 
     fputs("        </DataArray>\n", fp);
diff --git a/lib/Viscosity_structures.c b/lib/Viscosity_structures.c
index ffe31e3..88f6478 100644
--- a/lib/Viscosity_structures.c
+++ b/lib/Viscosity_structures.c
@@ -44,7 +44,7 @@ void read_visc_layer_file(struct All_variables *E);
 void read_visc_param_from_file(struct All_variables *E,
                                const char *param, float *var,
                                FILE *fp);
-static void apply_low_visc_wedge_channel(struct All_variables *E, float **evisc);
+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);
 static void low_viscosity_wedge_factor(struct All_variables *E, float *F);
 void parallel_process_termination();
@@ -278,7 +278,7 @@ void allocate_visc_vars(struct All_variables *E)
 void get_system_viscosity(E,propogate,evisc,visc)
      struct All_variables *E;
      int propogate;
-     float **evisc,**visc;
+     float *evisc,*visc;
 {
     void visc_from_mat();
     void visc_from_T();
@@ -337,22 +337,22 @@ void get_system_viscosity(E,propogate,evisc,visc)
     if(E->viscosity.MAX) {
             for(i=1;i<=E->lmesh.nel;i++)
                 for(j=1;j<=vpts;j++)
-                    if(evisc[CPPR][(i-1)*vpts + j] > E->viscosity.max_value)
-                        evisc[CPPR][(i-1)*vpts + j] = E->viscosity.max_value;
+                    if(evisc[(i-1)*vpts + j] > E->viscosity.max_value)
+                        evisc[(i-1)*vpts + j] = E->viscosity.max_value;
     }
 
     if(E->viscosity.MIN) {
             for(i=1;i<=E->lmesh.nel;i++)
                 for(j=1;j<=vpts;j++)
-                    if(evisc[CPPR][(i-1)*vpts + j] < E->viscosity.min_value)
-                        evisc[CPPR][(i-1)*vpts + j] = E->viscosity.min_value;
+                    if(evisc[(i-1)*vpts + j] < E->viscosity.min_value)
+                        evisc[(i-1)*vpts + j] = E->viscosity.min_value;
     }
 
     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]);
       for(i=1;i<=E->lmesh.nel;i++)
-          fprintf(E->fp_out,"%d %d %f %f\n",i,E->mat[CPPR][i],evisc[CPPR][(i-1)*vpts+1],evisc[CPPR][(i-1)*vpts+7]);
+          fprintf(E->fp_out,"%d %d %f %f\n",i,E->mat[CPPR][i],evisc[(i-1)*vpts+1],evisc[(i-1)*vpts+7]);
       fflush(E->fp_out);
     }
     /* interpolate from gauss quadrature points to node points for output */
@@ -399,18 +399,18 @@ void initial_viscosity(struct All_variables *E)
 
 void visc_from_mat(E,EEta)
      struct All_variables *E;
-     float **EEta;
+     float *EEta;
 {
 
     int i,m,jj;
     if(E->control.mat_control){	/* use pre-factor even without temperature dependent viscosity */
         for(i=1;i<=E->lmesh.nel;i++)
 	  for(jj=1;jj<=vpoints[E->mesh.nsd];jj++)
-	    EEta[CPPR][ (i-1)*vpoints[E->mesh.nsd]+jj ] = E->viscosity.N0[E->mat[CPPR][i]-1]*E->VIP[CPPR][i];
+	    EEta[ (i-1)*vpoints[E->mesh.nsd]+jj ] = E->viscosity.N0[E->mat[CPPR][i]-1]*E->VIP[CPPR][i];
      }else{
         for(i=1;i<=E->lmesh.nel;i++)
 	  for(jj=1;jj<=vpoints[E->mesh.nsd];jj++)
-	    EEta[CPPR][ (i-1)*vpoints[E->mesh.nsd]+jj ] = E->viscosity.N0[E->mat[CPPR][i]-1];
+	    EEta[ (i-1)*vpoints[E->mesh.nsd]+jj ] = E->viscosity.N0[E->mat[CPPR][i]-1];
     }
 }
 
@@ -461,7 +461,7 @@ void read_visc_layer_file(struct All_variables *E)
 
 void visc_from_T(E,EEta,propogate)
      struct All_variables *E;
-     float **EEta;
+     float *EEta;
      int propogate;
 {
     int m,i,k,l,z,jj,kk;
@@ -498,7 +498,7 @@ void visc_from_T(E,EEta,propogate)
                         temp += TT[kk] * E->N.vpt[GNVINDEX(kk,jj)];
                     }
 
-                    EEta[CPPR][ (i-1)*vpts + jj ] = tempa*
+                    EEta[ (i-1)*vpts + jj ] = tempa*
                         exp( E->viscosity.E[l] * (E->viscosity.T[l] - temp));
 
                 }
@@ -525,7 +525,7 @@ void visc_from_T(E,EEta,propogate)
                         temp += TT[kk] * E->N.vpt[GNVINDEX(kk,jj)];
                     }
 
-                    EEta[CPPR][ (i-1)*vpts + jj ] = tempa*
+                    EEta[ (i-1)*vpts + jj ] = tempa*
                         exp( -temp / E->viscosity.T[l]);
 
                 }
@@ -558,7 +558,7 @@ void visc_from_T(E,EEta,propogate)
 		      TT[kk]=max(TT[kk],zero);
 		      temp += min(TT[kk],one) * E->N.vpt[GNVINDEX(kk,jj)];
                     }
-		    EEta[CPPR][ (i-1)*vpts + jj ] = tempa*
+		    EEta[ (i-1)*vpts + jj ] = tempa*
 		      exp( E->viscosity.E[l]/(temp+E->viscosity.T[l])
 			   - E->viscosity.E[l]/(one +E->viscosity.T[l]) );
                 }
@@ -589,7 +589,7 @@ void visc_from_T(E,EEta,propogate)
                     }
 
 
-		    EEta[CPPR][ (i-1)*vpts + jj ] = tempa*
+		    EEta[ (i-1)*vpts + jj ] = tempa*
 		      exp( (E->viscosity.E[l] +  E->viscosity.Z[l]*zzz )
 			   / (E->viscosity.T[l]+temp) );
 
@@ -618,7 +618,7 @@ void visc_from_T(E,EEta,propogate)
                     }
 
                     if(E->control.mat_control==0){
-                        EEta[CPPR][ (i-1)*vpts + jj ] = tempa*
+                        EEta[ (i-1)*vpts + jj ] = tempa*
                             exp( E->viscosity.E[l]/(temp+E->viscosity.T[l])
                                  - E->viscosity.E[l]/(one +E->viscosity.T[l]) );
 		    }else{
@@ -633,7 +633,7 @@ void visc_from_T(E,EEta,propogate)
                            if(visc2 < E->viscosity.min_value)
                                visc2 = E->viscosity.min_value;
                          }
-                       EEta[CPPR][ (i-1)*vpts + jj ] = E->VIP[CPPR][i]*visc2;
+                       EEta[ (i-1)*vpts + jj ] = E->VIP[CPPR][i]*visc2;
                       }
 
                 }
@@ -667,7 +667,7 @@ void visc_from_T(E,EEta,propogate)
 		temp += min(TT[kk],one) * E->N.vpt[GNVINDEX(kk,jj)];
 		zzz += zz[kk] * E->N.vpt[GNVINDEX(kk,jj)];
 	      }
-	      EEta[CPPR][ (i-1)*vpts + jj ] = tempa*
+	      EEta[ (i-1)*vpts + jj ] = tempa*
 		exp( E->viscosity.E[l]*(E->viscosity.T[l] - temp) +
 		     zzz *  E->viscosity.Z[l]);
 	    }
@@ -724,7 +724,7 @@ void visc_from_T(E,EEta,propogate)
                     }
 
 
-                    EEta[CPPR][ (i-1)*vpts + jj ] = tempa*
+                    EEta[ (i-1)*vpts + jj ] = tempa*
                         exp( (E->viscosity.E[l] +  E->viscosity.Z[l]*zzz )
                              / (E->viscosity.T[l] + temp)
                              - (E->viscosity.E[l] +
@@ -776,9 +776,9 @@ void visc_from_T(E,EEta,propogate)
 		    visc1 = tempa* exp( E->viscosity.E[l]/(temp+E->viscosity.T[l]) 
 				  - E->viscosity.E[l]/(one +E->viscosity.T[l]) );
 		    if(temp < E->viscosity.T_sol0 + 2.*(1.-zzz))
-		      EEta[CPPR][ (i-1)*vpts + jj ] = visc1;
+		      EEta[ (i-1)*vpts + jj ] = visc1;
 		    else
-		      EEta[CPPR][ (i-1)*vpts + jj ] = visc1 * E->viscosity.ET_red;
+		      EEta[ (i-1)*vpts + jj ] = visc1 * E->viscosity.ET_red;
                 }
             }
         break;
@@ -801,7 +801,7 @@ void visc_from_T(E,EEta,propogate)
                     temp=0.0;
                     for(kk=1;kk<=ends;kk++)
 		      temp += TT[kk] * E->N.vpt[GNVINDEX(kk,jj)];
-		    EEta[CPPR][ (i-1)*vpts + jj ] = tempa*
+		    EEta[ (i-1)*vpts + jj ] = tempa*
 		      exp( E->viscosity.E[l]/(temp+E->viscosity.T[l])
 			   - E->viscosity.E[l]/(one +E->viscosity.T[l]) );
                 }
@@ -841,9 +841,9 @@ void visc_from_T(E,EEta,propogate)
 		    visc1 = tempa* exp( E->viscosity.E[l]/(temp+E->viscosity.T[l]) 
 				  - E->viscosity.E[l]/(one +E->viscosity.T[l]) );
 		    if(temp < E->viscosity.T_sol0 + 2.*(1.-zzz))
-		      EEta[CPPR][ (i-1)*vpts + jj ] = visc1;
+		      EEta[ (i-1)*vpts + jj ] = visc1;
 		    else
-		      EEta[CPPR][ (i-1)*vpts + jj ] = visc1 * E->viscosity.ET_red;
+		      EEta[ (i-1)*vpts + jj ] = visc1 * E->viscosity.ET_red;
                 }
             }
         break;
@@ -868,7 +868,7 @@ void visc_from_T(E,EEta,propogate)
 
 void visc_from_S(E,EEta,propogate)
      struct All_variables *E;
-     float **EEta;
+     float *EEta;
      int propogate;
 {
     float one,two,scale,stress_magnitude,depth,exponent1;
@@ -903,7 +903,7 @@ void visc_from_S(E,EEta,propogate)
             exponent1= one/E->viscosity.sdepv_expt[E->mat[CPPR][e]-1];
             scale=pow(eedot[e],exponent1-one);
             for(jj=1;jj<=vpts;jj++)
-                EEta[CPPR][(e-1)*vpts + jj] = scale*pow(EEta[CPPR][(e-1)*vpts+jj],exponent1);
+                EEta[(e-1)*vpts + jj] = scale*pow(EEta[(e-1)*vpts+jj],exponent1);
         }
 
     free ((void *)eedot);
@@ -955,7 +955,7 @@ void visc_from_P(E,EEta) /* "plasticity" implementation
 
 			 */
      struct All_variables *E;
-     float **EEta;
+     float *EEta;
 {
   float *eedot,zz[9],zzz,tau,eta_p,eta_new,tau2,eta_old,eta_old2;
   int m,e,l,z,jj,kk;
@@ -1011,12 +1011,12 @@ void visc_from_P(E,EEta) /* "plasticity" implementation
 	  eta_p = tau/(2.0 * eedot[e] + 1e-7) + E->viscosity.pdepv_offset;
 	  if(E->viscosity.pdepv_eff){
 	    /* two dashpots in series */
-	    eta_new  = 1.0/(1.0/EEta[CPPR][ (e-1)*vpts + jj ] + 1.0/eta_p);
+	    eta_new  = 1.0/(1.0/EEta[ (e-1)*vpts + jj ] + 1.0/eta_p);
 	  }else{
 	    /* min viscosities*/
-	    eta_new  = min(EEta[CPPR][ (e-1)*vpts + jj ], eta_p);
+	    eta_new  = min(EEta[ (e-1)*vpts + jj ], eta_p);
 	  }
-	  EEta[CPPR][(e-1)*vpts + jj] = eta_new;
+	  EEta[(e-1)*vpts + jj] = eta_new;
 	} /* end integration point loop */
       }	/* end element loop */
     }else{
@@ -1036,11 +1036,11 @@ void visc_from_P(E,EEta) /* "plasticity" implementation
 	  tau2 = tau * tau;
 	  if(tau < 1e10){
 	    /*  */
-	    eta_old = EEta[CPPR][ (e-1)*vpts + jj ];
+	    eta_old = EEta[ (e-1)*vpts + jj ];
 	    eta_old2 = eta_old * eta_old;
 	    /* effectiev viscosity */
 	    eta_new = (tau2 * eta_old)/(tau2 + 2.0 * eta_old2 * eedot[e]);
-	    EEta[CPPR][(e-1)*vpts + jj] = eta_new;
+	    EEta[(e-1)*vpts + jj] = eta_new;
 	  }
 	}
       }
@@ -1057,7 +1057,7 @@ compositions between zero and unity
 */
 void visc_from_C( E, EEta)
      struct All_variables *E;
-     float **EEta;
+     float *EEta;
 {
   double vmean,cc_loc[10],CC[10][9],cbackground;
   int m,l,z,jj,kk,i,p,q;
@@ -1097,7 +1097,7 @@ void visc_from_C( E, EEta)
             vmean = exp(vmean);
 
             /* multiply the viscosity with this prefactor */
-            EEta[CPPR][ (i-1)*vpts + jj ] *= vmean;
+            EEta[ (i-1)*vpts + jj ] *= vmean;
 
         } /* end jj loop */
     } /* end el loop */
@@ -1247,7 +1247,7 @@ void strain_rate_2_inv(E,EEDOT,SQRT)
 }
 
 
-static void apply_low_visc_wedge_channel(struct All_variables *E, float **evisc)
+static void apply_low_visc_wedge_channel(struct All_variables *E, float *evisc)
 {
     void parallel_process_termination();
 
@@ -1285,7 +1285,7 @@ static void apply_low_visc_wedge_channel(struct All_variables *E, float **evisc)
     for(i=1 ; i<=E->lmesh.nel ; i++) {
         if (F[i] != 0.0)
                 for(j=1;j<=vpts;j++) {
-                    evisc[CPPR][(i-1)*vpts + j] = F[i];
+                    evisc[(i-1)*vpts + j] = F[i];
             }
     }
 
diff --git a/lib/global_defs.h b/lib/global_defs.h
index 3ed46f7..ac8b2f8 100644
--- a/lib/global_defs.h
+++ b/lib/global_defs.h
@@ -847,7 +847,7 @@ struct All_variables {
     float *Fascmb[NCS],*Fascmb_b[NCS];
 
     float *Vi[NCS],*EVi[NCS];
-    float *VI[MAX_LEVELS][NCS],*EVI[MAX_LEVELS][NCS];
+    float *VI[MAX_LEVELS],*EVI[MAX_LEVELS];
 
 #ifdef CITCOM_ALLOW_ANISOTROPIC_VISC
     float *VI2[MAX_LEVELS][NCS],*EVI2[MAX_LEVELS][NCS];
diff --git a/lib/prototypes.h b/lib/prototypes.h
index 13c6262..19bc5c5 100644
--- a/lib/prototypes.h
+++ b/lib/prototypes.h
@@ -272,10 +272,10 @@ void velo_from_element_d(struct All_variables *, double [4][9], int, int);
 
 void p_to_nodes(struct All_variables *, double *, float **, int);
 
-void visc_from_gint_to_nodes(struct All_variables *, float **, float **, int);
-void visc_from_nodes_to_gint(struct All_variables *, float **, float **, int);
-void visc_from_gint_to_ele(struct All_variables *, float **, float **, int);
-void visc_from_ele_to_gint(struct All_variables *, float **, float **, int);
+void visc_from_gint_to_nodes(struct All_variables *, float *, float *, int);
+void visc_from_nodes_to_gint(struct All_variables *, float *, float *, int);
+void visc_from_gint_to_ele(struct All_variables *, float *, float *, int);
+void visc_from_ele_to_gint(struct All_variables *, float *, float *, int);
 /* Output.c */
 void output_common_input(struct All_variables *);
 void output(struct All_variables *, int);
@@ -519,14 +519,14 @@ int icheck_that_processor_shell(struct All_variables *, int, double);
 void viscosity_system_input(struct All_variables *);
 void viscosity_input(struct All_variables *);
 void allocate_visc_vars(struct All_variables *);
-void get_system_viscosity(struct All_variables *, int, float **, float **);
+void get_system_viscosity(struct All_variables *, int, float *, float *);
 void initial_viscosity(struct All_variables *);
-void visc_from_mat(struct All_variables *, float **);
+void visc_from_mat(struct All_variables *, float *);
 void read_visc_layer_file(struct All_variables *);
-void visc_from_T(struct All_variables *, float **, int);
-void visc_from_S(struct All_variables *, float **, int);
-void visc_from_P(struct All_variables *, float **);
-void visc_from_C(struct All_variables *, float **);
+void visc_from_T(struct All_variables *, float *, int);
+void visc_from_S(struct All_variables *, float *, int);
+void visc_from_P(struct All_variables *, float *);
+void visc_from_C(struct All_variables *, float *);
 void strain_rate_2_inv(struct All_variables *, float *, int);
 double second_invariant_from_3x3(double [3][3]);
 void calc_strain_from_vgm(double [3][3], double [3][3]);



More information about the CIG-COMMITS mailing list