command.py 2.89 KB
Newer Older
1 2 3 4 5 6 7 8

from pylmgc90.chipy import *
from numpy import *

checkDirectories()

utilities_DisableLogMes()

9
SetDimension(3)
10 11 12 13 14 15 16 17 18 19 20 21 22 23 24

### computation's parameters definition ### 
utilities_logMes('INIT TIME STEPPING')
# time step length
dt = 1.e-3
# value of the parameter of the theta-method
theta = 0.5
# number of time steps
nb_steps = 300

### parameters setting ###
#   * detection frequency
freq_detect = 1
#   * visualization frequency
freq_display = 10
25
ref_radius   = 1.
26 27 28 29
#   * frequence d'ecriture des fichier de sortie
freq_write = 50
#       123456789012345678901234567890
#   * nlgs solver parameters
30
type = 'Stored_Delassus_Loop          '
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
norm = 'QM/16'
tol = 0.1666e-3
relax = 1.0
gs_it1 = 51
gs_it2 = 501

#
TimeEvolution_SetTimeStep(dt)
Integrator_InitTheta(theta)
#

### model reading ###
utilities_logMes('READ BODIES')
RBDY3_ReadBodies()
#
CYLND_LoadTactors()
PLANx_LoadTactors()
#
overall_WriteBodies()
RBDY3_WriteBodies()
#
utilities_logMes('READ BEHAVIOURS')
bulk_behav_ReadBehaviours()
tact_behav_ReadBehaviours()

#LOADS
RBDY3_LoadBehaviours()

bulk_behav_WriteBehaviours()
tact_behav_WriteBehaviours()

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

TimeEvolution_WriteLastDof()
RBDY3_WriteLastDof()

utilities_logMes('READ INI Vloc Rloc')
TimeEvolution_ReadIniVlocRloc()
CDCDx_ReadIniVlocRloc()
CDPLx_ReadIniVlocRloc()

utilities_logMes('READ DRIVEN DOF')
RBDY3_ReadDrivenDof()

overall_WriteDrivenDof()
RBDY3_WriteDrivenDof()

### compute masses ###
RBDY3_ComputeMass()

### post3D ##
84
OpenDisplayFiles()
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

# time loop
for k in range(1, nb_steps + 1):
    #
    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)

    CDCDx_SelectProxTactors()
    CDPLx_SelectProxTactors()
    #
    CDCDx_RecupRloc()
    CDPLx_RecupRloc()

    utilities_logMes('RESOLUTION' )

    #utilities_logMes(str(type)+', '+str(norm)+', '+str(tol)+', '+str(relax)+', '+str(gs_it1)+', '+str(gs_it2))
    nlgs_3D_ExSolver(type, norm, tol, relax, gs_it1, gs_it2)

    CDCDx_StockRloc()
    CDPLx_StockRloc()
    #
    utilities_logMes('COMPUTE DOF')
    RBDY3_ComputeDof()
    #
    utilities_logMes('UPDATE DOF')
    TimeEvolution_UpdateStep()
    RBDY3_UpdateDof()

    ### post3D ###
129
    WriteDisplayFiles(freq_display,ref_radius)
130 131 132 133 134 135 136 137 138 139 140 141 142

    TimeEvolution_WriteOutDof(freq_write)
    RBDY3_WriteOutDof(-1,9999999)

    TimeEvolution_WriteOutVlocRloc(freq_write)
    CDCDx_WriteOutVlocRloc()
    CDPLx_WriteOutVlocRloc()

    ### writeout handling ###
    overall_CleanWriteOutFlags()

TimeEvolution_WriteLastDof()
RBDY3_WriteLastDof()
143 144

CloseDisplayFiles()