Program test
Type ClassNode
Real(8) x,y!节点坐标
Real(8) E,v!材料属性
End Type
Type ClassElement!三角形单元
Type(ClassNode),Pointer::Node(:)
End Type
Type(ClassNode) , target :: Node(4)
Type(ClassElement) :: Element
Node(1).x=10
Node(2).x=20
Node(3).x=30
Node(4).x=40
Element.Node(1) => Node(1)
Element.Node(2) => Node(3)
Element.Node(3) => Node(4)
Print*,Element.Node(1).x,',',Element.Node(2).x,',',Element.Node(3).x
Pause
End
Program test
Type ClassNode
Real(8) x,y!节点坐标
Real(8) E,v!材料属性
End Type
Type ClassElement!三角形单元
Type(ClassNode),Pointer::Node(:)
End Type
Type(ClassNode) , target :: Node(5)
Type(ClassElement) :: Element
Node(:).x=[10,20,30,40,50]
Element.Node => Node(1:5:2)
Print * , Element.Node(1:3).x
Pause
End Program test
Program test
Type ClassNode
Real(8) x,y!节点坐标
Real(8) E,v!材料属性
End Type
Type ClassElement!三角形单元
Type(ClassNode),Pointer::Node
End Type
Type(ClassNode) , target :: Node(5)
Type(ClassElement) :: Element(3)
Node(:).x=[10,20,30,40,50]
Element(1).Node => Node(1)
Element(2).Node => Node(3)
Element(3).Node => Node(4)
Print * , Element(1).Node.x , Element(2).Node.x , Element(3).Node.x
Pause
End Program test
欢迎光临 Fortran Coder (http://bbs.fcode.cn/) | Powered by Discuz! X3.2 |