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

Go to the source code of this file.

Functions/Subroutines

subroutine couptempdisps (inpc, textpart, nmethod, iperturb, isolver, istep, istat, n, tinc, tper, tmin, tmax, idrct, ithermal, iline, ipol, inl, ipoinp, inp, ipoinpc, alpha, ctrl, iexpl, tincf, ttime, nener)
 

Function/Subroutine Documentation

◆ couptempdisps()

subroutine couptempdisps ( character*1, dimension(*)  inpc,
character*132, dimension(16)  textpart,
integer  nmethod,
integer  iperturb,
integer  isolver,
integer  istep,
integer  istat,
integer  n,
real*8  tinc,
real*8  tper,
real*8  tmin,
real*8  tmax,
integer  idrct,
integer  ithermal,
integer  iline,
integer  ipol,
integer  inl,
integer, dimension(2,*)  ipoinp,
integer, dimension(3,*)  inp,
integer, dimension(0:*)  ipoinpc,
real*8  alpha,
real*8, dimension(*)  ctrl,
integer  iexpl,
real*8  tincf,
real*8  ttime,
integer  nener 
)
23 !
24 ! reading the input deck: *COUPLED TEMPERATURE-DISPLACEMENT
25 !
26 ! isolver=0: SPOOLES
27 ! 2: iterative solver with diagonal scaling
28 ! 3: iterative solver with Cholesky preconditioning
29 ! 4: sgi solver
30 ! 5: TAUCS
31 ! 7: pardiso
32 !
33 ! iexpl==0: structure:implicit, fluid:incompressible
34 ! iexpl==1: structure:implicit, fluid:compressible
35 !
36  implicit none
37 !
38  logical timereset
39 !
40  character*1 inpc(*)
41  character*20 solver
42  character*132 textpart(16)
43 !
44  integer nmethod,iperturb,isolver,istep,istat,n,key,i,idrct,
45  & ithermal,iline,ipol,inl,ipoinp(2,*),inp(3,*),ipoinpc(0:*),
46  & iexpl,nener
47 !
48  real*8 tinc,tper,tmin,tmax,alpha,ctrl(*),tincf,ttime
49 !
50  idrct=0
51  alpha=-0.05d0
52  tmin=0.d0
53  tmax=0.d0
54 c tincf=1.d-2
55  tincf=-1.d0
56  nmethod=4
57  timereset=.false.
58 !
59  if(iperturb.eq.0) then
60  iperturb=2
61  elseif((iperturb.eq.1).and.(istep.gt.1)) then
62  write(*,*) '*ERROR reading *COUPLED TEMPERATURE-DISPLACEMENT:'
63  write(*,*) ' perturbation analysis is not provided in a'
64  write(*,*) ' *COUPLED TEMPERATURE-DISPLACEMENT step.'
65  call exit(201)
66  endif
67 !
68  if(istep.lt.1) then
69  write(*,*) '*ERROR reading *COUPLED TEMPERATURE-DISPLACEMENT:'
70  write(*,*) ' *COUPLED TEMPERATURE-DISPLACEMENT can only '
71  write(*,*) ' be used within a STEP'
72  call exit(201)
73  endif
74 !
75 ! default solver
76 !
77  solver=' '
78  if(isolver.eq.0) then
79  solver(1:7)='SPOOLES'
80  elseif(isolver.eq.2) then
81  solver(1:16)='ITERATIVESCALING'
82  elseif(isolver.eq.3) then
83  solver(1:17)='ITERATIVECHOLESKY'
84  elseif(isolver.eq.4) then
85  solver(1:3)='SGI'
86  elseif(isolver.eq.5) then
87  solver(1:5)='TAUCS'
88  elseif(isolver.eq.7) then
89  solver(1:7)='PARDISO'
90  endif
91 !
92  do i=2,n
93  if(textpart(i)(1:6).eq.'ALPHA=') then
94  read(textpart(i)(7:26),'(f20.0)',iostat=istat) alpha
95  if(istat.gt.0) call inputerror(inpc,ipoinpc,iline,
96  &"*COUPLED TEMPERATURE-DISPLACEMENT%")
97  if(alpha.lt.-1.d0/3.d0) then
98  write(*,*) '*WARNING in dynamics: alpha is smaller'
99  write(*,*) ' than -1/3 and is reset to -1/3'
100  alpha=-1.d0/3.d0
101  elseif(alpha.gt.0.d0) then
102  write(*,*) '*WARNING in dynamics: alpha is greater'
103  write(*,*) ' than 0 and is reset to 0'
104  alpha=0.d0
105  endif
106  elseif(textpart(i)(1:7).eq.'SOLVER=') then
107  read(textpart(i)(8:27),'(a20)') solver
108  elseif(textpart(i)(1:12).eq.'COMPRESSIBLE') then
109  iexpl=1
110  elseif((textpart(i)(1:6).eq.'DIRECT').and.
111  & (textpart(i)(1:9).ne.'DIRECT=NO')) then
112  idrct=1
113  elseif(textpart(i)(1:11).eq.'STEADYSTATE') then
114  nmethod=1
115  elseif(textpart(i)(1:7).eq.'DELTMX=') then
116  read(textpart(i)(8:27),'(f20.0)',iostat=istat) ctrl(27)
117  elseif(textpart(i)(1:9).eq.'TIMERESET') then
118  timereset=.true.
119  elseif(textpart(i)(1:17).eq.'TOTALTIMEATSTART=') then
120  read(textpart(i)(18:37),'(f20.0)',iostat=istat) ttime
121  else
122  write(*,*)
123  & '*WARNING reading *COUPLED TEMPERATURE-DISPLACEMENT:'
124  write(*,*) ' parameter not recognized:'
125  write(*,*) ' ',
126  & textpart(i)(1:index(textpart(i),' ')-1)
127  call inputwarning(inpc,ipoinpc,iline,
128  &"*COUPLED TEMPERATURE-DISPLACEMENT%")
129  endif
130  enddo
131  if(nmethod.eq.1) ctrl(27)=1.d30
132 !
133  if((ithermal.eq.0).and.(nmethod.ne.1).and.
134  & (nmethod.ne.2).and.(iperturb.ne.0)) then
135  write(*,*) '*ERROR reading *COUPLED TEMPERATURE-DISPLACEMENT:'
136  write(*,*) ' please define initial '
137  write(*,*) ' conditions for the temperature'
138  call exit(201)
139  else
140  ithermal=3
141  endif
142 !
143  if(solver(1:7).eq.'SPOOLES') then
144  isolver=0
145  elseif(solver(1:16).eq.'ITERATIVESCALING') then
146  isolver=2
147  elseif(solver(1:17).eq.'ITERATIVECHOLESKY') then
148  isolver=3
149  elseif(solver(1:3).eq.'SGI') then
150  isolver=4
151  elseif(solver(1:5).eq.'TAUCS') then
152  isolver=5
153  elseif(solver(1:7).eq.'PARDISO') then
154  isolver=7
155  else
156  write(*,*) '*WARNING reading *COUPLED TEMPERATURE-DISPLACEMENT:'
157  write(*,*) ' unknown solver;'
158  write(*,*) ' the default solver is used'
159  endif
160 !
161  call getnewline(inpc,textpart,istat,n,key,iline,ipol,inl,
162  & ipoinp,inp,ipoinpc)
163  if((istat.lt.0).or.(key.eq.1)) then
164  if(iperturb.ge.2) then
165  write(*,*)
166  & '*WARNING reading *COUPLED TEMPERATURE-DISPLACEMENT:'
167  write(*,*)
168  & ' a nonlinear geometricanalysis is requested'
169  write(*,*) ' but no time increment nor step is speci
170  &fied'
171  write(*,*) ' the defaults (1,1) are used'
172  tinc=1.d0
173  tper=1.d0
174  tmin=1.d-5
175  tmax=1.d+30
176  tincf=-1.d0
177 c tincf=1.d-2
178  endif
179  if(timereset)ttime=ttime-tper
180  return
181  endif
182 !
183  read(textpart(1)(1:20),'(f20.0)',iostat=istat) tinc
184  if(istat.gt.0) call inputerror(inpc,ipoinpc,iline,
185  &"*COUPLED TEMPERATURE-DISPLACEMENT%")
186  read(textpart(2)(1:20),'(f20.0)',iostat=istat) tper
187  if(istat.gt.0) call inputerror(inpc,ipoinpc,iline,
188  &"*COUPLED TEMPERATURE-DISPLACEMENT%")
189  read(textpart(3)(1:20),'(f20.0)',iostat=istat) tmin
190  if(istat.gt.0) call inputerror(inpc,ipoinpc,iline,
191  &"*COUPLED TEMPERATURE-DISPLACEMENT%")
192  read(textpart(4)(1:20),'(f20.0)',iostat=istat) tmax
193  if(istat.gt.0) call inputerror(inpc,ipoinpc,iline,
194  &"*COUPLED TEMPERATURE-DISPLACEMENT%")
195  read(textpart(5)(1:20),'(f20.0)',iostat=istat) tincf
196  if(istat.gt.0) call inputerror(inpc,ipoinpc,iline,
197  &"*COUPLED TEMPERATURE-DISPLACEMENT%")
198 !
199  if(tinc.le.0.d0) then
200  write(*,*) '*ERROR reading *COUPLED TEMPERATURE-DISPLACEMENT:'
201  write(*,*) ' initial increment size is negative'
202  endif
203  if(tper.le.0.d0) then
204  write(*,*) '*ERROR reading *COUPLED TEMPERATURE-DISPLACEMENT:'
205  write(*,*) ' step size is negative'
206  endif
207  if(tinc.gt.tper) then
208  write(*,*) '*ERROR reading *COUPLED TEMPERATURE-DISPLACEMENT:'
209  write(*,*) ' initial increment size exceeds step size'
210  endif
211 !
212  if(idrct.ne.1) then
213  if(dabs(tmin).lt.1.d-6*tper) then
214  tmin=min(tinc,1.d-6*tper)
215  endif
216  if(dabs(tmax).lt.1.d-10) then
217  tmax=1.d+30
218  endif
219  if(tinc.gt.dabs(tmax)) then
220  write(*,*)
221  & '*WARNING reading *COUPLED TEMPERATURE-DISPLACEMENT:'
222  write(*,*) ' the initial increment ',tinc
223  write(*,*) ' exceeds the maximum increment ',
224  & tmax
225  write(*,*) ' the initial increment is reduced'
226  write(*,*) ' to the maximum value'
227  tinc=dabs(tmax)
228  endif
229  endif
230 !
231  if(timereset)ttime=ttime-tper
232 !
233  if(nmethod.eq.4) nener=1
234 !
235  call getnewline(inpc,textpart,istat,n,key,iline,ipol,inl,
236  & ipoinp,inp,ipoinpc)
237 !
238  return
subroutine inputwarning(inpc, ipoinpc, iline, text)
Definition: inputwarning.f:20
#define min(a, b)
Definition: cascade.c:31
subroutine getnewline(inpc, textpart, istat, n, key, iline, ipol, inl, ipoinp, inp, ipoinpc)
Definition: getnewline.f:21
subroutine inputerror(inpc, ipoinpc, iline, text)
Definition: inputerror.f:20
Hosted by OpenAircraft.com, (Michigan UAV, LLC)