surface-construct 0.5.13__tar.gz → 0.5.14__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 (21) hide show
  1. {surface_construct-0.5.13/surface_construct.egg-info → surface_construct-0.5.14}/PKG-INFO +1 -1
  2. {surface_construct-0.5.13 → surface_construct-0.5.14}/setup.py +1 -1
  3. {surface_construct-0.5.13 → surface_construct-0.5.14}/surface_construct/surface_grid.py +20 -11
  4. {surface_construct-0.5.13 → surface_construct-0.5.14/surface_construct.egg-info}/PKG-INFO +1 -1
  5. {surface_construct-0.5.13 → surface_construct-0.5.14}/LICENSE +0 -0
  6. {surface_construct-0.5.13 → surface_construct-0.5.14}/README.md +0 -0
  7. {surface_construct-0.5.13 → surface_construct-0.5.14}/setup.cfg +0 -0
  8. {surface_construct-0.5.13 → surface_construct-0.5.14}/surface_construct/__init__.py +0 -0
  9. {surface_construct-0.5.13 → surface_construct-0.5.14}/surface_construct/atoms.py +0 -0
  10. {surface_construct-0.5.13 → surface_construct-0.5.14}/surface_construct/db.py +0 -0
  11. {surface_construct-0.5.13 → surface_construct-0.5.14}/surface_construct/default_parameter.py +0 -0
  12. {surface_construct-0.5.13 → surface_construct-0.5.14}/surface_construct/sampling.py +0 -0
  13. {surface_construct-0.5.13 → surface_construct-0.5.14}/surface_construct/structure.py +0 -0
  14. {surface_construct-0.5.13 → surface_construct-0.5.14}/surface_construct/surface.py +0 -0
  15. {surface_construct-0.5.13 → surface_construct-0.5.14}/surface_construct/utils.py +0 -0
  16. {surface_construct-0.5.13 → surface_construct-0.5.14}/surface_construct.egg-info/SOURCES.txt +0 -0
  17. {surface_construct-0.5.13 → surface_construct-0.5.14}/surface_construct.egg-info/dependency_links.txt +0 -0
  18. {surface_construct-0.5.13 → surface_construct-0.5.14}/surface_construct.egg-info/requires.txt +0 -0
  19. {surface_construct-0.5.13 → surface_construct-0.5.14}/surface_construct.egg-info/top_level.txt +0 -0
  20. {surface_construct-0.5.13 → surface_construct-0.5.14}/tests/test_surface_grid.py +0 -0
  21. {surface_construct-0.5.13 → surface_construct-0.5.14}/tests/test_systematic_opt.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: surface_construct
3
- Version: 0.5.13
3
+ Version: 0.5.14
4
4
  Summary: Surface termination construction especially for complex model, such as oxides or carbides.
5
5
  Home-page: https://gitee.com/pjren/surface_construct/
6
6
  Author: ren
@@ -17,7 +17,7 @@ install_requires = [
17
17
 
18
18
  setup(
19
19
  name='surface_construct',
20
- version='0.5.13',
20
+ version='0.5.14',
21
21
  packages=['surface_construct'],
22
22
  url='https://gitee.com/pjren/surface_construct/',
23
23
  license='GPL',
@@ -165,22 +165,31 @@ class SurfaceGrid:
165
165
  result[dim, int((sign+1)/2)] = v
166
166
  return np.concatenate(result) # [xmin, xmax, ymin, ymax, zmin, zmax]
167
167
 
168
- def gridize(self, surface_index=None):
168
+ def gridize(self, surface_index=None, gridxy=None):
169
169
  """
170
170
  格点化。
171
171
  这种方法仅仅适用于无孔的材料,表面为z方向,且方向向上。
172
+ * gridxy: [X, Y] 2D meshgrid
173
+ * surface_index: 表面原子的序号
172
174
  :return:
173
175
  """
174
- nx, ny = self.grid_nx, self.grid_ny
175
-
176
- fx_list = np.linspace(0, 1, nx, endpoint=False) # endpoint=false指的是不包括右侧端点
177
- fy_list = np.linspace(0, 1, ny, endpoint=False)
178
- # 格点生成
179
- fgrid_x, fgrid_y = np.meshgrid(fx_list, fy_list)
180
- fxyz = np.zeros((nx * ny, 3))
181
- fxyz[:, 0] = fgrid_x.reshape(nx * ny)
182
- fxyz[:, 1] = fgrid_y.reshape(nx * ny)
183
- xyz = self.atoms.cell.cartesian_positions(fxyz)
176
+ if gridxy is None:
177
+ nx, ny = self.grid_nx, self.grid_ny
178
+
179
+ fx_list = np.linspace(0, 1, nx, endpoint=False) # endpoint=false指的是不包括右侧端点
180
+ fy_list = np.linspace(0, 1, ny, endpoint=False)
181
+ # 格点生成
182
+ fgrid_x, fgrid_y = np.meshgrid(fx_list, fy_list)
183
+ fxyz = np.zeros((nx * ny, 3))
184
+ fxyz[:, 0] = fgrid_x.reshape(nx * ny)
185
+ fxyz[:, 1] = fgrid_y.reshape(nx * ny)
186
+ xyz = self.atoms.cell.cartesian_positions(fxyz)
187
+ else:
188
+ Xgrid, Ygrid = gridxy
189
+ x = Xgrid.reshape(-1)
190
+ y = Ygrid.reshape(-1)
191
+ z = np.zeros(x.shape)
192
+ xyz = np.asarray([x, y, z]).T
184
193
 
185
194
  xmin, xmax, ymin, ymax, zmin, zmax = self.structure_boundary()
186
195
  condition = (xyz[:, 0] > xmin) * (xyz[:, 0] < xmax) * (xyz[:, 1] > ymin) * (xyz[:, 1] < ymax)
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: surface_construct
3
- Version: 0.5.13
3
+ Version: 0.5.14
4
4
  Summary: Surface termination construction especially for complex model, such as oxides or carbides.
5
5
  Home-page: https://gitee.com/pjren/surface_construct/
6
6
  Author: ren