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

Go to the source code of this file.

Functions/Subroutines

subroutine basemotions (inpc, textpart, amname, nam, ibasemotion, xboun, ndirboun, iamboun, typeboun, nboun, istep, istat, n, iline, ipol, inl, ipoinp, inp, ipoinpc)
 

Function/Subroutine Documentation

◆ basemotions()

subroutine basemotions ( character*1, dimension(*)  inpc,
character*132, dimension(16)  textpart,
character*80, dimension(*)  amname,
integer  nam,
integer  ibasemotion,
real*8, dimension(*)  xboun,
integer, dimension(*)  ndirboun,
integer, dimension(*)  iamboun,
character*1, dimension(*)  typeboun,
integer  nboun,
integer  istep,
integer  istat,
integer  n,
integer  iline,
integer  ipol,
integer  inl,
integer, dimension(2,*)  ipoinp,
integer, dimension(3,*)  inp,
integer, dimension(0:*)  ipoinpc 
)
22 !
23 ! reading the input deck: *BASE MOTION
24 !
25  implicit none
26 !
27  character*1 typeboun(*),type,inpc(*)
28  character*80 amname(*),amplitude
29  character*132 textpart(16)
30 !
31  integer iamplitude,idof,i,j,n,nam,ibasemotion,iamboun(*),nboun,
32  & ndirboun(*),istep,istat,iline,ipol,inl,ipoinp(2,*),inp(3,*),
33  & key,ipoinpc(0:*)
34 !
35  real*8 xboun(*)
36 !
37  type='A'
38  iamplitude=0
39  idof=0
40 !
41  if(istep.lt.1) then
42  write(*,*) '*ERROR reading *BASE MOTION:'
43  write(*,*) ' *BASE MOTION should only be used'
44  write(*,*) ' within a STEP'
45  call exit(201)
46  endif
47 !
48  do i=2,n
49  if(textpart(i)(1:4).eq.'DOF=') then
50  read(textpart(i)(5:14),'(i10)',iostat=istat) idof
51  if(istat.gt.0) call inputerror(inpc,ipoinpc,iline,
52  &"*BASE MOTION%")
53  elseif(textpart(i)(1:10).eq.'AMPLITUDE=') then
54  read(textpart(i)(11:90),'(a80)') amplitude
55  do j=1,nam
56  if(amname(j).eq.amplitude) then
57  iamplitude=j
58  exit
59  endif
60  enddo
61  if(j.gt.nam) then
62  write(*,*) '*ERROR reading *BASE MOTION:'
63  write(*,*) ' nonexistent amplitude'
64  write(*,*) ' '
65  call inputerror(inpc,ipoinpc,iline,
66  &"*BASE MOTION%")
67  call exit(201)
68  endif
69  iamplitude=j
70  elseif(textpart(i)(1:5).eq.'TYPE=') then
71  if(textpart(i)(6:17).eq.'DISPLACEMENT') then
72  type='B'
73  elseif(textpart(i)(6:17).eq.'ACCELERATION') then
74  type='A'
75  else
76  write(*,*) '*ERROR reading *BASE MOTION:'
77  write(*,*) ' invalid TYPE'
78  call inputerror(inpc,ipoinpc,iline,
79  &"*BASE MOTION%")
80  endif
81  else
82  write(*,*)
83  & '*WARNING reading *BASE MOTION: parameter not recognized:'
84  write(*,*) ' ',
85  & textpart(i)(1:index(textpart(i),' ')-1)
86  call inputwarning(inpc,ipoinpc,iline,
87  &"*BASE MOTION%")
88  endif
89  enddo
90 !
91  if(idof.eq.0) then
92  write(*,*) '*ERROR reading *BASE MOTION'
93  write(*,*) ' no degree of freedom specified'
94  call exit(201)
95  elseif(iamplitude.eq.0) then
96  write(*,*) '*ERROR reading *BASE MOTION'
97  write(*,*) ' no amplitude specified'
98  call exit(201)
99  endif
100 !
101  if(ibasemotion.eq.0) then
102 !
103 ! no previous *BASE MOTION within the actual step
104 !
105  ibasemotion=1
106  do i=1,nboun
107  if(ndirboun(i).eq.idof) then
108  xboun(i)=1.d0
109  iamboun(i)=iamplitude
110  typeboun(i)=type
111  else
112  xboun(i)=0.d0
113  endif
114  enddo
115  else
116 !
117 ! previous *BASE MOTION within the actual step
118 !
119  do i=1,nboun
120  if(ndirboun(i).eq.idof) then
121  xboun(i)=1.d0
122  iamboun(i)=iamplitude
123  typeboun(i)=type
124  endif
125  enddo
126  endif
127 !
128  call getnewline(inpc,textpart,istat,n,key,iline,ipol,inl,
129  & ipoinp,inp,ipoinpc)
130 !
131  return
subroutine inputwarning(inpc, ipoinpc, iline, text)
Definition: inputwarning.f:20
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)