command_SEQ.py 3.71 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

from pylmgc90.chipy import *
from numpy import *

checkDirectories()

utilities_EnableLogMes()

overall_DIME(3,0)

# Time parameters
nb_steps = 50
dt = 0.005

# Parametre du schema d'integration
# de la dynamique des corps
theta = 0.5

# info generation fichier visu
freq_display = 10
liste_tactors=['POLYR']
liste_inters=['PRPRx']

freq_write = 10
freq_last  = 100

freq_detect = 501
nlgs_SetWithQuickScramble()

# Pilotage du Gauss-Seisel
#       123456789012345678901234567890
32
#type = 'Exchange_Local_Global         '
33
type   = 'Stored_Delassus_Loop          '
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
tol    = 1.e-4
relax  = 1.0
norm   = 'Quad '
gs_it1 = 50
gs_it2 = 200

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

### model reading ###
utilities_logMes('READ BODIES')
RBDY3_ReadBodies()
PLANx_LoadTactors()
POLYR_LoadTactors()

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

#LOADS
RBDY3_LoadBehaviours()

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

utilities_logMes('READ INI Vloc Rloc')
TimeEvolution_ReadIniVlocRloc()
PRPRx_ReadIniVlocRloc()
PRPLx_ReadIniVlocRloc()

utilities_logMes('READ DRIVEN DOF')
RBDY3_ReadDrivenDof()

utilities_logMes('WRITE BODIES')
overall_WriteBodies()
RBDY3_WriteBodies()

utilities_logMes('WRITE BEHAVIOURS')
bulk_behav_WriteBehaviours()
tact_behav_WriteBehaviours()

utilities_logMes('WRITE DRIVEN DOF')
overall_WriteDrivenDof()
RBDY3_WriteDrivenDof()

### post3D ##
postpro_3D_PostproBeforeComputation()

tactors_dict={}
InitTactorsToVTK(liste_tactors,tactors_dict)

inters_dict={}
InitIntersToVTK(liste_inters,inters_dict)

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

### compute masses ###
utilities_logMes('COMPUTE MASS')
RBDY3_ComputeMass()

#PRPRx_CundallIteration(200)
PRPRx_UseCpF2fExplicitDetection(1.e-3)
PRPRx_ShrinkPolyrFaces(0.05)
PRPRx_LowSizeArrayPolyr(10)

nlgs_3D_DiagonalResolution()

for k in range(nb_steps):
    #
    utilities_logMes('itere : '+str(k))
    #
    utilities_logMes('INCREMENT STEP')
    TimeEvolution_IncrementStep()
    RBDY3_IncrementStep()
    #
    utilities_logMes('COMPUTE Fext')
    RBDY3_ComputeFext()
    #
    utilities_logMes('COMPUTE Fint')
    RBDY3_ComputeBulk()
    # 
    utilities_logMes('COMPUTE Free Vlocy')
    RBDY3_ComputeFreeVelocity()
    #
    utilities_logMes('SELECT PROX TACTORS')
    overall_SelectProxTactors(freq_detect)
    PRPRx_SelectProxTactors()
    PRPLx_SelectProxTactors()
    
    PRPRx_RecupRloc()
    PRPLx_RecupRloc()

    nlgs_3D_ExSolver(type, norm, tol, relax, gs_it1, gs_it2)

    nlgs_3D_UpdateTactBehav()

    PRPRx_StockRloc()
    PRPLx_StockRloc()
    #
    utilities_logMes('COMPUTE DOF')
    RBDY3_ComputeDof()
    #
    utilities_logMes('UPDATE DOF')
    TimeEvolution_UpdateStep()
    RBDY3_UpdateDof()

    #### LAST ###
    #TimeEvolution_WriteLastVlocRloc(freq_last)
    #PRPRx_WriteLastVlocRloc()
    #TimeEvolution_WriteLastDof(freq_last)
    #RBDY3_WriteLastDof()
    ### OUTBOX ###
    TimeEvolution_WriteOutVlocRloc(freq_write)
    PRPRx_WriteOutVlocRloc()
    TimeEvolution_WriteOutDof(freq_write)
    RBDY3_WriteOutDof()

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

    ### postpro ###
    postpro_3D_PostproDuringComputation()

    ### writeout handling ###
    overall_CleanWriteOutFlags()

TimeEvolution_WriteLastVlocRloc()
PRPRx_WriteLastVlocRloc()
TimeEvolution_WriteLastDof()
RBDY3_WriteLastDof()

postpro_3D_ClosePostproFiles()
stopCollection(fit)
stopCollection(fii)