From dcf4a00610f1c1634261dc0dba0815151130b82d Mon Sep 17 00:00:00 2001 From: moritzgubler Date: Mon, 5 Feb 2024 09:35:20 +0100 Subject: [PATCH] use mrchem conversion factor --- src/vc_sqnm/mrchem_optimizer.hpp | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/vc_sqnm/mrchem_optimizer.hpp b/src/vc_sqnm/mrchem_optimizer.hpp index d1fc66647..4b6073276 100644 --- a/src/vc_sqnm/mrchem_optimizer.hpp +++ b/src/vc_sqnm/mrchem_optimizer.hpp @@ -13,6 +13,7 @@ #include "version.h" #include "chemistry/Molecule.h" +#include "chemistry/PhysicalConstants.h" #include "vc_sqnm/periodic_optimizer.hpp" #include @@ -36,12 +37,14 @@ void writeXYZFile(std::ofstream& xyzFile, const Eigen::MatrixXd& atomicPositions int numAtoms = atomicPositions.rows(); + double bohrToAng = 1.0 / PhysicalConstants::get("angstrom2bohrs"); + xyzFile << numAtoms << "\n"; xyzFile << comment << std::endl; for (int i = 0; i < numAtoms; ++i) { - xyzFile << atomicLabels[i] << " " << atomicPositions(0, i) * 0.529177 << " " << atomicPositions(1, i) * 0.529177 - << " " << atomicPositions(2, i) * 0.529177 << "\n"; + xyzFile << atomicLabels[i] << " " << atomicPositions(0, i) * bohrToAng << " " << atomicPositions(1, i) * bohrToAng + << " " << atomicPositions(2, i) * bohrToAng << "\n"; } xyzFile.flush(); }