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

Go to the source code of this file.

Functions/Subroutines

subroutine loadadd (nelement, label, value, nelemload, sideload, xload, nload, nload_, iamload, iamplitude, nam, isector, idefload)
 

Function/Subroutine Documentation

◆ loadadd()

subroutine loadadd ( integer  nelement,
character*20  label,
real*8  value,
integer, dimension(2,*)  nelemload,
character*20, dimension(*)  sideload,
real*8, dimension(2,*)  xload,
integer  nload,
integer  nload_,
integer, dimension(2,*)  iamload,
integer  iamplitude,
integer  nam,
integer  isector,
integer, dimension(*)  idefload 
)
21 !
22 ! adds a facial dload condition to the data base
23 !
24  implicit none
25 !
26  character*20 label,sideload(*)
27 !
28  integer nelemload(2,*),iamload(2,*),nelement,nload,nload_,j,
29  & iamplitude,nam,isector,id,idefload(*)
30 !
31  real*8 xload(2,*),value
32 !
33  call nident2(nelemload,nelement,nload,id)
34  if(id.gt.0) then
35 !
36 ! it is possible that several *DLOAD, *FILM or
37 ! *RADIATE boundary conditions are applied to one
38 ! and the same element
39 !
40  if(nelemload(1,id).eq.nelement) then
41  do
42  if (sideload(id).eq.label) then
43  if(nelemload(2,id).eq.isector) then
44 !
45 ! loading on same element face and sector
46 ! detected: values are replaced
47 !
48  if(idefload(id).eq.0) then
49  xload(1,id)=value
50  idefload(id)=1
51  else
52  if(nam.gt.0) then
53  if(iamload(1,id).ne.iamplitude) then
54  write(*,*) '*ERROR in loadadd:'
55  write(*,*) ' it is not allowed to '
56  write(*,*) ' define two distributed'
57  write(*,*) ' loads/fluxes with'
58  write(*,*) ' different amplitudes '
59  write(*,*) ' in one step'
60  write(*,*) 'element: ',nelement,' face:',
61  & label
62  call exit(201)
63  endif
64  endif
65  xload(1,id)=xload(1,id)+value
66  endif
67  xload(2,id)=0.d0
68  if(nam.gt.0) then
69  iamload(1,id)=iamplitude
70  iamload(2,id)=iamplitude
71  endif
72  return
73  elseif(nelemload(2,id).lt.isector) then
74  exit
75  endif
76  elseif(sideload(id).lt.label) then
77  exit
78  endif
79  id=id-1
80  if((id.eq.0).or.(nelemload(1,id).ne.nelement)) then
81  exit
82  endif
83  enddo
84  endif
85  endif
86 !
87 ! loading a element face on which no previous loading
88 ! was applied
89 !
90 ! loading conditions on one and the same element are
91 ! alphabetized based on field sideload
92 !
93 ! loading conditions on one and the same element and
94 ! of one and the same sideload type are ordered based
95 ! on field nelemload(2,*)
96 !
97  nload=nload+1
98  if(nload.gt.nload_) then
99  write(*,*) '*ERROR in loadadd: increase nload_'
100  call exit(201)
101  endif
102 !
103 ! shifting existing loading
104 !
105  do j=nload,id+2,-1
106  nelemload(1,j)=nelemload(1,j-1)
107  nelemload(2,j)=nelemload(2,j-1)
108  idefload(j)=idefload(j-1)
109  sideload(j)=sideload(j-1)
110  xload(1,j)=xload(1,j-1)
111  xload(2,j)=xload(2,j-1)
112  if(nam.gt.0) then
113  iamload(1,j)=iamload(1,j-1)
114  iamload(2,j)=iamload(2,j-1)
115  endif
116  enddo
117 !
118 ! inserting new loading
119 !
120  nelemload(1,id+1)=nelement
121  nelemload(2,id+1)=isector
122  idefload(id+1)=1
123  sideload(id+1)=label
124  xload(1,id+1)=value
125  xload(2,id+1)=0.
126  if(nam.gt.0) then
127  iamload(1,id+1)=iamplitude
128  iamload(2,id+1)=0
129  endif
130 !
131  return
subroutine nident2(x, px, n, id)
Definition: nident2.f:27
Hosted by OpenAircraft.com, (Michigan UAV, LLC)