From 000fce8655e6f01c93112c191583969e3ff95b3f Mon Sep 17 00:00:00 2001 From: Terumasa Tadano Date: Thu, 14 Jul 2016 13:52:22 +0900 Subject: [PATCH 1/2] Fixed output format --- alm/writes.cpp | 2 +- anphon/conductivity.cpp | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/alm/writes.cpp b/alm/writes.cpp index 9be87309..02afd0cd 100644 --- a/alm/writes.cpp +++ b/alm/writes.cpp @@ -629,7 +629,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; diff --git a/anphon/conductivity.cpp b/anphon/conductivity.cpp index d6916dce..e3c85710 100644 --- a/anphon/conductivity.cpp +++ b/anphon/conductivity.cpp @@ -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); From 08953686cc692ac0f2b953337571837e32e5bf6a Mon Sep 17 00:00:00 2001 From: "Terumasa TADANO (windows)" Date: Thu, 14 Jul 2016 19:09:24 +0900 Subject: [PATCH 2/2] Minor changes of output format --- alm/alamode.cpp | 10 +++++----- alm/constraint.cpp | 13 +++++++------ alm/fcs.cpp | 2 +- alm/fitting.cpp | 10 +++++----- alm/interaction.cpp | 2 +- alm/symmetry.cpp | 5 +++-- alm/system.cpp | 2 +- alm/writes.cpp | 14 ++++++++------ anphon/dynamical.cpp | 19 ++++++++----------- anphon/phonons.cpp | 10 +++++----- anphon/relaxation.cpp | 2 +- anphon/system.cpp | 2 +- anphon/write_phonons.cpp | 16 ++++++++-------- 13 files changed, 54 insertions(+), 53 deletions(-) diff --git a/alm/alamode.cpp b/alm/alamode.cpp index acc5c57d..1f7dcb70 100644 --- a/alm/alamode.cpp +++ b/alm/alamode.cpp @@ -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); diff --git a/alm/constraint.cpp b/alm/constraint.cpp index 171fe886..46382a64 100644 --- a/alm/constraint.cpp +++ b/alm/constraint.cpp @@ -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); @@ -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; } } diff --git a/alm/fcs.cpp b/alm/fcs.cpp index dc2ab2c9..a1713dbe 100644 --- a/alm/fcs.cpp +++ b/alm/fcs.cpp @@ -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; } diff --git a/alm/fitting.cpp b/alm/fitting.cpp index 16627e4b..1d3f64fb 100644 --- a/alm/fitting.cpp +++ b/alm/fitting.cpp @@ -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; } @@ -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; @@ -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; diff --git a/alm/interaction.cpp b/alm/interaction.cpp index c6ce7836..adbda3a2 100644 --- a/alm/interaction.cpp +++ b/alm/interaction.cpp @@ -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; } diff --git a/alm/symmetry.cpp b/alm/symmetry.cpp index a831b922..e04c4453 100644 --- a/alm/symmetry.cpp +++ b/alm/symmetry.cpp @@ -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; @@ -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; } diff --git a/alm/system.cpp b/alm/system.cpp index 8ea99404..18d39dca 100644 --- a/alm/system.cpp +++ b/alm/system.cpp @@ -150,7 +150,7 @@ void System::init() } timer->print_elapsed(); - cout << " --------------------------------------------------------------" << endl; + cout << " -------------------------------------------------------------------" << endl; cout << endl; } diff --git a/alm/writes.cpp b/alm/writes.cpp index 02afd0cd..d20581e1 100644 --- a/alm/writes.cpp +++ b/alm/writes.cpp @@ -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; @@ -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() @@ -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; } @@ -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() @@ -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) diff --git a/anphon/dynamical.cpp b/anphon/dynamical.cpp index 9da28c6d..1974e379 100644 --- a/anphon/dynamical.cpp +++ b/anphon/dynamical.cpp @@ -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; } } @@ -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); } diff --git a/anphon/phonons.cpp b/anphon/phonons.cpp index 4764c26d..2446cbb7 100644 --- a/anphon/phonons.cpp +++ b/anphon/phonons.cpp @@ -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; diff --git a/anphon/relaxation.cpp b/anphon/relaxation.cpp index b44478d4..8564ac66 100644 --- a/anphon/relaxation.cpp +++ b/anphon/relaxation.cpp @@ -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; } diff --git a/anphon/system.cpp b/anphon/system.cpp index 15a219fe..ae2f2e2d 100644 --- a/anphon/system.cpp +++ b/anphon/system.cpp @@ -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; diff --git a/anphon/write_phonons.cpp b/anphon/write_phonons.cpp index 4e8b0a98..efe266f7 100644 --- a/anphon/write_phonons.cpp +++ b/anphon/write_phonons.cpp @@ -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; @@ -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; } @@ -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; } @@ -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) { @@ -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; @@ -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; @@ -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] << ", "