How to plot a load-displacement diagram?

33 views
Skip to first unread message

alex.amar.aa

unread,
Jun 20, 2017, 5:16:18 AM6/20/17
to mofem Group
Using the cohesive interface module, how do  you extract the results, and from which file, to plot a load-displacement diagram?

Lukasz Kaczmraczyk

unread,
Jun 20, 2017, 6:11:22 AM6/20/17
to mofem...@googlegroups.com
Hello, 

You need to create model, like in the attached files. The you run 
./read_med -med_file PeelTest.med -meshsets_config config_peel.cfg  && \
./split_sideset -my_file out.h5m -my_side_sets 200

  • read_med read med file and config file, as result out.h5m is created with boundary conditions and data
  • split_sideset splits cracked part of interface and saves result, side set 200 in that case is split.

The you can run analysis,
cd /mofem_build/um/basic_finite_elements/cohesive_interface
mpirun
-np 2 ./arc_length_interface -my_file ../../tools/out.h5m \
-my_order 2 -ksp_type fgmres \
-pc_type lu -pc_factor_mat_solver_package mumps \
-ksp_monitor -ksp_atol 1e-10 -ksp_rtol 1e-10 \
-snes_monitor -snes_type newtonls -snes_linesearch_type l2 \
-snes_linesearch_monitor -snes_max_it 16 \
-snes_atol 1e-8 -snes_rtol 1e-12 -snes_stol 0 \
-my_sr 1e-1 -my_ms 50 -snes_converged_reason 2>&1| tee log

However, this not create data for load-disp plots. The best way is to go to Salome in that case and create group with one node. At that node displacement is recorder. Let asy that block number with node is 11, the in config file you add
[block_11]
# Applying material block (isotropic elastic material)
id
=1011
add
=BLOCKSET
name=LoadPath

With this when you run analysis you will get, output to the screen 
Load Step 1 step_size = 1.0000e-01
 
Set s = 1.0000e-01
 
Set alpha = 0.0000e+00 beta = 1.0000e+00
 
Init dlambda = 1.7688e-01 s = 1.0000e-01 beta = 1.0000e+00 F_lambda2 = 3.1961e-01
 
lambda = 0.0000e+00, 1.7688e-01 (1.7688e-01)
 dlambda
= 1.7688e-01 dx2 = 0.0000e+00
 res_lambda
= 0.0000e+00 lambda_int = 1.0000e-01 s = 1.0000e-01
 
lambda = 1.7688e-01
 fnorm
= 1.0000e-01
 
0 SNES Function norm 1.000000000000e-01
 diag
= 5.6534e-01
   
0 KSP Residual norm 1.000000000000e-01
   
1 KSP Residual norm 8.359163813424e-16
 dlambda
= 1.7688e-01 dx2 = 2.8246e+00
 res_lambda
= 0.0000e+00 lambda_int = 1.0000e-01 s = 1.0000e-01
 
lambda = 1.7688e-01
 fnorm
= 5.0000e-02
 dlambda
= 1.7688e-01 dx2 = 1.1298e+01
 res_lambda
= 0.0000e+00 lambda_int = 1.0000e-01 s = 1.0000e-01
 
lambda = 1.7688e-01
 fnorm
= 3.6988e-09
     
Line search: lambdas = [1., 0.5, 0.], fnorms = [9.34683e-16, 0.05, 0.1]
 dlambda
= 1.7688e-01 dx2 = 1.1298e+01
 res_lambda
= 0.0000e+00 lambda_int = 1.0000e-01 s = 1.0000e-01
 
lambda = 1.7688e-01
 fnorm
= 3.6988e-09
     
Line search terminated: lambda = 1., fnorms = 9.44837e-16
 
1 SNES Function norm 9.448374400553e-16
Nonlinear solve converged due to CONVERGED_FNORM_ABS iterations 1
number of
Newton iterations = 1
LAMBDA
[ 0 ] 1.7688e-01 -> DISPLACEMENT [ 0 ] -3.5171e-01 -> 5.0000 -1.0000 -0.5000
LAMBDA
[ 0 ] 1.7688e-01 -> DISPLACEMENT [ 1 ] -5.9478e-01 -> 5.0000 -1.0000 -0.5000
LAMBDA
[ 0 ] 1.7688e-01 -> DISPLACEMENT [ 2 ] 1.0627e-04 -> 5.0000 -1.0000 -0.5000

Lines beginning with lambda, this is what you looking for. Fifth column is load factor and eleventh is displacement in direction x, y, z, respectively for 0, 1 ,2. All this saved into file log, see 
mpirun -np 2 ./arc_length_interface .. 2>&1| tee log

Exploring this you can do,
grep "LAMBDA.*DISPLACEMENT \[ 1 \].*"  log  | tee data
That will extract all lines with displacements in y-direction. At that point you can analyse data in spreadsheet, or better, produce gnuplot file,
grep "LAMBDA.*DISPLACEMENT \[ 1 \].*"  log  | awk '{print $5,$11}' | tee data.gp
see gnuplot for more details link and many more on google.

Let me know if that works, if you have problems please ask.





config_peel.cfg
PeelTest.med
peel_half.hdf

alex.amar.aa

unread,
Jun 21, 2017, 4:25:54 AM6/21/17
to mofem Group
Thank you very much, I managed to draw the plot following those steps.
Reply all
Reply to author
Forward
0 new messages