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

Go to the source code of this file.

Functions/Subroutines

subroutine usermaterials (inpc, textpart, elcon, nelcon, nmat, ntmat_, ncmat_, iperturb, iumat, irstrt, istep, istat, n, iline, ipol, inl, ipoinp, inp, cocon, ncocon, ipoinpc)
 

Function/Subroutine Documentation

◆ usermaterials()

subroutine usermaterials ( character*1, dimension(*)  inpc,
character*132, dimension(16)  textpart,
real*8, dimension(0:ncmat_,ntmat_,*)  elcon,
integer, dimension(2,*)  nelcon,
integer  nmat,
integer  ntmat_,
integer  ncmat_,
integer, dimension(*)  iperturb,
integer  iumat,
integer  irstrt,
integer  istep,
integer  istat,
integer  n,
integer  iline,
integer  ipol,
integer  inl,
integer, dimension(2,*)  ipoinp,
integer, dimension(3,*)  inp,
real*8, dimension(0:6,ntmat_,*)  cocon,
integer, dimension(2,*)  ncocon,
integer, dimension(0:*)  ipoinpc 
)
22 !
23 ! reading the input deck: *USER MATERIAL
24 !
25  implicit none
26 !
27  character*1 inpc(*)
28  character*132 textpart(16)
29 !
30  integer nelcon(2,*),nmat,ntmat,ntmat_,istep,istat,ncocon(2,*),
31  & n,key,i,ncmat_,nconstants,imax,isum,j,iperturb(*),iumat,
32  & irstrt,iline,ipol,inl,ipoinp(2,*),inp(3,*),imech,ipoinpc(0:*)
33 !
34  real*8 elcon(0:ncmat_,ntmat_,*),cocon(0:6,ntmat_,*)
35 !
36  iperturb(1)=3
37  iperturb(2)=0
38  ntmat=0
39  iumat=1
40 !
41  if((istep.gt.0).and.(irstrt.ge.0)) then
42  write(*,*)'*ERROR in usermaterials: *USER MATERIAL should be'
43  write(*,*) ' placed before all step definitions'
44  call exit(201)
45  endif
46 !
47  if(nmat.eq.0) then
48  write(*,*) '*ERROR in usermaterials: *USER MATERIAL should be'
49  write(*,*) ' preceded by a *MATERIAL card'
50  call exit(201)
51  endif
52 !
53  imech=1
54 !
55  do i=2,n
56  if(textpart(i)(1:10).eq.'CONSTANTS=') then
57  read(textpart(i)(11:20),'(i10)',iostat=istat) nconstants
58  if(istat.gt.0) call inputerror(inpc,ipoinpc,iline,
59  &"*USER MATERIAL%")
60  elseif(textpart(i)(1:12).eq.'TYPE=THERMAL') then
61  imech=0
62  else
63  write(*,*)
64  & '*WARNING in usermaterials: parameter not recognized:'
65  write(*,*) ' ',
66  & textpart(i)(1:index(textpart(i),' ')-1)
67  call inputwarning(inpc,ipoinpc,iline,
68  &"*USER MATERIAL%")
69  endif
70  enddo
71 !
72  if(imech.eq.1) then
73 !
74 ! mechanical user material
75 !
76 c if(nconstants.gt.21) then
77 c write(*,*) '*ERROR in usermaterials: number of'
78 c write(*,*) ' mechanical constants cannot exceed 21'
79 c write(*,*) ' change the source code or'
80 c write(*,*) ' contact the author'
81 c call exit(201)
82 c endif
83  nelcon(1,nmat)=-100-nconstants
84 !
85  do
86  isum=0
87  do j=1,(nconstants)/8+1
88  if(j.eq.1) then
89  call getnewline(inpc,textpart,istat,n,key,iline,ipol,
90  & inl,ipoinp,inp,ipoinpc)
91  if((istat.lt.0).or.(key.eq.1)) return
92  ntmat=ntmat+1
93  nelcon(2,nmat)=ntmat
94  if(ntmat.gt.ntmat_) then
95  write(*,*)
96  & '*ERROR in usermaterials: increase ntmat_'
97  call exit(201)
98  endif
99  else
100  call getnewline(inpc,textpart,istat,n,key,iline,ipol,
101  & inl,ipoinp,inp,ipoinpc)
102  if((istat.lt.0).or.(key.eq.1)) then
103  write(*,*)
104  & '*ERROR in usermaterials: anisotropic definition'
105  write(*,*) ' is not complete. '
106  call inputerror(inpc,ipoinpc,iline,
107  &"*USER MATERIAL%")
108  call exit(201)
109  endif
110  endif
111  imax=8
112  if(8*j.gt.nconstants+1) then
113  imax=nconstants-8*j+9
114  endif
115  do i=1,imax
116  if(isum+i.le.nconstants) then
117  read(textpart(i)(1:20),'(f20.0)',iostat=istat)
118  & elcon(isum+i,ntmat,nmat)
119  else
120  read(textpart(i)(1:20),'(f20.0)',iostat=istat)
121  & elcon(0,ntmat,nmat)
122  endif
123  if(istat.gt.0) call inputerror(inpc,ipoinpc,iline,
124  &"*USER MATERIAL%")
125  enddo
126  isum=isum+imax
127 !
128  enddo
129  enddo
130 !
131  else
132 !
133 ! thermal user material
134 !
135  if(nconstants.gt.6) then
136  write(*,*) '*ERROR in usermaterials: number of'
137  write(*,*) ' thermal constants cannot exceed 6'
138  write(*,*) ' change the source code or'
139  write(*,*) ' contact the author'
140  call exit(201)
141  endif
142  ncocon(1,nmat)=-100-nconstants
143 !
144  do
145  call getnewline(inpc,textpart,istat,n,key,iline,ipol,
146  & inl,ipoinp,inp,ipoinpc)
147  if((istat.lt.0).or.(key.eq.1)) return
148  ntmat=ntmat+1
149  ncocon(2,nmat)=ntmat
150  if(ntmat.gt.ntmat_) then
151  write(*,*)
152  & '*ERROR in usermaterials: increase ntmat_'
153  call exit(201)
154  endif
155 !
156  do i=1,nconstants+1
157  if(i.le.nconstants) then
158  read(textpart(i)(1:20),'(f20.0)',iostat=istat)
159  & cocon(i,ntmat,nmat)
160  else
161  read(textpart(i)(1:20),'(f20.0)',iostat=istat)
162  & cocon(0,ntmat,nmat)
163  endif
164  if(istat.gt.0) call inputerror(inpc,ipoinpc,iline,
165  &"*USER MATERIAL%")
166  enddo
167  enddo
168 !
169  endif
170 !
171  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)