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

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

max_it_fp=1

# bavardage de certaines fonctions
echo = 0
#utilities_DisableLogMes()

# info generation fichier visu
freq_display = 250
freq_write = 1000
ref_radius = 5.e-2

# info contact
freq_detect = 1

#       123456789012345678901234567890
25
type = 'Stored_Delassus_Loop          '
26 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 209 210 211 212 213 214 215 216 217 218
#type = 'Exchange_Local_Global         '
quad = 'QM/16'
tol = 0.1666e-3
relax = 1.
gs_it1 = 500
gs_it2 = 10

nlgs_3D_SetWithQuickScramble()
nlgs_3D_DiagonalResolution()

###
checkDirectories()
###
SetDimension(3,0)

utilities_logMes( 'INIT TIME STEPPING')
TimeEvolution_SetTimeStep(dt)
Integrator_InitTheta(theta)

### lecture du modele ###
utilities_logMes( 'READ BODIES')
MAILx_ReadBodies()
RBDY3_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()
RBDY3_LoadBehaviours()

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

utilities_logMes( 'CHECK')
ExternalModels_CheckProperties()

mecaMAILx_SetCoroAllBodies()

#
POLYR_LoadTactors()
CSxxx_LoadTactors()
ASpxx_LoadTactors()

#
utilities_logMes( 'READ INI DOF')
TimeEvolution_ReadIniDof()
mecaMAILx_ReadIniDof()
RBDY3_ReadIniDof()

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

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

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

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

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

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

### definition des parametres du calcul ### 

### post3D ##
OpenDisplayFiles()
OpenPostproFiles()

### parameters setting ###

utilities_logMes( 'COMPUTE MASS')
mecaMAILx_ComputeMass()
RBDY3_ComputeMass()
mecaMAILx_BuildRigidBodies()

utilities_logMes( 'COMPUTE STIFFNESS')

mecaMAILx_ComputeBulk()
mecaMAILx_ComputeRayleighDamping(0.,0.0001)

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

mecaMAILx_AssembKT()

for k in xrange(1,nstep+1,1):

   utilities_logMes( 'INCREMENT STEP')
   TimeEvolution_IncrementStep()
   mecaMAILx_IncrementStep()
   RBDY3_IncrementStep()
   
   utilities_logMes( 'DISPLAY TIMES')
   TimeEvolution_DisplayStep()

   utilities_logMes( 'COMPUTE Fext')
   mecaMAILx_ComputeFext()
   RBDY3_ComputeFext()

   RBDY3_ComputeBulk()

   RBDY3_ComputeFreeVelocity()

   for ifp in range(1,max_it_fp+1):

     utilities_logMes('----')
     utilities_logMes('ite fp: '+str(ifp))
    
     utilities_logMes( 'COMPUTE Fint')
     mecaMAILx_ComputeBulk()

     utilities_logMes( 'ASSEMBLAGE')
     mecaMAILx_AssembRHS()

     utilities_logMes( 'COMPUTE Free Vlocy')
     mecaMAILx_ComputeFreeVelocity()

     #
     utilities_logMes( 'SELECT PROX TACTORS')
     overall_SelectProxTactors(freq_detect)
     CSPRx_SelectProxTactors()
     CSASp_SelectProxTactors()

     #
     CSASp_RecupRloc()
     CSPRx_RecupRloc()


     utilities_logMes( 'RESOLUTION' )
    
     #utilities_logMes( type,quad,tol, relax, gs_it1, gs_it2 
     nlgs_3D_ExSolver(type,quad, tol, relax, gs_it1, gs_it2)

     CSASp_StockRloc()
     CSPRx_StockRloc()

     utilities_logMes( 'COMPUTE DOF, FIELDS, etc.')
     mecaMAILx_ComputeDof()


   nlgs_3D_UpdateTactBehav()
   CSASp_StockRloc()
   CSPRx_StockRloc()

   RBDY3_ComputeDof()

219 220
   mecaMAILx_ComputeField()

221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250
   #
   utilities_logMes( 'UPDATE DOF, FIELDS')
   TimeEvolution_UpdateStep()
   mecaMAILx_UpdateDof()
   mecaMAILx_UpdateBulk()
   RBDY3_UpdateDof()
   #
   utilities_logMes( 'WRITE LAST DOF')
   TimeEvolution_WriteOutDof(freq_write)
   mecaMAILx_WriteOutDof()
   RBDY3_WriteOutDof(-1,100000)
   #
   utilities_logMes( 'WRITE Vloc_Rloc')
   TimeEvolution_WriteOutVlocRloc(freq_write)
   CSPRx_WriteOutVlocRloc()
   CSASp_WriteOutVlocRloc()

   ### post3D ###
   WriteDisplayFiles(freq_display,ref_radius)
   WritePostproFiles()
   if (k % freq_display == 0 ):
     mecaMAILx_RigidVTKDrawAll()


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

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