[lammps-users] Creating Dimer for Saddle Finding

Hello,
I wish to use the dimer method to find all saddles connected to a minima. I am trying to accomplish this by building my own min_style. The problem is that the dimer method relies on having the data for three different structures. Specifically, you need their energy and forces. I am using the following code to get the energy and force of all three structures:

void MinDimer::GetEnergyAndForce()
{
LoadStructure(midPoint);
midPointEnergy = energy_force(0);
CopyArray(midPointForce, atom->f);
LoadStructure(endPoint1);
endPoint1Energy = energy_force(0);
CopyArray(endPoint1Force, atom->f);
LoadStructure(endPoint2);
endPoint2Energy = energy_force(0);
CopyArray(endPoint2Force, atom->f);
}

What is the correct way to get energy and forces in a situation where you have three different structures?

LoadStructures and CopyArray are functions I wrote myself and are shown below.

void MinDimer::LoadStructure(double** templateArray)
{
for(int i=0; i < atom->nlocal; i++)
{
for(int j = 0; j < domain->dimension; j++)
{
atom->x[i][j] = templateArray[i][j];
}
}
}
void MinDimer::CopyArray(double** copyArray, double** templateArray)
{

for(int i=0; i < atom->nlocal; i++)
{
for(int j = 0; j < domain->dimension; j++)
{
copyArray[i][j] = templateArray[i][j];
}
}

}

what you are doing will only work reliably when using LAMMPS in serial.

the energy_force() function may recompute the neighbor lists which in turn may case atoms to be migrated between subdomains.
the clean way to have multiple configurations at the same time would be to have multiple replica. see NEB method.
it may be possible to achieve the same though using the library interface and maintaining three different LAMMPS instances with the different configurations that are updated individually.

axel.

Okay, thank you very much for the guidance