Skip to content

Commit

Permalink
Moved the setup method of PhononH0 to a constructor.
Browse files Browse the repository at this point in the history
  • Loading branch information
cepellotti committed Mar 23, 2020
1 parent e1bf16b commit 432291c
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 7 deletions.
2 changes: 1 addition & 1 deletion src/harmonic/phononH0.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -603,7 +603,7 @@ void cryst_to_cart(Eigen::VectorXd& vec, const Eigen::MatrixXd& trmat,
}


void PhononH0::setup(
PhononH0::PhononH0(
const Eigen::MatrixXd& directUnitCell_,
const Eigen::MatrixXd& reciprocalUnitCell_,
const double& latticeParameter_,
Expand Down
2 changes: 1 addition & 1 deletion src/harmonic/phononH0.h
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

class PhononH0 {
public:
void setup(const Eigen::MatrixXd& directUnitCell_,
PhononH0(const Eigen::MatrixXd& directUnitCell_,
const Eigen::MatrixXd& reciprocalUnitCell_,
const double& latticeParameter_,
const double& volumeUnitCell_,
Expand Down
8 changes: 3 additions & 5 deletions src/parser/qe_input_parser.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -545,12 +545,8 @@ void QEParser::parsePhHarmonic(std::string fileName) {

// Now, let's try to diagonalize some points, and start debugging at q=0

Eigen::VectorXd q(3);
q << 0., 0., 0.;

PhononH0 dynamicalMatrix;

dynamicalMatrix.setup(directUnitCell,
PhononH0 dynamicalMatrix(directUnitCell,
reciprocalUnitCell,
alat,
volumeUnitCell,
Expand All @@ -566,6 +562,8 @@ void QEParser::parsePhHarmonic(std::string fileName) {

Eigen::VectorXd omega(numAtoms*3);
Eigen::Tensor<std::complex<double>,3> z(3,numAtoms,numAtoms*3);
Eigen::VectorXd q(3);
q << 0., 0., 0.;

dynamicalMatrix.diagonalize(q, omega, z);

Expand Down

0 comments on commit 432291c

Please sign in to comment.