// Convert string from fftype to element number int ElementMap::ffToZ(const char* s) const { ForcefieldAtom* ffa; int result = -1; for (Forcefield* ff = duq.forcefields(); ff != NULL; ff = ff->next) { ffa = ff->findType(s); // Found a match, so find out what element it is... if (ffa != NULL) result = ffa->neta()->characterElement(); if (result != -1) break; } return result; }
// Convert string from fftype to element number int ElementMap::ffToZ(QString s) { if (!aten_) return -1; ForcefieldAtom* ffa; int result = -1; for (Forcefield* ff = aten_->forcefields(); ff != NULL; ff = ff->next) { ffa = ff->findType(s); // Found a match, so find out what element it is... if (ffa != NULL) result = ffa->neta()->characterElement(); if (result != -1) break; } return result; }