CalculiX  2.13
A Free Software Three-Dimensional Structural Finite Element Program
objective_stress_dx.f File Reference

Go to the source code of this file.

Functions/Subroutines

subroutine objective_stress_dx (nodeset, istartset, iendset, ialset, nk, idesvarc, iobject, dgdx, ndesi, nobject, stn, dstn, objectset, g0)
 

Function/Subroutine Documentation

◆ objective_stress_dx()

subroutine objective_stress_dx ( integer  nodeset,
integer, dimension(*)  istartset,
integer, dimension(*)  iendset,
integer, dimension(*)  ialset,
integer  nk,
integer  idesvarc,
integer  iobject,
real*8, dimension(ndesi,nobject)  dgdx,
integer  ndesi,
integer  nobject,
real*8, dimension(6,*)  stn,
real*8, dimension(6,*)  dstn,
character*81, dimension(4,*)  objectset,
real*8, dimension(nobject)  g0 
)
21 !
22 ! calculates derivative of the sum of the square of the
23 ! von Mises stress of a node set w.r.t. the coordinates of the mesh
24 !
25  implicit none
26 !
27  character*81 objectset(4,*)
28 !
29  integer nk,istartset(*),iendset(*),ialset(*),nodeset,
30  & idesvarc,iobject,j,k,ndesi,nobject,idesvar
31 !
32  real*8 dgdx(ndesi,nobject),stn(6,*),dstn(6,*),g0(nobject),
33  & rho,xstress,svm,dsvmdx,p
34 !
35  idesvar=idesvarc+1
36 !
37 ! reading rho and the mean stress for the Kreisselmeier-Steinhauser
38 ! function
39 !
40  read(objectset(2,iobject)(41:60),'(f20.0)') rho
41  read(objectset(2,iobject)(61:80),'(f20.0)') xstress
42 !
43 ! check for the existence of a set, else take the complete mesh
44 !
45  if(nodeset.eq.0) then
46  do j=1,nk
47  p=-(stn(1,j)+stn(2,j)+stn(3,j))/3.d0
48  svm=dsqrt(1.5d0*
49  & ((stn(1,j)+p)**2+(stn(2,j)+p)**2+(stn(3,j)+p)**2+
50  & 2.d0*(stn(4,j)**2+stn(5,j)**2+stn(6,j)**2)))
51  dsvmdx=
52  & (2.d0*stn(1,j)-stn(2,j)-stn(3,j))*dstn(1,j)+
53  & (2.d0*stn(2,j)-stn(1,j)-stn(3,j))*dstn(2,j)+
54  & (2.d0*stn(3,j)-stn(1,j)-stn(2,j))*dstn(3,j)+
55  & 6.d0*(stn(4,j)*dstn(4,j)+stn(5,j)*dstn(5,j)+
56  & stn(6,j))
57  dgdx(idesvar,iobject)=dgdx(idesvar,iobject)+
58  & dexp(rho*svm/xstress)*dsvmdx
59  enddo
60  dgdx(idesvar,iobject)=dgdx(idesvar,iobject)*
61  & dexp(-rho*g0(iobject))/xstress
62  else
63  do j=istartset(nodeset),iendset(nodeset)
64  if(ialset(j).gt.0) then
65  k=ialset(j)
66  p=-(stn(1,k)+stn(2,k)+stn(3,k))/3.d0
67  svm=dsqrt(1.5d0*
68  & ((stn(1,k)+p)**2+(stn(2,k)+p)**2+(stn(3,k)+p)**2+
69  & 2.d0*(stn(4,k)**2+stn(5,k)**2+stn(6,k)**2)))
70  dsvmdx=
71  & (2.d0*stn(1,k)-stn(2,k)-stn(3,k))*dstn(1,k)+
72  & (2.d0*stn(2,k)-stn(1,k)-stn(3,k))*dstn(2,k)+
73  & (2.d0*stn(3,k)-stn(1,k)-stn(2,k))*dstn(3,k)+
74  & 6.d0*(stn(4,k)*dstn(4,k)+stn(5,k)*dstn(5,k)+
75  & stn(6,k))
76  dgdx(idesvar,iobject)=dgdx(idesvar,iobject)+
77  & dexp(rho*svm/xstress)*dsvmdx
78  else
79  k=ialset(j-2)
80  do
81  k=k-ialset(j)
82  if(k.ge.ialset(j-1)) exit
83  p=-(stn(1,k)+stn(2,k)+stn(3,k))/3.d0
84  svm=dsqrt(1.5d0*
85  & ((stn(1,k)+p)**2+(stn(2,k)+p)**2+(stn(3,k)+p)**2+
86  & 2.d0*(stn(4,k)**2+stn(5,k)**2+stn(6,k)**2)))
87  dsvmdx=
88  & (2.d0*stn(1,k)-stn(2,k)-stn(3,k))*dstn(1,k)+
89  & (2.d0*stn(2,k)-stn(1,k)-stn(3,k))*dstn(2,k)+
90  & (2.d0*stn(3,k)-stn(1,k)-stn(2,k))*dstn(3,k)+
91  & 6.d0*(stn(4,k)*dstn(4,k)+stn(5,k)*dstn(5,k)+
92  & stn(6,k))
93  dgdx(idesvar,iobject)=dgdx(idesvar,iobject)+
94  & dexp(rho*svm/xstress)*dsvmdx
95  enddo
96  endif
97  enddo
98  dgdx(idesvar,iobject)=dgdx(idesvar,iobject)*
99  & dexp(-rho*g0(iobject))/xstress
100  endif
101 !
102  return
Hosted by OpenAircraft.com, (Michigan UAV, LLC)