Commit f85ec539 authored by Florian Wittkamp's avatar Florian Wittkamp

CLEANUP: Free surface and small Bugfix

parent 5944d0e4
...@@ -1042,6 +1042,7 @@ int main(int argc, char **argv){ ...@@ -1042,6 +1042,7 @@ int main(int argc, char **argv){
} }
} }
/* Do some initia calculations */
if(iter==1){ if(iter==1){
/* Calculationg material parameters according to INVMAT1 */ /* Calculationg material parameters according to INVMAT1 */
...@@ -1276,14 +1277,18 @@ int main(int argc, char **argv){ ...@@ -1276,14 +1277,18 @@ int main(int argc, char **argv){
if ((QUELLTYP==1)) if ((QUELLTYP==1))
psource(nt,psxx,psyy,psp,srcpos_loc,signals,nsrc_loc,0); psource(nt,psxx,psyy,psp,srcpos_loc,signals,nsrc_loc,0);
/* Applying free surface condition */
if ((FREE_SURF) && (POS[2]==0)){ if ((FREE_SURF) && (POS[2]==0)){
if (!ACOUSTIC){ if (!ACOUSTIC){
if (L){ /* viscoelastic */ if (L){
/* 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);
}else{ /* elastic */ }else{
/* 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);
} }
} else { /* viscoelastic and elastic ACOUSTIC */ } else {
/* viscoelastic and elastic ACOUSTIC */
surface_acoustic_PML(1, psp); surface_acoustic_PML(1, psp);
} }
} }
...@@ -1757,22 +1762,19 @@ int main(int argc, char **argv){ ...@@ -1757,22 +1762,19 @@ int main(int argc, char **argv){
if ((QUELLTYP==1)&&(WAVETYPE==1||WAVETYPE==3)) if ((QUELLTYP==1)&&(WAVETYPE==1||WAVETYPE==3))
psource(nt,psxx,psyy,psp,srcpos_loc,signals,nsrc_loc,0); psource(nt,psxx,psyy,psp,srcpos_loc,signals,nsrc_loc,0);
/* apply free surface */ /* Applying free surface condition */
if ((FREE_SURF) && (POS[2]==0)){ if ((FREE_SURF) && (POS[2]==0)){
if (L) { if (!ACOUSTIC){
/* viscoelastic */ if (L){
if(!ACOUSTIC) { /* 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);
}else{ }else{
surface_acoustic_PML(1, psp); /* 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);
}else{
/* elastic */
if(!ACOUSTIC) {
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);
}else{
surface_acoustic_PML(1, psp);
} }
} else {
/* viscoelastic and elastic ACOUSTIC */
surface_acoustic_PML(1, psp);
} }
} }
...@@ -2232,23 +2234,19 @@ int main(int argc, char **argv){ ...@@ -2232,23 +2234,19 @@ int main(int argc, char **argv){
if ((QUELLTYPB==4)) if ((QUELLTYPB==4))
psource(nt,psxx,psyy,psp,srcpos_loc_back,sectionpdiff,ntr1,1); psource(nt,psxx,psyy,psp,srcpos_loc_back,sectionpdiff,ntr1,1);
/* Applying free surface condition */
if ((FREE_SURF) && (POS[2]==0)){ if ((FREE_SURF) && (POS[2]==0)){
if (L) { if (!ACOUSTIC){
/* viscoelastic */ if (L){
if (!ACOUSTIC) { /* 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);
}else{ }else{
/* acoustic */ /* elastic */
surface_acoustic_PML(1, psp);
}
}else{
/* elastic */
if(!ACOUSTIC){
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);
}else{
/* acoustic */
surface_acoustic_PML(1, psp);
} }
} else {
/* viscoelastic and elastic ACOUSTIC */
surface_acoustic_PML(1, psp);
} }
} }
...@@ -3313,19 +3311,20 @@ int main(int argc, char **argv){ ...@@ -3313,19 +3311,20 @@ int main(int argc, char **argv){
if ((QUELLTYP==1)) if ((QUELLTYP==1))
psource(nt,psxx,psyy,psp,srcpos_loc,signals,nsrc_loc,0); psource(nt,psxx,psyy,psp,srcpos_loc,signals,nsrc_loc,0);
/* Applying free surface condition */
if ((FREE_SURF) && (POS[2]==0)){ if ((FREE_SURF) && (POS[2]==0)){
if (L) /* viscoelastic */ if (!ACOUSTIC){
if (!ACOUSTIC){ if (L){
/* 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);
}else{ }else{
surface_acoustic_PML(1, psp); /* 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);
else{
if(!ACOUSTIC) /* 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);
else
surface_acoustic_PML(1, psp);
} }
} else {
/* viscoelastic and elastic ACOUSTIC */
surface_acoustic_PML(1, psp);
}
} }
/* stress exchange between PEs */ /* stress exchange between PEs */
......
...@@ -32,7 +32,7 @@ void matcopy_acoustic(float ** rho, float ** pi){ ...@@ -32,7 +32,7 @@ void matcopy_acoustic(float ** rho, float ** pi){
extern int MYID, NX, NY, INDEX[5]; extern int MYID, NX, NY, INDEX[5];
extern const int TAG1,TAG2,TAG5,TAG6; extern const int TAG1,TAG2,TAG5,TAG6;
extern FILE *FP; extern FILE *FP;
extern int VERBOSE;
MPI_Status status; MPI_Status status;
double time1, time2; double time1, time2;
...@@ -46,8 +46,8 @@ void matcopy_acoustic(float ** rho, float ** pi){ ...@@ -46,8 +46,8 @@ void matcopy_acoustic(float ** rho, float ** pi){
bufferbot_to_top_1 = matrix(0,NX+1,1,2); bufferbot_to_top_1 = matrix(0,NX+1,1,2);
fprintf(FP,"\n\n **Message from matcopy (written by PE %d):",MYID); if(VERBOSE) fprintf(FP,"\n\n **Message from matcopy (written by PE %d):",MYID);
fprintf(FP,"\n Copy material properties at inner boundaries ... \n"); if(VERBOSE) fprintf(FP,"\n Copy material properties at inner boundaries ... \n");
time1=MPI_Wtime(); time1=MPI_Wtime();
...@@ -131,7 +131,7 @@ void matcopy_acoustic(float ** rho, float ** pi){ ...@@ -131,7 +131,7 @@ void matcopy_acoustic(float ** rho, float ** pi){
} }
if (MYID==0){ if (MYID==0 && VERBOSE){
time2=MPI_Wtime(); time2=MPI_Wtime();
fprintf(FP," finished (real time: %4.2f s).\n",time2-time1); fprintf(FP," finished (real time: %4.2f s).\n",time2-time1);
} }
......
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