command.py 2.93 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
# importing chipy module
from pylmgc90.chipy import *
import numpy as N
import pylab as P


# Initializing
Initialize()

# checking/creating mandatory subfolders
checkDirectories()

#utilities_DisableLogMes()

# ------------------------------------------------------

# modeling hypothesis ( 1 = plain strain, 2 = plain stress, 3 = axi-symmetry)
mhyp = 1
dim= 3

# Set space dimension
SetDimension(dim,mhyp)

POLYR_SkipAutomaticReorientation()
#POLYR_FlatnessAngle(5.)
#POLYR_TopologyAngle(80.)

PRPRx_UseNcDetection(0.01)
PRPRx_LowSizeArrayPolyr(1000)


# theta integrator parameter
theta = 0.5

# time evolution parameters
dt     = 1e-2

# Defined the time discretisation and integrator

t_final = 20*dt


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

# Initialize theta integrator for all physical model
Integrator_InitTheta(theta)

# write parameter
freq_write   = 10

# display parameters
freq_display = 1
ref_radius   = 2.5e-2

# interaction parameters
freq_detect = 1
Rloc_tol    = 5.e-2

# nlgs parameters
tol    = 1e-4
relax  = 1.0
norm   = 'Quad '
gs_it1 = 50
gs_it2 = 10
66
type   = 'Stored_Delassus_Loop          '
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

nlgs_3D_DiagonalResolution()

#
utilities_logMes('READ BEHAVIOURS')
ReadBehaviours()
ReadModels()
#
utilities_logMes('READ BODIES')
ReadBodies()
#
utilities_logMes('LOAD BEHAVIOURS')
LoadBehaviours()
LoadModels()
#
utilities_logMes('READ INI DOF')
ReadIniDof()
#
utilities_logMes('READ INI GPV')
ReadIniGPV()
#
utilities_logMes('READ DRIVEN DOF')
ReadDrivenDof()
#
utilities_logMes('LOAD TACTORS')
LoadTactors()
#
utilities_logMes('READ INI Vloc Rloc')
ReadIniVlocRloc()

#
# open display & postpro
#
utilities_logMes('DISPLAY & WRITE')
OpenDisplayFiles()
#OpenPostproFiles()

# since constant compute elementary mass matrices once
utilities_logMes('COMPUTE MASS')
ComputeMass()

WriteDisplayFiles(freq_display,ref_radius)
##################### PARTIE THERMIQUE ####################

while TimeEvolution_GetTime() < t_final :
    #
    utilities_logMes('INCREMENT STEP')
    IncrementStep()
    #    
    utilities_logMes('COMPUTE Fext')
    ComputeFext()
    #
    utilities_logMes('COMPUTE Bulk')
    ComputeBulk()
    #
    utilities_logMes('COMPUTE Free Vlocy')
    ComputeFreeVelocity()
    #
    utilities_logMes('SELECT PROX TACTORS')
    SelectProxTactors(freq_detect)
    #
    utilities_logMes('RESOLUTION' )
    RecupRloc()
    #
    ExSolver(type, norm, tol, relax, gs_it1, gs_it2)
    UpdateTactBehav()
    #
    StockRloc()
    #
    utilities_logMes('COMPUTE DOF, FIELDS, etc.')
    ComputeDof()
    #
    utilities_logMes('UPDATE DOF, FIELDS')
    UpdateStep()
    #
    utilities_logMes('WRITE OUT DOF')
    WriteOutDof(freq_write)
    #
    utilities_logMes('WRITE OUT Rloc')
    WriteOutVlocRloc(freq_write)
    #
    utilities_logMes('VISU & POSTPRO')
    WriteDisplayFiles(freq_display,ref_radius)
    #~ WritePostproFiles()    


# close display & postpro
#
CloseDisplayFiles()
#ClosePostproFiles()


# this is the end
#~ Finalize()