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

Go to the source code of this file.

Functions/Subroutines

subroutine gen3dtruss (ipompc, nodempc, coefmpc, nmpc, nmpc_, mpcfree, ikmpc, ilmpc, labmpc, nk, ithermal, i, nodeboun, ndirboun, ikboun, ilboun, nboun, nboun_, typeboun, xboun, xta, jact, co, knor, ntrans, inotr, trab, vold, mi, nmethod, nk_, nam, iperturb, indexk, iamboun)
 

Function/Subroutine Documentation

◆ gen3dtruss()

subroutine gen3dtruss ( integer, dimension(*)  ipompc,
integer, dimension(3,*)  nodempc,
real*8, dimension(*)  coefmpc,
integer  nmpc,
integer  nmpc_,
integer  mpcfree,
integer, dimension(*)  ikmpc,
integer, dimension(*)  ilmpc,
character*20, dimension(*)  labmpc,
integer  nk,
integer, dimension(*)  ithermal,
integer  i,
integer, dimension(*)  nodeboun,
integer, dimension(*)  ndirboun,
integer, dimension(*)  ikboun,
integer, dimension(*)  ilboun,
integer  nboun,
integer  nboun_,
character*1, dimension(*)  typeboun,
real*8, dimension(*)  xboun,
real*8, dimension(3,100)  xta,
integer  jact,
real*8, dimension(3,*)  co,
integer, dimension(*)  knor,
integer  ntrans,
integer, dimension(2,*)  inotr,
real*8, dimension(7,*)  trab,
real*8, dimension(0:mi(2))  vold,
integer, dimension(*)  mi,
integer  nmethod,
integer  nk_,
integer  nam,
integer, dimension(2)  iperturb,
integer  indexk,
integer, dimension(*)  iamboun 
)
24 !
25 ! - connects the expanded nodes of a truss element to the
26 ! original node
27 ! - sets the rotation about the truss axis to zero
28 !
29  implicit none
30 !
31  logical fixed
32 !
33  character*1 type,typeboun(*)
34  character*20 labmpc(*),label
35 !
36  integer ipompc(*),nodempc(3,*),nmpc,nmpc_,mpcfree,mi(*),
37  & ikmpc(*),ilmpc(*),i,j,idir,nk,newnode,idof,id,mpcfreenew,
38  & ithermal(*),jstart,jend,nodeboun(*),ndirboun(*),ikboun(*),
39  & ilboun(*),nboun,nboun_,jact,knor(*),ntrans,inotr(2,*),
40  & nnodes,nodeact,nmethod,nk_,k,iperturb(2),nam,indexk,
41  & iamplitude,idirref,iamboun(*)
42 !
43  real*8 coefmpc(*),xboun(*),xta(3,100),co(3,*),trab(7,*),
44  & vold(0:mi(2)),val
45 !
46 ! generating a hinge at a node of a truss element
47 !
48 ! u(n_1)+u(n_2)+u(n_3)+u(n_4)=4*u(n)
49 !
50  newnode=nk-7
51 !
52  if(ithermal(2).le.1) then
53  jstart=1
54  jend=3
55  elseif(ithermal(2).eq.2) then
56  jstart=0
57  jend=0
58  else
59  jstart=0
60  jend=3
61  endif
62 !
63  do idir=jstart,jend
64  idof=8*(newnode-1)+idir
65  call nident(ikmpc,idof,nmpc,id)
66  if((id.le.0).or.(ikmpc(id).ne.idof)) then
67  nmpc=nmpc+1
68  if(nmpc.gt.nmpc_) then
69  write(*,*)
70  & '*ERROR in gen3dtruss: increase nmpc_'
71  call exit(201)
72  endif
73  labmpc(nmpc)=' '
74  ipompc(nmpc)=mpcfree
75  do j=nmpc,id+2,-1
76  ikmpc(j)=ikmpc(j-1)
77  ilmpc(j)=ilmpc(j-1)
78  enddo
79  ikmpc(id+1)=idof
80  ilmpc(id+1)=nmpc
81  nodempc(1,mpcfree)=newnode
82  nodempc(2,mpcfree)=idir
83  coefmpc(mpcfree)=1.d0
84  mpcfree=nodempc(3,mpcfree)
85  if(mpcfree.eq.0) then
86  write(*,*)
87  & '*ERROR in gen3dtruss: increase memmpc_'
88  call exit(201)
89  endif
90  do k=2,4
91  nodempc(1,mpcfree)=nk-8+k
92  nodempc(2,mpcfree)=idir
93  coefmpc(mpcfree)=1.d0
94  mpcfree=nodempc(3,mpcfree)
95  if(mpcfree.eq.0) then
96  write(*,*)
97  & '*ERROR in gen3dtruss: increase memmpc_'
98  call exit(201)
99  endif
100  enddo
101  nodempc(1,mpcfree)=i
102  nodempc(2,mpcfree)=idir
103  coefmpc(mpcfree)=-4.d0
104  mpcfreenew=nodempc(3,mpcfree)
105  if(mpcfreenew.eq.0) then
106  write(*,*)
107  & '*ERROR in gen3dtruss: increase memmpc_'
108  call exit(201)
109  endif
110  nodempc(3,mpcfree)=0
111  mpcfree=mpcfreenew
112  endif
113  enddo
114 !
115 ! mean rotation MPC to restrain rotation about the beam
116 ! axis
117 !
118  label='MEANROTBS '
119 !
120 ! axis of the beam is defined as x-axis in the local beam
121 ! system (only needed for printing in usermpc.f)
122 !
123  idirref=1
124  nnodes=0
125  do j=4,1,-1
126  nodeact=knor(indexk+j)
127  do k=1,3
128  nnodes=nnodes+1
129  call usermpc(ipompc,nodempc,coefmpc,
130  & labmpc,nmpc,nmpc_,mpcfree,ikmpc,ilmpc,
131  & nk,nk_,nodeboun,ndirboun,ikboun,ilboun,
132  & nboun,nboun_,nnodes,nodeact,co,label,
133  & typeboun,iperturb,i,idirref,xboun)
134  enddo
135  enddo
136 !
137 ! rotation value term
138 !
139  nodeact=nk+1
140  do k=1,3
141  co(k,nodeact)=xta(k,jact)
142  enddo
143  nnodes=nnodes+1
144  call usermpc(ipompc,nodempc,coefmpc,
145  & labmpc,nmpc,nmpc_,mpcfree,ikmpc,ilmpc,
146  & nk,nk_,nodeboun,ndirboun,ikboun,ilboun,
147  & nboun,nboun_,nnodes,nodeact,co,label,
148  & typeboun,iperturb,i,idirref,xboun)
149 !
150 ! inhomogeneous term
151 !
152  nodeact=0
153  call usermpc(ipompc,nodempc,coefmpc,
154  & labmpc,nmpc,nmpc_,mpcfree,ikmpc,ilmpc,
155  & nk,nk_,nodeboun,ndirboun,ikboun,ilboun,
156  & nboun,nboun_,nnodes,nodeact,co,label,
157  & typeboun,iperturb,i,idirref,xboun)
158 !
159 ! end meanrotationmpc
160 !
161 ! SPC angle term
162 !
163  if(nodeact.ne.-1) then
164  idir=1
165  type='B'
166  val=0.d0
167  iamplitude=0
168  fixed=.false.
169  call bounadd(nk,idir,idir,val,nodeboun,
170  & ndirboun,xboun,nboun,nboun_,iamboun,
171  & iamplitude,nam,ipompc,nodempc,coefmpc,
172  & nmpc,nmpc_,mpcfree,inotr,trab,ntrans,
173  & ikboun,ilboun,ikmpc,ilmpc,co,nk,nk_,labmpc,
174  & type,typeboun,nmethod,iperturb,fixed,vold,
175  & nk,mi,label)
176 !
177 ! storing the index of the SPC with the angle
178 ! value in ilboun(id)
179 !
180  ilboun(id)=nboun
181  endif
182 !
183  return
subroutine nident(x, px, n, id)
Definition: nident.f:26
subroutine usermpc(ipompc, nodempc, coefmpc, labmpc, nmpc, nmpc_, mpcfree, ikmpc, ilmpc, nk, nk_, nodeboun, ndirboun, ikboun, ilboun, nboun, nboun_, nnodes, node, co, label, typeboun, iperturb, noderef, idirref, xboun)
Definition: usermpc.f:23
subroutine bounadd(node, is, ie, val, nodeboun, ndirboun, xboun, nboun, nboun_, iamboun, iamplitude, nam, ipompc, nodempc, coefmpc, nmpc, nmpc_, mpcfree, inotr, trab, ntrans, ikboun, ilboun, ikmpc, ilmpc, co, nk, nk_, labmpc, type, typeboun, nmethod, iperturb, fixed, vold, nodetrue, mi, label)
Definition: bounadd.f:24
Hosted by OpenAircraft.com, (Michigan UAV, LLC)