Hi everyone,
Another problem that I am trying to solve in Materials Script is how to determine if two atoms are in fact the same atom. In my dehydroxylation script you can only condense two OH groups that are not bonded to the same silicon. Given two hydroxide oxygens that are reasonably close you can get all of the atoms bonded to each. You then need to determine if any two atoms in each set are the same. I am not sure the best way to do this. One obvious way is to see if they are very close (ie: less than 0.1 Angstroms), but this is not very efficient. Perhaps there is a quicker way based on the identity of the atoms themselves, but I have not found it.
Can anyone suggest a better way to do this. As an example I have pasted in my current code that does this based on distances.
Thanks.
Brad.
# Test that the two oxygens are not joined at the same base
my \$flag = 0;
my \$ListA = \$AtomA->AttachedAtoms;
my \$ListB = \$AtomB->AttachedAtoms;
foreach my \$TestA (@\$ListA)
{
foreach my \$TestB (@\$ListB)
{
my \$thisDist = MinDist(\$TestA, \$TestB, \$Surface->Lattice3D);
if(\$thisDist < 0.1)
{
\$flag++;
}
}
}