资源简介
这是一个正常逆时偏移c语言程序,过程比较简单,适合初级学习。
代码片段和文件信息
#include “math.h“
#include “string.h“
#include
#include
#define PI 3.1415926
#define MIN(xy) ((x) < (y) ? (x) : (y))
#define MAX(xy) ((x) > (y) ? (x) : (y))
#define NINT(x) ((int)((x)>0.0?(x)+0.5:(x)-0.5))
#define ABS(x) ((x) > 0.0 ? (x) : -1.0*(x))
void *alloc1 (int n1 int size);
void **alloc2 (int n1 int n2 int size);
float *alloc1float(int n1);
float **alloc2float(int n1 int n2);
void ptsrc(float sstrength float xsn float zsn
int nx float dx
int nz float dz
float dt float t float fmax float fpeak float tdelay float **s float **vsxd);
void tstep2 (int nx float dx int nz float dz float dt
float **dvv float **od float **s
float **pm float **p float **pp int *absbord float *omega int m float **vsxd);
static void star3 (int nx float dx int nz float dz float dt
float **dvv float **od float **s
float **pm float **p float **pp float *omega int m);
static float ricker (float t float fpeak);
static void absorb (int nx float dx int nz float dz float dt
float **dvv float **od float **pm float **p float **pp
int *absbord);
static void cal_bord (float xscale float zscale
float **dvv float **s
float **pm float **p float **pp int m
float *omega int nx int nz);
static void cal_inner (float xscale float zscale
float **dvv float **s
float **pm float **p float **pp int m
float *omega int nx int nz);
void ftstep2 (int nx float dx int nz float dz float dt
float **dvv float **od float **s
float **pm float **p float **pp int *absbord float *omega int m float **vsxd);
static void fabsorb (int nx float dx int nz float dz float dt
float **dvv float **od float **pm float **p float **pp
int *absbord);
static void absorbwhz (int nx float dx int nz float dz float dt
float **dvv float **od float **pm float **p float **pp
int *absbord float **vsxd);
static void fabsorbwhz (int nx float dx int nz float dz float dt
float **dvv float **od float **pm float **p float **pp
int *absbord float **vsxd);
static void absorbmultiple (int nx float dx int nz float dz float dt
float **dvv float **od float **pm float **p float **pp
int *absbord float **vsxd);
static void fabsorbmultiple (int nx float dx int nz float dz float dt
float **dvv float **od float **pm float **p float **pp
int *absbord float **vsxd);
/***************************************************************/
int main(void)
{
/**********************************************************/
/* ***input parameters*** */
/**********************************************************/
int nx=497;
int nz=750;
float dx=12.50; /* m */
float dz=4.0; /* m */
int absbord[4]={1111};
float sstrength=1000.0;
int ds_sxd=20;
int fs_sxd=200;
int ns_sxd=1; /* insure: (xs_sxd=(ns_sxd-1)*ds_sxd+fs_sxd)<=nx-1 */
//int
- 上一篇:简易温度测量C语言编程
- 下一篇:网络对战象棋游戏源代码
评论
共有 条评论