找回密码
 注册
Simdroid-非首页
楼主: RisenyoungCui

[前后处理] 求教FLAC3D6.0导入到Tecplot

[复制链接]
发表于 2021-9-7 00:11:52 | 显示全部楼层 来自 四川
rmy 发表于 2018-8-29 10:56
你也不留个邮箱,我怎么发啊


1026279332@qq.com,谢谢,也帮忙发一下
回复 不支持

使用道具 举报

发表于 2022-1-9 20:09:34 | 显示全部楼层 来自 江苏南京
Simdroid开发平台
能发一份6.0转tecplot的文件吗?谢谢了!1074254152@qq.com

回复 不支持

使用道具 举报

发表于 2022-5-13 09:39:22 | 显示全部楼层 来自 中国
rmy 发表于 2018-8-28 17:19
修改一下就可以了

辛苦大佬发一份 1304080346@qq.com
回复 不支持

使用道具 举报

发表于 2022-11-13 19:27:22 | 显示全部楼层 来自 广西南宁
Clioli 发表于 2022-5-13 09:39
辛苦大佬发一份

您好,麻烦问一下,您收到了吗,能给我来一份嘛,1525429591@qq.com
回复 不支持

使用道具 举报

发表于 2022-12-29 21:27:54 | 显示全部楼层 来自 湖南衡阳
rmy 发表于 2018-8-29 10:56
你也不留个邮箱,我怎么发啊

445316072@qq.com,感谢
回复 不支持

使用道具 举报

发表于 2023-2-27 11:29:19 | 显示全部楼层 来自 湖北武汉
rmy 发表于 2018-8-28 17:19
修改一下就可以了

老师能发一下6.0的嘛  935115886@qq.com
回复 不支持

使用道具 举报

发表于 2023-2-27 13:37:42 | 显示全部楼层 来自 湖北武汉
rmy 发表于 2018-8-28 17:19
修改一下就可以了

能发我一下嘛?935115886@qq.com
回复 不支持

使用道具 举报

发表于 2023-4-29 13:27:11 | 显示全部楼层 来自 中国
rmy 发表于 2018-8-28 17:19
修改一下就可以了

大神能发我一下吗?911612490@qq.com
回复 不支持

使用道具 举报

发表于 2023-7-12 09:50:21 | 显示全部楼层 来自 河南
你好,5.0的可以发我一份吗,谢谢,邮箱1487846196@qq.com
回复 不支持

使用道具 举报

发表于 2023-8-9 14:53:38 | 显示全部楼层 来自 江苏苏州
973730609@qq.com 大神发一份FLAC3D 6.0 to techplot的代码吧!谢谢啦
回复 不支持

使用道具 举报

发表于 2024-7-16 10:48:09 | 显示全部楼层 来自 中国
你好,flac6.0导入tecplot的代码可以给我也发一下吗?邮箱是1793315730@qq.com 感激不尽!
回复 不支持

使用道具 举报

发表于 5 天前 | 显示全部楼层 来自 四川成都

fish automatic-create on
;set fish sa off
program echo off
program        log off       
def ini_Flac2tec
    global IO_READ  = 0;
    global IO_WRITE = 1;To overwrite the exist file
    global IO_ASCII = 1;To write the file in ASCII format
    global N_RECORD = 10;MODIFY to set the figure count of each line
        global i=0;To control the loop
        global j=0;To mark the new indices of Nodes
    array my_Point(8)
    array buf(1)
        global ScaleFactor = 0;MODIFY to scale the transform
    global tec_file = 'FLAC3DMesh_deformation.dat';To define the write file name
        command;create an output range with the name writeRange
                ;MODIFY the group to define the range to deal with,Default the whole file,DON'T USE group XX not
                model range create 'writeRange';group v_fgc any group v_jy any group v_rtjc any
        endcommand
end;End of ini_Flac2tec
@ini_Flac2tec
;;
;;Write Tecplot File Head
def write_FileHead
        local p_gp=gp.head
        i=0
        loop while p_gp # null
                if range.isin('writeRange',p_gp) = 1  then
                        i=i+1
                endif
                p_gp = gp.next(p_gp);next grid point
        endloop
        local p_z=zone.head
        j=0
        loop while p_z # null
                if range.isin('writeRange',p_z) = 1  then
                if zone.model(p_z) # 'NULL' then
                        j=j+1
                endif
                endif
                p_z = z.next(p_z);next zone
        endloop
    buf(1) =          ' \n'
    buf(1) = buf(1) + 'VARIABLES = "X" "Y" "Z" "DISP" "XDISP" "YDISP" "ZDISP" "Maximum Shear Stress" "SXZ" "SYZ" "Sig1" "Sig2" "Sig3"\n'
    buf(1) = buf(1) + 'ZONE T="FLAC3D Data" \n'
    buf(1) = buf(1) + 'N='+string(i)+','+'E='+string(j)+','+'ZONETYPE=FEBrick '
        buf(1) = buf(1) + 'DATAPACKING=block\n'+'VARLOCATION=([8-13]=CELLCENTERED)\n'
    buf(1) = buf(1) + 'DT=(SINGLE SINGLE SINGLE SINGLE SINGLE SINGLE SINGLE SINGLE SINGLE SINGLE SINGLE SINGLE SINGLE)'
    status = file.write(buf,1)
    ii=io.out('File Head has been written!')
end;End of write_FileHead
;;
;;Write Nodes' Coordinates X Y Z
def write_node
    ;Write x position  
    p_gp = gp.head
    loop while p_gp # null
                buf(1)=''
                n=1
                loop while n <= N_RECORD
                        if p_gp # null then
                                if range.isin('writeRange',p_gp) = 1  then
                                        buf(1) = buf(1)+string(gp.pos.x(p_gp)+gp.disp.x(p_gp)*ScaleFactor)+ '  '
                                        n=n+1
                                endif
                                p_gp = gp.next(p_gp)
                        else
                                n=N_RECORD+1
                        endif
                endloop
                status = file.write(buf,1)
    endloop
        ;
        ;Write y position  
    p_gp = gp.head
    loop while p_gp # null
                buf(1)=''
                n=1
                loop while n <= N_RECORD
                        if p_gp # null then
                                if range.isin('writeRange',p_gp) = 1  then
                                        buf(1) = buf(1)+string(gp.pos.y(p_gp)+gp.disp.y(p_gp)*ScaleFactor)+ '  '
                                        n=n+1
                                endif
                                p_gp = gp.next(p_gp)
                        else
                                n=N_RECORD+1
                        endif
                endloop
                status = file.write(buf,1)
    endloop
        ;
        ;Write z position  
    p_gp = gp.head
    loop while p_gp # null
                buf(1)=''
                n=1
                loop while n <= N_RECORD
                        if p_gp # null then
                                if range.isin('writeRange',p_gp) = 1  then
                                        buf(1) = buf(1)+string(gp.pos.z(p_gp)+gp.disp.z(p_gp)*ScaleFactor)+ '  '
                                        n=n+1
                                endif
                                p_gp = gp.next(p_gp)
                        else
                                n=N_RECORD+1
                        endif
                endloop
                status = file.write(buf,1)
    endloop
ii=io.out('Node coordinations have been written!')
end;End of write_node
;;
;;Write the data on Node
def write_nodeData
        ;Write total displacement
        p_gp = gp.head
    loop while p_gp # null
                buf(1)=''
                n=1
                loop while n <= N_RECORD
                        if p_gp # null then
                                if range.isin('writeRange',p_gp) = 1 then
                                        buf(1) = buf(1)+string(math.sqrt(gp.disp.x(p_gp)^2+gp.disp.y(p_gp)^2+gp.disp.z(p_gp)^2))+ '  '
                                        n=n+1
                                endif
                                p_gp = gp.next(p_gp)
                        else
                                n=N_RECORD+1
                        endif
                endloop
                status = file.write(buf,1)
    endloop
        ;Write x-displacement
    p_gp = gp.head
    loop while p_gp # null
                buf(1)=''
                n=1
                loop while n <= N_RECORD
                        if p_gp # null then
                                if range.isin('writeRange',p_gp) = 1 then
                                        buf(1) = buf(1)+string(gp.disp.x(p_gp))+ '  '
                                        n=n+1
                                endif
                                p_gp = gp.next(p_gp)
                        else
                                n=N_RECORD+1
                        endif
                endloop
                status = file.write(buf,1)
    endloop
        ;
        ;Write y-displcaement
    p_gp = gp.head
    loop while p_gp # null
                buf(1)=''
                n=1
                loop while n <= N_RECORD
                        if p_gp # null then
                                if range.isin('writeRange',p_gp) = 1  then
                                        buf(1) = buf(1)+string(gp.disp.y(p_gp))+ '  '
                                        n=n+1
                                endif
                                p_gp = gp.next(p_gp)
                        else
                                n=N_RECORD+1
                        endif
                endloop
                status = file.write(buf,1)
    endloop
        ;  
        ;write z-displacement
    p_gp = gp.head
    loop while p_gp # null
                buf(1)=''
                n=1
                loop while n <= N_RECORD
                        if p_gp # null then
                                if range.isin('writeRange',p_gp) = 1  then
                                        buf(1) = buf(1)+string(gp.disp.z(p_gp))+ '  '
                                        n=n+1
                                endif
                                p_gp = gp.next(p_gp)
                        else
                                n=N_RECORD+1
                        endif
                endloop
                status = file.write(buf,1)
    endloop
ii=io.out('Displacement data have been written!')
end;End of write_nodeData
;;
;;Write the data in Elements
def write_zoneData
        ;Write Maximum Shear Stress
    p_z = zone.head
    loop while p_z # null
                buf(1)=''
                n=1
                loop while n<=N_RECORD
                        if p_z # null then
                                if range.isin('writeRange',p_z) = 1 then
                                if zone.model(p_z) # 'NULL' then
                                        buf(1) = buf(1)+string(0.5*(zone.stress.max(p_z)-zone.stress.min(p_z)))+ '  '
                                        n=n+1
                                endif
                                endif
                                p_z = zone.next(p_z)
                        else
                                n=N_RECORD+1
                        endif
                endloop
                status = file.write(buf,1)
    endloop
        ;Write SXZ
    p_z = zone.head
    loop while p_z # null
                buf(1)=''
                n=1
                loop while n<=N_RECORD
                        if p_z # null then
                                if range.isin('writeRange',p_z) = 1 then
                                if zone.model(p_z) # 'NULL' then
                                        buf(1) = buf(1)+string(zone.stress.xz(p_z))+ '  '
                                        n=n+1
                                endif
                                endif
                                p_z = zone.next(p_z)
                        else
                                n=N_RECORD+1
                        endif
                endloop
                status = file.write(buf,1)
    endloop
        ;Write SYZ
    p_z = zone.head
    loop while p_z # null
                buf(1)=''
                n=1
                loop while n<=N_RECORD
                        if p_z # null then
                                if range.isin('writeRange',p_z) = 1 then
                                if zone.model(p_z) # 'NULL' then
                                        buf(1) = buf(1)+string(zone.stress.yz(p_z))+ '  '
                                        n=n+1
                                endif
                                endif
                                p_z = z.next(p_z)
                        else
                                n=N_RECORD+1
                        endif
                endloop
                status = file.write(buf,1)
    endloop
        ;Write Sig1 Max Princinple
    p_z = zone.head
    loop while p_z # null
                buf(1)=''
                n=1
                loop while n<=N_RECORD
                        if p_z # null then
                                if range.isin('writeRange',p_z) = 1 then
                                if zone.model(p_z) # 'NULL' then
                                        buf(1) = buf(1)+string(zone.stress.min(p_z))+ '  '
                                        n=n+1
                                endif
                                endif
                                p_z = zone.next(p_z)
                        else
                                n=N_RECORD+1
                        endif
                endloop
                status = file.write(buf,1)
    endloop
        ;Write Sig2 Mid Princinple
    p_z = zone.head
    loop while p_z # null
                buf(1)=''
                n=1
                loop while n<=N_RECORD
                        if p_z # null then
                                if range.isin('writeRange',p_z) = 1 then
                                if zone.model(p_z) # 'NULL' then
                                        buf(1) = buf(1)+string(zone.stress.int(p_z))+ '  '
                                        n=n+1
                                endif
                                endif
                                p_z = zone.next(p_z)
                        else
                                n=N_RECORD+1
                        endif
                endloop
                status = file.write(buf,1)
    endloop
        ;Write Sig3 Min Princinple
    p_z = zone.head
    loop while p_z # null
                buf(1)=''
                n=1
                loop while n<=N_RECORD
                        if p_z # null then
                                if range.isin('writeRange',p_z) = 1 then
                                if zone.model(p_z) # 'NULL' then
                                        buf(1) = buf(1)+string(zone.stress.max(p_z))+ '  '
                                        n=n+1
                                endif
                                endif
                                p_z = zone.next(p_z)
                        else
                                n=N_RECORD+1
                        endif
                endloop
                status = file.write(buf,1)
    endloop
ii=io.out('Element stress data have been written!')
end;End of write_zoneData
;;
;;Zone Connectivity List
;Calculate the maximum index of the array my_Grid()
def my_array
        p_gp=gp.head
        loop while p_gp # null
                ski=gp.id(p_gp)
                p_gp=gp.next(p_gp)
        endloop
end;End of my_array
@my_array
;
def write_zone
        ;create an array to store the grid point data
        array my_Grid(ski)
        ;initialize the grid point array
        p_gp=gp.head
        i=1
        loop while p_gp # null
                if range.isin('writeRange',p_gp) = 1  then
                        my_Grid(gp.id(p_gp))=i
                        i=i+1
                endif
                p_gp=gp.next(p_gp)
        endloop
        ;Write Zone Connectivity List
        p_z = zone.head
        loop while p_z # null
        if range.isin('writeRange',p_z) = 1  then
        if zone.model(p_z) # 'NULL' then
                if zone.gp.num(p_z) = 8 then;A
                ;1 2 5 3 4 7 8 6
                        my_Point(1)=string(my_Grid(gp.id(z.gp(p_z, 1))))
                        my_Point(2)=string(my_Grid(gp.id(z.gp(p_z, 2))))
                        my_Point(3)=string(my_Grid(gp.id(z.gp(p_z, 3))))
                        my_Point(4)=string(my_Grid(gp.id(z.gp(p_z, 4))))
                        my_Point(5)=string(my_Grid(gp.id(z.gp(p_z, 5))))
                        my_Point(6)=string(my_Grid(gp.id(z.gp(p_z, 6))))
                        my_Point(7)=string(my_Grid(gp.id(z.gp(p_z, 7))))
                        my_Point(8)=string(my_Grid(gp.id(z.gp(p_z, 8))))
                        ;
                        buf(1) = my_Point(1) + '  ' + my_Point(2)+ '  ' + my_Point(5)+ '  ' + my_Point(3)
                        buf(1) = buf(1)+ '  ' +my_Point(4) + '  ' + my_Point(7)+ '  ' + my_Point(8)+ '  ' + my_Point(6)
                else
                if zone.gp.num(p_z) = 4 then;B
                ;1 2 3 3 4 4 4 4
                        my_Point(1)=string(my_Grid(gp.id(z.gp(p_z, 1))))
                        my_Point(2)=string(my_Grid(gp.id(z.gp(p_z, 2))))
                        my_Point(3)=string(my_Grid(gp.id(z.gp(p_z, 3))))
                        my_Point(4)=string(my_Grid(gp.id(z.gp(p_z, 4))))
                        ;
                    buf(1) = my_Point(1) + '  ' + my_Point(2)+ '  ' + my_Point(3)+ '  ' + my_Point(3)
                            buf(1) = buf(1)+ '  ' +my_Point(4) + '  ' + my_Point(4)+ '  ' + my_Point(4)+ '  ' + my_Point(4)
                else  
                if zone.gp.num(p_z) = 6 then;C
                ;1 2 5 3 4 4 6 6 or 1 2 4 4 3 5 6 6
                        my_Point(1)=string(my_Grid(gp.id(z.gp(p_z, 1))))
                        my_Point(2)=string(my_Grid(gp.id(z.gp(p_z, 2))))
                        my_Point(3)=string(my_Grid(gp.id(z.gp(p_z, 3))))
                        my_Point(4)=string(my_Grid(gp.id(z.gp(p_z, 4))))
                        my_Point(5)=string(my_Grid(gp.id(z.gp(p_z, 5))))
                        my_Point(6)=string(my_Grid(gp.id(z.gp(p_z, 6))))
                        ;
                    buf(1) = my_Point(1) + '  ' + my_Point(2)+ '  ' + my_Point(4)+ '  ' + my_Point(4)
                            buf(1) = buf(1)+ '  ' +my_Point(3) + '  ' + my_Point(5)+ '  ' + my_Point(6)+ '  ' + my_Point(6)   
                else
                if zone.gp.num(p_z) = 5 then;D
                ;1 2 5 3 4 4 4 4
                        my_Point(1)=string(my_Grid(gp.id(z.gp(p_z, 1))))
                        my_Point(2)=string(my_Grid(gp.id(z.gp(p_z, 2))))
                        my_Point(3)=string(my_Grid(gp.id(z.gp(p_z, 3))))
                        my_Point(4)=string(my_Grid(gp.id(z.gp(p_z, 4))))
                        my_Point(5)=string(my_Grid(gp.id(z.gp(p_z, 5))))
                        ;
                    buf(1) = my_Point(1) + '  ' + my_Point(2)+ '  ' + my_Point(5)+ '  ' + my_Point(3)
                            buf(1) = buf(1)+ '  ' +my_Point(4) + '  ' + my_Point(4)+ '  ' + my_Point(4)+ '  ' + my_Point(4)  
                endif;A
                endif;B
                endif;C
                endif;D
                status = file.write(buf,1)
        endif
        endif;if inrange('writeRange',p_z) = 1 then
                p_z = zone.next(p_z);next zone
        endloop;loop while p_z # null
ii=io.out('Zone Connectivity List has been written!')
end;End of write_zone
;;
;;Main Function
def Flac2tec       
    status = file.close
        status = file.open(tec_file,IO_WRITE,IO_ASCII)
        if status = 0 then
            write_FileHead
            write_node
                write_nodeData
                write_zoneData
            write_zone
            status = file.close
            ii = io.out('Data File for Tecplot has been created!  ' + tec_file)
        else
            ii = io.out('Open File Error! Status = ' + string(status))                       
        endif
end;End of Flac2tec       
@Flac2tec
program system("preplot FLAC3DMesh_deformation.dat")
program echo on
;;If you do not have saved this project before
;; Your output-file would be in C:\Windows\System32

回复 不支持

使用道具 举报

您需要登录后才可以回帖 登录 | 注册

本版积分规则

Simapps系列直播

Archiver|小黑屋|联系我们|仿真互动网 ( 京ICP备15048925号-7 )

GMT+8, 2024-9-22 12:50 , Processed in 0.030491 second(s), 8 queries , Gzip On, MemCache On.

Powered by Discuz! X3.5 Licensed

© 2001-2024 Discuz! Team.

快速回复 返回顶部 返回列表