19 #ifndef _libint2_src_lib_libint_atom_h_ 20 #define _libint2_src_lib_libint_atom_h_ 22 #include <libint2/cxxstd.h> 23 #if LIBINT2_CPLUSPLUS_STD < 2011 24 # error "libint2/atom.h requires C++11 support" 41 bool strcaseequal(
const std::string& a,
const std::string& b) {
42 return a.size() == b.size() && std::equal(a.begin(), a.end(), b.begin(),
43 [](
char a,
char b) {return ::tolower(a) == ::tolower(b);}
54 std::string rest_of_line;
55 std::getline(is, rest_of_line);
59 std::getline(is, comment);
62 std::vector<Atom> atoms(natom);
63 for (
auto i = 0; i < natom; i++) {
66 std::getline(is, line);
67 std::istringstream iss(line);
69 std::string element_symbol;
71 iss >> element_symbol >> x >> y >> z;
75 using libint2::chemistry::element_info;
76 for(
const auto& e: element_info) {
77 if (strcaseequal(e.symbol, element_symbol)) {
83 std::cerr <<
"read_dotxyz: element symbol \"" << element_symbol <<
"\" is not recognized" << std::endl;
84 throw "Did not recognize element symbol in .xyz file";
87 atoms[i].atomic_number = Z;
90 const auto angstrom_to_bohr = 1 / 0.52917721092;
92 atoms[i].x = x * angstrom_to_bohr;
93 atoms[i].y = y * angstrom_to_bohr;
94 atoms[i].z = z * angstrom_to_bohr;
Defaults definitions for various parameters assumed by Libint.
Definition: algebra.cc:23
std::vector< Atom > read_dotxyz(std::istream &is)
reads the list of atoms from a file in the standard XYZ format supported by most chemistry software ...
Definition: atom.h:49