diff --git a/doc/src/Section_howto.txt b/doc/src/Section_howto.txt index 33cbfa95865b8a2222abf94f7a7f4529459cd08e..33bba562edcd398b52626d47bfb418366c109573 100644 --- a/doc/src/Section_howto.txt +++ b/doc/src/Section_howto.txt @@ -2729,7 +2729,7 @@ production runs and is only required during equilibration. This way one is consistent with literature (based on the code packages DL_POLY or GULP for instance). -The mentioned energy transfer will typically lead to a a small drift +The mentioned energy transfer will typically lead to a small drift in total energy over time. This internal energy can be monitored using the "compute chunk/atom"_compute_chunk_atom.html and "compute temp/chunk"_compute_temp_chunk.html commands. The internal kinetic @@ -2830,7 +2830,7 @@ temp/drude"_compute_temp_drude.html. This requires also to use the command {comm_modify vel yes}. Short-range damping of the induced dipole interactions can be achieved -using Thole functions through the the "pair style +using Thole functions through the "pair style thole"_pair_thole.html in "pair_style hybrid/overlay"_pair_hybrid.html with a Coulomb pair style. It may be useful to use {coul/long/cs} or similar from the CORESHELL package if the core and Drude particle come diff --git a/doc/src/Section_start.txt b/doc/src/Section_start.txt index a0cc792455564ce06057789b5444fd4bd44eda79..ee122e0a7266fbef10658d6d30552675b0a6ea75 100644 --- a/doc/src/Section_start.txt +++ b/doc/src/Section_start.txt @@ -706,7 +706,7 @@ future changes to LAMMPS. User packages, such as user-atc or user-omp, have been contributed by users, and always begin with the user prefix. If they are a single command (single file), they are typically in the user-misc package. -Otherwise, they are a a set of files grouped together which add a +Otherwise, they are a set of files grouped together which add a specific functionality to the code. User packages don't necessarily meet the requirements of the standard diff --git a/doc/src/compute_centro_atom.txt b/doc/src/compute_centro_atom.txt index 2a3ae15aaf5a75c36c2ae768cfb666a0d63698ea..0a48ccb5be3080fdd201cc0834371f6f3843f553 100644 --- a/doc/src/compute_centro_atom.txt +++ b/doc/src/compute_centro_atom.txt @@ -114,7 +114,7 @@ local defects surrounding the central atom, as described above. For the {axes yes} case, the vector components are also unitless, since they represent spatial directions. -Here are typical centro-symmetry values, from a a nanoindentation +Here are typical centro-symmetry values, from a nanoindentation simulation into gold (FCC). These were provided by Jon Zimmerman (Sandia): diff --git a/doc/src/compute_chunk_atom.txt b/doc/src/compute_chunk_atom.txt index 2778be4f6ba675245c8ab3490d429594c57e5b0a..60516fe421de9809c2b8af18893d312dbb75ef71 100644 --- a/doc/src/compute_chunk_atom.txt +++ b/doc/src/compute_chunk_atom.txt @@ -536,7 +536,7 @@ For the {bin/cylinder} style the details are as follows. If {discard} is set to {yes}, an out-of-domain atom will have its chunk ID set to 0. If {discard} is set to {no}, the atom will have its chunk ID set to the first or last bin in both the radial and axis dimensions. If -{discard} is set to {mixed}, which is the default, the the radial +{discard} is set to {mixed}, which is the default, the radial dimension is treated the same as for {discard} = no. But for the axis dimensinon, it will only have its chunk ID set to the first or last bin if bins extend to the simulation box boundary in the axis diff --git a/doc/src/compute_stress_atom.txt b/doc/src/compute_stress_atom.txt index dcfdee9f85ae0f78005b0fcf36aea24b886c2c8b..3dc642da3296b654bc4e19c25b8366d24fe1ca59 100644 --- a/doc/src/compute_stress_atom.txt +++ b/doc/src/compute_stress_atom.txt @@ -60,7 +60,7 @@ produced by a small set of atoms (e.g. 4 atoms in a dihedral or 3 atoms in a Tersoff 3-body interaction) is assigned in equal portions to each atom in the set. E.g. 1/4 of the dihedral virial to each of the 4 atoms, or 1/3 of the fix virial due to SHAKE constraints applied -to atoms in a a water molecule via the "fix shake"_fix_shake.html +to atoms in a water molecule via the "fix shake"_fix_shake.html command. If no extra keywords are listed, all of the terms in this formula are diff --git a/doc/src/dihedral_table.txt b/doc/src/dihedral_table.txt index f34b22f4352439b6d6a6160d83fca34287781ec0..0b88f26a61076c6b10750ea419b947fb88a0dd8f 100644 --- a/doc/src/dihedral_table.txt +++ b/doc/src/dihedral_table.txt @@ -154,7 +154,7 @@ radians instead of degrees. (Note: This changes the way the forces are scaled in the 4th column of the data file.) The optional "CHECKU" keyword is followed by a filename. This allows -the user to save all of the the {Ntable} different entries in the +the user to save all of the {Ntable} different entries in the interpolated energy table to a file to make sure that the interpolated function agrees with the user's expectations. (Note: You can temporarily increase the {Ntable} parameter to a high value for this diff --git a/doc/src/dump_modify.txt b/doc/src/dump_modify.txt index e2f5f1eb8ddc08cc7ee0bb24bcbc93eee94dcd54..0cf30e3c920ab92754aeef9a9a69cb13fdad97f4 100644 --- a/doc/src/dump_modify.txt +++ b/doc/src/dump_modify.txt @@ -165,7 +165,7 @@ extra buffering. :line -The {element} keyword applies only to the the dump {cfg}, {xyz}, and +The {element} keyword applies only to the dump {cfg}, {xyz}, and {image} styles. It associates element names (e.g. H, C, Fe) with LAMMPS atom types. See the list of element names at the bottom of this page. @@ -574,7 +574,7 @@ e.g. its x-component of velocity if the atom-attribute "vx" was specified. The basic idea of a color map is that the atom-attribute will be -within a range of values, and that range is associated with a a series +within a range of values, and that range is associated with a series of colors (e.g. red, blue, green). An atom's specific value (vx = -3.2) can then mapped to the series of colors (e.g. halfway between red and blue), and a specific color is determined via an interpolation diff --git a/doc/src/fix_deform.txt b/doc/src/fix_deform.txt index ffda84bf18376a43487c46e04cab5ef30d07b067..1478d47df1fcce46676b521707e43466b1aa3436 100644 --- a/doc/src/fix_deform.txt +++ b/doc/src/fix_deform.txt @@ -150,7 +150,7 @@ initial box length is 100 Angstroms, and V is 10 Angstroms/psec, then after 10 psec, the box length will have doubled. After 20 psec, it will have tripled. -The {erate} style changes a dimension of the the box at a "constant +The {erate} style changes a dimension of the box at a "constant engineering strain rate". The units of the specified strain rate are 1/time. See the "units"_units.html command for the time units associated with different choices of simulation units, diff --git a/doc/src/fix_langevin.txt b/doc/src/fix_langevin.txt index 9dba4da3751223140397d5d7b0f4983c526bf680..b387117d8340958ae80c8d1a762af31b3161cb43 100644 --- a/doc/src/fix_langevin.txt +++ b/doc/src/fix_langevin.txt @@ -237,7 +237,7 @@ described in the papers cited below, the purpose of this method is to enable longer timesteps to be used (up to the numerical stability limit of the integrator), while still producing the correct Boltzmann distribution of atom positions. It is implemented within LAMMPS, by -changing how the the random force is applied so that it is composed of +changing how the random force is applied so that it is composed of the average of two random forces representing half-contributions from the previous and current time intervals. diff --git a/doc/src/fix_lb_fluid.txt b/doc/src/fix_lb_fluid.txt index b4447b65c25e4c6a00d702e043b0459bc835f860..62265a3bc17f0568e8e72cd0ea3e4292fd2ed28d 100644 --- a/doc/src/fix_lb_fluid.txt +++ b/doc/src/fix_lb_fluid.txt @@ -233,7 +233,7 @@ present, the speed of sound squared is set equal to (1/3)*(dx/dt)^2. Setting a0 > (dx/dt)^2 is not allowed, as this may lead to instabilities. -If the {noise} keyword is used, followed by a a positive temperature +If the {noise} keyword is used, followed by a positive temperature value, and a positive integer random number seed, a thermal lattice-Boltzmann algorithm is used. If {LBtype} is set equal to 1 (i.e. the standard LB integrator is chosen), the thermal LB algorithm diff --git a/doc/src/fix_rx.txt b/doc/src/fix_rx.txt index 4e26274b35251320c6e7d12b4905c9273a93040a..c0deedfa6305a22449e73efc9c88b0c742ebc09d 100644 --- a/doc/src/fix_rx.txt +++ b/doc/src/fix_rx.txt @@ -87,7 +87,7 @@ end of each run. A positive value N means that the diagnostics are reported once per N time-steps. The diagnostics report the average # of integrator steps and RHS function evaluations -and run-time per ODE as well as the the average/RMS/min/max per process. If the +and run-time per ODE as well as the average/RMS/min/max per process. If the reporting frequency is 1, the RMS/min/max per ODE are also reported. The per ODE statistics can be used to adjust the tolerance and min/max step parameters. The statistics per MPI process can be useful to examine any load imbalance caused by the diff --git a/doc/src/fix_smd_adjust_dt.txt b/doc/src/fix_smd_adjust_dt.txt index 6567c2c151c92c173d2a7987d3aff1eab1b10987..04a0a7becd0442578c09833b89f8bf0075ac16ae 100644 --- a/doc/src/fix_smd_adjust_dt.txt +++ b/doc/src/fix_smd_adjust_dt.txt @@ -28,7 +28,7 @@ fix 1 all smd/adjust_dt 0.1 :pre The fix calculates a new stable time increment for use with the SMD time integrators. The stable time increment is based on multiple conditions. For the SPH pair styles, a -CFL criterion (Courant, Friedrichs & Lewy, 1928) is evaluated, which determines the the speed of +CFL criterion (Courant, Friedrichs & Lewy, 1928) is evaluated, which determines the speed of sound cannot propagate further than a typical spacing between particles within a single time step to ensure no information is lost. For the contact pair styles, a linear analysis of the pair potential determines a stable maximum time step. diff --git a/doc/src/fix_srd.txt b/doc/src/fix_srd.txt index e76871dfe1582a0b0998cec8aab2db4b32f725c1..13519ecfad94728a00fe5aa3b5b130d3436ab4dc 100644 --- a/doc/src/fix_srd.txt +++ b/doc/src/fix_srd.txt @@ -101,7 +101,7 @@ particles move in the normal way via a time integration "fix"_fix.html with a short timestep dt. SRD particles advect with a large timestep dt_SRD >= dt. -If the {lamda} keyword is not specified, the the SRD temperature +If the {lamda} keyword is not specified, the SRD temperature {Tsrd} is used in the above formula to compute lamda. If the {lamda} keyword is specified, then the {Tsrd} setting is ignored and the above equation is used to compute the SRD temperature. diff --git a/doc/src/fix_ttm.txt b/doc/src/fix_ttm.txt index 586a06d5256944c53393ad305d476fe97cd9f5b5..2e7318da146fcf91f682d3d1410a48f71a1dc41f 100644 --- a/doc/src/fix_ttm.txt +++ b/doc/src/fix_ttm.txt @@ -107,7 +107,7 @@ specified as parameters to the fix. The other quantities are derived. The form of the heat diffusion equation used here is almost the same as that in equation 6 of "(Duffy)"_#Duffy, with the exception that the electronic density is explicitly reprensented, rather than being part -of the the specific heat parameter. +of the specific heat parameter. Currently, fix ttm assumes that none of the user-supplied parameters will vary with temperature. Note that "(Duffy)"_#Duffy used a tanh() diff --git a/doc/src/improper_style.txt b/doc/src/improper_style.txt index 0bd1c10b58b434c634c649c3c045e608983e4dbb..861701590fedcfce745e2542fd7c69c943e4e5a3 100644 --- a/doc/src/improper_style.txt +++ b/doc/src/improper_style.txt @@ -27,7 +27,7 @@ between quadruplets of atoms, which remain in force for the duration of the simulation. The list of improper quadruplets is read in by a "read_data"_read_data.html or "read_restart"_read_restart.html command from a data or restart file. Note that the ordering of the 4 atoms in -an improper quadruplet determines the the definition of the improper +an improper quadruplet determines the definition of the improper angle used in the formula for each style. See the doc pages of individual styles for details. diff --git a/doc/src/neb.txt b/doc/src/neb.txt index 17bd8544b780ad44ad12dfaa1e6833875f7f979d..649e521eee87d1948b1f5dbef8dd6dd002b5e9d6 100644 --- a/doc/src/neb.txt +++ b/doc/src/neb.txt @@ -284,7 +284,7 @@ ID2 x2 y2 z2 ... IDN xN yN zN :pre -The fields are the the atom ID, followed by the x,y,z coordinates. +The fields are the atom ID, followed by the x,y,z coordinates. The lines can be listed in any order. Additional trailing information on the line is OK, such as a comment. diff --git a/doc/src/next.txt b/doc/src/next.txt index 69bffe8bbf665a1a763a23c24fa657fdf50d263d..fe9dc975423858269a8fbb3f7f776be83ad7c033 100644 --- a/doc/src/next.txt +++ b/doc/src/next.txt @@ -44,7 +44,7 @@ one value from their respective list of values. A {file}-style variable reads the next line from its associated file. An {atomfile}-style variable reads the next set of lines (one per atom) from its associated file. {String-} or {atom}- or {equal}- or -{world}-style variables cannot be used with the the next command, +{world}-style variables cannot be used with the next command, since they only store a single value. When any of the variables in the next command has no more values, a diff --git a/doc/src/pair_srp.txt b/doc/src/pair_srp.txt index f2b6e6e769bac2cec1e1d1b5601f041d7fc0723c..a951cccbc33d86ef40a06790aad4fad1714eaf6a 100644 --- a/doc/src/pair_srp.txt +++ b/doc/src/pair_srp.txt @@ -99,7 +99,7 @@ The optional {exclude} keyword determines if forces are computed between first neighbor (directly connected) bonds. For a setting of {no}, first neighbor forces are computed; for {yes} they are not computed. A setting of {no} cannot be used with the {min} option for -distance calculation because the the minimum distance between directly +distance calculation because the minimum distance between directly connected bonds is zero. Pair style {srp} turns off normalization of thermodynamic properties diff --git a/doc/src/prd.txt b/doc/src/prd.txt index 832239de98ec2198af93cc8f722bc44299faae9a..1ad66ee441e99a6f3006c08b8c97cc81da0e500a 100644 --- a/doc/src/prd.txt +++ b/doc/src/prd.txt @@ -214,7 +214,7 @@ when a correlated event occurs during the third stage of the loop listed above, i.e. when only one replica is running dynamics. When more than one replica detects an event at the end of the same -event check (every {t_event} steps) during the the second stage, then +event check (every {t_event} steps) during the second stage, then one of them is chosen at random. The number of coincident events is the number of replicas that detected an event. Normally, this value should be 1. If it is often greater than 1, then either the number of @@ -241,7 +241,7 @@ time was spent in each stage (dephasing, dynamics, quenching, etc). Any "dump files"_dump.html defined in the input script, will be written to during a PRD run at timesteps corresponding to both -uncorrelated and correlated events. This means the the requested dump +uncorrelated and correlated events. This means the requested dump frequency in the "dump"_dump.html command is ignored. There will be one dump file (per dump command) created for all partitions. diff --git a/doc/src/python.txt b/doc/src/python.txt index 9d6dbdcb695ebb6e33c18a1a9349d2263ae7c961..773992bdddcc64b8d3026d5c5e31e307f4ab5d71 100644 --- a/doc/src/python.txt +++ b/doc/src/python.txt @@ -188,7 +188,7 @@ is assumed to have been previously loaded by another python command. Note that the Python code that is loaded and run must contain a function with the specified {func} name. To operate properly when -later invoked, the the function code must match the {input} and +later invoked, the function code must match the {input} and {return} and {format} keywords specified by the python command. Otherwise Python will generate an error. diff --git a/doc/src/read_dump.txt b/doc/src/read_dump.txt index f6424f65291793443f54707bfac985c20fb431bd..531e78aca51809599b5dd2c2cd0269c88fcbbaa7 100644 --- a/doc/src/read_dump.txt +++ b/doc/src/read_dump.txt @@ -185,7 +185,7 @@ For dump files in {xyz} format, only the {x}, {y}, and {z} fields are supported. The dump file does not store atom IDs, so these are assigned consecutively to the atoms as they appear in the dump file, starting from 1. Thus you should insure that order of atoms is -consistent from snapshot to snapshot in the the XYZ dump file. See +consistent from snapshot to snapshot in the XYZ dump file. See the "dump_modify sort"_dump_modify.html command if the XYZ dump file was written by LAMMPS. @@ -195,7 +195,7 @@ velocities, or their respective plugins may not support reading of velocities. The molfile dump files do not store atom IDs, so these are assigned consecutively to the atoms as they appear in the dump file, starting from 1. Thus you should insure that order of atoms are -consistent from snapshot to snapshot in the the molfile dump file. +consistent from snapshot to snapshot in the molfile dump file. See the "dump_modify sort"_dump_modify.html command if the dump file was written by LAMMPS. diff --git a/doc/src/tad.txt b/doc/src/tad.txt index 056ab73e56334411209416c61e09c22f71bbee97..5b0f5a006ce02d9eab48e55a90ef9567a4aaa2d8 100644 --- a/doc/src/tad.txt +++ b/doc/src/tad.txt @@ -231,7 +231,7 @@ time was spent in each stage (NEB, dynamics, quenching, etc). Any "dump files"_dump.html defined in the input script will be written to during a TAD run at timesteps when an event is executed. This -means the the requested dump frequency in the "dump"_dump.html command +means the requested dump frequency in the "dump"_dump.html command is ignored. There will be one dump file (per dump command) created for all partitions. The atom coordinates of the dump snapshot are those of the minimum energy configuration resulting from quenching diff --git a/doc/src/tutorial_drude.txt b/doc/src/tutorial_drude.txt index 58a3fae5c5176dd1187349bde189a98f106389d3..c2f4a16207e395b7c5c8406862f006fa1a5a29bf 100644 --- a/doc/src/tutorial_drude.txt +++ b/doc/src/tutorial_drude.txt @@ -33,7 +33,7 @@ created by the surrounding particles. Drude oscillators represent these dipoles by two fixed charges: the core (DC) and the Drude particle (DP) bound by a harmonic potential. The Drude particle can be thought of as the electron cloud whose center can be displaced from -the position of the the corresponding nucleus. +the position of the corresponding nucleus. The sum of the masses of a core-Drude pair should be the mass of the initial (unsplit) atom, \(m_C + m_D = m\). The sum of their charges diff --git a/src/KSPACE/ewald_disp.cpp b/src/KSPACE/ewald_disp.cpp index 49b7cde12e4db32e5560e8036aaee151101a7a78..2a4cc4b70c3ea190640ceab346fe9e852db0c88d 100644 --- a/src/KSPACE/ewald_disp.cpp +++ b/src/KSPACE/ewald_disp.cpp @@ -141,6 +141,7 @@ void EwaldDisp::init() init_coeffs(); init_coeff_sums(); if (function[0]) qsum_qsq(); + else qsqsum = qsum = 0.0; natoms_original = atom->natoms; // turn off coulombic if no charge @@ -152,6 +153,7 @@ void EwaldDisp::init() } double bsbsum = 0.0; + M2 = 0.0; if (function[1]) bsbsum = sum[1].x2; if (function[2]) bsbsum = sum[2].x2; @@ -489,8 +491,9 @@ void EwaldDisp::init_coeffs() double **b = (double **) force->pair->extract("B",tmp); delete [] B; B = new double[n+1]; + B[0] = 0.0; bytes += (n+1)*sizeof(double); - for (int i=0; i<=n; ++i) B[i] = sqrt(fabs(b[i][i])); + for (int i=1; i<=n; ++i) B[i] = sqrt(fabs(b[i][i])); } if (function[2]) { // arithmetic 1/r^6 double **epsilon = (double **) force->pair->extract("epsilon",tmp); @@ -502,7 +505,9 @@ void EwaldDisp::init_coeffs() if (!(epsilon&&sigma)) error->all( FLERR,"Epsilon or sigma reference not set by pair style in ewald/n"); - for (int i=0; i<=n; ++i) { + for (int j=0; j<7; ++j) + *(bi++) = 0.0; + for (int i=1; i<=n; ++i) { eps_i = sqrt(epsilon[i][i]); sigma_i = sigma[i][i]; sigma_n = 1.0; @@ -523,6 +528,7 @@ void EwaldDisp::init_coeff_sums() Sum sum_local[EWALD_MAX_NSUMS]; memset(sum_local, 0, EWALD_MAX_NSUMS*sizeof(Sum)); + memset(sum, 0, EWALD_MAX_NSUMS*sizeof(Sum)); // now perform qsum and qsq via parent qsum_qsq() diff --git a/src/KSPACE/pair_buck_long_coul_long.cpp b/src/KSPACE/pair_buck_long_coul_long.cpp index 7b42bb47d8539ee937163ae9301aea62f00a3e25..6504af57d92a71705023a488fa9ef14035b507c1 100644 --- a/src/KSPACE/pair_buck_long_coul_long.cpp +++ b/src/KSPACE/pair_buck_long_coul_long.cpp @@ -51,8 +51,6 @@ PairBuckLongCoulLong::PairBuckLongCoulLong(LAMMPS *lmp) : Pair(lmp) dispersionflag = ewaldflag = pppmflag = 1; respa_enable = 1; writedata = 1; - ftable = NULL; - fdisptable = NULL; } /* ---------------------------------------------------------------------- @@ -134,6 +132,7 @@ PairBuckLongCoulLong::~PairBuckLongCoulLong() memory->destroy(offset); } if (ftable) free_tables(); + if (fdisptable) free_disp_tables(); } /* ---------------------------------------------------------------------- @@ -288,8 +287,8 @@ void PairBuckLongCoulLong::init_style() if (ewald_order&(1<<6)) g_ewald_6 = force->kspace->g_ewald_6; // setup force tables - if (ncoultablebits) init_tables(cut_coul,cut_respa); - if (ndisptablebits) init_tables_disp(cut_buck_global); + if (ncoultablebits && (ewald_order&(1<<1))) init_tables(cut_coul,cut_respa); + if (ndisptablebits && (ewald_order&(1<<6))) init_tables_disp(cut_buck_global); } /* ---------------------------------------------------------------------- diff --git a/src/KSPACE/pair_lj_long_coul_long.cpp b/src/KSPACE/pair_lj_long_coul_long.cpp index 3b4ed79786fcaff010c820f756eb1df2a05af1d2..5ae607a2f055471cb5eb22be454ed5fa6a6fdfa8 100644 --- a/src/KSPACE/pair_lj_long_coul_long.cpp +++ b/src/KSPACE/pair_lj_long_coul_long.cpp @@ -130,6 +130,7 @@ PairLJLongCoulLong::~PairLJLongCoulLong() memory->destroy(offset); } if (ftable) free_tables(); + if (fdisptable) free_disp_tables(); } /* ---------------------------------------------------------------------- @@ -282,8 +283,8 @@ void PairLJLongCoulLong::init_style() // setup force tables - if (ncoultablebits) init_tables(cut_coul,cut_respa); - if (ndisptablebits) init_tables_disp(cut_lj_global); + if (ncoultablebits && (ewald_order&(1<<1))) init_tables(cut_coul,cut_respa); + if (ndisptablebits && (ewald_order&(1<<6))) init_tables_disp(cut_lj_global); } diff --git a/src/KSPACE/pppm_disp.cpp b/src/KSPACE/pppm_disp.cpp index b7ec188150e51752eb962c9b90f66a6d51339751..6bdf8a2d07da8127336c70853695b5327f72a0e4 100644 --- a/src/KSPACE/pppm_disp.cpp +++ b/src/KSPACE/pppm_disp.cpp @@ -1357,7 +1357,8 @@ void PPPMDisp::init_coeffs() // local pair coeffs if (function[1]) { // geometric 1/r^6 double **b = (double **) force->pair->extract("B",tmp); B = new double[n+1]; - for (int i=0; i<=n; ++i) B[i] = sqrt(fabs(b[i][i])); + B[0] = 0.0; + for (int i=1; i<=n; ++i) B[i] = sqrt(fabs(b[i][i])); } if (function[2]) { // arithmetic 1/r^6 //cannot use epsilon, because this has not been set yet diff --git a/src/USER-OMP/pppm_disp_omp.cpp b/src/USER-OMP/pppm_disp_omp.cpp index cdf4b3bce5a528ac3fde7fba4ee6080b343c4cbd..277da9d4b3851c62b2a504b4b7d5e569df613657 100644 --- a/src/USER-OMP/pppm_disp_omp.cpp +++ b/src/USER-OMP/pppm_disp_omp.cpp @@ -50,6 +50,13 @@ PPPMDispOMP::PPPMDispOMP(LAMMPS *lmp, int narg, char **arg) : suffix_flag |= Suffix::OMP; } +/* ---------------------------------------------------------------------- */ + +PPPMDispOMP::~PPPMDispOMP() +{ + deallocate(); +} + /* ---------------------------------------------------------------------- allocate memory that depends on # of K-vectors and order ------------------------------------------------------------------------- */ diff --git a/src/USER-OMP/pppm_disp_omp.h b/src/USER-OMP/pppm_disp_omp.h index 060f2694715be46e9c85ec16918e65da7d949f97..86c213282a22555658962de11a7b6ac0a9016138 100644 --- a/src/USER-OMP/pppm_disp_omp.h +++ b/src/USER-OMP/pppm_disp_omp.h @@ -28,7 +28,7 @@ namespace LAMMPS_NS { class PPPMDispOMP : public PPPMDisp, public ThrOMP { public: PPPMDispOMP(class LAMMPS *, int, char **); - virtual ~PPPMDispOMP () {}; + virtual ~PPPMDispOMP (); virtual void compute(int, int); protected: diff --git a/src/output.cpp b/src/output.cpp index df7c33e101aaf602d666068319da00d0f6cb4439..89e5c8d9cb7736b0bb81c8fd1a90ddcf297e6523 100644 --- a/src/output.cpp +++ b/src/output.cpp @@ -749,6 +749,7 @@ void Output::create_restart(int narg, char **arg) } else restart_every_single = every; int n = strlen(arg[1]) + 3; + delete [] restart1; restart1 = new char[n]; strcpy(restart1,arg[1]); if (strchr(restart1,'*') == NULL) strcat(restart1,".*"); @@ -765,6 +766,8 @@ void Output::create_restart(int narg, char **arg) restart_every_double = 0; } else restart_every_double = every; + delete [] restart2a; + delete [] restart2b; restart_toggle = 0; int n = strlen(arg[1]) + 3; restart2a = new char[n]; diff --git a/src/pair.cpp b/src/pair.cpp index 651cabed608e330412100b3c1ad9998a5adc18b3..5d73a592e8bea96cfe4b16939cdde484a3ee1fa9 100644 --- a/src/pair.cpp +++ b/src/pair.cpp @@ -87,6 +87,8 @@ Pair::Pair(LAMMPS *lmp) : Pointers(lmp) ndisptablebits = 12; tabinner = sqrt(2.0); tabinner_disp = sqrt(2.0); + ftable = NULL; + fdisptable = NULL; allocated = 0; suffix_flag = Suffix::NONE; diff --git a/src/region_cylinder.cpp b/src/region_cylinder.cpp index 5e666e472f610b6fa052e5f4ecac343775947891..3d5590b59e7cbe2d63e3e7f4dfe53b5158f404a3 100644 --- a/src/region_cylinder.cpp +++ b/src/region_cylinder.cpp @@ -36,8 +36,7 @@ RegCylinder::RegCylinder(LAMMPS *lmp, int narg, char **arg) : // check open face settings - if (openflag && (open_faces[2] || open_faces[3] || - open_faces[4] || open_faces[5])) + if (openflag && (open_faces[3] || open_faces[4] || open_faces[5])) error->all(FLERR,"Invalid region cylinder open setting"); if (strcmp(arg[2],"x") && strcmp(arg[2],"y") && strcmp(arg[2],"z")) diff --git a/src/universe.cpp b/src/universe.cpp index a856555de4f1bb6c2214629531d9ab87a4c36362..b5d33ac9a25316a9e6a0e12b3bb34a9ed54dae9e 100644 --- a/src/universe.cpp +++ b/src/universe.cpp @@ -163,17 +163,49 @@ void Universe::add_world(char *str) int n,nper; char *ptr; - if (str == NULL) { - n = 1; - nper = nprocs; - } else if ((ptr = strchr(str,'x')) != NULL) { - *ptr = '\0'; - n = atoi(str); - nper = atoi(ptr+1); - } else { - n = 1; - nper = atoi(str); - } + n = 1; + if (str != NULL) { + + // check for valid partition argument + + bool valid = true; + + // str may not be empty and may only consist of digits or 'x' + + int len = strlen(str); + if (len < 1) valid = false; + for (int i=0; i < len; ++i) + if (isdigit(str[i]) || str[i] == 'x') continue; + else valid = false; + + if (valid) { + if ((ptr = strchr(str,'x')) != NULL) { + + // 'x' may not be the first or last character + + if (ptr == str) { + valid = false; + } else if (strlen(str) == len-1) { + valid = false; + } else { + *ptr = '\0'; + n = atoi(str); + nper = atoi(ptr+1); + *ptr = 'x'; + } + } else nper = atoi(str); + } + + // require minimum of 1 partition with 1 processor + + if (n < 1 || nper < 1) valid = false; + + if (!valid) { + char msg[128]; + sprintf(msg,"Invalid partition string '%s'",str); + error->universe_all(FLERR,msg); + } + } else nper = nprocs; memory->grow(procs_per_world,nworlds+n,"universe:procs_per_world"); memory->grow(root_proc,(nworlds+n),"universe:root_proc"); diff --git a/tools/pymol_asphere/src/cartesian.cpp b/tools/pymol_asphere/src/cartesian.cpp old mode 100755 new mode 100644 diff --git a/tools/pymol_asphere/src/cartesian.h b/tools/pymol_asphere/src/cartesian.h old mode 100755 new mode 100644 diff --git a/tools/pymol_asphere/src/colors.cpp b/tools/pymol_asphere/src/colors.cpp old mode 100755 new mode 100644 diff --git a/tools/pymol_asphere/src/colors.h b/tools/pymol_asphere/src/colors.h old mode 100755 new mode 100644 diff --git a/tools/pymol_asphere/src/commandline.cpp b/tools/pymol_asphere/src/commandline.cpp old mode 100755 new mode 100644 diff --git a/tools/pymol_asphere/src/commandline.h b/tools/pymol_asphere/src/commandline.h old mode 100755 new mode 100644 diff --git a/tools/pymol_asphere/src/error.cpp b/tools/pymol_asphere/src/error.cpp old mode 100755 new mode 100644 diff --git a/tools/pymol_asphere/src/error.h b/tools/pymol_asphere/src/error.h old mode 100755 new mode 100644 diff --git a/tools/pymol_asphere/src/glsurface.cpp b/tools/pymol_asphere/src/glsurface.cpp old mode 100755 new mode 100644 diff --git a/tools/pymol_asphere/src/glsurface.h b/tools/pymol_asphere/src/glsurface.h old mode 100755 new mode 100644 diff --git a/tools/pymol_asphere/src/m_constants.h b/tools/pymol_asphere/src/m_constants.h old mode 100755 new mode 100644 diff --git a/tools/pymol_asphere/src/misc.cpp b/tools/pymol_asphere/src/misc.cpp old mode 100755 new mode 100644 diff --git a/tools/pymol_asphere/src/misc.h b/tools/pymol_asphere/src/misc.h old mode 100755 new mode 100644 diff --git a/tools/pymol_asphere/src/miscm.cpp b/tools/pymol_asphere/src/miscm.cpp old mode 100755 new mode 100644 diff --git a/tools/pymol_asphere/src/miscm.h b/tools/pymol_asphere/src/miscm.h old mode 100755 new mode 100644 diff --git a/tools/pymol_asphere/src/spherical.cpp b/tools/pymol_asphere/src/spherical.cpp old mode 100755 new mode 100644 diff --git a/tools/pymol_asphere/src/spherical.h b/tools/pymol_asphere/src/spherical.h old mode 100755 new mode 100644 diff --git a/tools/xmovie/control.c b/tools/xmovie/control.c old mode 100755 new mode 100644 diff --git a/tools/xmovie/dummy.c b/tools/xmovie/dummy.c old mode 100755 new mode 100644 diff --git a/tools/xmovie/hpsort.c b/tools/xmovie/hpsort.c old mode 100755 new mode 100644 diff --git a/tools/xmovie/read.c b/tools/xmovie/read.c old mode 100755 new mode 100644 diff --git a/tools/xmovie/resource.h b/tools/xmovie/resource.h old mode 100755 new mode 100644 diff --git a/tools/xmovie/scene.c b/tools/xmovie/scene.c old mode 100755 new mode 100644 diff --git a/tools/xmovie/toascii.c b/tools/xmovie/toascii.c old mode 100755 new mode 100644 diff --git a/tools/xmovie/tobinary.c b/tools/xmovie/tobinary.c old mode 100755 new mode 100644 diff --git a/tools/xmovie/version.c b/tools/xmovie/version.c old mode 100755 new mode 100644 diff --git a/tools/xmovie/xmovie.c b/tools/xmovie/xmovie.c old mode 100755 new mode 100644 diff --git a/tools/xmovie/xmovie.h b/tools/xmovie/xmovie.h old mode 100755 new mode 100644