Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Calculate center of geometry #223

Closed
ghutchis opened this issue Mar 15, 2018 · 12 comments · Fixed by #499 or #500
Closed

Calculate center of geometry #223

ghutchis opened this issue Mar 15, 2018 · 12 comments · Fixed by #499 or #500

Comments

@ghutchis
Copy link
Member

A lot of interaction needs to calculate the center of a set of selected atoms or the molecule as a whole.

We need a few methods added to the molecule classes:

  • centerOfGeometry() - calculate the center of the molecule or a set of selected atoms
  • centerOfMass() - calculate the mass-weighted center of the molecule or set of selected atoms
  • radius() - calculate the approximate radius of a sphere surrounding the molecule (e.g., square root of the distance between the furthest atom and the center of geometry)
  • bestFitPlane() - use Eigen to calculate the normal to the plane of best fit
@HeyAEE
Copy link

HeyAEE commented Mar 15, 2018

I would like to work on this as my first issue.

@ghutchis
Copy link
Member Author

Great - you'll want to start with core/molecule.* and look at the mass() and formula() methods and add similar methods that loop through the atoms.

@HeyAEE
Copy link

HeyAEE commented Mar 18, 2018 via email

@cryos
Copy link
Member

cryos commented Mar 19, 2018

It should work on Windows, but Windows is often a little more difficult. Happy to help out if you want to get in touch, Linux and macOS should also work fine.

@HeyAEE
Copy link

HeyAEE commented Mar 19, 2018 via email

@0xrushi
Copy link

0xrushi commented Jan 26, 2019

Is this solved ? i would like to work on this

@ghutchis
Copy link
Member Author

@rushic24 - no, this has not been completed. If you'd like to do it, that would be great.

@0xrushi
Copy link

0xrushi commented Jan 27, 2019

what does Array m_atomicNumbers; contain ? could you give an example say c6h6 or something else

@vsomnath
Copy link

Is this task complete? I couldn't find any PR raised.
Also, @rushic24: I think m_atomicNumbers contains the atomic_numbers of each atom in the molecule. This can be seen from:

inline bool Molecule::setAtomicNumbers(const Core::Array<unsigned char>& nums)
{
  if (nums.size() == atomCount()) {
    m_atomicNumbers = nums;
    return true;
  }
  return false;
}

@ghutchis
Copy link
Member Author

This task is not complete, no.

@dvermd
Copy link
Contributor

dvermd commented Sep 30, 2020

I partially implemented the requested methods. I don't know how to compute bestFitPlane. Can you give me some hints ?

@ghutchis
Copy link
Member Author

ghutchis commented Oct 2, 2020

There are a few links on how to do this with eigen, e.g.
https://stackoverflow.com/a/39374496/131896
https://stackoverflow.com/q/40589802/131896

I'd particularly look at the last link. Ideally, the method should allow passing a set of atoms / points (e.g. find the best fit plane for the selected atoms).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: Done
6 participants