Skip to content

Conversation

@johannes-spies
Copy link

Add a new fix that uses a model to predict future positions and momenta.

double *mass = atom->mass;
int *type = atom->type;
int *mask = atom->mask;
if (igroup == atom->firstgroup) nlocal = atom->nfirst;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
if (igroup == atom->firstgroup) nlocal = atom->nfirst;
if (igroup == atom->firstgroup) {
nlocal = atom->nfirst;
}

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The same line is used by all other LAMMPS fixes with the same formatting

int nghost = atom->nghost;
int nall = nlocal + nghost;

double *mass = atom->mass;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

what's the difference between rmass and mass?

Copy link

@frostedoyster frostedoyster Nov 13, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LAMMPS allows per-type masses as well as per-atom masses (to support e.g. different isotopes of the same element within the same simulation). rmass contains one mass per atom in the latter case, otherwise it's undefined and you have to use mass[type[i]]

if (atom->rmass)
  m = atom->rmass[i];       // per-atom mass array exists
else
  m = atom->mass[type[i]];  // fall back to per-type mass

@frostedoyster
Copy link

frostedoyster commented Nov 10, 2025

@copilot This code integrates a new machine-learning-driven integrator into LAMMPS, through an interface called metatomic. The prototype you see here works well.

I have three tasks for you:

  • Cleaning up the code. This includes adding comments, including, but by no means limited to, explaining the role of the force copy (isolating the Langevin forces to be applied to FlashMD), isolating the cryptic unit conversions and adding comments about them, erroring out nicely when the units are not metal, and any improvement that DOES NOT MODIFY THE FUNCTIONALITY OF THE CODE
  • Writing a kokkos version of this code. You should take inspiration from the relationship between pair_metatomic.cpp and pair_metatomic_kokkos.cpp and re-use code where it is possible
  • Erroring out nicely in case of multiple processes (they are not supported yet)

Copy link

Copilot AI commented Nov 10, 2025

@frostedoyster I've opened a new pull request, #30, to work on those changes. Once the pull request is ready, I'll request review from you.

@frostedoyster frostedoyster marked this pull request as ready for review November 12, 2025 12:40
@frostedoyster frostedoyster requested a review from Luthaf November 12, 2025 12:41
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.

4 participants