command.py 2.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 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
import os,sys

from pylmgc90.chipy import *

checkDirectories()
### lecture du modele ###

### model reading ###
RBDY2_ReadBodies()

bulk_behav_ReadBehaviours()
tact_behav_ReadBehaviours()

#LOADS
DISKx_LoadTactors()
JONCx_LoadTactors()
RBDY2_LoadBehaviours()

TimeEvolution_ReadIniDof()
RBDY2_ReadIniDof()

TimeEvolution_ReadIniVlocRloc()
DKDKx_ReadIniVlocRloc()
DKJCx_ReadIniVlocRloc()

RBDY2_ReadDrivenDof()

### ecriture paranoiaque du modele ###
overall_WriteBodies()
RBDY2_WriteBodies()

bulk_behav_WriteBehaviours()
tact_behav_WriteBehaviours()

overall_WriteDrivenDof()
RBDY2_WriteDrivenDof()

### definition des parametres du calcul ### 
dt = 0.01
theta = 0.5
TimeEvolution_SetTimeStep(dt)
Integrator_InitTheta(theta)

### post2D ##
post2D_SetDisplayedField('CONTACT POINT   ')
post2D_SetDisplayedField('TACTOR          ')
post2D_Init()

#postpro_PostproBeforeComputation()

### preparation de l'algo de detection par les boites ###

RBDY2_ComputeMass()

freq_detect = 1
tol = 0.1666e-3
relax = 1.0
quad = 'Quad '
gs_it1 = 51
gs_it2 = 1001
freq_gmv = 1

timer_InitializeTimers()
id_contact_solve = timer_GetNewTimer("CONTACT SOLVER")
id_free_solve    = timer_GetNewTimer("FREE STATE SOLVER")

for k in xrange(1,10,1):
   #
   #print 'itere : ',k
   #
   #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'
   timer_StartTimer(id_free_solve)
   RBDY2_ComputeFreeVelocity()
   timer_StopTimer(id_free_solve)
   #
   #print 'SELECT PROX TACTORS'
   overall_SelectProxTactors(freq_detect)
   DKJCx_SelectProxTactors()
   DKDKx_SelectProxTactors()
   #
   DKJCx_RecupRloc()
   DKDKx_RecupRloc()
   timer_StartTimer(id_contact_solve)
97
   nlgs_ExSolver('Stored_Delassus_Loop          ',quad, tol, relax, gs_it1, gs_it2)
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
   timer_StopTimer(id_contact_solve)
   DKJCx_StockRloc()
   DKDKx_StockRloc()
   #
   #print 'COMPUTE DOF'
   RBDY2_ComputeDof()
   #
   #print 'UPDATE DOF'
   TimeEvolution_UpdateStep()
   RBDY2_UpdateDof()
   #
   #print 'WRITE LAST DOF'
   #TimeEvolution_WriteLastDof()
   #RBDY2_WriteLastDof()
   ##
   ##print 'WRITE LAST Vloc Rloc'
   #TimeEvolution_WriteLastVlocRloc()
   #DKDKx_WriteLastVlocRloc()
   #DKJCx_WriteLastVlocRloc()
   #
   ### post2D ###
   #overall_WriteOutDisplayFile(freq_gmv)
   #post2D_WriteOutDisplayFile(0)
   #postpro_PostproDuringComputation()
   ### wrtieout handling ###
   overall_CleanWriteOutFlags()

#postpro_ClosePostproFiles()
timer_WriteOutTimers()