From 7c80b00f2389350686ab699fdadff3161f741f52 Mon Sep 17 00:00:00 2001 From: Axel Kohlmeyer Date: Mon, 2 Sep 2024 06:26:27 -0400 Subject: [PATCH] small corrections in the DIFFRACTION package, mostly cosmetic --- src/DIFFRACTION/compute_saed.cpp | 12 ++++++------ src/DIFFRACTION/compute_xrd.cpp | 12 ++++++------ src/DIFFRACTION/fix_saed_vtk.cpp | 5 +++-- 3 files changed, 15 insertions(+), 14 deletions(-) diff --git a/src/DIFFRACTION/compute_saed.cpp b/src/DIFFRACTION/compute_saed.cpp index 1350257910..e2a7bb33d9 100644 --- a/src/DIFFRACTION/compute_saed.cpp +++ b/src/DIFFRACTION/compute_saed.cpp @@ -401,7 +401,7 @@ void ComputeSAED::compute_vector() // Setting up OMP #if defined(_OPENMP) - if (me == 0 && echo) utils::logmesg(lmp," using {}OMP threads\n",comm->nthreads); + if (me == 0 && echo) utils::logmesg(lmp," using {} OMP thread(s)\n",comm->nthreads); #endif if (me == 0 && echo) utils::logmesg(lmp,"\n"); @@ -478,7 +478,7 @@ void ComputeSAED::compute_vector() } } } // End of pragma omp for region - delete [] f; + delete[] f; } auto scratch = new double[2*nRows]; @@ -499,10 +499,10 @@ void ComputeSAED::compute_vector() utils::logmesg(lmp," 100% \nTime elapsed during compute_saed = {:.2f} sec " "using {:.2f} Mbytes/processor\n-----\n", t2-t0, bytes/1024.0/1024.0); - delete [] xlocal; - delete [] typelocal; - delete [] scratch; - delete [] Fvec; + delete[] xlocal; + delete[] typelocal; + delete[] scratch; + delete[] Fvec; } /* ---------------------------------------------------------------------- diff --git a/src/DIFFRACTION/compute_xrd.cpp b/src/DIFFRACTION/compute_xrd.cpp index 11e0bb9a9f..a769be7d4f 100644 --- a/src/DIFFRACTION/compute_xrd.cpp +++ b/src/DIFFRACTION/compute_xrd.cpp @@ -332,7 +332,7 @@ void ComputeXRD::compute_array() // Setting up OMP #if defined(_OPENMP) - if ((me == 0) && echo) utils::logmesg(lmp," using {} OMP threads\n",comm->nthreads); + if ((me == 0) && echo) utils::logmesg(lmp," using {} OMP thread(s)\n",comm->nthreads); #endif if ((me == 0) && echo) { @@ -482,7 +482,7 @@ void ComputeXRD::compute_array() } } // End of pragma omp for region } // End of if LP=1 check - delete [] f; + delete[] f; } // End of pragma omp parallel region auto scratch = new double[2*size_array_rows]; @@ -503,10 +503,10 @@ void ComputeXRD::compute_array() utils::logmesg(lmp," 100% \nTime elapsed during compute_xrd = {:.2f} sec " "using {:.2f} Mbytes/processor\n-----\n", t2-t0, bytes/1024.0/1024.0); - delete [] scratch; - delete [] Fvec; - delete [] xlocal; - delete [] typelocal; + delete[] scratch; + delete[] Fvec; + delete[] xlocal; + delete[] typelocal; } /* ---------------------------------------------------------------------- diff --git a/src/DIFFRACTION/fix_saed_vtk.cpp b/src/DIFFRACTION/fix_saed_vtk.cpp index b3f6693e9e..693bb925b6 100644 --- a/src/DIFFRACTION/fix_saed_vtk.cpp +++ b/src/DIFFRACTION/fix_saed_vtk.cpp @@ -114,6 +114,7 @@ FixSAEDVTK::FixSAEDVTK(LAMMPS *lmp, int narg, char **arg) : memory->create(vector_total,nrows,"saed/vtk:vector_total"); vector_flag = 1; + extvector = 0; size_vector = nrows; if (nOutput == 0) { @@ -248,8 +249,8 @@ FixSAEDVTK::FixSAEDVTK(LAMMPS *lmp, int narg, char **arg) : FixSAEDVTK::~FixSAEDVTK() { - delete [] filename; - delete [] ids; + delete[] filename; + delete[] ids; memory->destroy(vector); memory->destroy(vector_total); if (fp && comm->me == 0) fclose(fp);