command_DDM.py 4.16 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
import os,sys
from pylmgc90.chipy import *

overall_DIME(3,0)

# Nombre de decoupe suivant l'axe x et y
nb_sdmx  = 2
nb_sdmy  = 2
nb_sdmz  = 1
# Type de methode de DDM : 0 -> Schwarz ; 1 -> NSCDD 
ddm_type = 1

# Pilotage des pas de temps
nb_steps = 2000
dt = 1.e-3

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

# Frequence de detection des contacts "grossiers" qui donne
# aussi la frequence de partionnement en sous-domaine
freq_detect  = 5

# Frequence d'ecriture des visu VTK
freq_display = 50
# Frequence d'ecritue des DOF et VlocRloc
freq_write   = 50
# Frequence des sauvegardes des DOF, VlocRloc et timers
freq_last    = 1001
# Frequence d'ecriture dans les fichiers de postpro
freq_postpro = 1

# Pilotage du Gauss-Seisel
#       123456789012345678901234567890
36
type = 'Stored_Delassus_Loop          '
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
#type = 'Exchange_Local_Global         '
tol    = 1.e-4
relax  = 1.0
quad   = 'QM/16'
gs_it1 = 50
gs_it2 = 200

nlgs_SetWithQuickScramble()

### Initialisation de MPI ### 
overall_Initialize()

### WD par sous-domaine ###
DDM_3D_SetDDWorkingDirectory()

### Gestion des messages de log ### 
#utilities_DisableLogMes()
utilities_EnableLogMes()

### Pour ne pas ecrire les donnees ###
### des corps invisibles dans les  ###
### les fichiers par sous-domaine  ###
RBDY3_SkipInvisible()

### Definition des parametres du calcul ### 
utilities_logMes('INIT TIME STEPPING')
TimeEvolution_SetTimeStep(dt)
Integrator_InitTheta(theta)

### Model reading ###
utilities_logMes('READ BODIES')
RBDY3_ReadBodies()

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

utilities_logMes('READ DRIVEN DOF')
RBDY3_ReadDrivenDof()

### LOADS ###
POLYR_LoadTactors()
SPHER_LoadTactors()

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

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

### Ecriture paranoiaque du modele ###
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()

utilities_logMes('COMPUTE MASS')
RBDY3_ComputeMass()

### Initialisation du module DDM_2D ###
utilities_logMes('Initializing DDM')
DDM_3D_Initialize(nb_sdmx,nb_sdmy,nb_sdmz,ddm_type)
utilities_logMes('Set DDM parameters')
DDM_3D_SetParameters(freq_detect,freq_write,freq_last,freq_postpro,freq_display)

#nlgs_3D_DiagonalResolution()

### Boucle en temps ###
utilities_logMes('Starting Time Loop')

for k in xrange(1,nb_steps+1,1):
   #
   TimeEvolution_IncrementStep()
   TimeEvolution_DisplayStep()
   
   ### Detection grossiere et partionnement en sous-domaines ###
   overall_SelectProxTactors(freq_detect)
   DDM_3D_Partitioning()

   RBDY3_IncrementStep()
   RBDY3_ComputeFext()
   RBDY3_ComputeBulk()

   ### Ajout de la contribution des sous-domaines 
   ### interconnectes sur les corps d'interface ###
   DDM_3D_AddToFext()

   RBDY3_ComputeFreeVelocity()

   #
   # Functions embedded in SPSPx_SelectProxTactors(), PRPRx_SelectProxTactors()
   # are replaced by functions at the beginning of DDM_3D_ExSolver
   # because of a specificity of DDM current implementation.
   # Removing this specificity should be added to the TODO list !
   #PRPRx_SelectProxTactors()
   #
   # Functions embedded in PRPRx_RecpRloc()
   # are replaced by functions at the beginning of DDM_3D_ExSolver
   # because of a specificity of DDM current implementation.
   # Removing this specificity should be added to the TODO list !
   #PRPRx_RecupRloc()
   DDM_3D_ExSolver(type,quad, tol, relax, gs_it1, gs_it2)

   # Functions embedded in nlgs_UpdateTactBehav()
   # are replaced by functions at the very end of DDM_3D_ExSolver
   #nlgs_UpdateTactBehav()

   SPSPx_StockRloc()
   #
   DDM_3D_ComputeDof()
   #
   TimeEvolution_UpdateStep()
   RBDY3_UpdateDof()
   #
   ### Output : write, out, postpro and last ###
   DDM_3D_Post()

   ### writeout handling ###
   overall_CleanWriteOutFlags()

### LAST en fin de simulation ###
DDM_3D_WriteLast()

### postpro ###
DDM_3D_Finalize()
overall_Finalize()