Skip to main content
added 31 characters in body
Source Link
Cody Aldaz
  • 8k
  • 1
  • 20
  • 76

In pdynamo 3.0.9

A vector3 can be defined by importing from Geometry module. For example,

center = Vector3.Null ( )

It looks like a vector3 is just 3 element vector. Not really sure but here is what I found in pScientific/Symmetry/PointGroupFinder.py file

You will need to get the center of mass however by looping over each atom in the geometry e.g.

$X_i = \displaystyle\sum_a^{N_a} m_a x_{ia}/M $

Which could be done in python like

np.sum([xyz[i,:]*atomic_masses[i]/M for i in range(self.natoms)],axis=0)

However, you are going to want to use an explicit for loop and loop over the coordinates3 of your geometry. Furthermore, I'm not sure ifyou're gonna need the masses are.

It looks like that's stored anywhere, or if you are going to have to do that separatelyin system.atoms e.g. atom.mass

But that's a separate problem.

There may be a simple trick to do this but I'm not that familiar with pDynamo!

In pdynamo 3.0.9

A vector3 can be defined by importing from Geometry module. For example,

center = Vector3.Null ( )

It looks like a vector3 is just 3 element vector. Not really sure but here is what I found in pScientific/Symmetry/PointGroupFinder.py file

You will need to get the center of mass however by looping over each atom in the geometry e.g.

$X_i = \displaystyle\sum_a^{N_a} m_a x_{ia}/M $

Which could be done in python like

np.sum([xyz[i,:]*atomic_masses[i]/M for i in range(self.natoms)],axis=0)

However, you are going to want to use an explicit for loop and loop over the coordinates3 of your geometry. Furthermore, I'm not sure if the masses are stored anywhere, or if you are going to have to do that separately.

There may be a simple trick to do this but I'm not that familiar with pDynamo!

In pdynamo 3.0.9

A vector3 can be defined by importing from Geometry module. For example,

center = Vector3.Null ( )

It looks like a vector3 is just 3 element vector. Not really sure but here is what I found in pScientific/Symmetry/PointGroupFinder.py file

You will need to get the center of mass however by looping over each atom in the geometry e.g.

$X_i = \displaystyle\sum_a^{N_a} m_a x_{ia}/M $

Which could be done in python like

np.sum([xyz[i,:]*atomic_masses[i]/M for i in range(self.natoms)],axis=0)

However, you are going to want to use an explicit for loop and loop over the coordinates3 of your geometry. Furthermore, you're gonna need the masses.

It looks like that's stored in system.atoms e.g. atom.mass

But that's a separate problem.

There may be a simple trick to do this but I'm not that familiar with pDynamo!

Source Link
Cody Aldaz
  • 8k
  • 1
  • 20
  • 76

In pdynamo 3.0.9

A vector3 can be defined by importing from Geometry module. For example,

center = Vector3.Null ( )

It looks like a vector3 is just 3 element vector. Not really sure but here is what I found in pScientific/Symmetry/PointGroupFinder.py file

You will need to get the center of mass however by looping over each atom in the geometry e.g.

$X_i = \displaystyle\sum_a^{N_a} m_a x_{ia}/M $

Which could be done in python like

np.sum([xyz[i,:]*atomic_masses[i]/M for i in range(self.natoms)],axis=0)

However, you are going to want to use an explicit for loop and loop over the coordinates3 of your geometry. Furthermore, I'm not sure if the masses are stored anywhere, or if you are going to have to do that separately.

There may be a simple trick to do this but I'm not that familiar with pDynamo!