You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

237 lines
11KB

  1. load "problem.ppl";
  2. load "run/analytical.ppl"
  3. ur1(x) = ur(0,x,0)
  4. sigmal1(x) = sigmal(0,x,0)
  5. sigmar1(x) = sigmar(0,x,0)
  6. sigmatheta1(x) = sigmatheta(0,x,0)
  7. delta = 0.05
  8. set preamble "\usepackage{amsmath}"
  9. set width 14*unit(cm)
  10. set axis x arrow nomirrored
  11. set axis y arrow nomirrored
  12. set grid
  13. set terminal pdf
  14. set output "ur.pdf"
  15. set xrange [a:b]
  16. set yrange [*:*]
  17. set key top right
  18. set xlabel "$r$ [mm]"
  19. set ylabel "$u_r(r)$ [mm]"
  20. plot ur1(x) w l lw 3 lt 1 color olivegreen ti "Analytical solution $u_r(r)$",\
  21. "run/pipe-dist-1-3.dat" u 2:4 w l lw 1 lt 2 color maroon ti "",\
  22. "run/pipe-dist-1-3.dat" u 2:4 w p pt 18 ps 1.5 color maroon every (100)/(1*3) ti "$n=3$ first order",\
  23. "run/pipe-dist-1-6.dat" u 2:4 w l lw 1 lt 4 color tan ti "",\
  24. "run/pipe-dist-1-6.dat" u 2:4 w p pt 16 ps 1.5 color tan every (100)/(1*6) ti "$n=6$ first order",\
  25. "run/pipe-dist-2-2.dat" u 2:4 w l lw 2 lt 3 color cerulean ti "",\
  26. "run/pipe-dist-2-2.dat" u 2:4 w p pt 17 ps 1.5 color cerulean every (100)/(2*2) ti "$n=2$ second order"
  27. set output "sigmatheta.pdf"
  28. set xrange [a:b]
  29. set yrange [*:*]
  30. set key top right
  31. set xlabel "$r$ [mm]"
  32. set ylabel "$\sigma_\theta(r)$ [mm]"
  33. plot sigmatheta1(x) w l lw 3 lt 1 color springgreen ti "Analytical solution $\sigma_\theta(r)$",\
  34. "run/pipe-dist-1-3.dat" u 2:5 w l lw 1 lt 2 color melon ti "",\
  35. "run/pipe-dist-1-3.dat" u 2:5 w p pt 18 ps 1.5 color melon every (100)/(1*3) ti "$n=3$ first order",\
  36. "run/pipe-dist-1-6.dat" u 2:5 w l lw 1 lt 2 color redorange ti "",\
  37. "run/pipe-dist-1-6.dat" u 2:5 w p pt 16 ps 1.5 color redorange every (100)/(1*6) ti "$n=6$ first order",\
  38. "run/pipe-dist-2-2.dat" u 2:5 w l lw 2 lt 3 color turquoise ti "",\
  39. "run/pipe-dist-2-2.dat" u 2:5 w p pt 17 ps 1.5 color turquoise every (100)/(2*2) ti "$n=2$ second order"
  40. set output "sigmal.pdf"
  41. set xrange [a:b]
  42. set yrange [*:*]
  43. set key top right
  44. set xlabel "$r$ [mm]"
  45. set ylabel "$\sigma_l(r)$ [mm]"
  46. plot sigmal1(x) w l lw 3 lt 1 color forestgreen ti "Analytical solution $\sigma_l(r)$",\
  47. "run/pipe-dist-1-3.dat" u 2:6 w l lw 1 lt 2 color peach ti "",\
  48. "run/pipe-dist-1-3.dat" u 2:6 w p pt 18 ps 1.5 color peach every (100)/(1*3) ti "$n=3$ first order",\
  49. "run/pipe-dist-1-6.dat" u 2:6 w l lw 1 lt 2 color dandelion ti "",\
  50. "run/pipe-dist-1-6.dat" u 2:6 w p pt 16 ps 1.5 color dandelion every (100)/(1*6) ti "$n=6$ first order",\
  51. "run/pipe-dist-2-3.dat" u 2:6 w l lw 2 lt 3 color periwinkle ti "",\
  52. "run/pipe-dist-2-3.dat" u 2:6 w p pt 17 ps 1.5 color periwinkle every (100)/(2*2) ti "$n=2$ second order"
  53. set output "sigmar.pdf"
  54. set xrange [a:b]
  55. set yrange [*:*]
  56. set key top left
  57. set xlabel "$r$ [mm]"
  58. set ylabel "$\sigma_r(r)$ [mm]"
  59. plot sigmar1(x) w l lw 3 lt 1 color emerald ti "Analytical solution $\sigma_r(r)$",\
  60. "run/pipe-dist-1-3.dat" u 2:7 w l lw 1 lt 2 color bittersweet ti "",\
  61. "run/pipe-dist-1-3.dat" u 2:7 w p pt 18 ps 1.5 color bittersweet every (100)/(1*3) ti "$n=3$ first order",\
  62. "run/pipe-dist-1-6.dat" u 2:7 w l lw 1 lt 2 color orange ti "",\
  63. "run/pipe-dist-1-6.dat" u 2:7 w p pt 16 ps 1.5 color orange every (100)/(1*6) ti "$n=6$ first order",\
  64. "run/pipe-dist-2-3.dat" u 2:7 w l lw 2 lt 3 color royalblue ti "",\
  65. "run/pipe-dist-2-3.dat" u 2:7 w p pt 17 ps 1.5 color royalblue every (100)/(2*2) ti "$n=2$ second order"
  66. set output "M_tresca.pdf"
  67. set key top right
  68. set xrange [*:*]
  69. set yrange [(1-delta)*M_tresca:(1+delta)*M_tresca]
  70. set xlabel "Number $n$ of elements through the pipe thickness"
  71. set ylabel "$\text{M}_\\text{tresca}$ [MPa]"
  72. plot M_tresca w l lw 3 lt 1 color green ti "Analytical solution",\
  73. "run/convergence-1.dat" u 1:2 w lp lw 2 lt 3 pt 2 ps 1.5 color brickred ti "First-order grid",\
  74. "run/convergence-2.dat" u 1:2 w lp lw 2 lt 2 pt 3 ps 1.5 color blue ti "Second-order grid"
  75. set output "M_vonmises.pdf"
  76. set key top right
  77. set yrange [(1-delta)*M_vonmises:(1+delta)*M_vonmises]
  78. set xlabel "Number $n$ of elements through the pipe thickness"
  79. set ylabel "$\text{M}_\\text{vonmises}$ [MPa]"
  80. plot M_vonmises w l lw 3 lt 1 color green ti "Analytical solution",\
  81. "run/convergence-1.dat" u 1:3 w lp lw 2 lt 3 pt 2 ps 1.5 color brickred ti "First-order grid",\
  82. "run/convergence-2.dat" u 1:3 w lp lw 2 lt 2 pt 3 ps 1.5 color blue ti "Second-order grid"
  83. set output "M_1.pdf"
  84. set key top right
  85. set yrange [(1-delta)*M_1:(1+delta)*M_1]
  86. set xlabel "Number $n$ of elements through the pipe thickness"
  87. set ylabel "$\text{M}_1$ [MPa]"
  88. plot M_1 w l lw 3 lt 1 color green ti "Analytical solution",\
  89. "run/convergence-1.dat" u 1:4 w lp lw 2 lt 3 pt 2 ps 1.5 color brickred ti "First-order grid",\
  90. "run/convergence-2.dat" u 1:4 w lp lw 2 lt 2 pt 3 ps 1.5 color blue ti "Second-order grid"
  91. set output "M_2.pdf"
  92. set key top right
  93. set yrange [(1-delta)*M_2:(1+delta)*M_2]
  94. set xlabel "Number $n$ of elements through the pipe thickness"
  95. set ylabel "$\text{M}_2$ [MPa]"
  96. plot M_2 w l lw 3 lt 1 color green ti "Analytical solution",\
  97. "run/convergence-1.dat" u 1:5 w lp lw 2 lt 3 pt 2 ps 1.5 color brickred ti "First-order grid",\
  98. "run/convergence-2.dat" u 1:5 w lp lw 2 lt 2 pt 3 ps 1.5 color blue ti "Second-order grid"
  99. set output "M_3.pdf"
  100. set key top right
  101. set yrange [(1+delta)*M_3:(1-delta)*M_3]
  102. set xlabel "Number $n$ of elements through the pipe thickness"
  103. set ylabel "$\text{M}_3$ [MPa]"
  104. plot M_3 w l lw 3 lt 1 color green ti "Analytical solution",\
  105. "run/convergence-1.dat" u 1:6 w lp lw 2 lt 3 pt 2 ps 1.5 color brickred ti "First-order grid",\
  106. "run/convergence-2.dat" u 1:6 w lp lw 2 lt 2 pt 3 ps 1.5 color blue ti "Second-order grid"
  107. set output "MB_tresca.pdf"
  108. set key top right
  109. set yrange [(1-delta)*MB_tresca:(1+delta)*MB_tresca]
  110. set xlabel "Number $n$ of elements through the pipe thickness"
  111. set ylabel "$\text{MB}_\\text{tresca}$ [MPa]"
  112. plot MB_tresca w l lw 3 lt 1 color limegreen ti "Analytical solution",\
  113. "run/convergence-1.dat" u 1:7 w lp lw 2 lt 3 pt 16 ps 1.5 color salmon ti "First-order grid",\
  114. "run/convergence-2.dat" u 1:7 w lp lw 2 lt 2 pt 17 ps 1.5 color cadetblue ti "Second-order grid"
  115. set output "MB_vonmises.pdf"
  116. set key top right
  117. set yrange [(1-delta)*MB_vonmises:(1+delta)*MB_vonmises]
  118. set xlabel "Number $n$ of elements through the pipe thickness"
  119. set ylabel "$\text{MB}_\\text{vonmises}$ [MPa]"
  120. plot MB_vonmises w l lw 3 lt 1 color limegreen ti "Analytical solution",\
  121. "run/convergence-1.dat" u 1:8 w lp lw 2 lt 3 pt 16 ps 1.5 color salmon ti "First-order grid",\
  122. "run/convergence-2.dat" u 1:8 w lp lw 2 lt 2 pt 17 ps 1.5 color cadetblue ti "Second-order grid"
  123. set output "MB_1.pdf"
  124. set key top right
  125. set yrange [(1-delta)*MB_1:(1+delta)*MB_1]
  126. set xlabel "Number $n$ of elements through the pipe thickness"
  127. set ylabel "$\text{MB}_1$ [MPa]"
  128. plot MB_1 w l lw 3 lt 1 color limegreen ti "Analytical solution",\
  129. "run/convergence-1.dat" u 1:9 w lp lw 2 lt 3 pt 16 ps 1.5 color salmon ti "First-order grid",\
  130. "run/convergence-2.dat" u 1:9 w lp lw 2 lt 2 pt 17 ps 1.5 color cadetblue ti "Second-order grid"
  131. set output "MB_2.pdf"
  132. set key top right
  133. set yrange [(1-delta)*MB_2:(1+delta)*MB_2]
  134. set xlabel "Number $n$ of elements through the pipe thickness"
  135. set ylabel "$\text{MB}_2$ [MPa]"
  136. plot MB_2 w l lw 3 lt 1 color limegreen ti "Analytical solution",\
  137. "run/convergence-1.dat" u 1:10 w lp lw 2 lt 3 pt 16 ps 1.5 color salmon ti "First-order grid",\
  138. "run/convergence-2.dat" u 1:10 w lp lw 2 lt 2 pt 17 ps 1.5 color cadetblue ti "Second-order grid"
  139. set output "MB_3.pdf"
  140. set key top right
  141. set yrange [(1+delta)*MB_3:(1-delta)*MB_3]
  142. set xlabel "Number $n$ of elements through the pipe thickness"
  143. set ylabel "$\text{MB}_3$ [MPa]"
  144. plot MB_3 w l lw 3 lt 1 color limegreen ti "Analytical solution",\
  145. "run/convergence-1.dat" u 1:11 w lp lw 2 lt 3 pt 16 ps 1.5 color salmon ti "First-order grid",\
  146. "run/convergence-2.dat" u 1:11 w lp lw 2 lt 2 pt 17 ps 1.5 color cadetblue ti "Second-order grid"
  147. set output "nodes-vs-n.pdf"
  148. set key bottom right
  149. set yrange [*:*]
  150. set logscale y
  151. set xlabel "Number $n$ of elements through the pipe thickness"
  152. set ylabel "Number of nodes"
  153. plot "run/convergence-1.dat" u 1:12 w lp lw 2 lt 3 pt 16 color melon ti "First-order grid",\
  154. "run/convergence-2.dat" u 1:12 w lp lw 3 lt 4 pt 17 color violet ti "Second-order grid"
  155. set output "elements-vs-n.pdf"
  156. set key bottom right
  157. set yrange [*:*]
  158. set logscale y
  159. set xlabel "Number $n$ of elements through the pipe thickness"
  160. set ylabel "Number of elements"
  161. plot "run/convergence-1.dat" u 1:13 w lp lw 2 lt 3 pt 16 ps 1.5 color apricot ti "First-order grid",\
  162. "run/convergence-2.dat" u 1:13 w lp lw 3 lt 4 pt 17 ps 1 color plum ti "Second-order grid"
  163. set output "cpu-vs-n.pdf"
  164. set key bottom right
  165. set yrange [*:*]
  166. set logscale y
  167. set xlabel "Number $n$ of elements through the pipe thickness"
  168. set ylabel "CPU time [sec]"
  169. plot "run/convergence-1.dat" u 1:14 w lp lw 2 lt 3 pt 16 ps 1.75 color melon ti "First-order grid",\
  170. "run/convergence-2.dat" u 1:14 w lp lw 3 lt 4 pt 17 ps 1.25 color plum ti "Second-order grid"
  171. set output "memory-vs-n.pdf"
  172. set key bottom right
  173. set yrange [*:*]
  174. set logscale y
  175. set xlabel "Number $n$ of elements through the pipe thickness"
  176. set ylabel "Memory [Mb]"
  177. plot "run/convergence-1.dat" u 1:15 w lp lw 2 lt 3 pt 16 color bittersweet ti "First-order grid",\
  178. "run/convergence-2.dat" u 1:15 w lp lw 3 lt 4 pt 17 color violet ti "Second-order grid"
  179. set output "error-M-vs-cpu.pdf"
  180. set key top right
  181. set yrange [*:*]
  182. set logscale y
  183. set logscale x
  184. set xlabel "CPU time [sec]"
  185. set ylabel "$|\text{M}_\\text{vonmises} - \text{analytical solution}|$ [MPa]"
  186. plot "run/convergence-1.dat" u 14:(abs($3-M_vonmises)) w lp lw 2 lt 3 pt 16 color orangered ti "First-order grid",\
  187. "run/convergence-2.dat" u 14:(abs($3-M_vonmises)) w lp lw 3 lt 4 pt 17 color cadetblue ti "Second-order grid"
  188. set output "error-MB-vs-cpu.pdf"
  189. set key top right
  190. set yrange [*:*]
  191. set logscale y
  192. set logscale x
  193. set xlabel "CPU time [sec]"
  194. set ylabel "$|\text{MB}_\\text{vonmises} - \text{analytical solution}|$ [MPa]"
  195. plot "run/convergence-1.dat" u 14:(abs($8-MB_vonmises)) w lp lw 2 lt 3 pt 16 color salmon ti "First-order grid",\
  196. "run/convergence-2.dat" u 14:(abs($8-MB_vonmises)) w lp lw 3 lt 4 pt 17 color navyblue ti "Second-order grid"