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

Simplify Molly interface #38

Merged
merged 4 commits into from
Aug 25, 2023
Merged

Simplify Molly interface #38

merged 4 commits into from
Aug 25, 2023

Conversation

tjjarvinen
Copy link
Collaborator

This will simplify Molly interface #34.

New interface can be used as

using Molly
using ACEmd

using ExtXYZ
using Unitful


# Load ACE model and initial structure
fname_ace = joinpath(pkgdir(ACEmd), "data", "TiAl.json")
fname_xyz = joinpath(pkgdir(ACEmd), "data", "TiAl-big.xyz")

data = ExtXYZ.Atoms(read_frame(fname_xyz))
pot = load_ace_model(fname_ace)

# Pack data to Molly compatible format
# data is AtomsBase compatible structure
sys = Molly.System(data, pot)

# Set up temperature and velocities
temp = 298.0u"K"
vel = random_velocities(sys, temp)

# Add initial velocities and loggers
sys = Molly.System(
    sys;
    velocities = vel,
    loggers=(temp=TemperatureLogger(100),)
)

# Set up simulator
simulator = VelocityVerlet(
    dt=1.0u"fs",
    coupling=AndersenThermostat(temp, 1.0u"ps"),
)


# Perform MD
simulate!(sys, simulator, 1000)

@cortner how do you like this way of building system or would you prefer something else?

@tjjarvinen tjjarvinen merged commit c62f0c0 into main Aug 25, 2023
@tjjarvinen tjjarvinen deleted the molly_interface_update branch August 25, 2023 21:28
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

Successfully merging this pull request may close these issues.

1 participant