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
......@@ -23,7 +23,7 @@ ref_radius = 1.
freq_detect = 1
# 123456789012345678901234567890
type = 'Exchange_Local_Global '
type = 'Stored_Delassus_Loop '
norm = 'Quad '
tol = 0.1666e-3
relax = 1.0
......
......@@ -23,7 +23,7 @@ ref_radius = 1.
freq_detect = 1
# 123456789012345678901234567890
type = 'Exchange_Local_Global '
type = 'Stored_Delassus_Loop '
norm = 'Quad '
tol = 0.1666e-3
relax = 1.0
......
......@@ -23,7 +23,7 @@ ref_radius=0.003
freq_detect = 1
# 123456789012345678901234567890
type = 'Exchange_Local_Global '
type = 'Stored_Delassus_Loop '
norm = 'Quad '
tol = 0.1e-3
relax = 1.0
......
......@@ -24,7 +24,7 @@ ref_radius=0.003
freq_detect = 1
# 123456789012345678901234567890
type = 'Exchange_Local_Global '
type = 'Stored_Delassus_Loop '
norm = 'Quad '
tol = 0.1e-3
relax = 1.0
......
......@@ -24,7 +24,7 @@ ref_radius=0.001
freq_detect = 1
# 123456789012345678901234567890
type = 'Exchange_Local_Global '
type = 'Stored_Delassus_Loop '
norm = 'Quad '
tol = 0.1e-4
relax = 1.0
......
......@@ -23,7 +23,7 @@ ref_radius=0.003
freq_detect = 1
# 123456789012345678901234567890
type = 'Exchange_Local_Global '
type = 'Stored_Delassus_Loop '
norm = 'Quad '
tol = 0.1e-3
relax = 1.0
......
......@@ -24,7 +24,7 @@ ref_radius = 0.01
freq_detect = 1
# 123456789012345678901234567890
type = 'Exchange_Local_Global '
type = 'Stored_Delassus_Loop '
quad = 'Quad '
tol = 0.1e-3
relax = 1.0
......@@ -167,7 +167,6 @@ for k in xrange(1, nb_steps + 1, 1):
#
CLALp_RecupRloc()
CLJCx_RecupRloc()
#nlgs_ExSolver('Exchange_Local_Global ','Quad ',0.1e-3,1.,100,10)
nlgs_ExSolver(type, quad, tol, relax, gs_it1, gs_it2)
CLALp_StockRloc()
CLJCx_StockRloc()
......
......@@ -23,7 +23,7 @@ ref_radius = 0.01
freq_detect = 1
# 123456789012345678901234567890
type = 'Exchange_Local_Global '
type = 'Stored_Delassus_Loop '
quad = 'Quad '
tol = 0.1e-3
relax = 1.0
......@@ -166,7 +166,6 @@ for k in xrange(1, nb_steps + 1, 1):
#
CLALp_RecupRloc()
CLJCx_RecupRloc()
#nlgs_ExSolver('Exchange_Local_Global ','Quad ',0.1e-3,1.,100,10)
nlgs_ExSolver(type, quad, tol, relax, gs_it1, gs_it2)
CLALp_StockRloc()
CLJCx_StockRloc()
......
......@@ -15,7 +15,7 @@ theta = 0.5
freq_detect = 1
tol = 0.1666e-3
relax = 1.0
type = 'Exchange_Local_Global '
type = 'Stored_Delassus_Loop '
norm = 'Quad '
gs_it1 = 51
gs_it2 = 1001
......
......@@ -16,7 +16,7 @@ theta = 0.5
freq_detect = 1
tol = 0.1666e-3
relax = 1.0
type = 'Exchange_Local_Global '
type = 'Stored_Delassus_Loop '
norm = 'QM/16'
gs_it1 = 51
gs_it2 = 501
......
......@@ -16,7 +16,7 @@ theta = 0.5
freq_detect = 1
tol = 0.1666e-3
relax = 1.0
type = 'Exchange_Local_Global '
type = 'Stored_Delassus_Loop '
norm = 'QM/16'
gs_it1 = 51
gs_it2 = 501
......
......@@ -16,7 +16,7 @@ theta = 0.5
freq_detect = 1
tol = 0.1666e-3
relax = 1.0
type = 'Exchange_Local_Global '
type = 'Stored_Delassus_Loop '
norm = 'QM/16'
gs_it1 = 51
gs_it2 = 501
......
......@@ -17,7 +17,7 @@ theta = 0.5
freq_detect = 1
tol = 0.1666e-3
relax = 1.0
type = 'Exchange_Local_Global '
type = 'Stored_Delassus_Loop '
norm = 'QM/16'
gs_it1 = 51
gs_it2 = 501
......
......@@ -17,7 +17,7 @@ theta = 0.5
freq_detect = 1
tol = 0.1666e-3
relax = 1.0
type = 'Exchange_Local_Global '
type = 'Stored_Delassus_Loop '
norm = 'QM/16'
gs_it1 = 51
gs_it2 = 501
......
import os,sys
from pylmgc90.chipy import *
# importing chipy module
from pylmgc90 import chipy
checkDirectories()
# Initializing
chipy.Initialize()
# checking/creating mandatory subfolders
chipy.checkDirectories()
# logMes
# chipy.utilities_DisableLogMes()
### definition des parametres du calcul ###
dim = 2
mhyp = 1
dt = 2e-4
nb_steps=3000
theta = 0.5
freq_write = 100
freq_display = 40
ref_radius = 0.1e-2
liste_tactors=['DISKx','JONCx']
liste_inters=['DKDKx','DKJCx']
deformable = 0
freq_detect = 1
norm='Exchange_Local_Global '
quad = 'Quad '
Rloc_tol = 5.e-2
norm = 'Quad '
tol = 1e-5
relax = 1.0
gs_it1 = 200
gs_it2 = 10
solver_type='Stored_Delassus_Loop '
nlgs_SetWithQuickScramble()
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()
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()
freq_write = 100
### ecriture paranoiaque du modele ###
utilities_logMes('WRITE BODIES')
overall_WriteBodies()
RBDY2_WriteBodies()
freq_display = 40
ref_radius = 0.1e-2
utilities_logMes('WRITE BEHAVIOURS')
bulk_behav_WriteBehaviours()
tact_behav_WriteBehaviours()
chipy.nlgs_SetWithQuickScramble()
# 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()
#
# 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()
utilities_logMes('WRITE DRIVEN DOF')
overall_WriteDrivenDof()
RBDY2_WriteDrivenDof()
chipy.utilities_logMes('COMPUTE Fext')
chipy.ComputeFext()
chipy.utilities_logMes('COMPUTE Fint')
chipy.ComputeBulk()
chipy.utilities_logMes('COMPUTE Free Vlocy')
chipy.ComputeFreeVelocity()
### postpro ###
postpro_PostproBeforeComputation()
chipy.utilities_logMes('SELECT PROX TACTORS')
chipy.SelectProxTactors(freq_detect)
utilities_logMes('COMPUTE MASS')
RBDY2_ComputeMass()
chipy.utilities_logMes('RESOLUTION' )
chipy.RecupRloc(Rloc_tol)
tactors_dict={}
InitTactorsToVTK(liste_tactors,tactors_dict)
chipy.ExSolver(solver_type, norm, tol, relax, gs_it1, gs_it2)
chipy.UpdateTactBehav()
inters_dict={}
InitIntersToVTK(liste_inters,inters_dict)
chipy.StockRloc()
fit = startCollection('DISPLAY/tacts.pvd')
fii = startCollection('DISPLAY/inters.pvd')
chipy.utilities_logMes('COMPUTE DOF, FIELDS, etc.')
chipy.ComputeDof()
for k in xrange(1,nb_steps+1,1):
#
utilities_logMes('INCREMENT STEP')
TimeEvolution_IncrementStep()
RBDY2_IncrementStep()
chipy.utilities_logMes('UPDATE DOF, FIELDS')
chipy.UpdateStep()
utilities_logMes('DISPLAY TIMES')
TimeEvolution_DisplayStep()
chipy.utilities_logMes('WRITE OUT DOF')
chipy.WriteOutDof(freq_write)
chipy.utilities_logMes('WRITE OUT Rloc')
chipy.WriteOutVlocRloc(freq_write)
utilities_logMes('COMPUTE Fext')
RBDY2_ComputeFext()
#chipy.utilities_logMes('VISU & POSTPRO')
#chipy.WriteDisplayFiles(freq_display,ref_radius)
#chipy.WritePostproFiles()
utilities_logMes('COMPUTE Fint')
RBDY2_ComputeBulk()
#
# close display & postpro
#
chipy.CloseDisplayFiles()
chipy.ClosePostproFiles()
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(norm,quad, 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 OUT Vloc Rloc')
TimeEvolution_WriteOutVlocRloc(freq_write)
DKDKx_WriteOutVlocRloc()
DKJCx_WriteOutVlocRloc()
#
### 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,ref_radius)
utilities_logMes('---')
### postpro ###
postpro_PostproDuringComputation()
### writeout handling ###
overall_CleanWriteOutFlags()
postpro_ClosePostproFiles()
stopCollection(fit)
stopCollection(fii)
# this is the end
chipy.Finalize()
from pylmgc90.chipy import *
dt = 2e-4
nb_steps=3000
theta = 0.5
freq_write = 100
freq_display = 40
ref_radius = 0.1e-2
freq_detect = 1
storage='Exchange_Local_Global '
norm = 'Quad '
tol = 1e-5
relax = 1.0
gs_it1 = 200
gs_it2 = 10
nlgs_SetWithQuickScramble()
checkDirectories()
### Set dimension in chipy for dummies ###
SetDimension(2)
### definition des parametres du calcul ###
utilities_logMes('INIT TIME STEPPING')
TimeEvolution_SetTimeStep(dt)
Integrator_InitTheta(theta)
### lecture du modele ###
utilities_logMes('READ BEHAVIOURS')
ReadBehaviours()
utilities_logMes('READ BODIES')
ReadBodies()
utilities_logMes('LOAD BEHAVIOURS')
LoadBehaviours()
utilities_logMes('READ INI DOF')
ReadIniDof()
utilities_logMes('READ DRIVEN DOF')
ReadDrivenDof()
utilities_logMes('LOAD TACTORS')
LoadTactors()
utilities_logMes('READ INI Vloc Rloc')
ReadIniVlocRloc()
### ecriture paranoiaque du modele ###
utilities_logMes('WRITE BODIES')
WriteBodies()
utilities_logMes('WRITE BEHAVIOURS')
WriteBehaviours()
utilities_logMes('WRITE DRIVEN DOF')
WriteDrivenDof()
OpenPostproFiles()
ComputeMass()
for k in xrange(0,nb_steps):
#
IncrementStep()
ComputeFext()
ComputeBulk()
ComputeFreeVelocity()
SelectProxTactors(freq_detect)
RecupRloc()
ExSolver(storage,norm,tol,relax,gs_it1,gs_it2)
StockRloc()
ComputeDof()
UpdateStep()
WriteOutDof(freq_write)
WriteOutVlocRloc(freq_write)
### postpro ###
WritePostproFiles()
### postpro ###
ClosePostproFiles()
from pylmgc90.chipy import *
from numpy import *
from pylmgc90 import chipy
# plage de fichiers a traiter
min=1
max=30
n_min=1
n_max=30
step = 1
checkDirectories()
chipy.checkDirectories()
# space dimension
dim = 2
mhyp = 1
# un pas de temps bidon ?
dt = 2.e-4
freq_display = 1
......@@ -16,63 +21,42 @@ freq_write = 1
######## etat 0 ###########################
### computation's parameters definition ###
overall_DIME(2,1)
chipy.SetDimension(dim,mhyp)
#utilities_logMes('INIT TIME STEPPING')
#TimeEvolution_SetTimeStep(dt)
utilities_logMes('INIT TIME STEPPING')
TimeEvolution_SetTimeStep(dt)
### model reading ###
print 'READ BODIES'
RBDY2_ReadBodies()
chipy.utilities_logMes('READ BEHAVIOURS')
chipy.ReadBehaviours()
chipy.utilities_logMes('READ BODIES')
chipy.ReadBodies()
print 'READ BEHAVIOURS'
bulk_behav_ReadBehaviours()
tact_behav_ReadBehaviours()
chipy.utilities_logMes('LOAD BEHAVIOURS')
chipy.LoadBehaviours()
#LOADS
DISKx_LoadTactors()
JONCx_LoadTactors()
RBDY2_LoadBehaviours()
chipy.utilities_logMes('READ INI DOF')
chipy.ReadIniDof()
print 'READ INI DOF'
TimeEvolution_ReadIniDof()
RBDY2_ReadIniDof()
chipy.utilities_logMes('LOAD TACTORS')
chipy.LoadTactors()
print 'READ INI Vloc Rloc'
TimeEvolution_ReadIniVlocRloc()
DKJCx_ReadIniVlocRloc()
DKDKx_ReadIniVlocRloc()
chipy.utilities_logMes('READ INI Vloc Rloc')
chipy.ReadIniVlocRloc()
names= ['DOF','Vloc_Rloc']
chipy.OpenDisplayFiles()
tacts_dict={}
InitTactorsToVTK(['DISKx','JONCx'],tacts_dict)
for k in xrange(n_min,n_max+1,step):
#
chipy.utilities_logMes('READ INI DOF')
chipy.ReadIniDof(k)
inters_dict={}
InitIntersToVTK(['DKDKx','DKJCx'],inters_dict)
chipy.utilities_logMes('READ INI Vloc Rloc')
chipy.ReadIniVlocRloc(k)
fit = startCollection('DISPLAY/tacts.pvd')
fii = startCollection('DISPLAY/inters.pvd')
chipy.WriteDisplayFiles(freq=1,ref_radius=0.1e-2)
for k in xrange(min,max+1,1):
#
utilities_logMes('on traite le set : '+str(k))
#
utilities_logMes('READ INI DOF')
TimeEvolution_ReadIniDof(k)
RBDY2_ReadIniDof(k)