Skip to content

Commit

Permalink
Merge branch 'develop' of github.com:ttadano/alamode into develop
Browse files Browse the repository at this point in the history
  • Loading branch information
ttadano committed Jul 14, 2016
2 parents 5cc9573 + 0895368 commit e6c2bbe
Show file tree
Hide file tree
Showing 14 changed files with 56 additions and 54 deletions.
10 changes: 5 additions & 5 deletions alm/alamode.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -33,12 +33,12 @@ using namespace ALM_NS;

ALM::ALM(int narg, char **arg)
{
std::cout << " +------------------------------------------------------------+" << std::endl;
std::cout << " + Program ALM +" << std::endl;
std::cout << " + Ver.";
std::cout << " +-----------------------------------------------------------------+" << std::endl;
std::cout << " + Program ALM +" << std::endl;
std::cout << " + Ver.";
std::cout << std::setw(7) << ALAMODE_VERSION;
std::cout << " +" << std::endl;
std::cout << " +------------------------------------------------------------+" << std::endl;
std::cout << " +" << std::endl;
std::cout << " +-----------------------------------------------------------------+" << std::endl;
std::cout << std::endl;

timer = new Timer(this);
Expand Down
13 changes: 7 additions & 6 deletions alm/constraint.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -65,22 +65,23 @@ void Constraint::setup()
case 1:
impose_inv_T = true;
impose_inv_R = false;
std::cout << " ICONST = 1: Constraints for translational invariance will be considered." << std::endl;
std::cout << " ICONST = 1: Constraints for translational invariance" << std::endl;
std::cout << " will be considered." << std::endl;
break;
case 2:
impose_inv_T = true;
impose_inv_R = true;
exclude_last_R = true;
std::cout << " ICONST = 2: Constraints for translational and rotational invariance will be considered." << std::endl;
std::cout << " Axis of rotation is " << rotation_axis << std::endl;
std::cout << " ICONST = 2: Constraints for translational and rotational invariance" << std::endl;
std::cout << " will be considered. Axis of rotation is " << rotation_axis << std::endl;
std::cout << " Rotational invariance of the maximum order will be neglected" << std::endl;
break;
case 3:
impose_inv_T = true;
impose_inv_R = true;
exclude_last_R = false;
std::cout << " ICONST = 3: Constraints for translational and rotational invariance will be considered." << std::endl;
std::cout << " Axis of rotation is " << rotation_axis << std::endl;
std::cout << " ICONST = 3: Constraints for translational and rotational invariance" << std::endl;
std::cout << " will be considered. Axis of rotation is " << rotation_axis << std::endl;
break;
default:
error->exit("Constraint::setup", "invalid constraint_mode", constraint_mode);
Expand Down Expand Up @@ -277,7 +278,7 @@ void Constraint::setup()
memory->deallocate(const_self);

timer->print_elapsed();
std::cout << " --------------------------------------------------------------" << std::endl;
std::cout << " -------------------------------------------------------------------" << std::endl;
std::cout << std::endl;
}
}
Expand Down
2 changes: 1 addition & 1 deletion alm/fcs.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ void Fcs::init()
memory->deallocate(nints);
memory->deallocate(nzero);
timer->print_elapsed();
std::cout << " --------------------------------------------------------------" << std::endl;
std::cout << " -------------------------------------------------------------------" << std::endl;
std::cout << std::endl;
}

Expand Down
10 changes: 5 additions & 5 deletions alm/fitting.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -217,7 +217,7 @@ void Fitting::fitmain()

std::cout << std::endl;
timer->print_elapsed();
std::cout << " --------------------------------------------------------------" << std::endl;
std::cout << " -------------------------------------------------------------------" << std::endl;
std::cout << std::endl;
}

Expand Down Expand Up @@ -307,8 +307,8 @@ void Fitting::data_multiplier(const int nat,

} else if (multiply_data == 1) {

std::cout << " MULTDAT = 1: Generate symmetrically equivalent displacement-force data sets " << std::endl;
std::cout << " by using pure translational operations only." << std::endl << std::endl;
std::cout << " MULTDAT = 1: Generate symmetrically equivalent displacement-force " << std::endl;
std::cout << " data sets by using pure translational operations only." << std::endl << std::endl;

nmulti = symmetry->ntran;

Expand Down Expand Up @@ -338,8 +338,8 @@ void Fitting::data_multiplier(const int nat,

double u_rot[3], f_rot[3];

std::cout << " MULTDAT = 2: Generate symmetrically equivalent displacement-force data sets." << std::endl;
std::cout << " (including rotational part) " << std::endl << std::endl;
std::cout << " MULTDAT = 2: Generate symmetrically equivalent displacement-force" << std::endl;
std::cout << " data sets. (including rotational part) " << std::endl << std::endl;

nmulti = symmetry->nsym;

Expand Down
2 changes: 1 addition & 1 deletion alm/interaction.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ void Interaction::init()
generate_pairs(pairs, mindist_cluster);

timer->print_elapsed();
std::cout << " --------------------------------------------------------------" << std::endl;
std::cout << " -------------------------------------------------------------------" << std::endl;
std::cout << std::endl;
}

Expand Down
5 changes: 3 additions & 2 deletions alm/symmetry.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,8 @@ void Symmetry::init()
symop_availability_check(symrel, sym_available, nsym, nsym_fc);

if (nsym_fc == nsym) {
std::cout << " All symmetry operations will be used to reduce the number of force constants." << std::endl;
std::cout << " All symmetry operations will be used to" << std::endl;
std::cout << " reduce the number of force constants." << std::endl;
} else {
std::cout << " " << nsym_fc << " symmetry operations out of "
<< nsym << " will be used to reduce the number of parameters." << std::endl;
Expand Down Expand Up @@ -117,7 +118,7 @@ void Symmetry::init()
std::cout << std::endl;

timer->print_elapsed();
std::cout << " --------------------------------------------------------------" << std::endl;
std::cout << " -------------------------------------------------------------------" << std::endl;
std::cout << std::endl;
}

Expand Down
2 changes: 1 addition & 1 deletion alm/system.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,7 @@ void System::init()
}

timer->print_elapsed();
cout << " --------------------------------------------------------------" << endl;
cout << " -------------------------------------------------------------------" << endl;
cout << endl;
}

Expand Down
16 changes: 9 additions & 7 deletions alm/writes.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -39,8 +39,8 @@ void Writes::write_input_vars()
unsigned int i;

std::cout << std::endl;
std::cout << " Input variables below:" << std::endl;
std::cout << " --------------------------------------------------------------" << std::endl;
std::cout << " Input variables:" << std::endl;
std::cout << " -------------------------------------------------------------------" << std::endl;
std::cout << " General:" << std::endl;
std::cout << " PREFIX = " << files->job_title << std::endl;
std::cout << " MODE = " << alm->mode << std::endl;
Expand Down Expand Up @@ -85,15 +85,17 @@ void Writes::write_input_vars()
std::cout << " FC3XML = " << constraint->fc3_file << std::endl;
std::cout << std::endl;
}
std::cout << " --------------------------------------------------------------" << std::endl;
std::cout << " -------------------------------------------------------------------" << std::endl;
std::cout << std::endl;
}

void Writes::writeall()
{
std::cout << " The following files are created:" << std::endl << std::endl;
write_force_constants();
write_misc_xml();
if (print_hessian) write_hessian();
std::cout << std::endl;
}

void Writes::write_force_constants()
Expand Down Expand Up @@ -262,7 +264,7 @@ void Writes::write_force_constants()
memory->deallocate(str_fcs);
ofs_fcs.close();

std::cout << std::endl << " Force constants are written to file: "
std::cout << " Force constants in a human-readable format : "
<< files->file_fcs << std::endl;
}

Expand Down Expand Up @@ -591,7 +593,7 @@ void Writes::write_misc_xml()

memory->deallocate(pair_tmp);

std::cout << " Information for post-process is stored to file: " << file_xml << std::endl;
std::cout << " Input data for the phonon code ANPHON : " << file_xml << std::endl;
}

void Writes::write_hessian()
Expand Down Expand Up @@ -629,7 +631,7 @@ void Writes::write_hessian()
ofs_hes.open(files->file_hes.c_str(), std::ios::out);
if (!ofs_hes) error->exit("write_hessian", "cannot create hessian file");

ofs_hes << "# iat, icrd, jat, jcrd, FC2 (Ryd/Bohr^2)" << std::endl;
ofs_hes << "# atom1, xyz1, atom2, xyz2, FC2 (Ryd/Bohr^2)" << std::endl;
for (i = 0; i < nat3; ++i) {
for (j = 0; j < nat3; ++j) {
ofs_hes << std::setw(5) << i / 3 + 1;
Expand All @@ -644,7 +646,7 @@ void Writes::write_hessian()
ofs_hes.close();
memory->deallocate(hessian);

std::cout << " Hessian is written to file: " << files->file_hes << std::endl;
std::cout << " Complete Hessian matrix : " << files->file_hes << std::endl;
}

std::string Writes::double2string(const double d, const int nprec)
Expand Down
1 change: 1 addition & 0 deletions anphon/conductivity.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -522,6 +522,7 @@ void Conductivity::compute_frequency_resolved_kappa(const int ntemp,
int *kmap_identity;
double **eval;

std::cout << std::endl;
std::cout << " KAPPA_SPEC = 1 : Calculating thermal conductivity spectra ... ";

memory->allocate(kappa_spec, dos->n_energy, ntemp, 3);
Expand Down
19 changes: 8 additions & 11 deletions anphon/dynamical.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,8 @@ void Dynamical::setup_dynamical(std::string mode)

if (mympi->my_rank == 0) {
std::cout << std::endl;
std::cout << " ------------------------------------------------------------" << std::endl << std::endl;
std::cout << " -----------------------------------------------------------------"
<< std::endl << std::endl;
}
}

Expand Down Expand Up @@ -788,16 +789,12 @@ double Dynamical::fold(double x)

double Dynamical::freq(const double x)
{
if (std::abs(x) < eps) {
// Special treatment to avoid the divergence of computation.
return eps15;
} else {
if (x > 0.0) {
return std::sqrt(x);
} else {
return -std::sqrt(-x);
}
}
// Special treatment to avoid the divergence of computation.
if (std::abs(x) < eps) return eps15;

if (x > 0.0) return std::sqrt(x);

return -std::sqrt(-x);
}


Expand Down
10 changes: 5 additions & 5 deletions anphon/phonons.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -47,12 +47,12 @@ PHON::PHON(int narg, char **arg, MPI_Comm comm)
create_pointers();

if (mympi->my_rank == 0) {
std::cout << " +------------------------------------------------------------+" << std::endl;
std::cout << " + Program ANPHON +" << std::endl;
std::cout << " + Ver.";
std::cout << " +-----------------------------------------------------------------+" << std::endl;
std::cout << " + Program ANPHON +" << std::endl;
std::cout << " + Ver.";
std::cout << std::setw(7) << ALAMODE_VERSION;
std::cout << " +" << std::endl;
std::cout << " +------------------------------------------------------------+" << std::endl;
std::cout << " +" << std::endl;
std::cout << " +-----------------------------------------------------------------+" << std::endl;

std::cout << std::endl;
std::cout << " Job started at " << timer->DateAndTime() << std::endl;
Expand Down
2 changes: 1 addition & 1 deletion anphon/relaxation.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ void Relaxation::setup_relaxation()

if (mympi->my_rank == 0) {
std::cout << std::endl;
std::cout << " ------------------------------------------------------------" << std::endl << std::endl;
std::cout << " -----------------------------------------------------------------" << std::endl << std::endl;
std::cout << " Now, move on to phonon lifetime calculations." << std::endl;
}

Expand Down
2 changes: 1 addition & 1 deletion anphon/system.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ void System::setup()
}

if (mympi->my_rank == 0) {
cout << " ------------------------------------------------------------" << endl;
cout << " -----------------------------------------------------------------" << endl;
cout << endl;
cout << " Crystal structure" << endl;
cout << " =================" << endl << endl;
Expand Down
16 changes: 8 additions & 8 deletions anphon/write_phonons.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -49,8 +49,8 @@ void Writes::write_input_vars()
unsigned int i;

std::cout << std::endl;
std::cout << " Input variables :" << std::endl;
std::cout << " ------------------------------------------------------------" << std::endl;
std::cout << " Input variables:" << std::endl;
std::cout << " -----------------------------------------------------------------" << std::endl;
std::cout << " General:" << std::endl;
std::cout << " PREFIX = " << input->job_title << std::endl;
std::cout << " MODE = " << phon->mode << std::endl;
Expand Down Expand Up @@ -150,7 +150,7 @@ void Writes::write_input_vars()
std::cout << " ISOFACT = ";
for (i = 0; i < system->nkd; ++i) {
std::cout << std::scientific
<< std::setw(12) << isotope->isotope_factor[i];
<< std::setw(13) << isotope->isotope_factor[i];
}
std::cout << std::endl;
}
Expand All @@ -169,7 +169,7 @@ void Writes::write_input_vars()
}

std::cout << std::endl << std::endl;
std::cout << " ------------------------------------------------------------" << std::endl;
std::cout << " -----------------------------------------------------------------" << std::endl;
std::cout << std::endl;
}

Expand Down Expand Up @@ -365,7 +365,7 @@ void Writes::print_phonon_energy()
double kayser_to_THz = 0.0299792458;

std::cout << std::endl;
std::cout << " ------------------------------------------------------------" << std::endl << std::endl;
std::cout << " -----------------------------------------------------------------" << std::endl << std::endl;
std::cout << " Phonon frequencies below:" << std::endl << std::endl;

if (kpoint->kpoint_mode == 0 || kpoint->kpoint_mode == 1) {
Expand Down Expand Up @@ -440,7 +440,7 @@ void Writes::write_phonon_info()
}

std::cout << std::endl;
std::cout << " ------------------------------------------------------------" << std::endl << std::endl;
std::cout << " -----------------------------------------------------------------" << std::endl << std::endl;
std::cout << " The following files are created: " << std::endl;


Expand Down Expand Up @@ -1226,7 +1226,7 @@ void Writes::write_kappa()
}

std::cout << std::endl;
std::cout << " ------------------------------------------------------------" << std::endl << std::endl;
std::cout << " -----------------------------------------------------------------" << std::endl << std::endl;
std::cout << " Lattice thermal conductivity is stored in the file " << file_kappa << std::endl;
if (conductivity->calc_kappa_spec) {
std::cout << " Thermal conductivity spectra is stored in the file " << file_kappa2 << std::endl;
Expand Down Expand Up @@ -1320,7 +1320,7 @@ void Writes::write_normal_mode_animation(const double xk_in[3],
for (i = 0; i < 3; ++i) {
xk[i] = xk_in[i];
}
std::cout << " ------------------------------------------------------------" << std::endl << std::endl;
std::cout << " -----------------------------------------------------------------" << std::endl << std::endl;
std::cout << " ANIME-tag is given: Making animation files for the given" << std::endl;
std::cout << " k point ( ";
std::cout << std::setw(5) << xk[0] << ", "
Expand Down

0 comments on commit e6c2bbe

Please sign in to comment.