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

Make center of mass computation of a molecule more robust? #95

Open
g-bauer opened this issue Feb 3, 2017 · 5 comments
Open

Make center of mass computation of a molecule more robust? #95

g-bauer opened this issue Feb 3, 2017 · 5 comments
Labels

Comments

@g-bauer
Copy link
Contributor

g-bauer commented Feb 3, 2017

Currently, the center of mass computation does not check if all particles of a molecule are adjacent, or if some particles are wrapped into the simulation cell. If a molecule is partially wrapped, the current center of mass computation will yield wrong results.

# Awesome sketch of a partially wrapped molecule
---------------
|        o    |<- boundary of the cell
|     x   \   |
|-o        o -|
---------------
# x : wrong center of mass

In the current implementation, everything is working as long as the initial configuration does not contain "partially wrapped" molecules because there are no propagation methods or other system changes that apply such partial wrapping.

We could enhance the current implementation to check for partial wrapping - e.g. compute bonding lengths without period boundary conditions. Do you think that this is needed? It would make the usage of the existing method more robust with respect to custom extensions.

@Luthaf Luthaf added the A-System label Feb 3, 2017
@Luthaf
Copy link
Member

Luthaf commented Feb 3, 2017

because there are no propagation methods or other system changes that apply such partial wrapping.

Not yet, but that what #3 is about. So we should handle it before implementing rewrap algorithm.

I think we definitively want to get the "right" center of mass here, I don't know how we can do this.

If we rewrap all the atomic positions before computing the center of mass, we still get wrong values:

Before wrapping:
+-------------+-------------+
|             |             |
|             |        o    |
|      +------|------+  \   |
|      |      |- o   |   o -|
|      |      |      |      |
+------|------+------|------+
|      |      |      |      |
|      |      |      |      |
|      +------|------+      |
|             |             |
|             |             |
+-------------+-------------+

After wrapping around origin:
+-------------+-------------+
|             |             |
|             |             |
|      +------|------+      |
|      |   o -|- o   |      |
|      |      |      |      |
+------|------+------|------+
|      |      |      |      |
|      | o    |      |      |
|      +--\---|------+      |
|             |             |
|             |             |
+-------------+-------------+

What would we do if we find a bonding length without PBC that is bigger than the bonding length wit PBC? Wrap this particular atom?

@Luthaf
Copy link
Member

Luthaf commented Feb 3, 2017

Just though of an easier solution: using the wrapped distances from the first atom of the molecule:

image

Because we are wrapping distances from another atom in the molecule, all wrapped values should fall around the same point, and not in separated parts of the cell. What do you think?

@g-bauer
Copy link
Contributor Author

g-bauer commented Feb 3, 2017

For the internal representation of positions, I would favor to never "partially wrap" molecules. I would wrap the molecule as a whole so that its center of mass lies within the cell. That is done at the moment in the translation of molecules with the implemented wrapping function (again, assuming that all particles of a molecule are adjacent).

What would we do if we find a bonding length without PBC that is bigger than the bonding length wit PBC? Wrap this particular atom?

Or "rewrap" it back so that its real positions is adjacent if we want to keep particles of molecules together.

@g-bauer
Copy link
Contributor Author

g-bauer commented Feb 3, 2017

Because we are wrapping distances from another atom in the molecule, all wrapped values should fall around the same point, and not in separated parts of the cell. What do you think?

That could work. I have to think about it 😄

@Luthaf
Copy link
Member

Luthaf commented Oct 18, 2018

See https://en.wikipedia.org/wiki/Center_of_mass#Systems_with_periodic_boundary_conditions for an algorithm that should always be valid

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants