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

from pylmgc90.chipy import *

checkDirectories()

### definition des parametres du calcul ### 

dt = 0.0002
nb_steps=4000
theta = 0.5

freq_display = 40
freq_write = 100

freq_detect = 1
tol = 0.1666e-4
relax = 1.0
quad = 'Quad '
gs_it1 = 33
gs_it2 = 101

nlgs_SetWithQuickScramble()

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

### lecture du modele ###

### model reading ###
print 'READ BODIES'
RBDY2_ReadBodies()
DISKx_LoadTactors()
JONCx_LoadTactors()

print 'READ BEHAVIOURS'
bulk_behav_ReadBehaviours()
tact_behav_ReadBehaviours()

RBDY2_LoadBehaviours()
mp_solver_ReadMpBehaviour()
RBDY2_MP_LoadBehaviours(0.)

print 'READ INI'
TimeEvolution_ReadIniDof()
RBDY2_ReadIniDof()

TimeEvolution_ReadIniVlocRloc()
DKJCx_ReadIniVlocRloc()
DKDKx_ReadIniVlocRloc()

RBDY2_ReadDrivenDof()

print 'WRITE'
overall_WriteBodies()
RBDY2_WriteBodies()
bulk_behav_WriteBehaviours()
tact_behav_WriteBehaviours()
mp_solver_WriteMpBehaviour()

overall_WriteDrivenDof()
RBDY2_WriteDrivenDof()

### post2D ##
print 'INIT GMV'
post2D_SetDisplayedField('TACTOR          ')
post2D_SetDisplayedField('CONTACT POINT   ')
post2D_SetDisplayedField('OXIDE           ')
post2D_SetDisplayedField('ELECTRO         ')
post2D_Init()

### postpro ###
postpro_PostproBeforeComputation()

print 'COMPUTE MASS'
RBDY2_ComputeMass()

for k in xrange(1,nb_steps+1,1):
   #
   print 'INCREMENT STEP'
   TimeEvolution_IncrementStep()
   RBDY2_IncrementStep()

   print 'DISPLAY TIMES'
   TimeEvolution_DisplayStep()

   print 'COMPUTE Fext'
   RBDY2_ComputeFext()

   print 'COMPUTE Fint'
   RBDY2_ComputeBulk()
   
   print 'COMPUTE Free Vlocy'
   RBDY2_ComputeFreeVelocity()
   #
   print 'SELECT PROX TACTORS'
   overall_SelectProxTactors(freq_detect)
   DKJCx_SelectProxTactors()
   DKDKx_SelectProxTactors()
   #
   DKJCx_RecupRloc()
   DKDKx_RecupRloc()
103
   nlgs_ExSolver('Stored_Delassus_Loop          ',quad, tol, relax, gs_it1, gs_it2)
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
   DKJCx_StockRloc()
   DKDKx_StockRloc()
   #
   mp_solver_SolveNlElectro1G()
   #
   print 'COMPUTE DOF'
   RBDY2_ComputeDof()
   #
   print 'UPDATE DOF'
   TimeEvolution_UpdateStep()
   RBDY2_UpdateDof()
   #
   ### post2D ###
   overall_WriteOutDisplayFile(freq_display)
   post2D_WriteOutDisplayFile(0)

   ### postpro ###
   postpro_PostproDuringComputation()

   ### writeout handling ###
   overall_CleanWriteOutFlags()
   #
### postpro ###
#
print 'WRITE LAST DOF'
TimeEvolution_WriteLastDof()
RBDY2_WriteLastDof()
#
print 'WRITE LAST Vloc Rloc'
TimeEvolution_WriteLastVlocRloc()
DKDKx_WriteLastVlocRloc()
DKJCx_WriteLastVlocRloc()
#
postpro_ClosePostproFiles()