*GET,Nnod,NODE,0,COUNT !得到总的节点数
*DIM,XYZ,ARRAY,Nnod,3 !定义两个数组分别存储节点号和节点坐标
*DIM,Nodes,ARRAY,Nnod
*DIM,Disp,ARRAY,Nnod,3
*DIM,Load,ARRAY,Nnod,3
*GET,Nd,NODE,0,NUM,MIN !得到最小的节点号
*DO,I,1,Nnod,1 !通过循环把节点号存在Nodes数组中,把节点坐标存在XYZ数组中
Nodes(I)=Nd
XYZ(I,1)=NX(Nd)
XYZ(I,2)=NY(Nd)
XYZ(I,3)=NZ(Nd)
Nd=NDNEXT(Nd)
*GET,Disp(I,1),NODE,I,U,X !得到每个节点的位移
*GET,Disp(I,2),NODE,I,U,Y
*GET,Disp(I,3),NODE,I,U,Z
*GET,Load(I,1),NODE,I,F,FX !得到每个节点的力
*GET,Load(I,2),NODE,I,F,FY
*GET,Load(I,3),NODE,I,F,FZ
*ENDDO
*GET,Nelm,ELEM,0,COUNT !得到总的单元数
*DIM,Elems,ARRAY,Nelm !定义两个数组分别存储单元号和单元的节点
*DIM,Ndlst,ARRAY,Nelm,4
*GET,El,ELEM,0,NUM,MIN !得到最小的单元号
*DO,I,1,Nelm,1 !通过循环把节点号存在Elems数组中,把单元节点存在Ndlst数组中
Elems(I)=El
*DO,J,1,4,1
Ndlst(I,J)=NELEM(El,J)
*ENDDO
El=ELNEXT(El)
*ENDDO
*GET,EX,Ex,1,TEMP, , !得到杨氏模量和泊松比
*GET,PRXY,PRXY,1,TEMP, ,
*cfopen,data,txt !打开文件,将数据存入
*vwrite,
("Nodes")
*vwrite,Nodes(1),XYZ(1,1),XYZ(1,2),XYZ(1,3)
(F10.0,F10.2,F10.2,F10.2)
*vwrite,
("Elements")
*vwrite,Elems(1),Ndlst(1,1),Ndlst(1,2),Ndlst(1,3),Ndlst(1,4)
(F10.0,F10.0,F10.0,F10.0,F10.0)
*vwrite,
("EX")
*vwrite,EX
(E10.2)
*vwrite,
("PRXY")
*vwrite,PRXY
(F10.2)
*vwrite,
("Displacement")
*vwrite,Nodes(1),Disp(1,1),Disp(1,2),Disp(1,3)
(F10.0,F20.15,F20.15,F20.15)
*vwrite,
("Load")
*vwrite,Nodes(1),Load(1,1),Load(1,2),Load(1,3)
(F10.0,F10.2,F10.2,F10.2)
*cfclose |