1 /* -*- c++ -*- */ 2 #ifndef ATOM_H 3 #define ATOM_H 4 5 #include "Real.h" 6 #include <vector> 7 8 namespace ProtoMol { 9 //_________________________________________________________________ Atom 10 11 /** 12 * This class defines the information for one atom. It contains the type 13 * of the atom, its charge (scaled by a constant factor), and the next 14 * atom in this atom's cell list. All other pieces of atom information 15 * are either in the atom type or the coordinate vectors (for positions, 16 * velocities, and so on). 17 */ 18 struct Atom { 19 20 //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 21 // Constructors, destructors, assignment 22 //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ AtomAtom23 Atom():type(-1), 24 scaledCharge(0.0), 25 scaledMass(0.0), 26 hvyAtom(-1), 27 atomNum(-1), 28 cellListNext(-1), 29 molecule(-1), 30 mybonds(std::vector< int >()), 31 deltaM(0.0), 32 deltaQ(0.0), 33 Qold(0.0), 34 Qnew(0.0), 35 stageNumber(0) { 36 } 37 // A default constructor for the atom class 38 39 //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 40 // My data members 41 //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 42 int type; 43 ///< The type number of the atom (an index into the array of atomTypes). 44 45 Real scaledCharge; 46 ///< The charge of this atom, scaled by the square root of the Coulomb 47 ///< constant. 48 49 Real scaledMass; 50 ///< The mass of this atom (can be modified, e.g., iSG) 51 52 int hvyAtom; 53 ///< The size of the Group for Heavy Atom Come First ordering 54 ///< for hydrogen hvyAtom=0, else, hvyAtom = 1+#of attached hydrogens 55 56 int atomNum; 57 ///< Original order number of the atom, used to undo Heavy Atom Come 58 ///< First ordering 59 60 mutable int cellListNext; 61 ///< The index of the next atom in this atom's cell list, or -1 if this 62 ///< atom is the last in its list. 63 64 int molecule; 65 ///< The ID# of the molecule to which this atom belongs 66 67 std::vector< int > mybonds; 68 ///< this vector holds the bond IDs for those bonds made with this atom 69 70 Real deltaM, deltaQ; 71 ///< For iSG simulations. This difference between the mass and charge, 72 ///< respectively, of the atom's two identities. 73 74 Real Qold, Qnew; 75 ///< For iSG simulations. The atom's charge for its old and new identities. 76 ///< Needed to correctly compute DeltaMu for intramolecular interactions. 77 78 int stageNumber; 79 ///< For iSG simulations. Molecule transformations can be broken into stages 80 ///< so that only small fragments of the whole molecule can be transformed at 81 ///< any time. This is critical to being able to transform a small molecule 82 ///< into a relatively large molecule. This variable is the number of the stage 83 ///< in which this atom will be transformed. For example, suppose I break a 84 ///< molecular transformation into 5 stages. If this atom's stageNumber = 3, that 85 ///< means that this atom will have its identity transformed only when 2 <= lambda <= 3. -- TIM 86 87 Real alphaLJ; 88 ///< For iSG simulations. Atoms which are dummy atoms in one particular identity but are 89 ///< real, interacting atoms in another identity require a positive, non-zero alpha parameter for the 90 ///< soft-core Lennard-Jones function used by iSGMD. Atoms which are real, interacting atoms in both 91 ///< identities of a transformation attempt need to have alphaLJ = 0 for the soft-core LJ function. I 92 ///< found that when transforming a water oxygen atom into an alcohol oxygen atom using the standard alphaLJ 93 ///< value of 0.5, the simulation was wildly unstable, but if I used alphaLJ = 0 only for the oxygen atom 94 ///< then the transformation proceeded smoothly. -- TIM 3/31/2005 (alphaLJ will be set prior to force 95 ///< calculations by ModifierISG::pickNewMolecule(...) ) 96 }; 97 98 } 99 #endif /* ATOM_H */ 100 101