apply clang-tidy fixes

This commit is contained in:
Axel Kohlmeyer
2024-02-09 06:29:08 -05:00
parent f8885cb266
commit a2ae9dce64
11 changed files with 36 additions and 137 deletions

View File

@ -53,7 +53,7 @@ void Phonon::pdisp()
#ifdef UseSPG #ifdef UseSPG
if (method == 1){ if (method == 1){
#endif #endif
while (1){ while (true){
for (int i = 0; i < 3; ++i) qstr[i] = qend[i]; for (int i = 0; i < 3; ++i) qstr[i] = qend[i];
printf("\nPlease input the start q-point in unit of B1->B3, q to exit [%g %g %g]: ", qstr[0], qstr[1], qstr[2]); printf("\nPlease input the start q-point in unit of B1->B3, q to exit [%g %g %g]: ", qstr[0], qstr[1], qstr[2]);
@ -67,7 +67,7 @@ void Phonon::pdisp()
qstr[2] = atof(strtok(NULL, " \t\n\r\f")); qstr[2] = atof(strtok(NULL, " \t\n\r\f"));
} }
while ( 1 ){ while ( true ){
printf("Please input the end q-point in unit of B1->B3: "); printf("Please input the end q-point in unit of B1->B3: ");
input->read_stdin(str); input->read_stdin(str);
if (count_words(str) >= 3) break; if (count_words(str) >= 3) break;
@ -166,8 +166,6 @@ void Phonon::pdisp()
delete []fname; delete []fname;
delete qnodes; delete qnodes;
return;
} }
/*----------------------------------------------------------------------------*/ /*----------------------------------------------------------------------------*/

View File

@ -200,8 +200,6 @@ DynMat::DynMat(int narg, char **arg)
// ask for the interpolation method // ask for the interpolation method
interpolate->set_method(); interpolate->set_method();
return;
} }
@ -222,8 +220,6 @@ DynMat::~DynMat()
memory->destroy(DM_all); memory->destroy(DM_all);
memory->destroy(M_inv_sqrt); memory->destroy(M_inv_sqrt);
delete memory; delete memory;
return;
} }
/* ---------------------------------------------------------------------------- /* ----------------------------------------------------------------------------
@ -234,10 +230,10 @@ void DynMat::writeDMq(double *q)
FILE *fp; FILE *fp;
// only ask for file name for the first time // only ask for file name for the first time
// other calls will append the result to the file. // other calls will append the result to the file.
if (dmfile == NULL){ if (dmfile == nullptr){
char str[MAXLINE], *ptr; char str[MAXLINE], *ptr;
printf("\n"); printf("\n");
while ( 1 ){ while ( true ){
printf("Please input the filename to output the DM at selected q: "); printf("Please input the filename to output the DM at selected q: ");
input->read_stdin(str); input->read_stdin(str);
ptr = strtok(str, " \r\t\n\f"); ptr = strtok(str, " \r\t\n\f");
@ -260,8 +256,6 @@ void DynMat::writeDMq(double *q)
} }
fprintf(fp,"\n"); fprintf(fp,"\n");
fclose(fp); fclose(fp);
return;
} }
/* ---------------------------------------------------------------------------- /* ----------------------------------------------------------------------------
@ -275,7 +269,6 @@ void DynMat::writeDMq(double *q, const double qr, FILE *fp)
for (int j = 0; j < fftdim; ++j) fprintf(fp,"%lg %lg\t", DM_q[i][j].r, DM_q[i][j].i); for (int j = 0; j < fftdim; ++j) fprintf(fp,"%lg %lg\t", DM_q[i][j].r, DM_q[i][j].i);
fprintf(fp,"\n"); fprintf(fp,"\n");
return;
} }
/* ---------------------------------------------------------------------------- /* ----------------------------------------------------------------------------
@ -327,8 +320,6 @@ int DynMat::geteigen(double *egv, int flag)
void DynMat::getDMq(double *q) void DynMat::getDMq(double *q)
{ {
interpolate->execute(q, DM_q[0]); interpolate->execute(q, DM_q[0]);
return;
} }
/* ---------------------------------------------------------------------------- /* ----------------------------------------------------------------------------
@ -339,7 +330,6 @@ void DynMat::getDMq(double *q, double *wt)
interpolate->execute(q, DM_q[0]); interpolate->execute(q, DM_q[0]);
if (flag_skip && interpolate->UseGamma ) wt[0] = 0.; if (flag_skip && interpolate->UseGamma ) wt[0] = 0.;
return;
} }
/* ---------------------------------------------------------------------------- /* ----------------------------------------------------------------------------
@ -359,7 +349,6 @@ void DynMat::car2dir()
basis[i][idim] = x[0]*mat[idim] + x[1]*mat[3+idim] + x[2]*mat[6+idim]; basis[i][idim] = x[0]*mat[idim] + x[1]*mat[3+idim] + x[2]*mat[6+idim];
} }
return;
} }
/* ---------------------------------------------------------------------------- /* ----------------------------------------------------------------------------
@ -463,7 +452,6 @@ void DynMat::EnforceASR()
} }
delete[] egvs; delete[] egvs;
puts("\n================================================================================\n"); puts("\n================================================================================\n");
return;
} }
/* ---------------------------------------------------------------------------- /* ----------------------------------------------------------------------------
@ -501,7 +489,6 @@ void DynMat::real2rec()
for (int j = 0; j < sysdim; ++j) printf("%8.4f ", ibasevec[i*3+j]); for (int j = 0; j < sysdim; ++j) printf("%8.4f ", ibasevec[i*3+j]);
} }
puts("\n================================================================================"); puts("\n================================================================================");
return;
} }
/* ---------------------------------------------------------------------- /* ----------------------------------------------------------------------
@ -590,8 +577,6 @@ void DynMat::GaussJordan(int n, double *Mat)
delete []indxr; delete []indxr;
delete []indxc; delete []indxc;
delete []ipiv; delete []ipiv;
return;
} }
/* ---------------------------------------------------------------------------- /* ----------------------------------------------------------------------------
@ -600,8 +585,6 @@ void DynMat::GaussJordan(int n, double *Mat)
void DynMat::reset_interp_method() void DynMat::reset_interp_method()
{ {
interpolate->set_method(); interpolate->set_method();
return;
} }
/* ---------------------------------------------------------------------------- /* ----------------------------------------------------------------------------
@ -644,8 +627,6 @@ void DynMat::ShowVersion()
printf(" (__) (_) (_)(__)(__)(_)\\_)(__)(__)\n"); printf(" (__) (_) (_)(__)(__)(_)\\_)(__)(__)\n");
printf("\nPHonon ANAlyzer for Fix-Phonon, version 2.%02d, compiled on %s.\n", VERSION, __DATE__); printf("\nPHonon ANAlyzer for Fix-Phonon, version 2.%02d, compiled on %s.\n", VERSION, __DATE__);
printf("Reference: https://doi.org/10.1016/j.cpc.2011.04.019\n"); printf("Reference: https://doi.org/10.1016/j.cpc.2011.04.019\n");
return;
} }
/* ---------------------------------------------------------------------------- /* ----------------------------------------------------------------------------
@ -696,7 +677,6 @@ void DynMat::Define_Conversion_Factor()
printf("sqrt(E/ML^2)/(2*pi) into THz, instead, I set it to 1; you should check the unit\nused by LAMMPS.\n"); printf("sqrt(E/ML^2)/(2*pi) into THz, instead, I set it to 1; you should check the unit\nused by LAMMPS.\n");
eml2f = eml2fc = 1.; eml2f = eml2fc = 1.;
} }
return;
} }
/* ---------------------------------------------------------------------------- /* ----------------------------------------------------------------------------
@ -711,6 +691,5 @@ void DynMat::ShowInfo()
printf("System dimension : %d\n", sysdim); printf("System dimension : %d\n", sysdim);
printf("Boltzmann constant in used units : %g\n", boltz); printf("Boltzmann constant in used units : %g\n", boltz);
puts("================================================================================"); puts("================================================================================");
return;
} }
/* --------------------------------------------------------------------*/ /* --------------------------------------------------------------------*/

View File

@ -65,8 +65,6 @@ Green::Green(const int ntm, const int sdim, const int niter, const double min, c
// Get the inverser of the treated hessian by continued fractional method // Get the inverser of the treated hessian by continued fractional method
Recursion(); Recursion();
return;
} }
/*------------------------------------------------------------------------------ /*------------------------------------------------------------------------------
@ -74,14 +72,12 @@ Green::Green(const int ntm, const int sdim, const int niter, const double min, c
*----------------------------------------------------------------------------*/ *----------------------------------------------------------------------------*/
Green::~Green() Green::~Green()
{ {
H = NULL; H = nullptr;
ldos = NULL; ldos = nullptr;
memory->destroy(alpha); memory->destroy(alpha);
memory->destroy(beta); memory->destroy(beta);
delete memory; delete memory;
return;
} }
/*------------------------------------------------------------------------------ /*------------------------------------------------------------------------------
@ -134,8 +130,6 @@ void Green::Lanczos()
delete []vp; delete []vp;
delete []v; delete []v;
delete []w; delete []w;
return;
} }
/*------------------------------------------------------------------------------ /*------------------------------------------------------------------------------
@ -211,8 +205,6 @@ void Green::Recursion()
delete []beta_inf; delete []beta_inf;
delete []xmin; delete []xmin;
delete []xmax; delete []xmax;
return;
} }
/*------------------------------------------------------------------------------ /*------------------------------------------------------------------------------
@ -239,7 +231,6 @@ void Green::recursion()
} }
w += dw; w += dw;
} }
return;
} }
/*------------------------------------------------------------------------------*/ /*------------------------------------------------------------------------------*/

View File

@ -7,10 +7,8 @@
* ---------------------------------------------------------------- */ * ---------------------------------------------------------------- */
UserInput::UserInput(int flag) UserInput::UserInput(int flag)
{ {
fp = NULL; fp = nullptr;
if (flag) fp = fopen("script.inp", "w"); if (flag) fp = fopen("script.inp", "w");
return;
} }
/* ------------------------------------------------------------------- /* -------------------------------------------------------------------
@ -19,7 +17,7 @@ UserInput::UserInput(int flag)
UserInput::~UserInput() UserInput::~UserInput()
{ {
if (fp) fclose(fp); if (fp) fclose(fp);
fp = NULL; fp = nullptr;
} }
/* ------------------------------------------------------------------- /* -------------------------------------------------------------------
@ -29,7 +27,5 @@ void UserInput::read_stdin(char *str)
{ {
fgets(str, MAXLINE, stdin); fgets(str, MAXLINE, stdin);
if (fp) fprintf(fp, "%s", str); if (fp) fprintf(fp, "%s", str);
return;
} }
/* ---------------------------------------------------------------- */ /* ---------------------------------------------------------------- */

View File

@ -28,8 +28,6 @@ Interpolate::Interpolate(int nx, int ny, int nz, int ndm, doublecomplex **DM)
Dfdx = Dfdy = Dfdz = D2fdxdy = D2fdxdz = D2fdydz = D3fdxdydz = NULL; Dfdx = Dfdy = Dfdz = D2fdxdy = D2fdxdz = D2fdydz = D3fdxdydz = NULL;
flag_reset_gamma = flag_allocated_dfs = 0; flag_reset_gamma = flag_allocated_dfs = 0;
input = NULL; input = NULL;
return;
} }
/* ---------------------------------------------------------------------------- /* ----------------------------------------------------------------------------
@ -106,7 +104,6 @@ void Interpolate::tricubic_init()
} }
n++; n++;
} }
return;
} }
/* ---------------------------------------------------------------------------- /* ----------------------------------------------------------------------------
@ -123,8 +120,6 @@ Interpolate::~Interpolate()
memory->destroy(D2fdydz); memory->destroy(D2fdydz);
memory->destroy(D3fdxdydz); memory->destroy(D3fdxdydz);
delete memory; delete memory;
return;
} }
/* ---------------------------------------------------------------------------- /* ----------------------------------------------------------------------------
@ -184,7 +179,6 @@ void Interpolate::tricubic(double *qin, doublecomplex *DMq)
tricubic_get_coeff(&a[0],&f[0],&dfdx[0],&dfdy[0],&dfdz[0],&d2fdxdy[0],&d2fdxdz[0],&d2fdydz[0],&d3fdxdydz[0]); tricubic_get_coeff(&a[0],&f[0],&dfdx[0],&dfdy[0],&dfdz[0],&d2fdxdy[0],&d2fdxdz[0],&d2fdydz[0],&d3fdxdydz[0]);
DMq[idim].i = tricubic_eval(&a[0],x,y,z); DMq[idim].i = tricubic_eval(&a[0],x,y,z);
} }
return;
} }
/* ---------------------------------------------------------------------------- /* ----------------------------------------------------------------------------
@ -250,7 +244,6 @@ void Interpolate::trilinear(double *qin, doublecomplex *DMq)
} }
} }
return;
} }
/* ---------------------------------------------------------------------------- /* ----------------------------------------------------------------------------
@ -263,8 +256,6 @@ void Interpolate::execute(double *qin, doublecomplex *DMq)
tricubic(qin, DMq); tricubic(qin, DMq);
else // otherwise: trilinear else // otherwise: trilinear
trilinear(qin, DMq); trilinear(qin, DMq);
return;
} }
/* ---------------------------------------------------------------------------- /* ----------------------------------------------------------------------------
@ -274,7 +265,7 @@ void Interpolate::set_method()
{ {
char str[MAXLINE]; char str[MAXLINE];
int im = 1; int im = 1;
if (input == NULL) input = new UserInput(0); if (input == nullptr) input = new UserInput(0);
puts("\n================================================================================"); puts("\n================================================================================");
printf("Which interpolation method would you like to use?\n"); printf("Which interpolation method would you like to use?\n");
@ -289,8 +280,6 @@ void Interpolate::set_method()
puts("================================================================================\n"); puts("================================================================================\n");
if (which == 1) tricubic_init(); if (which == 1) tricubic_init();
return;
} }
/* ---------------------------------------------------------------------------- /* ----------------------------------------------------------------------------
@ -316,6 +305,5 @@ void Interpolate::reset_gamma()
+ (data[im1][idim].r + data[ip1][idim].r) * two3; + (data[im1][idim].r + data[ip1][idim].r) * two3;
} }
return;
} }
/* ---------------------------------------------------------------------------- */ /* ---------------------------------------------------------------------------- */

View File

@ -64,7 +64,6 @@ kPath::kPath(DynMat *dm, QNodes *qn)
for (int j = 0; j < 3; ++j) pos[i][j] = atpos[i][j]; for (int j = 0; j < 3; ++j) pos[i][j] = atpos[i][j];
spgnum = spg_get_international(symbol, latvec, (double (*)[3])pos, attyp, num_atom, symprec); spgnum = spg_get_international(symbol, latvec, (double (*)[3])pos, attyp, num_atom, symprec);
memory->destroy(pos); memory->destroy(pos);
return;
} }
/* ---------------------------------------------------------------------------- /* ----------------------------------------------------------------------------
@ -89,7 +88,6 @@ void kPath::show_info()
printf("The space group number of your unit cell is: %d => %s\n", spgnum, symbol); printf("The space group number of your unit cell is: %d => %s\n", spgnum, symbol);
puts("--------------------------------------------------------------------------------"); puts("--------------------------------------------------------------------------------");
return;
} }
/* ---------------------------------------------------------------------------- /* ----------------------------------------------------------------------------
@ -102,8 +100,6 @@ kPath::~kPath( )
delete memory; delete memory;
dynmat = NULL; dynmat = NULL;
q = NULL; q = NULL;
return;
} }
/* ---------------------------------------------------------------------------- /* ----------------------------------------------------------------------------
@ -2764,7 +2760,6 @@ void kPath::kpath( )
q->nqbin.push_back(nqpt); q->nqbin.push_back(nqpt);
} }
return;
} }
/* ---------------------------------------------------------------------------- /* ----------------------------------------------------------------------------
@ -2772,7 +2767,7 @@ void kPath::kpath( )
* ---------------------------------------------------------------------------- */ * ---------------------------------------------------------------------------- */
void kPath::show_path() void kPath::show_path()
{ {
if (q == NULL) return; if (q == nullptr) return;
int nbin = q->ndstr.size(); int nbin = q->ndstr.size();
if (nbin > 0){ if (nbin > 0){
puts("\n--------------------------------------------------------------------------------"); puts("\n--------------------------------------------------------------------------------");
@ -2787,7 +2782,6 @@ void kPath::show_path()
puts("--------------------------------------------------------------------------------"); puts("--------------------------------------------------------------------------------");
} }
return;
} }
/* ---------------------------------------------------------------------------- */ /* ---------------------------------------------------------------------------- */
#endif #endif

View File

@ -96,7 +96,6 @@ Phonon::Phonon(DynMat *dm)
else if (job ==-1) dynmat->reset_interp_method(); else if (job ==-1) dynmat->reset_interp_method();
else break; else break;
} }
return;
} }
/* ---------------------------------------------------------------------------- /* ----------------------------------------------------------------------------
@ -104,7 +103,7 @@ Phonon::Phonon(DynMat *dm)
* ---------------------------------------------------------------------------- */ * ---------------------------------------------------------------------------- */
Phonon::~Phonon() Phonon::~Phonon()
{ {
dynmat = NULL; dynmat = nullptr;
memory->destroy(wt); memory->destroy(wt);
memory->destroy(qpts); memory->destroy(qpts);
@ -120,8 +119,6 @@ Phonon::~Phonon()
memory->destroy(atpos); memory->destroy(atpos);
#endif #endif
delete memory; delete memory;
return;
} }
/* ---------------------------------------------------------------------------- /* ----------------------------------------------------------------------------
@ -191,8 +188,6 @@ void Phonon::pdos()
// output DOS // output DOS
writeDOS(); writeDOS();
return;
} }
/* ---------------------------------------------------------------------------- /* ----------------------------------------------------------------------------
@ -200,7 +195,7 @@ void Phonon::pdos()
* ---------------------------------------------------------------------------- */ * ---------------------------------------------------------------------------- */
void Phonon::writeDOS() void Phonon::writeDOS()
{ {
if (dos == NULL) return; if (dos == nullptr) return;
char str[MAXLINE]; char str[MAXLINE];
// now to output the phonon DOS // now to output the phonon DOS
@ -231,8 +226,6 @@ void Phonon::writeDOS()
fclose(fp); fclose(fp);
fname = NULL; fname = NULL;
return;
} }
/* ---------------------------------------------------------------------------- /* ----------------------------------------------------------------------------
@ -265,7 +258,6 @@ void Phonon::writeLDOS()
fclose(fp); fclose(fp);
} }
return;
} }
/* ---------------------------------------------------------------------------- /* ----------------------------------------------------------------------------
@ -303,7 +295,7 @@ void Phonon::ldos_rsgf()
int ik = 0, nit = MAX(ndim*0.1, MIN(ndim,50)); int ik = 0, nit = MAX(ndim*0.1, MIN(ndim,50));
double eps = 12.; // for Cu with 1000+ atoms, 12 is enough; for small system, eps should be large. double eps = 12.; // for Cu with 1000+ atoms, 12 is enough; for small system, eps should be large.
while (1) { while (true) {
int istr, iend, iinc; int istr, iend, iinc;
// ask for relevant info // ask for relevant info
printf("\nThere are %d atoms in each unit cell of your lattice.\n", dynmat->nucell); printf("\nThere are %d atoms in each unit cell of your lattice.\n", dynmat->nucell);
@ -401,8 +393,6 @@ void Phonon::ldos_rsgf()
} }
memory->destroy(Hessian); memory->destroy(Hessian);
return;
} }
/* ---------------------------------------------------------------------------- /* ----------------------------------------------------------------------------
@ -412,19 +402,17 @@ void Phonon::dmanyq()
{ {
char str[MAXLINE]; char str[MAXLINE];
double q[3]; double q[3];
while ( 1 ){ while ( true ){
printf("Please input the q-point to output the dynamical matrix: "); printf("Please input the q-point to output the dynamical matrix: ");
input->read_stdin(str); input->read_stdin(str);
if (count_words(str) >= 3) break; if (count_words(str) >= 3) break;
} }
q[0] = atof(strtok(str," \t\n\r\f")); q[0] = atof(strtok(str," \t\n\r\f"));
q[1] = atof(strtok(NULL," \t\n\r\f")); q[1] = atof(strtok(nullptr," \t\n\r\f"));
q[2] = atof(strtok(NULL," \t\n\r\f")); q[2] = atof(strtok(nullptr," \t\n\r\f"));
dynmat->getDMq(q); dynmat->getDMq(q);
dynmat->writeDMq(q); dynmat->writeDMq(q);
return;
} }
/* ---------------------------------------------------------------------------- /* ----------------------------------------------------------------------------
@ -436,7 +424,7 @@ void Phonon::vfanyq()
double q[3]; double q[3];
double *egvs = new double[ndim]; double *egvs = new double[ndim];
while ( 1 ){ while ( true ){
printf("Please input the q-point to compute the frequencies, q to exit: "); printf("Please input the q-point to compute the frequencies, q to exit: ");
input->read_stdin(str); input->read_stdin(str);
if (count_words(str) < 3) break; if (count_words(str) < 3) break;
@ -454,7 +442,6 @@ void Phonon::vfanyq()
} }
delete[] egvs; delete[] egvs;
return;
} }
/* ---------------------------------------------------------------------------- /* ----------------------------------------------------------------------------
@ -471,7 +458,7 @@ void Phonon::vecanyq()
if (count_words(str) < 1) strcpy(str,"eigvec.dat"); if (count_words(str) < 1) strcpy(str,"eigvec.dat");
FILE *fp = fopen(strtok(str," \t\n\r\f"), "w"); FILE *fp = fopen(strtok(str," \t\n\r\f"), "w");
while ( 1 ){ while ( true ){
printf("Please input the q-point to compute the frequencies, q to exit: "); printf("Please input the q-point to compute the frequencies, q to exit: ");
input->read_stdin(str); input->read_stdin(str);
if (count_words(str) < 3) break; if (count_words(str) < 3) break;
@ -504,7 +491,6 @@ void Phonon::vecanyq()
fclose(fp); fclose(fp);
delete[] egvs; delete[] egvs;
eigvec = NULL; eigvec = NULL;
return;
} }
/* ---------------------------------------------------------------------------- /* ----------------------------------------------------------------------------
@ -528,7 +514,7 @@ void Phonon::DMdisp()
int nq = MAX(MAX(dynmat->nx,dynmat->ny),dynmat->nz)/2; int nq = MAX(MAX(dynmat->nx,dynmat->ny),dynmat->nz)/2;
qend[0] = qend[1] = qend[2] = 0.; qend[0] = qend[1] = qend[2] = 0.;
while ( 1 ){ while ( true ){
for (int i = 0; i < 3; ++i) qstr[i] = qend[i]; for (int i = 0; i < 3; ++i) qstr[i] = qend[i];
printf("\nPlease input the start q-point in unit of B1->B3, q to exit [%g %g %g]: ", qstr[0], qstr[1], qstr[2]); printf("\nPlease input the start q-point in unit of B1->B3, q to exit [%g %g %g]: ", qstr[0], qstr[1], qstr[2]);
@ -542,7 +528,7 @@ void Phonon::DMdisp()
qstr[2] = atof(strtok(NULL," \t\n\r\f")); qstr[2] = atof(strtok(NULL," \t\n\r\f"));
} }
while ( 1 ){ while ( true ){
printf("Please input the end q-point in unit of B1->B3: "); printf("Please input the end q-point in unit of B1->B3: ");
input->read_stdin(str); input->read_stdin(str);
if (count_words(str) >= 3) break; if (count_words(str) >= 3) break;
@ -569,8 +555,6 @@ void Phonon::DMdisp()
qr -= dq; qr -= dq;
} }
fclose(fp); fclose(fp);
return;
} }
/* ---------------------------------------------------------------------------- /* ----------------------------------------------------------------------------
@ -605,8 +589,6 @@ void Phonon::smooth(double *array, const int npt)
memory->destroy(tmp); memory->destroy(tmp);
memory->destroy(table); memory->destroy(table);
return;
} }
/* ---------------------------------------------------------------------------- /* ----------------------------------------------------------------------------
@ -671,8 +653,6 @@ void Phonon::therm()
} while (T > 0.); } while (T > 0.);
fclose(fp); fclose(fp);
return;
} }
/* ---------------------------------------------------------------------------- /* ----------------------------------------------------------------------------
@ -707,7 +687,7 @@ void Phonon::local_therm()
// constants J.s J/K J // constants J.s J/K J
const double h = 6.62606896e-34, Kb = 1.380658e-23, eV = 1.60217733e-19; const double h = 6.62606896e-34, Kb = 1.380658e-23, eV = 1.60217733e-19;
double T = dynmat->Tmeasure; double T = dynmat->Tmeasure;
while ( 1 ){ while ( true ){
printf("\nPlease input the temperature at which to evaluate the local vibrational\n"); printf("\nPlease input the temperature at which to evaluate the local vibrational\n");
printf("thermal properties, non-positive number to exit [%g]: ", T); printf("thermal properties, non-positive number to exit [%g]: ", T);
input->read_stdin(str); input->read_stdin(str);
@ -789,8 +769,6 @@ void Phonon::local_therm()
} }
} }
fclose(fp); fclose(fp);
return;
} }
/* ---------------------------------------------------------------------------- /* ----------------------------------------------------------------------------
@ -935,8 +913,6 @@ void Phonon::QMesh()
} }
#endif #endif
printf("Your new q-mesh size would be: %d x %d x %d => %d points\n", nx,ny,nz,nq); printf("Your new q-mesh size would be: %d x %d x %d => %d points\n", nx,ny,nz,nq);
return;
} }
/* ---------------------------------------------------------------------------- /* ----------------------------------------------------------------------------
@ -1055,8 +1031,6 @@ void Phonon::ldos_egv()
// evaluate the local vibrational thermal properties optionally // evaluate the local vibrational thermal properties optionally
local_therm(); local_therm();
return;
} }
/* ---------------------------------------------------------------------------- /* ----------------------------------------------------------------------------
@ -1078,8 +1052,6 @@ void Phonon::ShowCell()
for (int i = 0; i < dynmat->nucell; ++i) for (int i = 0; i < dynmat->nucell; ++i)
printf("%4d %12.8f %12.8f %12.8f\n", dynmat->attyp[i], dynmat->basis[i][0], dynmat->basis[i][1], dynmat->basis[i][2]); printf("%4d %12.8f %12.8f %12.8f\n", dynmat->attyp[i], dynmat->basis[i][0], dynmat->basis[i][1], dynmat->basis[i][2]);
puts("================================================================================"); puts("================================================================================");
return;
} }
/* ---------------------------------------------------------------------------- /* ----------------------------------------------------------------------------
@ -1112,7 +1084,6 @@ void Phonon::Normalize()
} }
} }
return;
} }
/* ---------------------------------------------------------------------------- /* ----------------------------------------------------------------------------
@ -1138,8 +1109,6 @@ void Phonon::ComputeAll()
} }
printf("Done!\n"); printf("Done!\n");
time->stop(); time->print(); delete time; time->stop(); time->print(); delete time;
return;
} }
/*------------------------------------------------------------------------------ /*------------------------------------------------------------------------------

View File

@ -60,8 +60,6 @@ Phonopy::Phonopy(DynMat *dynmat)
phonopy(); phonopy();
return;
} }
/* ---------------------------------------------------------------------------- /* ----------------------------------------------------------------------------
@ -72,8 +70,7 @@ Phonopy::~Phonopy()
memory->destroy(mass); memory->destroy(mass);
memory->destroy(FC_all); memory->destroy(FC_all);
delete memory; delete memory;
dm = NULL; dm = nullptr;
return;
} }
/* ---------------------------------------------------------------------------- /* ----------------------------------------------------------------------------
@ -111,7 +108,6 @@ void Phonopy::write(int flag)
} else if (flag == 5){ } else if (flag == 5){
puts("================================================================================"); puts("================================================================================");
} }
return;
} }
/* ---------------------------------------------------------------------------- /* ----------------------------------------------------------------------------
@ -141,7 +137,6 @@ void Phonopy::get_my_FC()
} }
++ipt; ++ipt;
} }
return;
} }
/* ---------------------------------------------------------------------------- /* ----------------------------------------------------------------------------
@ -304,7 +299,6 @@ void Phonopy::phonopy()
write(5); write(5);
delete[] type_id; delete[] type_id;
delete[] num_type; delete[] num_type;
return;
} }
/*------------------------------------------------------------------------------ /*------------------------------------------------------------------------------

View File

@ -11,8 +11,6 @@ QNodes::QNodes()
qs.clear(); qs.clear();
qe.clear(); qe.clear();
nqbin.clear(); nqbin.clear();
return;
} }
/* ---------------------------------------------------------------------------- /* ----------------------------------------------------------------------------
@ -25,6 +23,4 @@ QNodes::~QNodes()
qs.clear(); qs.clear();
qe.clear(); qe.clear();
nqbin.clear(); nqbin.clear();
return;
} }

View File

@ -9,8 +9,6 @@ Timer::Timer()
{ {
flag = 0; flag = 0;
start(); start();
return;
} }
/* ----------------------------------------------------------------------------- /* -----------------------------------------------------------------------------
@ -20,7 +18,6 @@ void Timer::start()
{ {
t1 = clock(); t1 = clock();
flag |= 1; flag |= 1;
return;
} }
/* ----------------------------------------------------------------------------- /* -----------------------------------------------------------------------------
@ -32,7 +29,6 @@ void Timer::stop()
t2 = clock(); t2 = clock();
flag |= 2; flag |= 2;
} }
return;
} }
/* ----------------------------------------------------------------------------- /* -----------------------------------------------------------------------------
@ -44,8 +40,6 @@ void Timer::print()
double cpu_time_used = ((double) (t2 - t1)) / CLOCKS_PER_SEC; double cpu_time_used = ((double) (t2 - t1)) / CLOCKS_PER_SEC;
printf("Total CPU time used: %g seconds.\n", cpu_time_used); printf("Total CPU time used: %g seconds.\n", cpu_time_used);
return;
} }
/* ----------------------------------------------------------------------------- /* -----------------------------------------------------------------------------

View File

@ -90,7 +90,7 @@ static void point2xyz(int p, int *x, int *y, int *z) {
} }
} }
const char *tricubic_version(void) { const char *tricubic_version() {
return(tricubic_version_stored); return(tricubic_version_stored);
} }