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];
}
}
}