@@ -13,6 +13,7 @@ or http://opensource.org/licenses/mit-license.php for information.
1313#include " constants.h"
1414#include " dynamical.h"
1515#include " error.h"
16+ #include " ewald.h"
1617#include " fcs_phonon.h"
1718#include " kpoint.h"
1819#include " mathfunctions.h"
@@ -77,6 +78,7 @@ void PhononVelocity::get_phonon_group_velocity_bandstructure(const KpointBandStr
7778 const double lavec_p[3 ][3 ],
7879 const double rlavec_p[3 ][3 ],
7980 const std::vector<FcsClassExtent> &fc2_ext_in,
81+ const std::vector<FcsClassExtent> &fc2_without_dipole,
8082 double **phvel_out) const
8183{
8284 unsigned int i;
@@ -130,12 +132,19 @@ void PhononVelocity::get_phonon_group_velocity_bandstructure(const KpointBandStr
130132 rotvec (xk_shift[idiff], xk_shift[idiff], lavec_p, ' T' );
131133 for (i = 0 ; i < 3 ; ++i) xk_shift[idiff][i] /= 2.0 * pi;
132134
133- dynamical->eval_k (xk_shift[idiff],
134- kpoint_bs_in->kvec_na [ik],
135- fc2_ext_in,
136- omega_shift[idiff],
137- evec_tmp, false );
138-
135+ if (dynamical->nonanalytic == 3 ) {
136+ dynamical->eval_k_ewald (xk_shift[idiff],
137+ kpoint_bs_in->kvec_na [ik],
138+ fc2_without_dipole,
139+ omega_shift[idiff],
140+ evec_tmp, false );
141+ } else {
142+ dynamical->eval_k (xk_shift[idiff],
143+ kpoint_bs_in->kvec_na [ik],
144+ fc2_ext_in,
145+ omega_shift[idiff],
146+ evec_tmp, false );
147+ }
139148 }
140149
141150 for (i = 0 ; i < n; ++i) {
@@ -159,7 +168,6 @@ void PhononVelocity::get_phonon_group_velocity_bandstructure(const KpointBandStr
159168
160169void PhononVelocity::get_phonon_group_velocity_mesh (const KpointMeshUniform &kmesh_in,
161170 const double lavec_p[3 ][3 ],
162- const std::vector<FcsClassExtent> &fc2_ext_in,
163171 const bool irreducible_only,
164172 double ***phvel3_out) const
165173{
@@ -202,7 +210,6 @@ void PhononVelocity::get_phonon_group_velocity_mesh(const KpointMeshUniform &kme
202210
203211void PhononVelocity::get_phonon_group_velocity_mesh_mpi (const KpointMeshUniform &kmesh_in,
204212 const double lavec_p[3 ][3 ],
205- const std::vector<FcsClassExtent> &fc2_ext_in,
206213 double ***phvel3_out) const
207214{
208215 // This routine computes the group velocities for the given uniform k mesh
@@ -469,13 +476,21 @@ void PhononVelocity::phonon_vel_k(const double *xk_in,
469476
470477 for (idiff = 0 ; idiff < ndiff; ++idiff) {
471478
472- dynamical->eval_k (xk_shift[idiff],
473- kvec_na_tmp[0 ],
474- fcs_phonon->fc2_ext ,
475- omega_shift[idiff],
476- evec_tmp,
477- false );
478-
479+ if (dynamical->nonanalytic == 3 ) {
480+ dynamical->eval_k_ewald (xk_shift[idiff],
481+ kvec_na_tmp[idiff],
482+ ewald->fc2_without_dipole ,
483+ omega_shift[idiff],
484+ evec_tmp,
485+ false );
486+ } else {
487+ dynamical->eval_k (xk_shift[idiff],
488+ kvec_na_tmp[idiff],
489+ fcs_phonon->fc2_ext ,
490+ omega_shift[idiff],
491+ evec_tmp,
492+ false );
493+ }
479494 }
480495
481496 for (j = 0 ; j < n; ++j) {
0 commit comments