52#ifndef PRIMITIVES_RIGIDBODY_HPP
53#define PRIMITIVES_RIGIDBODY_HPP
59#include "types/AtomStamp.hpp"
64 using AtomIterator = std::vector<Atom*>::iterator;
68 virtual std::string
getType() {
return name_; }
71 virtual void setType(
const std::string& name) { name_ = name; }
105 virtual std::vector<RealType>
getGrad();
130 void updateAtomVel();
132 void updateAtomVel(
int frame);
134 Atom* beginAtom(std::vector<Atom*>::iterator& i) {
136 return i != atoms_.end() ? *i : NULL;
139 Atom* nextAtom(std::vector<Atom*>::iterator& i) {
141 return i != atoms_.end() ? *i : NULL;
144 std::vector<Atom*>::iterator getBeginAtomIter() {
return atoms_.begin(); }
146 std::vector<Atom*>::iterator getEndAtomIter() {
return atoms_.end(); }
218 Vector3d getRefCOM() {
return refCOM_; }
222 Mat3x3d inertiaTensor_;
225 std::vector<Atom*> atoms_;
227 std::vector<Vector3d> refCoords_;
228 std::vector<RotMat3x3d> refOrients_;
virtual void setType(const std::string &name)
Sets the name of this stuntRealType.
void calcRefCoords()
calculates the reference coordinates
virtual void setPrevA(const RotMat3x3d &a)
Sets the previous rotation matrix of this stuntdouble.
bool getAtomRefCoor(Vector3d &coor, unsigned int index)
Return the reference coordinate of atom which belongs to this rigid body.
virtual void setA(const RotMat3x3d &a)
Sets the current rotation matrix of this stuntdouble.
size_t getNumAtoms()
Returns the number of atoms in this rigid body.
void updateAtoms()
update the positions of atoms belong to this rigidbody
std::vector< Atom * > getAtoms()
Returns the atoms of this rigid body.
virtual std::vector< RealType > getGrad()
Returns the gradient of this stuntdouble.
Mat3x3d calcForcesAndTorquesAndVirial()
Converts Atomic forces and torques to total forces and torques and computes the rigid body contributi...
virtual Mat3x3d getI()
Returns the inertia tensor of this stuntdouble.
void calcForcesAndTorques()
Converts Atomic forces and torques to total forces and torques.
virtual void accept(BaseVisitor *v)
bool getAtomPos(Vector3d &pos, unsigned int index)
Return the position of atom which belongs to this rigid body.
bool getAtomVel(Vector3d &vel, unsigned int index)
Return the velocity of atom which belongs to this rigid body.
virtual std::string getType()
Returns the name of this stuntDouble.
"Don't move, or you're dead! Stand up! Captain, we've got them!"
This basic Periodic Table class was originally taken from the data.cpp file in OpenBabel.