From 054abe280eabd73dc257941d002214674d5f52cd Mon Sep 17 00:00:00 2001 From: Axel Kohlmeyer Date: Wed, 29 Aug 2018 14:55:36 -0400 Subject: [PATCH 1/3] squash some more compiler warnings --- src/fix_tmd.cpp | 2 +- src/library.cpp | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/src/fix_tmd.cpp b/src/fix_tmd.cpp index ea448bd178..dd11dfd0c7 100644 --- a/src/fix_tmd.cpp +++ b/src/fix_tmd.cpp @@ -412,7 +412,7 @@ void FixTMD::readfile(char *file) m++; } - MPI_Bcast(&eof,sizeof(char *)/sizeof(char),MPI_CHAR,0,world); + MPI_Bcast(&eof,sizeof(char *),MPI_CHAR,0,world); MPI_Bcast(&nlines,1,MPI_INT,0,world); MPI_Bcast(&m,1,MPI_INT,0,world); MPI_Bcast(buffer,m,MPI_CHAR,0,world); diff --git a/src/library.cpp b/src/library.cpp index 245ae7ba84..a46689da09 100644 --- a/src/library.cpp +++ b/src/library.cpp @@ -1515,7 +1515,8 @@ void lammps_create_atoms(void *ptr, int n, tagint *id, int *type, if (lmp->atom->natoms != natoms_prev + n) { char str[128]; sprintf(str,"Library warning in lammps_create_atoms, " - "invalid total atoms " BIGINT_FORMAT " %lld",lmp->atom->natoms,natoms_prev+n); + "invalid total atoms " BIGINT_FORMAT " " BIGINT_FORMAT, + lmp->atom->natoms,natoms_prev+n); if (lmp->comm->me == 0) lmp->error->warning(FLERR,str); } From 9e03bf7db993ded945ac9e3a853e93814d349905 Mon Sep 17 00:00:00 2001 From: Axel Kohlmeyer Date: Sat, 1 Sep 2018 19:12:46 -0400 Subject: [PATCH 2/3] make USER-DIFFRACTION input example fully consistent with output and remove additional input file --- examples/USER/diffraction/BulkNi.in | 5 ++-- examples/USER/diffraction/Output/BulkNi.in | 35 ---------------------- 2 files changed, 3 insertions(+), 37 deletions(-) delete mode 100644 examples/USER/diffraction/Output/BulkNi.in diff --git a/examples/USER/diffraction/BulkNi.in b/examples/USER/diffraction/BulkNi.in index 0fa9c1b74c..8315e57750 100644 --- a/examples/USER/diffraction/BulkNi.in +++ b/examples/USER/diffraction/BulkNi.in @@ -17,8 +17,9 @@ atom_modify sort 0 0 compute XRD all xrd 1.541838 Ni 2Theta 40 80 c 2 2 2 LP 1 echo -compute SAED all saed 0.0251 Ni Kmax 0.85 Zone 1 0 0 c 0.025 0.025 0.025 & - dR_Ewald 0.05 echo manual +compute SAED all saed 0.0251 Ni Kmax 0.85 & + Zone 0 0 0 c 0.025 0.025 0.025 & + dR_Ewald 0.01 echo manual fix 1 all ave/histo/weight 1 1 1 40 80 200 c_XRD[1] c_XRD[2] & mode vector file $A.hist.xrd diff --git a/examples/USER/diffraction/Output/BulkNi.in b/examples/USER/diffraction/Output/BulkNi.in deleted file mode 100644 index 8315e57750..0000000000 --- a/examples/USER/diffraction/Output/BulkNi.in +++ /dev/null @@ -1,35 +0,0 @@ -variable A string bulkNi -log $A.log - -boundary p p p - -units metal -timestep 0.001 - -lattice fcc 3.52 -region box block 0 20 0 20 0 20 -create_box 1 box -create_atoms 1 box - -pair_style none -mass * 58.71 -atom_modify sort 0 0 - -compute XRD all xrd 1.541838 Ni 2Theta 40 80 c 2 2 2 LP 1 echo - -compute SAED all saed 0.0251 Ni Kmax 0.85 & - Zone 0 0 0 c 0.025 0.025 0.025 & - dR_Ewald 0.01 echo manual - -fix 1 all ave/histo/weight 1 1 1 40 80 200 c_XRD[1] c_XRD[2] & - mode vector file $A.hist.xrd - -fix 2 all saed/vtk 1 1 1 c_SAED file $A_001.saed - -dump 1 all custom 1 $A.dump id x y z -run 0 - -unfix 1 -unfix 2 -uncompute XRD -uncompute SAED From a6dfab6f27573e82a9fc89dbd2899f91f9f770e6 Mon Sep 17 00:00:00 2001 From: Axel Kohlmeyer Date: Tue, 4 Sep 2018 09:13:22 -0400 Subject: [PATCH 3/3] recover some const'ness in Domain class, that was lost when merging MESSAGE package. fixes lib/atc compilation issue --- src/domain.cpp | 10 +++++----- src/domain.h | 4 ++-- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/src/domain.cpp b/src/domain.cpp index 4e9b414050..8238ab7eea 100644 --- a/src/domain.cpp +++ b/src/domain.cpp @@ -1176,12 +1176,12 @@ int Domain::closest_image(int i, int j) if J is not a valid index like -1, just return it ------------------------------------------------------------------------- */ -int Domain::closest_image(double *pos, int j) +int Domain::closest_image(const double * const pos, int j) { if (j < 0) return j; - int *sametag = atom->sametag; - double **x = atom->x; + const int * const sametag = atom->sametag; + const double * const * const x = atom->x; int closest = j; double delx = pos[0] - x[j][0]; @@ -1208,10 +1208,10 @@ int Domain::closest_image(double *pos, int j) /* ---------------------------------------------------------------------- find and return Xj image = periodic image of Xj that is closest to Xi for triclinic, add/subtract tilt factors in other dims as needed - called by ServerMD class + called by ServerMD class and LammpsInterface in lib/atc. ------------------------------------------------------------------------- */ -void Domain::closest_image(double *xi, double *xj, double *xjimage) +void Domain::closest_image(const double * const xi, const double * const xj, double * const xjimage) { double dx = xj[0] - xi[0]; double dy = xj[1] - xi[1]; diff --git a/src/domain.h b/src/domain.h index ed24116cf4..9ebdd6ae94 100644 --- a/src/domain.h +++ b/src/domain.h @@ -115,8 +115,8 @@ class Domain : protected Pointers { void minimum_image(double *); void minimum_image_once(double *); int closest_image(int, int); - int closest_image(double *, int); - void closest_image(double *, double *, double *); + int closest_image(const double * const, int); + void closest_image(const double * const, const double * const, double * const); void remap(double *, imageint &); void remap(double *); void remap_near(double *, double *);