command.py 4.57 KB
Newer Older
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
import sys

from pylmgc90.chipy import *
from numpy import *
####
# info gestion du temps
dt = 1.e-3
theta = 0.505
nstep = 50

# bavardage de certaines fonctions
echo = 0

# info generation fichier visu
freq_display = 5
ref_radius   = 0.05
freq_write = 5

# info contact
freq_detect = 1

#       123456789012345678901234567890
#type = 'Exchange_Local_Global         '
type = 'Stored_Delassus_Loops         '
quad = 'QM/16'
tol = 1.e-5
relax = 1.0
gs_it1 = 300
gs_it2 = 10

###
32
checkDirectories()
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
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
SetDimension(3,0)

utilities_logMes('INIT TIME STEPPING')
TimeEvolution_SetTimeStep(dt)
Integrator_InitTheta(theta)
Integrator_SetContactDetectionConfiguration(1.-theta,0.)

#mecaMAILx_WithRenumbering()

### lecture du modele ###
utilities_logMes('READ BODIES')
MAILx_ReadBodies()

utilities_logMes('READ BEHAVIOURS')
bulk_behav_ReadBehaviours()
tact_behav_ReadBehaviours()

utilities_logMes('READ MODELS')
models_ReadModels()

utilities_logMes('INIT MODELS')
# on dimensionne et on initie la construction des mapping
models_InitModels()
ExternalModels_InitModels()

utilities_logMes('LOADS')
# on charge les choses et on construit les mapping
mecaMAILx_LoadModels()
mecaMAILx_LoadBehaviours()

utilities_logMes('PUSH')
mecaMAILx_PushProperties()
#
utilities_logMes('STORE')
# on finalise la construction des mapping
models_StoreProperties()

utilities_logMes('CHECK')
ExternalModels_CheckProperties()
#
ASpxx_LoadTactors()
CSxxx_LoadTactors()
CSxxx_FlipOrientation(1)
#
utilities_logMes('READ INI DOF')
TimeEvolution_ReadIniDof()
mecaMAILx_ReadIniDof()

utilities_logMes('READ INI GPV')
TimeEvolution_ReadIniGPV()
mecaMAILx_ReadIniGPV()

utilities_logMes('READ INI Vloc Rloc')
TimeEvolution_ReadIniVlocRloc()
CSASp_ReadIniVlocRloc()

#
utilities_logMes('READ DRIVEN DOF')
mecaMAILx_ReadDrivenDof()

### ecriture paranoiaque du modele ###
utilities_logMes('WRITE BODIES')
overall_WriteBodies()
MAILx_WriteBodies()

utilities_logMes('WRITE MODELS')
models_WriteModels()

utilities_logMes('WRITE BEHAVIOURS')
bulk_behav_WriteBehaviours()
tact_behav_WriteBehaviours()

utilities_logMes('WRITE DRIVEN DOF')
overall_WriteDrivenDof()
mecaMAILx_WriteDrivenDof()

utilities_logMes('WRITE DOF')
TimeEvolution_WriteLastDof()
mecaMAILx_WriteLastDof()

utilities_logMes('WRITE Vloc_Rloc')
TimeEvolution_WriteLastVlocRloc()
CSASp_WriteLastVlocRloc()

### definition des parametres du calcul ### 
### post3D ##
OpenDisplayFiles()
OpenPostproFiles()

### parameters setting ###

utilities_logMes('COMPUTE MASS')
mecaMAILx_ComputeMass()

utilities_logMes('COMPUTE STIFFNESS')
mecaMAILx_ComputeBulk()

####
mecaMAILx_SetPreconAllBodies()
CSxxx_PushPreconNodes()
ASpxx_PushPreconNodes()
mecaMAILx_ComputePreconW()

mecaMAILx_AssembKT()

for k in xrange(1,nstep+1,1):
   #
   utilities_logMes('INCREMENT STEP')
   TimeEvolution_IncrementStep()
   mecaMAILx_IncrementStep()
   
   utilities_logMes('DISPLAY TIMES')
   TimeEvolution_DisplayStep()

   utilities_logMes('COMPUTE Fext')
   mecaMAILx_ComputeFext()

   utilities_logMes('COMPUTE Fint')
   mecaMAILx_ComputeBulk()

   utilities_logMes('ASSEMBLAGE')
   mecaMAILx_AssembRHS()

   utilities_logMes('COMPUTE Free Vlocy')
   mecaMAILx_ComputeFreeVelocity()
   #
   utilities_logMes('SELECT PROX TACTORS')
   utilities_logMes('INIT TIME STEPPING')
   mecaMAILx_ComputeContactDetectionConfiguration()
   overall_SelectProxTactors(freq_detect)
   CSASp_SelectProxTactors()
   #
   CSASp_RecupRloc()

   utilities_logMes('RESOLUTION' )
    
   nlgs_3D_ExSolver(type,quad, tol, relax, gs_it1, gs_it2)
    
   nlgs_3D_UpdateTactBehav()
    
   CSASp_StockRloc()
   #
   utilities_logMes('COMPUTE DOF, FIELDS, etc.')
   mecaMAILx_ComputeDof()
   #
   utilities_logMes('UPDATE DOF, FIELDS')
   TimeEvolution_UpdateStep()
   mecaMAILx_UpdateDof()
   mecaMAILx_UpdateBulk()
   #
   utilities_logMes('WRITE LAST DOF')
   TimeEvolution_WriteOutDof(freq_write)
   mecaMAILx_WriteOutDof()

   TimeEvolution_WriteLastDof()
   mecaMAILx_WriteLastDof()
   #
   utilities_logMes('WRITE Vloc_Rloc')
   TimeEvolution_WriteOutVlocRloc(freq_write)
   CSASp_WriteOutVlocRloc()

   TimeEvolution_WriteLastVlocRloc()
   CSASp_WriteLastVlocRloc()

   ### post3D ###
   # on cree un field bidon
   nb_ele = mecaMAILx_GetNbElements(1)
200
   all_burp=[np.zeros(nb_ele),np.ones(nb_ele)]
201
202

   nb_node = mecaMAILx_GetNbNodes(1)
203
   all_boarf=[np.ones(nb_node),np.zeros(nb_node)]
204
205
206
207
208
209
210
211
212
213
214
215
   WriteDisplayFiles(freq_display,ref_radius,
                     burp=('mecaFE','element',all_burp),
                     boarf=('mecaFE','node',all_boarf))

   WritePostproFiles()

   ### gestion des writeout ###
   overall_CleanWriteOutFlags()

### postpro ###
CloseDisplayFiles()
ClosePostproFiles()