Commit bc9adffc authored by Florian Wittkamp's avatar Florian Wittkamp
Browse files

Renaming a few global variables

INVMAT - > FORWARD_ONLY
INVMAT1 - > PARAMETERIZATION
parent 1c13799e
......@@ -43,7 +43,7 @@ void exchange_par(void){
extern char JACOBIAN[STRING_SIZE], DATA_DIR[STRING_SIZE], INV_MODELFILE[STRING_SIZE], FREQ_FILE[STRING_SIZE];
extern int RUN_MULTIPLE_SHOTS, TAPERLENGTH, INVTYPE;
extern int NPROC, NPROCX, NPROCY, MYID, IDX, IDY;
extern int GRADT1, GRADT2, GRADT3, GRADT4, ITERMAX, INVMAT1, INVMAT, ADJOINT_TYPE;
extern int GRADT1, GRADT2, GRADT3, GRADT4, ITERMAX, PARAMETERIZATION, FORWARD_ONLY, ADJOINT_TYPE;
extern int GRAD_METHOD;
extern float TSHIFT_back;
extern int MODEL_FILTER, FILT_SIZE;
......@@ -252,9 +252,9 @@ void exchange_par(void){
idum[38] = GRADT3;
idum[39] = GRADT4;
idum[40] = ITERMAX;
idum[41] = INVMAT1;
idum[41] = PARAMETERIZATION;
idum[42] = FW;
idum[43] = INVMAT;
idum[43] = FORWARD_ONLY;
idum[44] = ADJOINT_TYPE;
idum[45] = TESTSHOT_START;
......@@ -527,9 +527,9 @@ void exchange_par(void){
GRADT3 = idum[38];
GRADT4 = idum[39];
ITERMAX = idum[40];
INVMAT1 = idum[41];
PARAMETERIZATION = idum[41];
FW = idum[42];
INVMAT = idum[43];
FORWARD_ONLY = idum[43];
ADJOINT_TYPE = idum[44];
TESTSHOT_START = idum[45];
......
......@@ -65,7 +65,7 @@ void calc_mat_change(float ** waveconv, float ** waveconv_rho, float ** waveco
float ** unp1, int iter, int epstest, int calcneweps, float eps_scale_vp, float eps_scale_vs);
void calc_mat_change_test(float ** waveconv, float ** waveconv_rho, float ** waveconv_u, float ** rho, float ** rhonp1, float ** pi, float ** pinp1, float ** u, float ** unp1, int iter,
int epstest, int INVMAT, float eps_scale, int itest, int nfstart, float ** u_start, float ** pi_start, float ** rho_start,int wavetype_start,float **bfgsmod,int bfgsnum,int bfgspar,float Vs_avg,float Vp_avg,float rho_avg,int LBFGS_iter_start);
int epstest, int FORWARD_ONLY, float eps_scale, int itest, int nfstart, float ** u_start, float ** pi_start, float ** rho_start,int wavetype_start,float **bfgsmod,int bfgsnum,int bfgspar,float Vs_avg,float Vp_avg,float rho_avg,int LBFGS_iter_start);
double calc_res(float **sectiondata, float **section, float **sectiondiff, float **sectiondiffold, int ntr, int ns, int LNORM, float L2, int itest, int sws, int swstestshot, int ntr_glob, int **recpos_loc, int nsrc_glob, int ishot, int iter);
......
......@@ -42,7 +42,7 @@ int WORKFLOW_STAGE;
int TAPER, TAPERLENGTH, INVTYPE;
int GRADT1,GRADT2,GRADT3,GRADT4;
int ITERMAX, REC1, REC2, INVMAT1, INVMAT, ADJOINT_TYPE;
int ITERMAX, REC1, REC2, PARAMETERIZATION, FORWARD_ONLY, ADJOINT_TYPE;
int GRAD_METHOD;
float TSHIFT_back;
int MODEL_FILTER, FILT_SIZE;
......
......@@ -23,7 +23,7 @@ void prepare_update_s(float *etajm, float *etaip, float *peta, float **fipjp, fl
float **ptausipjp, float **f, float **g, float *bip, float *bjm,
float *cip, float *cjm, float ***dip, float ***d, float ***e) {
extern int NX, NY, L, INVMAT1, MYID;
extern int NX, NY, L, PARAMETERIZATION, MYID;
extern float DT, *FL;
int i, j, l;
extern char MFILE[STRING_SIZE];
......@@ -57,7 +57,7 @@ void prepare_update_s(float *etajm, float *etaip, float *peta, float **fipjp, fl
etaip[l] = peta[l];
}
if (INVMAT1==1){
if (PARAMETERIZATION==1){
for (j=1;j<=NY;j++){
for (i=1;i<=NX;i++){
mu=(pu[j][i]*pu[j][i]*prho[j][i])/(1.0+sumu*ptaus[j][i]);
......@@ -80,7 +80,7 @@ void prepare_update_s(float *etajm, float *etaip, float *peta, float **fipjp, fl
}
}
if (INVMAT1==3){
if (PARAMETERIZATION==3){
for (j=1;j<=NY;j++){
for (i=1;i<=NX;i++){
mu=pu[j][i]/(1.0+sumu*ptaus[j][i]);
......
......@@ -41,7 +41,7 @@ void read_par_json(FILE *fp, char *fileinp){
extern char SEIS_FILE[STRING_SIZE];
extern char JACOBIAN[STRING_SIZE],DATA_DIR[STRING_SIZE],FREQ_FILE[STRING_SIZE];
extern int NPROCX, NPROCY, MYID, IDX, IDY;
extern int GRADT1, GRADT2, GRADT3, GRADT4, ITERMAX, INVMAT1, INVMAT, ADJOINT_TYPE;
extern int GRADT1, GRADT2, GRADT3, GRADT4, ITERMAX, PARAMETERIZATION, FORWARD_ONLY, ADJOINT_TYPE;
extern int GRAD_METHOD;
extern float TSHIFT_back;
extern int FILT_SIZE, MODEL_FILTER;
......@@ -431,17 +431,17 @@ void read_par_json(FILE *fp, char *fileinp){
section inversion parameters
=================================*/
if (get_int_from_objectlist("INVMAT1",number_readobjects,&INVMAT1,varname_list, value_list))
err("Variable INVMAT1 could not be retrieved from the json input file!");
if (get_int_from_objectlist("PARAMETERIZATION",number_readobjects,&PARAMETERIZATION,varname_list, value_list))
err("Variable PARAMETERIZATION could not be retrieved from the json input file!");
else
if(ACOUSTIC){
INVMAT1=1;
fprintf(fp,"For acoustic modelling only INVMAT1=%d possible.\n",INVMAT1);}
PARAMETERIZATION=1;
fprintf(fp,"For acoustic modelling only PARAMETERIZATION=%d possible.\n",PARAMETERIZATION);}
if (get_int_from_objectlist("INVMAT",number_readobjects,&INVMAT,varname_list, value_list))
err("Variable INVMAT could not be retrieved from the json input file!");
if (get_int_from_objectlist("FORWARD_ONLY",number_readobjects,&FORWARD_ONLY,varname_list, value_list))
err("Variable FORWARD_ONLY could not be retrieved from the json input file!");
else {
if (INVMAT==0) { /* FWI is calculated */
if (FORWARD_ONLY==0) { /* FWI is calculated */
/* General inversion parameters */
if (get_int_from_objectlist("ITERMAX",number_readobjects,&ITERMAX,varname_list, value_list))
......@@ -862,9 +862,10 @@ void read_par_json(FILE *fp, char *fileinp){
err("Variable GAMMA could not be retrieved from the json input file!");
}
}
} /* end if (INVMAT==0) */
} /* end if (FORWARD_ONLY==0) */
else {
if (INVMAT==10){ /* only forward modeling is applied */
if (FORWARD_ONLY>0){ /* only forward modeling is applied */
FORWARD_ONLY=1;
ITERMAX=1;
strcpy(INV_MODELFILE,MFILE);
DTINV=1;
......
......@@ -32,7 +32,7 @@ void readmod(float ** rho, float ** pi, float ** u, float ** taus, float **
extern float DT, *FL, TAU;
extern int L,WAVETYPE, VERBOSE;
extern int NX, NY, NXG, NYG, POS[3], MYID, INVMAT1;
extern int NX, NY, NXG, NYG, POS[3], MYID, PARAMETERIZATION;
extern char MFILE[STRING_SIZE];
extern FILE *FP;
......@@ -55,7 +55,7 @@ void readmod(float ** rho, float ** pi, float ** u, float ** taus, float **
/* read density and seismic velocities */
/* ----------------------------------- */
if(INVMAT1==1){
if(PARAMETERIZATION==1){
if(WAVETYPE==1||WAVETYPE==3){
fprintf(FP,"\t Vp:\n\t %s.vp\n\n",MFILE);
......@@ -101,7 +101,7 @@ void readmod(float ** rho, float ** pi, float ** u, float ** taus, float **
/* read density and Lame parameters */
/* ----------------------------------- */
if(INVMAT1==3){
if(PARAMETERIZATION==3){
fprintf(FP,"\t Lame parameter lambda:\n\t %s.lam\n\n",MFILE);
sprintf(filename,"%s.lam",MFILE);
fp_vp=fopen(filename,"r");
......@@ -194,26 +194,26 @@ void readmod(float ** rho, float ** pi, float ** u, float ** taus, float **
/* each PE writes his model to disk */
if(WAVETYPE==1||WAVETYPE==3){
if(INVMAT1==1) sprintf(filename,"%s.out.vp",MFILE);
if(INVMAT1==3) sprintf(filename,"%s.out.pi",MFILE);
if(PARAMETERIZATION==1) sprintf(filename,"%s.out.vp",MFILE);
if(PARAMETERIZATION==3) sprintf(filename,"%s.out.pi",MFILE);
writemod(filename,pi,3);
MPI_Barrier(MPI_COMM_WORLD);
if (MYID==0) mergemod(filename,3);
MPI_Barrier(MPI_COMM_WORLD);
if(INVMAT1==1) sprintf(filename,"%s.out.vp.%i.%i",MFILE,POS[1],POS[2]);
if(INVMAT1==3) sprintf(filename,"%s.out.pi.%i.%i",MFILE,POS[1],POS[2]);
if(PARAMETERIZATION==1) sprintf(filename,"%s.out.vp.%i.%i",MFILE,POS[1],POS[2]);
if(PARAMETERIZATION==3) sprintf(filename,"%s.out.pi.%i.%i",MFILE,POS[1],POS[2]);
remove(filename);
}
if(INVMAT1==1) sprintf(filename,"%s.out.vs",MFILE);
if(INVMAT1==3) sprintf(filename,"%s.out.mu",MFILE);
if(PARAMETERIZATION==1) sprintf(filename,"%s.out.vs",MFILE);
if(PARAMETERIZATION==3) sprintf(filename,"%s.out.mu",MFILE);
writemod(filename,u,3);
MPI_Barrier(MPI_COMM_WORLD);
if (MYID==0) mergemod(filename,3);
MPI_Barrier(MPI_COMM_WORLD);
if(INVMAT1==1) sprintf(filename,"%s.out.vs.%i.%i",MFILE,POS[1],POS[2]);
if(INVMAT1==3) sprintf(filename,"%s.out.mu.%i.%i",MFILE,POS[1],POS[2]);
if(PARAMETERIZATION==1) sprintf(filename,"%s.out.vs.%i.%i",MFILE,POS[1],POS[2]);
if(PARAMETERIZATION==3) sprintf(filename,"%s.out.mu.%i.%i",MFILE,POS[1],POS[2]);
remove(filename);
......
......@@ -31,7 +31,7 @@
void readmod_acoustic(float ** rho, float ** pi){
extern int NX, NY, NXG, NYG, POS[3], MYID, INVMAT1;
extern int NX, NY, NXG, NYG, POS[3], MYID, PARAMETERIZATION;
extern char MFILE[STRING_SIZE];
extern FILE *FP;
......@@ -47,7 +47,7 @@ void readmod_acoustic(float ** rho, float ** pi){
/* read density and seismic velocities */
/* ----------------------------------- */
if(INVMAT1==1){
if(PARAMETERIZATION==1){
fprintf(FP,"\t Vp:\n\t %s.vp\n\n",MFILE);
sprintf(filename,"%s.vp",MFILE);
fp_vp=fopen(filename,"r");
......
......@@ -31,7 +31,7 @@
void readmod_elastic(float ** rho, float ** pi, float ** u){
extern int NX, NY, NXG, NYG, POS[3], MYID, INVMAT1,WAVETYPE;
extern int NX, NY, NXG, NYG, POS[3], MYID, PARAMETERIZATION,WAVETYPE;
extern char MFILE[STRING_SIZE];
extern FILE *FP;
......@@ -49,7 +49,7 @@ void readmod_elastic(float ** rho, float ** pi, float ** u){
/* read density and seismic velocities */
/* ----------------------------------- */
if(INVMAT1==1){
if(PARAMETERIZATION==1){
if(WAVETYPE==1||WAVETYPE==3){
fprintf(FP,"\t Vp:\n\t %s.vp\n\n",MFILE);
......@@ -74,7 +74,7 @@ void readmod_elastic(float ** rho, float ** pi, float ** u){
/* read density and Lame parameters */
/* ----------------------------------- */
if(INVMAT1==3){
if(PARAMETERIZATION==3){
fprintf(FP,"\t Lame parameter lambda:\n\t %s.lam\n\n",MFILE);
sprintf(filename,"%s.lam",MFILE);
fp_vp=fopen(filename,"r");
......@@ -133,26 +133,26 @@ void readmod_elastic(float ** rho, float ** pi, float ** u){
/* each PE writes his model to disk */
if(WAVETYPE==1||WAVETYPE==3){
if(INVMAT1==1) sprintf(filename,"%s.out.vp",MFILE);
if(INVMAT1==3) sprintf(filename,"%s.out.pi",MFILE);
if(PARAMETERIZATION==1) sprintf(filename,"%s.out.vp",MFILE);
if(PARAMETERIZATION==3) sprintf(filename,"%s.out.pi",MFILE);
writemod(filename,pi,3);
MPI_Barrier(MPI_COMM_WORLD);
if (MYID==0) mergemod(filename,3);
MPI_Barrier(MPI_COMM_WORLD);
if(INVMAT1==1) sprintf(filename,"%s.out.vp.%i.%i",MFILE,POS[1],POS[2]);
if(INVMAT1==3) sprintf(filename,"%s.out.pi.%i.%i",MFILE,POS[1],POS[2]);
if(PARAMETERIZATION==1) sprintf(filename,"%s.out.vp.%i.%i",MFILE,POS[1],POS[2]);
if(PARAMETERIZATION==3) sprintf(filename,"%s.out.pi.%i.%i",MFILE,POS[1],POS[2]);
remove(filename);
}
if(INVMAT1==1) sprintf(filename,"%s.out.vs",MFILE);
if(INVMAT1==3) sprintf(filename,"%s.out.mu",MFILE);
if(PARAMETERIZATION==1) sprintf(filename,"%s.out.vs",MFILE);
if(PARAMETERIZATION==3) sprintf(filename,"%s.out.mu",MFILE);
writemod(filename,u,3);
MPI_Barrier(MPI_COMM_WORLD);
if (MYID==0) mergemod(filename,3);
MPI_Barrier(MPI_COMM_WORLD);
if(INVMAT1==1) sprintf(filename,"%s.out.vs.%i.%i",MFILE,POS[1],POS[2]);
if(INVMAT1==3) sprintf(filename,"%s.out.mu.%i.%i",MFILE,POS[1],POS[2]);
if(PARAMETERIZATION==1) sprintf(filename,"%s.out.vs.%i.%i",MFILE,POS[1],POS[2]);
if(PARAMETERIZATION==3) sprintf(filename,"%s.out.mu.%i.%i",MFILE,POS[1],POS[2]);
remove(filename);
......
......@@ -31,7 +31,7 @@ void saveseis_glob(FILE *fp, float **sectionvx, float **sectionvy,float **sectio
* 3== filtered measured data
*/
extern int SEISMO, SEIS_FORMAT, RUN_MULTIPLE_SHOTS, WAVETYPE, VERBOSE,INVMAT;
extern int SEISMO, SEIS_FORMAT, RUN_MULTIPLE_SHOTS, WAVETYPE, VERBOSE,FORWARD_ONLY;
extern char SEIS_FILE[STRING_SIZE];
char vxf[STRING_SIZE], vyf[STRING_SIZE],vzf[STRING_SIZE], curlf[STRING_SIZE], divf[STRING_SIZE], pf[STRING_SIZE];
......@@ -76,7 +76,7 @@ void saveseis_glob(FILE *fp, float **sectionvx, float **sectionvy,float **sectio
break;
}
if(INVMAT==10){
if(FORWARD_ONLY==1){
sprintf(vxf,"%s_vx.su.shot%d",SEIS_FILE,ishot);
sprintf(vyf,"%s_vy.su.shot%d",SEIS_FILE,ishot);
if(WAVETYPE==2 || WAVETYPE==3) {
......
......@@ -37,7 +37,7 @@ void surface_PML(int ndepth, float ** vx, float ** vy, float ** sxx, float ** sy
float dh24, dthalbe;
float *pts, ws, sumu, sumpi, mu, pi;
extern float DT, DH, *FL;
extern int NX, INVMAT1, L;
extern int NX, PARAMETERIZATION, L;
extern int FW, BOUNDARY;
extern int NPROCX, NPROCY, POS[3], MYID;
extern int FDORDER,WAVETYPE;
......@@ -125,11 +125,11 @@ void surface_PML(int ndepth, float ** vx, float ** vy, float ** sxx, float ** sy
vxx = vxx / K_x[h1] + psi_vxx[j][h1];
}
if (INVMAT1==1){
if (PARAMETERIZATION==1){
mu=(pu[j][i]*pu[j][i]*prho[j][i])/(1.0+sumu*ptaus[j][i]);
pi=(ppi[j][i]*ppi[j][i]*prho[j][i])/(1.0+sumpi*ptaup[j][i]);
}
if (INVMAT1==3){
if (PARAMETERIZATION==3){
mu=pu[j][i]/(1.0+sumu*ptaus[j][i]);
pi=(ppi[j][i]+2*pu[j][i])/(1.0+sumpi*ptaup[j][i]);
}
......
......@@ -34,7 +34,7 @@ void surface_elastic_PML(int ndepth, float ** vx, float ** vy, float ** sxx, flo
float vxx, vyy;
float dh24, dthalbe;
extern float DT, DH;
extern int NX, INVMAT1;
extern int NX, PARAMETERIZATION;
extern int FW, BOUNDARY;
extern int NPROCX, NPROCY, POS[3], MYID;
extern int FDORDER, WAVETYPE;
......@@ -92,11 +92,11 @@ void surface_elastic_PML(int ndepth, float ** vx, float ** vy, float ** sxx, flo
}
if(INVMAT1==3){
if(PARAMETERIZATION==3){
fjm=u[j][i]*2.0;
g=pi[j][i];}
if(INVMAT1==1){
if(PARAMETERIZATION==1){
fjm=rho[j][i] * u[j][i] * u[j][i] * 2.0;
g=rho[j][i] * ((pi[j][i] * pi[j][i]) - 2 * u[j][i] * u[j][i]);}
......
......@@ -35,7 +35,7 @@ void update_p_PML(int nx1, int nx2, int ny1, int ny2, float ** vx, float ** vy
float vxx, vyy;
float dhi;
extern float DT, DH;
extern int MYID, FDORDER, INVMAT1, FW;
extern int MYID, FDORDER, PARAMETERIZATION, FW;
extern int FREE_SURF, BOUNDARY;
extern int NPROCX, NPROCY, POS[3];
extern FILE *FP;
......@@ -94,7 +94,7 @@ void update_p_PML(int nx1, int nx2, int ny1, int ny2, float ** vx, float ** vy
}
/* lambda - mu relationship*/
if (INVMAT1==1){
if (PARAMETERIZATION==1){
g = rho[j][i] * (pi[j][i] * pi[j][i]);
}
......@@ -147,7 +147,7 @@ void update_p_PML(int nx1, int nx2, int ny1, int ny2, float ** vx, float ** vy
vyy = vyy / K_y[h1] + psi_vyy[h1][i];
}
if (INVMAT1==1){
if (PARAMETERIZATION==1){
g = rho[j][i] * (pi[j][i] * pi[j][i]);}
sp[j][i] += g*(vxx+vyy);
......@@ -202,7 +202,7 @@ void update_p_PML(int nx1, int nx2, int ny1, int ny2, float ** vx, float ** vy
vyy = vyy / K_y[h1] + psi_vyy[h1][i];
}
if (INVMAT1==1){
if (PARAMETERIZATION==1){
g = rho[j][i] * (pi[j][i] * pi[j][i]);}
sp[j][i] += g*(vxx+vyy);
......@@ -260,7 +260,7 @@ void update_p_PML(int nx1, int nx2, int ny1, int ny2, float ** vx, float ** vy
vyy = vyy / K_y[h1] + psi_vyy[h1][i];
}
if (INVMAT1==1){
if (PARAMETERIZATION==1){
g = rho[j][i] * (pi[j][i] * pi[j][i]);}
sp[j][i] += g*(vxx+vyy);
......
......@@ -39,7 +39,7 @@ void update_s_elastic_PML(int nx1, int nx2, int ny1, int ny2,
float vxx, vyy, vxy, vyx;
float dhi;
extern float DT, DH;
extern int MYID, FDORDER, INVMAT1, FW;
extern int MYID, FDORDER, PARAMETERIZATION, FW;
extern int FREE_SURF, BOUNDARY;
extern int NPROCX, NPROCY, POS[3];
extern FILE *FP;
......@@ -130,11 +130,11 @@ void update_s_elastic_PML(int nx1, int nx2, int ny1, int ny2,
fipjp=uipjp[j][i];
/* lambda - mu relationship*/
if (INVMAT1==3){
if (PARAMETERIZATION==3){
f = u[j][i];
g = pi[j][i];}
if (INVMAT1==1){
if (PARAMETERIZATION==1){
f = rho[j][i] * u[j][i] * u[j][i];
g = rho[j][i] * ((pi[j][i] * pi[j][i]) - 2 * u[j][i] * u[j][i]);}
......@@ -222,11 +222,11 @@ void update_s_elastic_PML(int nx1, int nx2, int ny1, int ny2,
fipjp=uipjp[j][i];
/* lambda - mu relationship*/
if (INVMAT1==3){
if (PARAMETERIZATION==3){
f = u[j][i];
g = pi[j][i];}
if (INVMAT1==1){
if (PARAMETERIZATION==1){
f = rho[j][i] * u[j][i] * u[j][i];
g = rho[j][i] * ((pi[j][i] * pi[j][i]) - 2 * u[j][i] * u[j][i]);}
......@@ -318,11 +318,11 @@ void update_s_elastic_PML(int nx1, int nx2, int ny1, int ny2,
fipjp=uipjp[j][i];
/* lambda - mu relationship*/
if (INVMAT1==3){
if (PARAMETERIZATION==3){
f = u[j][i];
g = pi[j][i];}
if (INVMAT1==1){
if (PARAMETERIZATION==1){
f = rho[j][i] * u[j][i] * u[j][i];
g = rho[j][i] * ((pi[j][i] * pi[j][i]) - 2 * u[j][i] * u[j][i]);}
......@@ -420,11 +420,11 @@ void update_s_elastic_PML(int nx1, int nx2, int ny1, int ny2,
fipjp=uipjp[j][i];
/* lambda - mu relationship*/
if (INVMAT1==3){
if (PARAMETERIZATION==3){
f = u[j][i];
g = pi[j][i];}
if (INVMAT1==1){
if (PARAMETERIZATION==1){
f = rho[j][i] * u[j][i] * u[j][i];
g = rho[j][i] * ((pi[j][i] * pi[j][i]) - 2 * u[j][i] * u[j][i]);}
......
......@@ -37,7 +37,7 @@ void update_s_elastic_PML_SH(int nx1, int nx2, int ny1, int ny2, float ** vz, f
float dhi;
extern float DT, DH;
extern int MYID, FDORDER, FW, L,INVMAT1;
extern int MYID, FDORDER, FW, L,PARAMETERIZATION;
extern int FREE_SURF, BOUNDARY;
extern int NPROCX, NPROCY, POS[3];
extern FILE *FP;
......@@ -97,8 +97,8 @@ void update_s_elastic_PML_SH(int nx1, int nx2, int ny1, int ny2, float ** vz, f
fipjp=uipjp[j][i];
/* lambda - mu relationship*/
if (INVMAT1==3) f = u[j][i];
if (INVMAT1==1) f = rho[j][i] * u[j][i] * u[j][i];
if (PARAMETERIZATION==3) f = u[j][i];
if (PARAMETERIZATION==1) f = rho[j][i] * u[j][i] * u[j][i];
/* updating components of the stress tensor, partially */
sxz[j][i]+=(fipjp*vzx);
......@@ -153,8 +153,8 @@ void update_s_elastic_PML_SH(int nx1, int nx2, int ny1, int ny2, float ** vz, f
fipjp=uipjp[j][i];
/* lambda - mu relationship*/
if (INVMAT1==3) f = u[j][i];
if (INVMAT1==1) f = rho[j][i] * u[j][i] * u[j][i];
if (PARAMETERIZATION==3) f = u[j][i];
if (PARAMETERIZATION==1) f = rho[j][i] * u[j][i] * u[j][i];
/* updating components of the stress tensor, partially */
sxz[j][i]+=(fipjp*vzx);
......@@ -210,8 +210,8 @@ void update_s_elastic_PML_SH(int nx1, int nx2, int ny1, int ny2, float ** vz, f
fipjp=uipjp[j][i];
/* lambda - mu relationship*/
if (INVMAT1==3) f = u[j][i];
if (INVMAT1==1) f = rho[j][i] * u[j][i] * u[j][i];
if (PARAMETERIZATION==3) f = u[j][i];
if (PARAMETERIZATION==1) f = rho[j][i] * u[j][i] * u[j][i];
/* updating components of the stress tensor, partially */
sxz[j][i]+=(fipjp*vzx);
......@@ -269,8 +269,8 @@ void update_s_elastic_PML_SH(int nx1, int nx2, int ny1, int ny2, float ** vz, f
fipjp=uipjp[j][i];
/* lambda - mu relationship*/
if (INVMAT1==3) f = u[j][i];
if (INVMAT1==1) f = rho[j][i] * u[j][i] * u[j][i];
if (PARAMETERIZATION==3) f = u[j][i];
if (PARAMETERIZATION==1) f = rho[j][i] * u[j][i] * u[j][i];
/* updating components of the stress tensor, partially */
sxz[j][i]+=(fipjp*vzx);
......@@ -330,8 +330,8 @@ void update_s_elastic_PML_SH(int nx1, int nx2, int ny1, int ny2, float ** vz, f
fipjp=uipjp[j][i];
/* lambda - mu relationship*/
if (INVMAT1==3) f = u[j][i];
if (INVMAT1==1) f = rho[j][i] * u[j][i] * u[j][i];
if (PARAMETERIZATION==3) f = u[j][i];
if (PARAMETERIZATION==1) f = rho[j][i] * u[j][i] * u[j][i];
/* updating components of the stress tensor, partially */
sxz[j][i]+=(fipjp*vzx);
......@@ -393,8 +393,8 @@ void update_s_elastic_PML_SH(int nx1, int nx2, int ny1, int ny2, float ** vz, f
fipjp=uipjp[j][i];
/* lambda - mu relationship*/
if (INVMAT1==3) f = u[j][i];
if (INVMAT1==1) f = rho[j][i] * u[j][i] * u[j][i];
if (PARAMETERIZATION==3) f = u[j][i];
if (PARAMETERIZATION==1) f = rho[j][i] * u[j][i] * u[j][i];
/* updating components of the stress tensor, partially */
sxz[j][i]+=(fipjp*vzx);
......
......@@ -36,7 +36,7 @@ void update_s_elastic_hc(int nx1, int nx2, int ny1, int ny2,
float vxx, vyy, vxy, vyx;
float dhi;
extern float DT, DH;
extern int MYID, FDORDER, INVMAT1;
extern int MYID, FDORDER, PARAMETERIZATION;
extern FILE *FP;
double time1, time2;
......@@ -185,11 +185,11 @@ void update_s_elastic_hc(int nx1, int nx2, int ny1, int ny2,
fipjp=uipjp[j][i];
/* lambda - mu relationship*/
if (INVMAT1==3){
if (PARAMETERIZATION==3){
f=u[j][i];
g = pi[j][i];}
if (INVMAT1==1){
if (PARAMETERIZATION==1){
f = rho[j][i] * u[j][i] * u[j][i];
g = rho[j][i] * ((pi[j][i] * pi[j][i]) - 2 * u[j][i] * u[j][i]);}
......
......@@ -42,7 +42,7 @@ void update_v_PML(int nx1, int nx2, int ny1, int ny2, int nt,
extern float DT, DH;
double time1, time2;
extern int MYID, SOURCE_TYPE, ADJOINT_TYPE, FDORDER;
extern int FDORDER, INVMAT1;
extern int FDORDER, PARAMETERIZATION;
extern int FREE_SURF, BOUNDARY, FW;
extern int NPROCX, NPROCY, POS[3];
extern FILE *FP;
......
......@@ -38,7 +38,7 @@ void update_v_PML_SH(int nx1, int nx2, int ny1, int ny2, int nt,
extern float DT, DH;
double time1, time2;
extern int MYID, SOURCE_TYPE, ADJOINT_TYPE, FDORDER;
extern int FDORDER, INVMAT1;
extern int FDORDER, PARAMETERIZATION;
extern int FREE_SURF, BOUNDARY, FW;
extern int NPROCX, NPROCY, POS[3];
extern FILE *FP;
......
......@@ -42,7 +42,7 @@ void update_v_acoustic_PML(int nx1, int nx2, int ny1, int ny2, int nt,
extern float DT, DH;
double time1, time2;
extern int MYID, SOURCE_TYPE, ADJOINT_TYPE, FDORDER;
extern int FDORDER, INVMAT1;
extern int FDORDER, PARAMETERIZATION;
extern int FREE_SURF, BOUNDARY, FW;
extern int NPROCX, NPROCY, POS[3];
extern FILE *FP;
......
......@@ -44,7 +44,7 @@ void write_par(FILE *fp){
extern char MFILE[STRING_SIZE], JACOBIAN[STRING_SIZE], DATA_DIR[STRING_SIZE],FREQ_FILE[STRING_SIZE];
extern int NP, NPROCX, NPROCY, MYID;
extern int GRADT1, GRADT2, GRADT3, GRADT4, ITERMAX, INVMAT1, INVMAT, ADJOINT_TYPE;
extern int GRADT1, GRADT2, GRADT3, GRADT4, ITERMAX, PARAMETERIZATION, FORWARD_ONLY, ADJOINT_TYPE;
extern int GRAD_METHOD;
extern float TSHIFT_back;
extern int FILT_SIZE, MODEL_FILTER;
......@@ -349,21 +349,21 @@ void write_par(FILE *fp){
}
fprintf(fp,"\n");
fprintf(fp," ----------------------- IFOS elastic specific parameters ----------------------\n");
if (INVMAT==10){
fprintf(fp," INVMAT=%d: Only forward modeling is applied.\n",INVMAT);}
if (FORWARD_ONLY==1){
fprintf(fp," FORWARD_ONLY=%d: Only forward modeling is applied.\n",FORWARD_ONLY);}
else {
if (INVMAT==0){
fprintf(fp," INVMAT=%d: FWI is applied.\n",INVMAT);}
if (FORWARD_ONLY==0){
fprintf(fp," FORWARD_ONLY=%d: FWI is applied.\n",FORWARD_ONLY);}
fprintf(fp,"\n Maximum number of iterations: %d\n",ITERMAX);