structuretoolkit.build.mesh.create_mesh#
- structuretoolkit.build.mesh.create_mesh(cell: Atoms | ndarray | list | float, n_mesh: int | list[int] | None = 10, density: float | None = None, endpoint: bool = False)[source]#
Create a mesh based on a structure cell
- Parameters:
cell (ase.atoms.Atoms|np.ndarray|list|float) – ASE Atoms or cell
n_mesh (int) – Number of grid points in each direction. If one number is given, it will be repeated in every direction (i.e. n_mesh = 3 is the same as n_mesh = [3, 3, 3])
density (float) – Density of grid points. Ignored when n_mesh is not None
endpoint (bool) – Whether both the edges get separate points or not. cf. endpoint in numpy.linspace
- Returns:
mesh
- Return type:
(3, n, n, n)-array