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

construct default structure from prim #38

Open
xivh opened this issue Apr 3, 2024 · 1 comment
Open

construct default structure from prim #38

xivh opened this issue Apr 3, 2024 · 1 comment

Comments

@xivh
Copy link
Contributor

xivh commented Apr 3, 2024

It would be nice to have a function which constructs the default structure (first occupant at each site) from a prim.

@bpuchala
Copy link
Collaborator

Feel free to write a libcasm.xtal.make_default_structure(prim: libcasm.xtal.Prim) function. For most cases, I think it is:

default_structure = xtal.Structure(
    lattice=prim.lattice(),
    atom_coordinate_frac=prim.coordinate_frac(),
    atom_type=[x[0] for x in prim.occ_dof()],
)

Maybe you also want checks for vacancies, and a include_vacancies: bool argument.

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

2 participants