command.py 2.64 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 *

# add timer definition and start here

checkDirectories()

### definition des parametres du calcul ### 
dt=5e-4
nb_steps=10
theta=0.5

# peridioc length
lx=1.1

freq_display = 1
freq_write = 1

freq_detect = 1
tol     = 0.1666e-4
relax   = 1.0
norm    = 'QM/16'
gs_it1  = 100
gs_it2  = 200
25
gs_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


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

### lecture du modele ###
print 'READ BODIES'
RBDY2_ReadBodies()

print 'READ BEHAVIOURS'
bulk_behav_ReadBehaviours()
tact_behav_ReadBehaviours()

#LOADS
POLYG_LoadTactors()
JONCx_LoadTactors()
RBDY2_LoadBehaviours()

print 'READ INI DOF'
TimeEvolution_ReadIniDof()
RBDY2_ReadIniDof()

print 'READ INI Vloc Rloc'
TimeEvolution_ReadIniVlocRloc()
PLPLx_ReadIniVlocRloc()
PLJCx_ReadIniVlocRloc()

print 'READ DRIVEN DOF'
RBDY2_ReadDrivenDof()

### ecriture paranoiaque du modele ###
print 'WRITE BODIES'
overall_WriteBodies()
RBDY2_WriteBodies()

print 'WRITE BEHAVIOURS'
bulk_behav_WriteBehaviours()
tact_behav_WriteBehaviours()

print 'WRITE DRIVEN DOF'
overall_WriteDrivenDof()
RBDY2_WriteDrivenDof()


### post2D ##
names= ['DOF','Vloc_Rloc']
tacts_dict={}
InitTactorsToVTK(['POLYG','JONCx'],tacts_dict)

inters_dict={}
InitIntersToVTK(['PLPLx','PLJCx'],inters_dict)

fit = startCollection('./DISPLAY/tacts.pvd')
fii = startCollection('./DISPLAY/inters.pvd')

### postpro ###
postpro_PostproBeforeComputation()

#
RBDY2_SetPeriodicCondition(lx)
PLPLx_SetPeriodicCondition(lx)
post2D_SetPeriodicCondition(lx)

RBDY2_ComputeMass()

for k in xrange(1,nb_steps+1,1):
   #
   TimeEvolution_IncrementStep()
   RBDY2_IncrementStep()
   
   TimeEvolution_DisplayStep()

   RBDY2_ComputeFext()

   RBDY2_ComputeBulk()
   
   RBDY2_ComputeFreeVelocity()
   #
   overall_SelectProxTactors(freq_detect)
   PLPLx_SelectProxTactors()
   PLJCx_SelectProxTactors()
   #
   PLPLx_RecupRloc()
   PLJCx_RecupRloc()
   nlgs_ExSolver(gs_type,norm,tol,relax,gs_it1,gs_it2)
   PLPLx_StockRloc()
   PLJCx_StockRloc()
   #
   RBDY2_ComputeDof()
   #
   TimeEvolution_UpdateStep()
   RBDY2_UpdateDof()
   #
   #TimeEvolution_WriteLastDof()
   #RBDY2_WriteLastDof()
   ##
   #TimeEvolution_WriteLastVlocRloc()
   #PLPLx_WriteLastVlocRloc()
   #PLJCx_WriteLastVlocRloc()
   ### post2D ###
   writeTactorsToVTK('./DISPLAY/tacts'+'_'+str(k)+'.vtp',fit,tacts_dict)
   writeIntersToVTK('./DISPLAY/inters'+'_'+str(k)+'.vtp',fii,inters_dict,2.5e-2)

   ### postpro ###
   postpro_PostproDuringComputation()

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


### postpro ###
postpro_ClosePostproFiles()

stopCollection(fit)
stopCollection(fii)

# Stop and write timers here