File: contactprints.f

package info (click to toggle)
calculix-ccx 2.11-1
  • links: PTS, VCS
  • area: main
  • in suites: buster, stretch
  • size: 10,188 kB
  • sloc: fortran: 115,312; ansic: 34,480; sh: 374; makefile: 35; perl: 15
file content (161 lines) | stat: -rw-r--r-- 5,266 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
!
!     CalculiX - A 3-dimensional finite element program
!              Copyright (C) 1998-2015 Guido Dhondt
!
!     This program is free software; you can redistribute it and/or
!     modify it under the terms of the GNU General Public License as
!     published by the Free Software Foundation(version 2);
!     
!
!     This program is distributed in the hope that it will be useful,
!     but WITHOUT ANY WARRANTY; without even the implied warranty of 
!     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 
!     GNU General Public License for more details.
!
!     You should have received a copy of the GNU General Public License
!     along with this program; if not, write to the Free Software
!     Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
!
      subroutine contactprints(inpc,textpart,
     &     nprint,nprint_,jout,prlab,prset,
     &     contactprint_flag,ithermal,istep,istat,n,iline,ipol,inl,
     &     ipoinp,inp,amname,nam,itpamp,idrct,ipoinpc,nener)
!
!     reading the *CONTACT PRINT cards in the input deck
!
      implicit none
!
      logical contactprint_flag
!
      character*1 total,nodesys,inpc(*)
      character*6 prlab(*)
      character*80 amname(*),timepointsname
      character*81 prset(*),noset
      character*132 textpart(16)
!
      integer ii,i,nam,itpamp,
     &  jout(2),joutl,ithermal,nprint,nprint_,istep,
     &  istat,n,key,ipos,iline,ipol,inl,ipoinp(2,*),inp(3,*),idrct,
     &  ipoinpc(0:*),nener
!
      if(istep.lt.1) then
         write(*,*) '*ERROR in contactprints: *CONTACT PRINT 
     &        should only be'
         write(*,*) '  used within a *STEP definition'
         call exit(201)
      endif
!
      nodesys='L'
!
!     reset the contact print requests (node and element print requests,
!     if any, are kept)
!
      if(.not.contactprint_flag) then
         ii=0
         do i=1,nprint
            if((prlab(i)(1:4).eq.'CSTR').or.
     &         (prlab(i)(1:4).eq.'CDIS').or.
     &         (prlab(i)(1:4).eq.'CNUM').or.
     &         (prlab(i)(1:4).eq.'CELS')) cycle
            ii=ii+1
            prlab(ii)=prlab(i)
            prset(ii)=prset(i)
         enddo
         nprint=ii
      endif
!
c      jout=max(jout,1)
      do ii=1,81
         noset(ii:ii)=' '
      enddo
      total=' '
!
      do ii=2,n
         if(textpart(ii)(1:10).eq.'FREQUENCY=') then
            read(textpart(ii)(11:20),'(i10)',iostat=istat) joutl
            if(istat.gt.0) call inputerror(inpc,ipoinpc,iline,
     &"*CONTACT PRINT%")
            if(joutl.eq.0) then
               do
                  call getnewline(inpc,textpart,istat,n,key,iline,ipol,
     &                 inl,ipoinp,inp,ipoinpc)
                  if((key.eq.1).or.(istat.lt.0)) return
               enddo
            endif
           if(joutl.gt.0) then
              jout(1)=joutl
              itpamp=0
           endif
        elseif(textpart(ii)(1:10).eq.'TOTALS=YES') then
           total='T'
        elseif(textpart(ii)(1:11).eq.'TOTALS=ONLY') then
           total='O'
        elseif(textpart(ii)(1:11).eq.'TIMEPOINTS=') then
           timepointsname=textpart(ii)(12:91)
           do i=1,nam
              if(amname(i).eq.timepointsname) then
                 itpamp=i
                 exit
              endif
           enddo
           if(i.gt.nam) then
              ipos=index(timepointsname,' ')
              write(*,*) '*ERROR in contactprints: time points
     &             definition '
     &               ,timepointsname(1:ipos-1),' is unknown or empty'
              call exit(201)
           endif
           if(idrct.eq.1) then
              write(*,*) '*ERROR in contactprints: the DIRECT option'
              write(*,*) '       collides with a TIME POINTS '
              write(*,*) '       specification'
              call exit(201)
           endif
           jout(1)=1
           jout(2)=1
         else
            write(*,*) 
     &        '*WARNING in contactprints: parameter not recognized:'
            write(*,*) '         ',
     &                 textpart(ii)(1:index(textpart(ii),' ')-1)
            call inputwarning(inpc,ipoinpc,iline,
     &"*CONTACT PRINT%")
        endif
      enddo

      do
         call getnewline(inpc,textpart,istat,n,key,iline,ipol,inl,
     &        ipoinp,inp,ipoinpc)
         if(key.eq.1) exit
         do ii=1,n
            if((textpart(ii)(1:4).ne.'CSTR').and.
     &         (textpart(ii)(1:4).ne.'CELS').and.
     &         (textpart(ii)(1:4).ne.'CNUM').and.
     &         (textpart(ii)(1:4).ne.'CDIS')) then
               write(*,*) '*WARNING in contactprints: label not
     &              applicable'
               write(*,*) '         or unknown; '
               call inputwarning(inpc,ipoinpc,iline,
     &"*CONTACT PRINT%")
               cycle
            endif
!
!
!
            if(textpart(ii)(1:4).eq.'CELS') nener=1
!
            nprint=nprint+1
            if(nprint.gt.nprint_) then
               write(*,*) '*ERROR in contatcprints: increase nprint_'
               call exit(201)
            endif
            prset(nprint)=noset
            prlab(nprint)(1:4)=textpart(ii)(1:4)
            prlab(nprint)(5:5)=total
            prlab(nprint)(6:6)=nodesys
         enddo
      enddo
!
      return
      end