- 1、原创力文档(book118)网站文档一经付费(服务费),不意味着购买了该文档的版权,仅供个人/单位学习、研究之用,不得用于商业用途,未经授权,严禁复制、发行、汇编、翻译或者网络传播等,侵权必究。。
- 2、本站所有内容均由合作方或网友上传,本站不对文档的完整性、权威性及其观点立场正确性做任何保证或承诺!文档内容仅供研究参考,付费前请自行鉴别。如您付费,意味着您自己接受本站规则且自行承担风险,本站不退款、不进行额外附加服务;查看《如何避免下载的几个坑》。如果您已付费下载过本站文档,您可以点击 这里二次下载。
- 3、如文档侵犯商业秘密、侵犯著作权、侵犯人身权等,请点击“版权申诉”(推荐),也可以打举报电话:400-050-0827(电话支持时间:9:00-18:30)。
- 4、该文档为VIP文档,如果想要下载,成为VIP会员后,下载免费。
- 5、成为VIP后,下载本文档将扣除1次下载权益。下载后,不支持退款、换文档。如有疑问请联系我们。
- 6、成为VIP后,您将拥有八大权益,权益包括:VIP文档下载权益、阅读免打扰、文档格式转换、高级专利检索、专属身份标志、高级客服、多端互通、版权登记。
- 7、VIP文档为合作方或网友上传,每下载1次, 网站将根据用户上传文档的质量评分、类型等,对文档贡献者给予高额补贴、流量扶持。如果你也想贡献VIP文档。上传文档
查看更多
#include stdafx.h
#include iostream
#include fstream
#include cmath
#includestring
using namespace std;
const double pi=4*atan(1.0);
double freq=45;
double sb=7.45;
double t1=2*pi/(sb*4);
double source(double t)
{
//double t2=0.0;
if(t=t1) return (sin(sb*4*t-pi/2)+1)/10;
else{ double tep=0.0; return tep;}
//return ((1-2*pi*pi*freq*freq*t*t)*exp(-pi*pi*freq*freq*t*t)+1);//Ricker子波
}
void update_Vn(double upt,double lowt,double upx1,double lowx1)
{
int i,j,m;
const int Csize=300;
double deg=0;
double stepx1=abs(upx1-lowx1)/(Csize-1);
//double te=sqrt(static_castdouble(3.0/8.0));
double stept=sqrt(static_castdouble(1.0/2.0))*stepx1/2.0;//
int tn=static_castint(upt/stept);
double r=stept/stepx1;
double **u_current,**u_old,**u_past;
u_current=new double *[Csize];
u_old=new double*[Csize];
u_past=new double*[Csize];
for(i=0;iCsize;i++)
{
u_current[i]=new double [Csize];
u_old[i]=new double[Csize];
u_past[i]=new double[Csize];
}
for(i=0;iCsize;i++)
for(j=0;jCsize;j++)
{
u_current[i][j]=0;
u_old[i][j]=0;
u_past[i][j]=0;
}
double ck[Csize][Csize];
int flag=0;
for(j=0;jCsize;j++)
{
for(i=0;iCsize;i++)
{
if(ji) ck[i][j]=4;
else ck[i][j]=1;
}
}
}
string str;
cout\n 输入保存文件名:;
cinstr;
ofstream fout(str);
if(!fout)
{
cout\n 不能打开文件strendl;exit(1);
}
m=0;
double f0=2.0/(stept*30);
double t0=4.0/f0;
while(m1500((m++)*stept+lowt)upt)
{
for(i=0;iCsize;i++)
for(j=0;jCsize;j++)
{
if((i!=0(i!=Csize-1))(j!=0j!=(Csize-1)))//cope with the internal points of the interesting domain
{
//if(i==(Csize/2)j==(Csize/2)) u_current[i][j]=(r*r/ck[i][j])*(u_old[i+1][j]+u_old[i][j+1]+u_old[i-1][j]+u_old[i][j-1])-2*u_old[i][j]*(2*r*r/ck[i][j]-1.0)-u_past[i][j]
//+stept*stept*source(m*stept+lowt);//stept*stept*exp(-f0*f0*(m*stept-t0)*(m*stept-t0));//stept*stept*source(m*stept+lowt);
//elseu_current[i][j]=(r*r/ck[i][j])*(u_old[i+1][
您可能关注的文档
最近下载
- 金属工艺学 全套课件.ppt VIP
- 外研版(三起)(2024)三年级下册英语Unit 4《What’s your hobby?》第1课时教案 .pdf VIP
- Unit 4 What's your hobby 第三课时教案 2024-2025学年度 外研版英语三年级下册.docx VIP
- 老年患者麻醉管理专家共识.pptx
- 景区运营管理合作协议.doc VIP
- HGT21629-2021管架标准图图集标准.docx VIP
- 保健食品要掌握的全部基本知识【58页】.pptx VIP
- MDCG 2020-7 上市后临床随访 (PMCF) 计划模板中文版.docx VIP
- 基坑土方回填施工策划方案.doc VIP
- 半导体材料课件课件.pptx VIP
文档评论(0)