command.py 4.4 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

from pylmgc90.chipy import *
from numpy import *
####

checkDirectories()

utilities_DisableLogMes()

####
# info gestion du temps
dt = 1.e-4
theta = 0.505
nb_steps = 1000

# bavardage de certaines fonctions
echo = 0

# info generation fichier visu
freq_display = 10

# info contact
freq_detect = 1

#       123456789012345678901234567890
26
type = 'Stored_Delassus_Loop          '
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 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 200 201 202 203 204 205 206 207 208
norm = 'Quad '
tol = 0.1e-3
relax = 1.0
gs_it1 = 100
gs_it2 = 10

###
overall_DIME(2,1)

### definition des parametres du calcul ### 
utilities_logMes('INIT TIME STEPPING')
TimeEvolution_SetTimeStep(dt)
Integrator_InitTheta(theta)

### lecture du modele ###
utilities_logMes('READ BODIES')
RBDY2_ReadBodies()
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()
RBDY2_LoadBehaviours()

utilities_logMes('READ INI DOF')
TimeEvolution_ReadIniDof()
mecaMAILx_ReadIniDof()
mecaMAILx_ReadIniGPV()
RBDY2_ReadIniDof()

#CLxxx_LoadTactors()
ALpxx_LoadTactors()
#JONCx_LoadTactors()
DISKx_LoadTactors()

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

utilities_logMes('CHECK')
ExternalModels_CheckProperties()

utilities_logMes('READ INI Vloc Rloc')
TimeEvolution_ReadIniVlocRloc()
DKALp_ReadIniVlocRloc()
DKDKx_ReadIniVlocRloc()

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

### ecriture paranoiaque du modele ###
utilities_logMes('WRITE BODIES')
overall_WriteBodies()
MAILx_WriteBodies()
RBDY2_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()
RBDY2_WriteDrivenDof()

### post2D ##
post2D_SetReferenceRadius(0.01)
post2D_SetDisplayedField('MECHANICAL GPV  ')
post2D_SetDisplayedField('CONTACT POINT   ')
post2D_SetDisplayedField('TACTOR          ')
post2D_Init()

### postpro ###
postpro_PostproBeforeComputation()

utilities_logMes('COMPUTE MASS')
mecaMAILx_ComputeMass()
RBDY2_ComputeMass()

utilities_logMes('COMPUTE STIFFNESS')
mecaMAILx_ComputeBulk()

####
mecaMAILx_SetPreconAllBodies()
ALpxx_PushPreconNodes()
mecaMAILx_ComputePreconW()
####
mecaMAILx_AssembKT()
#
overall_WriteOutDisplayFile(1)
post2D_WriteOutDisplayFile(1)
for k in xrange(1, nb_steps + 1, 1):
   #
   utilities_logMes('increment : '+str(k))
   #
   utilities_logMes('INCREMENT STEP')
   TimeEvolution_IncrementStep()
   mecaMAILx_IncrementStep()
   RBDY2_IncrementStep()
   
   utilities_logMes('DISPLAY TIMES')
   TimeEvolution_DisplayStep()

   utilities_logMes('COMPUTE Fext')
   mecaMAILx_ComputeFext()
   RBDY2_ComputeFext()

   utilities_logMes('COMPUTE Fint')
   mecaMAILx_ComputeBulk()
   RBDY2_ComputeBulk()

   utilities_logMes('ASSEMBLAGE')
   mecaMAILx_AssembRHS()

   utilities_logMes('COMPUTE Free Vlocy')
   mecaMAILx_ComputeFreeVelocity()
   RBDY2_ComputeFreeVelocity()
   #
   utilities_logMes('SELECT PROX TACTORS')
   overall_SelectProxTactors(freq_detect)
   DKDKx_SelectProxTactors()
   DKALp_SelectProxTactors()
   #
   DKDKx_RecupRloc()
   DKALp_RecupRloc()
   #utilities_logMes(type,norm,tol, relax, gs_it1, gs_it2 )
   nlgs_ExSolver(type, norm, tol, relax, gs_it1, gs_it2)
   DKDKx_StockRloc()
   DKALp_StockRloc()
   #
   utilities_logMes('COMPUTE DOF, FIELDS, etc.')
   mecaMAILx_ComputeDof()
   mecaMAILx_ComputeBulk()
   RBDY2_ComputeDof()
   #
   utilities_logMes('UPDATE DOF, FIELDS')
   TimeEvolution_UpdateStep()
   mecaMAILx_UpdateDof()
   mecaMAILx_UpdateBulk()
   RBDY2_UpdateDof()
   #
   utilities_logMes('WRITE LAST DOF')
   TimeEvolution_WriteLastDof()
   mecaMAILx_WriteLastDof()
   RBDY2_WriteLastDof()
   #
   utilities_logMes('WRITE LAST Vloc Rloc')
   TimeEvolution_WriteLastVlocRloc()
   DKALp_WriteLastVlocRloc()

   ### post2D ###
   overall_WriteOutDisplayFile(freq_display)
   post2D_WriteOutDisplayFile(echo)

   ### postpro ###
   postpro_PostproDuringComputation()

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

### postpro ###
postpro_ClosePostproFiles()