Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 11 additions & 3 deletions src/cxx/nux/xyz_to_mol.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,12 @@

namespace nux {

double ang2bohr(double ang_value) {
// Converts a anstrom-based value to a bohr-based value
double bohr_value = ang_value * 1.8897259886;
return bohr_value;
}

MODULE_CTOR(XYZToMolecule) {
satisfies_property_type<simde::MoleculeFromString>();
add_submodule<simde::ZFromSymbol>("Z from symbol");
Expand Down Expand Up @@ -66,9 +72,11 @@ MODULE_RUN(XYZToMolecule) {

auto Z = z_from_sym.run_as<simde::ZFromSymbol>(atom_string);
auto atom = atom_from_z.run_as<simde::AtomFromZ>(Z);
atom.x() = x;
atom.y() = y;
atom.z() = z;

// Assumes that the XYZ coordnates given are in angstroms
atom.x() = ang2bohr(x);
atom.y() = ang2bohr(y);
atom.z() = ang2bohr(z);

mol.push_back(atom);
}
Expand Down
2 changes: 1 addition & 1 deletion tests/cxx/unit_tests/xyz_file_to_mol.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ TEST_CASE("XYZFileToMolecule") {
SECTION("Full XYZ To Molecule run: File") {
auto atom0{make_atoms(1)};
auto atom1{make_atoms(1)};
atom1.z() = 1;
atom1.z() = 1.8897259886;

simde::type::molecule test_mol{atom0, atom1};

Expand Down
2 changes: 1 addition & 1 deletion tests/cxx/unit_tests/xyz_to_mol.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ TEST_CASE("XYZToMolecule") {
SECTION("Full XYZ To Molecule run: Data") {
auto atom0{make_atoms(1)};
auto atom1{make_atoms(1)};
atom1.z() = 1;
atom1.z() = 1.8897259886;

simde::type::molecule test_mol{atom0, atom1};

Expand Down