[cig-commits] [commit] rajesh-petsc-schur: Changed the shapes of anisotropic viscosity related structures as part of caps_per_proc removal (c4c1cf8)
cig_noreply at geodynamics.org
cig_noreply at geodynamics.org
Thu Sep 25 12:11:41 PDT 2014
Repository : https://github.com/geodynamics/citcoms
On branch : rajesh-petsc-schur
Link : https://github.com/geodynamics/citcoms/compare/83e076a2bdf711878e94abba01774dfb324c9dff...c4c1cf8c9c00db42db37ba9de24475c42f027909
>---------------------------------------------------------------
commit c4c1cf8c9c00db42db37ba9de24475c42f027909
Author: Rajesh Kommu <rajesh.kommu at gmail.com>
Date: Thu Sep 25 12:07:50 2014 -0700
Changed the shapes of anisotropic viscosity related structures as part of caps_per_proc removal
>---------------------------------------------------------------
c4c1cf8c9c00db42db37ba9de24475c42f027909
lib/Anisotropic_viscosity.c | 28 ++++++++++++++--------------
lib/Element_calculations.c | 10 +++++-----
lib/Ggrd_handling.c | 14 +++++++-------
lib/Instructions.c | 26 +++++++++++++-------------
lib/Output.c | 2 +-
lib/Output_gzdir.c | 4 ++--
lib/Topo_gravity.c | 10 +++++-----
lib/global_defs.h | 10 +++++-----
8 files changed, 52 insertions(+), 52 deletions(-)
diff --git a/lib/Anisotropic_viscosity.c b/lib/Anisotropic_viscosity.c
index 76db51d..dded4f7 100644
--- a/lib/Anisotropic_viscosity.c
+++ b/lib/Anisotropic_viscosity.c
@@ -295,9 +295,9 @@ void set_anisotropic_viscosity_at_element_level(struct All_variables *E,
for(k=1;k <= nel;k++){
for(l=1;l <= vpts;l++){ /* assign to all integration points */
off = (k-1)*vpts + l;
- E->EVI2[i][CPPR][off] = 0.0;
- E->EVIn1[i][CPPR][off] = 1.0; E->EVIn2[i][CPPR][off] = E->EVIn3[i][CPPR][off] = 0.0;
- E->avmode[i][CPPR][off] = (unsigned char)
+ E->EVI2[i][off] = 0.0;
+ E->EVIn1[i][off] = 1.0; E->EVIn2[i][off] = E->EVIn3[i][off] = 0.0;
+ E->avmode[i][off] = (unsigned char)
E->viscosity.allow_anisotropic_viscosity;
}
}
@@ -326,8 +326,8 @@ void set_anisotropic_viscosity_at_element_level(struct All_variables *E,
n[2] = 2.0*s -1 ; /* z */
for(l=1;l <= vpts;l++){ /* assign to all integration points */
off = (k-1)*vpts + l;
- E->EVI2[i][CPPR][off] = vis2;E->EVIn1[i][CPPR][off] = n[0]; E->EVIn2[i][CPPR][off] = n[1];E->EVIn3[i][CPPR][off] = n[2];
- E->avmode[i][CPPR][off] = (unsigned char)E->viscosity.allow_anisotropic_viscosity;
+ E->EVI2[i][off] = vis2;E->EVIn1[i][off] = n[0]; E->EVIn2[i][off] = n[1];E->EVIn3[i][off] = n[2];
+ E->avmode[i][off] = (unsigned char)E->viscosity.allow_anisotropic_viscosity;
}
}
} /* mg loop */
@@ -441,9 +441,9 @@ void set_anisotropic_viscosity_at_element_level(struct All_variables *E,
n[0]=rout[0];n[1]=rout[1];n[2]=rout[2];
for(p=1;p <= vpts;p++){ /* assign to all integration points */
off = (el-1)*vpts + p;
- E->EVI2[i][CPPR][off] = vis2;
- E->EVIn1[i][CPPR][off] = n[0]; E->EVIn2[i][CPPR][off] = n[1];E->EVIn3[i][CPPR][off] = n[2];
- E->avmode[i][CPPR][off] = CITCOM_ANIVISC_ORTHO_MODE;
+ E->EVI2[i][off] = vis2;
+ E->EVIn1[i][off] = n[0]; E->EVIn2[i][off] = n[1];E->EVIn3[i][off] = n[2];
+ E->avmode[i][off] = CITCOM_ANIVISC_ORTHO_MODE;
}
}
}
@@ -453,7 +453,7 @@ void set_anisotropic_viscosity_at_element_level(struct All_variables *E,
el = j + (l-1) * elz + (k-1)*elxlz;
for(p=1;p <= vpts;p++){ /* assign to all integration points */
off = (el-1)*vpts + p;
- E->EVI2[i][CPPR][off] = 0;E->EVIn1[i][CPPR][off] = 1; E->EVIn2[i][CPPR][off] = 0;E->EVIn3[i][CPPR][off] = 0;E->avmode[i][CPPR][off] = CITCOM_ANIVISC_ORTHO_MODE;
+ E->EVI2[i][off] = 0;E->EVIn1[i][off] = 1; E->EVIn2[i][off] = 0;E->EVIn3[i][off] = 0;E->avmode[i][off] = CITCOM_ANIVISC_ORTHO_MODE;
}
}
}
@@ -703,11 +703,11 @@ void align_director_with_ISA_for_element(struct All_variables *E,
/* assign to director for all vpoints */
for(i=1;i <= vpts;i++){
off = (e-1)*vpts + i;
- E->avmode[lev][CPPR][off] = avmode;
- E->EVI2[lev][CPPR][off] = vis2;
- E->EVIn1[lev][CPPR][off] = n[0];
- E->EVIn2[lev][CPPR][off] = n[1];
- E->EVIn3[lev][CPPR][off] = n[2];
+ E->avmode[lev][off] = avmode;
+ E->EVI2[lev][off] = vis2;
+ E->EVIn1[lev][off] = n[0];
+ E->EVIn2[lev][off] = n[1];
+ E->EVIn3[lev][off] = n[2];
}
} /* in layer */
}
diff --git a/lib/Element_calculations.c b/lib/Element_calculations.c
index fd73220..0bba248 100644
--- a/lib/Element_calculations.c
+++ b/lib/Element_calculations.c
@@ -312,9 +312,9 @@ void get_elt_k(E,el,elt_k,lev,iconv)
if(E->viscosity.allow_anisotropic_viscosity){
/* allow for a possibly anisotropic viscosity */
get_constitutive(D[k],rtf[1][k],rtf[2][k],TRUE,
- E->EVIn1[lev][CPPR][off], E->EVIn2[lev][CPPR][off],
- E->EVIn3[lev][CPPR][off],
- E->EVI2[lev][CPPR][off],E->avmode[lev][CPPR][off],
+ E->EVIn1[lev][off], E->EVIn2[lev][off],
+ E->EVIn3[lev][off],
+ E->EVI2[lev][off],E->avmode[lev][off],
E);
}
#endif
@@ -907,8 +907,8 @@ void get_elt_g(E,el,elt_del,lev)
for(i=1;i <= vpts;i++){ /* get vag const matrix */
off = (el-1)*vpts+i;
get_constitutive(Dtmp,rtf2[1][i],rtf2[2][i],TRUE,
- E->EVIn1[lev][CPPR][off], E->EVIn2[lev][CPPR][off], E->EVIn3[lev][CPPR][off],
- E->EVI2[lev][CPPR][off],E->avmode[lev][CPPR][off],
+ E->EVIn1[lev][off], E->EVIn2[lev][off], E->EVIn3[lev][off],
+ E->EVI2[lev][off],E->avmode[lev][off],
E);
for(j=0;j<6;j++)
for(k=0;k<6;k++)
diff --git a/lib/Ggrd_handling.c b/lib/Ggrd_handling.c
index 2619192..9c74f78 100644
--- a/lib/Ggrd_handling.c
+++ b/lib/Ggrd_handling.c
@@ -1554,9 +1554,9 @@ void ggrd_read_anivisc_from_file(struct All_variables *E, int is_geographic)
for(k=1;k <= nel;k++){
for(l=1;l <= vpts;l++){ /* assign to all integration points */
ind = (k-1)*vpts + l;
- E->EVI2[i][CPPR][ind] = 0.0;
- E->EVIn1[i][CPPR][ind] = 1.0; E->EVIn2[i][CPPR][ind] = E->EVIn3[i][CPPR][ind] = 0.0;
- E->avmode[i][CPPR][ind] = (unsigned char)
+ E->EVI2[i][ind] = 0.0;
+ E->EVIn1[i][ind] = 1.0; E->EVIn2[i][ind] = E->EVIn3[i][ind] = 0.0;
+ E->avmode[i][ind] = (unsigned char)
E->viscosity.allow_anisotropic_viscosity;
}
}
@@ -1698,10 +1698,10 @@ void ggrd_read_anivisc_from_file(struct All_variables *E, int is_geographic)
vis2 = 1.0 - pow(10.0,log_vis);
for(l=1;l <= vpts;l++){ /* assign to all integration points */
ind = (el-1)*vpts + l;
- E->EVI2[E->mesh.gridmax][CPPR][ind] = vis2;
- E->EVIn1[E->mesh.gridmax][CPPR][ind] = cvec[0];
- E->EVIn2[E->mesh.gridmax][CPPR][ind] = cvec[1];
- E->EVIn3[E->mesh.gridmax][CPPR][ind] = cvec[2];
+ E->EVI2[E->mesh.gridmax][ind] = vis2;
+ E->EVIn1[E->mesh.gridmax][ind] = cvec[0];
+ E->EVIn2[E->mesh.gridmax][ind] = cvec[1];
+ E->EVIn3[E->mesh.gridmax][ind] = cvec[2];
}
}
}
diff --git a/lib/Instructions.c b/lib/Instructions.c
index ab85a14..17b0690 100644
--- a/lib/Instructions.c
+++ b/lib/Instructions.c
@@ -1102,19 +1102,19 @@ void allocate_common_vars(E)
for(i=E->mesh.gridmin;i<=E->mesh.gridmax;i++) {
nel = E->lmesh.NEL[i];
nno = E->lmesh.NNO[i];
- E->EVI2[i][CPPR] = (float *) malloc((nel+1)*vpoints[E->mesh.nsd]*sizeof(float));
- E->avmode[i][CPPR] = (unsigned char *) malloc((nel+1)*vpoints[E->mesh.nsd]*sizeof(unsigned char));
- E->EVIn1[i][CPPR] = (float *) malloc((nel+1)*vpoints[E->mesh.nsd]*sizeof(float));
- E->EVIn2[i][CPPR] = (float *) malloc((nel+1)*vpoints[E->mesh.nsd]*sizeof(float));
- E->EVIn3[i][CPPR] = (float *) malloc((nel+1)*vpoints[E->mesh.nsd]*sizeof(float));
-
- E->VI2[i][CPPR] = (float *) malloc((nno+1)*sizeof(float));
- E->VIn1[i][CPPR] = (float *) malloc((nno+1)*sizeof(float));
- E->VIn2[i][CPPR] = (float *) malloc((nno+1)*sizeof(float));
- E->VIn3[i][CPPR] = (float *) malloc((nno+1)*sizeof(float));
- if((!(E->EVI2[i][CPPR]))||(!(E->VI2[i][CPPR]))||
- (!(E->EVIn1[i][CPPR]))||(!(E->EVIn2[i][CPPR]))||(!(E->EVIn3[i][CPPR]))||
- (!(E->VIn1[i][CPPR]))||(!(E->VIn2[i][CPPR]))||(!(E->VIn3[i][CPPR]))){
+ E->EVI2[i] = (float *) malloc((nel+1)*vpoints[E->mesh.nsd]*sizeof(float));
+ E->avmode[i] = (unsigned char *) malloc((nel+1)*vpoints[E->mesh.nsd]*sizeof(unsigned char));
+ E->EVIn1[i] = (float *) malloc((nel+1)*vpoints[E->mesh.nsd]*sizeof(float));
+ E->EVIn2[i] = (float *) malloc((nel+1)*vpoints[E->mesh.nsd]*sizeof(float));
+ E->EVIn3[i] = (float *) malloc((nel+1)*vpoints[E->mesh.nsd]*sizeof(float));
+
+ E->VI2[i] = (float *) malloc((nno+1)*sizeof(float));
+ E->VIn1[i] = (float *) malloc((nno+1)*sizeof(float));
+ E->VIn2[i] = (float *) malloc((nno+1)*sizeof(float));
+ E->VIn3[i] = (float *) malloc((nno+1)*sizeof(float));
+ if((!(E->EVI2[i]))||(!(E->VI2[i]))||
+ (!(E->EVIn1[i]))||(!(E->EVIn2[i]))||(!(E->EVIn3[i]))||
+ (!(E->VIn1[i]))||(!(E->VIn2[i]))||(!(E->VIn3[i]))){
fprintf(stderr, "Error: Cannot allocate anisotropic visc memory, rank=%i\n",
E->parallel.me);
parallel_process_termination();
diff --git a/lib/Output.c b/lib/Output.c
index ada02d4..c8661b7 100644
--- a/lib/Output.c
+++ b/lib/Output.c
@@ -330,7 +330,7 @@ void output_avisc(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 %.4e %.4e %.4e\n",
- E->VI2[lev][CPPR][i],E->VIn1[lev][CPPR][i],E->VIn2[lev][CPPR][i],E->VIn3[lev][CPPR][i]);
+ E->VI2[lev][i],E->VIn1[lev][i],E->VIn2[lev][i],E->VIn3[lev][i]);
fclose(fp1);
}
}
diff --git a/lib/Output_gzdir.c b/lib/Output_gzdir.c
index 464cf9c..daec336 100644
--- a/lib/Output_gzdir.c
+++ b/lib/Output_gzdir.c
@@ -761,7 +761,7 @@ void gzdir_output_avisc(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 %.4e %.4e %.4e\n",E->VI2[lev][CPPR][i],E->VIn1[lev][CPPR][i],E->VIn2[lev][CPPR][i],E->VIn3[lev][CPPR][i]);
+ gzprintf(gz1,"%.4e %.4e %.4e %.4e\n",E->VI2[lev][i],E->VIn1[lev][i],E->VIn2[lev][i],E->VIn3[lev][i]);
gzclose(gz1);
}else{
@@ -780,7 +780,7 @@ void gzdir_output_avisc(struct All_variables *E, int cycles)
fp1 = output_open(output_file,"a");
}
for(i=1;i<=E->lmesh.nno;i++){
- ftmp = E->VI2[lev][CPPR][i];
+ ftmp = E->VI2[lev][i];
if(be_write_float_to_file(&ftmp,1,fp1)!=1)
BE_WERROR;
}
diff --git a/lib/Topo_gravity.c b/lib/Topo_gravity.c
index 4d936b2..f3d32f8 100644
--- a/lib/Topo_gravity.c
+++ b/lib/Topo_gravity.c
@@ -316,11 +316,11 @@ void compute_nodal_stress(struct All_variables *E,
*/
get_constitutive(D,rtf[1][i],rtf[2][i],TRUE,
- E->EVIn1[E->mesh.levmax][CPPR][l1],
- E->EVIn2[E->mesh.levmax][CPPR][l1],
- E->EVIn3[E->mesh.levmax][CPPR][l1],
- E->EVI2[E->mesh.levmax][CPPR][l1],
- E->avmode[E->mesh.levmax][CPPR][l1],
+ E->EVIn1[E->mesh.levmax][l1],
+ E->EVIn2[E->mesh.levmax][l1],
+ E->EVIn3[E->mesh.levmax][l1],
+ E->EVI2[E->mesh.levmax][l1],
+ E->avmode[E->mesh.levmax][l1],
E);
/* deviatoric stress, pressure will be added later */
diff --git a/lib/global_defs.h b/lib/global_defs.h
index d2d0ace..992814d 100644
--- a/lib/global_defs.h
+++ b/lib/global_defs.h
@@ -850,11 +850,11 @@ struct All_variables {
float *VI[MAX_LEVELS],*EVI[MAX_LEVELS];
#ifdef CITCOM_ALLOW_ANISOTROPIC_VISC
- float *VI2[MAX_LEVELS][NCS],*EVI2[MAX_LEVELS][NCS];
- float *VIn1[MAX_LEVELS][NCS],*EVIn1[MAX_LEVELS][NCS];
- float *VIn2[MAX_LEVELS][NCS],*EVIn2[MAX_LEVELS][NCS];
- float *VIn3[MAX_LEVELS][NCS],*EVIn3[MAX_LEVELS][NCS];
- unsigned char *avmode[MAX_LEVELS][NCS];
+ float *VI2[MAX_LEVELS],*EVI2[MAX_LEVELS];
+ float *VIn1[MAX_LEVELS],*EVIn1[MAX_LEVELS];
+ float *VIn2[MAX_LEVELS],*EVIn2[MAX_LEVELS];
+ float *VIn3[MAX_LEVELS],*EVIn3[MAX_LEVELS];
+ unsigned char *avmode[MAX_LEVELS];
#endif
More information about the CIG-COMMITS
mailing list