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

Add wrapping and scaling methods to class Box #50

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

PhilLecl
Copy link
Contributor

See #11

This adds methods for converting wrapped/unwrapped and scaled/real coordinates.

I also have a (rudimentary) implementation for reading dumps with scaled and/or unwrapped coordinates at https://github.com/PhilLecl/lammpsio/tree/read-dump-su.
I've used it together with the dumps generated by the input script below to test the calculations.
Note that unwrapping can cause the floating point error to become rather large.


# randomly generated periodic triclinic simulation box
units real
region r1 prism -87 9 -80 58 -63 83 9 -13 5
boundary p p p
create_box 1 r1
mass * 1

# some random atoms with random velocities
create_atoms 1 random 100 20240519 NULL
velocity all create 298.15 20240519
fix thermostat all nvt temp 298.15 298.15 100.0

# dumps
dump d1 all custom 1000 dump.position_i id x y z ix iy iz
dump d2 all custom 1000 dump.position_u id xu yu zu
dump d3 all custom 1000 dump.position_si id xs ys zs ix iy iz
dump d4 all custom 1000 dump.position_su id xsu ysu zsu

# run
run 100000

@mphoward
Copy link
Contributor

mphoward commented Jun 4, 2024

Thank you! This will be a nice feature to have available, and we will work to add some tests for it soon.

I would also welcome a pull request to support reading from / writing to scaled or unwrapped coordinates when you are ready. Could you open an issue so we can discuss that before you do so? I'd like to discuss a plan for that first, particularly whether multiple of those are allowed to be in a dump file and how lammpsio will transform them when they're read in.

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.

2 participants