vasputils 0.0.11 → 0.0.12

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (406) hide show
  1. data/CHANGES +49 -28
  2. data/Gemfile +10 -9
  3. data/VERSION +1 -1
  4. data/{test/vaspgeometryoptimizer/ended-Iter1/try00/CONTCAR → bin/changeincar} +0 -0
  5. data/bin/checkvasp +106 -75
  6. data/bin/genincar +4 -4
  7. data/bin/genkpoints +13 -13
  8. data/bin/genpotcar +2 -2
  9. data/bin/latticeconstants +10 -12
  10. data/bin/qsubvasp +63 -80
  11. data/bin/resetvaspdir +51 -0
  12. data/bin/resetvaspgeomopt +73 -0
  13. data/bin/runvasp +42 -49
  14. data/bin/runvaspdir +19 -0
  15. data/bin/runvaspgeomopt +19 -0
  16. data/bin/showvaspdir +171 -0
  17. data/bin/showvaspgeomopt +83 -0
  18. data/bin/symposcar +89 -113
  19. data/bin/varycondition +28 -0
  20. data/example/dot.vasputils +26 -232
  21. data/lib/vasputils/conditionvarier.rb +157 -0
  22. data/lib/vasputils/incar.rb +40 -43
  23. data/lib/vasputils/kpoints.rb +31 -33
  24. data/lib/vasputils/outcar.rb +53 -53
  25. data/lib/vasputils/poscar.rb +148 -150
  26. data/lib/vasputils/potcar/concatenater.rb +22 -22
  27. data/lib/vasputils/potcar.rb +12 -12
  28. data/lib/vasputils/setting.rb +22 -22
  29. data/lib/vasputils/vaspdir.rb +199 -86
  30. data/lib/vasputils/vaspgeometryoptimizer.rb +233 -100
  31. data/lib/vasputils.rb +7 -65
  32. data/test/conditionanalyzer/00/POSCAR +8 -0
  33. data/test/conditionanalyzer/00/encut400_k444/CONTCAR +8 -0
  34. data/test/conditionanalyzer/00/encut400_k444/INCAR +28 -0
  35. data/test/conditionanalyzer/00/encut400_k444/KPOINTS +6 -0
  36. data/test/conditionanalyzer/00/encut400_k444/OUTCAR +1436 -0
  37. data/test/conditionanalyzer/00/encut400_k444/POSCAR +8 -0
  38. data/test/conditionanalyzer/00/encut400_k444/POTCAR +16 -0
  39. data/test/conditionanalyzer/00/encut400_k555/CONTCAR +8 -0
  40. data/test/conditionanalyzer/00/encut400_k555/INCAR +28 -0
  41. data/test/conditionanalyzer/00/encut400_k555/KPOINTS +6 -0
  42. data/test/conditionanalyzer/00/encut400_k555/OUTCAR +1436 -0
  43. data/test/conditionanalyzer/00/encut400_k555/POSCAR +8 -0
  44. data/test/conditionanalyzer/00/encut400_k555/POTCAR +16 -0
  45. data/test/conditionanalyzer/00/encut500_k444/CONTCAR +8 -0
  46. data/test/conditionanalyzer/00/encut500_k444/INCAR +28 -0
  47. data/test/conditionanalyzer/00/encut500_k444/KPOINTS +6 -0
  48. data/test/conditionanalyzer/00/encut500_k444/OUTCAR +1436 -0
  49. data/test/conditionanalyzer/00/encut500_k444/POSCAR +8 -0
  50. data/test/conditionanalyzer/00/encut500_k444/POTCAR +16 -0
  51. data/test/conditionanalyzer/00/encut500_k555/CONTCAR +8 -0
  52. data/test/conditionanalyzer/00/encut500_k555/INCAR +28 -0
  53. data/test/conditionanalyzer/00/encut500_k555/KPOINTS +6 -0
  54. data/test/conditionanalyzer/00/encut500_k555/OUTCAR +1436 -0
  55. data/test/conditionanalyzer/00/encut500_k555/POSCAR +8 -0
  56. data/test/conditionanalyzer/00/encut500_k555/POTCAR +16 -0
  57. data/test/{vaspkpointsfinder/01-01-01/try00 → conditionanalyzer/01/00-original}/INCAR +3 -3
  58. data/test/conditionanalyzer/01/00-original/KPOINTS +6 -0
  59. data/test/conditionanalyzer/01/00-original/POSCAR +10 -0
  60. data/test/conditionanalyzer/01/01-ENCUT/1000/try02/CONTCAR +13 -0
  61. data/test/conditionanalyzer/01/01-ENCUT/1000/try02/INCAR +17 -0
  62. data/test/conditionanalyzer/01/01-ENCUT/1000/try02/KPOINTS +6 -0
  63. data/test/conditionanalyzer/01/01-ENCUT/1000/try02/OUTCAR +1692 -0
  64. data/test/conditionanalyzer/01/01-ENCUT/1000/try02/POSCAR +13 -0
  65. data/test/conditionanalyzer/01/01-ENCUT/1200/try02/CONTCAR +13 -0
  66. data/test/conditionanalyzer/01/01-ENCUT/1200/try02/INCAR +17 -0
  67. data/test/conditionanalyzer/01/01-ENCUT/1200/try02/KPOINTS +6 -0
  68. data/test/conditionanalyzer/01/01-ENCUT/1200/try02/OUTCAR +1692 -0
  69. data/test/conditionanalyzer/01/01-ENCUT/1200/try02/POSCAR +13 -0
  70. data/test/conditionanalyzer/01/01-ENCUT/1500/try02/CONTCAR +13 -0
  71. data/test/conditionanalyzer/01/01-ENCUT/1500/try02/INCAR +17 -0
  72. data/test/conditionanalyzer/01/01-ENCUT/1500/try02/KPOINTS +6 -0
  73. data/test/conditionanalyzer/01/01-ENCUT/1500/try02/OUTCAR +1742 -0
  74. data/test/conditionanalyzer/01/01-ENCUT/1500/try02/POSCAR +13 -0
  75. data/test/conditionanalyzer/01/01-ENCUT/500/try05/CONTCAR +13 -0
  76. data/test/conditionanalyzer/01/01-ENCUT/500/try05/INCAR +17 -0
  77. data/test/conditionanalyzer/01/01-ENCUT/500/try05/KPOINTS +6 -0
  78. data/test/conditionanalyzer/01/01-ENCUT/500/try05/OUTCAR +1644 -0
  79. data/test/conditionanalyzer/01/01-ENCUT/500/try05/POSCAR +13 -0
  80. data/test/conditionanalyzer/01/01-ENCUT/600/try01/CONTCAR +13 -0
  81. data/test/conditionanalyzer/01/01-ENCUT/600/try01/INCAR +17 -0
  82. data/test/conditionanalyzer/01/01-ENCUT/600/try01/KPOINTS +6 -0
  83. data/test/conditionanalyzer/01/01-ENCUT/600/try01/OUTCAR +1644 -0
  84. data/test/conditionanalyzer/01/01-ENCUT/600/try01/POSCAR +13 -0
  85. data/test/conditionanalyzer/01/01-ENCUT/700/try01/CONTCAR +13 -0
  86. data/test/conditionanalyzer/01/01-ENCUT/700/try01/INCAR +17 -0
  87. data/test/conditionanalyzer/01/01-ENCUT/700/try01/KPOINTS +6 -0
  88. data/test/conditionanalyzer/01/01-ENCUT/700/try01/OUTCAR +1644 -0
  89. data/test/conditionanalyzer/01/01-ENCUT/700/try01/POSCAR +13 -0
  90. data/test/conditionanalyzer/01/01-ENCUT/800/try01/CONTCAR +13 -0
  91. data/test/conditionanalyzer/01/01-ENCUT/800/try01/INCAR +17 -0
  92. data/test/conditionanalyzer/01/01-ENCUT/800/try01/KPOINTS +6 -0
  93. data/test/conditionanalyzer/01/01-ENCUT/800/try01/OUTCAR +3610 -0
  94. data/test/conditionanalyzer/01/01-ENCUT/800/try01/POSCAR +10 -0
  95. data/test/conditionanalyzer/01/01-ENCUT/900/try01/CONTCAR +13 -0
  96. data/test/conditionanalyzer/01/01-ENCUT/900/try01/INCAR +17 -0
  97. data/test/conditionanalyzer/01/01-ENCUT/900/try01/KPOINTS +6 -0
  98. data/test/conditionanalyzer/01/01-ENCUT/900/try01/OUTCAR +1692 -0
  99. data/test/conditionanalyzer/01/01-ENCUT/900/try01/POSCAR +13 -0
  100. data/test/conditionanalyzer/01/02-KPOINTS/16x16x16/try07/CONTCAR +13 -0
  101. data/test/conditionanalyzer/01/02-KPOINTS/16x16x16/try07/INCAR +17 -0
  102. data/test/conditionanalyzer/01/02-KPOINTS/16x16x16/try07/KPOINTS +6 -0
  103. data/test/conditionanalyzer/01/02-KPOINTS/16x16x16/try07/OUTCAR +12318 -0
  104. data/test/conditionanalyzer/01/02-KPOINTS/16x16x16/try07/POSCAR +13 -0
  105. data/test/conditionanalyzer/01/02-KPOINTS/1x1x1/try07/CONTCAR +13 -0
  106. data/test/conditionanalyzer/01/02-KPOINTS/1x1x1/try07/INCAR +17 -0
  107. data/test/{vaspkpointsfinder/01-01-01/try00 → conditionanalyzer/01/02-KPOINTS/1x1x1/try07}/KPOINTS +1 -1
  108. data/test/conditionanalyzer/01/02-KPOINTS/1x1x1/try07/OUTCAR +1337 -0
  109. data/test/conditionanalyzer/01/02-KPOINTS/1x1x1/try07/POSCAR +13 -0
  110. data/test/conditionanalyzer/01/02-KPOINTS/2x2x2/try10/CONTCAR +13 -0
  111. data/test/conditionanalyzer/01/02-KPOINTS/2x2x2/try10/INCAR +17 -0
  112. data/test/conditionanalyzer/01/02-KPOINTS/2x2x2/try10/KPOINTS +6 -0
  113. data/test/conditionanalyzer/01/02-KPOINTS/2x2x2/try10/OUTCAR +9885 -0
  114. data/test/conditionanalyzer/01/02-KPOINTS/2x2x2/try10/POSCAR +13 -0
  115. data/test/conditionanalyzer/01/02-KPOINTS/32x32x32/try06/CONTCAR +13 -0
  116. data/test/conditionanalyzer/01/02-KPOINTS/32x32x32/try06/INCAR +17 -0
  117. data/test/conditionanalyzer/01/02-KPOINTS/32x32x32/try06/KPOINTS +6 -0
  118. data/test/conditionanalyzer/01/02-KPOINTS/32x32x32/try06/OUTCAR +72342 -0
  119. data/test/conditionanalyzer/01/02-KPOINTS/32x32x32/try06/POSCAR +13 -0
  120. data/test/conditionanalyzer/01/02-KPOINTS/32x32x64/try04/CONTCAR +13 -0
  121. data/test/conditionanalyzer/01/02-KPOINTS/32x32x64/try04/INCAR +17 -0
  122. data/test/conditionanalyzer/01/02-KPOINTS/32x32x64/try04/KPOINTS +6 -0
  123. data/test/conditionanalyzer/01/02-KPOINTS/32x32x64/try04/OUTCAR +139254 -0
  124. data/test/conditionanalyzer/01/02-KPOINTS/32x32x64/try04/POSCAR +13 -0
  125. data/test/conditionanalyzer/01/02-KPOINTS/4x4x4/try05/CONTCAR +13 -0
  126. data/test/conditionanalyzer/01/02-KPOINTS/4x4x4/try05/INCAR +17 -0
  127. data/test/conditionanalyzer/01/02-KPOINTS/4x4x4/try05/KPOINTS +6 -0
  128. data/test/conditionanalyzer/01/02-KPOINTS/4x4x4/try05/OUTCAR +1644 -0
  129. data/test/conditionanalyzer/01/02-KPOINTS/4x4x4/try05/POSCAR +13 -0
  130. data/test/conditionanalyzer/01/02-KPOINTS/64x64x64/INCAR +17 -0
  131. data/test/conditionanalyzer/01/02-KPOINTS/64x64x64/KPOINTS +6 -0
  132. data/test/conditionanalyzer/01/02-KPOINTS/64x64x64/OUTCAR +507061 -0
  133. data/test/conditionanalyzer/01/02-KPOINTS/64x64x64/POSCAR +10 -0
  134. data/test/conditionanalyzer/01/02-KPOINTS/8x8x8/try05/CONTCAR +13 -0
  135. data/test/conditionanalyzer/01/02-KPOINTS/8x8x8/try05/INCAR +17 -0
  136. data/test/conditionanalyzer/01/02-KPOINTS/8x8x8/try05/KPOINTS +6 -0
  137. data/test/conditionanalyzer/01/02-KPOINTS/8x8x8/try05/OUTCAR +3298 -0
  138. data/test/conditionanalyzer/01/02-KPOINTS/8x8x8/try05/POSCAR +13 -0
  139. data/test/conditionanalyzer/mixed_conditions/orthorhombic/CONTCAR +17 -0
  140. data/test/conditionanalyzer/mixed_conditions/orthorhombic/INCAR +28 -0
  141. data/test/conditionanalyzer/mixed_conditions/orthorhombic/KPOINTS +6 -0
  142. data/test/conditionanalyzer/mixed_conditions/orthorhombic/OUTCAR +1436 -0
  143. data/test/conditionanalyzer/mixed_conditions/orthorhombic/POSCAR +12 -0
  144. data/test/conditionanalyzer/mixed_conditions/orthorhombic/POTCAR +16 -0
  145. data/test/conditionanalyzer/mixed_conditions/tetragonal/CONTCAR +17 -0
  146. data/test/conditionanalyzer/mixed_conditions/tetragonal/INCAR +28 -0
  147. data/test/conditionanalyzer/mixed_conditions/tetragonal/KPOINTS +6 -0
  148. data/test/conditionanalyzer/mixed_conditions/tetragonal/OUTCAR +1436 -0
  149. data/test/conditionanalyzer/mixed_conditions/tetragonal/POSCAR +12 -0
  150. data/test/conditionanalyzer/mixed_conditions/tetragonal/POTCAR +16 -0
  151. data/test/conditionanalyzer/picker/encut400_k444-cubic/INCAR +28 -0
  152. data/test/conditionanalyzer/picker/encut400_k444-cubic/KPOINTS +6 -0
  153. data/test/conditionanalyzer/picker/encut400_k444-cubic/OUTCAR +1436 -0
  154. data/test/conditionanalyzer/picker/encut400_k444-cubic/POSCAR +9 -0
  155. data/test/conditionanalyzer/picker/encut400_k444-cubic/POTCAR +16 -0
  156. data/test/conditionanalyzer/picker/encut400_k444-tetragonal-b/INCAR +28 -0
  157. data/test/conditionanalyzer/picker/encut400_k444-tetragonal-b/KPOINTS +6 -0
  158. data/test/conditionanalyzer/picker/encut400_k444-tetragonal-b/OUTCAR +1436 -0
  159. data/test/conditionanalyzer/picker/encut400_k444-tetragonal-b/POSCAR +9 -0
  160. data/test/conditionanalyzer/picker/encut400_k444-tetragonal-b/POTCAR +16 -0
  161. data/test/conditionanalyzer/picker/encut400_k444-unfinished/INCAR +28 -0
  162. data/test/conditionanalyzer/picker/encut400_k444-unfinished/KPOINTS +6 -0
  163. data/test/conditionanalyzer/picker/encut400_k444-unfinished/OUTCAR +1381 -0
  164. data/test/conditionanalyzer/picker/encut400_k444-unfinished/POSCAR +12 -0
  165. data/test/conditionanalyzer/picker/encut400_k444-unfinished/POTCAR +16 -0
  166. data/test/conditionanalyzer/picker/hexiagonal/CONTCAR +13 -0
  167. data/test/conditionanalyzer/picker/hexiagonal/INCAR +17 -0
  168. data/test/conditionanalyzer/picker/hexiagonal/KPOINTS +6 -0
  169. data/test/conditionanalyzer/picker/hexiagonal/OUTCAR +1644 -0
  170. data/test/conditionanalyzer/picker/hexiagonal/POSCAR +13 -0
  171. data/test/conditionvarier/standard/INCAR +28 -0
  172. data/test/conditionvarier/standard/KPOINTS +6 -0
  173. data/test/conditionvarier/standard/POSCAR +12 -0
  174. data/test/conditionvarier/standard/POTCAR +16 -0
  175. data/test/helper.rb +4 -4
  176. data/test/poscar/symmetry/cubic/POSCAR +8 -0
  177. data/test/poscar/symmetry/hexagonal/POSCAR +8 -0
  178. data/test/poscar/symmetry/monoclinic/POSCAR +8 -0
  179. data/test/poscar/symmetry/orthorhombic/POSCAR +8 -0
  180. data/test/poscar/symmetry/tetragonal/POSCAR +8 -0
  181. data/test/poscar/symmetry/tetragonal-b/POSCAR +8 -0
  182. data/test/poscar/symmetry/triclinic/POSCAR +10 -0
  183. data/test/poscar/symmetry/trigonal/POSCAR +9 -0
  184. data/test/test_conditionvarier.rb +201 -0
  185. data/test/test_incar.rb +144 -144
  186. data/test/test_kpoints.rb +91 -91
  187. data/test/test_outcar.rb +154 -154
  188. data/test/test_poscar.rb +263 -262
  189. data/test/test_potcar.rb +31 -31
  190. data/test/test_potcar_concatenater.rb +39 -39
  191. data/test/test_setting.rb +15 -14
  192. data/test/test_vaspdir.rb +193 -126
  193. data/test/test_vaspgeometryoptimizer.rb +177 -78
  194. data/test/test_vasputils.rb +48 -48
  195. data/test/vaspdir/reset_init/finished/orig/CONTCAR +17 -0
  196. data/test/vaspdir/reset_init/finished/orig/INCAR +27 -0
  197. data/test/vaspdir/reset_init/finished/orig/KPOINTS +6 -0
  198. data/test/vaspdir/reset_init/finished/orig/OUTCAR +1436 -0
  199. data/test/vaspdir/reset_init/finished/orig/POSCAR +12 -0
  200. data/test/vaspdir/reset_init/finished/orig/POTCAR +16 -0
  201. data/test/vaspgeometryoptimizer/multiple_vaspdir/vaspdir0/CONTCAR +17 -0
  202. data/test/vaspgeometryoptimizer/multiple_vaspdir/vaspdir0/INCAR +27 -0
  203. data/test/vaspgeometryoptimizer/multiple_vaspdir/vaspdir0/KPOINTS +6 -0
  204. data/test/vaspgeometryoptimizer/multiple_vaspdir/vaspdir0/OUTCAR +1436 -0
  205. data/test/vaspgeometryoptimizer/multiple_vaspdir/vaspdir0/POSCAR +12 -0
  206. data/test/vaspgeometryoptimizer/multiple_vaspdir/vaspdir0/POTCAR +16 -0
  207. data/test/vaspgeometryoptimizer/multiple_vaspdir/vaspdir1/CONTCAR +17 -0
  208. data/test/vaspgeometryoptimizer/multiple_vaspdir/vaspdir1/INCAR +27 -0
  209. data/test/vaspgeometryoptimizer/multiple_vaspdir/vaspdir1/KPOINTS +6 -0
  210. data/test/vaspgeometryoptimizer/multiple_vaspdir/vaspdir1/OUTCAR +1436 -0
  211. data/test/vaspgeometryoptimizer/multiple_vaspdir/vaspdir1/POSCAR +12 -0
  212. data/test/vaspgeometryoptimizer/multiple_vaspdir/vaspdir1/POTCAR +16 -0
  213. data/test/vaspgeometryoptimizer/prepare_next/no-contcar/geomopt00/DOSCAR +0 -0
  214. data/test/vaspgeometryoptimizer/prepare_next/no-contcar/geomopt00/EIGENVAL +0 -0
  215. data/test/vaspgeometryoptimizer/prepare_next/no-contcar/geomopt00/INCAR +0 -0
  216. data/test/vaspgeometryoptimizer/prepare_next/no-contcar/geomopt00/KPOINTS +0 -0
  217. data/test/vaspgeometryoptimizer/prepare_next/no-contcar/geomopt00/OSZICAR +0 -0
  218. data/test/vaspgeometryoptimizer/prepare_next/no-contcar/geomopt00/OUTCAR +0 -0
  219. data/test/vaspgeometryoptimizer/prepare_next/no-contcar/geomopt00/PCDAT +0 -0
  220. data/test/vaspgeometryoptimizer/prepare_next/no-contcar/geomopt00/POSCAR +0 -0
  221. data/test/vaspgeometryoptimizer/prepare_next/no-contcar/geomopt00/POTCAR +0 -0
  222. data/test/vaspgeometryoptimizer/prepare_next/no-contcar/geomopt00/WAVECAR +0 -0
  223. data/test/vaspgeometryoptimizer/prepare_next/no-contcar/geomopt00/XDATCAR +0 -0
  224. data/test/vaspgeometryoptimizer/prepare_next/no-contcar/geomopt00/vasprun.xml +0 -0
  225. data/test/vaspgeometryoptimizer/prepare_next/no-contcar/geomopt01/.gitignore +0 -0
  226. data/test/vaspgeometryoptimizer/prepare_next/normal/geomopt00/CHG +0 -0
  227. data/test/vaspgeometryoptimizer/prepare_next/normal/geomopt00/CHGCAR +0 -0
  228. data/test/vaspgeometryoptimizer/prepare_next/normal/geomopt00/CONTCAR +0 -0
  229. data/test/vaspgeometryoptimizer/prepare_next/normal/geomopt00/DOSCAR +0 -0
  230. data/test/vaspgeometryoptimizer/prepare_next/normal/geomopt00/EIGENVAL +0 -0
  231. data/test/vaspgeometryoptimizer/prepare_next/normal/geomopt00/INCAR +0 -0
  232. data/test/vaspgeometryoptimizer/prepare_next/normal/geomopt00/KPOINTS +0 -0
  233. data/test/vaspgeometryoptimizer/prepare_next/normal/geomopt00/OSZICAR +0 -0
  234. data/test/vaspgeometryoptimizer/prepare_next/normal/geomopt00/OUTCAR +0 -0
  235. data/test/vaspgeometryoptimizer/prepare_next/normal/geomopt00/PCDAT +0 -0
  236. data/test/vaspgeometryoptimizer/prepare_next/normal/geomopt00/POSCAR +0 -0
  237. data/test/vaspgeometryoptimizer/prepare_next/normal/geomopt00/POTCAR +0 -0
  238. data/test/vaspgeometryoptimizer/prepare_next/normal/geomopt00/WAVECAR +0 -0
  239. data/test/vaspgeometryoptimizer/prepare_next/normal/geomopt00/XDATCAR +0 -0
  240. data/test/vaspgeometryoptimizer/prepare_next/normal/geomopt00/vasprun.xml +0 -0
  241. data/test/vaspgeometryoptimizer/reset_init/orig/geomopt00/CONTCAR +12 -0
  242. data/test/vaspgeometryoptimizer/reset_init/orig/geomopt00/INCAR +0 -0
  243. data/test/vaspgeometryoptimizer/reset_init/orig/geomopt00/KPOINTS +0 -0
  244. data/test/vaspgeometryoptimizer/reset_init/orig/geomopt00/OUTCAR +0 -0
  245. data/test/vaspgeometryoptimizer/reset_init/orig/geomopt00/POSCAR +12 -0
  246. data/test/vaspgeometryoptimizer/reset_init/orig/geomopt00/POTCAR +0 -0
  247. data/test/vaspgeometryoptimizer/reset_init/orig/geomopt01/CONTCAR +12 -0
  248. data/test/vaspgeometryoptimizer/reset_init/orig/geomopt01/INCAR +0 -0
  249. data/test/vaspgeometryoptimizer/reset_init/orig/geomopt01/KPOINTS +0 -0
  250. data/test/vaspgeometryoptimizer/reset_init/orig/geomopt01/OUTCAR +0 -0
  251. data/test/vaspgeometryoptimizer/reset_init/orig/geomopt01/POSCAR +12 -0
  252. data/test/vaspgeometryoptimizer/reset_init/orig/geomopt01/POTCAR +0 -0
  253. data/test/vaspgeometryoptimizer/reset_init/orig/geomopt02/CONTCAR +0 -0
  254. data/test/vaspgeometryoptimizer/reset_init/orig/geomopt02/INCAR +0 -0
  255. data/test/vaspgeometryoptimizer/reset_init/orig/geomopt02/KPOINTS +0 -0
  256. data/test/vaspgeometryoptimizer/reset_init/orig/geomopt02/POSCAR +12 -0
  257. data/test/vaspgeometryoptimizer/reset_init/orig/geomopt02/POTCAR +0 -0
  258. data/test/vaspgeometryoptimizer/reset_init/orig/lock_vaspgeomopt/dummy +0 -0
  259. data/test/vaspgeometryoptimizer/reset_next/empty-contcar/orig/geomopt00/CONTCAR +12 -0
  260. data/test/vaspgeometryoptimizer/reset_next/empty-contcar/orig/geomopt00/INCAR +0 -0
  261. data/test/vaspgeometryoptimizer/reset_next/empty-contcar/orig/geomopt00/KPOINTS +0 -0
  262. data/test/vaspgeometryoptimizer/reset_next/empty-contcar/orig/geomopt00/OUTCAR +0 -0
  263. data/test/vaspgeometryoptimizer/reset_next/empty-contcar/orig/geomopt00/POSCAR +12 -0
  264. data/test/vaspgeometryoptimizer/reset_next/empty-contcar/orig/geomopt00/POTCAR +0 -0
  265. data/test/vaspgeometryoptimizer/reset_next/empty-contcar/orig/geomopt01/CONTCAR +12 -0
  266. data/test/vaspgeometryoptimizer/reset_next/empty-contcar/orig/geomopt01/INCAR +0 -0
  267. data/test/vaspgeometryoptimizer/reset_next/empty-contcar/orig/geomopt01/KPOINTS +0 -0
  268. data/test/vaspgeometryoptimizer/reset_next/empty-contcar/orig/geomopt01/OUTCAR +0 -0
  269. data/test/vaspgeometryoptimizer/reset_next/empty-contcar/orig/geomopt01/POSCAR +12 -0
  270. data/test/vaspgeometryoptimizer/reset_next/empty-contcar/orig/geomopt01/POTCAR +0 -0
  271. data/test/vaspgeometryoptimizer/reset_next/empty-contcar/orig/geomopt02/CONTCAR +0 -0
  272. data/test/vaspgeometryoptimizer/reset_next/empty-contcar/orig/geomopt02/INCAR +0 -0
  273. data/test/vaspgeometryoptimizer/reset_next/empty-contcar/orig/geomopt02/KPOINTS +0 -0
  274. data/test/vaspgeometryoptimizer/reset_next/empty-contcar/orig/geomopt02/OUTCAR +0 -0
  275. data/test/vaspgeometryoptimizer/reset_next/empty-contcar/orig/geomopt02/POSCAR +12 -0
  276. data/test/vaspgeometryoptimizer/reset_next/empty-contcar/orig/geomopt02/POTCAR +0 -0
  277. data/test/vaspgeometryoptimizer/reset_next/empty-contcar/orig/lock_vaspgeomopt/dummy +0 -0
  278. data/test/vaspgeometryoptimizer/reset_next/no-contcar/orig/geomopt00/CONTCAR +12 -0
  279. data/test/vaspgeometryoptimizer/reset_next/no-contcar/orig/geomopt00/INCAR +0 -0
  280. data/test/vaspgeometryoptimizer/reset_next/no-contcar/orig/geomopt00/KPOINTS +0 -0
  281. data/test/vaspgeometryoptimizer/reset_next/no-contcar/orig/geomopt00/OUTCAR +0 -0
  282. data/test/vaspgeometryoptimizer/reset_next/no-contcar/orig/geomopt00/POSCAR +12 -0
  283. data/test/vaspgeometryoptimizer/reset_next/no-contcar/orig/geomopt00/POTCAR +0 -0
  284. data/test/vaspgeometryoptimizer/reset_next/no-contcar/orig/geomopt01/CONTCAR +12 -0
  285. data/test/vaspgeometryoptimizer/reset_next/no-contcar/orig/geomopt01/INCAR +0 -0
  286. data/test/vaspgeometryoptimizer/reset_next/no-contcar/orig/geomopt01/KPOINTS +0 -0
  287. data/test/vaspgeometryoptimizer/reset_next/no-contcar/orig/geomopt01/OUTCAR +0 -0
  288. data/test/vaspgeometryoptimizer/reset_next/no-contcar/orig/geomopt01/POSCAR +12 -0
  289. data/test/vaspgeometryoptimizer/reset_next/no-contcar/orig/geomopt01/POTCAR +0 -0
  290. data/test/vaspgeometryoptimizer/reset_next/no-contcar/orig/geomopt02/INCAR +0 -0
  291. data/test/vaspgeometryoptimizer/reset_next/no-contcar/orig/geomopt02/KPOINTS +0 -0
  292. data/test/vaspgeometryoptimizer/reset_next/no-contcar/orig/geomopt02/POSCAR +12 -0
  293. data/test/vaspgeometryoptimizer/reset_next/no-contcar/orig/geomopt02/POTCAR +0 -0
  294. data/test/vaspgeometryoptimizer/reset_next/no-contcar/orig/lock_vaspgeomopt/dummy +0 -0
  295. data/test/vaspgeometryoptimizer/reset_next/poscar-contcar/orig/geomopt00/CONTCAR +12 -0
  296. data/test/vaspgeometryoptimizer/reset_next/poscar-contcar/orig/geomopt00/INCAR +0 -0
  297. data/test/vaspgeometryoptimizer/reset_next/poscar-contcar/orig/geomopt00/KPOINTS +0 -0
  298. data/test/vaspgeometryoptimizer/reset_next/poscar-contcar/orig/geomopt00/OUTCAR +0 -0
  299. data/test/vaspgeometryoptimizer/reset_next/poscar-contcar/orig/geomopt00/POSCAR +12 -0
  300. data/test/vaspgeometryoptimizer/reset_next/poscar-contcar/orig/geomopt00/POTCAR +0 -0
  301. data/test/vaspgeometryoptimizer/reset_next/poscar-contcar/orig/geomopt01/CONTCAR +12 -0
  302. data/test/vaspgeometryoptimizer/reset_next/poscar-contcar/orig/geomopt01/INCAR +0 -0
  303. data/test/vaspgeometryoptimizer/reset_next/poscar-contcar/orig/geomopt01/KPOINTS +0 -0
  304. data/test/vaspgeometryoptimizer/reset_next/poscar-contcar/orig/geomopt01/OUTCAR +0 -0
  305. data/test/vaspgeometryoptimizer/reset_next/poscar-contcar/orig/geomopt01/POSCAR +12 -0
  306. data/test/vaspgeometryoptimizer/reset_next/poscar-contcar/orig/geomopt01/POTCAR +0 -0
  307. data/test/vaspgeometryoptimizer/reset_next/poscar-contcar/orig/geomopt02/CONTCAR +12 -0
  308. data/test/vaspgeometryoptimizer/reset_next/poscar-contcar/orig/geomopt02/INCAR +0 -0
  309. data/test/vaspgeometryoptimizer/reset_next/poscar-contcar/orig/geomopt02/KPOINTS +0 -0
  310. data/test/vaspgeometryoptimizer/reset_next/poscar-contcar/orig/geomopt02/POSCAR +12 -0
  311. data/test/vaspgeometryoptimizer/reset_next/poscar-contcar/orig/geomopt02/POTCAR +0 -0
  312. data/test/vaspgeometryoptimizer/reset_next/poscar-contcar/orig/lock_vaspgeomopt/dummy +0 -0
  313. data/test/vaspgeometryoptimizer/reset_reincarnation/orig/geomopt00/CONTCAR +12 -0
  314. data/test/vaspgeometryoptimizer/reset_reincarnation/orig/geomopt00/INCAR +0 -0
  315. data/test/vaspgeometryoptimizer/reset_reincarnation/orig/geomopt00/KPOINTS +0 -0
  316. data/test/vaspgeometryoptimizer/reset_reincarnation/orig/geomopt00/OUTCAR +0 -0
  317. data/test/vaspgeometryoptimizer/reset_reincarnation/orig/geomopt00/POSCAR +12 -0
  318. data/test/vaspgeometryoptimizer/reset_reincarnation/orig/geomopt00/POTCAR +0 -0
  319. data/test/vaspgeometryoptimizer/reset_reincarnation/orig/geomopt01/CONTCAR +12 -0
  320. data/test/vaspgeometryoptimizer/reset_reincarnation/orig/geomopt01/INCAR +0 -0
  321. data/test/vaspgeometryoptimizer/reset_reincarnation/orig/geomopt01/KPOINTS +0 -0
  322. data/test/vaspgeometryoptimizer/reset_reincarnation/orig/geomopt01/OUTCAR +0 -0
  323. data/test/vaspgeometryoptimizer/reset_reincarnation/orig/geomopt01/POSCAR +12 -0
  324. data/test/vaspgeometryoptimizer/reset_reincarnation/orig/geomopt01/POTCAR +0 -0
  325. data/test/vaspgeometryoptimizer/reset_reincarnation/orig/geomopt02/CONTCAR +0 -0
  326. data/test/vaspgeometryoptimizer/reset_reincarnation/orig/geomopt02/INCAR +0 -0
  327. data/test/vaspgeometryoptimizer/reset_reincarnation/orig/geomopt02/KPOINTS +0 -0
  328. data/test/vaspgeometryoptimizer/reset_reincarnation/orig/geomopt02/POSCAR +12 -0
  329. data/test/vaspgeometryoptimizer/reset_reincarnation/orig/geomopt02/POTCAR +0 -0
  330. data/test/vaspgeometryoptimizer/reset_reincarnation/orig/lock_vaspgeomopt/dummy +0 -0
  331. data/test/vaspgeometryoptimizer/started/geomopt00/INCAR +0 -0
  332. data/test/vaspgeometryoptimizer/started/geomopt00/KPOINTS +0 -0
  333. data/test/vaspgeometryoptimizer/started/geomopt00/POSCAR +0 -0
  334. data/test/vaspgeometryoptimizer/started/geomopt00/POTCAR +0 -0
  335. data/test/vaspgeometryoptimizer/till01/geomopt00/CONTCAR +0 -0
  336. data/test/vaspgeometryoptimizer/till01/geomopt00/INCAR +0 -0
  337. data/test/vaspgeometryoptimizer/till01/geomopt00/KPOINTS +0 -0
  338. data/test/vaspgeometryoptimizer/till01/geomopt00/OUTCAR +0 -0
  339. data/test/vaspgeometryoptimizer/till01/geomopt00/POSCAR +0 -0
  340. data/test/vaspgeometryoptimizer/till01/geomopt00/POTCAR +0 -0
  341. data/test/vaspgeometryoptimizer/till01/geomopt01/INCAR +0 -0
  342. data/test/vaspgeometryoptimizer/till01/geomopt01/KPOINTS +0 -0
  343. data/test/vaspgeometryoptimizer/till01/geomopt01/POSCAR +0 -0
  344. data/test/vaspgeometryoptimizer/till01/geomopt01/POTCAR +0 -0
  345. metadata +464 -106
  346. data/bin/genvaspdir +0 -17
  347. data/bin/rmvaspout +0 -40
  348. data/lib/vasputils/vaspkpointsfinder.rb +0 -72
  349. data/test/test_vaspkpointsfinder.rb +0 -25
  350. data/test/vaspkpointsfinder/01-01-01/try00/POSCAR +0 -8
  351. data/vasputils.gemspec +0 -567
  352. /data/test/{vaspgeometryoptimizer/ended-Iter1/try00 → conditionanalyzer/01/00-original}/POTCAR +0 -0
  353. /data/test/{vaspgeometryoptimizer/ended-Iter1/try01 → conditionanalyzer/01/01-ENCUT/1000/try02}/POTCAR +0 -0
  354. /data/test/{vaspgeometryoptimizer/ended-Iter2/try00 → conditionanalyzer/01/01-ENCUT/1200/try02}/POTCAR +0 -0
  355. /data/test/{vaspgeometryoptimizer/ended-Iter2/try01 → conditionanalyzer/01/01-ENCUT/1500/try02}/POTCAR +0 -0
  356. /data/test/{vaspgeometryoptimizer/not-yet/try00 → conditionanalyzer/01/01-ENCUT/500/try05}/POTCAR +0 -0
  357. /data/test/{vaspgeometryoptimizer/prepare_next/try00 → conditionanalyzer/01/01-ENCUT/600/try01}/POTCAR +0 -0
  358. /data/test/{vaspgeometryoptimizer/started/try00 → conditionanalyzer/01/01-ENCUT/700/try01}/POTCAR +0 -0
  359. /data/test/{vaspgeometryoptimizer/till01/try00 → conditionanalyzer/01/01-ENCUT/800/try01}/POTCAR +0 -0
  360. /data/test/{vaspgeometryoptimizer/till01 → conditionanalyzer/01/01-ENCUT/900}/try01/POTCAR +0 -0
  361. /data/test/{vaspkpointsfinder/01-01-01/try00 → conditionanalyzer/01/02-KPOINTS/16x16x16/try07}/POTCAR +0 -0
  362. /data/test/{vaspgeometryoptimizer/ended-Iter1/try00/INCAR → conditionanalyzer/01/02-KPOINTS/1x1x1/try07/POTCAR} +0 -0
  363. /data/test/{vaspgeometryoptimizer/ended-Iter1/try00/KPOINTS → conditionanalyzer/01/02-KPOINTS/2x2x2/try10/POTCAR} +0 -0
  364. /data/test/{vaspgeometryoptimizer/ended-Iter1/try00/OUTCAR → conditionanalyzer/01/02-KPOINTS/32x32x32/try06/POTCAR} +0 -0
  365. /data/test/{vaspgeometryoptimizer/ended-Iter1/try00/POSCAR → conditionanalyzer/01/02-KPOINTS/32x32x64/try04/POTCAR} +0 -0
  366. /data/test/{vaspgeometryoptimizer/ended-Iter1/try01/INCAR → conditionanalyzer/01/02-KPOINTS/4x4x4/try05/POTCAR} +0 -0
  367. /data/test/{vaspgeometryoptimizer/ended-Iter2/try00 → conditionanalyzer/01/02-KPOINTS/64x64x64}/CONTCAR +0 -0
  368. /data/test/{vaspgeometryoptimizer/ended-Iter1/try01/KPOINTS → conditionanalyzer/01/02-KPOINTS/64x64x64/POTCAR} +0 -0
  369. /data/test/{vaspgeometryoptimizer/ended-Iter1/try01/POSCAR → conditionanalyzer/01/02-KPOINTS/8x8x8/try05/POTCAR} +0 -0
  370. /data/test/{vaspgeometryoptimizer/ended-Iter2/try00/INCAR → conditionanalyzer/picker/hexiagonal/POTCAR} +0 -0
  371. /data/test/vaspgeometryoptimizer/{prepare_next/try00 → ended-Iter1/geomopt00}/CONTCAR +0 -0
  372. /data/test/vaspgeometryoptimizer/{ended-Iter2/try01 → ended-Iter1/geomopt00}/INCAR +0 -0
  373. /data/test/vaspgeometryoptimizer/{ended-Iter2/try00 → ended-Iter1/geomopt00}/KPOINTS +0 -0
  374. /data/test/vaspgeometryoptimizer/{ended-Iter2/try00 → ended-Iter1/geomopt00}/OUTCAR +0 -0
  375. /data/test/vaspgeometryoptimizer/{ended-Iter2/try00 → ended-Iter1/geomopt00}/POSCAR +0 -0
  376. /data/test/vaspgeometryoptimizer/{ended-Iter2/try01/KPOINTS → ended-Iter1/geomopt00/POTCAR} +0 -0
  377. /data/test/vaspgeometryoptimizer/{not-yet/try00 → ended-Iter1/geomopt01}/INCAR +0 -0
  378. /data/test/vaspgeometryoptimizer/{not-yet/try00 → ended-Iter1/geomopt01}/KPOINTS +0 -0
  379. /data/test/vaspgeometryoptimizer/ended-Iter1/{try01 → geomopt01}/OUTCAR +0 -0
  380. /data/test/vaspgeometryoptimizer/{ended-Iter2/try01 → ended-Iter1/geomopt01}/POSCAR +0 -0
  381. /data/test/vaspgeometryoptimizer/{not-yet/try00/POSCAR → ended-Iter1/geomopt01/POTCAR} +0 -0
  382. /data/test/vaspgeometryoptimizer/{till01/try00 → ended-Iter2/geomopt00}/CONTCAR +0 -0
  383. /data/test/vaspgeometryoptimizer/{prepare_next/try00 → ended-Iter2/geomopt00}/INCAR +0 -0
  384. /data/test/vaspgeometryoptimizer/{prepare_next/try00 → ended-Iter2/geomopt00}/KPOINTS +0 -0
  385. /data/test/vaspgeometryoptimizer/{prepare_next/try00 → ended-Iter2/geomopt00}/OUTCAR +0 -0
  386. /data/test/vaspgeometryoptimizer/{prepare_next/try00 → ended-Iter2/geomopt00}/POSCAR +0 -0
  387. /data/test/vaspgeometryoptimizer/{prepare_next/try00/CHG → ended-Iter2/geomopt00/POTCAR} +0 -0
  388. /data/test/vaspgeometryoptimizer/{started/try00 → ended-Iter2/geomopt01}/INCAR +0 -0
  389. /data/test/vaspgeometryoptimizer/{started/try00 → ended-Iter2/geomopt01}/KPOINTS +0 -0
  390. /data/test/vaspgeometryoptimizer/ended-Iter2/{try01 → geomopt01}/OUTCAR +0 -0
  391. /data/test/vaspgeometryoptimizer/{started/try00 → ended-Iter2/geomopt01}/POSCAR +0 -0
  392. /data/test/vaspgeometryoptimizer/{prepare_next/try00/CHGCAR → ended-Iter2/geomopt01/POTCAR} +0 -0
  393. /data/test/vaspgeometryoptimizer/{till01/try00 → not-geomopt/not-geomopt-subdir/calcA}/INCAR +0 -0
  394. /data/test/vaspgeometryoptimizer/{till01/try00 → not-geomopt/not-geomopt-subdir/calcA}/KPOINTS +0 -0
  395. /data/test/vaspgeometryoptimizer/{till01/try00 → not-geomopt/not-geomopt-subdir/calcA}/POSCAR +0 -0
  396. /data/test/vaspgeometryoptimizer/{prepare_next/try00/DOSCAR → not-geomopt/not-geomopt-subdir/calcA/POTCAR} +0 -0
  397. /data/test/vaspgeometryoptimizer/{till01/try01 → not-geomopt/not-geomopt-subdir/calcB}/INCAR +0 -0
  398. /data/test/vaspgeometryoptimizer/{till01/try01 → not-geomopt/not-geomopt-subdir/calcB}/KPOINTS +0 -0
  399. /data/test/vaspgeometryoptimizer/{till01/try01 → not-geomopt/not-geomopt-subdir/calcB}/POSCAR +0 -0
  400. /data/test/vaspgeometryoptimizer/{prepare_next/try00/EIGENVAL → not-geomopt/not-geomopt-subdir/calcB/POTCAR} +0 -0
  401. /data/test/vaspgeometryoptimizer/{prepare_next/try00/OSZICAR → not-yet/geomopt00/INCAR} +0 -0
  402. /data/test/vaspgeometryoptimizer/{prepare_next/try00/PCDAT → not-yet/geomopt00/KPOINTS} +0 -0
  403. /data/test/vaspgeometryoptimizer/{prepare_next/try00/WAVECAR → not-yet/geomopt00/POSCAR} +0 -0
  404. /data/test/vaspgeometryoptimizer/{prepare_next/try00/XDATCAR → not-yet/geomopt00/POTCAR} +0 -0
  405. /data/test/vaspgeometryoptimizer/prepare_next/{try00/vasprun.xml → no-contcar/geomopt00/CHG} +0 -0
  406. /data/test/vaspgeometryoptimizer/{till01/try00/OUTCAR → prepare_next/no-contcar/geomopt00/CHGCAR} +0 -0
data/test/test_poscar.rb CHANGED
@@ -1,283 +1,284 @@
1
1
  #! /usr/bin/ruby -W
2
2
 
3
+ require "helper"
3
4
  require "test/unit"
4
5
  require "stringio"
5
- require "vasputils.rb"
6
- require "vasputils/poscar.rb"
7
6
 
8
7
  require "rubygems"
9
- gem "mageo"
10
- require "mageo/vector3dinternal.rb"
11
- gem "crystalcell"
12
- require "crystalcell/cell.rb"
8
+ #gem "crystalcell"
9
+ require "crystalcell"
13
10
 
14
11
  class TC_Poscar < Test::Unit::TestCase
15
- $tolerance = 10 ** (-10)
12
+ $tolerance = 10 ** (-10)
16
13
 
17
- def test_dump
18
- # 例外ケース
19
- axes = LatticeAxes.new( [
20
- [1.0, 0.0, 0.0 ],
21
- [0.0, 1.0, 0.0 ],
22
- [0.0, 0.0, 1.0 ],
23
- ])
24
- atoms = [
25
- Atom.new(0, [0.1, 0.2, 0.3]),
26
- Atom.new(1, [0.2, 0.3, 0.4]),
27
- Atom.new(0, [0.3, 0.4, 0.5]),
28
- ]
29
- cell = Cell.new(axes, atoms)
30
- cell.comment = "test"
31
- io = StringIO.new
32
- assert_raises(VaspUtils::Poscar::ElementMismatchError){
33
- VaspUtils::Poscar.dump(cell, [0,1,2], io)}
14
+ def test_dump
15
+ # 例外ケース
16
+ axes = CrystalCell::LatticeAxes.new( [
17
+ [1.0, 0.0, 0.0 ],
18
+ [0.0, 1.0, 0.0 ],
19
+ [0.0, 0.0, 1.0 ],
20
+ ])
21
+ atoms = [
22
+ CrystalCell::Atom.new(0, [0.1, 0.2, 0.3]),
23
+ CrystalCell::Atom.new(1, [0.2, 0.3, 0.4]),
24
+ CrystalCell::Atom.new(0, [0.3, 0.4, 0.5]),
25
+ ]
26
+ cell = CrystalCell::Cell.new(axes, atoms)
27
+ cell.comment = "test"
28
+ io = StringIO.new
29
+ assert_raises(VaspUtils::Poscar::ElementMismatchError){
30
+ VaspUtils::Poscar.dump(cell, [0,1,2], io)}
34
31
 
35
- # 生成
36
- axes = LatticeAxes.new( [
37
- [1.0, 0.0, 0.0 ],
38
- [0.0, 1.0, 0.0 ],
39
- [0.0, 0.0, 1.0 ],
40
- ])
41
- atoms = [
42
- Atom.new(0, [0.1, 0.2, 0.3]),
43
- Atom.new(1, [0.2, 0.3, 0.4]),
44
- Atom.new(0, [0.3, 0.4, 0.5]),
45
- ]
46
- cell = Cell.new(axes, atoms)
47
- cell.comment = "test"
48
- io = StringIO.new
49
- VaspUtils::Poscar.dump(cell, [0,1], io, 4)
50
- io.rewind
51
- corrects = [
52
- "test\n",
53
- "1.0\n",
54
- " 1.000000000000000 0.000000000000000 0.000000000000000\n",
55
- " 0.000000000000000 1.000000000000000 0.000000000000000\n",
56
- " 0.000000000000000 0.000000000000000 1.000000000000000\n",
57
- "2 1\n",
58
- "Direct\n",
59
- " 0.100000000000000 0.200000000000000 0.300000000000000\n",
60
- " 0.300000000000000 0.400000000000000 0.500000000000000\n",
61
- " 0.200000000000000 0.300000000000000 0.400000000000000\n",
62
- ]
63
- lines = io.readlines
64
- corrects.each_with_index do |cor, index|
65
- assert_equal(cor, lines[index], "line: #{index}")
66
- end
67
- assert_equal(corrects.size, lines.size)
32
+ # 生成
33
+ axes = CrystalCell::LatticeAxes.new( [
34
+ [1.0, 0.0, 0.0 ],
35
+ [0.0, 1.0, 0.0 ],
36
+ [0.0, 0.0, 1.0 ],
37
+ ])
38
+ atoms = [
39
+ CrystalCell::Atom.new(0, [0.1, 0.2, 0.3]),
40
+ CrystalCell::Atom.new(1, [0.2, 0.3, 0.4]),
41
+ CrystalCell::Atom.new(0, [0.3, 0.4, 0.5]),
42
+ ]
43
+ cell = CrystalCell::Cell.new(axes, atoms)
44
+ cell.comment = "test"
45
+ io = StringIO.new
46
+ VaspUtils::Poscar.dump(cell, [0,1], io, 4)
47
+ io.rewind
48
+ corrects = [
49
+ "test\n",
50
+ "1.0\n",
51
+ " 1.000000000000000 0.000000000000000 0.000000000000000\n",
52
+ " 0.000000000000000 1.000000000000000 0.000000000000000\n",
53
+ " 0.000000000000000 0.000000000000000 1.000000000000000\n",
54
+ "2 1\n",
55
+ "Direct\n",
56
+ " 0.100000000000000 0.200000000000000 0.300000000000000\n",
57
+ " 0.300000000000000 0.400000000000000 0.500000000000000\n",
58
+ " 0.200000000000000 0.300000000000000 0.400000000000000\n",
59
+ ]
60
+ lines = io.readlines
61
+ corrects.each_with_index do |cor, index|
62
+ assert_equal(cor, lines[index], "line: #{index}")
63
+ end
64
+ assert_equal(corrects.size, lines.size)
68
65
 
69
- # vasp 4
70
- atoms = [
71
- Atom.new(0, [0.1, 0.2, 0.3], "atom0", [false, true , true ]),
72
- Atom.new(1, [0.2, 0.3, 0.4], "atom1", [false, false, true ]),
73
- Atom.new(0, [0.3, 0.4, 0.5], "atom2", [false, false, false]),
74
- ]
75
- cell = Cell.new(axes, atoms)
76
- cell.comment = "test"
77
- io = StringIO.new
78
- VaspUtils::Poscar.dump(cell, [0,1], io, 4)
79
- io.rewind
80
- corrects = [
81
- "test\n",
82
- "1.0\n",
83
- " 1.000000000000000 0.000000000000000 0.000000000000000\n",
84
- " 0.000000000000000 1.000000000000000 0.000000000000000\n",
85
- " 0.000000000000000 0.000000000000000 1.000000000000000\n",
86
- "2 1\n",
87
- "Selective dynamics\n",
88
- "Direct\n",
89
- " 0.100000000000000 0.200000000000000 0.300000000000000 F T T\n",
90
- " 0.300000000000000 0.400000000000000 0.500000000000000 F F F\n",
91
- " 0.200000000000000 0.300000000000000 0.400000000000000 F F T\n",
92
- ]
93
- lines = io.readlines
94
- corrects.each_with_index do |cor, index|
95
- assert_equal(cor, lines[index], "line: #{index}")
96
- end
97
- assert_equal(corrects.size, lines.size)
66
+ # vasp 4
67
+ atoms = [
68
+ CrystalCell::Atom.new(0, [0.1, 0.2, 0.3], "atom0", [false, true , true ]),
69
+ CrystalCell::Atom.new(1, [0.2, 0.3, 0.4], "atom1", [false, false, true ]),
70
+ CrystalCell::Atom.new(0, [0.3, 0.4, 0.5], "atom2", [false, false, false]),
71
+ ]
72
+ cell = CrystalCell::Cell.new(axes, atoms)
73
+ cell.comment = "test"
74
+ io = StringIO.new
75
+ VaspUtils::Poscar.dump(cell, [0,1], io, 4)
76
+ io.rewind
77
+ corrects = [
78
+ "test\n",
79
+ "1.0\n",
80
+ " 1.000000000000000 0.000000000000000 0.000000000000000\n",
81
+ " 0.000000000000000 1.000000000000000 0.000000000000000\n",
82
+ " 0.000000000000000 0.000000000000000 1.000000000000000\n",
83
+ "2 1\n",
84
+ "Selective dynamics\n",
85
+ "Direct\n",
86
+ " 0.100000000000000 0.200000000000000 0.300000000000000 F T T\n",
87
+ " 0.300000000000000 0.400000000000000 0.500000000000000 F F F\n",
88
+ " 0.200000000000000 0.300000000000000 0.400000000000000 F F T\n",
89
+ ]
90
+ lines = io.readlines
91
+ corrects.each_with_index do |cor, index|
92
+ assert_equal(cor, lines[index], "line: #{index}")
93
+ end
94
+ assert_equal(corrects.size, lines.size)
95
+
96
+ atoms = [
97
+ CrystalCell::Atom.new(0, [0.1, 0.2, 0.3], "atom0", [false, true , true ]),
98
+ CrystalCell::Atom.new(1, [0.2, 0.3, 0.4], "atom1", [false, false, true ]),
99
+ CrystalCell::Atom.new(0, [0.3, 0.4, 0.5], "atom2", [false, false, false]),
100
+ ]
101
+ cell = CrystalCell::Cell.new(axes, atoms)
102
+ cell.comment = "test"
103
+ io = StringIO.new
104
+ VaspUtils::Poscar.dump(cell, [0,1], io, 4)
105
+ io.rewind
106
+ corrects = [
107
+ "test\n",
108
+ "1.0\n",
109
+ " 1.000000000000000 0.000000000000000 0.000000000000000\n",
110
+ " 0.000000000000000 1.000000000000000 0.000000000000000\n",
111
+ " 0.000000000000000 0.000000000000000 1.000000000000000\n",
112
+ "2 1\n",
113
+ "Selective dynamics\n",
114
+ "Direct\n",
115
+ " 0.100000000000000 0.200000000000000 0.300000000000000 F T T\n",
116
+ " 0.300000000000000 0.400000000000000 0.500000000000000 F F F\n",
117
+ " 0.200000000000000 0.300000000000000 0.400000000000000 F F T\n",
118
+ ]
119
+ lines = io.readlines
120
+ corrects.each_with_index do |cor, index|
121
+ assert_equal(cor, lines[index], "line: #{index}")
122
+ end
123
+ assert_equal(corrects.size, lines.size)
124
+ # vasp 5
125
+ atoms = [
126
+ CrystalCell::Atom.new("Li", [0.1, 0.2, 0.3], "atom0", [false, true , true ]),
127
+ CrystalCell::Atom.new("O" , [0.2, 0.3, 0.4], "atom1", [false, false, true ]),
128
+ CrystalCell::Atom.new("Li", [0.3, 0.4, 0.5], "atom2", [false, false, false]),
129
+ ]
130
+ cell = CrystalCell::Cell.new(axes, atoms)
131
+ cell.comment = "test"
132
+ io = StringIO.new
133
+ VaspUtils::Poscar.dump(cell, ["Li", "O"], io, 5)
134
+ io.rewind
135
+ corrects = [
136
+ "test\n",
137
+ "1.0\n",
138
+ " 1.000000000000000 0.000000000000000 0.000000000000000\n",
139
+ " 0.000000000000000 1.000000000000000 0.000000000000000\n",
140
+ " 0.000000000000000 0.000000000000000 1.000000000000000\n",
141
+ "Li O\n",
142
+ "2 1\n",
143
+ "Selective dynamics\n",
144
+ "Direct\n",
145
+ " 0.100000000000000 0.200000000000000 0.300000000000000 F T T\n",
146
+ " 0.300000000000000 0.400000000000000 0.500000000000000 F F F\n",
147
+ " 0.200000000000000 0.300000000000000 0.400000000000000 F F T\n",
148
+ ]
149
+ lines = io.readlines
150
+ corrects.each_with_index do |cor, index|
151
+ assert_equal(cor, lines[index], "line: #{index}")
152
+ end
153
+ assert_equal(corrects.size, lines.size)
98
154
 
99
- atoms = [
100
- Atom.new(0, [0.1, 0.2, 0.3], "atom0", [false, true , true ]),
101
- Atom.new(1, [0.2, 0.3, 0.4], "atom1", [false, false, true ]),
102
- Atom.new(0, [0.3, 0.4, 0.5], "atom2", [false, false, false]),
103
- ]
104
- cell = Cell.new(axes, atoms)
105
- cell.comment = "test"
106
- io = StringIO.new
107
- VaspUtils::Poscar.dump(cell, [0,1], io, 4)
108
- io.rewind
109
- corrects = [
110
- "test\n",
111
- "1.0\n",
112
- " 1.000000000000000 0.000000000000000 0.000000000000000\n",
113
- " 0.000000000000000 1.000000000000000 0.000000000000000\n",
114
- " 0.000000000000000 0.000000000000000 1.000000000000000\n",
115
- "2 1\n",
116
- "Selective dynamics\n",
117
- "Direct\n",
118
- " 0.100000000000000 0.200000000000000 0.300000000000000 F T T\n",
119
- " 0.300000000000000 0.400000000000000 0.500000000000000 F F F\n",
120
- " 0.200000000000000 0.300000000000000 0.400000000000000 F F T\n",
121
- ]
122
- lines = io.readlines
123
- corrects.each_with_index do |cor, index|
124
- assert_equal(cor, lines[index], "line: #{index}")
125
- end
126
- assert_equal(corrects.size, lines.size)
127
- # vasp 5
128
- atoms = [
129
- Atom.new("Li", [0.1, 0.2, 0.3], "atom0", [false, true , true ]),
130
- Atom.new("O" , [0.2, 0.3, 0.4], "atom1", [false, false, true ]),
131
- Atom.new("Li", [0.3, 0.4, 0.5], "atom2", [false, false, false]),
132
- ]
133
- cell = Cell.new(axes, atoms)
134
- cell.comment = "test"
135
- io = StringIO.new
136
- VaspUtils::Poscar.dump(cell, ["Li", "O"], io, 5)
137
- io.rewind
138
- corrects = [
139
- "test\n",
140
- "1.0\n",
141
- " 1.000000000000000 0.000000000000000 0.000000000000000\n",
142
- " 0.000000000000000 1.000000000000000 0.000000000000000\n",
143
- " 0.000000000000000 0.000000000000000 1.000000000000000\n",
144
- "Li O\n",
145
- "2 1\n",
146
- "Selective dynamics\n",
147
- "Direct\n",
148
- " 0.100000000000000 0.200000000000000 0.300000000000000 F T T\n",
149
- " 0.300000000000000 0.400000000000000 0.500000000000000 F F F\n",
150
- " 0.200000000000000 0.300000000000000 0.400000000000000 F F T\n",
151
- ]
152
- lines = io.readlines
153
- corrects.each_with_index do |cor, index|
154
- assert_equal(cor, lines[index], "line: #{index}")
155
155
  end
156
- assert_equal(corrects.size, lines.size)
157
156
 
158
- end
157
+ def test_parse
158
+ io = StringIO.new
159
+ assert_raises(VaspUtils::Poscar::ParseError){ VaspUtils::Poscar.parse(io) }
159
160
 
160
- def test_parse
161
- io = StringIO.new
162
- assert_raises(VaspUtils::Poscar::ParseError){ VaspUtils::Poscar.parse(io) }
161
+ # vasp 4 style
162
+ io = StringIO.new
163
+ io.puts "sample0"
164
+ io.puts "1.0"
165
+ io.puts " 1.0 0.0 0.0"
166
+ io.puts " 0.0 1.0 0.0"
167
+ io.puts " 0.0 0.0 1.0"
168
+ io.puts " 1 1 1"
169
+ io.puts "Direct"
170
+ io.puts " 0.0 0.0 0.0 #Li-001"
171
+ io.puts " 0.5 0.0 0.0 #Ge-002"
172
+ io.puts " 0.5 0.5 0.0 #O--003"
173
+ io.rewind
174
+ cell = VaspUtils::Poscar.parse(io)
175
+ assert_equal("sample0", cell.comment)
176
+ assert_equal(
177
+ CrystalCell::LatticeAxes.new( [
178
+ [1.0, 0.0, 0.0 ],
179
+ [0.0, 1.0, 0.0 ],
180
+ [0.0, 0.0, 1.0 ],
181
+ ]),
182
+ cell.axes
183
+ )
184
+ assert_equal(
185
+ CrystalCell::Atom.new(0, [0.0, 0.0, 0.0], "#Li-001"), cell.atoms[0])
186
+ assert_equal(
187
+ CrystalCell::Atom.new(1, [0.5, 0.0, 0.0], "#Ge-002"), cell.atoms[1])
188
+ assert_equal(
189
+ CrystalCell::Atom.new(2, [0.5, 0.5, 0.0], "#O--003"), cell.atoms[2])
163
190
 
164
- # vasp 4 style
165
- io = StringIO.new
166
- io.puts "sample0"
167
- io.puts "1.0"
168
- io.puts " 1.0 0.0 0.0"
169
- io.puts " 0.0 1.0 0.0"
170
- io.puts " 0.0 0.0 1.0"
171
- io.puts " 1 1 1"
172
- io.puts "Direct"
173
- io.puts " 0.0 0.0 0.0 #Li-001"
174
- io.puts " 0.5 0.0 0.0 #Ge-002"
175
- io.puts " 0.5 0.5 0.0 #O--003"
176
- io.rewind
177
- cell = VaspUtils::Poscar.parse(io)
178
- assert_equal("sample0", cell.comment)
179
- assert_equal(
180
- LatticeAxes.new( [
181
- [1.0, 0.0, 0.0 ],
182
- [0.0, 1.0, 0.0 ],
183
- [0.0, 0.0, 1.0 ],
184
- ]),
185
- cell.axes
186
- )
187
- assert_equal(
188
- Atom.new(0, [0.0, 0.0, 0.0], "#Li-001"), cell.atoms[0])
189
- assert_equal(
190
- Atom.new(1, [0.5, 0.0, 0.0], "#Ge-002"), cell.atoms[1])
191
- assert_equal(
192
- Atom.new(2, [0.5, 0.5, 0.0], "#O--003"), cell.atoms[2])
191
+ # vasp 4 style and selective dynamics
192
+ io = StringIO.new
193
+ io.puts "sample1"
194
+ io.puts "2.0"
195
+ io.puts " 1.0 0.0 0.0"
196
+ io.puts " 0.0 1.0 0.0"
197
+ io.puts " 0.0 0.0 1.0"
198
+ io.puts " 1 1 2"
199
+ io.puts "Selective dynamics"
200
+ io.puts "Direct"
201
+ io.puts " 0.0 0.0 0.0 F F F #Li-001"
202
+ io.puts " 0.5 0.0 0.0 F T F #Ge-002"
203
+ io.puts " 0.5 0.5 0.0 T T T #O--003"
204
+ io.puts " 0.5 0.5 0.5 T T T #O--004"
205
+ io.rewind
206
+ cell = VaspUtils::Poscar.parse(io)
207
+ assert_equal("sample1", cell.comment)
208
+ assert_equal(
209
+ CrystalCell::LatticeAxes.new( [
210
+ [2.0, 0.0, 0.0 ],
211
+ [0.0, 2.0, 0.0 ],
212
+ [0.0, 0.0, 2.0 ],
213
+ ]),
214
+ cell.axes
215
+ )
216
+ assert_equal(
217
+ CrystalCell::Atom.new(0, [0.0, 0.0, 0.0], "#Li-001", [false, false, false]),
218
+ cell.atoms[0])
219
+ assert_equal(
220
+ CrystalCell::Atom.new(1, [0.5, 0.0, 0.0], "#Ge-002", [false, true , false]),
221
+ cell.atoms[1])
222
+ assert_equal(
223
+ CrystalCell::Atom.new(2, [0.5, 0.5, 0.0], "#O--003", [true, true, true]),
224
+ cell.atoms[2])
225
+ assert_equal(
226
+ CrystalCell::Atom.new(2, [0.5, 0.5, 0.5], "#O--004", [true, true, true]),
227
+ cell.atoms[3])
193
228
 
194
- # vasp 4 style and selective dynamics
195
- io = StringIO.new
196
- io.puts "sample1"
197
- io.puts "2.0"
198
- io.puts " 1.0 0.0 0.0"
199
- io.puts " 0.0 1.0 0.0"
200
- io.puts " 0.0 0.0 1.0"
201
- io.puts " 1 1 2"
202
- io.puts "Selective dynamics"
203
- io.puts "Direct"
204
- io.puts " 0.0 0.0 0.0 F F F #Li-001"
205
- io.puts " 0.5 0.0 0.0 F T F #Ge-002"
206
- io.puts " 0.5 0.5 0.0 T T T #O--003"
207
- io.puts " 0.5 0.5 0.5 T T T #O--004"
208
- io.rewind
209
- cell = VaspUtils::Poscar.parse(io)
210
- assert_equal("sample1", cell.comment)
211
- assert_equal(
212
- LatticeAxes.new( [
213
- [2.0, 0.0, 0.0 ],
214
- [0.0, 2.0, 0.0 ],
215
- [0.0, 0.0, 2.0 ],
216
- ]),
217
- cell.axes
218
- )
219
- assert_equal(
220
- Atom.new(0, [0.0, 0.0, 0.0], "#Li-001", [false, false, false]),
221
- cell.atoms[0])
222
- assert_equal(
223
- Atom.new(1, [0.5, 0.0, 0.0], "#Ge-002", [false, true , false]),
224
- cell.atoms[1])
225
- assert_equal(
226
- Atom.new(2, [0.5, 0.5, 0.0], "#O--003", [true, true, true]),
227
- cell.atoms[2])
228
- assert_equal(
229
- Atom.new(2, [0.5, 0.5, 0.5], "#O--004", [true, true, true]),
230
- cell.atoms[3])
229
+ # vasp 5 style
230
+ io = StringIO.new
231
+ io.puts "sample0"
232
+ io.puts "1.0"
233
+ io.puts " 1.0 0.0 0.0"
234
+ io.puts " 0.0 1.0 0.0"
235
+ io.puts " 0.0 0.0 1.0"
236
+ io.puts " Li Ge O"
237
+ io.puts " 1 1 1"
238
+ io.puts "Direct"
239
+ io.puts " 0.0 0.0 0.0 #Li-001"
240
+ io.puts " 0.5 0.0 0.0 #Ge-002"
241
+ io.puts " 0.5 0.5 0.0 #O--003"
242
+ io.rewind
243
+ cell = VaspUtils::Poscar.parse(io)
244
+ assert_equal("sample0", cell.comment)
245
+ assert_equal(
246
+ CrystalCell::LatticeAxes.new( [
247
+ [1.0, 0.0, 0.0 ],
248
+ [0.0, 1.0, 0.0 ],
249
+ [0.0, 0.0, 1.0 ],
250
+ ]),
251
+ cell.axes
252
+ )
253
+ assert_equal(
254
+ CrystalCell::Atom.new("Li", [0.0, 0.0, 0.0], "#Li-001"), cell.atoms[0])
255
+ assert_equal(
256
+ CrystalCell::Atom.new("Ge", [0.5, 0.0, 0.0], "#Ge-002"), cell.atoms[1])
257
+ assert_equal(
258
+ CrystalCell::Atom.new("O", [0.5, 0.5, 0.0], "#O--003"), cell.atoms[2])
259
+ end
231
260
 
232
- # vasp 5 style
233
- io = StringIO.new
234
- io.puts "sample0"
235
- io.puts "1.0"
236
- io.puts " 1.0 0.0 0.0"
237
- io.puts " 0.0 1.0 0.0"
238
- io.puts " 0.0 0.0 1.0"
239
- io.puts " Li Ge O"
240
- io.puts " 1 1 1"
241
- io.puts "Direct"
242
- io.puts " 0.0 0.0 0.0 #Li-001"
243
- io.puts " 0.5 0.0 0.0 #Ge-002"
244
- io.puts " 0.5 0.5 0.0 #O--003"
245
- io.rewind
246
- cell = VaspUtils::Poscar.parse(io)
247
- assert_equal("sample0", cell.comment)
248
- assert_equal(
249
- LatticeAxes.new( [
250
- [1.0, 0.0, 0.0 ],
251
- [0.0, 1.0, 0.0 ],
252
- [0.0, 0.0, 1.0 ],
253
- ]),
254
- cell.axes
255
- )
256
- assert_equal(
257
- Atom.new("Li", [0.0, 0.0, 0.0], "#Li-001"), cell.atoms[0])
258
- assert_equal(
259
- Atom.new("Ge", [0.5, 0.0, 0.0], "#Ge-002"), cell.atoms[1])
260
- assert_equal(
261
- Atom.new("O", [0.5, 0.5, 0.0], "#O--003"), cell.atoms[2])
262
- end
261
+ def test_load_file
262
+ cell = VaspUtils::Poscar.load_file("test/poscar/POSCAR.4-0")
263
+ assert_equal("sample0", cell.comment)
264
+ assert_equal(
265
+ CrystalCell::LatticeAxes.new( [
266
+ [1.0, 0.0, 0.0 ],
267
+ [0.0, 1.0, 0.0 ],
268
+ [0.0, 0.0, 1.0 ],
269
+ ]),
270
+ cell.axes
271
+ )
272
+ assert_equal(
273
+ CrystalCell::Atom.new(0, [0.0, 0.0, 0.0], "#Li-001"), cell.atoms[0])
274
+ assert_equal(
275
+ CrystalCell::Atom.new(1, [0.5, 0.0, 0.0], "#Ge-002"), cell.atoms[1])
276
+ assert_equal(
277
+ CrystalCell::Atom.new(2, [0.5, 0.5, 0.0], "#O--003"), cell.atoms[2])
263
278
 
264
- def test_load_file
265
- cell = VaspUtils::Poscar.load_file("test/poscar/POSCAR.4-0")
266
- assert_equal("sample0", cell.comment)
267
- assert_equal(
268
- LatticeAxes.new( [
269
- [1.0, 0.0, 0.0 ],
270
- [0.0, 1.0, 0.0 ],
271
- [0.0, 0.0, 1.0 ],
272
- ]),
273
- cell.axes
274
- )
275
- assert_equal(
276
- Atom.new(0, [0.0, 0.0, 0.0], "#Li-001"), cell.atoms[0])
277
- assert_equal(
278
- Atom.new(1, [0.5, 0.0, 0.0], "#Ge-002"), cell.atoms[1])
279
- assert_equal(
280
- Atom.new(2, [0.5, 0.5, 0.0], "#O--003"), cell.atoms[2])
281
279
 
282
- end
280
+ assert_raise(VaspUtils::Poscar::ParseError) {
281
+ VaspUtils::Poscar.load_file("test/poscar/NOT_POSCAR")
282
+ }
283
+ end
283
284
  end
data/test/test_potcar.rb CHANGED
@@ -7,39 +7,39 @@ require "vasputils/setting.rb"
7
7
 
8
8
  class TC_Potcar < Test::Unit::TestCase
9
9
 
10
- def setup
11
- @p0 = VaspUtils::Potcar.load_file("test/potcar/POTCAR" )
12
- @p1 = VaspUtils::Potcar.load_file("test/potcar/POTCAR.dummy" )
13
- @p2 = VaspUtils::Potcar.load_file("test/potcar/POTCAR.allElement")
14
- end
10
+ def setup
11
+ @p0 = VaspUtils::Potcar.load_file("test/potcar/POTCAR" )
12
+ @p1 = VaspUtils::Potcar.load_file("test/potcar/POTCAR.dummy" )
13
+ @p2 = VaspUtils::Potcar.load_file("test/potcar/POTCAR.allElement")
14
+ end
15
15
 
16
- def test_get_filename
17
- assert_equal("test/potcar/POTCAR" , @p0[:name])
18
- assert_equal("test/potcar/POTCAR.dummy" , @p1[:name])
19
- assert_equal("test/potcar/POTCAR.allElement", @p2[:name])
20
- end
16
+ def test_get_filename
17
+ assert_equal("test/potcar/POTCAR" , @p0[:name])
18
+ assert_equal("test/potcar/POTCAR.dummy" , @p1[:name])
19
+ assert_equal("test/potcar/POTCAR.allElement", @p2[:name])
20
+ end
21
21
 
22
- def test_elements
23
- assert_equal([ "Li", "Ge", "O" ], @p0[:elements])
24
- assert_equal([ "Li", "Ge", "O" ], @p1[:elements])
25
- correct = [
26
- "Ac", "Ac", "Ag", "Al", "Al", "Ar", "As", "Au", "B", "B", "B", "Ba",
27
- "Be", "Be", "Bi", "Bi", "Br", "C", "C", "C", "Ca", "Ca", "Cd", "Ce",
28
- "Ce", "Cl", "Cl", "Co", "Cr", "Cr", "Cs", "Cu", "Cu", "Dy",
29
- "Er", "Er", "Eu", "Eu", "F", "F", "F", "Fe", "Fe", "Ga", "Ga", "Ga",
30
- "Gd", "Gd", "Ge", "Ge", "Ge", "H", "H", "H", "H", "H", "H", "He",
31
- "Hf", "Hf", "Hg", "Ho", "I", "In", "In", "Ir", "K", "K", "Kr",
32
- "La", "La", "Li", "Li", "Lu", "Lu", "Mg", "Mg", "Mn", "Mn",
33
- "Mo", "Mo", "N", "N", "N", "Na", "Na", "Na", "Nb", "Nb", "Nd", "Nd",
34
- "Ne", "Ni", "Ni", "Np", "Np", "O", "O", "O", "Os", "Os", "P", "P",
35
- "Pa", "Pa", "Pb", "Pb", "Pd", "Pd", "Pm", "Pm", "Pr", "Pr", "Pt",
36
- "Pu", "Pu", "Rb", "Rb", "Re", "Re", "Rh", "Rh", "Ru", "Ru", "S", "S",
37
- "Sb", "Sc", "Se", "Si", "Si", "Sm", "Sm", "Sn", "Sn", "Sr",
38
- "Ta", "Ta", "Tb", "Tc", "Tc", "Te", "Th", "Th", "Ti", "Ti", "Ti",
39
- "Tl", "Tl", "Tm", "Tm", "U", "U", "V", "V", "V", "W", "W", "X", "Y",
40
- "Yb", "Yb", "Zn", "Zr", "Zr"]
41
- assert_equal( correct, @p2[:elements])
42
- end
22
+ def test_elements
23
+ assert_equal([ "Li", "Ge", "O" ], @p0[:elements])
24
+ assert_equal([ "Li", "Ge", "O" ], @p1[:elements])
25
+ correct = [
26
+ "Ac", "Ac", "Ag", "Al", "Al", "Ar", "As", "Au", "B", "B", "B", "Ba",
27
+ "Be", "Be", "Bi", "Bi", "Br", "C", "C", "C", "Ca", "Ca", "Cd", "Ce",
28
+ "Ce", "Cl", "Cl", "Co", "Cr", "Cr", "Cs", "Cu", "Cu", "Dy",
29
+ "Er", "Er", "Eu", "Eu", "F", "F", "F", "Fe", "Fe", "Ga", "Ga", "Ga",
30
+ "Gd", "Gd", "Ge", "Ge", "Ge", "H", "H", "H", "H", "H", "H", "He",
31
+ "Hf", "Hf", "Hg", "Ho", "I", "In", "In", "Ir", "K", "K", "Kr",
32
+ "La", "La", "Li", "Li", "Lu", "Lu", "Mg", "Mg", "Mn", "Mn",
33
+ "Mo", "Mo", "N", "N", "N", "Na", "Na", "Na", "Nb", "Nb", "Nd", "Nd",
34
+ "Ne", "Ni", "Ni", "Np", "Np", "O", "O", "O", "Os", "Os", "P", "P",
35
+ "Pa", "Pa", "Pb", "Pb", "Pd", "Pd", "Pm", "Pm", "Pr", "Pr", "Pt",
36
+ "Pu", "Pu", "Rb", "Rb", "Re", "Re", "Rh", "Rh", "Ru", "Ru", "S", "S",
37
+ "Sb", "Sc", "Se", "Si", "Si", "Sm", "Sm", "Sn", "Sn", "Sr",
38
+ "Ta", "Ta", "Tb", "Tc", "Tc", "Te", "Th", "Th", "Ti", "Ti", "Ti",
39
+ "Tl", "Tl", "Tm", "Tm", "U", "U", "V", "V", "V", "W", "W", "X", "Y",
40
+ "Yb", "Yb", "Zn", "Zr", "Zr"]
41
+ assert_equal( correct, @p2[:elements])
42
+ end
43
43
 
44
44
  end
45
45