1 /* -*- c++ -*- */ 2 #ifndef PSF_H 3 #define PSF_H 4 5 #include <string> 6 #include <vector> 7 8 #include "Real.h" 9 10 namespace ProtoMol { 11 //_________________________________________________________________PSF 12 /** 13 * PSF container holding the topology of the system 14 */ 15 class PSF { 16 public: 17 //___________________________________________________________________PsfAtom 18 /** 19 * This class holds data for a basic .psf atom. The data stored includes: 20 * atom number, segment identifier, residue sequence, residue name, atom name, 21 * atom2 name, charge and mass. 22 */ 23 struct Atom { AtomAtom24 Atom():number(0),seg_id(""),residue_sequence(0),residue_name(""), 25 atom_name(""),atom_type(""),charge(0.0),mass(0.0), identity(0) {} AtomAtom26 Atom(int a,std::string b, int c, std::string d, std::string e, std::string f, Real g, Real h, unsigned int i): 27 number(a),seg_id(b),residue_sequence(c),residue_name(d), 28 atom_name(e),atom_type(f),charge(g),mass(h),identity(i){} 29 30 int number; ///< atom number 31 std::string seg_id; ///< segment identifier 32 int residue_sequence; ///< residue sequence 33 std::string residue_name; ///< residue name 34 std::string atom_name; ///< atom name 35 std::string atom_type; ///< atom type 36 Real charge; ///< charge [e] 37 Real mass; ///< mass [amu] 38 unsigned int identity; ///< atom's identity (for iSGMD) 39 }; 40 41 42 //___________________________________________________________________Bond 43 /** 44 * This structure holds data for a basic .psf bond. The data stored includes 45 * the bond number and the numbers of the two atoms involved. 46 */ 47 struct Bond { 48 BondBond49 Bond():number(0),atom1(0),atom2(0){} BondBond50 Bond(int a, int b, int c):number(a),atom1(b),atom2(c){} 51 52 int number; ///< bond number 53 int atom1; ///< bonded atom 1 number 54 int atom2; ///< bonded atom 2 number 55 }; 56 57 58 //___________________________________________________________________Angle 59 /** 60 * This structure holds data for a basic .psf angle. The data stored includes 61 * the angle number and the numbers of the three atoms involved. 62 */ 63 struct Angle { 64 AngleAngle65 Angle():number(0),atom1(0),atom2(0),atom3(0){} AngleAngle66 Angle(int a, int b, int c, int d):number(a),atom1(b),atom2(c),atom3(d){} 67 68 int number; ///< angle number 69 int atom1; ///< angle atom 1 number 70 int atom2; ///< angle atom 2 number 71 int atom3; ///< angle atom 3 number 72 }; 73 74 75 //__________________________________________________________________Dihedral 76 /** 77 * This structure holds data for a basic .psf dihedral. The data stored 78 * includes the dihedral number and the numbers of the four atoms involved. 79 */ 80 struct Dihedral { 81 DihedralDihedral82 Dihedral():number(0),atom1(0),atom2(0),atom3(0),atom4(0){} DihedralDihedral83 Dihedral(int a, int b, int c, int d, int e):number(a),atom1(b),atom2(c),atom3(d),atom4(e){} 84 85 int number; ///< dihedral number 86 int atom1; ///< dihedral atom 1 number 87 int atom2; ///< dihedral atom 2 number 88 int atom3; ///< dihedral atom 3 number 89 int atom4; ///< dihedral atom 4 number 90 }; 91 92 //__________________________________________________________________Improper 93 /** 94 * This structure holds data for a basic .psf improper. The data stored 95 * includes the improper number and the numbers of the four atoms involved. 96 */ 97 struct Improper { 98 ImproperImproper99 Improper():number(0),atom1(0),atom2(0),atom3(0),atom4(0){} ImproperImproper100 Improper(int a, int b, int c, int d, int e):number(a),atom1(b),atom2(c),atom3(d),atom4(e){} 101 102 int number; ///< improper number 103 int atom1; ///< improper atom 1 number 104 int atom2; ///< improper atom 2 number 105 int atom3; ///< improper atom 3 number 106 int atom4; ///< improper atom 4 number 107 }; 108 109 //_____________________________________________________________________Donor 110 /** 111 * This structure holds data for a basic .psf donor. The data stored includes 112 * the donor number and the numbers of the two donors involved 113 */ 114 struct Donor { 115 DonorDonor116 Donor():number(0),atom1(0),atom2(0){} DonorDonor117 Donor(int a, int b, int c):number(a),atom1(b),atom2(c){} 118 119 int number; ///< donor number 120 int atom1; ///< donor atom 1 number 121 int atom2; ///< donor atom 2 number 122 }; 123 124 //__________________________________________________________________Acceptor 125 /** 126 * This structure holds data for a basic .psf acceptor. The data stored 127 * includes the acceptor number and the numbers of the two acceptors. 128 */ 129 struct Acceptor { 130 AcceptorAcceptor131 Acceptor():number(0),atom1(0),atom2(0){} AcceptorAcceptor132 Acceptor(int a, int b, int c):number(a),atom1(b),atom2(c){} 133 134 int number; ///< acceptor number 135 int atom1; ///< acceptor atom 1 number 136 int atom2; ///< acceptor atom 2 number 137 }; 138 139 //_________________________________________________________________Nonbonded 140 /** 141 * This structure holds data for a basic .psf nonbonded. The data stored 142 * includes the number of the nonbonded structure as well as the number of the 143 * nonbonded atom. 144 */ 145 struct Nonbonded { 146 NonbondedNonbonded147 Nonbonded():number(0),atom1(0){} NonbondedNonbonded148 Nonbonded(int a, int b):number(a),atom1(b){} 149 150 int number; ///< nonbonded structure number 151 int atom1; ///< nonbonded atom number 152 }; 153 154 //______________________________________________________________________Ngrp 155 /** 156 * This structure holds data for a basic .psf ngrp. The data stored includes 157 * the number of the ngrp as well as the numbers of the three atoms involved. 158 */ 159 struct Ngrp { 160 NgrpNgrp161 Ngrp():number(0),atom1(0),atom2(0),atom3(0){} NgrpNgrp162 Ngrp(int a, int b, int c, int d):number(a),atom1(b),atom2(c),atom3(d){} 163 164 int number; ///< ngrp number 165 int atom1; ///< ngrp atom 1 number 166 int atom2; ///< ngrp atom 2 number 167 int atom3; ///< ngrp atom 3 number 168 }; 169 170 //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 171 // New methods of class PSF 172 //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 173 void clear(); 174 //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 175 // My data members 176 //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 177 std::vector<Atom> atoms; 178 std::vector<Bond> bonds; 179 std::vector<Angle> angles; 180 std::vector<Dihedral> dihedrals; 181 std::vector<Improper> impropers; 182 std::vector<Donor> donors; 183 std::vector<Acceptor> acceptors; 184 std::vector<Nonbonded> nonbondeds; 185 std::vector<Ngrp> ngrp; 186 }; 187 188 //_______________________________________________________________________________INLINES 189 190 } 191 192 #endif /* PSF_H */ 193