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. ...@@ -23,7 +23,7 @@ ref_radius = 1.
freq_detect = 1 freq_detect = 1
# 123456789012345678901234567890 # 123456789012345678901234567890
type = 'Exchange_Local_Global ' type = 'Stored_Delassus_Loop '
norm = 'Quad ' norm = 'Quad '
tol = 0.1666e-3 tol = 0.1666e-3
relax = 1.0 relax = 1.0
......
...@@ -23,7 +23,7 @@ ref_radius = 1. ...@@ -23,7 +23,7 @@ ref_radius = 1.
freq_detect = 1 freq_detect = 1
# 123456789012345678901234567890 # 123456789012345678901234567890
type = 'Exchange_Local_Global ' type = 'Stored_Delassus_Loop '
norm = 'Quad ' norm = 'Quad '
tol = 0.1666e-3 tol = 0.1666e-3
relax = 1.0 relax = 1.0
......
...@@ -23,7 +23,7 @@ ref_radius=0.003 ...@@ -23,7 +23,7 @@ ref_radius=0.003
freq_detect = 1 freq_detect = 1
# 123456789012345678901234567890 # 123456789012345678901234567890
type = 'Exchange_Local_Global ' type = 'Stored_Delassus_Loop '
norm = 'Quad ' norm = 'Quad '
tol = 0.1e-3 tol = 0.1e-3
relax = 1.0 relax = 1.0
......
...@@ -24,7 +24,7 @@ ref_radius=0.003 ...@@ -24,7 +24,7 @@ ref_radius=0.003
freq_detect = 1 freq_detect = 1
# 123456789012345678901234567890 # 123456789012345678901234567890
type = 'Exchange_Local_Global ' type = 'Stored_Delassus_Loop '
norm = 'Quad ' norm = 'Quad '
tol = 0.1e-3 tol = 0.1e-3
relax = 1.0 relax = 1.0
......
...@@ -24,7 +24,7 @@ ref_radius=0.001 ...@@ -24,7 +24,7 @@ ref_radius=0.001
freq_detect = 1 freq_detect = 1
# 123456789012345678901234567890 # 123456789012345678901234567890
type = 'Exchange_Local_Global ' type = 'Stored_Delassus_Loop '
norm = 'Quad ' norm = 'Quad '
tol = 0.1e-4 tol = 0.1e-4
relax = 1.0 relax = 1.0
......
...@@ -23,7 +23,7 @@ ref_radius=0.003 ...@@ -23,7 +23,7 @@ ref_radius=0.003
freq_detect = 1 freq_detect = 1
# 123456789012345678901234567890 # 123456789012345678901234567890
type = 'Exchange_Local_Global ' type = 'Stored_Delassus_Loop '
norm = 'Quad ' norm = 'Quad '
tol = 0.1e-3 tol = 0.1e-3
relax = 1.0 relax = 1.0
......
...@@ -24,7 +24,7 @@ ref_radius = 0.01 ...@@ -24,7 +24,7 @@ ref_radius = 0.01
freq_detect = 1 freq_detect = 1
# 123456789012345678901234567890 # 123456789012345678901234567890
type = 'Exchange_Local_Global ' type = 'Stored_Delassus_Loop '
quad = 'Quad ' quad = 'Quad '
tol = 0.1e-3 tol = 0.1e-3
relax = 1.0 relax = 1.0
...@@ -167,7 +167,6 @@ for k in xrange(1, nb_steps + 1, 1): ...@@ -167,7 +167,6 @@ for k in xrange(1, nb_steps + 1, 1):
# #
CLALp_RecupRloc() CLALp_RecupRloc()
CLJCx_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) nlgs_ExSolver(type, quad, tol, relax, gs_it1, gs_it2)
CLALp_StockRloc() CLALp_StockRloc()
CLJCx_StockRloc() CLJCx_StockRloc()
......
...@@ -23,7 +23,7 @@ ref_radius = 0.01 ...@@ -23,7 +23,7 @@ ref_radius = 0.01
freq_detect = 1 freq_detect = 1
# 123456789012345678901234567890 # 123456789012345678901234567890
type = 'Exchange_Local_Global ' type = 'Stored_Delassus_Loop '
quad = 'Quad ' quad = 'Quad '
tol = 0.1e-3 tol = 0.1e-3
relax = 1.0 relax = 1.0
...@@ -166,7 +166,6 @@ for k in xrange(1, nb_steps + 1, 1): ...@@ -166,7 +166,6 @@ for k in xrange(1, nb_steps + 1, 1):
# #
CLALp_RecupRloc() CLALp_RecupRloc()
CLJCx_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) nlgs_ExSolver(type, quad, tol, relax, gs_it1, gs_it2)
CLALp_StockRloc() CLALp_StockRloc()
CLJCx_StockRloc() CLJCx_StockRloc()
......
...@@ -15,7 +15,7 @@ theta = 0.5 ...@@ -15,7 +15,7 @@ theta = 0.5
freq_detect = 1 freq_detect = 1
tol = 0.1666e-3 tol = 0.1666e-3
relax = 1.0 relax = 1.0
type = 'Exchange_Local_Global ' type = 'Stored_Delassus_Loop '
norm = 'Quad ' norm = 'Quad '
gs_it1 = 51 gs_it1 = 51
gs_it2 = 1001 gs_it2 = 1001
......
...@@ -16,7 +16,7 @@ theta = 0.5 ...@@ -16,7 +16,7 @@ theta = 0.5
freq_detect = 1 freq_detect = 1
tol = 0.1666e-3 tol = 0.1666e-3
relax = 1.0 relax = 1.0
type = 'Exchange_Local_Global ' type = 'Stored_Delassus_Loop '
norm = 'QM/16' norm = 'QM/16'
gs_it1 = 51 gs_it1 = 51
gs_it2 = 501 gs_it2 = 501
......
...@@ -16,7 +16,7 @@ theta = 0.5 ...@@ -16,7 +16,7 @@ theta = 0.5
freq_detect = 1 freq_detect = 1
tol = 0.1666e-3 tol = 0.1666e-3
relax = 1.0 relax = 1.0
type = 'Exchange_Local_Global ' type = 'Stored_Delassus_Loop '
norm = 'QM/16' norm = 'QM/16'
gs_it1 = 51 gs_it1 = 51
gs_it2 = 501 gs_it2 = 501
......
...@@ -16,7 +16,7 @@ theta = 0.5 ...@@ -16,7 +16,7 @@ theta = 0.5
freq_detect = 1 freq_detect = 1
tol = 0.1666e-3 tol = 0.1666e-3
relax = 1.0 relax = 1.0
type = 'Exchange_Local_Global ' type = 'Stored_Delassus_Loop '
norm = 'QM/16' norm = 'QM/16'
gs_it1 = 51 gs_it1 = 51
gs_it2 = 501 gs_it2 = 501
......
...@@ -17,7 +17,7 @@ theta = 0.5 ...@@ -17,7 +17,7 @@ theta = 0.5
freq_detect = 1 freq_detect = 1
tol = 0.1666e-3 tol = 0.1666e-3
relax = 1.0 relax = 1.0
type = 'Exchange_Local_Global ' type = 'Stored_Delassus_Loop '
norm = 'QM/16' norm = 'QM/16'
gs_it1 = 51 gs_it1 = 51
gs_it2 = 501 gs_it2 = 501
......
...@@ -17,7 +17,7 @@ theta = 0.5 ...@@ -17,7 +17,7 @@ theta = 0.5
freq_detect = 1 freq_detect = 1
tol = 0.1666e-3 tol = 0.1666e-3
relax = 1.0 relax = 1.0
type = 'Exchange_Local_Global ' type = 'Stored_Delassus_Loop '
norm = 'QM/16' norm = 'QM/16'
gs_it1 = 51 gs_it1 = 51
gs_it2 = 501 gs_it2 = 501
......
import os,sys # importing chipy module
from pylmgc90.chipy import * from pylmgc90 import chipy
checkDirectories() # Initializing
chipy.Initialize()
# checking/creating mandatory subfolders
chipy.checkDirectories()
# logMes
# chipy.utilities_DisableLogMes()
### definition des parametres du calcul ### ### definition des parametres du calcul ###
dim = 2
mhyp = 1
dt = 2e-4 dt = 2e-4
nb_steps=3000 nb_steps=3000
theta = 0.5 theta = 0.5
freq_write = 100 deformable = 0
freq_display = 40
ref_radius = 0.1e-2
liste_tactors=['DISKx','JONCx']
liste_inters=['DKDKx','DKJCx']
freq_detect = 1 freq_detect = 1
norm='Exchange_Local_Global ' Rloc_tol = 5.e-2
quad = 'Quad '
norm = 'Quad '
tol = 1e-5 tol = 1e-5
relax = 1.0 relax = 1.0
gs_it1 = 200 gs_it1 = 200
gs_it2 = 10 gs_it2 = 10
solver_type='Stored_Delassus_Loop '
nlgs_SetWithQuickScramble() freq_write = 100
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()
### ecriture paranoiaque du modele ### freq_display = 40
utilities_logMes('WRITE BODIES') ref_radius = 0.1e-2
overall_WriteBodies()
RBDY2_WriteBodies()
utilities_logMes('WRITE BEHAVIOURS') chipy.nlgs_SetWithQuickScramble()
bulk_behav_WriteBehaviours()
tact_behav_WriteBehaviours() # 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') chipy.utilities_logMes('COMPUTE Fext')
overall_WriteDrivenDof() chipy.ComputeFext()
RBDY2_WriteDrivenDof() chipy.utilities_logMes('COMPUTE Fint')
chipy.ComputeBulk()
chipy.utilities_logMes('COMPUTE Free Vlocy')
chipy.ComputeFreeVelocity()
### postpro ### chipy.utilities_logMes('SELECT PROX TACTORS')
postpro_PostproBeforeComputation() chipy.SelectProxTactors(freq_detect)
utilities_logMes('COMPUTE MASS') chipy.utilities_logMes('RESOLUTION' )
RBDY2_ComputeMass() chipy.RecupRloc(Rloc_tol)
tactors_dict={} chipy.ExSolver(solver_type, norm, tol, relax, gs_it1, gs_it2)
InitTactorsToVTK(liste_tactors,tactors_dict) chipy.UpdateTactBehav()
inters_dict={} chipy.StockRloc()
InitIntersToVTK(liste_inters,inters_dict)
fit = startCollection('DISPLAY/tacts.pvd') chipy.utilities_logMes('COMPUTE DOF, FIELDS, etc.')
fii = startCollection('DISPLAY/inters.pvd') chipy.ComputeDof()
for k in xrange(1,nb_steps+1,1): chipy.utilities_logMes('UPDATE DOF, FIELDS')
# chipy.UpdateStep()
utilities_logMes('INCREMENT STEP')
TimeEvolution_IncrementStep()
RBDY2_IncrementStep()
utilities_logMes('DISPLAY TIMES') chipy.utilities_logMes('WRITE OUT DOF')
TimeEvolution_DisplayStep() chipy.WriteOutDof(freq_write)
chipy.utilities_logMes('WRITE OUT Rloc')
chipy.WriteOutVlocRloc(freq_write)
utilities_logMes('COMPUTE Fext') #chipy.utilities_logMes('VISU & POSTPRO')
RBDY2_ComputeFext() #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') # this is the end
RBDY2_ComputeFreeVelocity() chipy.Finalize()
#
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)
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()