SAMBA-ilum 1.0.0.403__tar.gz → 1.0.0.404__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.403 → samba_ilum-1.0.0.404}/PKG-INFO +1 -1
  2. {samba_ilum-1.0.0.403 → samba_ilum-1.0.0.404}/SAMBA_ilum.egg-info/PKG-INFO +1 -1
  3. {samba_ilum-1.0.0.403 → samba_ilum-1.0.0.404}/SAMBA_ilum.egg-info/SOURCES.txt +1 -0
  4. {samba_ilum-1.0.0.403 → samba_ilum-1.0.0.404}/samba_ilum/__main__.py +1 -1
  5. samba_ilum-1.0.0.404/samba_ilum/src/data-base_json.py +844 -0
  6. {samba_ilum-1.0.0.403 → samba_ilum-1.0.0.404}/samba_ilum/src/output.py +6 -18
  7. {samba_ilum-1.0.0.403 → samba_ilum-1.0.0.404}/samba_ilum/src/xy-scan_analysis.py +3 -6
  8. {samba_ilum-1.0.0.403 → samba_ilum-1.0.0.404}/samba_ilum/src/xyz-scan_analysis.py +2 -2
  9. {samba_ilum-1.0.0.403 → samba_ilum-1.0.0.404}/samba_ilum/src/z-scan_analysis.py +1 -1
  10. {samba_ilum-1.0.0.403 → samba_ilum-1.0.0.404}/setup.py +1 -1
  11. {samba_ilum-1.0.0.403 → samba_ilum-1.0.0.404}/LICENSE.txt +0 -0
  12. {samba_ilum-1.0.0.403 → samba_ilum-1.0.0.404}/README.md +0 -0
  13. {samba_ilum-1.0.0.403 → samba_ilum-1.0.0.404}/SAMBA_ilum.egg-info/dependency_links.txt +0 -0
  14. {samba_ilum-1.0.0.403 → samba_ilum-1.0.0.404}/SAMBA_ilum.egg-info/entry_points.txt +0 -0
  15. {samba_ilum-1.0.0.403 → samba_ilum-1.0.0.404}/SAMBA_ilum.egg-info/requires.txt +0 -0
  16. {samba_ilum-1.0.0.403 → samba_ilum-1.0.0.404}/SAMBA_ilum.egg-info/top_level.txt +0 -0
  17. {samba_ilum-1.0.0.403 → samba_ilum-1.0.0.404}/samba_ilum/__init__.py +0 -0
  18. {samba_ilum-1.0.0.403 → samba_ilum-1.0.0.404}/samba_ilum/src/HeteroStructure_Generator.py +0 -0
  19. {samba_ilum-1.0.0.403 → samba_ilum-1.0.0.404}/samba_ilum/src/INPUTS/INCAR_a-scan +0 -0
  20. {samba_ilum-1.0.0.403 → samba_ilum-1.0.0.404}/samba_ilum/src/INPUTS/INCAR_bader +0 -0
  21. {samba_ilum-1.0.0.403 → samba_ilum-1.0.0.404}/samba_ilum/src/INPUTS/INCAR_bader.SO +0 -0
  22. {samba_ilum-1.0.0.403 → samba_ilum-1.0.0.404}/samba_ilum/src/INPUTS/INCAR_bands +0 -0
  23. {samba_ilum-1.0.0.403 → samba_ilum-1.0.0.404}/samba_ilum/src/INPUTS/INCAR_bands.SO +0 -0
  24. {samba_ilum-1.0.0.403 → samba_ilum-1.0.0.404}/samba_ilum/src/INPUTS/INCAR_dos +0 -0
  25. {samba_ilum-1.0.0.403 → samba_ilum-1.0.0.404}/samba_ilum/src/INPUTS/INCAR_dos.SO +0 -0
  26. {samba_ilum-1.0.0.403 → samba_ilum-1.0.0.404}/samba_ilum/src/INPUTS/INCAR_relax +0 -0
  27. {samba_ilum-1.0.0.403 → samba_ilum-1.0.0.404}/samba_ilum/src/INPUTS/INCAR_scf +0 -0
  28. {samba_ilum-1.0.0.403 → samba_ilum-1.0.0.404}/samba_ilum/src/INPUTS/INCAR_scf.SO +0 -0
  29. {samba_ilum-1.0.0.403 → samba_ilum-1.0.0.404}/samba_ilum/src/INPUTS/INCAR_xy-scan +0 -0
  30. {samba_ilum-1.0.0.403 → samba_ilum-1.0.0.404}/samba_ilum/src/INPUTS/INCAR_xyz-scan +0 -0
  31. {samba_ilum-1.0.0.403 → samba_ilum-1.0.0.404}/samba_ilum/src/INPUTS/INCAR_z-scan +0 -0
  32. {samba_ilum-1.0.0.403 → samba_ilum-1.0.0.404}/samba_ilum/src/INPUTS/SAMBA_HeteroStructure.input +0 -0
  33. {samba_ilum-1.0.0.403 → samba_ilum-1.0.0.404}/samba_ilum/src/INPUTS/SAMBA_WorkFlow.input +0 -0
  34. {samba_ilum-1.0.0.403 → samba_ilum-1.0.0.404}/samba_ilum/src/INPUTS/inputs_VASProcar/input.vasprocar.bands +0 -0
  35. {samba_ilum-1.0.0.403 → samba_ilum-1.0.0.404}/samba_ilum/src/INPUTS/inputs_VASProcar/input.vasprocar.chgcar +0 -0
  36. {samba_ilum-1.0.0.403 → samba_ilum-1.0.0.404}/samba_ilum/src/INPUTS/inputs_VASProcar/input.vasprocar.dos +0 -0
  37. {samba_ilum-1.0.0.403 → samba_ilum-1.0.0.404}/samba_ilum/src/INPUTS/inputs_VASProcar/input.vasprocar.location +0 -0
  38. {samba_ilum-1.0.0.403 → samba_ilum-1.0.0.404}/samba_ilum/src/INPUTS/inputs_VASProcar/input.vasprocar.locpot +0 -0
  39. {samba_ilum-1.0.0.403 → samba_ilum-1.0.0.404}/samba_ilum/src/INPUTS/inputs_VASProcar/input.vasprocar.orbitals +0 -0
  40. {samba_ilum-1.0.0.403 → samba_ilum-1.0.0.404}/samba_ilum/src/INPUTS/inputs_VASProcar/input.vasprocar.spin +0 -0
  41. {samba_ilum-1.0.0.403 → samba_ilum-1.0.0.404}/samba_ilum/src/INPUTS/vdw_kernel.bindat +0 -0
  42. {samba_ilum-1.0.0.403 → samba_ilum-1.0.0.404}/samba_ilum/src/OLD/a-scan.py +0 -0
  43. {samba_ilum-1.0.0.403 → samba_ilum-1.0.0.404}/samba_ilum/src/OLD/a-scan_analysis.py +0 -0
  44. {samba_ilum-1.0.0.403 → samba_ilum-1.0.0.404}/samba_ilum/src/OLD/job.py +0 -0
  45. {samba_ilum-1.0.0.403 → samba_ilum-1.0.0.404}/samba_ilum/src/OLD/z-scan.py +0 -0
  46. {samba_ilum-1.0.0.403 → samba_ilum-1.0.0.404}/samba_ilum/src/OLD/z-scan_analysis.py +0 -0
  47. {samba_ilum-1.0.0.403 → samba_ilum-1.0.0.404}/samba_ilum/src/_info_pseudo.py +0 -0
  48. {samba_ilum-1.0.0.403 → samba_ilum-1.0.0.404}/samba_ilum/src/a-scan.py +0 -0
  49. {samba_ilum-1.0.0.403 → samba_ilum-1.0.0.404}/samba_ilum/src/a-scan_analysis.py +0 -0
  50. {samba_ilum-1.0.0.403 → samba_ilum-1.0.0.404}/samba_ilum/src/bader +0 -0
  51. {samba_ilum-1.0.0.403 → samba_ilum-1.0.0.404}/samba_ilum/src/bader_poscar.py +0 -0
  52. {samba_ilum-1.0.0.403 → samba_ilum-1.0.0.404}/samba_ilum/src/bader_update.py +0 -0
  53. {samba_ilum-1.0.0.403 → samba_ilum-1.0.0.404}/samba_ilum/src/charge_transfer.py +0 -0
  54. {samba_ilum-1.0.0.403 → samba_ilum-1.0.0.404}/samba_ilum/src/chgsum.pl +0 -0
  55. {samba_ilum-1.0.0.403 → samba_ilum-1.0.0.404}/samba_ilum/src/contcar_update.py +0 -0
  56. /samba_ilum-1.0.0.403/samba_ilum/src/data-base_json.py → /samba_ilum-1.0.0.404/samba_ilum/src/data-base_json [backup].py +0 -0
  57. {samba_ilum-1.0.0.403 → samba_ilum-1.0.0.404}/samba_ilum/src/data-base_union.py +0 -0
  58. {samba_ilum-1.0.0.403 → samba_ilum-1.0.0.404}/samba_ilum/src/energy_scan.py +0 -0
  59. {samba_ilum-1.0.0.403 → samba_ilum-1.0.0.404}/samba_ilum/src/job.py +0 -0
  60. {samba_ilum-1.0.0.403 → samba_ilum-1.0.0.404}/samba_ilum/src/kpoints.py +0 -0
  61. {samba_ilum-1.0.0.403 → samba_ilum-1.0.0.404}/samba_ilum/src/lattice_plot3d.py +0 -0
  62. {samba_ilum-1.0.0.403 → samba_ilum-1.0.0.404}/samba_ilum/src/make_files.py +0 -0
  63. {samba_ilum-1.0.0.403 → samba_ilum-1.0.0.404}/samba_ilum/src/potcar.py +0 -0
  64. {samba_ilum-1.0.0.403 → samba_ilum-1.0.0.404}/samba_ilum/src/vdW_DF.py +0 -0
  65. {samba_ilum-1.0.0.403 → samba_ilum-1.0.0.404}/samba_ilum/src/xy-scan.py +0 -0
  66. {samba_ilum-1.0.0.403 → samba_ilum-1.0.0.404}/samba_ilum/src/xyz-scan.py +0 -0
  67. {samba_ilum-1.0.0.403 → samba_ilum-1.0.0.404}/samba_ilum/src/z-scan.py +0 -0
  68. {samba_ilum-1.0.0.403 → samba_ilum-1.0.0.404}/setup.cfg +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: SAMBA_ilum
3
- Version: 1.0.0.403
3
+ Version: 1.0.0.404
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.403
3
+ Version: 1.0.0.404
4
4
  Summary: ...
5
5
  Author: Augusto de Lelis Araujo
6
6
  Author-email: augusto-lelis@outlook.com
@@ -20,6 +20,7 @@ samba_ilum/src/bader_update.py
20
20
  samba_ilum/src/charge_transfer.py
21
21
  samba_ilum/src/chgsum.pl
22
22
  samba_ilum/src/contcar_update.py
23
+ samba_ilum/src/data-base_json [backup].py
23
24
  samba_ilum/src/data-base_json.py
24
25
  samba_ilum/src/data-base_union.py
25
26
  samba_ilum/src/energy_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.403'
19
+ version = '1.0.0.404'
20
20
 
21
21
  print(" ")
22
22
  print("=============================================================")
@@ -0,0 +1,844 @@
1
+ # SAMBA_ilum Copyright (C) 2024 - Closed source
2
+
3
+ from pymatgen.io.vasp import Poscar
4
+ from pymatgen.core import Structure
5
+ from pymatgen.symmetry.analyzer import SpacegroupAnalyzer
6
+ #--------------------------------------------------------
7
+ import numpy as np
8
+ import shutil
9
+ import json
10
+ import uuid
11
+ import sys
12
+ import os
13
+
14
+
15
+ pseudo_type = 'PAW_PBE'
16
+ exchange_correlation_functional = 'GGA'
17
+ vdW = 'optB86b'
18
+
19
+
20
+ # replace_type_pseudo
21
+ # replace_type_XC
22
+ # replace_type_vdW
23
+
24
+
25
+ # =========================================
26
+ # Verificando arquivos da sereme lidos: ===
27
+ # =========================================
28
+ l_file = 'null'; l_file_SO = 'null'
29
+ if os.path.isfile('output/info_scf.txt'): l_file = 'info_scf.txt'
30
+ if os.path.isfile('output/info_bands.txt'): l_file = 'info_bands.txt'
31
+ if os.path.isfile('output/info_scf_SO.txt'): l_file_SO = 'info_scf_SO.txt'
32
+ if os.path.isfile('output/info_bands_SO.txt'): l_file_SO = 'info_bands_SO.txt'
33
+ if (l_file == 'null' and l_file_SO == 'null'): sys.exit(0)
34
+
35
+
36
+ # =========================================================
37
+ # Extraindo o k-path para o plot da Estrutura de Bandas ===
38
+ # =========================================================
39
+ kpoints_file = []
40
+ kpath = []
41
+ #---------
42
+ if os.path.isdir('output/Bandas'): dir_kpath = 'bands'
43
+ if os.path.isdir('output/Bandas.SO'): dir_kpath = 'bands.SO'
44
+ #-----------------------------------------------------------
45
+ if os.path.isfile(dir_kpath + '/' + 'KPOINTS'): kpoints_file.append('KPOINTS')
46
+ #-------------------
47
+ for i in range(100):
48
+ file = 'KPOINTS.' + str(i+1)
49
+ if os.path.isfile(dir_kpath + '/' + file): kpoints_file.append(file)
50
+ #---------------------------------
51
+ for i in range(len(kpoints_file)):
52
+ #-----------------------------
53
+ with open(dir_kpath + '/' + kpoints_file[i], 'r') as file: lines = file.readlines()
54
+ #----------------------------------------------------------------------------------
55
+ if (len(kpoints_file) == 1):
56
+ for j in range(len(lines)):
57
+ if (j > 3 and len(lines[j]) > 1):
58
+ line = lines[j].split()
59
+ line[3] = line[3].replace('!', '').replace('#1', 'Gamma').replace('#', '')
60
+ kpath.append([float(line[0]), float(line[1]), float(line[2]), str(line[3])])
61
+ #-------------------------------------------------------------------------------------
62
+ if (len(kpoints_file) > 1):
63
+ for j in range(len(lines)):
64
+ if (i == 0 and j > 3 and len(lines[j]) > 1):
65
+ line = lines[j].split()
66
+ line[3] = line[3].replace('!', '').replace('#1', 'Gamma').replace('#', '')
67
+ kpath.append([float(line[0]), float(line[1]), float(line[2]), str(line[3])])
68
+ if (i > 0 and j > 4 and len(lines[j]) > 1):
69
+ line = lines[j].split()
70
+ line[3] = line[3].replace('!', '').replace('#1', 'Gamma').replace('#', '')
71
+ kpath.append([float(line[0]), float(line[1]), float(line[2]), str(line[3])])
72
+ #----------------------------------------------------------
73
+ # Removendo elementos adjacentes e repetidos da lista kpath
74
+ #----------------------------------------------------------
75
+ i = 0
76
+ while i < (len(kpath) -1):
77
+ if kpath[i] == kpath[i +1]: del kpath[i +1]
78
+ else: i += 1 # Avança para o próximo par de elementos
79
+
80
+
81
+ # ===================================================
82
+ # Iniciando tags com valores vazios "--" ============
83
+ # ===================================================
84
+ area_perc_mismatch = '--'; perc_area_change = '--'; perc_mod_vectors_change = '--';
85
+ angle_perc_mismatch = '--'; perc_angle_change = '--'; rotation_angle = '--';
86
+ supercell_matrix = '--'; deformation_matrix = '--'; strain_matrix = '--'
87
+ shift_plane = '--'
88
+
89
+ # ============================================================
90
+ # Extraindo informações de configuração da Heteroestrutura ===
91
+ # ============================================================
92
+ if os.path.isfile('output/POSCAR.info'):
93
+ #---------------------------------------
94
+ poscar = open('output/POSCAR.info', "r")
95
+ VTemp = poscar.readline().split()
96
+ param = float(poscar.readline())
97
+ poscar.close()
98
+ #------------------------
99
+ if (VTemp[0] == 'SAMBA'):
100
+ #----------------------------------------------------------------
101
+ l_materials = VTemp[1].replace('+', ' ').replace('_', '').split()
102
+ n_materials = len(l_materials)
103
+ #------------------------------------------
104
+ r_ions_materials = []; nions_materials = []
105
+ nion = 0; passo = 0
106
+ #-----------------------------
107
+ for m in range(n_materials):
108
+ r_ions_materials.append( str(1 + nion) + ':')
109
+ nion += int(VTemp[m+2])
110
+ r_ions_materials[m] += str(nion)
111
+ nions_materials.append(int(VTemp[m+2]))
112
+ #------------------------------------------
113
+ id_materials = []
114
+ #--------------------
115
+
116
+
117
+ if (n_materials > 1):
118
+ #----------------------------------------------------------------------
119
+ area_perc_mismatch = []; angle_perc_mismatch = []; rotation_angle = []
120
+ perc_area_change = []; perc_mod_vectors_change = []; perc_angle_change = []
121
+ supercell_matrix = []; deformation_matrix = []; strain_matrix = []
122
+ shift_plane = []
123
+ #---------------------
124
+ passo = n_materials +1
125
+ passo += 4
126
+ temp1 = str(VTemp[passo]).replace('_', ' ').split()
127
+ area_perc_mismatch.append([float(temp1[0]), float(temp1[1])])
128
+ if (n_materials == 3):
129
+ area_perc_mismatch.append([float(temp1[2]), float(temp1[3])])
130
+ #---------------------------------------------------------------
131
+ passo += 4
132
+ temp1 = str(VTemp[passo]).replace('_', ' ').split()
133
+ for ii in range(len(temp1)): perc_area_change.append(float(temp1[ii]))
134
+ #---------------------------------------------------------------------
135
+ passo += 4
136
+ temp1 = str(VTemp[passo]).replace('_', ' ').split()
137
+ perc_mod_vectors_change.append([float(temp1[0]), float(temp1[1])])
138
+ perc_mod_vectors_change.append([float(temp1[2]), float(temp1[3])])
139
+ if (n_materials == 3):
140
+ perc_mod_vectors_change.append([float(temp1[4]), float(temp1[5])])
141
+ #--------------------------------------------------------------------
142
+ passo += 4
143
+ temp1 = str(VTemp[passo]).replace('_', ' ').split()
144
+ angle_perc_mismatch.append([float(temp1[0]), float(temp1[1])])
145
+ if (n_materials == 3):
146
+ angle_perc_mismatch.append([float(temp1[2]), float(temp1[3])])
147
+ #----------------------------------------------------------------
148
+ passo += 4
149
+ temp1 = str(VTemp[passo]).replace('_', ' ').split()
150
+ for ii in range(len(temp1)): perc_angle_change.append(float(temp1[ii]))
151
+ #----------------------------------------------------------------------
152
+ passo += 4
153
+ temp1 = str(VTemp[passo]).replace('_', ' ').split()
154
+ for ii in range(len(temp1)): rotation_angle.append(float(temp1[ii]))
155
+ #-------------------------------------------------------------------
156
+ for i in range(n_materials):
157
+ passo += 4
158
+ temp1 = str(VTemp[passo]).replace('_', ' ').split()
159
+ supercell_matrix.append([[int(temp1[0]), int(temp1[1])], [int(temp1[2]), int(temp1[3])]])
160
+ #--------------------------------------------------------------------------------------------
161
+ for i in range(n_materials):
162
+ passo += 4
163
+ temp1 = str(VTemp[passo]).replace('_', ' ').split()
164
+ deformation_matrix.append([[float(temp1[0]), float(temp1[1])], [float(temp1[2]), float(temp1[3])]])
165
+ #------------------------------------------------------------------------------------------------------
166
+ for i in range(n_materials):
167
+ passo += 4
168
+ temp1 = str(VTemp[passo]).replace('_', ' ').split()
169
+ strain_matrix.append([[float(temp1[0]), float(temp1[1])], [float(temp1[2]), float(temp1[3])]])
170
+ #-------------------------------------------------------------------------------------------------
171
+ passo += 4
172
+ temp1 = str(VTemp[passo]).replace('_', ' ').split()
173
+ for ii in range(len(temp1)): shift_plane.append(float(temp1[ii]))
174
+ #----------------------------------------------------------------
175
+ passo += 1
176
+ for i in range(n_materials):
177
+ id_materials.append(str(VTemp[-n_materials -1 +i]))
178
+ #--------------------------------------------
179
+ temp_id = VTemp[-1].replace('_', ' ').split()
180
+ if (len(temp_id) > 1): estequiometria = temp_id[0]
181
+ id_code = VTemp[-1]
182
+ #-------------------------------------------------------
183
+ if (n_materials == 1): id_materials.append(str(id_code))
184
+ #-------------------------------------------------------
185
+ if (VTemp[0] != 'SAMBA'): exit()
186
+ #-------------------------------
187
+
188
+
189
+ # ============================================================
190
+ # Extraindo informações de configuração da Heteroestrutura ===
191
+ # ============================================================
192
+ poscar = open('output/POSCAR.info', "r")
193
+ VTemp = poscar.readline().split()
194
+ materials = VTemp[1].replace('+', ' ').split()
195
+ #---------------------------------------------
196
+ t_ions_materials = []
197
+ for i in range(len(materials)):
198
+ ions_vector = []
199
+ mat_temp = materials[i].replace('_', ' ').split()
200
+ for j in range(len(mat_temp)):
201
+ ions_vector.append(str(mat_temp[j]))
202
+ t_ions_materials.append(ions_vector)
203
+ #-------------------------------------------
204
+ for i in range(6): VTemp = poscar.readline().split()
205
+ t_nions_materials = []; number = -1
206
+ for i in range(len(materials)):
207
+ nions_vector = []
208
+ mat_temp = materials[i].replace('_', ' ').split()
209
+ for j in range(len(mat_temp)):
210
+ number += 1
211
+ nions_vector.append(int(VTemp[number]))
212
+ t_nions_materials.append(nions_vector)
213
+ #-------------
214
+ poscar.close()
215
+ #-------------
216
+
217
+
218
+ # ==========================================
219
+ # Extraindo as posições dos ions da Rede ===
220
+ # ==========================================
221
+ poscar = open('output/CONTCAR', "r")
222
+ for i in range(5): VTemp = poscar.readline()
223
+ type_ions = poscar.readline().split()
224
+ type_ions_n = poscar.readline().split()
225
+ poscar.readline()
226
+ coord_ions = []
227
+ for i in range(len(type_ions)):
228
+ for j in range(int(type_ions_n[i])):
229
+ VTemp = poscar.readline().split()
230
+ coord_ions.append([ str(type_ions[i]), float(VTemp[0]), float(VTemp[1]), float(VTemp[2]) ])
231
+ poscar.close()
232
+
233
+
234
+ # ========================================================
235
+ # Extraindo as espessuras e separação do(s) materiais ====
236
+ # ========================================================
237
+ thickness = []; temp_z = []; z_separation = []
238
+ #----------------------------------------------
239
+ poscar = open('output/POSCAR.info', "r")
240
+ for i in range(8): VTemp = poscar.readline()
241
+ for i in range(nion):
242
+ VTemp = poscar.readline().split()
243
+ temp_z.append(float(VTemp[2]))
244
+ total_thickness = (max(temp_z) -min(temp_z))*param
245
+ poscar.close()
246
+ #---------------------------------------------------------
247
+ if (n_materials == 1): thickness.append( total_thickness )
248
+ #---------------------------------------------------------
249
+ if (n_materials > 1):
250
+ poscar = open('output/POSCAR.info', "r")
251
+ for i in range(8): VTemp = poscar.readline()
252
+ for i in range(n_materials):
253
+ temp_z = []
254
+ for j in range(int(nions_materials[i])):
255
+ VTemp = poscar.readline().split()
256
+ temp_z.append(float(VTemp[2]))
257
+ thickness.append( (max(temp_z) -min(temp_z))*param )
258
+ #---------------------------------------------------------------
259
+ if (i > 0): z_separation.append( (min(temp_z) -temp_max)*param )
260
+ temp_max = max(temp_z)
261
+ #---------------------
262
+ poscar.close()
263
+ #----------------
264
+
265
+
266
+ # =================================================
267
+ # Extraindo a Energia de Ligação ==================
268
+ # =================================================
269
+
270
+ if os.path.isfile('output/z-scan/info_z-scan.dat'):
271
+ e_binding = '--'
272
+ #--------------------------------------------------
273
+ zscan = open('output/z-scan/info_z-scan.dat', "r")
274
+ #--------------------------------------------------
275
+ for i in range(5): VTemp = zscan.readline().split()
276
+ e_binding = float(VTemp[2])
277
+ #-------------
278
+ zscan.close()
279
+
280
+ # -------------------------------------
281
+ # Atualizando a Energia de Ligação ----
282
+ # -------------------------------------
283
+ file_oszicar = 'relax/OSZICAR'
284
+ file_oszicar_f = 'relax/OSZICAR_frozen'
285
+ #--------------------------------------
286
+ if os.path.isfile(file_oszicar):
287
+ if os.path.isfile(file_oszicar_f):
288
+ #------------------------------------
289
+ with open(file_oszicar, 'r') as file:
290
+ lines = file.readlines()
291
+ last_line = lines[-1].split()
292
+ energ_r = float(last_line[2])
293
+ #--------------------------------------
294
+ with open(file_oszicar_f, 'r') as file:
295
+ lines = file.readlines()
296
+ last_line = lines[-1].split()
297
+ energ_f = float(last_line[2])
298
+ #-------------------------------
299
+ e_binding += (energ_f - energ_r)
300
+
301
+
302
+ # =================================================
303
+ # Extraindo a Energia de Deslizamento =============
304
+ # =================================================
305
+ if os.path.isfile('output/xy-scan/info_xy-scan.dat'):
306
+ e_slide = '--'
307
+ #----------------------------------------------------
308
+ xyscan = open('output/xy-scan/info_xy-scan.dat', "r")
309
+ #----------------------------------------------------
310
+ for i in range(5): VTemp = xyscan.readline().split()
311
+ e_slide = float(VTemp[2])
312
+ #-------------
313
+ xyscan.close()
314
+
315
+
316
+ # ==========================================
317
+ # Splitando o arquivo POSCAR ===============
318
+ # ==========================================
319
+
320
+ if (n_materials > 1):
321
+
322
+ #---------------------------------------
323
+ poscar = open('output/POSCAR.info', 'r')
324
+ #---------------------------------------
325
+ VTemp = poscar.readline().split()
326
+ label_materials = VTemp[1].replace('+', ' ').split()
327
+ n_Lattice = len(label_materials); nion = 0
328
+ range_ion_Lattice = []; ntype_ions = ['']*n_Lattice
329
+ #--------------------------------------------------
330
+ for m in range(n_Lattice):
331
+ range_ion_Lattice.append( str(1 + nion) + ' ')
332
+ nion += int(VTemp[m+2])
333
+ range_ion_Lattice[m] += str(nion)
334
+ #----------------------------------------------------
335
+ for m in range(6): VTemp = poscar.readline().split()
336
+ #----------------------------------------------------
337
+ poscar.close()
338
+ #-------------
339
+ for m in range(n_Lattice):
340
+ contador = 0
341
+ for n in range(len(VTemp)):
342
+ contador += int(VTemp[n])
343
+ range_ion = range_ion_Lattice[m].split()
344
+ ion_i = int(range_ion[0]); ion_f = int(range_ion[1])
345
+ if (contador >= ion_i and contador <= ion_f):
346
+ ntype_ions[m] += str(VTemp[n]) + ' '
347
+
348
+ for m in range(n_Lattice):
349
+ #---------------------------------------
350
+ poscar = open('output/POSCAR.info', 'r')
351
+ poscar_new = open('output/POSCAR.material_' + str(m+1), 'w')
352
+ #-----------------------------------------------------------
353
+ VTemp = poscar.readline()
354
+ poscar_new.write(f'POSCAR \n')
355
+ #-----------------------------
356
+ for n in range(4):
357
+ VTemp = poscar.readline()
358
+ poscar_new.write(f'{VTemp}')
359
+ #-------------------------------
360
+ VTemp = poscar.readline()
361
+ temp = label_materials[m].replace('_', ' ')
362
+ poscar_new.write(f'{temp} \n')
363
+ #-----------------------------
364
+ VTemp = poscar.readline()
365
+ poscar_new.write(f'{ntype_ions[m]} \n')
366
+ #--------------------------------------
367
+ VTemp = poscar.readline()
368
+ poscar_new.write(f'direct \n')
369
+ #---------------------------------------
370
+ range_ion = range_ion_Lattice[m].split()
371
+ ion_i = int(range_ion[0]); ion_f = int(range_ion[1])
372
+ #----------------------------------------------------
373
+ for n in range(1,(nion+1)):
374
+ VTemp = poscar.readline()
375
+ if (n >= ion_i and n <= ion_f): poscar_new.write(f'{VTemp}')
376
+ #----------------------------------------------------------------
377
+ poscar.close()
378
+ poscar_new.close()
379
+ #-----------------
380
+
381
+
382
+ # ===============================================
383
+ # Construindo o arquivo .json ===================
384
+ # ===============================================
385
+
386
+ #------------------------------------------------------
387
+ # Inicializando o arquivo JSON com um dicionário vazio:
388
+ #------------------------------------------------------
389
+ with open('output/info.json', 'w') as file_json:
390
+ json.dump({}, file_json)
391
+
392
+ # ===============================================
393
+ # Atualizando as informações do arquivo .json ===
394
+ # ===============================================
395
+
396
+ for n in range(2):
397
+
398
+
399
+ #-------
400
+ crit = 1
401
+ #-----------
402
+ if (n == 0):
403
+ file = l_file
404
+ if (file == 'null'): crit = 0
405
+ #-----------
406
+ if (n == 1):
407
+ file = l_file_SO
408
+ if (file == 'null'): crit = 0
409
+ #---------
410
+
411
+
412
+ if (crit == 1):
413
+ # ===================================================
414
+ # Iniciando tags com valores vazios "--" ============
415
+ # ===================================================
416
+ loop = 0
417
+ id = '--'; id_monolayers = '--'
418
+ label = '--'; label_materials = '--'; formula = '--'
419
+ nlayers = '--'; nions = '--'; nions_monolayers = '--'; range_ions_materials = '--'
420
+ type_ions_materials = '--'; type_nions_materials = '--'
421
+ lattice_type = '--'; point_group = []; point_group_schoenflies = []; space_group = []; space_group_number = []; inversion_symmetry = []
422
+ param_a = '--'; a1 = '--'; a2 = '--'; a3 = '--'; param_b = '--'; b1 = '--'; b2 = '--'; b3 = '--'
423
+ module_a1_a2_a3 = '--'; module_b1_b2_b3 = '--'; angle_a1a2_a1a3_a2a3 = '--'; angle_b1b2_b1b3_b2b3 = '--'
424
+ cell_area = '--'; cell_vol = '--'; zb_area = '--'; zb_volume = '--'
425
+ direct_coord_ions = '--'; k_path = '--'
426
+
427
+
428
+ #----------------------------------------------------------------------------------------------------------------------------------------------
429
+ e_vbm = '--'; e_cbm = '--'; e_fermi = '--'; e_vacuum = '--'; work_function = '--'; total_energy = '--'; e_per_ion = '--'
430
+ tk_vbm = '--'; tk_cbm = '--'; k_vbm = '--'; k_cbm = '--'
431
+ nk = '--'; nb = '--'; ne = '--'; ne_valence = '--'; vbm = '--'; cbm = '--'; charge_transfer = [];
432
+ gap = '--'; type_gap = '--'; k_vbm = []; k_cbm = []; lorbit = '--'; ispin = '--'
433
+ #------------------------------------------------------------------------------------------
434
+ non_collinear = '--'; spin_orbit = '--'; lorbit = '--'; ispin = '--'
435
+ #----------------------------------------------------------------------
436
+
437
+
438
+ # ========================================= ????????????????????????????????????????????????????????????????????????????????????????????????????????????
439
+ # Extraindo o nível de vácuo: ============= ??????????????????????????? Somente faz sentido para sistemas 2D confinados em Z ???????????????????????????
440
+ # ========================================= ????????????????????????????????????????????????????????????????????????????????????????????????????????????
441
+ l_pot = 'null'; l_pot_SO = 'null'
442
+ #-----------------------------------------------------------
443
+ if os.path.isfile('output/Potencial_bands/Potencial_Z.dat'): l_pot = 'output/Potencial_bands/Potencial_Z.dat'
444
+ if os.path.isfile('output/Potencial_scf/Potencial_Z.dat'): l_pot = 'output/Potencial_scf/Potencial_Z.dat'
445
+ if os.path.isfile('output/Potencial_bands_SO/Potencial_Z.dat'): l_pot_SO = 'output/Potencial_bands_SO/Potencial_Z.dat'
446
+ if os.path.isfile('output/Potencial_scf_SO/Potencial_Z.dat'): l_pot_SO = 'output/Potencial_scf_SO/Potencial_Z.dat'
447
+ #------------------------------------------------------------
448
+ if (l_pot != 'null'):
449
+ file0 = np.loadtxt(l_pot)
450
+ file0.shape
451
+ #-----------------
452
+ date_e = file0[:,1]
453
+ e_vacuum = max(date_e)
454
+ #------------------------
455
+ if (l_pot_SO != 'null'):
456
+ file1 = np.loadtxt(l_pot_SO)
457
+ file1.shape
458
+ #-----------------
459
+ date_e = file1[:,1]
460
+ e_vacuum = max(date_e)
461
+
462
+
463
+ # ===========================================
464
+ # Extraindo dados da saída do VASProcar =====
465
+ # ===========================================
466
+ with open('output/' + file, "r") as info: lines = info.readlines()
467
+ #-----------------------------------------------------------------
468
+ for i in range(len(lines)):
469
+ VTemp = lines[i].replace('(', ' ( ').replace(')', ' ) ').replace(';', '').replace(',', '').split()
470
+ if (len(VTemp) > 0):
471
+ #----------------------------------------
472
+ if (VTemp[0] == 'LNONCOLLINEAR'): non_collinear = str(VTemp[2])
473
+ #----------------------------------------
474
+ elif (VTemp[0] == 'LSORBIT'): spin_orbit = str(VTemp[2])
475
+ #----------------------------------------
476
+ elif (VTemp[0] == 'nº' or VTemp[0] == 'nº'):
477
+ if (VTemp[1] == 'k-points'): nk = int(VTemp[3])
478
+ if (VTemp[5] == 'bands'): nb = int(VTemp[7])
479
+ if (VTemp[1] == 'ions'): ni = int(VTemp[3])
480
+ if (VTemp[5] == 'electrons'): ne = float(VTemp[7])
481
+ #----------------------------------------
482
+ elif (VTemp[0] == 'LORBIT'):
483
+ lorbit = int(VTemp[2])
484
+ if (VTemp[3] == 'ISPIN'): ispin = int(VTemp[5])
485
+ #----------------------------------------
486
+ elif (VTemp[0] == 'Last'): vbm = int(VTemp[4])
487
+ #----------------------------------------
488
+ elif (VTemp[0] == 'First'): cbm = vbm +1
489
+ #----------------------------------------
490
+ elif (VTemp[0] == 'Valence'):
491
+ e_vbm = float(VTemp[7])
492
+ tk_vbm = int(VTemp[11])
493
+ #----------------------------------------
494
+ elif (VTemp[0] == 'Conduction'):
495
+ e_cbm = float(VTemp[7])
496
+ tk_cbm = int(VTemp[11])
497
+ #----------------------------------------
498
+ elif (VTemp[0] == 'GAP'):
499
+ type_gap = str(VTemp[2])
500
+ gap = float(VTemp[5])
501
+ #----------------------------------------
502
+ elif (VTemp[0] == 'Fermi'): e_fermi = float(VTemp[3])
503
+ #----------------------------------------
504
+ elif (VTemp[0] == 'free'):
505
+ total_energy = float(VTemp[4])
506
+ e_per_ion = total_energy/ni
507
+ #----------------------------------------
508
+ elif (VTemp[0] == 'Volume_cell'): Volume_cell = float(VTemp[2])
509
+ #----------------------------------------
510
+ elif (VTemp[0] == 'Param.'): param = float(VTemp[2])
511
+ #----------------------------------------
512
+ elif (VTemp[0] == 'A1'):
513
+ a1 = [float(VTemp[4])*param, float(VTemp[5])*param, float(VTemp[6])*param]
514
+ A1 = np.array([float(VTemp[4]), float(VTemp[5]), float(VTemp[6])])*param; module_a1_a2_a3 = []; module_a1_a2_a3.append(np.linalg.norm(A1))
515
+ elif (VTemp[0] == 'A2'):
516
+ a2 = [float(VTemp[4])*param, float(VTemp[5])*param, float(VTemp[6])*param]
517
+ A2 = np.array([float(VTemp[4]), float(VTemp[5]), float(VTemp[6])])*param; module_a1_a2_a3.append(np.linalg.norm(A2))
518
+ elif (VTemp[0] == 'A3'):
519
+ a3 = [float(VTemp[4])*param, float(VTemp[5])*param, float(VTemp[6])*param]
520
+ A3 = np.array([float(VTemp[4]), float(VTemp[5]), float(VTemp[6])])*param; module_a1_a2_a3.append(np.linalg.norm(A3))
521
+ #-------------------------------------------------------
522
+ angle_a1a2_a1a3_a2a3 = []
523
+ angle_a1a2_a1a3_a2a3.append(round(np.degrees(np.arccos(np.dot(A1,A2) / (np.linalg.norm(A1) * np.linalg.norm(A2)))), 3))
524
+ angle_a1a2_a1a3_a2a3.append(round(np.degrees(np.arccos(np.dot(A1,A3) / (np.linalg.norm(A1) * np.linalg.norm(A3)))), 3))
525
+ angle_a1a2_a1a3_a2a3.append(round(np.degrees(np.arccos(np.dot(A2,A3) / (np.linalg.norm(A2) * np.linalg.norm(A3)))), 3))
526
+ #----------------------------------------
527
+ elif (VTemp[0] == '2pi/Param.'): fator_rec = float(VTemp[2])
528
+ #----------------------------------------
529
+ elif (VTemp[0] == 'B1'):
530
+ b1 = [float(VTemp[4])*fator_rec, float(VTemp[5])*fator_rec, float(VTemp[6])*fator_rec]
531
+ B1 = np.array([float(VTemp[4]), float(VTemp[5]), float(VTemp[6])])*fator_rec; module_b1_b2_b3 = []; module_b1_b2_b3.append(np.linalg.norm(B1))
532
+ elif (VTemp[0] == 'B2'):
533
+ b2 = [float(VTemp[4])*fator_rec, float(VTemp[5])*fator_rec, float(VTemp[6])*fator_rec]
534
+ B2 = np.array([float(VTemp[4]), float(VTemp[5]), float(VTemp[6])])*fator_rec; module_b1_b2_b3.append(np.linalg.norm(B2))
535
+ elif (VTemp[0] == 'B3'):
536
+ b3 = [float(VTemp[4])*fator_rec, float(VTemp[5])*fator_rec, float(VTemp[6])*fator_rec]
537
+ B3 = np.array([float(VTemp[4]), float(VTemp[5]), float(VTemp[6])])*fator_rec; module_b1_b2_b3.append(np.linalg.norm(B3))
538
+ #-------------------------------------------------------
539
+ angle_b1b2_b1b3_b2b3 = []
540
+ angle_b1b2_b1b3_b2b3.append(round(np.degrees(np.arccos(np.dot(B1,B2) / (np.linalg.norm(B1) * np.linalg.norm(B2)))), 3))
541
+ angle_b1b2_b1b3_b2b3.append(round(np.degrees(np.arccos(np.dot(B1,B3) / (np.linalg.norm(B1) * np.linalg.norm(B3)))), 3))
542
+ angle_b1b2_b1b3_b2b3.append(round(np.degrees(np.arccos(np.dot(B2,B3) / (np.linalg.norm(B2) * np.linalg.norm(B3)))), 3))
543
+ #----------------------------------------
544
+ elif (VTemp[0] == 'Volume_ZB'): vol_zb = float(VTemp[2])
545
+ #----------------------------------------
546
+ elif (VTemp[0] == 'k-points'): loop = i+3
547
+
548
+
549
+
550
+ if (tk_vbm != '--' and tk_cbm != '--'):
551
+ # ===========================================
552
+ # Buscando os pontos-k do GAP da banda ======
553
+ # ===========================================
554
+ if (file == 'info_bands.txt' or file == 'info_bands_SO.txt'):
555
+ if (n == 0): info = open('output/info_bands.txt', "r")
556
+ if (n == 1): info = open('output/info_bands_SO.txt', "r")
557
+ #-----------
558
+ test = 'nao'
559
+ #-----------
560
+ while (test == 'nao'):
561
+ #--------------------------------
562
+ VTemp = info.readline().split()
563
+ #-----------------------------------------------------------
564
+ if (len(VTemp) > 0 and VTemp[0] == 'k-points'): test = 'sim'
565
+ #-----------------------------------------------------------
566
+ for nn in range(2): VTemp = info.readline()
567
+ for nn in range(1,(nk+1)):
568
+ VTemp = info.readline().split()
569
+ if (nn == int(tk_vbm)): k_vbm = [float(VTemp[1]), float(VTemp[2]), float(VTemp[3])]
570
+ if (nn == int(tk_cbm)): k_cbm = [float(VTemp[1]), float(VTemp[2]), float(VTemp[3])]
571
+
572
+
573
+ # =================================================================
574
+ # Buscando os valores para a Transferência de Carga de Bader ======
575
+ # =================================================================
576
+ if (n_materials > 1):
577
+ #===========
578
+ if (n == 0):
579
+ if os.path.isfile('output/Charge_transfer/Bader_charge_transfer.dat'):
580
+ file_bader = 'output/Charge_transfer/Bader_charge_transfer.dat'
581
+ #----------------------------
582
+ bader = open(file_bader, "r")
583
+ for nn in range(4): VTemp = bader.readline()
584
+ for mn in range(len(t_ions_materials)):
585
+ vector_bader = []
586
+ VTemp = bader.readline()
587
+ VTemp = bader.readline().split()
588
+ vector_bader.append(float(VTemp[2]))
589
+ for mm in range(len(t_ions_materials[mn])):
590
+ VTemp = bader.readline().split()
591
+ vector_bader.append(float(VTemp[3]))
592
+ charge_transfer.append(vector_bader)
593
+ #===========
594
+ if (n == 1):
595
+ if os.path.isfile('output/Charge_transfer_SO/Bader_charge_transfer.dat'):
596
+ file_bader = 'output/Charge_transfer_SO/Bader_charge_transfer.dat'
597
+ #----------------------------
598
+ bader = open(file_bader, "r")
599
+ for nn in range(4): VTemp = bader.readline()
600
+ for mn in range(len(t_ions_materials)):
601
+ vector_bader = []
602
+ VTemp = bader.readline()
603
+ VTemp = bader.readline().split()
604
+ vector_bader.append(float(VTemp[2]))
605
+ for mm in range(len(t_ions_materials[mn])):
606
+ VTemp = bader.readline().split()
607
+ vector_bader.append(float(VTemp[3]))
608
+ charge_transfer.append(vector_bader)
609
+
610
+
611
+ """
612
+ # ===========================================================
613
+ # Obtando e organizando as informações dos pontos-k =========
614
+ # ===========================================================
615
+ if (file == 'info_bands.txt' or file == 'info_bands_SO.txt'):
616
+ #---------------------------------
617
+ info = open('output/' + file, "r")
618
+ #---------------------------------
619
+ if (loop != 0):
620
+ #-----------------------------------------------------
621
+ k_points_direct = []; k_points_cart = []; k_path = []
622
+ #---------------------------------------------
623
+ for i in range(loop): VTemp = info.readline()
624
+ for i in range(nk):
625
+ VTemp = info.readline().split()
626
+ k_points_direct.append([float(VTemp[1]), float(VTemp[2]), float(VTemp[3])])
627
+ k_points_cart.append([float(VTemp[4]), float(VTemp[5]), float(VTemp[6])])
628
+ k_path.append(float(VTemp[7]))
629
+ print(k_path)
630
+ #-----------
631
+ info.close()
632
+ """
633
+
634
+
635
+ # =========================================================
636
+ # Obtendo as simetrias da rede ============================
637
+ # =========================================================
638
+
639
+ #--------------------------------------------------------------------
640
+ # Dicionário de mapeamento de Hermann-Mauguin para Schoenflies ------
641
+ #--------------------------------------------------------------------
642
+ schoenflies = {"1": "C1", "-1": "Ci", "2": "C2", "m": "Cs", "2/m": "C2h", "222": "D2", "mm2": "C2v", "mmm": "D2h", "4": "C4", "-4": "S4", "4/m": "C4h",
643
+ "422": "D4", "4mm": "C4v", "-42m": "D2d", "4/mmm": "D4h", "3": "C3", "-3": "C3i", "32": "D3", "3m": "C3v", "-3m": "D3d", "6": "C6", "-6": "C3h",
644
+ "6/m": "C6h", "622": "D6", "6mm": "C6v", "-6m2": "D3h", "6/mmm": "D6h", "23": "T", "m-3": "Th", "432": "O", "-43m": "Td", "m-3m": "Oh"}
645
+ #--------------------------------------------------------------------
646
+ if (n_materials == 1): passo = 1
647
+ if (n_materials > 1): passo = n_materials +1
648
+ #--------------------------------------------
649
+ for i in range(passo):
650
+ #-----------------
651
+ if (i == 0): structure = Poscar.from_file('output/POSCAR.info').structure
652
+ if (i > 0): structure = Poscar.from_file('output/POSCAR.material_' + str(i)).structure
653
+ analyzer = SpacegroupAnalyzer(structure)
654
+ #----------------------------------------------------
655
+ point_group.append(analyzer.get_point_group_symbol())
656
+ space_group.append(analyzer.get_space_group_symbol())
657
+ space_group_number.append(analyzer.get_space_group_number())
658
+ inversion_symmetry.append(analyzer.is_laue())
659
+ if (i == 0): lattice_type = analyzer.get_lattice_type()
660
+ point_group_schoenflies.append(schoenflies.get(point_group[0], "Desconhecido"))
661
+ #------------------------------------------------------------------------------
662
+ # if (i > 0): os.remove('output/POSCAR.material_' + str(i)) # ERROR !!!!!!!!!!!
663
+
664
+
665
+ #=======================================
666
+ # Obtendo a área no plano XY da rede ===
667
+ #=======================================
668
+ V1 = np.array([A1[0], A1[1]])
669
+ V2 = np.array([A2[0], A2[1]])
670
+ #----------------------------
671
+ # Área da célula no plano XY
672
+ Area_cell = np.linalg.norm(np.cross(V1, V2))
673
+ #-------------------------------------------
674
+
675
+
676
+ #=======================================
677
+ # Obtendo a área no plano KxKy da ZB ===
678
+ #=======================================
679
+ V1 = np.array([B1[0], B1[1]])
680
+ V2 = np.array([B2[0], B2[1]])
681
+ #----------------------------
682
+ # Área da zb no plano KxKy
683
+ Area_ZB = np.linalg.norm(np.cross(V1, V2))
684
+ #-----------------------------------------
685
+
686
+
687
+ # ===========================================
688
+ # Criando o Dicionário ======================
689
+ # ===========================================
690
+
691
+ dados0 = {
692
+ "id": id_code,
693
+ "number_layers": n_materials,
694
+ "id_layers": id_materials,
695
+ "formula": estequiometria,
696
+ "type_ions_layers": t_ions_materials,
697
+ "number_ions_layers": nions_materials,
698
+ "number_type_ions_layers": t_nions_materials,
699
+ "range_ions_layers": r_ions_materials,
700
+ "number_ions": ni,
701
+ # ---------------------------------------------------------------------
702
+ "area_perc_mismatch": area_perc_mismatch if n_materials > 1 else None,
703
+ "perc_area_change": perc_area_change if n_materials > 1 else None,
704
+ "perc_mod_vectors_change": perc_mod_vectors_change if n_materials > 1 else None,
705
+ "angle_perc_mismatch": angle_perc_mismatch if n_materials > 1 else None,
706
+ "perc_angle_change": perc_angle_change if n_materials > 1 else None,
707
+ "rotation_angle": rotation_angle if n_materials > 1 else None,
708
+ "supercell_matrix": supercell_matrix if n_materials > 1 else None,
709
+ "deformation_matrix": deformation_matrix if n_materials > 1 else None,
710
+ "strain_matrix": strain_matrix if n_materials > 1 else None,
711
+ "shift_plane": shift_plane if n_materials > 1 else None,
712
+ # ---------------------------------------------------------------------
713
+ "lattice_type": lattice_type,
714
+ "point_group": point_group,
715
+ # "point_group_schoenflies": point_group_schoenflies,
716
+ "space_group": space_group,
717
+ "space_group_number": space_group_number,
718
+ "inversion_symmetry": inversion_symmetry,
719
+ "pseudo_type": pseudo_type,
720
+ "exchange_correlation_functional": exchange_correlation_functional,
721
+ "vdW": vdW,
722
+ "non_collinear": non_collinear,
723
+ "spin_orbit": spin_orbit,
724
+ "z_separation": z_separation if n_materials > 1 else None,
725
+ "thickness": thickness,
726
+ "total_thickness": total_thickness,
727
+ # "param_a": param,
728
+ "a1": a1,
729
+ "a2": a2,
730
+ "a3": a3,
731
+ "module_a1_a2_a3": module_a1_a2_a3,
732
+ "angle_a1a2_a1a3_a2a3": angle_a1a2_a1a3_a2a3,
733
+ "cell_area": Area_cell,
734
+ # "cell_vol": Volume_cell,
735
+ # "param_b": fator_rec,
736
+ "b1": b1,
737
+ "b2": b2,
738
+ "b3": b3,
739
+ "module_b1_b2_b3": module_b1_b2_b3,
740
+ "angle_b1b2_b1b3_b2b3": angle_b1b2_b1b3_b2b3,
741
+ "zb_area": Area_ZB,
742
+ # "zb_volume": vol_zb,
743
+ "direct_coord_ions": coord_ions,
744
+ "kpath": kpath,
745
+ }
746
+
747
+
748
+ if (n == 0):
749
+ #---------
750
+ dados1 = {
751
+ "lorbit": lorbit,
752
+ "ispin": ispin,
753
+ "nk": nk,
754
+ "nb": nb,
755
+ "ne": ne,
756
+ "gap": gap,
757
+ "e_vbm": e_vbm,
758
+ "e_cbm": e_cbm,
759
+ "vbm": vbm,
760
+ "cbm": cbm,
761
+ "type_gap": type_gap,
762
+ "k_vbm": k_vbm,
763
+ "k_cbm": k_cbm,
764
+ "e_fermi": e_fermi,
765
+ "e_vacuum": e_vacuum,
766
+ # "work_function": work_function,
767
+ "total_energy": total_energy,
768
+ "e_per_ion": e_per_ion,
769
+ "e_binding": e_binding if n_materials > 1 else None,
770
+ "e_slide": e_slide if n_materials > 1 else None,
771
+ "charge_transfer": charge_transfer if n_materials > 1 else None,
772
+ }
773
+
774
+
775
+ if (n == 1):
776
+ #---------
777
+ dados1 = {
778
+ "lorbit_SO": lorbit,
779
+ "ispin_SO": ispin,
780
+ "nk_SO": nk,
781
+ "nb_SO": nb,
782
+ "ne_SO": ne,
783
+ "gap_SO": gap,
784
+ "e_vbm_SO": e_vbm,
785
+ "e_cbm_SO": e_cbm,
786
+ "vbm_SO": vbm,
787
+ "cbm_SO": cbm,
788
+ "type_gap_SO": type_gap,
789
+ "k_vbm_SO": k_vbm,
790
+ "k_cbm_SO": k_cbm,
791
+ "e_fermi_SO": e_fermi,
792
+ "e_vacuum_SO": e_vacuum,
793
+ # "work_function_SO": work_function,
794
+ "total_energy_SO": total_energy,
795
+ "e_per_ion_SO": e_per_ion,
796
+ "charge_transfer": charge_transfer if n_materials > 1 else None,
797
+ }
798
+
799
+
800
+ # ==================================================
801
+ # Inserindo as informações no arquivo .json ========
802
+ # ==================================================
803
+ with open('output/info.json', 'r') as file: data = json.load(file) # Carregando o conteúdo atual do arquivo info.json
804
+ data.update(dados0) # Atualizando o dicionário com as novas informações
805
+ with open('output/info.json', 'w') as file: json.dump(data, file, indent=4) # Salvar o conteúdo atualizado no arquivo info.json
806
+ #----------------------
807
+ with open('output/info.json', 'r') as file: data = json.load(file) # Carregando o conteúdo atual do arquivo info.json
808
+ data.update(dados1) # Atualizando o dicionário com as novas informações
809
+ with open('output/info.json', 'w') as file: json.dump(data, file, indent=4) # Salvar o conteúdo atualizado no arquivo info.json
810
+
811
+
812
+ #===============================================================
813
+ # Atualizando os arquivos POSCAR e CONTCAR =====================
814
+ #===============================================================
815
+ with open('output/POSCAR', 'r') as file: line = file.readlines()
816
+ tline = line[0].split()
817
+ #--------------------
818
+ replace_line = tline[0] + ' ' + tline[1] + ' '
819
+ for i in range(n_materials): replace_line += tline[2 +i] + ' '
820
+ replace_line += tline[-1] + '\n'
821
+ #------------------------------
822
+ line[0] = replace_line
823
+ with open('output/POSCAR', 'w') as file: file.writelines(line)
824
+ #================================================================
825
+ with open('output/CONTCAR', 'r') as file: line = file.readlines()
826
+ line[0] = replace_line
827
+ with open('output/CONTCAR', 'w') as file: file.writelines(line)
828
+ #==============================================================
829
+
830
+
831
+ """
832
+ # ===============================================
833
+ # Abrindo e lendo o data-base .json =============
834
+ # ===============================================
835
+ with open('output/info.json', "r") as file_json: date = json.load(file_json)
836
+ #------------------------------------------------
837
+ print(" ")
838
+ print("===========================")
839
+ print("Dados do arquivo info.json:")
840
+ print("===========================")
841
+ print(" ")
842
+ for chave, valor in date.items(): print(f"{chave}: {valor}")
843
+ """
844
+
@@ -7,13 +7,13 @@ import shutil
7
7
 
8
8
  #------------------------
9
9
  current_dir = os.getcwd()
10
- folders = folders = [name for name in os.listdir(current_dir) if os.path.isdir(os.path.join(current_dir, name))]
11
- #---------------------------------------------------------------------------------------------------------------
10
+ folders = [name for name in os.listdir(current_dir) if os.path.isdir(os.path.join(current_dir, name))]
11
+ #-----------------------------------------------------------------------------------------------------
12
12
  if os.path.isdir('output'):
13
- 0 == 0
14
- else:
15
- os.mkdir('output')
16
- #--------------------
13
+ folders2 = [name for name in os.listdir('output') if os.path.isdir(os.path.join('output', name))]
14
+ for i in range(len(folders2)): shutil.rmtree('output/' + folders2[i])
15
+ else: os.mkdir('output')
16
+ #-----------------------
17
17
 
18
18
 
19
19
  for i in range(len(folders)):
@@ -79,15 +79,3 @@ for i in range(len(folders)):
79
79
  if os.path.isdir(folders[i] + '/Charge_transfer'): shutil.copytree(folders[i] + '/Charge_transfer', 'output/Charge_transfer_SO')
80
80
  # if os.path.isdir(folders[i] + '/Charge_transfer'): shutil.rmtree(folders[i] + '/Charge_transfer')
81
81
  #--------------------------------
82
-
83
-
84
-
85
-
86
-
87
-
88
-
89
-
90
-
91
-
92
-
93
-
@@ -308,12 +308,9 @@ info = open('info_xy-scan.dat', "w", encoding='utf-8')
308
308
  info.write(f'====================================================== \n')
309
309
  info.write(f'Displacement carried out over the 2nd material lattice \n')
310
310
  #------------------------------------------------------------------
311
- info.write(f'Displacement_XY = ({x_min}, {y_min}) in Å \n')
312
- info.write(f'Displacement_XY = ({new_delta_A1}*A1, {new_delta_A2}*A2) \n')
313
- #-------------------------------------------------------------------------
314
- # info.write(f'Displacement_XY = ({delta_X}, {delta_Y}) in Å \n')
315
- # info.write(f'Displacement_XY = ({delta_A1}*A1, {delta_A2}*A2) \n')
316
- info.write(f'------------------------------------------------------ \n')
311
+ info.write(f'XY_Displacement = ({x_min}, {y_min}) in Å \n')
312
+ info.write(f'XY_Displacement = ({new_delta_A1}*A1, {new_delta_A2}*A2) \n')
313
+ #--------------------------------------------------------------------
317
314
  info.write(f'ΔE = {Delta_E_meV:.12f} meV/Å^2 or {Delta_E_J:.12f} J/m^2 \n')
318
315
  info.write(f'====================================================== \n')
319
316
  info.close()
@@ -100,8 +100,8 @@ file.close()
100
100
  info = open('info_xyz-scan.dat', "w", encoding='utf-8')
101
101
  info.write(f'====================================================== \n')
102
102
  info.write(f'Displacement carried out over the 2nd material lattice \n')
103
- info.write(f'Displacement_XY = ({a1_min}*A1, {a2_min}*A2) \n')
104
- info.write(f'Displacement_Z = {z_min} Å \n')
103
+ info.write(f'XY_Displacement = ({a1_min}*A1, {a2_min}*A2) \n')
104
+ info.write(f'Z_Displacement = {z_min} Å \n')
105
105
  # info.write(f'------------------------------------------------------ \n')
106
106
  # info.write(f'ΔE = {Delta_E_meV:.12f} meV/Å^2 or {Delta_E_J:.12f} J/m^2 \n')
107
107
  info.write(f'====================================================== \n')
@@ -112,7 +112,7 @@ plt.savefig('z-scan.png', dpi = 600, bbox_inches='tight', pad_inches=0)
112
112
  info = open('info_z-scan.dat', "w", encoding='utf-8')
113
113
  info.write(f'====================================================== \n')
114
114
  info.write(f'Displacement carried out over the 2nd material lattice \n')
115
- info.write(f'Displacement_Z = {delta_z} in Å \n')
115
+ info.write(f'Z_Displacement = {delta_z} in Å \n')
116
116
  info.write(f'------------------------------------------------------ \n')
117
117
  info.write(f'Eb = {Eb_meV:.12f} meV/Å^2 or {Eb_J:.12f} J/m^2 \n')
118
118
  info.write(f'====================================================== \n')
@@ -6,7 +6,7 @@ import json
6
6
 
7
7
  setup(
8
8
  name = "SAMBA_ilum",
9
- version = "1.0.0.403",
9
+ version = "1.0.0.404",
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