SAMBA-ilum 1.0.0.412__tar.gz → 1.0.0.414__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 (63) hide show
  1. {samba_ilum-1.0.0.412 → samba_ilum-1.0.0.414}/PKG-INFO +1 -1
  2. {samba_ilum-1.0.0.412 → samba_ilum-1.0.0.414}/SAMBA_ilum.egg-info/PKG-INFO +1 -1
  3. {samba_ilum-1.0.0.412 → samba_ilum-1.0.0.414}/SAMBA_ilum.egg-info/SOURCES.txt +0 -1
  4. {samba_ilum-1.0.0.412 → samba_ilum-1.0.0.414}/samba_ilum/__main__.py +1 -1
  5. {samba_ilum-1.0.0.412 → samba_ilum-1.0.0.414}/samba_ilum/src/data-base_json.py +7 -5
  6. {samba_ilum-1.0.0.412 → samba_ilum-1.0.0.414}/setup.py +1 -1
  7. samba_ilum-1.0.0.412/samba_ilum/src/data-base_json [backup].py +0 -840
  8. {samba_ilum-1.0.0.412 → samba_ilum-1.0.0.414}/LICENSE.txt +0 -0
  9. {samba_ilum-1.0.0.412 → samba_ilum-1.0.0.414}/README.md +0 -0
  10. {samba_ilum-1.0.0.412 → samba_ilum-1.0.0.414}/SAMBA_ilum.egg-info/dependency_links.txt +0 -0
  11. {samba_ilum-1.0.0.412 → samba_ilum-1.0.0.414}/SAMBA_ilum.egg-info/entry_points.txt +0 -0
  12. {samba_ilum-1.0.0.412 → samba_ilum-1.0.0.414}/SAMBA_ilum.egg-info/requires.txt +0 -0
  13. {samba_ilum-1.0.0.412 → samba_ilum-1.0.0.414}/SAMBA_ilum.egg-info/top_level.txt +0 -0
  14. {samba_ilum-1.0.0.412 → samba_ilum-1.0.0.414}/samba_ilum/__init__.py +0 -0
  15. {samba_ilum-1.0.0.412 → samba_ilum-1.0.0.414}/samba_ilum/src/HeteroStructure_Generator.py +0 -0
  16. {samba_ilum-1.0.0.412 → samba_ilum-1.0.0.414}/samba_ilum/src/INPUTS/INCAR_a-scan +0 -0
  17. {samba_ilum-1.0.0.412 → samba_ilum-1.0.0.414}/samba_ilum/src/INPUTS/INCAR_bader +0 -0
  18. {samba_ilum-1.0.0.412 → samba_ilum-1.0.0.414}/samba_ilum/src/INPUTS/INCAR_bader.SO +0 -0
  19. {samba_ilum-1.0.0.412 → samba_ilum-1.0.0.414}/samba_ilum/src/INPUTS/INCAR_bands +0 -0
  20. {samba_ilum-1.0.0.412 → samba_ilum-1.0.0.414}/samba_ilum/src/INPUTS/INCAR_bands.SO +0 -0
  21. {samba_ilum-1.0.0.412 → samba_ilum-1.0.0.414}/samba_ilum/src/INPUTS/INCAR_dos +0 -0
  22. {samba_ilum-1.0.0.412 → samba_ilum-1.0.0.414}/samba_ilum/src/INPUTS/INCAR_dos.SO +0 -0
  23. {samba_ilum-1.0.0.412 → samba_ilum-1.0.0.414}/samba_ilum/src/INPUTS/INCAR_relax +0 -0
  24. {samba_ilum-1.0.0.412 → samba_ilum-1.0.0.414}/samba_ilum/src/INPUTS/INCAR_scf +0 -0
  25. {samba_ilum-1.0.0.412 → samba_ilum-1.0.0.414}/samba_ilum/src/INPUTS/INCAR_scf.SO +0 -0
  26. {samba_ilum-1.0.0.412 → samba_ilum-1.0.0.414}/samba_ilum/src/INPUTS/INCAR_xy-scan +0 -0
  27. {samba_ilum-1.0.0.412 → samba_ilum-1.0.0.414}/samba_ilum/src/INPUTS/INCAR_xyz-scan +0 -0
  28. {samba_ilum-1.0.0.412 → samba_ilum-1.0.0.414}/samba_ilum/src/INPUTS/INCAR_z-scan +0 -0
  29. {samba_ilum-1.0.0.412 → samba_ilum-1.0.0.414}/samba_ilum/src/INPUTS/SAMBA_HeteroStructure.input +0 -0
  30. {samba_ilum-1.0.0.412 → samba_ilum-1.0.0.414}/samba_ilum/src/INPUTS/SAMBA_WorkFlow.input +0 -0
  31. {samba_ilum-1.0.0.412 → samba_ilum-1.0.0.414}/samba_ilum/src/INPUTS/inputs_VASProcar/input.vasprocar.bands +0 -0
  32. {samba_ilum-1.0.0.412 → samba_ilum-1.0.0.414}/samba_ilum/src/INPUTS/inputs_VASProcar/input.vasprocar.chgcar +0 -0
  33. {samba_ilum-1.0.0.412 → samba_ilum-1.0.0.414}/samba_ilum/src/INPUTS/inputs_VASProcar/input.vasprocar.dos +0 -0
  34. {samba_ilum-1.0.0.412 → samba_ilum-1.0.0.414}/samba_ilum/src/INPUTS/inputs_VASProcar/input.vasprocar.location +0 -0
  35. {samba_ilum-1.0.0.412 → samba_ilum-1.0.0.414}/samba_ilum/src/INPUTS/inputs_VASProcar/input.vasprocar.locpot +0 -0
  36. {samba_ilum-1.0.0.412 → samba_ilum-1.0.0.414}/samba_ilum/src/INPUTS/inputs_VASProcar/input.vasprocar.orbitals +0 -0
  37. {samba_ilum-1.0.0.412 → samba_ilum-1.0.0.414}/samba_ilum/src/INPUTS/inputs_VASProcar/input.vasprocar.spin +0 -0
  38. {samba_ilum-1.0.0.412 → samba_ilum-1.0.0.414}/samba_ilum/src/INPUTS/vdw_kernel.bindat +0 -0
  39. {samba_ilum-1.0.0.412 → samba_ilum-1.0.0.414}/samba_ilum/src/_info_pseudo.py +0 -0
  40. {samba_ilum-1.0.0.412 → samba_ilum-1.0.0.414}/samba_ilum/src/a-scan.py +0 -0
  41. {samba_ilum-1.0.0.412 → samba_ilum-1.0.0.414}/samba_ilum/src/a-scan_analysis.py +0 -0
  42. {samba_ilum-1.0.0.412 → samba_ilum-1.0.0.414}/samba_ilum/src/bader +0 -0
  43. {samba_ilum-1.0.0.412 → samba_ilum-1.0.0.414}/samba_ilum/src/bader_poscar.py +0 -0
  44. {samba_ilum-1.0.0.412 → samba_ilum-1.0.0.414}/samba_ilum/src/bader_update.py +0 -0
  45. {samba_ilum-1.0.0.412 → samba_ilum-1.0.0.414}/samba_ilum/src/charge_transfer.py +0 -0
  46. {samba_ilum-1.0.0.412 → samba_ilum-1.0.0.414}/samba_ilum/src/chgsum.pl +0 -0
  47. {samba_ilum-1.0.0.412 → samba_ilum-1.0.0.414}/samba_ilum/src/contcar_update.py +0 -0
  48. {samba_ilum-1.0.0.412 → samba_ilum-1.0.0.414}/samba_ilum/src/data-base_union.py +0 -0
  49. {samba_ilum-1.0.0.412 → samba_ilum-1.0.0.414}/samba_ilum/src/energy_scan.py +0 -0
  50. {samba_ilum-1.0.0.412 → samba_ilum-1.0.0.414}/samba_ilum/src/job.py +0 -0
  51. {samba_ilum-1.0.0.412 → samba_ilum-1.0.0.414}/samba_ilum/src/kpoints.py +0 -0
  52. {samba_ilum-1.0.0.412 → samba_ilum-1.0.0.414}/samba_ilum/src/lattice_plot3d.py +0 -0
  53. {samba_ilum-1.0.0.412 → samba_ilum-1.0.0.414}/samba_ilum/src/make_files.py +0 -0
  54. {samba_ilum-1.0.0.412 → samba_ilum-1.0.0.414}/samba_ilum/src/output.py +0 -0
  55. {samba_ilum-1.0.0.412 → samba_ilum-1.0.0.414}/samba_ilum/src/potcar.py +0 -0
  56. {samba_ilum-1.0.0.412 → samba_ilum-1.0.0.414}/samba_ilum/src/vdW_DF.py +0 -0
  57. {samba_ilum-1.0.0.412 → samba_ilum-1.0.0.414}/samba_ilum/src/xy-scan.py +0 -0
  58. {samba_ilum-1.0.0.412 → samba_ilum-1.0.0.414}/samba_ilum/src/xy-scan_analysis.py +0 -0
  59. {samba_ilum-1.0.0.412 → samba_ilum-1.0.0.414}/samba_ilum/src/xyz-scan.py +0 -0
  60. {samba_ilum-1.0.0.412 → samba_ilum-1.0.0.414}/samba_ilum/src/xyz-scan_analysis.py +0 -0
  61. {samba_ilum-1.0.0.412 → samba_ilum-1.0.0.414}/samba_ilum/src/z-scan.py +0 -0
  62. {samba_ilum-1.0.0.412 → samba_ilum-1.0.0.414}/samba_ilum/src/z-scan_analysis.py +0 -0
  63. {samba_ilum-1.0.0.412 → samba_ilum-1.0.0.414}/setup.cfg +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: SAMBA_ilum
3
- Version: 1.0.0.412
3
+ Version: 1.0.0.414
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.412
3
+ Version: 1.0.0.414
4
4
  Summary: ...
5
5
  Author: Augusto de Lelis Araujo
6
6
  Author-email: augusto-lelis@outlook.com
@@ -20,7 +20,6 @@ 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
24
23
  samba_ilum/src/data-base_json.py
25
24
  samba_ilum/src/data-base_union.py
26
25
  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.412'
19
+ version = '1.0.0.414'
20
20
 
21
21
  print(" ")
22
22
  print("=============================================================")
@@ -425,8 +425,8 @@ for n in range(2):
425
425
  direct_coord_ions = '--'; k_path = '--'
426
426
 
427
427
 
428
- #----------------------------------------------------------------------------------------------------------------------------------------------
429
- e_vbm = '--'; e_cbm = '--'; e_fermi = '--'; e_vacuum = '--'; work_function = '--'; total_energy = '--'; e_per_ion = '--'
428
+ #----------------------------------------------------------------------------------------------------------
429
+ e_vbm = '--'; e_cbm = '--'; e_fermi = '--'; e_vacuum = '--'; work_function = '--'; total_energy = '--'
430
430
  tk_vbm = '--'; tk_cbm = '--'; k_vbm = '--'; k_cbm = '--'
431
431
  nk = '--'; nb = '--'; ne = '--'; ne_valence = '--'; vbm = '--'; cbm = '--'; charge_transfer = [];
432
432
  gap = '--'; type_gap = '--'; k_vbm = []; k_cbm = []; lorbit = '--'; ispin = '--'
@@ -503,7 +503,7 @@ for n in range(2):
503
503
  #----------------------------------------
504
504
  elif (VTemp[0] == 'free'):
505
505
  total_energy = float(VTemp[4])
506
- e_per_ion = total_energy/ni
506
+ # e_per_ion = total_energy/ni
507
507
  #----------------------------------------
508
508
  elif (VTemp[0] == 'Volume_cell'): Volume_cell = float(VTemp[2])
509
509
  #----------------------------------------
@@ -765,7 +765,8 @@ for n in range(2):
765
765
  "e_vacuum": e_vacuum,
766
766
  # "work_function": work_function,
767
767
  "total_energy": total_energy,
768
- "e_per_ion": e_per_ion,
768
+ "e_per_ion": total_energy/ni,
769
+ "e_per_area": total_energy/Area_cell,
769
770
  "e_binding": e_binding if n_materials > 1 else None,
770
771
  "e_slide": e_slide if n_materials > 1 else None,
771
772
  "charge_transfer": charge_transfer if n_materials > 1 else None,
@@ -792,7 +793,8 @@ for n in range(2):
792
793
  "e_vacuum_SO": e_vacuum,
793
794
  # "work_function_SO": work_function,
794
795
  "total_energy_SO": total_energy,
795
- "e_per_ion_SO": e_per_ion,
796
+ "e_per_ion_SO": total_energy/ni,
797
+ "e_per_area_SO": total_energy/Area_cell,
796
798
  "charge_transfer": charge_transfer if n_materials > 1 else None,
797
799
  }
798
800
 
@@ -6,7 +6,7 @@ import json
6
6
 
7
7
  setup(
8
8
  name = "SAMBA_ilum",
9
- version = "1.0.0.412",
9
+ version = "1.0.0.414",
10
10
  entry_points={'console_scripts': ['samba_ilum = samba_ilum:main']},
11
11
  description = "...",
12
12
  author = "Augusto de Lelis Araujo",
@@ -1,840 +0,0 @@
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(6): 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_vmb = '--'; e_cbm = '--'; e_fermi = '--'; e_vacuum = '--'; work_function = '--'; total_energy = '--'; e_per_ion = '--'
430
- nk = '--'; nb = '--'; ne = '--'; ne_valence = '--'; vbm = '--'; cbm = '--'; charge_transfer = [];
431
- gap = '--'; type_gap = '--'; k_vbm = []; k_cbm = []; lorbit = '--'; ispin = '--'
432
- #------------------------------------------------------------------------------------------
433
- non_collinear = '--'; spin_orbit = '--'; lorbit = '--'; ispin = '--'
434
- #----------------------------------------------------------------------
435
-
436
-
437
- # ========================================= ????????????????????????????????????????????????????????????????????????????????????????????????????????????
438
- # Extraindo o nível de vácuo: ============= ??????????????????????????? Somente faz sentido para sistemas 2D confinados em Z ???????????????????????????
439
- # ========================================= ????????????????????????????????????????????????????????????????????????????????????????????????????????????
440
- l_pot = 'null'; l_pot_SO = 'null'
441
- #-----------------------------------------------------------
442
- if os.path.isfile('output/Potencial_bands/Potencial_Z.dat'): l_pot = 'output/Potencial_bands/Potencial_Z.dat'
443
- if os.path.isfile('output/Potencial_scf/Potencial_Z.dat'): l_pot = 'output/Potencial_scf/Potencial_Z.dat'
444
- if os.path.isfile('output/Potencial_bands_SO/Potencial_Z.dat'): l_pot_SO = 'output/Potencial_bands_SO/Potencial_Z.dat'
445
- if os.path.isfile('output/Potencial_scf_SO/Potencial_Z.dat'): l_pot_SO = 'output/Potencial_scf_SO/Potencial_Z.dat'
446
- #------------------------------------------------------------
447
- if (l_pot != 'null'):
448
- file0 = np.loadtxt(l_pot)
449
- file0.shape
450
- #-----------------
451
- date_e = file0[:,1]
452
- e_vacuum = max(date_e)
453
- #------------------------
454
- if (l_pot_SO != 'null'):
455
- file1 = np.loadtxt(l_pot_SO)
456
- file1.shape
457
- #-----------------
458
- date_e = file1[:,1]
459
- e_vacuum = max(date_e)
460
-
461
-
462
- # ===========================================
463
- # Extraindo dados da saída do VASProcar =====
464
- # ===========================================
465
- with open('output/' + file, "r") as info: lines = info.readlines()
466
- #-----------------------------------------------------------------
467
- for i in range(len(lines)):
468
- VTemp = lines[i].replace('(', ' ( ').replace(')', ' ) ').replace(';', '').replace(',', '').split()
469
- if (len(VTemp) > 0):
470
- #----------------------------------------
471
- if (VTemp[0] == 'LNONCOLLINEAR'): non_collinear = str(VTemp[2])
472
- #----------------------------------------
473
- elif (VTemp[0] == 'LSORBIT'): spin_orbit = str(VTemp[2])
474
- #----------------------------------------
475
- elif (VTemp[0] == 'nº' or VTemp[0] == 'nº'):
476
- if (VTemp[1] == 'k-points'): nk = int(VTemp[3])
477
- if (VTemp[5] == 'bands'): nb = int(VTemp[7])
478
- if (VTemp[1] == 'ions'): ni = int(VTemp[3])
479
- if (VTemp[5] == 'electrons'): ne = float(VTemp[7])
480
- #----------------------------------------
481
- elif (VTemp[0] == 'LORBIT'):
482
- lorbit = int(VTemp[2])
483
- if (VTemp[3] == 'ISPIN'): ispin = int(VTemp[5])
484
- #----------------------------------------
485
- elif (VTemp[0] == 'Last'): vbm = int(VTemp[4])
486
- #----------------------------------------
487
- elif (VTemp[0] == 'First'): cbm = vbm +1
488
- #----------------------------------------
489
- elif (VTemp[0] == 'Valence'):
490
- e_vbm = float(VTemp[7])
491
- tk_vbm = int(VTemp[11])
492
- #----------------------------------------
493
- elif (VTemp[0] == 'Conduction'):
494
- e_cbm = float(VTemp[7])
495
- tk_cbm = int(VTemp[11])
496
- #----------------------------------------
497
- elif (VTemp[0] == 'GAP'):
498
- type_gap = str(VTemp[2])
499
- gap = float(VTemp[5])
500
- #----------------------------------------
501
- elif (VTemp[0] == 'Fermi'): e_fermi = float(VTemp[3])
502
- #----------------------------------------
503
- elif (VTemp[0] == 'free'):
504
- total_energy = float(VTemp[4])
505
- e_per_ion = total_energy/ni
506
- #----------------------------------------
507
- elif (VTemp[0] == 'Volume_cell'): Volume_cell = float(VTemp[2])
508
- #----------------------------------------
509
- elif (VTemp[0] == 'Param.'): param = float(VTemp[2])
510
- #----------------------------------------
511
- elif (VTemp[0] == 'A1'):
512
- a1 = [float(VTemp[4])*param, float(VTemp[5])*param, float(VTemp[6])*param]
513
- 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))
514
- elif (VTemp[0] == 'A2'):
515
- a2 = [float(VTemp[4])*param, float(VTemp[5])*param, float(VTemp[6])*param]
516
- A2 = np.array([float(VTemp[4]), float(VTemp[5]), float(VTemp[6])])*param; module_a1_a2_a3.append(np.linalg.norm(A2))
517
- elif (VTemp[0] == 'A3'):
518
- a3 = [float(VTemp[4])*param, float(VTemp[5])*param, float(VTemp[6])*param]
519
- A3 = np.array([float(VTemp[4]), float(VTemp[5]), float(VTemp[6])])*param; module_a1_a2_a3.append(np.linalg.norm(A3))
520
- #-------------------------------------------------------
521
- angle_a1a2_a1a3_a2a3 = []
522
- angle_a1a2_a1a3_a2a3.append(round(np.degrees(np.arccos(np.dot(A1,A2) / (np.linalg.norm(A1) * np.linalg.norm(A2)))), 3))
523
- angle_a1a2_a1a3_a2a3.append(round(np.degrees(np.arccos(np.dot(A1,A3) / (np.linalg.norm(A1) * np.linalg.norm(A3)))), 3))
524
- angle_a1a2_a1a3_a2a3.append(round(np.degrees(np.arccos(np.dot(A2,A3) / (np.linalg.norm(A2) * np.linalg.norm(A3)))), 3))
525
- #----------------------------------------
526
- elif (VTemp[0] == '2pi/Param.'): fator_rec = float(VTemp[2])
527
- #----------------------------------------
528
- elif (VTemp[0] == 'B1'):
529
- b1 = [float(VTemp[4])*fator_rec, float(VTemp[5])*fator_rec, float(VTemp[6])*fator_rec]
530
- 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))
531
- elif (VTemp[0] == 'B2'):
532
- b2 = [float(VTemp[4])*fator_rec, float(VTemp[5])*fator_rec, float(VTemp[6])*fator_rec]
533
- B2 = np.array([float(VTemp[4]), float(VTemp[5]), float(VTemp[6])])*fator_rec; module_b1_b2_b3.append(np.linalg.norm(B2))
534
- elif (VTemp[0] == 'B3'):
535
- b3 = [float(VTemp[4])*fator_rec, float(VTemp[5])*fator_rec, float(VTemp[6])*fator_rec]
536
- B3 = np.array([float(VTemp[4]), float(VTemp[5]), float(VTemp[6])])*fator_rec; module_b1_b2_b3.append(np.linalg.norm(B3))
537
- #-------------------------------------------------------
538
- angle_b1b2_b1b3_b2b3 = []
539
- angle_b1b2_b1b3_b2b3.append(round(np.degrees(np.arccos(np.dot(B1,B2) / (np.linalg.norm(B1) * np.linalg.norm(B2)))), 3))
540
- angle_b1b2_b1b3_b2b3.append(round(np.degrees(np.arccos(np.dot(B1,B3) / (np.linalg.norm(B1) * np.linalg.norm(B3)))), 3))
541
- angle_b1b2_b1b3_b2b3.append(round(np.degrees(np.arccos(np.dot(B2,B3) / (np.linalg.norm(B2) * np.linalg.norm(B3)))), 3))
542
- #----------------------------------------
543
- elif (VTemp[0] == 'Volume_ZB'): vol_zb = float(VTemp[2])
544
- #----------------------------------------
545
- elif (VTemp[0] == 'k-points'): loop = i+3
546
-
547
-
548
- # ===========================================
549
- # Buscando os pontos-k do GAP da banda ======
550
- # ===========================================
551
- if (file == 'info_bands.txt' or file == 'info_bands_SO.txt'):
552
- if (n == 0): info = open('output/info_bands.txt', "r")
553
- if (n == 1): info = open('output/info_bands_SO.txt', "r")
554
- #-----------
555
- test = 'nao'
556
- #-----------
557
- while (test == 'nao'):
558
- #--------------------------------
559
- VTemp = info.readline().split()
560
- #-----------------------------------------------------------
561
- if (len(VTemp) > 0 and VTemp[0] == 'k-points'): test = 'sim'
562
- #-----------------------------------------------------------
563
- for nn in range(2): VTemp = info.readline()
564
- for nn in range(1,(nk+1)):
565
- VTemp = info.readline().split()
566
- if (nn == int(tk_vbm)): k_vbm = [float(VTemp[1]), float(VTemp[2]), float(VTemp[3])]
567
- if (nn == int(tk_cbm)): k_cbm = [float(VTemp[1]), float(VTemp[2]), float(VTemp[3])]
568
-
569
-
570
- # =================================================================
571
- # Buscando os valores para a Transferência de Carga de Bader ======
572
- # =================================================================
573
- if (n_materials > 1):
574
- #===========
575
- if (n == 0):
576
- if os.path.isfile('output/Charge_transfer/Bader_charge_transfer.dat'):
577
- file_bader = 'output/Charge_transfer/Bader_charge_transfer.dat'
578
- #----------------------------
579
- bader = open(file_bader, "r")
580
- for nn in range(4): VTemp = bader.readline()
581
- for mn in range(len(t_ions_materials)):
582
- vector_bader = []
583
- VTemp = bader.readline()
584
- VTemp = bader.readline().split()
585
- vector_bader.append(float(VTemp[2]))
586
- for mm in range(len(t_ions_materials[mn])):
587
- VTemp = bader.readline().split()
588
- vector_bader.append(float(VTemp[3]))
589
- charge_transfer.append(vector_bader)
590
- #===========
591
- if (n == 1):
592
- if os.path.isfile('output/Charge_transfer_SO/Bader_charge_transfer.dat'):
593
- file_bader = 'output/Charge_transfer_SO/Bader_charge_transfer.dat'
594
- #----------------------------
595
- bader = open(file_bader, "r")
596
- for nn in range(4): VTemp = bader.readline()
597
- for mn in range(len(t_ions_materials)):
598
- vector_bader = []
599
- VTemp = bader.readline()
600
- VTemp = bader.readline().split()
601
- vector_bader.append(float(VTemp[2]))
602
- for mm in range(len(t_ions_materials[mn])):
603
- VTemp = bader.readline().split()
604
- vector_bader.append(float(VTemp[3]))
605
- charge_transfer.append(vector_bader)
606
-
607
-
608
- """
609
- # ===========================================================
610
- # Obtando e organizando as informações dos pontos-k =========
611
- # ===========================================================
612
- if (file == 'info_bands.txt' or file == 'info_bands_SO.txt'):
613
- #---------------------------------
614
- info = open('output/' + file, "r")
615
- #---------------------------------
616
- if (loop != 0):
617
- #-----------------------------------------------------
618
- k_points_direct = []; k_points_cart = []; k_path = []
619
- #---------------------------------------------
620
- for i in range(loop): VTemp = info.readline()
621
- for i in range(nk):
622
- VTemp = info.readline().split()
623
- k_points_direct.append([float(VTemp[1]), float(VTemp[2]), float(VTemp[3])])
624
- k_points_cart.append([float(VTemp[4]), float(VTemp[5]), float(VTemp[6])])
625
- k_path.append(float(VTemp[7]))
626
- print(k_path)
627
- #-----------
628
- info.close()
629
- """
630
-
631
-
632
- # =========================================================
633
- # Obtendo as simetrias da rede ============================
634
- # =========================================================
635
-
636
- #--------------------------------------------------------------------
637
- # Dicionário de mapeamento de Hermann-Mauguin para Schoenflies ------
638
- #--------------------------------------------------------------------
639
- 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",
640
- "422": "D4", "4mm": "C4v", "-42m": "D2d", "4/mmm": "D4h", "3": "C3", "-3": "C3i", "32": "D3", "3m": "C3v", "-3m": "D3d", "6": "C6", "-6": "C3h",
641
- "6/m": "C6h", "622": "D6", "6mm": "C6v", "-6m2": "D3h", "6/mmm": "D6h", "23": "T", "m-3": "Th", "432": "O", "-43m": "Td", "m-3m": "Oh"}
642
- #--------------------------------------------------------------------
643
- if (n_materials == 1): passo = 1
644
- if (n_materials > 1): passo = n_materials +1
645
- #--------------------------------------------
646
- for i in range(passo):
647
- #-----------------
648
- if (i == 0): structure = Poscar.from_file('output/POSCAR.info').structure
649
- if (i > 0): structure = Poscar.from_file('output/POSCAR.material_' + str(i)).structure
650
- analyzer = SpacegroupAnalyzer(structure)
651
- #----------------------------------------------------
652
- point_group.append(analyzer.get_point_group_symbol())
653
- space_group.append(analyzer.get_space_group_symbol())
654
- space_group_number.append(analyzer.get_space_group_number())
655
- inversion_symmetry.append(analyzer.is_laue())
656
- if (i == 0): lattice_type = analyzer.get_lattice_type()
657
- point_group_schoenflies.append(schoenflies.get(point_group[0], "Desconhecido"))
658
- #------------------------------------------------------------------------------
659
- # if (i > 0): os.remove('output/POSCAR.material_' + str(i)) # ERROR !!!!!!!!!!!
660
-
661
-
662
- #=======================================
663
- # Obtendo a área no plano XY da rede ===
664
- #=======================================
665
- V1 = np.array([A1[0], A1[1]])
666
- V2 = np.array([A2[0], A2[1]])
667
- #----------------------------
668
- # Área da célula no plano XY
669
- Area_cell = np.linalg.norm(np.cross(V1, V2))
670
- #-------------------------------------------
671
-
672
-
673
- #=======================================
674
- # Obtendo a área no plano KxKy da ZB ===
675
- #=======================================
676
- V1 = np.array([B1[0], B1[1]])
677
- V2 = np.array([B2[0], B2[1]])
678
- #----------------------------
679
- # Área da zb no plano KxKy
680
- Area_ZB = np.linalg.norm(np.cross(V1, V2))
681
- #-----------------------------------------
682
-
683
-
684
- # ===========================================
685
- # Criando o Dicionário ======================
686
- # ===========================================
687
-
688
- dados0 = {
689
- "id": id_code,
690
- "number_layers": n_materials,
691
- "id_layers": id_materials,
692
- "formula": estequiometria,
693
- "type_ions_layers": t_ions_materials,
694
- "number_ions_layers": nions_materials,
695
- "number_type_ions_layers": t_nions_materials,
696
- "range_ions_layers": r_ions_materials,
697
- "number_ions": ni,
698
- # ---------------------------------------------------------------------
699
- "area_perc_mismatch": area_perc_mismatch if n_materials > 1 else None,
700
- "perc_area_change": perc_area_change if n_materials > 1 else None,
701
- "perc_mod_vectors_change": perc_mod_vectors_change if n_materials > 1 else None,
702
- "angle_perc_mismatch": angle_perc_mismatch if n_materials > 1 else None,
703
- "perc_angle_change": perc_angle_change if n_materials > 1 else None,
704
- "rotation_angle": rotation_angle if n_materials > 1 else None,
705
- "supercell_matrix": supercell_matrix if n_materials > 1 else None,
706
- "deformation_matrix": deformation_matrix if n_materials > 1 else None,
707
- "strain_matrix": strain_matrix if n_materials > 1 else None,
708
- "shift_plane": shift_plane if n_materials > 1 else None,
709
- # ---------------------------------------------------------------------
710
- "lattice_type": lattice_type,
711
- "point_group": point_group,
712
- # "point_group_schoenflies": point_group_schoenflies,
713
- "space_group": space_group,
714
- "space_group_number": space_group_number,
715
- "inversion_symmetry": inversion_symmetry,
716
- "pseudo_type": pseudo_type,
717
- "exchange_correlation_functional": exchange_correlation_functional,
718
- "vdW": vdW,
719
- "non_collinear": non_collinear,
720
- "spin_orbit": spin_orbit,
721
- "z_separation": z_separation if n_materials > 1 else None,
722
- "thickness": thickness,
723
- "total_thickness": total_thickness,
724
- # "param_a": param,
725
- "a1": a1,
726
- "a2": a2,
727
- "a3": a3,
728
- "module_a1_a2_a3": module_a1_a2_a3,
729
- "angle_a1a2_a1a3_a2a3": angle_a1a2_a1a3_a2a3,
730
- "cell_area": Area_cell,
731
- # "cell_vol": Volume_cell,
732
- # "param_b": fator_rec,
733
- "b1": b1,
734
- "b2": b2,
735
- "b3": b3,
736
- "module_b1_b2_b3": module_b1_b2_b3,
737
- "angle_b1b2_b1b3_b2b3": angle_b1b2_b1b3_b2b3,
738
- "zb_area": Area_ZB,
739
- # "zb_volume": vol_zb,
740
- "direct_coord_ions": coord_ions,
741
- "kpath": kpath,
742
- }
743
-
744
-
745
- if (n == 0):
746
- #---------
747
- dados1 = {
748
- "lorbit": lorbit,
749
- "ispin": ispin,
750
- "nk": nk,
751
- "nb": nb,
752
- "ne": ne,
753
- "gap": gap,
754
- "e_vbm": e_vbm,
755
- "e_cbm": e_cbm,
756
- "vbm": vbm,
757
- "cbm": cbm,
758
- "type_gap": type_gap,
759
- "k_vbm": k_vbm,
760
- "k_cbm": k_cbm,
761
- "e_fermi": e_fermi,
762
- "e_vacuum": e_vacuum,
763
- # "work_function": work_function,
764
- "total_energy": total_energy,
765
- "e_per_ion": e_per_ion,
766
- "e_binding": e_binding if n_materials > 1 else None,
767
- "e_slide": e_slide if n_materials > 1 else None,
768
- "charge_transfer": charge_transfer if n_materials > 1 else None,
769
- }
770
-
771
-
772
- if (n == 1):
773
- #---------
774
- dados1 = {
775
- "lorbit_SO": lorbit,
776
- "ispin_SO": ispin,
777
- "nk_SO": nk,
778
- "nb_SO": nb,
779
- "ne_SO": ne,
780
- "gap_SO": gap,
781
- "e_vbm_SO": e_vbm,
782
- "e_cbm_SO": e_cbm,
783
- "vbm_SO": vbm,
784
- "cbm_SO": cbm,
785
- "type_gap_SO": type_gap,
786
- "k_vbm_SO": k_vbm,
787
- "k_cbm_SO": k_cbm,
788
- "e_fermi_SO": e_fermi,
789
- "e_vacuum_SO": e_vacuum,
790
- # "work_function_SO": work_function,
791
- "total_energy_SO": total_energy,
792
- "e_per_ion_SO": e_per_ion,
793
- "charge_transfer": charge_transfer if n_materials > 1 else None,
794
- }
795
-
796
-
797
- # ==================================================
798
- # Inserindo as informações no arquivo .json ========
799
- # ==================================================
800
- with open('output/info.json', 'r') as file: data = json.load(file) # Carregando o conteúdo atual do arquivo info.json
801
- data.update(dados0) # Atualizando o dicionário com as novas informações
802
- with open('output/info.json', 'w') as file: json.dump(data, file, indent=4) # Salvar o conteúdo atualizado no arquivo info.json
803
- #----------------------
804
- with open('output/info.json', 'r') as file: data = json.load(file) # Carregando o conteúdo atual do arquivo info.json
805
- data.update(dados1) # Atualizando o dicionário com as novas informações
806
- with open('output/info.json', 'w') as file: json.dump(data, file, indent=4) # Salvar o conteúdo atualizado no arquivo info.json
807
-
808
-
809
- #===============================================================
810
- # Atualizando os arquivos POSCAR e CONTCAR =====================
811
- #===============================================================
812
- with open('output/POSCAR', 'r') as file: line = file.readlines()
813
- tline = line[0].split()
814
- #--------------------
815
- replace_line = tline[0] + ' ' + tline[1] + ' '
816
- for i in range(n_materials): replace_line += tline[2 +i] + ' '
817
- replace_line += tline[-1] + '\n'
818
- #------------------------------
819
- line[0] = replace_line
820
- with open('output/POSCAR', 'w') as file: file.writelines(line)
821
- #================================================================
822
- with open('output/CONTCAR', 'r') as file: line = file.readlines()
823
- line[0] = replace_line
824
- with open('output/CONTCAR', 'w') as file: file.writelines(line)
825
- #==============================================================
826
-
827
-
828
- """
829
- # ===============================================
830
- # Abrindo e lendo o data-base .json =============
831
- # ===============================================
832
- with open('output/info.json', "r") as file_json: date = json.load(file_json)
833
- #------------------------------------------------
834
- print(" ")
835
- print("===========================")
836
- print("Dados do arquivo info.json:")
837
- print("===========================")
838
- print(" ")
839
- for chave, valor in date.items(): print(f"{chave}: {valor}")
840
- """
File without changes
File without changes