SAMBA-ilum 1.0.0.541__tar.gz → 1.0.0.543__tar.gz

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 (68) hide show
  1. {samba_ilum-1.0.0.541 → samba_ilum-1.0.0.543}/PKG-INFO +1 -1
  2. {samba_ilum-1.0.0.541 → samba_ilum-1.0.0.543}/SAMBA_ilum.egg-info/PKG-INFO +1 -1
  3. {samba_ilum-1.0.0.541 → samba_ilum-1.0.0.543}/SAMBA_ilum.egg-info/SOURCES.txt +1 -0
  4. {samba_ilum-1.0.0.541 → samba_ilum-1.0.0.543}/samba_ilum/__main__.py +8 -1
  5. {samba_ilum-1.0.0.541 → samba_ilum-1.0.0.543}/samba_ilum/src/HeteroStructure_Generator.py +113 -101
  6. {samba_ilum-1.0.0.541 → samba_ilum-1.0.0.543}/samba_ilum/src/cell_check.py +1 -1
  7. samba_ilum-1.0.0.543/samba_ilum/src/energy_scan.py +57 -0
  8. {samba_ilum-1.0.0.541 → samba_ilum-1.0.0.543}/samba_ilum/src/job.py +4 -4
  9. samba_ilum-1.0.0.543/samba_ilum/src/poscar_fix_direct_coord.py +117 -0
  10. {samba_ilum-1.0.0.541 → samba_ilum-1.0.0.543}/setup.py +1 -1
  11. samba_ilum-1.0.0.541/samba_ilum/src/energy_scan.py +0 -35
  12. {samba_ilum-1.0.0.541 → samba_ilum-1.0.0.543}/LICENSE.txt +0 -0
  13. {samba_ilum-1.0.0.541 → samba_ilum-1.0.0.543}/README.md +0 -0
  14. {samba_ilum-1.0.0.541 → samba_ilum-1.0.0.543}/SAMBA_ilum.egg-info/dependency_links.txt +0 -0
  15. {samba_ilum-1.0.0.541 → samba_ilum-1.0.0.543}/SAMBA_ilum.egg-info/entry_points.txt +0 -0
  16. {samba_ilum-1.0.0.541 → samba_ilum-1.0.0.543}/SAMBA_ilum.egg-info/requires.txt +0 -0
  17. {samba_ilum-1.0.0.541 → samba_ilum-1.0.0.543}/SAMBA_ilum.egg-info/top_level.txt +0 -0
  18. {samba_ilum-1.0.0.541 → samba_ilum-1.0.0.543}/samba_ilum/__init__.py +0 -0
  19. {samba_ilum-1.0.0.541 → samba_ilum-1.0.0.543}/samba_ilum/src/BZ_2D.py +0 -0
  20. {samba_ilum-1.0.0.541 → samba_ilum-1.0.0.543}/samba_ilum/src/INPUTS/Hubbard_U_values.txt +0 -0
  21. {samba_ilum-1.0.0.541 → samba_ilum-1.0.0.543}/samba_ilum/src/INPUTS/INCAR_a-scan +0 -0
  22. {samba_ilum-1.0.0.541 → samba_ilum-1.0.0.543}/samba_ilum/src/INPUTS/INCAR_bader +0 -0
  23. {samba_ilum-1.0.0.541 → samba_ilum-1.0.0.543}/samba_ilum/src/INPUTS/INCAR_bader.SO +0 -0
  24. {samba_ilum-1.0.0.541 → samba_ilum-1.0.0.543}/samba_ilum/src/INPUTS/INCAR_bands +0 -0
  25. {samba_ilum-1.0.0.541 → samba_ilum-1.0.0.543}/samba_ilum/src/INPUTS/INCAR_bands.SO +0 -0
  26. {samba_ilum-1.0.0.541 → samba_ilum-1.0.0.543}/samba_ilum/src/INPUTS/INCAR_dos +0 -0
  27. {samba_ilum-1.0.0.541 → samba_ilum-1.0.0.543}/samba_ilum/src/INPUTS/INCAR_dos.SO +0 -0
  28. {samba_ilum-1.0.0.541 → samba_ilum-1.0.0.543}/samba_ilum/src/INPUTS/INCAR_relax +0 -0
  29. {samba_ilum-1.0.0.541 → samba_ilum-1.0.0.543}/samba_ilum/src/INPUTS/INCAR_scf +0 -0
  30. {samba_ilum-1.0.0.541 → samba_ilum-1.0.0.543}/samba_ilum/src/INPUTS/INCAR_scf.SO +0 -0
  31. {samba_ilum-1.0.0.541 → samba_ilum-1.0.0.543}/samba_ilum/src/INPUTS/INCAR_xy-scan +0 -0
  32. {samba_ilum-1.0.0.541 → samba_ilum-1.0.0.543}/samba_ilum/src/INPUTS/INCAR_xyz-scan +0 -0
  33. {samba_ilum-1.0.0.541 → samba_ilum-1.0.0.543}/samba_ilum/src/INPUTS/INCAR_z-scan +0 -0
  34. {samba_ilum-1.0.0.541 → samba_ilum-1.0.0.543}/samba_ilum/src/INPUTS/SAMBA_HeteroStructure.input +0 -0
  35. {samba_ilum-1.0.0.541 → samba_ilum-1.0.0.543}/samba_ilum/src/INPUTS/SAMBA_WorkFlow.input +0 -0
  36. {samba_ilum-1.0.0.541 → samba_ilum-1.0.0.543}/samba_ilum/src/INPUTS/inputs_VASProcar/input.vasprocar.bands +0 -0
  37. {samba_ilum-1.0.0.541 → samba_ilum-1.0.0.543}/samba_ilum/src/INPUTS/inputs_VASProcar/input.vasprocar.chgcar +0 -0
  38. {samba_ilum-1.0.0.541 → samba_ilum-1.0.0.543}/samba_ilum/src/INPUTS/inputs_VASProcar/input.vasprocar.dos +0 -0
  39. {samba_ilum-1.0.0.541 → samba_ilum-1.0.0.543}/samba_ilum/src/INPUTS/inputs_VASProcar/input.vasprocar.location +0 -0
  40. {samba_ilum-1.0.0.541 → samba_ilum-1.0.0.543}/samba_ilum/src/INPUTS/inputs_VASProcar/input.vasprocar.locpot +0 -0
  41. {samba_ilum-1.0.0.541 → samba_ilum-1.0.0.543}/samba_ilum/src/INPUTS/inputs_VASProcar/input.vasprocar.orbitals +0 -0
  42. {samba_ilum-1.0.0.541 → samba_ilum-1.0.0.543}/samba_ilum/src/INPUTS/inputs_VASProcar/input.vasprocar.spin +0 -0
  43. {samba_ilum-1.0.0.541 → samba_ilum-1.0.0.543}/samba_ilum/src/INPUTS/vdw_kernel.bindat +0 -0
  44. {samba_ilum-1.0.0.541 → samba_ilum-1.0.0.543}/samba_ilum/src/_info_pseudo.py +0 -0
  45. {samba_ilum-1.0.0.541 → samba_ilum-1.0.0.543}/samba_ilum/src/a-scan.py +0 -0
  46. {samba_ilum-1.0.0.541 → samba_ilum-1.0.0.543}/samba_ilum/src/a-scan_analysis.py +0 -0
  47. {samba_ilum-1.0.0.541 → samba_ilum-1.0.0.543}/samba_ilum/src/bader +0 -0
  48. {samba_ilum-1.0.0.541 → samba_ilum-1.0.0.543}/samba_ilum/src/bader_poscar.py +0 -0
  49. {samba_ilum-1.0.0.541 → samba_ilum-1.0.0.543}/samba_ilum/src/bader_update.py +0 -0
  50. {samba_ilum-1.0.0.541 → samba_ilum-1.0.0.543}/samba_ilum/src/charge_transfer.py +0 -0
  51. {samba_ilum-1.0.0.541 → samba_ilum-1.0.0.543}/samba_ilum/src/chgsum.pl +0 -0
  52. {samba_ilum-1.0.0.541 → samba_ilum-1.0.0.543}/samba_ilum/src/contcar_update.py +0 -0
  53. {samba_ilum-1.0.0.541 → samba_ilum-1.0.0.543}/samba_ilum/src/data-base_json.py +0 -0
  54. {samba_ilum-1.0.0.541 → samba_ilum-1.0.0.543}/samba_ilum/src/data-base_union.py +0 -0
  55. {samba_ilum-1.0.0.541 → samba_ilum-1.0.0.543}/samba_ilum/src/hubbard_correction.py +0 -0
  56. {samba_ilum-1.0.0.541 → samba_ilum-1.0.0.543}/samba_ilum/src/kpoints.py +0 -0
  57. {samba_ilum-1.0.0.541 → samba_ilum-1.0.0.543}/samba_ilum/src/lattice_plot3d.py +0 -0
  58. {samba_ilum-1.0.0.541 → samba_ilum-1.0.0.543}/samba_ilum/src/make_files.py +0 -0
  59. {samba_ilum-1.0.0.541 → samba_ilum-1.0.0.543}/samba_ilum/src/output.py +0 -0
  60. {samba_ilum-1.0.0.541 → samba_ilum-1.0.0.543}/samba_ilum/src/potcar.py +0 -0
  61. {samba_ilum-1.0.0.541 → samba_ilum-1.0.0.543}/samba_ilum/src/vdW_DF.py +0 -0
  62. {samba_ilum-1.0.0.541 → samba_ilum-1.0.0.543}/samba_ilum/src/xy-scan.py +0 -0
  63. {samba_ilum-1.0.0.541 → samba_ilum-1.0.0.543}/samba_ilum/src/xy-scan_analysis.py +0 -0
  64. {samba_ilum-1.0.0.541 → samba_ilum-1.0.0.543}/samba_ilum/src/xyz-scan.py +0 -0
  65. {samba_ilum-1.0.0.541 → samba_ilum-1.0.0.543}/samba_ilum/src/xyz-scan_analysis.py +0 -0
  66. {samba_ilum-1.0.0.541 → samba_ilum-1.0.0.543}/samba_ilum/src/z-scan.py +0 -0
  67. {samba_ilum-1.0.0.541 → samba_ilum-1.0.0.543}/samba_ilum/src/z-scan_analysis.py +0 -0
  68. {samba_ilum-1.0.0.541 → samba_ilum-1.0.0.543}/setup.cfg +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: SAMBA_ilum
3
- Version: 1.0.0.541
3
+ Version: 1.0.0.543
4
4
  Summary: ...
5
5
  Author: Augusto de Lelis Araujo
6
6
  Author-email: augusto-lelis@outlook.com
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: SAMBA_ilum
3
- Version: 1.0.0.541
3
+ Version: 1.0.0.543
4
4
  Summary: ...
5
5
  Author: Augusto de Lelis Araujo
6
6
  Author-email: augusto-lelis@outlook.com
@@ -31,6 +31,7 @@ samba_ilum/src/kpoints.py
31
31
  samba_ilum/src/lattice_plot3d.py
32
32
  samba_ilum/src/make_files.py
33
33
  samba_ilum/src/output.py
34
+ samba_ilum/src/poscar_fix_direct_coord.py
34
35
  samba_ilum/src/potcar.py
35
36
  samba_ilum/src/vdW_DF.py
36
37
  samba_ilum/src/xy-scan.py
@@ -16,7 +16,7 @@ dir_samba = os.path.dirname(os.path.realpath(__file__))
16
16
  print(f'{dir_samba}')
17
17
  #--------------------
18
18
 
19
- version = '1.0.0.541'
19
+ version = '1.0.0.543'
20
20
 
21
21
  print(" ")
22
22
  print("=============================================================")
@@ -59,6 +59,13 @@ except Exception as e:
59
59
  print(" ")
60
60
 
61
61
 
62
+ #=============================================================
63
+ # Fixing the coordinates of POSCAR files in direct form ======
64
+ #=============================================================
65
+ # exec(open(dir_codes + '/poscar_fix_direct_coord.py').read())
66
+ #=============================================================
67
+
68
+
62
69
  # ------------------------------------------------------------------------------
63
70
  # Checking if the "run.input" file exists --------------------------------------
64
71
  # ------------------------------------------------------------------------------
@@ -1707,6 +1707,7 @@ print(f'{n_structures} remaining cells')
1707
1707
 
1708
1708
  #=====================================================================
1709
1709
  # Filtering/Excluding Similar POSCAR Files ===========================
1710
+ # within the temporary subdirectories of the POSCAR files ============
1710
1711
  #=====================================================================
1711
1712
 
1712
1713
  n += 1
@@ -1825,7 +1826,7 @@ print(f'{n_structures} remaining cells')
1825
1826
 
1826
1827
 
1827
1828
  #=====================================================================
1828
- # Deleting temporary directory of POSCAR files =======================
1829
+ # Deleting temporary subdirectories of POSCAR files ==================
1829
1830
  #=====================================================================
1830
1831
  number = 0
1831
1832
  #--------------------------
@@ -1845,114 +1846,125 @@ for i in range(len(files0)):
1845
1846
 
1846
1847
  #=====================================================================
1847
1848
  # Filtering/Excluding Similar POSCAR Files ===========================
1849
+ # within the final directory of the POSCAR files =====================
1848
1850
  #=====================================================================
1849
1851
 
1850
- n += 1
1851
- #----------
1852
- print(f' ')
1853
- print(f'========================================')
1854
- print(f'Step {n}: Deleting Similar Lattices ====')
1855
- print(f'========================================')
1852
+ #%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1853
+ # Introduzir o loop de exclusão, até que duas interações retornem exclusão nula
1854
+ #%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1856
1855
 
1857
- files = os.listdir(diret2)
1858
- n_exclusion = 0
1856
+ n_exclusion_cont = 0
1859
1857
 
1860
- for i in range(len(files)):
1861
- #---------------------------------
1862
- print(f'Progress {i+1}/{len(files)}')
1863
- #----------------
1864
- files_delete = []
1865
- #------------------------------------
1866
- if os.path.exists(diret2 + files[i]):
1867
- #---------------------------------------------------------
1868
- structure1 = Poscar.from_file(diret2 + files[i]).structure
1869
- #---------------------------------------------------------
1870
- poscar = open(diret2 + files[i], "r")
1871
- #--------------------------------
1872
- VTemp = poscar.readline().split()
1873
- if (n_Lattice == 2):
1874
- Angle_AB1 = float(VTemp[27])
1875
- if (n_Lattice == 3):
1876
- temp_angle = VTemp[28].replace('_',' ').split()
1877
- Angle_AB1 = float(temp_angle[0])
1878
- #----------------------------------------------
1879
- param = poscar.readline(); param = float(param)
1880
- VTemp = poscar.readline().split(); Ax = float(VTemp[0])*param; Ay = float(VTemp[1])*param; A = np.array([Ax, Ay]); mA = np.linalg.norm(A)
1881
- VTemp = poscar.readline().split(); Bx = float(VTemp[0])*param; By = float(VTemp[1])*param; B = np.array([Bx, By]); mB = np.linalg.norm(B)
1882
- dAB1 = abs(mA - mB)
1883
- poscar.close()
1884
- #-------------
1885
-
1886
- for j in range(len(files)):
1887
- if (i != j):
1888
- #------------------------------------
1889
- if os.path.exists(diret2 + files[j]):
1890
- #---------------------------------------------------------
1891
- structure2 = Poscar.from_file(diret2 + files[j]).structure
1892
- #----------------------------------------------------------------------------------
1893
- matcher = StructureMatcher() # Creating a StructureMatcher object
1894
- if matcher.fit(structure1, structure2): # Checking if the structures are similar
1895
- #-----------------------------------------------------------------------------------
1896
- poscar = open(diret2 + files[j], "r")
1897
- #--------------------------------
1898
- VTemp = poscar.readline().split()
1899
- if (n_Lattice == 2):
1900
- Angle_AB2 = float(VTemp[27])
1901
- if (n_Lattice == 3):
1902
- temp_angle = VTemp[28].replace('_',' ').split()
1903
- Angle_AB2 = float(temp_angle[0])
1904
- #----------------------------------------------
1905
- param = poscar.readline(); param = float(param)
1906
- VTemp = poscar.readline().split(); Ax = float(VTemp[0])*param; Ay = float(VTemp[1])*param; A = np.array([Ax, Ay]); mA = np.linalg.norm(A)
1907
- VTemp = poscar.readline().split(); Bx = float(VTemp[0])*param; By = float(VTemp[1])*param; B = np.array([Bx, By]); mB = np.linalg.norm(B)
1908
- dAB2 = abs(mA - mB)
1909
- poscar.close()
1910
- #----------------
1911
- if (dAB1 < dAB2):
1912
- if os.path.exists(diret2 + + files[j]):
1913
- os.remove(diret2 + files[j])
1914
- n_exclusion += 1
1915
- #----------------
1916
- if (dAB1 > dAB2):
1917
- if os.path.exists(diret2 + files[i]):
1918
- os.remove(diret2 + files[i])
1919
- n_exclusion += 1
1920
- #-----------------
1921
- if (dAB1 == dAB2):
1922
- cont = 1
1923
- #--------------------------------------------------------
1924
- if ( (Angle_AB1 < 0) and (Angle_AB2 > 0) and cont == 1 ):
1925
- if os.path.exists(diret2 + files[i]):
1926
- os.remove(diret2 + files[i])
1927
- n_exclusion += 1; cont = 0
1928
- if ( (Angle_AB1 > 0) and (Angle_AB2 < 0) and cont == 1 ):
1929
- if os.path.exists(diret2 + files[j]):
1930
- os.remove(diret2 + files[j])
1931
- n_exclusion += 1; cont = 0
1932
- if (abs(Angle_AB1) < abs(Angle_AB2) and cont == 1):
1933
- if os.path.exists(diret2 + files[j]):
1858
+ while n_exclusion_cont != 2:
1859
+
1860
+ n += 1
1861
+ #----------
1862
+ print(f' ')
1863
+ print(f'========================================')
1864
+ print(f'Step {n}: Deleting Similar Lattices ====')
1865
+ print(f'========================================')
1866
+
1867
+ files = os.listdir(diret2)
1868
+ n_exclusion = 0
1869
+
1870
+ for i in range(len(files)):
1871
+ #---------------------------------
1872
+ print(f'Progress {i+1}/{len(files)}')
1873
+ #----------------
1874
+ files_delete = []
1875
+ #------------------------------------
1876
+ if os.path.exists(diret2 + files[i]):
1877
+ #---------------------------------------------------------
1878
+ structure1 = Poscar.from_file(diret2 + files[i]).structure
1879
+ #---------------------------------------------------------
1880
+ poscar = open(diret2 + files[i], "r")
1881
+ #--------------------------------
1882
+ VTemp = poscar.readline().split()
1883
+ if (n_Lattice == 2):
1884
+ Angle_AB1 = float(VTemp[27])
1885
+ if (n_Lattice == 3):
1886
+ temp_angle = VTemp[28].replace('_',' ').split()
1887
+ Angle_AB1 = float(temp_angle[0])
1888
+ #----------------------------------------------
1889
+ param = poscar.readline(); param = float(param)
1890
+ VTemp = poscar.readline().split(); Ax = float(VTemp[0])*param; Ay = float(VTemp[1])*param; A = np.array([Ax, Ay]); mA = np.linalg.norm(A)
1891
+ VTemp = poscar.readline().split(); Bx = float(VTemp[0])*param; By = float(VTemp[1])*param; B = np.array([Bx, By]); mB = np.linalg.norm(B)
1892
+ dAB1 = abs(mA - mB)
1893
+ poscar.close()
1894
+ #-------------
1895
+ for j in range(len(files)):
1896
+ if (i != j):
1897
+ #------------------------------------
1898
+ if os.path.exists(diret2 + files[j]):
1899
+ #---------------------------------------------------------
1900
+ structure2 = Poscar.from_file(diret2 + files[j]).structure
1901
+ #----------------------------------------------------------------------------------
1902
+ matcher = StructureMatcher() # Creating a StructureMatcher object
1903
+ if matcher.fit(structure1, structure2): # Checking if the structures are similar
1904
+ #-----------------------------------------------------------------------------------
1905
+ poscar = open(diret2 + files[j], "r")
1906
+ #--------------------------------
1907
+ VTemp = poscar.readline().split()
1908
+ if (n_Lattice == 2):
1909
+ Angle_AB2 = float(VTemp[27])
1910
+ if (n_Lattice == 3):
1911
+ temp_angle = VTemp[28].replace('_',' ').split()
1912
+ Angle_AB2 = float(temp_angle[0])
1913
+ #----------------------------------------------
1914
+ param = poscar.readline(); param = float(param)
1915
+ VTemp = poscar.readline().split(); Ax = float(VTemp[0])*param; Ay = float(VTemp[1])*param; A = np.array([Ax, Ay]); mA = np.linalg.norm(A)
1916
+ VTemp = poscar.readline().split(); Bx = float(VTemp[0])*param; By = float(VTemp[1])*param; B = np.array([Bx, By]); mB = np.linalg.norm(B)
1917
+ dAB2 = abs(mA - mB)
1918
+ poscar.close()
1919
+ #----------------
1920
+ if (dAB1 < dAB2):
1921
+ if os.path.exists(diret2 + + files[j]):
1934
1922
  os.remove(diret2 + files[j])
1935
- n_exclusion += 1; cont = 0
1936
- if (abs(Angle_AB1) > abs(Angle_AB2) and cont == 1):
1923
+ n_exclusion += 1
1924
+ #----------------
1925
+ if (dAB1 > dAB2):
1937
1926
  if os.path.exists(diret2 + files[i]):
1938
1927
  os.remove(diret2 + files[i])
1939
- n_exclusion += 1; cont = 0
1940
- if (Angle_AB1 == Angle_AB2 and cont == 1):
1941
- if os.path.exists(diret2 + files[j]):
1942
- os.remove(diret2 + files[j])
1943
1928
  n_exclusion += 1
1944
-
1945
- #-------------------------
1946
- files = os.listdir(diret2)
1947
- n_structures = len(files)
1948
- #------------------------
1949
-
1950
- print(f'============================================')
1951
- print(f'{n_exclusion} cells were filtered/excluded')
1952
- print(f'--------------------------------------------')
1953
- if (n_structures == 1): print(f'Only one cell was found')
1954
- if (n_structures > 1): print(f'{n_structures} cells were found')
1955
- print(f'============================================')
1929
+ #-----------------
1930
+ if (dAB1 == dAB2):
1931
+ cont = 1
1932
+ #--------------------------------------------------------
1933
+ if ( (Angle_AB1 < 0) and (Angle_AB2 > 0) and cont == 1 ):
1934
+ if os.path.exists(diret2 + files[i]):
1935
+ os.remove(diret2 + files[i])
1936
+ n_exclusion += 1; cont = 0
1937
+ if ( (Angle_AB1 > 0) and (Angle_AB2 < 0) and cont == 1 ):
1938
+ if os.path.exists(diret2 + files[j]):
1939
+ os.remove(diret2 + files[j])
1940
+ n_exclusion += 1; cont = 0
1941
+ if (abs(Angle_AB1) < abs(Angle_AB2) and cont == 1):
1942
+ if os.path.exists(diret2 + files[j]):
1943
+ os.remove(diret2 + files[j])
1944
+ n_exclusion += 1; cont = 0
1945
+ if (abs(Angle_AB1) > abs(Angle_AB2) and cont == 1):
1946
+ if os.path.exists(diret2 + files[i]):
1947
+ os.remove(diret2 + files[i])
1948
+ n_exclusion += 1; cont = 0
1949
+ if (Angle_AB1 == Angle_AB2 and cont == 1):
1950
+ if os.path.exists(diret2 + files[j]):
1951
+ os.remove(diret2 + files[j])
1952
+ n_exclusion += 1
1953
+ #-------------------------
1954
+ files = os.listdir(diret2)
1955
+ n_structures = len(files)
1956
+ #------------------------
1957
+
1958
+ print(f'============================================')
1959
+ print(f'{n_exclusion} cells were filtered/excluded')
1960
+ print(f'--------------------------------------------')
1961
+ if (n_structures == 1): print(f'Only one cell was found')
1962
+ if (n_structures > 1): print(f'{n_structures} cells were found')
1963
+ print(f'============================================')
1964
+
1965
+ if (n_exclusion != 0): n_exclusion_cont = 0
1966
+ if (n_exclusion == 0): n_exclusion_cont += 1
1967
+ if (n_structures == 1): n_exclusion_cont = 2
1956
1968
 
1957
1969
 
1958
1970
  #=====================================================================
@@ -177,7 +177,7 @@ for name in files0:
177
177
  menor_0 = min(angulos_z) if angulos_z else 0.0
178
178
  menor_1 = min(angulos_z_na_origem) if angulos_z_na_origem else 0.0
179
179
  #--------------------------------------------------------------------
180
- # If there is a difference, calculate, correct and save the new file.
180
+ # If there is a difference, the rotation angle position is fixed ----
181
181
  #--------------------------------------------------------------------
182
182
  if (menor_0 != menor_1 and menor_0 != 0.0):
183
183
  axis_correction += 1
@@ -0,0 +1,57 @@
1
+ # SAMBA_ilum Copyright (C) 2025 - Closed source
2
+
3
+
4
+ import os
5
+
6
+
7
+ try:
8
+ path_dir, name_dir = os.path.split(os.getcwd())
9
+ except Exception as e:
10
+ pass
11
+
12
+
13
+ #----------------
14
+ converged = False
15
+ #----------------
16
+ try:
17
+ with open('OUTCAR', 'r') as f:
18
+ for line in f:
19
+ if 'reached' in line:
20
+ converged = True
21
+ break
22
+ except FileNotFoundError:
23
+ pass
24
+ except Exception as e:
25
+ pass
26
+
27
+
28
+ if converged:
29
+ try:
30
+ with open('OSZICAR', 'r') as f:
31
+ last_line = f.readlines()[-1].strip()
32
+ energy_value = last_line.replace('=', ' ').split()[4]
33
+ #--------------------------------------------------------
34
+ with open('../energy_scan.txt', "a") as energy_file:
35
+ energy_file.write(f'{name_dir} {energy_value}\n')
36
+ #---------------------------------------------
37
+ temp_name = name_dir.replace('_', ' ').split()
38
+ #---------------------------------------------
39
+ if len(temp_name) == 2:
40
+ t_temp_name_original = temp_name.copy()
41
+ #---------------------------------------------
42
+ if temp_name[0] == '0.0': temp_name[0] = '1.0'
43
+ if temp_name[1] == '0.0': temp_name[1] = '1.0'
44
+ #---------------------------------------------
45
+ if temp_name[0] == '1.0' or temp_name[1] == '1.0':
46
+ new_name_dir = f'{temp_name[0]}_{temp_name[1]}'
47
+ energy_file.write(f'{new_name_dir} {energy_value}\n')
48
+ #------------------------------------------------------------------------
49
+ if t_temp_name_original[0] == '0.0' and t_temp_name_original[1] == '0.0':
50
+ energy_file.write(f'1.0_0.0 {energy_value}\n')
51
+ energy_file.write(f'0.0_1.0 {energy_value}\n')
52
+ except FileNotFoundError:
53
+ pass
54
+ except IndexError:
55
+ pass
56
+ except Exception as e:
57
+ pass
@@ -130,8 +130,8 @@ job.write(f' $vasp_std || echo "Error in VASP in $dir0/$
130
130
  job.write(f' sleep 10 \n')
131
131
  job.write(f' python3 contcar_update.py \n')
132
132
  job.write(f' python3 energy_scan.py \n')
133
- job.write(f' rm -r CHG CHGCAR DOSCAR PROCAR WAVECAR INCAR KPOINTS OSZICAR PCDAT POTCAR REPORT XDATCAR vdw_kernel.bindat EIGENVAL IBZKPT vasprun.xml *.py \n')
134
- job.write(f' bzip2 OUTCAR \n')
133
+ job.write(f' rm -r CHG CHGCAR DOSCAR PROCAR WAVECAR INCAR KPOINTS PCDAT POTCAR REPORT XDATCAR vdw_kernel.bindat EIGENVAL IBZKPT vasprun.xml *.py \n')
134
+ job.write(f' bzip2 OUTCAR OSZICAR \n')
135
135
  job.write(f' done \n')
136
136
  job.write(f' #------------- \n')
137
137
  job.write(f' cd $dir0/$i/$j \n')
@@ -174,8 +174,8 @@ job.write(f' $vasp_std || echo "Error in VASP in
174
174
  job.write(f' sleep 10 \n')
175
175
  job.write(f' python3 contcar_update.py \n')
176
176
  job.write(f' python3 energy_scan.py \n')
177
- job.write(f' rm -r CHG CHGCAR DOSCAR PROCAR WAVECAR INCAR KPOINTS OSZICAR PCDAT POTCAR REPORT XDATCAR vdw_kernel.bindat EIGENVAL IBZKPT vasprun.xml *.py \n')
178
- job.write(f' bzip2 OUTCAR \n')
177
+ job.write(f' rm -r CHG CHGCAR DOSCAR PROCAR WAVECAR INCAR KPOINTS PCDAT POTCAR REPORT XDATCAR vdw_kernel.bindat EIGENVAL IBZKPT vasprun.xml *.py \n')
178
+ job.write(f' bzip2 OUTCAR OSZICAR \n')
179
179
  job.write(f' cd $dir0/$i/$j \n')
180
180
  job.write(f' mv $k OK_$k \n')
181
181
  job.write(f' fi \n')
@@ -0,0 +1,117 @@
1
+ # SAMBA_ilum Copyright (C) 2025 - Closed source
2
+
3
+
4
+ import numpy as np
5
+ import shutil
6
+ import glob
7
+ import sys
8
+ import os
9
+
10
+
11
+ #----------------------------------------------------------------------------
12
+ # Function to delete hidden files -------------------------------------------
13
+ #----------------------------------------------------------------------------
14
+ def delete_hidden_files(target_directory):
15
+ search_files = os.path.join(target_directory, '.*')
16
+ for item in glob.glob(search_files):
17
+ try:
18
+ if os.path.isfile(item): os.remove(item)
19
+ except OSError: pass
20
+
21
+
22
+ #----------------------------------------------------
23
+ # Listing files inside the "dir_poscar" directory ---
24
+ #----------------------------------------------------
25
+ poscar_dir_path = os.path.join(dir_files, dir_poscar)
26
+ #-----------------------------------
27
+ delete_hidden_files(poscar_dir_path)
28
+ files0 = [name for name in os.listdir(poscar_dir_path) if os.path.isfile(os.path.join(poscar_dir_path, name))]
29
+
30
+
31
+ #======================================================
32
+ # Checking/Correcting POSCAR files ====================
33
+ #======================================================
34
+ poscar_backup_dir_path = os.path.join(dir_files, 'POSCAR_Backup_temp')
35
+ os.rename(poscar_dir_path, poscar_backup_dir_path)
36
+ os.makedirs(poscar_dir_path, exist_ok=True)
37
+ #------------------------------------------
38
+ files1 = [name for name in os.listdir(poscar_backup_dir_path) if os.path.isfile(os.path.join(poscar_backup_dir_path, name))]
39
+ for file_in in files1:
40
+ #-------------------
41
+ type_poscar = 'none'
42
+ poscar_in = open(poscar_backup_dir_path + '/' + file_in, "r")
43
+ for i in range(8): VTemp = poscar_in.readline().split()
44
+ if (VTemp[0][0] == 'D' or VTemp[0][0] == 'd'): type_poscar = 'direct'
45
+ if (VTemp[0][0] == 'C' or VTemp[0][0] == 'c'): type_poscar = 'cartesian'
46
+ if (VTemp[0][0] == 'S' or VTemp[0][0] == 's'): type_poscar = 'selective'
47
+ poscar_in.close()
48
+ #----------------
49
+
50
+ if (type_poscar != 'cartesian'): shutil.copy2(poscar_backup_dir_path + '/' + file_in, poscar_dir_path + '/' + file_in)
51
+
52
+ if (type_poscar == 'cartesian'):
53
+ #-------------------------------------------------------------
54
+ poscar_in = open(poscar_backup_dir_path + '/' + file_in, "r")
55
+ poscar_out = open(poscar_dir_path + '/' + file_in, "w")
56
+ #------------------------------------------------------
57
+ VTemp = poscar_in.readline()
58
+ poscar_out.write(f'{VTemp}')
59
+ #------------------------------------------------------------
60
+ VTemp = poscar_in.readline().split(); param = float(VTemp[0])
61
+ poscar_out.write(f'1.0 \n')
62
+ #-----------------------------------
63
+ VTemp = poscar_in.readline().split()
64
+ A1x = float(VTemp[0])*param
65
+ A1y = float(VTemp[1])*param
66
+ A1z = float(VTemp[2])*param
67
+ poscar_out.write(f'{A1x:.16} {A1y:.16} {A1z:.16} \n')
68
+ #----------------------------------------------------
69
+ VTemp = poscar_in.readline().split()
70
+ A2x = float(VTemp[0])*param
71
+ A2y = float(VTemp[1])*param
72
+ A2z = float(VTemp[2])*param
73
+ poscar_out.write(f'{A2x:.16} {A2y:.16} {A2z:.16} \n')
74
+ #----------------------------------------------------
75
+ VTemp = poscar_in.readline().split()
76
+ A3x = float(VTemp[0])*param
77
+ A3y = float(VTemp[1])*param
78
+ A3z = float(VTemp[2])*param
79
+ poscar_out.write(f'{A3x:.16} {A3y:.16} {A3z:.16} \n')
80
+ #----------------------------------------------------
81
+ VTemp = poscar_in.readline()
82
+ poscar_out.write(f'{VTemp}')
83
+ #---------------------------
84
+ nions = 0
85
+ VTemp = poscar_in.readline()
86
+ poscar_out.write(f'{VTemp}')
87
+ VTemp = VTemp.split()
88
+ for i in range(len(VTemp)): nions += int(VTemp[i])
89
+ #-------------------------------------------------
90
+ VTemp = poscar_in.readline()
91
+ poscar_out.write(f'Direct \n')
92
+ #-----------------------------
93
+ a = np.array([A1x, A1y, A1z])
94
+ b = np.array([A2x, A2y, A2z])
95
+ c = np.array([A3x, A3y, A3z])
96
+ T = np.linalg.inv(np.array([a, b, c]).T) # Defines the transformation matrix
97
+ #---------------------------------------
98
+ for i in range(nions):
99
+ #-----------------------------------
100
+ VTemp = poscar_in.readline().split()
101
+ x = float(VTemp[0])*param
102
+ y = float(VTemp[1])*param
103
+ z = float(VTemp[2])*param
104
+ #------------------------
105
+ r = np.array([x, y, z]) # Defines the Cartesian position of the atom
106
+ f = np.dot(T, r) # Calculates fractional position
107
+ f = f % 1.0
108
+ #-------------------------------------------------------
109
+ poscar_out.write(f'{f[0]:.16} {f[1]:.16} {f[2]:.16} \n')
110
+ #-----------------------------------------------------------
111
+ poscar_in.close()
112
+ poscar_out.close()
113
+ #-----------------
114
+
115
+ #===============================
116
+ os.rmdir(poscar_backup_dir_path)
117
+ #===============================
@@ -6,7 +6,7 @@ import json
6
6
 
7
7
  setup(
8
8
  name = "SAMBA_ilum",
9
- version = "1.0.0.541",
9
+ version = "1.0.0.543",
10
10
  entry_points={'console_scripts': ['samba_ilum = samba_ilum:main']},
11
11
  description = "...",
12
12
  author = "Augusto de Lelis Araujo",
@@ -1,35 +0,0 @@
1
- # SAMBA_ilum Copyright (C) 2025 - Closed source
2
-
3
-
4
- import os
5
-
6
- #===================================================
7
- # Getting the path and name of the current directory:
8
- path_dir, name_dir = os.path.split(os.getcwd())
9
- #===============================================
10
-
11
- if os.path.isfile('../energy_scan.txt'): energy = open('../energy_scan.txt', "a")
12
- else: energy = open('../energy_scan.txt', "w")
13
-
14
- with open('OSZICAR') as file:
15
- lines = file.readlines()
16
- VTemp = lines[-1].strip()
17
-
18
- energia = VTemp.replace('=',' ').split()
19
-
20
- energy.write(f'{name_dir} {energia[4]} \n')
21
-
22
- temp_name = name_dir.replace('_', ' ').split()
23
- t_temp_name = temp_name
24
- #------------------------
25
- if (len(temp_name) == 2):
26
- if (temp_name[0] == '0.0'): temp_name[0] = '1.0'
27
- if (temp_name[1] == '0.0'): temp_name[1] = '1.0'
28
- if (temp_name[0] == '1.0' or temp_name[1] == '1.0'):
29
- new_name_dir = str(temp_name[0]) + '_' + str(temp_name[1])
30
- energy.write(f'{new_name_dir} {energia[4]} \n')
31
- if (t_temp_name[0] == '1.0' and t_temp_name[1] == '1.0'):
32
- energy.write(f'1.0_0.0 {energia[4]} \n')
33
- energy.write(f'0.0_1.0 {energia[4]} \n')
34
-
35
- energy.close()
File without changes
File without changes