SAMBA-ilum 1.0.0.503__tar.gz → 1.0.0.505__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 (65) hide show
  1. {samba_ilum-1.0.0.503 → samba_ilum-1.0.0.505}/PKG-INFO +1 -1
  2. {samba_ilum-1.0.0.503 → samba_ilum-1.0.0.505}/SAMBA_ilum.egg-info/PKG-INFO +1 -1
  3. {samba_ilum-1.0.0.503 → samba_ilum-1.0.0.505}/samba_ilum/__main__.py +1 -1
  4. {samba_ilum-1.0.0.503 → samba_ilum-1.0.0.505}/samba_ilum/src/HeteroStructure_Generator.py +2 -2
  5. {samba_ilum-1.0.0.503 → samba_ilum-1.0.0.505}/samba_ilum/src/cell_check.py +68 -32
  6. {samba_ilum-1.0.0.503 → samba_ilum-1.0.0.505}/setup.py +1 -1
  7. {samba_ilum-1.0.0.503 → samba_ilum-1.0.0.505}/LICENSE.txt +0 -0
  8. {samba_ilum-1.0.0.503 → samba_ilum-1.0.0.505}/README.md +0 -0
  9. {samba_ilum-1.0.0.503 → samba_ilum-1.0.0.505}/SAMBA_ilum.egg-info/SOURCES.txt +0 -0
  10. {samba_ilum-1.0.0.503 → samba_ilum-1.0.0.505}/SAMBA_ilum.egg-info/dependency_links.txt +0 -0
  11. {samba_ilum-1.0.0.503 → samba_ilum-1.0.0.505}/SAMBA_ilum.egg-info/entry_points.txt +0 -0
  12. {samba_ilum-1.0.0.503 → samba_ilum-1.0.0.505}/SAMBA_ilum.egg-info/requires.txt +0 -0
  13. {samba_ilum-1.0.0.503 → samba_ilum-1.0.0.505}/SAMBA_ilum.egg-info/top_level.txt +0 -0
  14. {samba_ilum-1.0.0.503 → samba_ilum-1.0.0.505}/samba_ilum/__init__.py +0 -0
  15. {samba_ilum-1.0.0.503 → samba_ilum-1.0.0.505}/samba_ilum/src/BZ_2D.py +0 -0
  16. {samba_ilum-1.0.0.503 → samba_ilum-1.0.0.505}/samba_ilum/src/INPUTS/INCAR_a-scan +0 -0
  17. {samba_ilum-1.0.0.503 → samba_ilum-1.0.0.505}/samba_ilum/src/INPUTS/INCAR_bader +0 -0
  18. {samba_ilum-1.0.0.503 → samba_ilum-1.0.0.505}/samba_ilum/src/INPUTS/INCAR_bader.SO +0 -0
  19. {samba_ilum-1.0.0.503 → samba_ilum-1.0.0.505}/samba_ilum/src/INPUTS/INCAR_bands +0 -0
  20. {samba_ilum-1.0.0.503 → samba_ilum-1.0.0.505}/samba_ilum/src/INPUTS/INCAR_bands.SO +0 -0
  21. {samba_ilum-1.0.0.503 → samba_ilum-1.0.0.505}/samba_ilum/src/INPUTS/INCAR_dos +0 -0
  22. {samba_ilum-1.0.0.503 → samba_ilum-1.0.0.505}/samba_ilum/src/INPUTS/INCAR_dos.SO +0 -0
  23. {samba_ilum-1.0.0.503 → samba_ilum-1.0.0.505}/samba_ilum/src/INPUTS/INCAR_relax +0 -0
  24. {samba_ilum-1.0.0.503 → samba_ilum-1.0.0.505}/samba_ilum/src/INPUTS/INCAR_scf +0 -0
  25. {samba_ilum-1.0.0.503 → samba_ilum-1.0.0.505}/samba_ilum/src/INPUTS/INCAR_scf.SO +0 -0
  26. {samba_ilum-1.0.0.503 → samba_ilum-1.0.0.505}/samba_ilum/src/INPUTS/INCAR_xy-scan +0 -0
  27. {samba_ilum-1.0.0.503 → samba_ilum-1.0.0.505}/samba_ilum/src/INPUTS/INCAR_xyz-scan +0 -0
  28. {samba_ilum-1.0.0.503 → samba_ilum-1.0.0.505}/samba_ilum/src/INPUTS/INCAR_z-scan +0 -0
  29. {samba_ilum-1.0.0.503 → samba_ilum-1.0.0.505}/samba_ilum/src/INPUTS/SAMBA_HeteroStructure.input +0 -0
  30. {samba_ilum-1.0.0.503 → samba_ilum-1.0.0.505}/samba_ilum/src/INPUTS/SAMBA_WorkFlow.input +0 -0
  31. {samba_ilum-1.0.0.503 → samba_ilum-1.0.0.505}/samba_ilum/src/INPUTS/inputs_VASProcar/input.vasprocar.bands +0 -0
  32. {samba_ilum-1.0.0.503 → samba_ilum-1.0.0.505}/samba_ilum/src/INPUTS/inputs_VASProcar/input.vasprocar.chgcar +0 -0
  33. {samba_ilum-1.0.0.503 → samba_ilum-1.0.0.505}/samba_ilum/src/INPUTS/inputs_VASProcar/input.vasprocar.dos +0 -0
  34. {samba_ilum-1.0.0.503 → samba_ilum-1.0.0.505}/samba_ilum/src/INPUTS/inputs_VASProcar/input.vasprocar.location +0 -0
  35. {samba_ilum-1.0.0.503 → samba_ilum-1.0.0.505}/samba_ilum/src/INPUTS/inputs_VASProcar/input.vasprocar.locpot +0 -0
  36. {samba_ilum-1.0.0.503 → samba_ilum-1.0.0.505}/samba_ilum/src/INPUTS/inputs_VASProcar/input.vasprocar.orbitals +0 -0
  37. {samba_ilum-1.0.0.503 → samba_ilum-1.0.0.505}/samba_ilum/src/INPUTS/inputs_VASProcar/input.vasprocar.spin +0 -0
  38. {samba_ilum-1.0.0.503 → samba_ilum-1.0.0.505}/samba_ilum/src/INPUTS/vdw_kernel.bindat +0 -0
  39. {samba_ilum-1.0.0.503 → samba_ilum-1.0.0.505}/samba_ilum/src/_info_pseudo.py +0 -0
  40. {samba_ilum-1.0.0.503 → samba_ilum-1.0.0.505}/samba_ilum/src/a-scan.py +0 -0
  41. {samba_ilum-1.0.0.503 → samba_ilum-1.0.0.505}/samba_ilum/src/a-scan_analysis.py +0 -0
  42. {samba_ilum-1.0.0.503 → samba_ilum-1.0.0.505}/samba_ilum/src/bader +0 -0
  43. {samba_ilum-1.0.0.503 → samba_ilum-1.0.0.505}/samba_ilum/src/bader_poscar.py +0 -0
  44. {samba_ilum-1.0.0.503 → samba_ilum-1.0.0.505}/samba_ilum/src/bader_update.py +0 -0
  45. {samba_ilum-1.0.0.503 → samba_ilum-1.0.0.505}/samba_ilum/src/charge_transfer.py +0 -0
  46. {samba_ilum-1.0.0.503 → samba_ilum-1.0.0.505}/samba_ilum/src/chgsum.pl +0 -0
  47. {samba_ilum-1.0.0.503 → samba_ilum-1.0.0.505}/samba_ilum/src/contcar_update.py +0 -0
  48. {samba_ilum-1.0.0.503 → samba_ilum-1.0.0.505}/samba_ilum/src/data-base_json.py +0 -0
  49. {samba_ilum-1.0.0.503 → samba_ilum-1.0.0.505}/samba_ilum/src/data-base_union.py +0 -0
  50. {samba_ilum-1.0.0.503 → samba_ilum-1.0.0.505}/samba_ilum/src/energy_scan.py +0 -0
  51. {samba_ilum-1.0.0.503 → samba_ilum-1.0.0.505}/samba_ilum/src/hubbard_correction.py +0 -0
  52. {samba_ilum-1.0.0.503 → samba_ilum-1.0.0.505}/samba_ilum/src/job.py +0 -0
  53. {samba_ilum-1.0.0.503 → samba_ilum-1.0.0.505}/samba_ilum/src/kpoints.py +0 -0
  54. {samba_ilum-1.0.0.503 → samba_ilum-1.0.0.505}/samba_ilum/src/lattice_plot3d.py +0 -0
  55. {samba_ilum-1.0.0.503 → samba_ilum-1.0.0.505}/samba_ilum/src/make_files.py +0 -0
  56. {samba_ilum-1.0.0.503 → samba_ilum-1.0.0.505}/samba_ilum/src/output.py +0 -0
  57. {samba_ilum-1.0.0.503 → samba_ilum-1.0.0.505}/samba_ilum/src/potcar.py +0 -0
  58. {samba_ilum-1.0.0.503 → samba_ilum-1.0.0.505}/samba_ilum/src/vdW_DF.py +0 -0
  59. {samba_ilum-1.0.0.503 → samba_ilum-1.0.0.505}/samba_ilum/src/xy-scan.py +0 -0
  60. {samba_ilum-1.0.0.503 → samba_ilum-1.0.0.505}/samba_ilum/src/xy-scan_analysis.py +0 -0
  61. {samba_ilum-1.0.0.503 → samba_ilum-1.0.0.505}/samba_ilum/src/xyz-scan.py +0 -0
  62. {samba_ilum-1.0.0.503 → samba_ilum-1.0.0.505}/samba_ilum/src/xyz-scan_analysis.py +0 -0
  63. {samba_ilum-1.0.0.503 → samba_ilum-1.0.0.505}/samba_ilum/src/z-scan.py +0 -0
  64. {samba_ilum-1.0.0.503 → samba_ilum-1.0.0.505}/samba_ilum/src/z-scan_analysis.py +0 -0
  65. {samba_ilum-1.0.0.503 → samba_ilum-1.0.0.505}/setup.cfg +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: SAMBA_ilum
3
- Version: 1.0.0.503
3
+ Version: 1.0.0.505
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.503
3
+ Version: 1.0.0.505
4
4
  Summary: ...
5
5
  Author: Augusto de Lelis Araujo
6
6
  Author-email: augusto-lelis@outlook.com
@@ -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.503'
19
+ version = '1.0.0.505'
20
20
 
21
21
  print(" ")
22
22
  print("=============================================================")
@@ -1647,8 +1647,8 @@ for s in range(len(files0)):
1647
1647
  for i in range(len(files)):
1648
1648
  #--------------------------
1649
1649
  structure = Poscar.from_file(diret2 + files0[s] + '/' + files[i]).structure # Lendo o arquivo POSCAR
1650
- matcher = StructureMatcher() # Criando um objeto StructureMatcher
1651
- reduced_structure = matcher._get_reduced_structure(structure) # Obtendo a correspondente célula unitária reduzida
1650
+ matcher = StructureMatcher() # Criando um objeto StructureMatcher
1651
+ reduced_structure = matcher._get_reduced_structure(structure) # Obtendo a correspondente célula unitária reduzida
1652
1652
  Poscar(reduced_structure).write_file(diret2 + files0[s] + '/' + 'temp_' + str(i+1) + '.vasp')
1653
1653
 
1654
1654
  poscar1 = open(diret2 + files0[s] + '/' + files[i], "r")
@@ -6,6 +6,7 @@ print("Espere um momento ================")
6
6
  print("==================================")
7
7
  print("")
8
8
 
9
+
9
10
  from pymatgen.io.vasp import Poscar
10
11
  from pymatgen.core import Structure
11
12
  from pymatgen.analysis.structure_matcher import StructureMatcher
@@ -22,9 +23,9 @@ poscar_dir_path = os.path.join(dir_files, dir_poscar)
22
23
  files0 = [name for name in os.listdir(poscar_dir_path) if os.path.isfile(os.path.join(poscar_dir_path, name))]
23
24
 
24
25
 
25
- #---------------------------------------------------
26
- # Testando a compatibilidade dos arquivos POSCAR ---
27
- #---------------------------------------------------
26
+ #===================================================
27
+ # Testando a compatibilidade dos arquivos POSCAR ===
28
+ #===================================================
28
29
  A1x0 = []; A1y0 = []; A2x0 = []; A2y0 = []
29
30
  #--------------------------------------------
30
31
  for k in range(len(files0)):
@@ -53,28 +54,62 @@ for k in range(len(files0)):
53
54
  print(f'A3 = [0.0, 0.0, A3z]')
54
55
  print(f'========================================')
55
56
  print(f' ')
56
- #=============
57
+ #-------------
57
58
  poscar.close()
58
59
  sys.exit()
59
- #=============
60
+ #-------------
60
61
  poscar.close()
61
- #=============
62
+ #-------------
63
+
62
64
 
63
- #------------
64
- stop_code = 0
65
- #------------
65
+ #=====================================================================
66
+ # Testando se os arquivos POSCAR correspondem há células unitárias ===
67
+ #=====================================================================
68
+ supercell_files = []
69
+ #-------------------------
70
+ for filename in files0:
71
+ poscar_path = os.path.join(poscar_dir_path, filename)
72
+ try:
73
+ original_structure = Structure.from_file(poscar_path)
74
+ primitive_structure = original_structure.get_primitive_structure()
75
+ if (len(original_structure) > len(primitive_structure)): supercell_files.append(filename)
76
+ except Exception as e: print(f"Aviso: Não foi possível analisar o arquivo '{filename}'.")
77
+ #----------------------------
78
+ if (len(supercell_files) > 0):
79
+ print(f'========================================')
80
+ print(f'Verifique os arquivos POSCAR utilizados!')
81
+ print(f'Foram identificadas as seguinte células não-unitárias: {supercell_files}')
82
+ print(f'----------------------------------------')
83
+ print(f'Deseja prosseguir com estes arquivos? ')
84
+ print(f'Digite: [0] para NÃO e [1] para SIM ')
85
+ print(f'========================================')
86
+ print(f' ')
87
+ selected_option = input(" "); selected_option = int(selected_option)
88
+ if (selected_option != 1): sys.exit()
89
+ #------------------------------------
90
+
91
+
92
+ #======================================================
93
+ # Chegando/Corrigindo o eixo de rotação das células ===
94
+ #======================================================
95
+ axis_correction = 0
96
+ #------------------
66
97
  for name in files0:
67
98
  Lattice = os.path.join(poscar_dir_path, name)
68
-
99
+ #--------------------------------------------
100
+ poscar = open(Lattice, 'r')
101
+ VTemp = poscar.readline(); VTemp = str(VTemp)
102
+ poscar.close()
103
+ #-------------
69
104
  try:
70
105
  estrutura = Structure.from_file(Lattice)
71
106
  sga = SpacegroupAnalyzer(estrutura, symprec=1e-3)
72
107
  operacoes_0 = sga.get_symmetry_operations()
73
108
  operacoes_1 = sga.get_symmetry_operations(cartesian=True)
74
-
109
+ #-------------
75
110
  angulos_z = []
76
111
  angulos_z_na_origem = []
77
- # =========================================================
112
+ #--------------------------------------------------
78
113
  # Loop 1: Encontra todos os ângulos de rotação em Z
79
114
  for op in operacoes_0:
80
115
  R = op.rotation_matrix
@@ -88,7 +123,7 @@ for name in files0:
88
123
  angle_deg = round(np.degrees(angle), 4)
89
124
  if 0.1 < angle_deg < 360.0 and angle_deg not in angulos_z:
90
125
  angulos_z.append(angle_deg)
91
- # =========================================================
126
+ #--------------------------------------------------
92
127
  # Loop 2: Encontra rotações em Z que fixam a origem
93
128
  z = np.array([0, 0, 1])
94
129
  for op in operacoes_1:
@@ -102,34 +137,33 @@ for name in files0:
102
137
  angle_deg = round(np.degrees(angle), 4)
103
138
  if 0.1 < angle_deg < 360.0 and angle_deg not in angulos_z_na_origem:
104
139
  angulos_z_na_origem.append(angle_deg)
105
- # =========================================================
106
-
140
+ #------------------------------------------------
107
141
  temp_name = name.replace('_',' ').split()
108
142
  menor_0 = min(angulos_z) if angulos_z else 0.0
109
143
  menor_1 = min(angulos_z_na_origem) if angulos_z_na_origem else 0.0
110
-
144
+ #----------------------------------------------------------
111
145
  # Se houver diferença, calcula, corrige e salva o new file.
112
146
  if (menor_0 != menor_1 and menor_0 != 0.0):
113
- stop_code += 1
114
-
147
+ axis_correction += 1
148
+ #--------------------------------------------------------------
115
149
  # 1. Definindo os diretórios de backup e criando se necessário
116
150
  backup_dir = os.path.join(dir_files, 'POSCAR_original')
117
151
  os.makedirs(backup_dir, exist_ok=True)
118
-
152
+ #---------------------------------------------------------
119
153
  # 2. Definindo os caminhos do arquivo original e do backup
120
154
  original_filepath = os.path.join(poscar_dir_path, name)
121
155
  backup_filepath = os.path.join(backup_dir, name)
122
-
156
+ #-----------------------------------------------------
123
157
  # 3. Movendo o arquivo original para a pasta de backup
124
158
  shutil.move(original_filepath, backup_filepath)
125
-
126
- if (stop_code == 1):
159
+ #----------------------------------------------
160
+ if (axis_correction == 1):
127
161
  print(" ")
128
162
  print(f"-------------------------------------------------------------")
129
-
130
163
  print(f"POSCAR file: {name}")
131
164
  print(f"Discrepância encontrada em relação ao ângulo de rotação em torno do eixo Z")
132
165
  print(f"Min. Rotation Angle: {int(menor_0)}º / Angle at Origin: {int(menor_1)}º")
166
+ #-------------
133
167
  op_alvo = None
134
168
  for op_cart in operacoes_1:
135
169
  R_cart = op_cart.rotation_matrix
@@ -140,34 +174,36 @@ for name in files0:
140
174
  if np.isclose(np.degrees(np.arccos(cos_theta_3d)), menor_0, atol=1e-4):
141
175
  op_alvo = op_cart
142
176
  break
143
-
177
+ #------------
144
178
  if op_alvo:
145
179
  R = op_alvo.rotation_matrix
146
180
  t = op_alvo.translation_vector
147
181
  celula = estrutura.lattice.matrix.T
148
-
182
+ #----------------------------------
149
183
  try:
150
184
  M = R - np.eye(3)
151
185
  p_cart, *_ = np.linalg.lstsq(M, -t, rcond=None)
152
186
  p_direto = np.linalg.solve(celula, p_cart)
153
-
187
+ #--------------------------------------------------------------
154
188
  deslocamento_frac = np.array([-p_direto[0], -p_direto[1], 0.0])
155
189
  print(f"Coordenadas diretas do eixo de rotação apropriado: ({p_direto[0]:.9f}, {p_direto[1]:.9f})")
156
190
  print(f"Movendo arquivo original para a pasta 'POSCAR_original' e criando versão corrigida.")
157
-
191
+ #------------------------------------
158
192
  estrutura_corrigida = estrutura.copy()
159
193
  indices_dos_sites = list(range(len(estrutura_corrigida)))
160
194
  estrutura_corrigida.translate_sites(indices_dos_sites, deslocamento_frac, frac_coords=True)
161
-
195
+ #----------------------------------------------------------------------
162
196
  # Salvar o arquivo corrigido com o nome_original no diretório original.
163
197
  Lattice_new_file = os.path.join(poscar_dir_path, name)
164
198
  estrutura_corrigida.to(fmt="poscar", filename=Lattice_new_file)
165
-
166
199
  print(f"-------------------------------------------------------------")
167
-
168
200
  except np.linalg.LinAlgError:
169
201
  print("ERRO: Não foi possível calcular o deslocamento devido a um erro numérico.")
170
-
202
+ #-------------------------------------------------------
203
+ with open(Lattice, 'r') as file: line = file.readlines()
204
+ line[0] = VTemp
205
+ with open(Lattice, 'w') as file: file.writelines(line)
206
+ #---------------------
171
207
  except Exception as e:
172
208
  print(f"Erro Crítico ao processar o file {name}: {e}")
173
- if (stop_code > 0): sys.exit()
209
+ if (axis_correction > 0): sys.exit()
@@ -6,7 +6,7 @@ import json
6
6
 
7
7
  setup(
8
8
  name = "SAMBA_ilum",
9
- version = "1.0.0.503",
9
+ version = "1.0.0.505",
10
10
  entry_points={'console_scripts': ['samba_ilum = samba_ilum:main']},
11
11
  description = "...",
12
12
  author = "Augusto de Lelis Araujo",
File without changes
File without changes