Skip to content

Commit

Permalink
Print PR and APR also when KPMODE = 0.
Browse files Browse the repository at this point in the history
  • Loading branch information
ttadano committed Mar 1, 2016
1 parent 64f6e37 commit 7182097
Showing 1 changed file with 11 additions and 11 deletions.
22 changes: 11 additions & 11 deletions anphon/write_phonons.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1530,6 +1530,15 @@ void Writes::write_normal_mode_animation(const double xk_in[3], const unsigned i

void Writes::write_participation_ratio()
{
unsigned int i, j, k;
unsigned int knum;
unsigned int nk = kpoint->nk;
unsigned int neval = dynamical->neval;
unsigned int natmin = system->natmin;

double **participation_ratio;
double ***atomic_participation_ratio;

std::ofstream ofs_pr, ofs_apr;
std::string file_pr = input->job_title + ".pr";
std::string file_apr = input->job_title + ".apr";
Expand All @@ -1544,23 +1553,14 @@ void Writes::write_participation_ratio()

ofs_apr.setf(std::ios::scientific);

unsigned int i, j, k;
unsigned int knum;
unsigned int nk = kpoint->nk;
unsigned int neval = dynamical->neval;
unsigned int natmin = system->natmin;

double **participation_ratio;
double ***atomic_participation_ratio;

memory->allocate(participation_ratio, nk, neval);
memory->allocate(atomic_participation_ratio, nk, neval, natmin);

dynamical->calc_participation_ratio_all(dynamical->evec_phonon, participation_ratio, atomic_participation_ratio);

ofs_pr << "# Participation ratio of each phonon modes at k points" << std::endl;

if (kpoint->kpoint_mode == 1) {
if (kpoint->kpoint_mode == 0 || kpoint->kpoint_mode == 1) {

ofs_pr << "# kpoint, mode, PR[kpoint][mode]" << std::endl;

Expand Down Expand Up @@ -1607,7 +1607,7 @@ void Writes::write_participation_ratio()

ofs_apr << "# Atomic participation ratio of each phonon modes at k points" << std::endl;

if (kpoint->kpoint_mode == 1) {
if (kpoint->kpoint_mode == 0 || kpoint->kpoint_mode == 1) {

ofs_apr << "# kpoint, mode, atom, APR[kpoint][mode][atom]" << std::endl;

Expand Down

0 comments on commit 7182097

Please sign in to comment.