change_parameterization_vti.c 1.6 KB
Newer Older
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43
/* This file is part of IFOS.
 * 
 * IFOS is free software: you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation, version 2.0 of the License only.
 * 
 * IFOS is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 * 
 * You should have received a copy of the GNU General Public License
 * along with IFOS. See file COPYING and/or <http://www.gnu.org/licenses/gpl-2.0.html>.
-----------------------------------------------------------------------------------------*/

/*------------------------------------------------------------------------
 *   transforms parameters (rho,vp,vs,epsilon,gamma,delta)
 *   into (rho,c11,c13,c33,c55,c66)
 *   and averages c55 and c66	
 *  ----------------------------------------------------------------------*/

#include "fd.h"


void change_parameterization_vti(float **rho, float **pi, float **u, float **epsilon, float **delta, float **vshor, 
				 float **c11, float **c13, float **c33, float **c55, float **c66) {
    
    extern int NX,NY;
    int i,j;
    
    for (j=1;j<=NY;j++){
            for (i=1;i<=NX;i++){
		
		c33[j][i]=pi[j][i]*pi[j][i]*rho[j][i];
 		c55[j][i]=u[j][i]*u[j][i]*rho[j][i];
 		c11[j][i]=c33[j][i]*(1+2*epsilon[j][i]);
 		c13[j][i]=sqrt(2*delta[j][i]*c33[j][i]*(c33[j][i]-c55[j][i])+(c33[j][i]-c55[j][i])*(c33[j][i]-c55[j][i]))-c55[j][i];
 		c66[j][i]=vshor[j][i]*vshor[j][i]*rho[j][i];
		
	    }
    }
   
}