Example showing how to compute the enrgy for a molecule.
#include <iostream>
shared_ptr<OBMol> GetMol(const std::string &filename)
{
shared_ptr<OBMol> mol(
new OBMol);
std::cout << "Could not find input format for file " << filename << std::endl;
return mol;
}
std::ifstream ifs(filename.c_str());
if (!ifs) {
std::cout << "Could not open " << filename << " for reading." << std::endl;
return mol;
}
if (!conv.
Read(mol.get(), &ifs)) {
std::cout << "Could not read molecule from file " << filename << std::endl;
return mol;
}
return mol;
}
int main(int argc, char **argv)
{
if (argc < 2) {
std::cout << "Usage: " << argv[0] << " <filename>" << std::endl;
return 1;
}
shared_ptr<OBMol> mol = GetMol(argv[1]);
if (!ff) {
std::cout << "Could not find forcefield." << std::endl;
return 1;
}
std::cout << "Could not setup forcefield." << std::endl;
return 1;
}
return 0;
}