Water.h

Go to the documentation of this file.
00001 #include "molmodel/internal/common.h"
00002 #include "molmodel/internal/Compound.h"
00003 #include <iostream>
00004 #include <fstream>
00005 //#include <ios>
00006 
00007 
00008 
00009 
00010 namespace SimTK 
00011 {
00012 
00013 
00014 
00015 
00016 class Water : public Compound { public:
00017         Water(TinkerDuMMForceFieldSubsystem &dumm)
00018         {   
00019  
00020 
00021      if (!dumm.hasAtomClass(DuMM::AtomClassIndex(400)))
00022      {  
00023 
00024         dumm.defineAtomClass_KA(
00025             DuMM::AtomClassIndex(400),
00026             "TIP3P Hydrogen"    ,
00027             1 , //element number
00028             1, //expected valence
00029             .0001 ,//from vdw parms
00030             (.0000)
00031             );
00032      }  
00033      if (! dumm.hasChargedAtomType(DuMM::ChargedAtomTypeIndex(8000)))
00034      {  
00035         dumm.defineChargedAtomType(
00036             DuMM::ChargedAtomTypeIndex(8000),
00037             "TIP3P Hydrogen"    ,
00038             DuMM::AtomClassIndex(400),
00039             .417                   //partial charge
00040             );
00041      }
00042     
00043      if (! Biotype::exists("TIP3P"   ,"Hydrogen" ))
00044          Biotype::defineBiotype(Element::Hydrogen(), 1, "TIP3P",   "Hydrogen"  ); // second arg is valence
00045                                                                                  // a residue name, second is an atom name
00046      dumm.setBiotypeChargedAtomType( DuMM::ChargedAtomTypeIndex(8000), Biotype::get("TIP3P", "Hydrogen"     ).getIndex() );
00047      if (!dumm.hasAtomClass(DuMM::AtomClassIndex(300)))
00048      {  
00049         dumm.defineAtomClass_KA(
00050             DuMM::AtomClassIndex(300),
00051             "TIP3P Oxygen"      ,
00052             16, //element number
00053             2, //expected valence
00054             1.7683,//from vdw parms
00055             (.1520)
00056             );
00057      }
00058      if (!dumm.hasChargedAtomType(DuMM::ChargedAtomTypeIndex(7000)))
00059      {          
00060         dumm.defineChargedAtomType(
00061             DuMM::ChargedAtomTypeIndex(7000),
00062             "TIP3P Oxygen"      ,//magnesium",
00063             DuMM::AtomClassIndex(300),
00064             -.834                  //partial charge
00065             );
00066      }
00067      if (! Biotype::exists("TIP3P"   ,"Oxygen"   ))
00068          Biotype::defineBiotype(Element::Oxygen(), 2, "TIP3P"   ,  "Oxygen"  ); // second arg is valence
00069                                                                                  // a residue name, second is an atom name
00070      dumm.setBiotypeChargedAtomType( DuMM::ChargedAtomTypeIndex(7000), Biotype::get("TIP3P" , "Oxygen"     ).getIndex() );
00071  
00072 
00073    
00074         setBaseAtom    (BivalentAtom("OW",Element::Oxygen()),Vec3(0));
00075         bondAtom    ( UnivalentAtom("HW0",Element::Hydrogen()),"OW/bond1",(.09572));
00076         bondAtom    ( UnivalentAtom("HW1",Element::Hydrogen()),"OW/bond2",(.09572));
00077         setDefaultBondAngle((104.52*Deg2Rad),"HW0","OW","HW1");
00078 
00079         setBiotypeIndex( "OW", Biotype::get("TIP3P"   ,"Oxygen").getIndex() );
00080         setBiotypeIndex("HW0", Biotype::get("TIP3P"   ,"Hydrogen").getIndex() );
00081         setBiotypeIndex("HW1", Biotype::get("TIP3P"   ,"Hydrogen").getIndex() );
00082         }   
00083 };
00084 
00085 
00086 }

Generated on Fri Sep 26 07:44:19 2008 for SimTKcore by  doxygen 1.5.6