ISISNeutronMuon / ISISNeutronMuon/MDMC

StructuralUnit Universe can be set during initialisation

Open
#169 2 comments 0 reactions 0 assignees View on GitHub
enhancement P1
Dominant language
Python
Stars
4
Forks
0
Avg merge
2d 4h
Merged PRs (30d)
5

Description

**Is your feature request related to a problem? Please describe.**
Currently atoms are created and are then added to a Universe object using Universe.add_structural_unit. It should be possible to add them to a universe during Atom initialisation or by setting the Atom.universe attribute.

**Describe the solution you'd like**
Allow Atom.universe to be set. When setting it, check if atom is in Universe.atom_list - if it is not, then call Universe.add_structural_unit to add the atom to the universe.

**Additional context**
A potential problem with allowing this additional flexibility is that it complicates the atom_type issue. Firstly if an atom is init with both a universe and an atom_type, **the atom_type must be set first**. This will stop the universe generating an atom_type for the atom. Secondly, as all atoms added to a universe in this manner will not have any interactions defined on them (except possibly Coulombic depending on another feature being implemented - see #168 ), all atoms of the same element will have the same atom_type set. This is not necessarily a problem, but something that the user has to be aware of - it would be advisable (unless all atoms of the same element are to have the same atom_type) for the user to specify the atom_type if they are adding an element directly to a Universe.

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.