Skip to content

Commit

Permalink
use mrchem conversion factor
Browse files Browse the repository at this point in the history
  • Loading branch information
moritzgubler committed Feb 5, 2024
1 parent 535a9c6 commit 0cafe48
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions src/vc_sqnm/mrchem_optimizer.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
#include "version.h"

#include "chemistry/Molecule.h"
#include "chemistry/PhysicalConstants.h"
#include "vc_sqnm/periodic_optimizer.hpp"

#include <Eigen/Dense>
Expand All @@ -36,12 +37,14 @@ void writeXYZFile(std::ofstream& xyzFile, const Eigen::MatrixXd& atomicPositions

int numAtoms = atomicPositions.rows();

Check warning on line 38 in src/vc_sqnm/mrchem_optimizer.hpp

View check run for this annotation

Codecov / codecov/patch

src/vc_sqnm/mrchem_optimizer.hpp#L38

Added line #L38 was not covered by tests

double bohrToAng = 1.0 / PhysicalConstants::get("angstrom2bohrs");

Check warning on line 40 in src/vc_sqnm/mrchem_optimizer.hpp

View check run for this annotation

Codecov / codecov/patch

src/vc_sqnm/mrchem_optimizer.hpp#L40

Added line #L40 was not covered by tests

xyzFile << numAtoms << "\n";
xyzFile << comment << std::endl;

Check warning on line 43 in src/vc_sqnm/mrchem_optimizer.hpp

View check run for this annotation

Codecov / codecov/patch

src/vc_sqnm/mrchem_optimizer.hpp#L42-L43

Added lines #L42 - L43 were not covered by tests

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";

Check warning on line 47 in src/vc_sqnm/mrchem_optimizer.hpp

View check run for this annotation

Codecov / codecov/patch

src/vc_sqnm/mrchem_optimizer.hpp#L45-L47

Added lines #L45 - L47 were not covered by tests
}
xyzFile.flush();

Check warning on line 49 in src/vc_sqnm/mrchem_optimizer.hpp

View check run for this annotation

Codecov / codecov/patch

src/vc_sqnm/mrchem_optimizer.hpp#L49

Added line #L49 was not covered by tests
}
Expand Down

0 comments on commit 0cafe48

Please sign in to comment.