72 SimpleAtom(
const loos::pAtom& a) : atom(a), isHydrogen(divineHydrogen(a->name())), usePeriodicity(
false) { }
73 SimpleAtom(
const loos::pAtom& a,
const loos::SharedPeriodicBox& b,
const bool c =
true) : atom(a), isHydrogen(divineHydrogen(a->name())), usePeriodicity(c), sbox(b) { }
75 void attach(
const loos::pAtom&a) { attached_to = a; }
76 loos::pAtom attachedTo()
const {
return(attached_to); }
78 loos::pAtom rawAtom()
const {
return(atom); }
83 static bool debuggingMode() {
return(debugging); }
84 static void debuggingMode(
const bool b) { debugging = b; }
86 static double innerRadius() {
return(sqrt(inner)); }
87 static void innerRadius(
const double r) { inner = r*r; }
89 static double outerRadius() {
return(sqrt(outer)); }
90 static void outerRadius(
const double r) { outer = r*r; }
92 static double maxDeviation() {
return(deviation); }
93 static void maxDeviation(
const double d) { deviation = d; }
98 bool hydrogenBond(
const SimpleAtom& other)
const;
102 loos::AtomicGroup findHydrogenBonds(
const std::vector<SimpleAtom>& group,
const bool findFirstOnly =
true);
104 std::vector<uint> findHydrogenBondsVector(
const std::vector<SimpleAtom>& group);
112 BondMatrix findHydrogenBondsMatrix(
const std::vector<SimpleAtom>& group, loos::pTraj& traj,
loos::AtomicGroup& model,
const uint maxt)
const;
114 return(findHydrogenBondsMatrix(group, traj, model, traj->nframes()));
123 static std::vector<SimpleAtom> processSelection(
const std::string& selection,
const loos::AtomicGroup& system,
const bool use_periodicity =
false);
125 friend std::ostream& operator<<(std::ostream& os,
const SimpleAtom& s) {
126 os <<
"<SimpleAtom>\n";
127 os << *(s.atom) << std::endl;
128 os <<
"<isHydrogen " << s.isHydrogen <<
"/>\n";
129 os <<
"<usePeriodicity " << s.usePeriodicity <<
"/>\n";
130 if (s.usePeriodicity)
131 os <<
"<PeriodicBox>" << s.sbox.box() <<
"</PeriodicBox>\n";
132 if (s.attached_to != 0) {
133 os <<
"<attached>\n";
134 os << *(s.attached_to) << std::endl;
135 os <<
"</attached>\n";
137 os <<
"</SimpleAtom>";
145 bool divineHydrogen(
const std::string& name);
152 static double inner, outer, deviation;
153 static bool debugging;
156 loos::pAtom attached_to;