compute contact/atom command

Hey,

I've written my own python code to replicate the compute contact/atom command, however I'm finding small discrepancies in my calculated values and the ones from LAMMPS. I am using the dump file to calculate the euclidian distance between pairwise interactions and checking if this is less than the sum of the radius, see this stackoverflow page for an overview of my method: http://stackoverflow.com/questions/42397870/calculation-of-contact-coordination-number-with-periodic-boundary-conditions

I have followed the particles that give discrepancies and find that they occur when the values are very close to the radius sum. For example with a radius sum of 1, sometimes LAMMPS counts atoms a distance 1.000002 as touching, or particles at 0.999998 as not touching.

Can you see any reason why we would disagree in this manner?

Thanks,
Oli

Hey,

I've written my own python code to replicate the compute contact/atom
command, however I'm finding small discrepancies in my calculated values
and the ones from LAMMPS. I am using the dump file to calculate the
euclidian distance between pairwise interactions and checking if this is
less than the sum of the radius, see this stackoverflow page for an
overview of my method:
http://stackoverflow.com/questions/42397870/calculation-of-contact-
coordination-number-with-periodic-boundary-conditions

I have followed the particles that give discrepancies and find that they
occur when the values are very close to the radius sum. For example with
a radius sum of 1, sometimes LAMMPS counts atoms a distance 1.000002 as
touching, or particles at 0.999998 as not touching.

Can you see any reason why we would disagree in this manner?

​yes.​

​which precision do you use when writing out your dump files? if you are
not making any changes from the default settings, than the differences you
quote could originate from rounding that happens when writing out the dump
files.

​axel.​

If it's that simple that's great! I'm using the default precision. I see I can change this using the dump_modify command, what kind of precision will I need to output to?

Thanks,
Oli

If it's that simple that's great! I'm using the default precision. I see
I can change this using the dump_modify command, what kind of precision
will I need to output to?

​it doesn't really matter. you won't get a perfect match, since the
conversion of the internal base-2 representation of floating point numbers​
​ to base-10 numbers will always result in minor differences. all you need
is the confirmation that increasing the output precision will reduce the
number of discrepancies. since rounding errors are uniformly distributed,
there should be no systematic error and then your are below the statistical
relevance, anyway.

axel.​

Hey Axel,

This has drastically(!) improved the values I'm calculating, but there still exist non-negligible differences. I am continually under-estimating the number of particles in contact, and am a loss as to why. Any other ideas?

Thanks,
Oli

Hey Axel,

This has drastically(!) improved the values I'm calculating, but there
still exist non-negligible differences. I am continually
under-estimating the number of particles in contact, and am a loss as to
why. Any other ideas?

​sorry, but i don't have time to debug *your* code.​ there is so much work
that needs to be done on LAMMPS already, and i'd rather work on something
that many people will benefit from...

axel.

No worries, the previous help is appreciated nonetheless!
Oli