AtomsSystems is meant to provide updated AtomsBase
systems structures over the standard FlexibleSystem and FastSystem.
Additionally AtomsSystems provides some useful utilities, like fractional coordinates.
There are three commands that will do most of the things you want
SimpleAtombuild atomsgeneric_systembuild systemssystem_viewtake a subsystem from a system without allocating new system
You can look the docstrings for these commands to get going. Documentation has additional information what you can do, including utility functions.
Here is a quick example on what you can do
using AtomsBase
using AtomsSystems
using Unitful
# Make a water molecule
sys = generic_system"""
O -2.1 0.6 0.0
H -1.4 0.4 0.6
H -1.8 1.3 -0.6
"""
# Add cell to the system (by default periodic)
sys = generic_system(sys; cell_vectors = [
[5., 0., 0.]u"Å",
[0., 5., 0.]u"Å",
[0., 0., 5.]u"Å"],
)
# Set periodicity conditions
sys = generic_system(sys; periodicity=(false, true, false))
# Add additional data
sys = generic_system(sys; energy=1.2u"eV", label="my water")Using SimpleAtoms gives you better control on what features atoms have
# First build a vector of atoms
# Syntax is SimpleAtom(species, pos, [vel]; kwords...)
# or SimpleAtom(species, x, y, z; kwords...) e.g. SimpleAtom(:O, -2.1, 0.6, 0.0)
atoms = [
SimpleAtom(:O, [-2.1, 0.6, 0.0]u"Å"; mass=16.5u"u" )
SimpleAtom(:H, [-1.4, 0.4, 0.6]u"Å"; mass=2.3u"u" )
SimpleAtom(:H, [-1.8, 1.3, -0.6]u"Å"; mass=3.3u"u" )
]
# You can add more features to existing atoms
atoms = [
SimpleAtom( atoms[1]; velocity=[0.1, 0.2, 0.0]u"Å/fs" , charge=-1.0u"q" )
SimpleAtom( atoms[2]; velocity=[-0.2, 0.0, 0.1]u"Å/fs", charge=1.0u"q" )
SimpleAtom( atoms[3]; velocity=[0.0, -0.1, 0.2]u"Å/fs", charge=0.0u"q" )
]
# Use vector of atoms to build a system
sys = generic_system(atoms)