我无法得知二维情况下,循环中的公式是什么原理,或者说pn和co_xn是什么变量[Fortran] 纯文本查看 复制代码 subroutine get_jcob(detj,jcob,jinv,pn,co_xn)implicit none
real(8)::co_xn(nnd_e,dimens),detj
real(8)::jcob(dimens,dimens),jinv(dimens,dimens),pn(nnd_e,dimens)
integer::i,j,k
jcob=0.0;jinv=0.0
if(dimens==2) then
do i=1,nnd_e
jinv(1,1)=jinv(1,1)+pn(i,2)*co_xn(i,2)
jinv(1,2)=jinv(1,2)-pn(i,1)*co_xn(i,2)
jinv(2,1)=jinv(2,1)-pn(i,2)*co_xn(i,1)
jinv(2,2)=jinv(2,2)+pn(i,1)*co_xn(i,1)
end do
detj=jinv(1,1)*jinv(2,2)-jinv(1,2)*jinv(2,1)
|