Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Periodic hexagonal atomistic lattice creation fails #129

Open
rpep opened this issue Jan 28, 2019 · 0 comments
Open

Periodic hexagonal atomistic lattice creation fails #129

rpep opened this issue Jan 28, 2019 · 0 comments

Comments

@rpep
Copy link
Member

rpep commented Jan 28, 2019

nx = 22
ny = 21
nz = 1

a = 2.5

unit_length = 1e-10
mesh = fidimag.atomistic.HexagonalMesh(nx=nx, ny=ny, 
                                                                        alignment='square',
                                                                        radius=a/2.0, unit_length=unit_length,
                                                                        periodicity=(True, False))

Returns:

---------------------------------------------------------------------------
IndexError                                Traceback (most recent call last)
<ipython-input-18-7a2772fa88e0> in <module>
     28 
     29 mesh = fidimag.atomistic.HexagonalMesh(nx=nx, ny=ny, alignment='square',
---> 30                                        radius=a/2.0, unit_length=unit_length, periodicity=(True, False))

~/git/fidimag/fidimag/atomistic/hexagonal_mesh.py in __init__(self, radius, nx, ny, periodicity, unit_length, alignment, shells)
    176         self.unit_length = unit_length
    177 
--> 178         self.vertices, self.hexagons = self.init_grid()
    179 
    180     def init_coordinates(self):

~/git/fidimag/fidimag/atomistic/hexagonal_mesh.py in init_grid(self)
    303                 # let the False statements just in case)
    304                 if W is not (False or -1):  # can't replace by if W because 0 == False
--> 305                     hexagon.append(hexagons[W][0])  # our NW (2) is west's NE (0)
    306                 else:
    307                     vertices.append(corners[2])

IndexError: list index out of range
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant