資源描述:
《3DEC TO TECPLOT》由會(huì)員上傳分享,免費(fèi)在線閱讀,更多相關(guān)內(nèi)容在學(xué)術(shù)論文-天天文庫(kù)。
1、;;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=znum+1endloopbi=b_next(bi)en
2、dloopend@zonenum;definegpgpnumbi=block_headgpnum=0loopwhilebi#0p_gp=b_gp(bi)loopwhilep_gp#0p_gp=gp_next(p_gp)gpnum=gpnum+1endloopbi=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=i
3、i+1endloopbi=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)
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_hea
5、dloopwhilebi#0p_gp=b_gp(bi)loopwhilep_gp#0buf1(1)=''loopi(1,N_RECORD)ifp_gp#0thencaseofinfo_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_gp+gp_ydis(p_gp)*gp_ydis(p_
6、gp)dis_gp=dis_gp+gp_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=
7、b_next(bi)endloopend;;;Writezone-relateddata,suchasStressesdefinewrite_stressbi=block_headznum=0loopwhilebi#0p_z=b_zone(bi)loopwhilep_z#0buf1(1)=''loopi(1,N_RECORD)ifp_z#0thencaseofinfo_flagcase0buf1(1)=buf