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

Go to the source code of this file.

Functions/Subroutines

subroutine changematerials (inpc, textpart, matname, nmat, nmat_, irstrt, istep, istat, n, iline, ipol, inl, ipoinp, inp, ipoinpc, imat)
 

Function/Subroutine Documentation

◆ changematerials()

subroutine changematerials ( character*1, dimension(*)  inpc,
character*132, dimension(16)  textpart,
character*80, dimension(*)  matname,
integer  nmat,
integer  nmat_,
integer  irstrt,
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  imat 
)
22 !
23 ! reading the input deck: *CHANGE MATERIAL
24 !
25  implicit none
26 !
27  character*1 inpc(*)
28  character*80 matname(*),materialname
29  character*132 textpart(16)
30 !
31  integer nmat,nmat_,istep,istat,n,key,i,irstrt,iline,ipol,inl,
32  & ipoinp(2,*),inp(3,*),ipoinpc(0:*),imat
33 !
34  if(istep.eq.0) then
35  write(*,*) '*ERROR reading *CHANGE MATERIAL: *CHANGE MATERIAL'
36  write(*,*) ' cannot be used before the first step'
37  call exit(201)
38  endif
39 !
40  do i=2,n
41  if(textpart(i)(1:5).eq.'NAME=') then
42  materialname=textpart(i)(6:85)
43  else
44  write(*,*)
45  & '*WARNING reading *CHANGE MATERIAL: parameter not recognized:'
46  write(*,*) ' ',
47  & textpart(i)(1:index(textpart(i),' ')-1)
48  call inputwarning(inpc,ipoinpc,iline,
49  &"*CHANGE MATERIAL%")
50  endif
51  enddo
52 !
53 ! check whether the material exists
54 !
55  imat=0
56  do i=1,nmat
57  if(matname(i).eq.materialname) then
58  imat=i
59  exit
60  endif
61  enddo
62 !
63  if(imat.eq.0) then
64  write(*,*) '*ERROR reading *CHANGE MATERIAL:',materialname
65  write(*,*) ' is a nonexistent material'
66  call exit(201)
67  endif
68 !
69  call getnewline(inpc,textpart,istat,n,key,iline,ipol,inl,
70  & ipoinp,inp,ipoinpc)
71 !
72  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
Hosted by OpenAircraft.com, (Michigan UAV, LLC)