1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84
|
#include "SimTKmolmodel.h"
#include <iostream>
#include <fstream>
namespace SimTK
{
class Water : public Compound { public:
Water(DuMMForceFieldSubsystem &dumm)
{
if (!dumm.hasAtomClass(DuMM::AtomClassIndex(400)))
{
dumm.defineAtomClass_KA(
DuMM::AtomClassIndex(400),
"TIP3P Hydrogen" ,
1 , //element number
1, //expected valence
.0001 ,//from vdw parms
(.0000)
);
}
if (! dumm.hasChargedAtomType(DuMM::ChargedAtomTypeIndex(8000)))
{
dumm.defineChargedAtomType(
DuMM::ChargedAtomTypeIndex(8000),
"TIP3P Hydrogen" ,
DuMM::AtomClassIndex(400),
.417 //partial charge
);
}
if (! Biotype::exists("TIP3P" ,"Hydrogen" ))
Biotype::defineBiotype(Element::getBySymbol("H"), 1, "TIP3P", "Hydrogen" ); // second arg is valence
// a residue name, second is an atom name
dumm.setBiotypeChargedAtomType( DuMM::ChargedAtomTypeIndex(8000), Biotype::get("TIP3P", "Hydrogen" ).getIndex() );
if (!dumm.hasAtomClass(DuMM::AtomClassIndex(300)))
{
dumm.defineAtomClass_KA(
DuMM::AtomClassIndex(300),
"TIP3P Oxygen" ,
16, //element number
2, //expected valence
1.7683,//from vdw parms
(.1520)
);
}
if (!dumm.hasChargedAtomType(DuMM::ChargedAtomTypeIndex(7000)))
{
dumm.defineChargedAtomType(
DuMM::ChargedAtomTypeIndex(7000),
"TIP3P Oxygen" ,//magnesium",
DuMM::AtomClassIndex(300),
-.834 //partial charge
);
}
if (! Biotype::exists("TIP3P" ,"Oxygen" ))
Biotype::defineBiotype(Element::getBySymbol("O"), 2, "TIP3P" , "Oxygen" ); // second arg is valence
// a residue name, second is an atom name
dumm.setBiotypeChargedAtomType( DuMM::ChargedAtomTypeIndex(7000), Biotype::get("TIP3P" , "Oxygen" ).getIndex() );
setBaseAtom (BivalentAtom("OW",Element::getBySymbol("O")),Vec3(0));
bondAtom ( UnivalentAtom("HW0",Element::getBySymbol("H")),"OW/bond1",(.09572));
bondAtom ( UnivalentAtom("HW1",Element::getBySymbol("H")),"OW/bond2",(.09572));
setDefaultBondAngle((104.52*Deg2Rad),"HW0","OW","HW1");
setBiotypeIndex( "OW", Biotype::get("TIP3P" ,"Oxygen").getIndex() );
setBiotypeIndex("HW0", Biotype::get("TIP3P" ,"Hydrogen").getIndex() );
setBiotypeIndex("HW1", Biotype::get("TIP3P" ,"Hydrogen").getIndex() );
}
};
}
|