您好,欢迎访问三七文档
当前位置:首页 > 建筑/环境 > 工程监理 > Flac3D_to_tecplot后处理____转换程序,直接在flac中运行
;;08/04/2009;;Modifications:;;(1)½«Ó¦Á¦Êä³öÏîÔö¼ÓΪ(SIG1,SIG2,SIG3,SXX,SYY,SZZ,SXY,SYZ,SZX,SHEAR_N,TENSION_N,SHEAR_P,TENSION_P);;;;01/12/2007;;Modifications:;;(1)½«Ó¦Á¦Êä³öÏîÔö¼ÓΪ(SIG1,SIG2,SIG3,SXX,SYY,SZZ,SXY,SYZ,SZX);;(2)¿É¿ØÖÆÊä³öµÄGROUP£¬Èô²»ÏëÊä³öij¸ö×飬Çërannametec_rangeºóÃæ¼ÓÈë×éÃû;;;;18/12/2006;;Modifications:;;(1)adaptedtoalltypesofzones(brick,pyramid,wedge,tetra);;(2)Ifallthezonesaretetra,usetheformatZONETYPE=FETETRAHEDRON;;;;9/14/2004;;Modifications:;;(1)changedatapackingmodefrompointtoblock;;(2)addzone-relatedinfotobeplotted;;;;9/11/2004;;Modifications:;;(1)addrangetec_rangetosetplotrange;;(2)addfunctionplot_testtohidenullzones;;;;7/11/2004;;Flac3dMeshtoTecplot;;Limits:;;(1)ZoneType----TETRAHEDRONorBRICK;;(2)TecplotVersion----Version10;;(3)OnlyDISPLACEMENTSofGridPointsareoutputted;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;Initializationdefini_mesh2tecIO_READ=0IO_WRITE=1IO_FISH=0IO_ASCII=1N_RECORD=5;;;;;;;;;;;;;;;;Êý¾Ýÿ5¸ö´æ·ÅÒ»ÐÐZONE_NGP=z_numgp(zone_head)arraybuff(1)tec_file='tec10_hole.dat';;Editthetec_rangetosetplotrangecommand;grouphaitangrangegroup6anygroup7any;modelnullrangegrouphaitangnotrannametec_rangeendcommandendini_mesh2tec;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;Ifplotit=1,plotthezonedefplot_testplotit=1ifz_model(p_z)='NULL'thenplotit=0endififinrange('tec_range',p_z)=0thenplotit=0endifend;;Getnumberofzonestoplotdefget_nzonen_zone=0numzones=0p_z=zone_headloopwhilep_z#nullnumzones=numzones+1plot_testifplotit=1thenn_zone=n_zone+1endifp_z=z_next(p_z)endloopendget_nzone;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;WriteTecplotFileHeaddefwrite_headbuff(1)='TITLE=FLAC3DtoTecplot10\n'buff(1)=buff(1)+'VARIABLES=X(m)\nY(m)\nZ(m)\n'buff(1)=buff(1)+'DISP(mm)\nXDISP(mm)\nYDISP(mm)\nZDISP(mm)\n'buff(1)=buff(1)+'SIG1(MPa)\nSIG2(MPa)\nSIG3(MPa)\n'buff(1)=buff(1)+'SXX(MPa)\nSYY(MPa)\nSZZ(MPa)\n'buff(1)=buff(1)+'SXY(MPa)\nSYZ(MPa)\nSZX(MPa)\n'buff(1)=buff(1)+'SHEAR_N\nTENSION_N\nSHEAR_P\nTENSION_P\n'buff(1)=buff(1)+'ZONET=GLOBAL\n'buff(1)=buff(1)+'N='+string(ngp)+','buff(1)=buff(1)+'E='+string(n_zone)+','buff(1)=buff(1)+'ZONETYPE=FEBrick\n'buff(1)=buff(1)+'DATAPACKING=BLOCK\n'buff(1)=buff(1)+'VARLOCATION=([8-20]=CELLCENTERED)\n'buff(1)=buff(1)+'DT=(SINGLESINGLESINGLE'buff(1)=buff(1)+'SINGLESINGLESINGLESINGLE'buff(1)=buff(1)+'SINGLESINGLESINGLE'buff(1)=buff(1)+'SINGLESINGLESINGLE'buff(1)=buff(1)+'SINGLESINGLESINGLE'buff(1)=buff(1)+'SINGLESINGLESINGLESINGLE)'status=write(buff,1)end;;Calculatedisplacementmagnitudedefget_gp_dispgp_disp=gp_xdisp(p_gp)*gp_xdisp(p_gp)gp_disp=gp_disp+gp_ydisp(p_gp)*gp_ydisp(p_gp)gp_disp=gp_disp+gp_zdisp(p_gp)*gp_zdisp(p_gp)gp_disp=sqrt(gp_disp)end;;Writegp-relateddata,suchasCoordinatesandDisplacementsdefwrite_gp_infop_gp=gp_headloopwhilep_gp#nullbuff(1)=''loopi(1,N_RECORD)ifp_gp#nullthencaseofinfo_flagcase0buff(1)=buff(1)+string(gp_xpos(p_gp))+''case1buff(1)=buff(1)+string(gp_ypos(p_gp))+''case2buff(1)=buff(1)+string(gp_zpos(p_gp))+''case4get_gp_dispbuff(1)=buff(1)+string(gp_disp*1000)+''case8buff(1)=buff(1)+string(gp_xdisp(p_gp)*1000)+''case16buff(1)=buff(1)+string(gp_ydisp(p_gp)*1000)+''case32buff(1)=buff(1)+string(gp_zdisp(p_gp)*1000)+''endcasep_gp=gp_next(p_gp)endifendloopstatus=write(buff,1)endloopend;;Writezone-relateddata,suchasStressesdefwrite_zone_info_stressp_z=zone_headloopwhilep_z#nullbuff(1)=''loopi(1,N_RECORD)ifp_z#nullthenplot_testifplotit=1thencaseofinfo_flagcase0buff(1)=buff(1)+string(z_sig3(p_z)*0.000001)+''case1buff(1)=buff(1)+string(z_sig2(p_z)*0.000001)+''case2buff(1)=buff(1)+string(z_sig1(p_z)*0.000001)+''case4buff(1)=buff(1)+string(z_sxx(p_z)*0.000001)+''case8buff(1)=buff(1)+string(z_syy(p_z)*0.000001)+''case16buff(1)=buff(1)+string(z_szz(p_z)*0.000001)+''case32buff(1)=buff(1)+string(z_sxy(p_z)*0.000001)+''case64buff(1)=buff(1)+string(z_syz(p_z)*0.000001)+''case128buff(1)=buff(1)+string(z_sxz(p_z)*0.000001)+''endcaseendifp_z=z_next(p_z)endifendloopstatus=write(buff,1)endloopend;;Writezone-relateddata,suchasStatesdefwrite_zone_info_stateshear_n=1tension_n=2shear_p=4tension_p=8state=0p_z=zone_headloopwhilep_z#nullbuff(1)=''loopi(1,N_RECORD)ifp_z#nullthenplot_testifplotit=1thencaseofinfo_flagcase1ifand(z_state(p_z,0),shear_n)=shear_nthenstate=1elsestate=0endifbuff(1)=buff(1)+string(state)+''case2ifand(z_state(p_z,0),tension_n)=tension_nthenstate=1elsestate=0endifbuff(1)=buff(1)+string(state)+''case4ifand(z_state(p_z,0),shear_p)=shear_pthenstate=1elsestate=0endifbuff(1)=buff(1)+string(state)+''case8ifand(z_state(p_z,0),tension_p)=tension_pthenstate=1elsestate=0endifbuff(1)=buff(1)+string(state)+''endcaseendifp_z=z_next(p_z)endifendloopstatus=write(buff,1)endloopend;;WriteZoneConnectivitydefwrite_zonep_z=zone_headtetranum=0bricknum=0wedgenum=0pyramidnum=0loopwhilep_z#nullbuff(1)=''Z1_code=z_code(p_z)ifZ1_code=4thentetranum=tetranum+1buff(1)=buff(1)+string(gp_id(z_gp(p_z,1)))+''buff(1)=buff(1)+string(gp_id(z_gp(p_z,2)))+''buff(1)=buff(1)+string(gp_id(z_gp(p_z,3)))+''buff(1)=buff(1)+string(gp_id(z_gp(p_z,3)))+''buff(1)=buff(1)+string(gp_id(z_gp(p_z,4)))+''b
本文标题:Flac3D_to_tecplot后处理____转换程序,直接在flac中运行
链接地址:https://www.777doc.com/doc-3477864 .html