首页 3DEC TO TECPLOT

3DEC TO TECPLOT

举报
开通vip

3DEC TO TECPLOT;;3DEC4.1MeshtoTecplot10.0/ahmky/仅适用于四面体ZONE,六面体ZONE需修改defini_mesh2tecIO_READ =0IO_WRITE=1IO_FISH =0IO_ASCII=1N_RECORD=8arraybuf(10),buf1(1)tec_file='汉字名字也可以.dat'end@ini_mesh2tec;;definezonenumbi=block_headznum=0loopwhilebi#0p_z=b_zone(bi)loopwhilep_z#0p_z=z_n...

3DEC TO  TECPLOT
;;3DEC4.1MeshtoTecplot10.0/ahmky/仅适用于四面体ZONE,六面体ZONE需修改defini_mesh2tecIO_READ =0IO_WRITE=1IO_FISH =0IO_ASCII=1N_RECORD=8arraybuf(10),buf1(1)tec_file='汉字名字也可以.dat'end@ini_mesh2tec;;definezonenumbi=block_headznum=0loopwhilebi#0p_z=b_zone(bi)loopwhilep_z#0p_z=z_next(p_z)znum=znum1endloopbi=b_next(bi)endloopend@zonenum;definegpgpnumbi=block_headgpnum=0loopwhilebi#0p_gp=b_gp(bi)loopwhilep_gp#0p_gp=gp_next(p_gp)gpnum=gpnum1endloopbi=b_next(bi)endloopend@gpgpnumdefineggpparrayggppi(gpnum,2)bi=block_headii=1loopwhilebi#0p_gp=b_gp(bi)loopwhilep_gp#0ggppi(ii,1)=p_gpggppi(ii,2)=iip_gp=gp_next(p_gp)ii=ii1endloopbi=b_next(bi)endloopii=ii-1end@ggpp;;;;WriteTecplotFileHeaddefwrite_mesh_headbuf(1)='TITLE  ="3DEC4.1MeshtoTecplotVersion10"'buf(2)='VARIABLES="X""Y""Z""DISP""XDISP"'buf(2)=buf(2)'"YDISP""ZDISP""SXX""SYY""SZZ""SIG1""SIG2""SIG3"'buf(3)='ZONET="Tecplotv10"'buf(4)='N='string(gpnum)','buf(4)=buf(4)'E='string(znum)',''ZONETYPE=FETETRAHEDRON,'buf(5)='DATAPACKING=BLOCK'buf(6)='VARLOCATION=([6-11]=CELLCENTERED)'buf(7)='DT=(SINGLESINGLESINGLESINGLESINGLE'buf(7)=buf(7)'SINGLESINGLESINGLESINGLE)'status=write(buf,7)end;;;;;WriteGridPointCoordinatesandDisplacementsdefwrite_disbi=block_headloopwhilebi#0p_gp=b_gp(bi)loopwhilep_gp#0buf1(1)=''loopi(1,N_RECORD)ifp_gp#0thencaseof info_flagcase0buf1(1)=buf1(1)string(gp_x(p_gp))' 'case1buf1(1)=buf1(1)string(gp_y(p_gp))' 'case9buf1(1)=buf1(1)string(gp_z(p_gp))' 'case2dis_gp=gp_xdis(p_gp)*gp_xdis(p_gp)dis_gp=dis_gpgp_ydis(p_gp)*gp_ydis(p_gp)dis_gp=dis_gpgp_zdis(p_gp)*gp_zdis(p_gp)dis_gp=sqrt(dis_gp)buf1(1)=buf1(1)string(dis_gp)' 'case4buf1(1)=buf1(1)string(gp_xdis(p_gp))' 'case8buf1(1)=buf1(1)string(gp_ydis(p_gp))' 'case10buf1(1)=buf1(1)string(gp_zdis(p_gp))' 'endcasep_gp=gp_next(p_gp)endifendloopstatus=write(buf1,1)endloopbi=b_next(bi)endloop end;;;Writezone-relateddata,suchasStressesdefinewrite_stressbi=block_headznum=0loopwhilebi#0p_z=b_zone(bi)loopwhilep_z#0buf1(1)=''loopi(1,N_RECORD)ifp_z#0thencaseof info_flagcase0buf1(1)=buf1(1)string(z_sxx(p_z))' 'case1buf1(1)=buf1(1)string(z_syy(p_z))' 'case2buf1(1)=buf1(1)string(z_szz(p_z))' 'case4buf1(1)=buf1(1)string(z_sig1(p_z))' 'case5buf1(1)=buf1(1)string(z_sig2(p_z))' 'case6buf1(1)=buf1(1)string(z_sig3(p_z))' 'endcasep_z=z_next(p_z)endifendloopstatus=write(buf1,1)endloopbi=b_next(bi)endloopend;;;WriteZoneConnectivitydefwrite_zoneifii#gpnumexitendif  bi=block_headloopwhilebi#0p_z=b_zone(bi)loopwhilep_z#0loopjj(1,ii)ifggppi(jj,1)=z_gp(p_z,1)buf1(1)=''buf1(1)=buf1(1)string(ggppi(jj,2))' 'endifendlooploopjj(1,ii)ifggppi(jj,1)=z_gp(p_z,2)buf1(1)=buf1(1)string(ggppi(jj,2))' 'endifendlooploopjj(1,ii)ifggppi(jj,1)=z_gp(p_z,3)buf1(1)=buf1(1)string(ggppi(jj,2))' 'endifendlooploopjj(1,ii)ifggppi(jj,1)=z_gp(p_z,4)buf1(1)=buf1(1)string(ggppi(jj,2))' 'endifendloopstatus=write(buf1,1)p_z=z_next(p_z)endloopbi=b_next(bi)endloopend;;;;MainFunctiondefmesh2tec  status=open(tec_file,IO_WRITE,IO_ASCII)ifstatus=0thenwrite_mesh_head;  info_flag=0write_disinfo_flag=1write_dis;info_flag=9write_disinfo_flag=2write_disinfo_flag=4write_disinfo_flag=8write_disinfo_flag=10write_dis;;    info_flag=0write_stressinfo_flag=1write_stressinfo_flag=2write_stressinfo_flag=4write_stressinfo_flag=5write_stressinfo_flag=6write_stress;write_zonestatus=closeii=out('buzhidaonengbunengyong'tec_file)elseii=out('OpenFileError!Status='string(status))      endif      end@mesh2tec
本文档为【3DEC TO TECPLOT】,请使用软件OFFICE或WPS软件打开。作品中的文字与图均可以修改和编辑, 图片更改请在作品中右键图片并更换,文字修改请直接点击文字进行修改,也可以新增和删除文档中的内容。
该文档来自用户分享,如有侵权行为请发邮件ishare@vip.sina.com联系网站客服,我们会及时删除。
[版权声明] 本站所有资料为用户分享产生,若发现您的权利被侵害,请联系客服邮件isharekefu@iask.cn,我们尽快处理。
本作品所展示的图片、画像、字体、音乐的版权可能需版权方额外授权,请谨慎使用。
网站提供的党政主题相关内容(国旗、国徽、党徽..)目的在于配合国家政策宣传,仅限个人学习分享使用,禁止用于任何广告和商用目的。
下载需要: 免费 已有0 人下载
最新资料
资料动态
专题动态
is_654168
暂无简介~
格式:doc
大小:29KB
软件:Word
页数:16
分类:
上传时间:2022-08-05
浏览量:2