[Fortran] 纯文本查看 复制代码 program main
implicit none
integer,parameter::NP = SELECTED_REAL_KIND(8)
real(Kind = NP)::emod,nu
real(Kind = NP),dimension(6)::destrain,dstress
real(Kind = NP),dimension(6,6)::dompl
!=====================================================
emod=70000.0
nu=0.15
dompl=0.0
dompl(1,1)=(emod*(1.0-nu))/((1+nu)*(1.0-2.0*nu))
dompl(2,2)=(emod*(1.0-nu))/((1+nu)*(1.0-2.0*nu))
dompl(3,3)=(emod*(1.0-nu))/((1+nu)*(1.0-2.0*nu))
dompl(1,2)=(emod*nu)/((1.0+nu)*(1.0-2.0*nu))
dompl(2,1)=(emod*nu)/((1.0+nu)*(1.0-2.0*nu))
dompl(2,3)=(emod*nu)/((1.0+nu)*(1.0-2.0*nu))
dompl(3,2)=(emod*nu)/((1.0+nu)*(1.0-2.0*nu))
dompl(1,3)=(emod*nu)/((1.0+nu)*(1.0-2.0*nu))
dompl(3,1)=(emod*nu)/((1.0+nu)*(1.0-2.0*nu))
dompl(4,4)=emod/(1.0+nu)
dompl(5,5)=emod/(1.0+nu)
dompl(6,6)=emod/(1.0+nu)
destrain(1)=-0.000005
destrain(2)=-nu*destrain(1)
destrain(3)=-nu*destrain(1)
destrain(4)=0.0
destrain(5)=0.0
destrain(6)=0.0
dstress=matmul(dompl,destrain)
write(*,*) dstress
end program
为什么用matmul函数运算6×6的矩阵乘以6×1的矩阵得到的结果好像不对,结果的第二和第三个参数不应该是一样的吗?
|