ComputeThole.inl

Go to the documentation of this file.
00001 
00007 #ifndef COMPUTETHOLE_INL
00008 #define COMPUTETHOLE_INL
00009 
00010 #include "ComputeThole.h"
00011 
00012 inline TholeElem::TholeElem() { ; }
00013 
00014 inline TholeElem::TholeElem(AtomID atom0, const TupleSignature *sig, const TholeValue *v){
00015     NAMD_die("Can't use Thole with memory optimized version of NAMD.");
00016     // atomID[0] = atom0;
00017     // atomID[1] = atom0 + sig->offset[0];
00018     // atomID[2] = atom0 + sig->offset[1];
00019     // atomID[3] = atom0 + sig->offset[2];
00020     // value = &v[sig->tupleParamType];
00021 }
00022 
00023 inline TholeElem::TholeElem(const Thole *a, const TholeValue *v)
00024   {
00025     atomID[0] = a->atom1;
00026     atomID[1] = a->atom2;
00027     atomID[2] = a->atom3;
00028     atomID[3] = a->atom4;
00029     value = a;  // expect v to be NULL
00030   }
00031 
00032 inline TholeElem::TholeElem(AtomID atom0, AtomID atom1,
00033                                   AtomID atom2, AtomID atom3)
00034   {
00035     // atoms arranged:  HEAVY DRUDE HEAVY DRUDE
00036     if (atom0 > atom2) {  // Swap heavy atoms so lowest is first!
00037       AtomID tmp = atom2; atom2 = atom0; atom0 = tmp; 
00038       tmp = atom1; atom1 = atom3; atom3 = tmp;
00039     }
00040     atomID[0] = atom0;
00041     atomID[1] = atom1;
00042     atomID[2] = atom2;
00043     atomID[3] = atom3;
00044   }
00045 
00046 inline int TholeElem::operator==(const TholeElem &a) const
00047   {
00048     return (a.atomID[0] == atomID[0] && a.atomID[1] == atomID[1] &&
00049         a.atomID[2] == atomID[2] && a.atomID[3] == atomID[3]);
00050   }
00051 
00052 inline int TholeElem::operator<(const TholeElem &a) const
00053   {
00054     return  (atomID[0] < a.atomID[0] ||
00055             (atomID[0] == a.atomID[0] &&
00056             (atomID[1] < a.atomID[1] ||
00057             (atomID[1] == a.atomID[1] &&
00058             (atomID[2] < a.atomID[2] ||
00059             (atomID[2] == a.atomID[2] &&
00060              atomID[3] < a.atomID[3] 
00061              ))))));
00062   }
00063 
00064 #endif
00065 

Generated on Tue Sep 26 01:17:12 2017 for NAMD by  doxygen 1.4.7