Commit 1f28f4d5 authored by mozul's avatar mozul
Browse files

Squashed 'examples/' changes from b82f1bc..53263b1

53263b1 Merge branch 'for_dummies' into 'master'
d183718 [NAMING] in mecaMAILx_RIGID_3D only command.py file with "for_dummies" commands
3d323d9 [NAMING] in mecaMAILx_RIGID_2D only command.py file with "for_dummies" commands
cfd31fb [NAMING] missed to switch to "for_dummies" in two examples of mecaMAILx_3D
665ba7f [FIX] missing POSTPRO.DAT in gen_sample
cd4f5d8 [FIX] typo in gen_sample
5814138 [FIX] missing POSTPRO.DAT or VlocRloc.INI files in some mecaMAILx_3D examples
0d24450 [FIX] missing VlocRloc.INI file in some mecaMAILx_2D examples
42b0ebf [NAMING] in mcaMAILx_3D only command.py file with "for_dummies" commands
f4bee99 [FIX] WriteDisplayFiles call in dilatation/_umat examples
405a013 [NAMING] in mcaMAILx_2D only command.py file with "for_dummies" commands
eca3adf [FIX] missing numpy import in 2_PR_TH_CZM
cfc3430 [FIX] several minor errors when changing scripts in "for_dummies" format
537ede0 [FIX] missing postpro in gen_samples of POLYF examples
7431bad [FIX] missing chipy. in 2_PR_TH_CZM and donut_skin examples
58df807 [FIX] missing postpro file in arche_plein_ceintre_3D
10ce891 [FIX] missing numpy module in POLYG_Vther
49fd7f9 [NAMING] in RIGID_3D only command.py file with "for_dummies" commands
c69ca53 [FIX] add missing postpro files in POLYG_Vther
4746f2b [NAMING] in RIGID_2D only command.py file with "for_dummies" commands
c11e51b notebook maillage
4eae20a Merge branch 'default_sdl' into 'master'
5ecefc4 [FIX] use of Stored_Delassus_Loop contact solver in every example

git-subtree-dir: examples
git-subtree-split: 53263b146be8dc255ca92f6efbc6986ddea769b5
parent 555ea7cd
......@@ -17,7 +17,7 @@ relax = 1.0
norm = 'Quad '
gs_it1 = 33
gs_it2 = 101
storage='Exchange_Local_Global '
storage='Stored_Delassus_Loop '
### definition des parametres du calcul ###
utilities_logMes('INIT TIME STEPPING')
......
# importing chipy module
from pylmgc90 import chipy
from pylmgc90.chipy import *
# Initializing
chipy.Initialize()
checkDirectories()
# checking/creating mandatory subfolders
chipy.checkDirectories()
utilities_DisableLogMes()
# logMes
# chipy.utilities_DisableLogMes()
### definition des parametres du calcul ###
#
# defining some variables
#
# space dimension
dim = 2
dim=2
# modeling hypothesis ( 1 = plain strain, 2 = plain stress, 3 = axi-symmetry)
mhyp = 1
dt = 0.001
# time evolution parameters
dt = 1e-3
nb_steps = 1000
# theta integrator parameter
theta = 0.5
# deformable yes=1, no=0
deformable = 0
# interaction parameters
freq_detect = 1
Rloc_tol = 5.e-2
# nlgs parameters
tol = 0.1666e-3
relax = 1.0
type = 'Exchange_Local_Global '
norm = 'Quad '
gs_it1 = 51
gs_it2 = 1001
gs_it1 = 50
gs_it2 = 1000
solver_type='Stored_Delassus_Loops '
freq_write = 50
# write parameter
freq_write = 50
# display parameters
freq_display = 50
ref_radius=0.05
SetDimension(dim)
utilities_logMes('INIT TIME STEPPING')
TimeEvolution_SetTimeStep(dt)
Integrator_InitTheta(theta)
### lecture du modele ###
utilities_logMes('READ BEHAVIOURS')
bulk_behav_ReadBehaviours()
tact_behav_ReadBehaviours()
### model reading ###
utilities_logMes('READ BODIES')
RBDY2_ReadBodies()
RBDY2_LoadBehaviours()
utilities_logMes('READ INI DOF')
TimeEvolution_ReadIniDof()
RBDY2_ReadIniDof()
utilities_logMes('READ DRIVEN DOF')
RBDY2_ReadDrivenDof()
#LOADS
DISKx_LoadTactors()
JONCx_LoadTactors()
utilities_logMes('READ INI Vloc Rloc')
TimeEvolution_ReadIniVlocRloc()
DKJCx_ReadIniVlocRloc()
DKDKx_ReadIniVlocRloc()
### ecriture paranoiaque du modele ###
utilities_logMes('WRITE BODIES')
overall_WriteBodies()
RBDY2_WriteBodies()
utilities_logMes('WRITE BEHAVIOURS')
bulk_behav_WriteBehaviours()
tact_behav_WriteBehaviours()
utilities_logMes('WRITE DRIVEN DOF')
overall_WriteDrivenDof()
RBDY2_WriteDrivenDof()
#
OpenDisplayFiles()
OpenPostproFiles()
SetDomainBoundary(Ymin=-1.5)
utilities_logMes('COMPUTE MASS')
RBDY2_ComputeMass()
for k in xrange(1,1001,1):
#
utilities_logMes('INCREMENT STEP')
TimeEvolution_IncrementStep()
RBDY2_IncrementStep()
utilities_logMes('DISPLAY TIMES')
TimeEvolution_DisplayStep()
utilities_logMes('COMPUTE Fext')
RBDY2_ComputeFext()
utilities_logMes('COMPUTE Fint')
RBDY2_ComputeBulk()
utilities_logMes('COMPUTE Free Vlocy')
RBDY2_ComputeFreeVelocity()
#
utilities_logMes('SELECT PROX TACTORS')
overall_SelectProxTactors(freq_detect)
DKJCx_SelectProxTactors()
DKDKx_SelectProxTactors()
#
DKJCx_RecupRloc()
DKDKx_RecupRloc()
nlgs_ExSolver(type, norm, tol, relax, gs_it1, gs_it2)
DKJCx_StockRloc()
DKDKx_StockRloc()
#
utilities_logMes('COMPUTE DOF')
RBDY2_ComputeDof()
#
utilities_logMes('UPDATE DOF')
TimeEvolution_UpdateStep()
RBDY2_UpdateDof()
#
utilities_logMes('WRITE OUT DOF')
TimeEvolution_WriteOutDof(freq_write)
RBDY2_WriteOutDof()
#
utilities_logMes('WRITE OUTT Vloc Rloc')
TimeEvolution_WriteOutVlocRloc(freq_write)
DKDKx_WriteOutVlocRloc()
DKJCx_WriteOutVlocRloc()
#
WriteDisplayFiles(freq_display,ref_radius)
WritePostproFiles()
### wrtieout handling ###
overall_CleanWriteOutFlags()
CloseDisplayFiles()
ClosePostproFiles()
ref_radius = 5.e-2
#
# read and load
#
# Set space dimension
chipy.SetDimension(dim,mhyp)
#
chipy.utilities_logMes('INIT TIME STEPPING')
chipy.TimeEvolution_SetTimeStep(dt)
chipy.Integrator_InitTheta(theta)
#
chipy.utilities_logMes('READ BEHAVIOURS')
chipy.ReadBehaviours()
if deformable: chipy.ReadModels()
#
chipy.utilities_logMes('READ BODIES')
chipy.ReadBodies()
#
chipy.utilities_logMes('LOAD BEHAVIOURS')
chipy.LoadBehaviours()
if deformable: chipy.LoadModels()
#
chipy.utilities_logMes('READ INI DOF')
chipy.ReadIniDof()
#
if deformable:
chipy.utilities_logMes('READ INI GPV')
chipy.ReadIniGPV()
#
chipy.utilities_logMes('READ DRIVEN DOF')
chipy.ReadDrivenDof()
#
chipy.utilities_logMes('LOAD TACTORS')
chipy.LoadTactors()
#
chipy.utilities_logMes('READ INI Vloc Rloc')
chipy.ReadIniVlocRloc()
#
# paranoid writes
#
chipy.utilities_logMes('WRITE BODIES')
chipy.WriteBodies()
chipy.utilities_logMes('WRITE BEHAVIOURS')
chipy.WriteBehaviours()
chipy.utilities_logMes('WRITE DRIVEN DOF')
chipy.WriteDrivenDof()
#
# open display & postpro
#
chipy.utilities_logMes('DISPLAY & WRITE')
chipy.OpenDisplayFiles()
chipy.OpenPostproFiles()
chipy.SetDomainBoundary(Ymin=-1.5)
#
# simulation part ...
#
# ... calls a simulation time loop
# since constant compute elementary mass once
chipy.utilities_logMes('COMPUTE MASS')
chipy.ComputeMass()
for k in xrange(0,nb_steps):
#
chipy.utilities_logMes('INCREMENT STEP')
chipy.IncrementStep()
chipy.utilities_logMes('COMPUTE Fext')
chipy.ComputeFext()
chipy.utilities_logMes('COMPUTE Fint')
chipy.ComputeBulk()
chipy.utilities_logMes('COMPUTE Free Vlocy')
chipy.ComputeFreeVelocity()
chipy.utilities_logMes('SELECT PROX TACTORS')
chipy.SelectProxTactors(freq_detect)
chipy.utilities_logMes('RESOLUTION' )
chipy.RecupRloc(Rloc_tol)
chipy.ExSolver(solver_type, norm, tol, relax, gs_it1, gs_it2)
chipy.UpdateTactBehav()
chipy.StockRloc()
chipy.utilities_logMes('COMPUTE DOF, FIELDS, etc.')
chipy.ComputeDof()
chipy.utilities_logMes('UPDATE DOF, FIELDS')
chipy.UpdateStep()
chipy.utilities_logMes('WRITE OUT DOF')
chipy.WriteOutDof(freq_write)
chipy.utilities_logMes('WRITE OUT Rloc')
chipy.WriteOutVlocRloc(freq_write)
chipy.utilities_logMes('VISU & POSTPRO')
chipy.WriteDisplayFiles(freq_display,ref_radius)
chipy.WritePostproFiles()
#
# close display & postpro
#
chipy.CloseDisplayFiles()
chipy.ClosePostproFiles()
# this is the end
chipy.Finalize()
from pylmgc90.chipy import *
checkDirectories()
SetDimension(2)
utilities_DisableLogMes()
### definition des parametres du calcul ###
utilities_logMes('INIT TIME STEPPING')
dt = 0.001
theta = 0.5
freq_detect = 1
tol = 0.1666e-3
relax = 1.0
type = 'Exchange_Local_Global '
norm = 'Quad '
gs_it1 = 51
gs_it2 = 1001
freq_display= 50
ref_radius=0.05
TimeEvolution_SetTimeStep(dt)
Integrator_InitTheta(theta)
### model reading ###
utilities_logMes('READ BODIES')
ReadBodies()
utilities_logMes('READ BEHAVIOURS')
ReadBehaviours()
LoadBehaviours()
utilities_logMes('READ INI DOF')
ReadIniDof()
utilities_logMes('LOAD TACTORS')
LoadTactors()
utilities_logMes('READ INI Vloc Rloc')
ReadIniVlocRloc()
utilities_logMes('READ DRIVEN DOF')
ReadDrivenDof()
### ecriture paranoiaque du modele ###
utilities_logMes('WRITE BODIES')
WriteBodies()
utilities_logMes('WRITE BEHAVIOURS')
WriteBehaviours()
utilities_logMes('WRITE DRIVEN DOF')
WriteDrivenDof()
### post2D ##
OpenDisplayFiles()
OpenPostproFiles()
utilities_logMes('COMPUTE MASS')
ComputeMass()
#for k in xrange(1,3000,1):
for k in xrange(1,1001,1):
#
utilities_logMes('itere : '+str(k))
#
utilities_logMes('INCREMENT STEP')
IncrementStep()
utilities_logMes('COMPUTE Fext')
ComputeFext()
utilities_logMes('COMPUTE Fint')
ComputeBulk()
utilities_logMes('COMPUTE Free Vlocy')
ComputeFreeVelocity()
#
utilities_logMes('SELECT PROX TACTORS')
SelectProxTactors(freq_detect)
#
RecupRloc()
nlgs_ExSolver(type, norm, tol, relax, gs_it1, gs_it2)
StockRloc()
#
utilities_logMes('COMPUTE DOF')
ComputeDof()
#
utilities_logMes('UPDATE DOF')
UpdateStep()
#
utilities_logMes('WRITE LAST DOF')
WriteLastDof()
#
utilities_logMes('WRITE LAST Vloc Rloc')
WriteLastVlocRloc()
#
### post2D ###
WriteDisplayFiles(freq_display,ref_radius)
### postpro ###
WritePostproFiles()
CloseDisplayFiles()
### postpro ###
ClosePostproFiles()
import os,sys
# importing chipy module
from pylmgc90 import chipy
from pylmgc90.chipy import *
# Initializing
chipy.Initialize()
checkDirectories()
dt = 0.00003
# checking/creating mandatory subfolders
chipy.checkDirectories()
freq_display = 1000
liste_tactors=['DISKx','JONCx']
liste_inters=['DKDKx','DKJCx']
# logMes
# chipy.utilities_DisableLogMes()
#
# defining some variables
#
# space dimension
dim = 2
# modeling hypothesis ( 1 = plain strain, 2 = plain stress, 3 = axi-symmetry)
mhyp = 1
# time evolution parameters
dt = 3e-5
nb_steps = 100000
# theta integrator parameter
theta = 0.5
# deformable yes=1, no=0
deformable = 0
# interaction parameters
freq_detect = 1
Rloc_tol = 1.e-2
# nlgs parameters
tol = 1e-4
relax = 1.0
norm = 'Quad '
gs_it1 = 50
gs_it2 = 10
solver_type='Stored_Delassus_Loops '
### definition des parametres du calcul ###
utilities_logMes('INIT TIME STEPPING')
TimeEvolution_SetTimeStep(dt)
Integrator_InitVerlet()
### model reading ###
utilities_logMes('READ BEHAVIOURS')
bulk_behav_ReadBehaviours()
tact_behav_ReadBehaviours()
utilities_logMes('READ BODIES')
RBDY2_ReadBodies()
utilities_logMes('READ INI DOF')
TimeEvolution_ReadIniDof()
RBDY2_ReadIniDof()
#LOADS
DISKx_LoadTactors()
JONCx_LoadTactors()
RBDY2_LoadBehaviours()
utilities_logMes('READ INI Vloc Rloc')
TimeEvolution_ReadIniVlocRloc()
DKJCx_ReadIniVlocRloc()
DKDKx_ReadIniVlocRloc()
utilities_logMes('READ DRIVEN DOF')
RBDY2_ReadDrivenDof()
### ecriture paranoiaque du modele ###
utilities_logMes('WRITE BODIES')
overall_WriteBodies()
RBDY2_WriteBodies()
utilities_logMes('WRITE BEHAVIOURS')
bulk_behav_WriteBehaviours()
tact_behav_WriteBehaviours()
utilities_logMes('WRITE DRIVEN DOF')
overall_WriteDrivenDof()
RBDY2_WriteDrivenDof()
tactors_dict={}
InitTactorsToVTK(liste_tactors,tactors_dict)
inters_dict={}
InitIntersToVTK(liste_inters,inters_dict)
fit = startCollection('DISPLAY/tacts.pvd')
fii = startCollection('DISPLAY/inters.pvd')
### postpro ###
postpro_PostproBeforeComputation()
utilities_logMes('COMPUTE MASS')
RBDY2_ComputeMass()
for k in xrange(1,100001,1):
#
utilities_logMes('INCREMENT STEP')
TimeEvolution_IncrementStep()
RBDY2_IncrementStep()
utilities_logMes('DISPLAY TIMES')
TimeEvolution_DisplayStep()
utilities_logMes('COMPUTE Fext')
RBDY2_ComputeFext()
utilities_logMes('COMPUTE Fint')
RBDY2_ComputeBulk()
utilities_logMes('COMPUTE Free Vlocy')
RBDY2_ComputeFreeVelocity()
#
utilities_logMes('SELECT PROX TACTORS')
overall_SelectProxTactors(freq_detect)
DKJCx_SelectProxTactors()
DKDKx_SelectProxTactors()
#
DKDKx_SmoothForceComputation()
DKJCx_SmoothForceComputation()
DKJCx_StockRloc()
DKDKx_StockRloc()
#
utilities_logMes('COMPUTE DOF')
RBDY2_ComputeDof()
#
utilities_logMes('UPDATE DOF')
TimeEvolution_UpdateStep()
RBDY2_UpdateDof()
#
utilities_logMes('WRITE LAST DOF')
TimeEvolution_WriteLastDof()
RBDY2_WriteLastDof()
#
utilities_logMes('WRITE LAST Vloc Rloc')
TimeEvolution_WriteLastVlocRloc()
DKDKx_WriteLastVlocRloc()
DKJCx_WriteLastVlocRloc()
#
### post2D ###
### viz ###
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,1e-2)
utilities_logMes('---')
### postpro ###
postpro_PostproDuringComputation()
### writeout handling ###
overall_CleanWriteOutFlags()
### postpro ###
postpro_ClosePostproFiles()
stopCollection(fit)
stopCollection(fii)
# write parameter
freq_write = 1000
# display parameters
freq_display = 1000
ref_radius = 2.5e-2
#
# read and load
#
# Set space dimension
chipy.SetDimension(dim,mhyp)
#
chipy.utilities_logMes('INIT TIME STEPPING')
chipy.TimeEvolution_SetTimeStep(dt)
chipy.Integrator_InitTheta(theta)
#
chipy.utilities_logMes('READ BEHAVIOURS')
chipy.ReadBehaviours()
if deformable: chipy.ReadModels()
#
chipy.utilities_logMes('READ BODIES')
chipy.ReadBodies()
#
chipy.utilities_logMes('LOAD BEHAVIOURS')
chipy.LoadBehaviours()
if deformable: chipy.LoadModels()
#
chipy.utilities_logMes('READ INI DOF')
chipy.ReadIniDof()
#
if deformable:
chipy.utilities_logMes('READ INI GPV')
chipy.ReadIniGPV()
#
chipy.utilities_logMes('READ DRIVEN DOF')
chipy.ReadDrivenDof()
#
chipy.utilities_logMes('LOAD TACTORS')
chipy.LoadTactors()
#
chipy.utilities_logMes('READ INI Vloc Rloc')