Commit 6ceffba4 authored by mozul's avatar mozul
Browse files

Merge commit '8e599252'

Get lmgc90_user_examples tag 2015.2
parents 8f90e403 8e599252
! File BEHAVIOUR
!
! The symbol '$' preceeds a keyword used in scanning files.
!
! The symbol 'behav' stands for the nickname of a bulk or
! contact behaviour law, character(len=5).
!
! The symbol 'lawty' stands for the name of a bulk or
! contact behaviour law, character(len=30).
!
! The symbol 'seety' stands for description of a candidate
! 'cdbdy' type of body, 'cdtac' type of contactor, 'cdcol' color
! ready to meet with the contact behaviour law 'behav' an antagonist
! 'anbdy' type of body, 'antac' type of contactor, 'ancol' color.
!
! Candidate antagonist objects are considered only within some distance
! 'alert'.
!
! STANDARD PACKAGE of bulk or contact behaviour laws
!
! 123456789012345678901234567890:
! :
! bulk behaviour :
! :
! RIGID : Rigid body
! :
$gravy
grv1= 0.0000000D+00 grv2=-0.9810000D+01 grv3= 0.0000000D+00
$behav lawty
plexx RIGID Umas= 0.2800000D+04
$behav lawty
TDURx RIGID Umas= 0.5000000D+03
#COMMAND.DAT :
#23456789012345678901234567890:
#NO CHECK CHIC COMMAND :
#
ECHO OFF :
DIME :
3D :
##############################
ECHO OFF :
TIME STEP :
0.1D-04 :
#
5.D-04 :
THETA :
0.5D0 :
#
APPELLE reading data : reading and processing data, see SUB
#
DIAGONAL RESOLUTION :
#
COMPUTE BOX :
COMPUTE MASS :
#
CUNDALL ITERATION :
200 :
#
LOW SIZE ARRAY POLYR :
10 :
#
loading step : label beginning of the loading loop
#
TOTALISATEURS A ZERO :
INCREMENT STEP :
DISPLAY TIMES :
#
#
COMPUTE Fext :
COMPUTE BULK :
COMPUTE FREE VELOCITY :
WCP SELECT PROX TACTORS :
#
#
APPELLE Signorini Coulomb :
#
COMPUTE DOF :
UPDATE DOF :
#
APPELLE writing results : writing and displaying results, see SUB
#
AFFICHE TOTALISATEURS :
AFFICHE COMPTEURS :
#
REPETE 199 FOIS :
DEPUIS loading step :
# :
#CLOSE POSTPRO FILES :
#
FIN DU PROGRAMME
#####
#-----------------------------:
SUB reading data :
# :
##############################
READ BODIES :
READ BEHAVIOURS :
READ INI DOF :
READ INI Vloc Rloc : from Vloc_Rloc.INI into verlt
READ INI Vloc Rloc :
READ DRIVEN DOF :
#
WRITE BODIES :
##############################
WRITE BODIES :
WRITE BEHAVIOURS :
WRITE DRIVEN DOF :
# : initializing gmv output
DISPLAY POSITION :
DISPLAY AVERAGE VELOCITY :
#DISPLAY STRESS :
##############################
PERIODIC CONDITION :
1.1 :
##############################
DISPLAY TACTORS :
#DISPLAY FORCES :
#DISPLAY HEAT :
INIT POST 3D :
#START POSTPRO :
DISPLAY STRESS :
DISPLAY AVERAGE VELOCITY :
DISPLAY DISPLACEMENT :
REFERENCE RADIUS :
0.025 :
INIT GMV :
WRITE OUTPUT GMV :
#
RETOUR
#-----------------------------:
#-----------------------------:
SUB writing results : writing and displaying results
#
WRITE LAST DOF : writing degrees of freedom and velocities
WRITE LAST Vloc Rloc :
#
#
UPDATE POST 3D :
#POSTPRO DURING COMPUTATION :
WRITE OUTPUT GMV STEP 1 :
#
RETOUR :
#-----------------------------:
#-----------------------------:
SUB Signorini Coulomb :
#
START POSTPRO :
##############################
COMPUTE BOX :
COMPUTE MASS :
##############################
loading step :
TOTALISATEURS A ZERO :
INCREMENT STEP :
DISPLAY TIMES :
##############################
COMPUTE Fext :
COMPUTE BULK :
##############################
COMPUTE FREE VELOCITY :
SELECT PROX TACTORS :
##############################
.doing Signorini Coulomb : Some label to draw attention
###ECHO OFF :
RECUP Rloc : from verlt into this
#
###ECHO OFF :
NLGS CHECK TYPE :
QM/16 0.1666D-03 : tol
QM/16 0.1666D-02 : Maxm,Quad,QM/16
1.D0 : RELAX
#
EX PREP NLGS :
Exchange_Local_Global :
#
>more :
# quickSCRAMBLE :
>iteration :
EX ITER NLGS :
REPETE 50 FOIS :
REPETE 5 FOIS :
DEPUIS >iteration :
AFTER ITER CHECK :
DISPLAY AFTER ITER CHECK :
### DISPLAY AFTER ITER CHECK :
IOK = FLAG 1 :
INTO AFTER ITER CHECK :
STOP REPETE SI IOK = 0 :
REPETE 500 FOIS :
REPETE 200 FOIS :
DEPUIS >more :
EX POST NLGS :
###ECHO OFF :
STOCK Rloc : from this into verlt
###ECHO ON
# :
RETOUR :
#-----------------------------:
#
##############################
COMPUTE DOF :
##############################
###WRITE LAST DOF :
####WRITE LAST Vloc Rloc :
#
WRITE OUT DOF STEP 500 : writing degrees of freedom and
WRITE OUT Vloc Rloc STEP 500 : writing relative velocities and
#
FIN DU FICHIER
WRITE OUTPUT GMV STEP 10 :
##############################
UPDATE DOF :
##############################
POSTPRO DURING COMPUTATION :
##############################
AFFICHE TOTALISATEURS :
AFFICHE COMPTEURS :
REPETE 1000 FOIS :
DEPUIS loading step :
##############################
CLOSE POSTPRO FILES :
##############################
FIN DU PROGRAMME :
FIN DU FICHIER :
This diff is collapsed.
!-----------------------------------------------------------------------
$bdyty
RBDY2 501
$nodty
NO3xx 1
$dofty [CT......+......AMP..*..cos.(..OMEGA.*.time.+.PHI..)]...*...[RAMPI.....+.....RAMP.*.time]
vlocy 1 0.0000000D+00 0.0000000D+00 0.0000000D+00 0.0000000D+00 0.1000000D+01 0.0000000D+00
vlocy 2 0.0000000D+00 0.0000000D+00 0.0000000D+00 0.0000000D+00 0.1000000D+01 0.0000000D+00
vlocy 3 0.0000000D+00 0.0000000D+00 0.0000000D+00 0.0000000D+00 0.1000000D+01 0.0000000D+00
$$$$$$
!-----------------------------------------------------------------------
$bdyty
RBDY2 502
$nodty
NO3xx 1
$dofty [CT......+......AMP..*..cos.(..OMEGA.*.time.+.PHI..)]...*...[RAMPI.....+.....RAMP.*.time]
vlocy 1 0.0000000D+00 0.0000000D+00 0.0000000D+00 0.0000000D+00 0.1000000D+01 0.0000000D+00
force 2 0.0000000D+00 0.0000000D+00 0.0000000D+00 0.0000000D+00 0.1000000D+01 0.0000000D+00
vlocy 3 0.0000000D+00 0.0000000D+00 0.0000000D+00 0.0000000D+00 0.1000000D+01 0.0000000D+00
$$$$$$
!-----------------------------------------------------------------------
#23456789012345678901234567890:
SOLVER INFORMATIONS :
STEP 1 :
VIOLATION EVOLUTION :
STEP 1 :
COORDINATION NUMBER :
STEP 1 :
AVERAGE VELOCITY EVOLUTION :
STEP 1 :
DENSE SAMPLE COMPACITY :
STEP 1 :
TORQUE EVOLUTION :
STEP 1 :
2 :
501 :
502 :
BODY TRACKING :
STEP 1 :
2 :
501 :
502 :
END :
! File BEHAVIOUR
!
! The symbol '$' preceeds a keyword used in scanning files.
!
! The symbol 'behav' stands for the nickname of a bulk or
! contact behaviour law, character(len=5).
!
! The symbol 'lawty' stands for the name of a bulk or
! contact behaviour law, character(len=30).
!
! The symbol 'seety' stands for description of a candidate
! 'cdbdy' type of body, 'cdtac' type of contactor, 'cdcol' color
! ready to meet with the contact behaviour law 'behav' an antagonist
! 'anbdy' type of body, 'antac' type of contactor, 'ancol' color.
!
! Candidate antagonist objects are considered only within some distance
! 'alert'.
!
! STANDARD PACKAGE of contact behaviour laws
!
! 123456789012345678901234567890:
! :
! contact behaviour :
! :
! IQS_CLB : Inelastic quasi shock &
! : Coulomb law
! GAP_SGR_CLB : Gap Signorini condition &
! : Coulomb law
! VEL_SGR_CLB : Velocity Signorini condition &
! : Coulomb law
! IQS_DS_CLB : Inelastic quasi shock &
! : dynamic static Coulomb law
! GAP_SGR_DS_CLB : Gap Signorini condition &
! : dynamic static Coulomb law
! VEL_SGR_DS_CLB : Velocity Signorini condition &
! : dynamic static Coulomb law
! RST_CLB : Restitution shock law &
! : Coulomb law
! RST_DS_CLB : Restitution shock law &
! : dynamic static Coulomb law
! IQS_DS_MOHR_CLB : Mohr-Coulomb law when cohesive, else
! : inelastic quasi shock &
! : dynamic static Coulomb law
! IQS_DS_WET_CLB : cohesive rolling frictionless dynamic
! : static Coulomb law, else,
! : inelastic quasi shock &
! : dynamic static Coulomb law
! ELASTIC_REPELL_CLB : Repulsive reaction force proportional
! : to penetration gap, vanishing
! : otherwise
! ELASTIC_ROD : Linear elastic rod under traction &
! : compression
! : (to be used with POINT against POINT)
! ELASTIC_WIRE : Elastic wire under traction &
! : inactive under compression
! : (to be used with POINT against POINT)
$behav lawty
iqsc0 IQS_CLB fric= 0.4000000D+00
$behav lawty
iqsc1 IQS_CLB fric= 0.5000000D+00
$behav lawty
erpcE ELASTIC_REPELL_CLB F/gp= 0.1000000D+07
fric= 0.8391000D+00
$behav lawty
gapc1 GAP_SGR_CLB fric= 0.5000000D+00
$behav lawty
velc1 VEL_SGR_CLB fric= 0.5000000D+00
$behav lawty
idsc1 IQS_DS_CLB dyfr= 0.3000000D+00 stfr= 0.5000000D+00
$behav lawty
gdsc1 GAP_SGR_DS_CLB dyfr= 0.3000000D+00 stfr= 0.5000000D+00
$behav lawty
vdsc1 VEL_SGR_DS_CLB dyfr= 0.5000000D+00 stfr= 0.6000000D+00
$behav lawty
rstc1 RST_CLB rstn= 0.9000000D+00 rstt 0.5000000D+00
fric= 0.0000000D+00
$behav lawty
rdsc1 RST_DS_CLB rstn= 0.9000000D+00 rstt= 0.5000000D+00
dyfr= 0.3000000D+00 stfr= 0.5000000D+00
$behav lawty
wet01 IQS_WET_DS_CLB cohn= 0.2234379D+01 Wthk= 0.1000000D-02
dyfr= 0.2500000D+00 stfr= 0.5500000D+00
$behav lawty
mohr1 IQS_MOHR_DS_CLB cohn= 0.9000000D+01 coht= 0.5000000D+00
dyfr= 0.2500000D+00 stfr= 0.5500000D+00
$seety
cdbdy cdtac cdcol behav anbdy antac ancol alert
RBDY2 POLYG BLEUx iqsc0 RBDY2 POLYG BLEUx 0.9000000D-02
$seety
cdbdy cdtac cdcol behav anbdy antac ancol alert
RBDY2 POLYG BLEUx iqsc0 RBDY2 JONCx WALLx 0.5000000D-02
from pylmgc90.chipy import *
# add timer definition and start here
checkDirectories()
### definition des parametres du calcul ###
dt=5e-4
nb_steps=10
theta=0.5
# peridioc length
lx=1.1
freq_display = 1
freq_write = 1
freq_detect = 1
tol = 0.1666e-4
relax = 1.0
norm = 'QM/16'
gs_it1 = 100
gs_it2 = 200
gs_type ='Stored_Delassus_Loops '
print 'INIT TIME STEPPING'
TimeEvolution_SetTimeStep(dt)
Integrator_InitTheta(theta)
### lecture du modele ###
print 'READ BODIES'
RBDY2_ReadBodies()
print 'READ BEHAVIOURS'
bulk_behav_ReadBehaviours()
tact_behav_ReadBehaviours()
#LOADS
POLYG_LoadTactors()
JONCx_LoadTactors()
RBDY2_LoadBehaviours()
print 'READ INI DOF'
TimeEvolution_ReadIniDof()
RBDY2_ReadIniDof()
print 'READ INI Vloc Rloc'
TimeEvolution_ReadIniVlocRloc()
PLPLx_ReadIniVlocRloc()
PLJCx_ReadIniVlocRloc()
print 'READ DRIVEN DOF'
RBDY2_ReadDrivenDof()
### ecriture paranoiaque du modele ###
print 'WRITE BODIES'
overall_WriteBodies()
RBDY2_WriteBodies()
print 'WRITE BEHAVIOURS'
bulk_behav_WriteBehaviours()
tact_behav_WriteBehaviours()
print 'WRITE DRIVEN DOF'
overall_WriteDrivenDof()
RBDY2_WriteDrivenDof()
### post2D ##
names= ['DOF','Vloc_Rloc']
tacts_dict={}
InitTactorsToVTK(['POLYG','JONCx'],tacts_dict)
inters_dict={}
InitIntersToVTK(['PLPLx','PLJCx'],inters_dict)
fit = startCollection('./DISPLAY/tacts.pvd')
fii = startCollection('./DISPLAY/inters.pvd')
### postpro ###
postpro_PostproBeforeComputation()
#
RBDY2_SetPeriodicCondition(lx)
PLPLx_SetPeriodicCondition(lx)
post2D_SetPeriodicCondition(lx)
RBDY2_ComputeMass()
for k in xrange(1,nb_steps+1,1):
#
TimeEvolution_IncrementStep()
RBDY2_IncrementStep()
TimeEvolution_DisplayStep()
RBDY2_ComputeFext()
RBDY2_ComputeBulk()
RBDY2_ComputeFreeVelocity()
#
overall_SelectProxTactors(freq_detect)
PLPLx_SelectProxTactors()
PLJCx_SelectProxTactors()
#
PLPLx_RecupRloc()
PLJCx_RecupRloc()
nlgs_ExSolver(gs_type,norm,tol,relax,gs_it1,gs_it2)
PLPLx_StockRloc()
PLJCx_StockRloc()
#
RBDY2_ComputeDof()
#
TimeEvolution_UpdateStep()
RBDY2_UpdateDof()
#
#TimeEvolution_WriteLastDof()
#RBDY2_WriteLastDof()
##
#TimeEvolution_WriteLastVlocRloc()
#PLPLx_WriteLastVlocRloc()
#PLJCx_WriteLastVlocRloc()
### post2D ###
writeTactorsToVTK('./DISPLAY/tacts'+'_'+str(k)+'.vtp',fit,tacts_dict)
writeIntersToVTK('./DISPLAY/inters'+'_'+str(k)+'.vtp',fii,inters_dict,2.5e-2)
### postpro ###
postpro_PostproDuringComputation()
### gestion des writeout ###
overall_CleanWriteOutFlags()
### postpro ###
postpro_ClosePostproFiles()
stopCollection(fit)
stopCollection(fii)
# Stop and write timers here
Open the directions/index.html in a web browser to get
the directions of the training session.
The examples to use during the trainin session are
in the different directories :
* 500PL_PerioBoxJC
* beam
* openmp
This diff is collapsed.
Parallelism
-----------
The parallel computation is a technic taking advantages to the fact that bit of computation
can be done on different processeur units. There are mainly to kinds of parallel computations:
* shared memory: all the cores have access to the whole available memory. Like using all the
cores of a computer. It is called multi-threading.
* distributed memory: each core has access to memory dedicated to it and the different cores
have to send messages from their respectiv memory. This is what clusters do and implements
a decomposition domain method.
Multi-threading
"""""""""""""""
This method is really is to use when there are independant computations to execute in a
sequential manner. A good example is to compute the free velocity of each bodies. There
is no exchange of information and if two cores are available, each could handle half of
the bodies. The contact solver can be multi-threaded to, it just add to the scrambling
of contacts order resolution.
The activate LMGC90 multi-threading, the code must be compiled with the cmake option
`WITH_OPENMP` activated. Thus type::
$ cd builds/Lmgc90
$ cmake . -DWITH_OPENMP=ON
$ make -j2
The default behaviour may depend on the operating system. Either the software will
use as many available cores as possible, or just one. To decide how many cores are
to be used, the environment variable `OMP_NUM_THREADS` is to be set. For example
to use 4 threads, one would type::
$ export OMP_NUM_THREADS=4
**Example:**
Simulation of a 2D box with about 45 000 diskx. Gives about 93 000 disk/disk contacts.
See the :download:`generation<files/openmp/gen_sample.py>` and
:download:`simulation<files/openmp/command.py>` scripts for more details. On our cluster,
lmgc90 compiled with ifort, 10 time steps give the following result without OpenMP::
real 11m15.421s
user 11m13.690s
sys 0m1.300s
And with OpenMP using 2 cpus::
real 6m55.312s
user 25m47.600s
sys 0m14.580s
**WARNING:** It seems that we are experiencing troubles with the multi-thread version compiled
with gfortran. Using more threads actually slows down the computation !!!
Domain decomposition method
"""""""""""""""""""""""""""