!木材DLOAD検証用CLOAD
implicit real*8(a-h,o-z)
dimension x(315500),y(315500),z(315500),e66(6,6),b(3,3)&
&,mesh(300000,8),meshkou(300000,8)
b1=1.0d-1
h1=1.0d-1
ell=1.0d0
!要素分割
nx1=14
ny1=14
nz=500
nitimen=(nx1+1)*(ny1+1)
!荷重設定は下で
p=-0.01d0
!ヤング率
ezz=7.694d3!z軸方向のヤング率
exx=ezz/25.0d0!x軸方向のヤング率
eyy=ezz/25.0d0!y軸方向のヤング率
!ポアソン比
poixy=0.016d0
poixz=poixy
poiyx=poixy
poiyz=poixy
poizx=0.4d0
poizy=poizx
!せん断弾性係数の入力
gxy=ezz/15.0d0
gxz=gxy
gyz=gxy
!1つあたりの要素の長さ?
xn1=b1/nx1
yn1=h1/ny1
zn=ell/nz
!節点番号ごとの節点座標!i~mで始まるのがdoで使える
!真ん中部分の鋼材の節点
do k=0,nz
do j=0,ny1
do i=1,nx1+1
nset=i+j*(nx1+1)+k*nitimen
x(nset)=(i-1)*xn1
y(nset)=j*yn1
z(nset)=k*zn
end do
end do
end do
!i5~6が整数,aが文字,f9,6が小数.1peとかはeの＊乗
!接点番号と座標の出力
print'("*NODE, NSET=NALL")'
do i=1,(nz+1)*nitimen
print'(i6,a,f9.6,a,f9.6,a,f9.6)',&
&i,',',x(i),',',y(i),',',z(i)
end do
!要素番号とその要素の8接点の接点番号
nyou=0
do k=0,nz-1
do j=0,ny1-1
do i=1,nx1
nyou=nyou+1
mesh(nyou,1)=i+j*(nx1+1)+k*nitimen
mesh(nyou,2)=mesh(nyou,1)+nx1+1
mesh(nyou,3)=mesh(nyou,2)+nitimen
mesh(nyou,4)=mesh(nyou,1)+nitimen
mesh(nyou,5)=mesh(nyou,1)+1
mesh(nyou,6)=mesh(nyou,2)+1
mesh(nyou,7)=mesh(nyou,3)+1
mesh(nyou,8)=mesh(nyou,4)+1
end do
end do
end do
print'("*ELEMENT, TYPE=C3D8, ELSET=Emoku")'
do i=1,nz*(nx1*ny1)
print'(i6,a,i6,a,i6,a,i6,a,i6,a,i6,a,i6,a,i6,a,i6)',&
&i,',',&
&mesh(i,1),',',&
&mesh(i,2),',',&
&mesh(i,3),',',&
&mesh(i,4),',',&
&mesh(i,5),',',&
&mesh(i,6),',',&
&mesh(i,7),',',&
&mesh(i,8)
end do
nyousosuu=nz*nitimen
!載荷接点、拘束接点の設定
!cgxでやるのめんどいので節点指定
print'("*NSET,NSET=kousoku")'
do i=1,nitimen
nkousoku=i
print'(i6,a)',nkousoku,','
end do
print'("*NSET,NSET=saika4")'
do m=0,1
do l=0,1
nsaika4=nitimen-(nx1+1)+1+l*nx1+m*nitimen*nz
print'(i6,a)',nsaika4,','
end do
end do
print'("*NSET,NSET=saika2")'!左右
do l=0,1
do i=1,nx1-1
nsaika2=nitimen-(nx1+1)+1+i+l*nitimen*nz
print'(i6,a)',nsaika2,','
end do
end do
print'("*NSET,NSET=saika3")'!上下
do k=0,nz-2
do l=0,1
nsaika3=nitimen*2-(nx1+1)+1+l*nx1+k*nitimen
print'(i6,a)',nsaika3,','
end do
end do
print'("*NSET,NSET=saikap")'!Pかかる点
do k=0,nz-2
do i=1,nx1-1
nsaikap=nitimen*2-(nx1+1)+1+i+k*nitimen
print'(i6,a)',nsaikap,','
end do
end do
nsaikapsuu=(nx1-1)*(nz-1)
nsaika2suu=(nx1-1)*2+(nz-1)*2
nsaika4suu=4
!
nsaikapsousuu=nsaika4suu/4+nsaika2suu/2+nsaikapsuu
ptou=p/nsaikapsousuu
p2=ptou/2
p4=ptou/4
!一応
print'("**settensuu")'
print'(A,a,i6)','**saikapsuu',',',nsaikapsuu
print'(A,a,i6)','**saika4suu',',',nsaika4suu
print'(A,a,i6)','**saika2suu',',',nsaika2suu
! 境界条件
print'("*BOUNDARY")'
print'("kousoku,1,3")'
! 木材の設定
print'("*MATERIAL,NAME=ELmoku")'
print'("*ELASTIC,TYPE=ORTHOROPIC")'
call ortho(e66,exx,eyy,ezz,poixy,poixz,poiyz,gyz,&
& gxz,gxy,poiyx,poizx,poizy)
print'(f12.4,a,f12.4,a,f12.4,a,&
&f12.4,a,f12.4,a,f12.4,a,f12.4,&
& a ,f12.4,a)',&
&e66(1,1),',',e66(1,2),',',e66(2,2),',',e66(1,3),','& 
&,e66(2,3),',',e66(3,3),',',e66(6,6),',',e66(5,5),','
print'(f12.4,a,a)',e66(4,4),',','293'
print'("*SOLID SECTION,ELSET=Emoku,MATERIAL=ELmoku")'
! 載荷条件
print'("*STEP")'
print'("*STATIC,SOLVER=SPOOLES")'
print'("*CLOAD")'
print'(A,a,i6,a,1pe13.5)','saika4',',',2,',',p4
print'(A,a,i6,a,1pe13.5)','saika2',',',2,',',p2
print'(A,a,i6,a,1pe13.5)','saika3',',',2,',',p2
print'(A,a,i6,a,1pe13.5)','saikap',',',2,',',ptou
! datのオプション
print'("*NODE PRINT,NSET=Nall")'
print'("U")'
print'("*NODE FILE")'
print'("U")'
print'("*END STEP")'
!
!
!
end
!######## 直交異方性の定数を出すプログラム ########
subroutine ortho(e66,exx,eyy,ezz,poixy,poixz,poiyz,gyz,&
&gxz,gxy,poiyx,poizx,poizy)
implicit real*8(a-h,o-z)
dimension e66(6,6),b(3,3)
!応力－ひずみ行列：e66
do i=1,6
do j=1,6
e66(i,j)=0.d0
end do
end do
!  
e66(1,1)=1.d0/exx
e66(1,2)=-poixy/exx
e66(1,3)=-poixz/exx
e66(2,1)=-poiyx/eyy
e66(2,2)=1.d0/eyy
e66(2,3)=-poiyz/eyy
e66(3,1)=-poizx/ezz
e66(3,2)=-poizy/ezz
e66(3,3)=1.d0/ezz
!
!****** 逆行列を取って、応力－ひずみ行列に変換する******
det=e66(1,1)*e66(2,2)*e66(3,3)+e66(2,1)*e66(3,2)*e66(1,3)&
&+e66(3,1)*e66(1,2)*e66(2,3)-e66(2,1)*e66(1,2)*e66(3,3)&
&-e66(3,1)*e66(2,2)*e66(1,3)-e66(1,1)*e66(3,2)*e66(2,3)
b(1,1)=(-1.d0)**(1+1)*(e66(2,2)*e66(3,3)-e66(3,2)*e66(2,3))
b(1,2)=(-1.d0)**(1+2)*(e66(2,1)*e66(3,3)-e66(3,1)*e66(2,3))
b(1,3)=(-1.d0)**(1+3)*(e66(2,1)*e66(3,2)-e66(3,1)*e66(2,2))
b(2,1)=(-1.d0)**(2+1)*(e66(1,2)*e66(3,3)-e66(3,2)*e66(1,3))
b(2,2)=(-1.d0)**(2+2)*(e66(1,1)*e66(3,3)-e66(3,1)*e66(1,3))
b(2,3)=(-1.d0)**(2+3)*(e66(1,1)*e66(3,2)-e66(3,1)*e66(1,2))
b(3,1)=(-1.d0)**(3+1)*(e66(1,2)*e66(2,3)-e66(2,2)*e66(1,3))
b(3,2)=(-1.d0)**(3+2)*(e66(1,1)*e66(2,3)-e66(2,1)*e66(1,3))
b(3,3)=(-1.d0)**(3+3)*(e66(1,1)*e66(2,2)-e66(2,1)*e66(1,2))
do i=1,3
do j=1,3
e66(i,j)=b(j,i)/det
end do
end do
!
!****** せん断補正係数を入力 ******
!print*,'xy面のせん断弾性係数を入れて下さい'
!read*, gxy
e66(4,4)=gyz
!print*,'xz面のせん断弾性係数を入れて下さい'
!read*, gxz
e66(5,5)=gxz
!print*,'yz面のせん断弾性係数を入れて下さい'
!read*, gyz
e66(6,6)=gxy
!
!
return
end
