Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bugfix: Isotope and boundary scattering terms #208

Merged
merged 11 commits into from
Jan 3, 2024
Prev Previous commit
Next Next commit
actually apply the isotope scattering fix
  • Loading branch information
jcoulter12 committed Jan 2, 2024
commit fb77fc4934a9ff458d00514f17c9089928b4b373
12 changes: 6 additions & 6 deletions src/bte/ph_scattering.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -726,7 +726,7 @@ void PhScatteringMatrix::builder(VectorBTE *linewidth,
linewidth->operator()(iCalc, 0, iBte1) += rateIso;
}
if (is1 != is2Irr) {
theMatrix(iMat1, iMat2) +=
theMatrix(iMat1, iMat2) -=
rotation.inverse()(i, j) * rateIso;
}
}
Expand All @@ -735,13 +735,12 @@ void PhScatteringMatrix::builder(VectorBTE *linewidth,
} else {
if (theMatrix.indicesAreLocal(iBte1, iBte2)) {
linewidth->operator()(iCalc, 0, iBte1) += rateIso;
theMatrix(iBte1, iBte2) -= rateIso;
}
theMatrix(iBte1, iBte2) += rateIso;
}

} else if (switchCase == 1) { // case of matrix-vector multiplication
for (unsigned int iInput = 0; iInput < inPopulations.size();
iInput++) {
for (unsigned int iInput = 0; iInput < inPopulations.size(); iInput++) {

// here we rotate the populations from the irreducible point
Eigen::Vector3d inPopRot;
Expand All @@ -754,9 +753,10 @@ void PhScatteringMatrix::builder(VectorBTE *linewidth,
}
for (int i : {0, 1, 2}) {
if (is1 != is2Irr) {
outPopulations[iInput](iCalc, i, iBte1) +=
// off diagonals
outPopulations[iInput](iCalc, i, iBte1) -=
rateIso * inPopRot(i);
}
} // diagonals
outPopulations[iInput](iCalc, i, iBte1) +=
rateIso * inPopulations[iInput](iCalc, i, iBte1);
}
Expand Down
Loading