[cig-commits] [commit] rajesh-petsc-schur: Changed the shapes of heating_adi, heating_visc and heating_latent members of the All_variables struct as part of caps_per_proc removal (35f9b1d)
cig_noreply at geodynamics.org
cig_noreply at geodynamics.org
Wed Nov 5 19:11:02 PST 2014
Repository : https://github.com/geodynamics/citcoms
On branch : rajesh-petsc-schur
Link : https://github.com/geodynamics/citcoms/compare/464e1b32299b15819f93efd98d969cddb84dfe51...f97ae655a50bdbd6dac1923a3471ee4dae178fbd
>---------------------------------------------------------------
commit 35f9b1d9d1c1baffcdae9310cbee6de3a2f90814
Author: Rajesh Kommu <rajesh.kommu at gmail.com>
Date: Fri Sep 19 13:18:48 2014 -0700
Changed the shapes of heating_adi, heating_visc and heating_latent members of the All_variables struct as part of caps_per_proc removal
>---------------------------------------------------------------
35f9b1d9d1c1baffcdae9310cbee6de3a2f90814
lib/Advection_diffusion.c | 16 ++++++++--------
lib/Instructions.c | 12 ++++++------
lib/Output.c | 4 ++--
lib/Output_gzdir.c | 4 ++--
lib/global_defs.h | 6 +++---
5 files changed, 21 insertions(+), 21 deletions(-)
diff --git a/lib/Advection_diffusion.c b/lib/Advection_diffusion.c
index c2e3ea6..c27081c 100644
--- a/lib/Advection_diffusion.c
+++ b/lib/Advection_diffusion.c
@@ -570,8 +570,8 @@ static void element_residual(struct All_variables *E, int el,
heating = rho * Q;
else
/* E->heating_latent is actually the inverse of latent heating */
- heating = (rho * Q - E->heating_adi[CPPR][el] + E->heating_visc[CPPR][el])
- * E->heating_latent[CPPR][el];
+ heating = (rho * Q - E->heating_adi[el] + E->heating_visc[el])
+ * E->heating_latent[el];
/* construct residual from this information */
@@ -584,7 +584,7 @@ static void element_residual(struct All_variables *E, int el,
PG->vpt[GNVINDEX(j,i)] * dOmega->vpt[i]
* ((dT[i] + v1[i]*tx1[i] + v2[i]*tx2[i] + v3[i]*tx3[i])*rho*cp
- heating )
- + diff * dOmega->vpt[i] * E->heating_latent[CPPR][el]
+ + diff * dOmega->vpt[i] * E->heating_latent[el]
* (GNx->vpt[GNVXINDEX(0,j,i)]*tx1[i]*rtf[3][i] +
GNx->vpt[GNVXINDEX(1,j,i)]*tx2[i]*sint[i] +
GNx->vpt[GNVXINDEX(2,j,i)]*tx3[i] );
@@ -854,7 +854,7 @@ static void process_latent_heating(struct All_variables *E,
}
-static double total_heating(struct All_variables *E, double **heating)
+static double total_heating(struct All_variables *E, double *heating)
{
int m, e;
double sum, total;
@@ -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[e].area;
+ sum += heating[e] * E->eco[e].area;
/* sum up for all processors */
MPI_Allreduce(&sum, &total, 1, MPI_DOUBLE, MPI_SUM, E->parallel.world);
@@ -879,10 +879,10 @@ static void process_heating(struct All_variables *E, int psc_pass)
if(psc_pass == 0) {
/* visc heating does not change between psc_pass, compute only
* at first psc_pass */
- process_visc_heating(E, E->heating_visc[CPPR]);
+ process_visc_heating(E, E->heating_visc);
}
- process_adi_heating(E, E->heating_adi[CPPR]);
- process_latent_heating(E, E->heating_latent[CPPR], E->heating_adi[CPPR]);
+ process_adi_heating(E, E->heating_adi);
+ process_latent_heating(E, E->heating_latent, E->heating_adi);
/* compute total amount of visc/adi heating over all processors
* only at last psc_pass */
diff --git a/lib/Instructions.c b/lib/Instructions.c
index e47a737..4967d91 100644
--- a/lib/Instructions.c
+++ b/lib/Instructions.c
@@ -975,9 +975,9 @@ void allocate_common_vars(E)
E->mat[CPPR] = (int *) malloc((nel+2)*sizeof(int));
E->VIP[CPPR] = (float *) malloc((nel+2)*sizeof(float));
- E->heating_adi[CPPR] = (double *) malloc((nel+1)*sizeof(double));
- E->heating_visc[CPPR] = (double *) malloc((nel+1)*sizeof(double));
- E->heating_latent[CPPR] = (double *) malloc((nel+1)*sizeof(double));
+ E->heating_adi = (double *) malloc((nel+1)*sizeof(double));
+ E->heating_visc = (double *) malloc((nel+1)*sizeof(double));
+ 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));
@@ -1136,9 +1136,9 @@ void allocate_common_vars(E)
E->mat[CPPR][i]=1;
E->VIP[CPPR][i]=1.0;
- E->heating_adi[CPPR][i] = 0;
- E->heating_visc[CPPR][i] = 0;
- E->heating_latent[CPPR][i] = 1.0;
+ E->heating_adi[i] = 0;
+ E->heating_visc[i] = 0;
+ E->heating_latent[i] = 1.0;
}
for(i=0;i<E->lmesh.npno;i++)
diff --git a/lib/Output.c b/lib/Output.c
index f2e28d6..83f62bc 100644
--- a/lib/Output.c
+++ b/lib/Output.c
@@ -734,8 +734,8 @@ void output_heating(struct All_variables *E, int cycles)
fprintf(fp1,"%3d %7d\n", CPPR, E->lmesh.nel);
for(e=1; e<=E->lmesh.nel; e++)
- fprintf(fp1, "%.4e %.4e %.4e\n", E->heating_adi[CPPR][e],
- E->heating_visc[CPPR][e], E->heating_latent[CPPR][e]);
+ fprintf(fp1, "%.4e %.4e %.4e\n", E->heating_adi[e],
+ E->heating_visc[e], E->heating_latent[e]);
fclose(fp1);
}
diff --git a/lib/Output_gzdir.c b/lib/Output_gzdir.c
index 6fbd0c9..159b506 100644
--- a/lib/Output_gzdir.c
+++ b/lib/Output_gzdir.c
@@ -1160,8 +1160,8 @@ void gzdir_output_heating(struct All_variables *E, int cycles)
gzprintf(fp1,"%3d %7d\n", CPPR, E->lmesh.nel);
for(e=1; e<=E->lmesh.nel; e++)
- gzprintf(fp1, "%.4e %.4e %.4e\n", E->heating_adi[CPPR][e],
- E->heating_visc[CPPR][e], E->heating_latent[CPPR][e]);
+ gzprintf(fp1, "%.4e %.4e %.4e\n", E->heating_adi[e],
+ E->heating_visc[e], E->heating_latent[e]);
gzclose(fp1);
}
diff --git a/lib/global_defs.h b/lib/global_defs.h
index 9d194bf..4ff4237 100644
--- a/lib/global_defs.h
+++ b/lib/global_defs.h
@@ -825,9 +825,9 @@ struct All_variables {
double *BI[MAX_LEVELS],*BPI[MAX_LEVELS];
double *rho;
- double *heating_adi[NCS];
- double *heating_visc[NCS];
- double *heating_latent[NCS];
+ double *heating_adi;
+ double *heating_visc;
+ double *heating_latent;
double *P,*F,*U;
double *T[NCS],*Tdot[NCS],*buoyancy[NCS];
More information about the CIG-COMMITS
mailing list