pabloalcain / pexmd

A parallel and extendable molecular dynamics code
Other
1 stars 5 forks source link

Forces and acceleration mixup in Particles and Evolution #3

Closed pabloalcain closed 6 years ago

pabloalcain commented 6 years ago

Either we pass forces to the evolution or put acceleration as the property of particles.

pabloalcain commented 6 years ago

We cannot add f and a as two different arrays, it would duplicate information. We cannot either remove f from the particles, since it is the variable we want to actually set from outside. I see two different choices:

  1. Pass f as a parameter in the evolution (this would be, all other things the same, what LAMMS does in src/fix_nve.cpp).
  2. Set a as a property in Particles that always returns f/mass, but does not allocate anything.

From a design point of view, number 2 is much neater, but implementation should be thought deeply, because we don't want to be calculating a everytime in the evolution, rather prefetch it. It could become cumbersome when we finally implement domain decomposition.

I chose N2, but it is susceptible to changes.