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.
- {surface_construct-0.5.13/surface_construct.egg-info → surface_construct-0.5.14}/PKG-INFO +1 -1
- {surface_construct-0.5.13 → surface_construct-0.5.14}/setup.py +1 -1
- {surface_construct-0.5.13 → surface_construct-0.5.14}/surface_construct/surface_grid.py +20 -11
- {surface_construct-0.5.13 → surface_construct-0.5.14/surface_construct.egg-info}/PKG-INFO +1 -1
- {surface_construct-0.5.13 → surface_construct-0.5.14}/LICENSE +0 -0
- {surface_construct-0.5.13 → surface_construct-0.5.14}/README.md +0 -0
- {surface_construct-0.5.13 → surface_construct-0.5.14}/setup.cfg +0 -0
- {surface_construct-0.5.13 → surface_construct-0.5.14}/surface_construct/__init__.py +0 -0
- {surface_construct-0.5.13 → surface_construct-0.5.14}/surface_construct/atoms.py +0 -0
- {surface_construct-0.5.13 → surface_construct-0.5.14}/surface_construct/db.py +0 -0
- {surface_construct-0.5.13 → surface_construct-0.5.14}/surface_construct/default_parameter.py +0 -0
- {surface_construct-0.5.13 → surface_construct-0.5.14}/surface_construct/sampling.py +0 -0
- {surface_construct-0.5.13 → surface_construct-0.5.14}/surface_construct/structure.py +0 -0
- {surface_construct-0.5.13 → surface_construct-0.5.14}/surface_construct/surface.py +0 -0
- {surface_construct-0.5.13 → surface_construct-0.5.14}/surface_construct/utils.py +0 -0
- {surface_construct-0.5.13 → surface_construct-0.5.14}/surface_construct.egg-info/SOURCES.txt +0 -0
- {surface_construct-0.5.13 → surface_construct-0.5.14}/surface_construct.egg-info/dependency_links.txt +0 -0
- {surface_construct-0.5.13 → surface_construct-0.5.14}/surface_construct.egg-info/requires.txt +0 -0
- {surface_construct-0.5.13 → surface_construct-0.5.14}/surface_construct.egg-info/top_level.txt +0 -0
- {surface_construct-0.5.13 → surface_construct-0.5.14}/tests/test_surface_grid.py +0 -0
- {surface_construct-0.5.13 → surface_construct-0.5.14}/tests/test_systematic_opt.py +0 -0
|
@@ -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
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
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)
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{surface_construct-0.5.13 → surface_construct-0.5.14}/surface_construct/default_parameter.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{surface_construct-0.5.13 → surface_construct-0.5.14}/surface_construct.egg-info/SOURCES.txt
RENAMED
|
File without changes
|
|
File without changes
|
{surface_construct-0.5.13 → surface_construct-0.5.14}/surface_construct.egg-info/requires.txt
RENAMED
|
File without changes
|
{surface_construct-0.5.13 → surface_construct-0.5.14}/surface_construct.egg-info/top_level.txt
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|