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

Go to the source code of this file.

Functions/Subroutines

subroutine objectives (inpc, textpart, istep, istat, n, iline, ipol, inl, ipoinp, inp, ipoinpc, nener, nobject, objectset)
 

Function/Subroutine Documentation

◆ objectives()

subroutine objectives ( character*1, dimension(*)  inpc,
character*132, dimension(16)  textpart,
integer  istep,
integer  istat,
integer  n,
integer  iline,
integer  ipol,
integer  inl,
integer, dimension(2,*)  ipoinp,
integer, dimension(3,*)  inp,
integer, dimension(0:*)  ipoinpc,
integer  nener,
integer  nobject,
character*81, dimension(4,*)  objectset 
)
21 !
22 ! reading the input deck: *OBJECTIVE
23 !
24 ! criteria: DISPLACEMENT
25 ! EIGENFREQUENCY
26 ! GREEN
27 ! MASS
28 ! SHAPE ENERGY
29 ! STRESS
30 !
31  implicit none
32 !
33  character*1 inpc(*)
34  character*20 filter,radius,transition
35  character*132 textpart(16)
36  character*81 objectset(4,*)
37 !
38  integer istep,istat,n,key,i,iline,ipol,inl,ipoinp(2,*),
39  & inp(3,*),ipoinpc(0:*),nener,nobject,k,ipos
40 !
41  real*8 rho,stress
42 !
43  filter=' '
44  radius=' '
45  transition=' '
46 !
47  if(istep.lt.1) then
48  write(*,*) '*ERROR reading *OBJECTIVE: *OBJECTIVE can
49  &only be used within a SENSITIVITY STEP'
50  call exit(201)
51  endif
52 !
53  do i=2,n
54 !
55 ! reading filter function
56 !
57  if(textpart(i)(1:7).eq.'FILTER=') then
58  read(textpart(i)(8:27),'(a20)') filter
59 !
60 ! reading filter radius
61 !
62  elseif(textpart(i)(1:7).eq.'RADIUS=') then
63  radius=textpart(i)(8:27)
64 !
65 ! reading transition distance
66 !
67  elseif(textpart(i)(1:11).eq.'TRANSITION=') then
68  transition=textpart(i)(12:31)
69  else
70  write(*,*)
71  & '*WARNING reading *OBJECTIVE: parameter not recognized:'
72  write(*,*) ' ',
73  & textpart(i)(1:index(textpart(i),' ')-1)
74  call inputwarning(inpc,ipoinpc,iline,
75  &"*OBJECTIVE%")
76  endif
77  enddo
78 !
79 ! reading the objectives
80 !
81  call getnewline(inpc,textpart,istat,n,key,iline,ipol,inl,
82  & ipoinp,inp,ipoinpc)
83 !
84  do
85  if(textpart(1)(1:12).eq.'DISPLACEMENT') then
86  nobject=nobject+1
87  objectset(1,nobject)(1:12)='DISPLACEMENT'
88  do k=13,20
89  objectset(1,nobject)(k:k)=' '
90  enddo
91  if(n.ge.2) then
92  read(textpart(2)(1:80),'(a80)',iostat=istat)
93  & objectset(3,nobject)(1:80)
94  objectset(3,nobject)(81:81)=' '
95  ipos=index(objectset(3,nobject),' ')
96  if(ipos.ne.1) objectset(3,nobject)(ipos:ipos)='N'
97  endif
98  elseif(textpart(1)(1:14).eq.'EIGENFREQUENCY') then
99  nobject=nobject+1
100  objectset(1,nobject)(1:14)='EIGENFREQUENCY'
101  do k=15,81
102  objectset(1,nobject)(k:k)=' '
103  enddo
104  elseif(textpart(1)(1:5).eq.'GREEN') then
105  nobject=nobject+1
106  objectset(1,nobject)(1:5)='GREEN'
107  do k=6,81
108  objectset(1,nobject)(k:k)=' '
109  enddo
110  elseif(textpart(1)(1:4).eq.'MASS') then
111  nobject=nobject+1
112  objectset(1,nobject)(1:4)='MASS'
113  do k=5,81
114  objectset(1,nobject)(k:k)=' '
115  enddo
116  if(n.ge.2) then
117  read(textpart(2)(1:80),'(a80)',iostat=istat)
118  & objectset(3,nobject)(1:80)
119  objectset(3,nobject)(81:81)=' '
120  ipos=index(objectset(3,nobject),' ')
121  if(ipos.ne.1) objectset(3,nobject)(ipos:ipos)='E'
122  endif
123  elseif(textpart(1)(1:11).eq.'SHAPEENERGY') then
124  nobject=nobject+1
125  objectset(1,nobject)(1:11)='SHAPEENERGY'
126  do k=12,81
127  objectset(1,nobject)(k:k)=' '
128  enddo
129  if(n.ge.2) then
130  read(textpart(2)(1:80),'(a80)',iostat=istat)
131  & objectset(3,nobject)(1:80)
132  objectset(3,nobject)(81:81)=' '
133  ipos=index(objectset(3,nobject),' ')
134  if(ipos.ne.1) objectset(3,nobject)(ipos:ipos)='E'
135  endif
136  nener=1
137  elseif(textpart(1)(1:6).eq.'STRESS') then
138  nobject=nobject+1
139  objectset(1,nobject)(1:6)='STRESS'
140  do k=7,81
141  objectset(1,nobject)(k:k)=' '
142  enddo
143  if(n.ge.2) then
144  read(textpart(2)(1:80),'(a80)',iostat=istat)
145  & objectset(3,nobject)(1:80)
146  objectset(3,nobject)(81:81)=' '
147  ipos=index(objectset(3,nobject),' ')
148  if(ipos.ne.1) objectset(3,nobject)(ipos:ipos)='N'
149  endif
150 !
151 ! rho for the Kreisselmeier-Steinhauser function
152 !
153  if(n.ge.3) then
154  read(textpart(3)(1:20),'(f20.0)',iostat=istat) rho
155  if(istat.gt.0) call inputerror(inpc,ipoinpc,iline,
156  &"*OBJECTIVE%")
157  if(rho.lt.1.d0) then
158  write(*,*) '*ERROR reading *OBJECTIVE'
159  write(*,*) ' first Kreisselmeier-Steinhauser'
160  write(*,*) ' parameter rho cannot be less'
161  write(*,*) ' than 1'
162  call inputerror(inpc,ipoinpc,iline,
163  &"*OBJECTIVE%")
164  endif
165  objectset(2,nobject)(41:60)=textpart(3)(1:20)
166  endif
167 !
168 ! the target stress for the Kreisselmeier-Steinhauser function
169 !
170  if(n.ge.4) then
171  read(textpart(4)(1:20),'(f20.0)',iostat=istat) stress
172  if(istat.gt.0) call inputerror(inpc,ipoinpc,iline,
173  &"*OBJECTIVE%")
174  if(stress.le.0.d0) then
175  write(*,*) '*ERROR reading *OBJECTIVE'
176  write(*,*) ' the target stress in the'
177  write(*,*) ' Kreisselmeier-Steinhauser function'
178  write(*,*) ' must be strictly positive'
179  call inputerror(inpc,ipoinpc,iline,
180  &"*OBJECTIVE%")
181  endif
182  objectset(2,nobject)(61:80)=textpart(4)(1:20)
183  endif
184  else
185  write(*,*) '*ERROR reading *OBJECTIVE'
186  write(*,*) ' objective function not known'
187  call inputerror(inpc,ipoinpc,iline,
188  &"*OBJECTIVE%")
189  endif
190 !
191 ! storing the kind of filter, the filter radius and
192 ! the transition distance
193 !
194  objectset(2,nobject)(1:20)=filter
195  objectset(2,nobject)(21:40)=radius
196  objectset(1,nobject)(21:40)=transition
197 !
198  call getnewline(inpc,textpart,istat,n,key,iline,ipol,inl,
199  & ipoinp,inp,ipoinpc)
200  if((istat.lt.0).or.(key.eq.1)) exit
201 !
202  enddo
203 !
204  return
subroutine inputwarning(inpc, ipoinpc, iline, text)
Definition: inputwarning.f:20
subroutine filter(dgdxglob, nobject, nk, nodedesi, ndesi, objectset, xo, yo, zo, x, y, z, nx, ny, nz, neighbor, r, ndesia, ndesib)
Definition: filter.f:22
subroutine getnewline(inpc, textpart, istat, n, key, iline, ipol, inl, ipoinp, inp, ipoinpc)
Definition: getnewline.f:21
subroutine transition(dgdxglob, nobject, nk, nodedesi, ndesi, objectset, xo, yo, zo, x, y, z, nx, ny, nz, co, ifree, ndesia, ndesib)
Definition: transition.f:22
subroutine inputerror(inpc, ipoinpc, iline, text)
Definition: inputerror.f:20
Hosted by OpenAircraft.com, (Michigan UAV, LLC)