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

SH: Viscoelastic modelling and free surface

Updated SH viscoelastic modelling to the new grid.
parent 09f6740a
......@@ -19,9 +19,9 @@
#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;
float u1, u2, u3, u4;
......@@ -31,17 +31,9 @@ void av_mue(float ** u, float ** uipjp, float ** uip, float ** ujp, float ** rho
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]));
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)){
uipjp[j][i]=0.0;
if(WAVETYPE==2 || WAVETYPE==3) {
uip[j][i]=0.0;
ujp[j][i]=0.0;
}
}
......@@ -61,18 +53,9 @@ 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];
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)){
uipjp[j][i]=0.0;
if(WAVETYPE==2 || WAVETYPE==3) {
uip[j][i]=0.0;
ujp[j][i]=0.0;
}
}
}
}
......
......@@ -20,18 +20,14 @@
#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;
for (j=1;j<=NY;j++){
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]);
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]);
}
}
}
}
This diff is collapsed.
......@@ -53,11 +53,11 @@ float norm(float ** waveconv, int iter, int sws);
void av_mat(float ** pi, float ** u,
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_tau(float **taus, float **tausipjp,float **tausip,float **tausjp);
void av_tau(float **taus, float **tausipjp);
float median2d(float **mat, int ny, int nx);
......@@ -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,
float ** sxy, float ** pi, float ** u, float ** rho, float * hc);
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);
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);
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_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,
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);
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,
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_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);
void update_s_rsg(int nx1, int nx2, int ny1, int ny2,
float ** pvx, float ** pvy, float ** psxx, float ** psyy,
......
......@@ -27,7 +27,7 @@
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 ** ux, float ** uy, float ** uxy, float ** uyz,float ** sxz,float **uxz){
int i,j,m,h,h1,l;
......@@ -162,10 +162,15 @@ void surface_PML(int ndepth, float ** vx, float ** vy, float ** sxx, float ** sy
}
if (WAVETYPE==2||WAVETYPE==3){
for (i=1;i<=NX;i++){
for (m=0; m<=fdoh-1; m++) {
/* mirroring of stress components for syz
to make a stress free surface in depth y=jsurf*h */
syz[j-m][i]=-syz[j+m+1][i];
syz[j][i]=0.0;
uyz[j][i]=0.0;
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 @@
* 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]
* by a staggered grid finite difference scheme of arbitrary (FDORDER) order accuracy in space
......
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.
*
......@@ -16,13 +16,11 @@
* 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]
* by a staggered grid finite difference scheme of FDORDER accuracy in space
* and second order accuracy in time
* T. Bohlen
*
* SH-Version F. Wittkamp
* ----------------------------------------------------------------------*/
#include "fd.h"
......@@ -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 * 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;
float amp, dtdh, azi_rad;
int i, j,l,fdoh, h, h1;
float dtdh;
float sxz_x, syz_y;
extern float DT, DH;
double time1, time2;
......@@ -46,13 +44,9 @@ void update_v_PML_SH(int nx1, int nx2, int ny1, int ny2, int nt,
extern FILE *FP;
extern int VELOCITY;
fdoh = FDORDER/2;
dtdh = DT*DT/DH;
/* drad = PI/180.0;
angle = 135.0; */
if (infoout && (MYID==0)){
time1=MPI_Wtime();
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