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

Go to the source code of this file.

Functions/Subroutines

subroutine gaps (inpc, textpart, nelcon, nmat, ntmat_, npmat_, plicon, nplicon, ncmat_, elcon, matname, irstrt, istep, istat, n, iline, ipol, inl, ipoinp, inp, nmat_, set, istartset, iendset, ialset, nset, ielmat, ielorien, ipoinpc, mi)
 

Function/Subroutine Documentation

◆ gaps()

subroutine gaps ( character*1, dimension(*)  inpc,
character*132, dimension(16)  textpart,
integer, dimension(2,*)  nelcon,
integer  nmat,
integer  ntmat_,
integer  npmat_,
real*8, dimension(0:2*npmat_,ntmat_,*)  plicon,
integer, dimension(0:ntmat_,*)  nplicon,
integer  ncmat_,
real*8, dimension(0:ncmat_,ntmat_,*)  elcon,
character*80, dimension(*)  matname,
integer  irstrt,
integer  istep,
integer  istat,
integer  n,
integer  iline,
integer  ipol,
integer  inl,
integer, dimension(2,*)  ipoinp,
integer, dimension(3,*)  inp,
integer  nmat_,
character*81, dimension(*)  set,
integer, dimension(*)  istartset,
integer, dimension(*)  iendset,
integer, dimension(*)  ialset,
integer  nset,
integer, dimension(mi(3),*)  ielmat,
integer, dimension(mi(3),*)  ielorien,
integer, dimension(0:*)  ipoinpc,
integer, dimension(*)  mi 
)
24 !
25 ! reading the input deck: *GAP
26 !
27  implicit none
28 !
29  character*1 inpc(*)
30  character*80 matname(*)
31  character*81 set(*),elset
32  character*132 textpart(16)
33 !
34  integer mi(*),nelcon(2,*),nmat,ntmat_,ntmat,npmat_,npmat,istep,
35  & n,key,i,nplicon(0:ntmat_,*),ncmat_,istat,istartset(*),
36  & iendset(*),irstrt,iline,ipol,inl,ipoinp(2,*),inp(3,*),nmat_,
37  & ialset(*),ipos,nset,j,k,ielmat(mi(3),*),ielorien(mi(3),*),
38  & ipoinpc(0:*)
39 !
40  real*8 plicon(0:2*npmat_,ntmat_,*),temperature,
41  & elcon(0:ncmat_,ntmat_,*)
42 !
43  ntmat=0
44 !
45  if((istep.gt.0).and.(irstrt.ge.0)) then
46  write(*,*) '*ERROR reading *GAP: *GAP should be placed'
47  write(*,*) ' before all step definitions'
48  call exit(201)
49  endif
50 !
51  nmat=nmat+1
52  if(nmat.gt.nmat_) then
53  write(*,*) '*ERROR reading *GAP: increase nmat_'
54  call exit(201)
55  endif
56  matname(nmat)(1:3)='GAP'
57  do i=4,80
58  matname(nmat)(i:i)=' '
59  enddo
60 !
61  do i=2,n
62  if(textpart(i)(1:6).eq.'ELSET=') then
63  elset=textpart(i)(7:86)
64  elset(81:81)=' '
65  ipos=index(elset,' ')
66  elset(ipos:ipos)='E'
67  else
68  write(*,*)
69  & '*WARNING reading *GAP: parameter not recognized:'
70  write(*,*) ' ',
71  & textpart(i)(1:index(textpart(i),' ')-1)
72  call inputwarning(inpc,ipoinpc,iline,
73  &"*GAP%")
74  endif
75  enddo
76 !
77 ! 6 parameters
78 !
79  nelcon(1,nmat)=6
80 !
81  do
82  call getnewline(inpc,textpart,istat,n,key,iline,ipol,inl,
83  & ipoinp,inp,ipoinpc)
84  if((istat.lt.0).or.(key.eq.1)) exit
85  ntmat=ntmat+1
86  nelcon(2,nmat)=ntmat
87  if(ntmat.gt.ntmat_) then
88  write(*,*) '*ERROR reading *GAP: increase ntmat_'
89  call exit(201)
90  endif
91 !
92 ! defaults for spring constant (force vs. displacement)
93 ! and force at infinite clearance
94 !
95  elcon(5,ntmat,nmat)=1.d12
96  elcon(6,ntmat,nmat)=1.d-3
97 !
98 ! reading the initial clearance and the normal direction
99 !
100  do i=1,min(4,n)
101  read(textpart(i)(1:20),'(f20.0)',iostat=istat)
102  & elcon(i,ntmat,nmat)
103  if(istat.gt.0) call inputerror(inpc,ipoinpc,iline,
104  & "*GAP%")
105  enddo
106 !
107 ! reading entry 6 and 7 (spring constant and force at
108 ! infinite clearance)
109 !
110  do i=6,min(7,n)
111  read(textpart(i)(1:20),'(f20.0)',iostat=istat)
112  & elcon(i-1,ntmat,nmat)
113  if(istat.gt.0) call inputerror(inpc,ipoinpc,iline,
114  & "*GAP%")
115  enddo
116 !
117  elcon(0,ntmat,nmat)=0.d0
118  enddo
119 !
120  if(ntmat.eq.0) then
121  write(*,*) '*ERROR reading *GAP: *GAP card without data'
122  call exit(201)
123  endif
124  do i=1,nset
125  if(set(i).eq.elset) exit
126  enddo
127  if(i.gt.nset) then
128  elset(ipos:ipos)=' '
129  write(*,*) '*ERROR reading *GAP: element set ',elset
130  write(*,*) ' has not yet been defined. '
131  call inputerror(inpc,ipoinpc,iline,
132  &"*GAP%")
133  call exit(201)
134  endif
135 !
136 ! assigning the elements of the set the appropriate material
137 !
138  do j=istartset(i),iendset(i)
139  if(ialset(j).gt.0) then
140  ielmat(1,ialset(j))=nmat
141  ielorien(1,ialset(j))=0
142  else
143  k=ialset(j-2)
144  do
145  k=k-ialset(j)
146  if(k.ge.ialset(j-1)) exit
147  ielmat(1,k)=nmat
148  ielorien(1,k)=0
149  enddo
150  endif
151  enddo
152 !
153  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)