Commit 37dc3095 authored by Florian Wittkamp's avatar Florian Wittkamp
Browse files

SH: Viscoelastic modelling and free surface

Updated SH viscoelastic modelling to the new grid.
parent 09f6740a
...@@ -19,9 +19,9 @@ ...@@ -19,9 +19,9 @@
#include "fd.h" #include "fd.h"
void av_mue(float ** u, float ** uipjp, float ** uip, float ** ujp, float ** rho){ void av_mue(float ** u, float ** uipjp,float ** rho){
extern int NX, NY, INVMAT1, WAVETYPE; extern int NX, NY, INVMAT1;
int i, j; int i, j;
float u1, u2, u3, u4; float u1, u2, u3, u4;
...@@ -31,17 +31,9 @@ void av_mue(float ** u, float ** uipjp, float ** uip, float ** ujp, float ** rho ...@@ -31,17 +31,9 @@ void av_mue(float ** u, float ** uipjp, float ** uip, float ** ujp, float ** rho
for (i=1;i<=NX;i++){ for (i=1;i<=NX;i++){
uipjp[j][i]=4.0/((1.0/u[j][i])+(1.0/u[j][i+1])+(1.0/u[j+1][i])+(1.0/u[j+1][i+1])); uipjp[j][i]=4.0/((1.0/u[j][i])+(1.0/u[j][i+1])+(1.0/u[j+1][i])+(1.0/u[j+1][i+1]));
if(WAVETYPE==2 || WAVETYPE==3) {
uip[j][i]=0.5*(u[j][i+1]+u[j][i]);
ujp[j][i]=0.5*(u[j+1][i]+u[j][i]);
}
if((u[j][i]==0.0)||(u[j][i+1]==0.0)||(u[j+1][i]==0.0)||(u[j+1][i+1]==0.0)){ if((u[j][i]==0.0)||(u[j][i+1]==0.0)||(u[j+1][i]==0.0)||(u[j+1][i+1]==0.0)){
uipjp[j][i]=0.0; uipjp[j][i]=0.0;
if(WAVETYPE==2 || WAVETYPE==3) {
uip[j][i]=0.0;
ujp[j][i]=0.0;
}
} }
...@@ -61,19 +53,10 @@ void av_mue(float ** u, float ** uipjp, float ** uip, float ** ujp, float ** rho ...@@ -61,19 +53,10 @@ void av_mue(float ** u, float ** uipjp, float ** uip, float ** ujp, float ** rho
u4 = rho[j+1][i+1] * u[j+1][i+1] * u[j+1][i+1]; u4 = rho[j+1][i+1] * u[j+1][i+1] * u[j+1][i+1];
uipjp[j][i]=4.0/((1.0/u1)+(1.0/u2)+(1.0/u3)+(1.0/u4)); uipjp[j][i]=4.0/((1.0/u1)+(1.0/u2)+(1.0/u3)+(1.0/u4));
if(WAVETYPE==2 || WAVETYPE==3) {
uip[j][i]=0.5*(u1+u2);
ujp[j][i]=0.5*(u3+u1);
}
if((u1==0.0)||(u2==0.0)||(u3==0.0)||(u4==0.0)){ if((u1==0.0)||(u2==0.0)||(u3==0.0)||(u4==0.0)){
uipjp[j][i]=0.0; uipjp[j][i]=0.0;
if(WAVETYPE==2 || WAVETYPE==3) {
uip[j][i]=0.0;
ujp[j][i]=0.0;
}
} }
} }
} }
......
...@@ -20,18 +20,14 @@ ...@@ -20,18 +20,14 @@
#include "fd.h" #include "fd.h"
void av_tau(float **taus, float **tausipjp,float **tausip,float **tausjp){ void av_tau(float **taus, float **tausipjp){
extern int NX, NY, WAVETYPE; extern int NX, NY;
int i, j; int i, j;
for (j=1;j<=NY;j++){ for (j=1;j<=NY;j++){
for (i=1;i<=NX;i++){ for (i=1;i<=NX;i++){
tausipjp[j][i] = 0.25*(taus[j][i]+taus[j][i+1]+taus[j+1][i]+taus[j+1][i+1]); tausipjp[j][i] = 0.25*(taus[j][i]+taus[j][i+1]+taus[j+1][i]+taus[j+1][i+1]);
if(WAVETYPE==2 || WAVETYPE==3) {
tausip[j][i]=0.5*(taus[j][i+1]+taus[j][i]);
tausjp[j][i]=0.5*(taus[j+1][i]+taus[j][i]);
}
} }
} }
} }
...@@ -68,7 +68,6 @@ int main(int argc, char **argv){ ...@@ -68,7 +68,6 @@ int main(int argc, char **argv){
float ** gradg, ** gradp,** gradg_rho, ** gradp_rho, ** gradg_u, ** gradp_u, ** gradp_u_z,** gradp_rho_z; float ** gradg, ** gradp,** gradg_rho, ** gradp_rho, ** gradg_u, ** gradp_u, ** gradp_u_z,** gradp_rho_z;
float ** prho,** prhonp1, **prip=NULL, **prjp=NULL, **pripnp1=NULL, **prjpnp1=NULL, ** ppi, ** pu, ** punp1, ** puipjp, ** ppinp1; float ** prho,** prhonp1, **prip=NULL, **prjp=NULL, **pripnp1=NULL, **prjpnp1=NULL, ** ppi, ** pu, ** punp1, ** puipjp, ** ppinp1;
float ** vpmat, ***forward_prop_x, ***forward_prop_y, ***forward_prop_rho_x, ***forward_prop_u, ***forward_prop_rho_y, ***forward_prop_p; float ** vpmat, ***forward_prop_x, ***forward_prop_y, ***forward_prop_rho_x, ***forward_prop_u, ***forward_prop_rho_y, ***forward_prop_p;
float ** puip,** pujp;
float ***forward_prop_z_xz,***forward_prop_z_yz,***forward_prop_rho_z,**waveconv_mu_z; float ***forward_prop_z_xz,***forward_prop_z_yz,***forward_prop_rho_z,**waveconv_mu_z;
float ** uxz, ** uyz; float ** uxz, ** uyz;
...@@ -93,7 +92,7 @@ int main(int argc, char **argv){ ...@@ -93,7 +92,7 @@ int main(int argc, char **argv){
/* Variables for viscoelastic modeling */ /* Variables for viscoelastic modeling */
float **ptaus=NULL, **ptaup=NULL, *etaip=NULL, *etajm=NULL, *peta=NULL, **ptausipjp=NULL, **fipjp=NULL, ***dip=NULL, *bip=NULL, *bjm=NULL; float **ptaus=NULL, **ptaup=NULL, *etaip=NULL, *etajm=NULL, *peta=NULL, **ptausipjp=NULL, **fipjp=NULL, ***dip=NULL, *bip=NULL, *bjm=NULL;
float *cip=NULL, *cjm=NULL, ***d=NULL, ***e=NULL, ***pr=NULL, ***pp=NULL, ***pq=NULL, **f=NULL, **g=NULL; float *cip=NULL, *cjm=NULL, ***d=NULL, ***e=NULL, ***pr=NULL, ***pp=NULL, ***pq=NULL, **f=NULL, **g=NULL;
float **tausjp, **tausip, ***pt=NULL, ***po=NULL; // SH Simulation float ***pt=NULL, ***po=NULL; // SH Simulation
/* Variables for step length calculation */ /* Variables for step length calculation */
int step1, step2, step3=0, itests, iteste, stepmax, countstep; int step1, step2, step3=0, itests, iteste, stepmax, countstep;
...@@ -472,10 +471,6 @@ int main(int argc, char **argv){ ...@@ -472,10 +471,6 @@ int main(int argc, char **argv){
pu = matrix(-nd+1,NY+nd,-nd+1,NX+nd); pu = matrix(-nd+1,NY+nd,-nd+1,NX+nd);
punp1 = matrix(-nd+1,NY+nd,-nd+1,NX+nd); punp1 = matrix(-nd+1,NY+nd,-nd+1,NX+nd);
puipjp = matrix(-nd+1,NY+nd,-nd+1,NX+nd); puipjp = matrix(-nd+1,NY+nd,-nd+1,NX+nd);
if(WAVETYPE==2 || WAVETYPE==3) {
puip = matrix(-nd+1,NY+nd,-nd+1,NX+nd);
pujp = matrix(-nd+1,NY+nd,-nd+1,NX+nd);
}
} }
vpmat = matrix(-nd+1,NY+nd,-nd+1,NX+nd); vpmat = matrix(-nd+1,NY+nd,-nd+1,NX+nd);
...@@ -507,8 +502,6 @@ int main(int argc, char **argv){ ...@@ -507,8 +502,6 @@ int main(int argc, char **argv){
ptaus = matrix(-nd+1,NY+nd,-nd+1,NX+nd); ptaus = matrix(-nd+1,NY+nd,-nd+1,NX+nd);
ptausipjp = matrix(-nd+1,NY+nd,-nd+1,NX+nd); ptausipjp = matrix(-nd+1,NY+nd,-nd+1,NX+nd);
if(WAVETYPE==2 || WAVETYPE==3) { if(WAVETYPE==2 || WAVETYPE==3) {
tausip = matrix(-nd+1,NY+nd,-nd+1,NX+nd);
tausjp = matrix(-nd+1,NY+nd,-nd+1,NX+nd);
pt = f3tensor(-nd+1,NY+nd,-nd+1,NX+nd,1,L); pt = f3tensor(-nd+1,NY+nd,-nd+1,NX+nd,1,L);
po = f3tensor(-nd+1,NY+nd,-nd+1,NX+nd,1,L); po = f3tensor(-nd+1,NY+nd,-nd+1,NX+nd,1,L);
} }
...@@ -1033,9 +1026,9 @@ int main(int argc, char **argv){ ...@@ -1033,9 +1026,9 @@ int main(int argc, char **argv){
/* end of MPI split for processors with ntr>0 */ /* end of MPI split for processors with ntr>0 */
if(!ACOUSTIC) av_mue(pu,puipjp,puip,pujp,prho); if(!ACOUSTIC) av_mue(pu,puipjp,prho);
av_rho(prho,prip,prjp); av_rho(prho,prip,prjp);
if (!ACOUSTIC && L) av_tau(ptaus,ptausipjp,tausip,tausjp); if (!ACOUSTIC && L) av_tau(ptaus,ptausipjp);
/* Preparing memory variables for update_s (viscoelastic) */ /* Preparing memory variables for update_s (viscoelastic) */
...@@ -1295,7 +1288,7 @@ int main(int argc, char **argv){ ...@@ -1295,7 +1288,7 @@ int main(int argc, char **argv){
if (!ACOUSTIC){ if (!ACOUSTIC){
if (L){ if (L){
/* viscoelastic */ /* viscoelastic */
surface_PML(1, pvx, pvy, psxx, psyy, psxy,psyz, pp, pq, ppi, pu, prho, ptaup, ptaus, etajm, peta, hc, K_x, a_x, b_x, psi_vxxs, ux, uy, uxy); surface_PML(1, pvx, pvy, psxx, psyy, psxy,psyz, pp, pq, ppi, pu, prho, ptaup, ptaus, etajm, peta, hc, K_x, a_x, b_x, psi_vxxs, ux, uy,uxy,uyz,psxz,uxz);
}else{ }else{
/* elastic */ /* elastic */
surface_elastic_PML(1, pvx, pvy, psxx, psyy, psxy,psyz, ppi, pu, prho, hc, K_x, a_x, b_x, psi_vxxs, ux, uy, uxy,uyz,psxz,uxz); surface_elastic_PML(1, pvx, pvy, psxx, psyy, psxy,psyz, ppi, pu, prho, hc, K_x, a_x, b_x, psi_vxxs, ux, uy, uxy,uyz,psxz,uxz);
...@@ -1753,7 +1746,7 @@ int main(int argc, char **argv){ ...@@ -1753,7 +1746,7 @@ int main(int argc, char **argv){
} }
} }
if (WAVETYPE==2 || WAVETYPE==3) { if (WAVETYPE==2 || WAVETYPE==3) {
update_s_visc_PML_SH(1, NX, 1, NY, pvz, psxz, psyz, pt, po, puip, pujp, tausip, tausjp, bip, bjm, cip, cjm, etajm, etaip, hc,infoout, K_x, a_x, b_x, K_x_half, a_x_half, b_x_half, K_y, a_y, b_y, K_y_half, a_y_half, b_y_half,psi_vzx, psi_vzy); update_s_visc_PML_SH(1, NX, 1, NY, pvz, psxz, psyz, pt, po, bip, bjm, cip, cjm, d, dip,fipjp, f, hc,infoout, K_x, a_x, b_x, K_x_half, a_x_half, b_x_half, K_y, a_y, b_y, K_y_half, a_y_half, b_y_half,psi_vzx, psi_vzy);
} }
} else { /* elastic */ } else { /* elastic */
if (WAVETYPE==1 || WAVETYPE==3) { if (WAVETYPE==1 || WAVETYPE==3) {
...@@ -1779,7 +1772,7 @@ int main(int argc, char **argv){ ...@@ -1779,7 +1772,7 @@ int main(int argc, char **argv){
if (!ACOUSTIC){ if (!ACOUSTIC){
if (L){ if (L){
/* viscoelastic */ /* viscoelastic */
surface_PML(1, pvx, pvy, psxx, psyy, psxy,psyz, pp, pq, ppi, pu, prho, ptaup, ptaus, etajm, peta, hc, K_x, a_x, b_x, psi_vxxs, ux, uy, uxy); surface_PML(1, pvx, pvy, psxx, psyy, psxy,psyz, pp, pq, ppi, pu, prho, ptaup, ptaus, etajm, peta, hc, K_x, a_x, b_x, psi_vxxs, ux, uy,uxy,uyz,psxz,uxz);
}else{ }else{
/* elastic */ /* elastic */
surface_elastic_PML(1, pvx, pvy, psxx, psyy, psxy,psyz, ppi, pu, prho, hc, K_x, a_x, b_x, psi_vxxs, ux, uy, uxy,uyz,psxz,uxz); surface_elastic_PML(1, pvx, pvy, psxx, psyy, psxy,psyz, ppi, pu, prho, hc, K_x, a_x, b_x, psi_vxxs, ux, uy, uxy,uyz,psxz,uxz);
...@@ -2243,7 +2236,7 @@ int main(int argc, char **argv){ ...@@ -2243,7 +2236,7 @@ int main(int argc, char **argv){
} }
} }
if (WAVETYPE==2 || WAVETYPE==3) { if (WAVETYPE==2 || WAVETYPE==3) {
update_s_visc_PML_SH(1, NX, 1, NY, pvz, psxz, psyz, pt, po, puip, pujp, tausip, tausjp, bip, bjm, cip, cjm, etajm, etaip, hc,infoout, K_x, a_x, b_x, K_x_half, a_x_half, b_x_half, K_y, a_y, b_y, K_y_half, a_y_half, b_y_half,psi_vzx, psi_vzy); update_s_visc_PML_SH(1, NX, 1, NY, pvz, psxz, psyz, pt, po, bip, bjm, cip, cjm, d, dip,fipjp, f, hc,infoout, K_x, a_x, b_x, K_x_half, a_x_half, b_x_half, K_y, a_y, b_y, K_y_half, a_y_half, b_y_half,psi_vzx, psi_vzy);
} }
} else{ } else{
/* elastic */ /* elastic */
...@@ -2268,7 +2261,7 @@ int main(int argc, char **argv){ ...@@ -2268,7 +2261,7 @@ int main(int argc, char **argv){
if (!ACOUSTIC){ if (!ACOUSTIC){
if (L){ if (L){
/* viscoelastic */ /* viscoelastic */
surface_PML(1, pvx, pvy, psxx, psyy, psxy,psyz, pp, pq, ppi, pu, prho, ptaup, ptaus, etajm, peta, hc, K_x, a_x, b_x, psi_vxxs, ux, uy, uxy); surface_PML(1, pvx, pvy, psxx, psyy, psxy,psyz, pp, pq, ppi, pu, prho, ptaup, ptaus, etajm, peta, hc, K_x, a_x, b_x, psi_vxxs, ux, uy,uxy,uyz,psxz,uxz);
}else{ }else{
/* elastic */ /* elastic */
surface_elastic_PML(1, pvx, pvy, psxx, psyy, psxy,psyz, ppi, pu, prho, hc, K_x, a_x, b_x, psi_vxxs, ux, uy, uxy,uyz,psxz,uxz); surface_elastic_PML(1, pvx, pvy, psxx, psyy, psxy,psyz, ppi, pu, prho, hc, K_x, a_x, b_x, psi_vxxs, ux, uy, uxy,uyz,psxz,uxz);
...@@ -2882,7 +2875,7 @@ int main(int argc, char **argv){ ...@@ -2882,7 +2875,7 @@ int main(int argc, char **argv){
waveconv_rho=joint_inversion_grad(waveconv_rho,waveconv_rho_z,JOINT_INVERSION_PSV_SH_ALPHA_RHO,JOINT_INVERSION_PSV_SH_TYPE); waveconv_rho=joint_inversion_grad(waveconv_rho,waveconv_rho_z,JOINT_INVERSION_PSV_SH_ALPHA_RHO,JOINT_INVERSION_PSV_SH_TYPE);
/* Output joint gradient to disk */ /* Output joint gradient to disk */
sprintf(jac,"%s_joint_u_it%i",JACOBIAN,iter); sprintf(jac,"%s_joint_vs_it%i",JACOBIAN,iter);
write_matrix_disk(waveconv_u, jac); write_matrix_disk(waveconv_u, jac);
/* Output joint gradient to disk */ /* Output joint gradient to disk */
...@@ -3172,7 +3165,7 @@ int main(int argc, char **argv){ ...@@ -3172,7 +3165,7 @@ int main(int argc, char **argv){
MPI_Barrier(MPI_COMM_WORLD); MPI_Barrier(MPI_COMM_WORLD);
if(!ACOUSTIC) av_mue(punp1,puipjp,puip,pujp,prhonp1); if(!ACOUSTIC) av_mue(punp1,puipjp,prhonp1);
av_rho(prhonp1,prip,prjp); av_rho(prhonp1,prip,prjp);
/* Preparing memory variables for update_s (viscoelastic) */ /* Preparing memory variables for update_s (viscoelastic) */
...@@ -3343,7 +3336,7 @@ int main(int argc, char **argv){ ...@@ -3343,7 +3336,7 @@ int main(int argc, char **argv){
} }
} }
if (WAVETYPE==2 || WAVETYPE==3) { if (WAVETYPE==2 || WAVETYPE==3) {
update_s_visc_PML_SH(1, NX, 1, NY, pvz, psxz, psyz, pt, po, puip, pujp, tausip, tausjp, bip, bjm, cip, cjm, etajm, etaip, hc,infoout, K_x, a_x, b_x, K_x_half, a_x_half, b_x_half, K_y, a_y, b_y, K_y_half, a_y_half, b_y_half,psi_vzx, psi_vzy); update_s_visc_PML_SH(1, NX, 1, NY, pvz, psxz, psyz, pt, po, bip, bjm, cip, cjm, d, dip,fipjp, f, hc,infoout, K_x, a_x, b_x, K_x_half, a_x_half, b_x_half, K_y, a_y, b_y, K_y_half, a_y_half, b_y_half,psi_vzx, psi_vzy);
} }
} else { /* elastic */ } else { /* elastic */
if(!ACOUSTIC){ if(!ACOUSTIC){
...@@ -3373,7 +3366,7 @@ int main(int argc, char **argv){ ...@@ -3373,7 +3366,7 @@ int main(int argc, char **argv){
if (!ACOUSTIC){ if (!ACOUSTIC){
if (L){ if (L){
/* viscoelastic */ /* viscoelastic */
surface_PML(1, pvx, pvy, psxx, psyy, psxy,psyz, pp, pq, ppinp1, punp1, prhonp1, ptaup, ptaus, etajm, peta, hc, K_x, a_x, b_x, psi_vxxs, ux, uy, uxy); surface_PML(1, pvx, pvy, psxx, psyy, psxy,psyz, pp, pq, ppinp1, punp1, prhonp1, ptaup, ptaus, etajm, peta, hc, K_x, a_x, b_x, psi_vxxs, ux, uy,uxy,uyz,psxz,uxz);
}else{ }else{
/* elastic */ /* elastic */
surface_elastic_PML(1, pvx, pvy, psxx, psyy, psxy,psyz, ppinp1, punp1, prhonp1, hc, K_x, a_x, b_x, psi_vxxs, ux, uy, uxy,uyz,psxz,uxz); surface_elastic_PML(1, pvx, pvy, psxx, psyy, psxy,psyz, ppinp1, punp1, prhonp1, hc, K_x, a_x, b_x, psi_vxxs, ux, uy, uxy,uyz,psxz,uxz);
...@@ -4251,15 +4244,9 @@ int main(int argc, char **argv){ ...@@ -4251,15 +4244,9 @@ int main(int argc, char **argv){
free_matrix(gradp_u_z,-nd+1,NY+nd,-nd+1,NX+nd); free_matrix(gradp_u_z,-nd+1,NY+nd,-nd+1,NX+nd);
free_matrix(gradp_rho_z,-nd+1,NY+nd,-nd+1,NX+nd); free_matrix(gradp_rho_z,-nd+1,NY+nd,-nd+1,NX+nd);
if(L){ if(L){
free_matrix(tausip,-nd+1,NY+nd,-nd+1,NX+nd);
free_matrix(tausjp,-nd+1,NY+nd,-nd+1,NX+nd);
free_f3tensor(pt,-nd+1,NY+nd,-nd+1,NX+nd,1,L); free_f3tensor(pt,-nd+1,NY+nd,-nd+1,NX+nd,1,L);
free_f3tensor(po,-nd+1,NY+nd,-nd+1,NX+nd,1,L); free_f3tensor(po,-nd+1,NY+nd,-nd+1,NX+nd,1,L);
} }
if(!ACOUSTIC){
free_matrix(puip,-nd+1,NY+nd,-nd+1,NX+nd);
free_matrix(pujp,-nd+1,NY+nd,-nd+1,NX+nd);
}
} }
......
...@@ -53,11 +53,11 @@ float norm(float ** waveconv, int iter, int sws); ...@@ -53,11 +53,11 @@ float norm(float ** waveconv, int iter, int sws);
void av_mat(float ** pi, float ** u, void av_mat(float ** pi, float ** u,
float ** ppijm, float ** puip, float ** pujm); float ** ppijm, float ** puip, float ** pujm);
void av_mue(float ** u, float ** uipjp, float ** uip, float ** ujp, float ** rho); void av_mue(float ** u, float ** uipjp,float ** rho);
void av_rho(float **rho, float **rip, float **rjp); void av_rho(float **rho, float **rip, float **rjp);
void av_tau(float **taus, float **tausipjp,float **tausip,float **tausjp); void av_tau(float **taus, float **tausipjp);
float median2d(float **mat, int ny, int nx); float median2d(float **mat, int ny, int nx);
...@@ -283,10 +283,9 @@ void surface(int ndepth, float ** pvx, float ** pvy, ...@@ -283,10 +283,9 @@ void surface(int ndepth, float ** pvx, float ** pvy,
void surface_elastic(int ndepth, float ** vx, float ** vy, float ** sxx, float ** syy, void surface_elastic(int ndepth, float ** vx, float ** vy, float ** sxx, float ** syy,
float ** sxy, float ** pi, float ** u, float ** rho, float * hc); float ** sxy, float ** pi, float ** u, float ** rho, float * hc);
void surface_elastic_PML(int ndepth, float ** vx, float ** vy, float ** sxx, float ** syy, void surface_elastic_PML(int ndepth, float ** vx, float ** vy, float ** sxx, float ** syy, float ** sxy, float ** syz, float ** pi, float ** u, float ** rho, float * hc, float * K_x, float * a_x, float * b_x, float ** psi_vxx, float ** ux, float ** uy, float ** uxy, float ** uyz,float ** sxz,float **uxz);
float ** sxy, float ** syz, float ** pi, float ** u, float ** rho, float * hc, float * K_x, float * a_x, float * b_x, float ** psi_vxx, float ** ux, float ** uy, float ** uxy, float ** uyz,float ** sxz,float **uxz);
void surface_PML(int ndepth, float ** vx, float ** vy, float ** sxx, float ** syy, float ** sxy, float ** syz, float ***p, float ***q, float ** ppi, float ** pu, float **prho, float **ptaup, float **ptaus, float *etajm, float *peta, float * hc, float * K_x, float * a_x, float * b_x, float ** psi_vxx,float ** ux, float ** uy, float ** uxy); void surface_PML(int ndepth, float ** vx, float ** vy, float ** sxx, float ** syy, float ** sxy, float ** syz, float ***p, float ***q, float ** ppi, float ** pu, float **prho, float **ptaup, float **ptaus, float *etajm, float *peta, float * hc, float * K_x, float * a_x, float * b_x, float ** psi_vxx, float ** ux, float ** uy, float ** uxy, float ** uyz,float ** sxz,float **uxz);
void timedomain_filt(float ** data, float fc, int order, int ntr, int ns, int method); void timedomain_filt(float ** data, float fc, int order, int ntr, int ns, int method);
void timedomain_filt_vector(float * data, float fc, int order, int ntr, int ns, int method); void timedomain_filt_vector(float * data, float fc, int order, int ntr, int ns, int method);
...@@ -313,8 +312,7 @@ void update_s_visc_hc(int nx1, int nx2, int ny1, int ny2, ...@@ -313,8 +312,7 @@ void update_s_visc_hc(int nx1, int nx2, int ny1, int ny2,
void update_s_elastic_PML_SH(int nx1, int nx2, int ny1, int ny2, float ** vz, float ** sxz, float ** syz, float ** uxz, float ** uyz, float *hc, int infoout,float * K_x, float * a_x, float * b_x, float * K_x_half, float * a_x_half, float * b_x_half, void update_s_elastic_PML_SH(int nx1, int nx2, int ny1, int ny2, float ** vz, float ** sxz, float ** syz, float ** uxz, float ** uyz, float *hc, int infoout,float * K_x, float * a_x, float * b_x, float * K_x_half, float * a_x_half, float * b_x_half,
float * K_y, float * a_y, float * b_y, float * K_y_half, float * a_y_half, float * b_y_half,float ** psi_vzx, float ** psi_vzy,float ** uipjp,float ** u,float ** rho); float * K_y, float * a_y, float * b_y, float * K_y_half, float * a_y_half, float * b_y_half,float ** psi_vzx, float ** psi_vzy,float ** uipjp,float ** u,float ** rho);
void update_s_visc_PML_SH(int nx1, int nx2, int ny1, int ny2, float ** vz, float ** sxz, float ** syz, float ***t, float ***o, float ** uip, float ** ujp, float ** tausip, float ** tausjp, float *bip, float *bjm, float *cip, float *cjm, float *etajm, float *etaip, float *hc, int infoout,float * K_x, float * a_x, float * b_x, float * K_x_half, float * a_x_half, float * b_x_half, void update_s_visc_PML_SH(int nx1, int nx2, int ny1, int ny2, float ** vz, float ** sxz, float ** syz, float ***t, float ***o, float *bip, float *bjm, float *cip, float *cjm, float ***d, float ***dip, float **fipjp, float **f, float *hc, int infoout,float * K_x, float * a_x, float * b_x, float * K_x_half, float * a_x_half, float * b_x_half,float * K_y, float * a_y, float * b_y, float * K_y_half, float * a_y_half, float * b_y_half,float ** psi_vzx, float ** psi_vzy);
float * K_y, float * a_y, float * b_y, float * K_y_half, float * a_y_half, float * b_y_half,float ** psi_vzx, float ** psi_vzy);
void update_s_rsg(int nx1, int nx2, int ny1, int ny2, void update_s_rsg(int nx1, int nx2, int ny1, int ny2,
float ** pvx, float ** pvy, float ** psxx, float ** psyy, float ** pvx, float ** pvy, float ** psxx, float ** psyy,
......
...@@ -27,7 +27,7 @@ ...@@ -27,7 +27,7 @@
void surface_PML(int ndepth, float ** vx, float ** vy, float ** sxx, float ** syy, void surface_PML(int ndepth, float ** vx, float ** vy, float ** sxx, float ** syy,
float ** sxy, float ** syz, float ***p, float ***q, float ** ppi, float ** pu, float **prho, float **ptaup, float **ptaus, float *etajm, float *peta, float * hc, float * K_x, float * a_x, float * b_x, float ** psi_vxx, float ** sxy, float ** syz, float ***p, float ***q, float ** ppi, float ** pu, float **prho, float **ptaup, float **ptaus, float *etajm, float *peta, float * hc, float * K_x, float * a_x, float * b_x, float ** psi_vxx,
float ** ux, float ** uy, float ** uxy){ float ** ux, float ** uy, float ** uxy, float ** uyz,float ** sxz,float **uxz){
int i,j,m,h,h1,l; int i,j,m,h,h1,l;
...@@ -162,10 +162,15 @@ void surface_PML(int ndepth, float ** vx, float ** vy, float ** sxx, float ** sy ...@@ -162,10 +162,15 @@ void surface_PML(int ndepth, float ** vx, float ** vy, float ** sxx, float ** sy
} }
if (WAVETYPE==2||WAVETYPE==3){ if (WAVETYPE==2||WAVETYPE==3){
for (i=1;i<=NX;i++){ for (i=1;i<=NX;i++){
for (m=0; m<=fdoh-1; m++) {
/* mirroring of stress components for syz syz[j][i]=0.0;
to make a stress free surface in depth y=jsurf*h */ uyz[j][i]=0.0;
syz[j-m][i]=-syz[j+m+1][i]; for (m=1; m<=fdoh; m++) {
syz[j-m][i]=-syz[j+m][i];
sxz[j-m][i]=-sxz[j+m-1][i];
uyz[j-m][i]=-uyz[j+m][i];
uxz[j-m][i]=-uxz[j+m-1][i];
} }
} }
} }
......
...@@ -16,7 +16,6 @@ ...@@ -16,7 +16,6 @@
* along with DENISE. See file COPYING and/or <http://www.gnu.org/licenses/gpl-2.0.html>. * along with DENISE. See file COPYING and/or <http://www.gnu.org/licenses/gpl-2.0.html>.
-----------------------------------------------------------------------------------------*/ -----------------------------------------------------------------------------------------*/
/* $Id: update_s_visc_PML.c,v 1.1.1.1 2011/10/06 22:44:52 groos Exp $*/
/*------------------------------------------------------------------------ /*------------------------------------------------------------------------
* updating stress components at gridpoints [nx1...nx2][ny1...ny2] * updating stress components at gridpoints [nx1...nx2][ny1...ny2]
* by a staggered grid finite difference scheme of arbitrary (FDORDER) order accuracy in space * by a staggered grid finite difference scheme of arbitrary (FDORDER) order accuracy in space
...@@ -256,7 +255,7 @@ void update_s_visc_PML(int nx1, int nx2, int ny1, int ny2, ...@@ -256,7 +255,7 @@ void update_s_visc_PML(int nx1, int nx2, int ny1, int ny2,
} }
/* updating components of the stress tensor, partially */ /* updating components of the stress tensor, partially */
sxy[j][i] += (fipjp[j][i]*(vxy+vyx))+(dthalbe*sumr); sxy[j][i] += (fipjp[j][i]*(vxy+vyx))+(dthalbe*sumr);
sxx[j][i] += (g[j][i]*(vxx+vyy))-(2.0*f[j][i]*vyy)+(dthalbe*sump); sxx[j][i] += (g[j][i]*(vxx+vyy))-(2.0*f[j][i]*vyy)+(dthalbe*sump);
syy[j][i] += (g[j][i]*(vxx+vyy))-(2.0*f[j][i]*vxx)+(dthalbe*sumq); syy[j][i] += (g[j][i]*(vxx+vyy))-(2.0*f[j][i]*vxx)+(dthalbe*sumq);
......
This diff is collapsed.
/*----------------------------------------------------------------------------------------- /*-----------------------------------------------------------------------------------------
* Copyright (C) 2013 For the list of authors, see file AUTHORS. * Copyright (C) 2015 For the list of authors, see file AUTHORS.
* *
* This file is part of DENISE. * This file is part of DENISE.
* *
...@@ -16,13 +16,11 @@ ...@@ -16,13 +16,11 @@
* along with DENISE. See file COPYING and/or <http://www.gnu.org/licenses/gpl-2.0.html>. * along with DENISE. See file COPYING and/or <http://www.gnu.org/licenses/gpl-2.0.html>.
-----------------------------------------------------------------------------------------*/ -----------------------------------------------------------------------------------------*/
/* $Id: update_v_ssg.c,v 1.1.1.1 2007/11/21 22:44:52 koehn Exp $*/
/*------------------------------------------------------------------------ /*------------------------------------------------------------------------
* updating particle velocities at gridpoints [nx1...nx2][ny1...ny2] * updating particle velocities at gridpoints [nx1...nx2][ny1...ny2]
* by a staggered grid finite difference scheme of FDORDER accuracy in space * by a staggered grid finite difference scheme of FDORDER accuracy in space
* and second order accuracy in time * and second order accuracy in time
* T. Bohlen * SH-Version F. Wittkamp
*
* ----------------------------------------------------------------------*/ * ----------------------------------------------------------------------*/
#include "fd.h" #include "fd.h"
...@@ -34,8 +32,8 @@ void update_v_PML_SH(int nx1, int nx2, int ny1, int ny2, int nt, ...@@ -34,8 +32,8 @@ void update_v_PML_SH(int nx1, int nx2, int ny1, int ny2, int nt,
float *hc, int infoout,int sw, float * K_x, float * a_x, float * b_x, float * K_x_half, float * a_x_half, float * b_x_half, float *hc, int infoout,int sw, float * K_x, float * a_x, float * b_x, float * K_x_half, float * a_x_half, float * b_x_half,
float * K_y, float * a_y, float * b_y, float * K_y_half, float * a_y_half, float * b_y_half,float ** psi_sxz_x,float ** psi_syz_y){ float * K_y, float * a_y, float * b_y, float * K_y_half, float * a_y_half, float * b_y_half,float ** psi_sxz_x,float ** psi_syz_y){
int i, j,l,fdoh,m, h, h1; int i, j,l,fdoh, h, h1;
float amp, dtdh, azi_rad; float dtdh;
float sxz_x, syz_y; float sxz_x, syz_y;
extern float DT, DH; extern float DT, DH;
double time1, time2; double time1, time2;
...@@ -46,13 +44,9 @@ void update_v_PML_SH(int nx1, int nx2, int ny1, int ny2, int nt, ...@@ -46,13 +44,9 @@ void update_v_PML_SH(int nx1, int nx2, int ny1, int ny2, int nt,
extern FILE *FP; extern FILE *FP;
extern int VELOCITY; extern int VELOCITY;
fdoh = FDORDER/2; fdoh = FDORDER/2;
dtdh = DT*DT/DH; dtdh = DT*DT/DH;
/* drad = PI/180.0;
angle = 135.0; */
if (infoout && (MYID==0)){ if (infoout && (MYID==0)){
time1=MPI_Wtime(); time1=MPI_Wtime();
fprintf(FP,"\n **Message from update_v_SH (printed by PE %d):\n",MYID); fprintf(FP,"\n **Message from update_v_SH (printed by PE %d):\n",MYID);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment