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

Go to the source code of this file.

Functions/Subroutines

subroutine umpc_dist (x, u, f, a, jdof, n, force, iit, idiscon)
 

Function/Subroutine Documentation

◆ umpc_dist()

subroutine umpc_dist ( real*8, dimension(3,*)  x,
real*8, dimension(3,*)  u,
real*8  f,
real*8, dimension(*)  a,
integer, dimension(*)  jdof,
integer  n,
real*8  force,
integer  iit,
integer  idiscon 
)
20 !
21 ! updates the coefficients in a dist mpc (name DIST)
22 !
23 ! a dist mpc specifies that the distance between two nodes
24 ! a and b must not exceed value d
25 !
26 ! input nodes: a,a,a,b,b,b,c
27 !
28 ! node c is a fictitious node. The value d must be assigned
29 ! to the first coordinate of node c by means of a *NODE card;
30 ! the other coordinates of the node can be arbitrary.
31 !
32 ! A value of zero must be assigned to the first DOF of node c by using
33 ! a *BOUNDARY card. The second DOF of node c is not constrained and is
34 ! used when the distance between nodes a and b is less than d: in
35 ! that case there is no constraint at all.
36 !
37 ! INPUT:
38 !
39 ! x(3,n) Carthesian coordinates of the nodes in the
40 ! user mpc.
41 ! u(3,n) Actual displacements of the nodes in the
42 ! user mpc.
43 ! jdof Actual degrees of freedom of the mpc terms
44 ! n number of terms in the user mpc
45 ! force Actual value of the mpc force
46 ! iit iteration number
47 !
48 ! OUTPUT:
49 !
50 ! f Actual value of the mpc. If the mpc is
51 ! exactly satisfied, this value is zero
52 ! a(n) coefficients of the linearized mpc
53 ! jdof Corrected degrees of freedom of the mpc terms
54 ! idiscon 0: no discontinuity
55 ! 1: discontinuity
56 ! If a discontinuity arises the previous
57 ! results are not extrapolated at the start of
58 ! a new increment
59 !
60  implicit none
61 !
62  integer jdof(*),n,iit,ifix,idiscon
63 !
64  real*8 x(3,*),u(3,*),f,a(*),dist(3),force
65 !
66 c write(*,*) (jdof(i),i=1,7)
67  if(jdof(7).eq.1) then
68  ifix=1
69  else
70  ifix=0
71  jdof(7)=2
72  endif
73 !
74  dist(1)=x(1,1)+u(1,1)-x(1,4)-u(1,4)
75  dist(2)=x(2,1)+u(2,1)-x(2,4)-u(2,4)
76  dist(3)=x(3,1)+u(3,1)-x(3,4)-u(3,4)
77 !
78  f=dist(1)**2+dist(2)**2+dist(3)**2-x(1,7)**2
79 !
80 c write(*,*) 'mpcforc=, f= ',force,f
81 !
82  a(7)=-1.
83 !
84 ! only one change per increment is allowed
85 ! (change= from free to linked or vice versa)
86 ! ifix=0: free
87 ! ifix=1: linked
88 !
89  if(ifix.eq.0) then
90 !
91 ! previous state: free
92 !
93  if(f.lt.0) then
94 !
95 ! new state: free
96 !
97  f=0.d0
98  elseif(iit.le.1) then
99 !
100 ! new state: linked
101 !
102  write(*,*) 'switch to linked'
103  write(*,*)
104  jdof(7)=1
105  idiscon=1
106  else
107 !
108 ! new state: free
109 !
110  f=0.d0
111  endif
112  else
113 !
114 ! previous state: linked
115 !
116  if(force.le.0.d0) then
117 !
118 ! new state: linked
119 !
120  elseif(iit.le.1) then
121 !
122 ! new state: free
123 !
124  write(*,*) 'switch to free'
125  write(*,*)
126  jdof(7)=2
127  f=0.d0
128  idiscon=1
129  else
130 !
131 ! new state: linked
132 !
133  endif
134  endif
135 !
136  if(dabs(dist(jdof(1))).gt.1.d-10) then
137  a(1)=2.d0*dist(jdof(1))
138  if(jdof(1).eq.1) then
139  jdof(2)=2
140  jdof(3)=3
141  elseif(jdof(1).eq.2) then
142  jdof(2)=3
143  jdof(3)=1
144  else
145  jdof(2)=1
146  jdof(3)=2
147  endif
148  a(2)=2.d0*dist(jdof(2))
149  a(3)=2.d0*dist(jdof(3))
150  else
151  if(jdof(1).eq.3) then
152  jdof(1)=1
153  else
154  jdof(1)=jdof(1)+1
155  endif
156  if(dabs(dist(jdof(1))).gt.1.d-10) then
157  a(1)=2.d0*dist(jdof(1))
158  if(jdof(1).eq.1) then
159  jdof(2)=2
160  jdof(3)=3
161  elseif(jdof(1).eq.2) then
162  jdof(2)=3
163  jdof(3)=1
164  else
165  jdof(2)=1
166  jdof(3)=2
167  endif
168  a(2)=2.d0*dist(jdof(2))
169  a(3)=2.d0*dist(jdof(3))
170  else
171  if(jdof(1).eq.3) then
172  jdof(1)=1
173  else
174  jdof(1)=jdof(1)+1
175  endif
176  if(dabs(dist(jdof(1))).gt.1.d-10) then
177  a(1)=2.d0*dist(jdof(1))
178  if(jdof(1).eq.1) then
179  jdof(2)=2
180  jdof(3)=3
181  elseif(jdof(1).eq.2) then
182  jdof(2)=3
183  jdof(3)=1
184  else
185  jdof(2)=1
186  jdof(3)=2
187  endif
188  a(2)=2.d0*dist(jdof(2))
189  a(3)=2.d0*dist(jdof(3))
190  endif
191  endif
192  endif
193 !
194  a(4)=-2.d0*dist(1)
195  a(5)=-2.d0*dist(2)
196  a(6)=-2.d0*dist(3)
197  jdof(4)=1
198  jdof(5)=2
199  jdof(6)=3
200 !
201 c write(*,*) 'jdof,a'
202 c do i=1,7
203 c write(*,*) jdof(i),a(i)
204 c enddo
205 c write(*,*) 'f ',f
206 !
207  return
static double * dist
Definition: radflowload.c:42
Hosted by OpenAircraft.com, (Michigan UAV, LLC)