command.py 3.31 KB
Newer Older
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20
import os,sys

from pylmgc90.chipy import *

checkDirectories()

### definition des parametres du calcul ### 

dt=0.01
theta=0.5
nb_steps_meca=10
nb_steps_ther=20000

# info generation fichier visu
freq_display = 200
ref_radius = 0.1e-2
liste_tactors=['DISKx','JONCx']
liste_inters=['DKDKx','DKJCx']

freq_detect=1
21
type = 'Stored_Delassus_Loop          '
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
quad = 'Quad '
tol = 1.666e-5
relax = 1.
it1 = 33
it2 = 101

RBDY2_SetSurfaceSectors(1)

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

utilities_logMes('READ BODIES')
RBDY2_ReadBodies()

utilities_logMes('READ BEHAVIOURS')
bulk_behav_ReadBehaviours()
tact_behav_ReadBehaviours()

utilities_logMes('LOAD BULK & TACTORS')
RBDY2_LoadBehaviours()
DISKx_LoadTactors()
JONCx_LoadTactors()

mp_solver_ReadMpBehaviour()
RBDY2_MP_LoadBehaviours(0.,'therm')
#RBDY2_MP_LoadBehaviours(0.,'sener')

RBDY2_ComputeMass()

utilities_logMes('READ INITIAL STATE')
TimeEvolution_ReadIniDof()
RBDY2_ReadIniDof()

TimeEvolution_ReadIniVlocRloc()
DKDKx_ReadIniVlocRloc()
DKJCx_ReadIniVlocRloc()

RBDY2_ReadDrivenDof()

utilities_logMes('WRITE DATBOX COPY')
overall_WriteBodies()
RBDY2_WriteBodies()

tact_behav_WriteBehaviours()
bulk_behav_WriteBehaviours()
mp_solver_WriteMpBehaviour()

utilities_logMes('INIT POSTPRO')
postpro_PostproBeforeComputation()

#
utilities_logMes('COMPUTE MASS')
RBDY2_ComputeMass()

##################

tactors_dict={}
InitTactorsToVTK(liste_tactors,tactors_dict)

inters_dict={}
InitIntersToVTK(liste_inters,inters_dict)

85 86
fit = startCollection('DISPLAY/tacts.pvd')
fii = startCollection('DISPLAY/inters.pvd')
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

##################

utilities_logMes('START THERMO-MECA LOOP')

for k in xrange(1,nb_steps_meca+1,1):
   #
   utilities_logMes('INCREMENT STEP')
   TimeEvolution_IncrementStep()
   RBDY2_IncrementStep()
   
   utilities_logMes('DISPLAY TIME')
   TimeEvolution_DisplayStep()

   utilities_logMes('COMPUTE RHS')
   RBDY2_ComputeFext()
   RBDY2_ComputeBulk()
   RBDY2_ComputeFreeVelocity()

   utilities_logMes('CONTACT DETECTION')
   overall_SelectProxTactors(freq_detect)
   DKDKx_SelectProxTactors()
   DKJCx_SelectProxTactors()

   utilities_logMes('CONTACT RESOLUTION')
   DKDKx_RecupRloc()
   DKJCx_RecupRloc()
114
   nlgs_ExSolver(type,quad,tol,relax,it1,it2)
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
   DKDKx_StockRloc()
   DKJCx_StockRloc()

   utilities_logMes('THERMAL RESOLUTION')
   mp_solver_RecupTemperature()
   mp_solver_SolveThermoProblem()

   RBDY2_ComputeDof()

   TimeEvolution_UpdateStep()
   RBDY2_UpdateDof()

   postpro_PostproDuringComputation()
   overall_CleanWriteOutFlags()

#
RBDY2_NullifyVelocities()

utilities_logMes('THERMAL ONLY')

for i in xrange(nb_steps_ther+1):
   TimeEvolution_IncrementStep()
   RBDY2_IncrementStep()
   mp_solver_RecupTemperature()
   mp_solver_SolveThermoProblem()
   TimeEvolution_UpdateStep()
   RBDY2_UpdateDof()

   postpro_PostproDuringComputation()
   
   ### viz ###
   if i % freq_display == 0:
     utilities_logMes('tact')
     writeTactorsToVTK('./DISPLAY/tacts'+'_'+str(i)+'.vtp',fit,tactors_dict)
     utilities_logMes('inter')
     writeIntersToVTK('./DISPLAY/inters'+'_'+str(i)+'.vtp',fii,inters_dict,ref_radius)
     utilities_logMes('---')

   ### gestion des writeout ###
   overall_CleanWriteOutFlags()
#
utilities_logMes('WRITE LAST THERMAL DOF')
overall_WriteOutMpValues(1)
mp_solver_WriteOutMpValues()
#
postpro_ClosePostproFiles()