From ae70f1090f187e161e2a3e81d4c8779eabd11a36 Mon Sep 17 00:00:00 2001 From: dstelter92 Date: Tue, 22 Nov 2016 12:05:14 -0500 Subject: [PATCH 01/13] added readme for grem examples --- examples/USER/misc/grem/README | 78 ++++++++++++++++++++++++++++++++++ 1 file changed, 78 insertions(+) create mode 100644 examples/USER/misc/grem/README diff --git a/examples/USER/misc/grem/README b/examples/USER/misc/grem/README new file mode 100644 index 0000000000..e064c7443e --- /dev/null +++ b/examples/USER/misc/grem/README @@ -0,0 +1,78 @@ +Generalized Replica Exchange Method (gREM) examples +=================================================== + +Examples: +--------------------------------------------------- + + lj-single: + This example is the simplest case scenerio utilizing the generalized + ensembled defined by fix_grem. It utilizes only 1 replica and requires + the LAMMPS executable to be run as usual: + + mpirun -np 4 lmp_mpi -in in.gREM-npt + ./lmp_serial -in in.gREM-nvt + + While this does not obtain any information about Ts(H), it is most similar to + a microcanonical simulation and "single-replica gREM" can be useful for + studying non-equilibrium processes as well. + + lj-6rep: + This example utilizes an external python script to handle swaps between + replicas. Included is run.sh, which requires the path to the LAMMPS + executable. If complied with mpi, multiple processors can be used as: + + ./run.sh $NUM_PROCS + + a serial run is completed simply as + + ./run.sh 1 + + where the executable provided must be serial if "1" is provided as the number + of procs. While this external replica exchange module is quite slow and + inefficient, it allows for many replicas to be used on a single processor. + While here there are only 6 replicas, this example could be extended to >100 + replicas while still using a serial compilation. This is also beneficial for + running on high performance nodes with few cores to complete a full-scale gREM + simulation with a large number of replicas. + + A quick note on efficiency: frequent exchanges slow down this script + substantially because LAMMPS is restarted every exchange attempt. The script + works best for large systems with infrequent exchanges. + + lj-temper: + This is an example using the internal replica exchange module. While fast + in comparison to the python version, it requires substantial resources + (at least 1 proc per replica). Instead of stopping LAMMPS every exchange + attempt, all replicas are run concurrantly, and exchanges take place + internally. This requires use of LAMMPS partition mode, via the command + line using the -p flag. Input files require world type variables defining + the parameters of each replica. The included example with 4 replicas must + run on at least 4 procs, in that case LAMMPS could be initiated as: + + mpirun -np 4 lmp_mpi -p 4x1 -in in.gREM-temper + + spawning 4 partitions with 1 replica each. Multiple procs per replica could + be used. In the case of a 16 system with 4 replicas, the + following logic could be used: + + mpirun -np 16 lmp_mpi -p 4x4 -in in.gREM-temper + + Once started, a universe log file will be created as well as log files for + each replica. The universe (log.lammps) contains exchange information, while + the replicas (*/log.lammps.*) contains the thermo_output as usual. In this + example, in.gREM-temper moves the log files to their respective folders. + + +Closing Notes: +--------------------------------------------------- + + Of significant difference between lj-6rep and lj-temper is the format of data. + In lj-6rep, data is stored as 'replicas' meaning discontinuous trajectories, as + files are moved between directories labeled by the 'lambda' of the replica. In + lj-temper, data is stored as 'walkers' with continuous trajectories, but + discontinuous parameters. The later is significantly more efficient, but + requires post-processing to obtain per-replica information. + + +Any problems/questions should be directed to . + From d58dd4f159896f5f51be536daa8ca694c59949bd Mon Sep 17 00:00:00 2001 From: dstelter92 Date: Tue, 22 Nov 2016 12:13:20 -0500 Subject: [PATCH 02/13] bugfix when parsing mpirun --- examples/USER/misc/grem/lj-6rep/double-re-short.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/examples/USER/misc/grem/lj-6rep/double-re-short.py b/examples/USER/misc/grem/lj-6rep/double-re-short.py index f04636c8fb..36705fe7b5 100755 --- a/examples/USER/misc/grem/lj-6rep/double-re-short.py +++ b/examples/USER/misc/grem/lj-6rep/double-re-short.py @@ -51,7 +51,7 @@ for exchange in arange(starting_ex,max_exchange): os.chdir(path+"/%s" % lambdas[l]) #os.system("cp restart_file restart_file%d" % exchange) if (nproc > 1): - os.system("mpirun -np %d " + lmp + " -in ../" + inp + " -var lambda %g -var eta %g -var enthalpy %g > output" % (nproc, lambdas[l], eta, H)) + os.system("mpirun -np %d " % (nproc) + lmp + " -in ../" + inp + " -var lambda %g -var eta %g -var enthalpy %g > output" % (lambdas[l], eta, H)) if (nproc == 1): os.system(lmp + " -in ../" + inp + " -var lambda %g -var eta %g -var enthalpy %g > output" % (lambdas[l], eta, H)) os.system("grep -v '[a-zA-Z]' output | awk '{if(NF==6 && NR>19)print $0}' | awk '{print $3}' >ent") @@ -60,7 +60,6 @@ for exchange in arange(starting_ex,max_exchange): aver_enthalpy[l] = mean(ee[-1]) # os.system("mv dump.dcd dump%d.dcd" % exchange) os.system("mv log.lammps log%d.lammps" % exchange) -# os.system("rm output") os.system("mv final_restart_file final_restart_file%d" % exchange) os.system("mv ent ent%d" % exchange) os.system("bzip2 log%d.lammps ent%d" % (exchange,exchange)) From 237307eda2385b23b79743577826ae76a4fed914 Mon Sep 17 00:00:00 2001 From: dstelter92 Date: Tue, 22 Nov 2016 12:16:00 -0500 Subject: [PATCH 03/13] small typo and changes --- examples/USER/misc/grem/README | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/examples/USER/misc/grem/README b/examples/USER/misc/grem/README index e064c7443e..a9d37ea869 100644 --- a/examples/USER/misc/grem/README +++ b/examples/USER/misc/grem/README @@ -5,8 +5,8 @@ Examples: --------------------------------------------------- lj-single: - This example is the simplest case scenerio utilizing the generalized - ensembled defined by fix_grem. It utilizes only 1 replica and requires + This example is the simplest case scenario utilizing the generalized + ensemble defined by fix_grem. It utilizes only 1 replica and requires the LAMMPS executable to be run as usual: mpirun -np 4 lmp_mpi -in in.gREM-npt @@ -18,8 +18,11 @@ Examples: lj-6rep: This example utilizes an external python script to handle swaps between - replicas. Included is run.sh, which requires the path to the LAMMPS - executable. If complied with mpi, multiple processors can be used as: + replicas. Included is run.sh, which requires the path to your LAMMPS + executable. The python script is fragile as it relies on parsing output files + from the LAMMPS run and moving LAMMPS data files between directories. Use + caution if modifying this example further. If complied with mpi, multiple + processors can be used as: ./run.sh $NUM_PROCS @@ -43,7 +46,7 @@ Examples: This is an example using the internal replica exchange module. While fast in comparison to the python version, it requires substantial resources (at least 1 proc per replica). Instead of stopping LAMMPS every exchange - attempt, all replicas are run concurrantly, and exchanges take place + attempt, all replicas are run concurrently, and exchanges take place internally. This requires use of LAMMPS partition mode, via the command line using the -p flag. Input files require world type variables defining the parameters of each replica. The included example with 4 replicas must From df46b9aa38fcca91ae653a62f20eb13b77c08957 Mon Sep 17 00:00:00 2001 From: Axel Kohlmeyer Date: Tue, 22 Nov 2016 15:25:59 -0500 Subject: [PATCH 04/13] rename compute pressure/grem to compute PRESSURE/GREM --- src/USER-MISC/README | 2 +- src/USER-MISC/compute_pressure_grem.cpp | 2 +- src/USER-MISC/compute_pressure_grem.h | 8 ++++---- src/USER-MISC/fix_grem.cpp | 2 +- 4 files changed, 7 insertions(+), 7 deletions(-) diff --git a/src/USER-MISC/README b/src/USER-MISC/README index 4b2394f087..513973b4f5 100644 --- a/src/USER-MISC/README +++ b/src/USER-MISC/README @@ -29,7 +29,7 @@ bond_style harmonic/shift/cut, Carsten Svaneborg, science at zqex.dk, 8 Aug 11 compute ackland/atom, Gerolf Ziegenhain, gerolf at ziegenhain.com, 4 Oct 2007 compute basal/atom, Christopher Barrett, cdb333 at cavs.msstate.edu, 3 Mar 2013 compute temp/rotate, Laurent Joly (U Lyon), ljoly.ulyon at gmail.com, 8 Aug 11 -compute pressure/grem, David Stelter, dstelter@bu.edu, 22 Nov 16 +compute PRESSURE/GREM, David Stelter, dstelter@bu.edu, 22 Nov 16 dihedral_style cosine/shift/exp, Carsten Svaneborg, science at zqex.dk, 8 Aug 11 dihedral_style fourier, Loukas Peristeras, loukas.peristeras at scienomics.com, 27 Oct 12 dihedral_style nharmonic, Loukas Peristeras, loukas.peristeras at scienomics.com, 27 Oct 12 diff --git a/src/USER-MISC/compute_pressure_grem.cpp b/src/USER-MISC/compute_pressure_grem.cpp index 02b9e02459..984ac9894e 100644 --- a/src/USER-MISC/compute_pressure_grem.cpp +++ b/src/USER-MISC/compute_pressure_grem.cpp @@ -54,7 +54,7 @@ void ComputePressureGrem::init() // Initialize hook to gREM fix int ifix = modify->find_fix(fix_grem); if (ifix < 0) - error->all(FLERR,"Fix grem ID for compute pressure/grem does not exist"); + error->all(FLERR,"Fix grem ID for compute PRESSURE/GREM does not exist"); int dim; scale_grem = (double *)modify->fix[ifix]->extract("scale_grem",dim); diff --git a/src/USER-MISC/compute_pressure_grem.h b/src/USER-MISC/compute_pressure_grem.h index 115688e7ac..e6dc5e6839 100644 --- a/src/USER-MISC/compute_pressure_grem.h +++ b/src/USER-MISC/compute_pressure_grem.h @@ -13,7 +13,7 @@ #ifdef COMPUTE_CLASS -ComputeStyle(pressure/grem,ComputePressureGrem) +ComputeStyle(PRESSURE/GREM,ComputePressureGrem) #else @@ -80,12 +80,12 @@ E: Must use 'kspace_modify pressure/scalar no' for tensor components with kspace Otherwise MSM will compute only a scalar pressure. See the kspace_modify command for details on this setting. -E: Fix grem ID for compute pressure/grem does not exist +E: Fix grem ID for compute PRESSURE/GREM does not exist -Compute pressure/grem was passed an invalid fix id +Compute PRESSURE/GREM was passed an invalid fix id E: Cannot extract gREM scale factor from fix grem -The fix id passed to compute pressure/grem refers to an incompatible fix +The fix id passed to compute PRESSURE/GREM refers to an incompatible fix */ diff --git a/src/USER-MISC/fix_grem.cpp b/src/USER-MISC/fix_grem.cpp index 55d176f413..fd646fa7ad 100644 --- a/src/USER-MISC/fix_grem.cpp +++ b/src/USER-MISC/fix_grem.cpp @@ -97,7 +97,7 @@ FixGrem::FixGrem(LAMMPS *lmp, int narg, char **arg) : newarg = new char*[5]; newarg[0] = id_press; newarg[1] = (char *) "all"; - newarg[2] = (char *) "pressure/grem"; + newarg[2] = (char *) "PRESSURE/GREM"; newarg[3] = id_temp; newarg[4] = id; modify->add_compute(5,newarg); From 87781771baf83a661ce2f77fd5624bbbc2ea5563 Mon Sep 17 00:00:00 2001 From: Axel Kohlmeyer Date: Wed, 23 Nov 2016 09:02:32 -0500 Subject: [PATCH 05/13] fix typo and USER-OMP support omission --- doc/src/Section_commands.txt | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/doc/src/Section_commands.txt b/doc/src/Section_commands.txt index 4707d25c4f..db2f7918be 100644 --- a/doc/src/Section_commands.txt +++ b/doc/src/Section_commands.txt @@ -632,11 +632,11 @@ USER-INTEL, k = KOKKOS, o = USER-OMP, t = OPT. "rigid/npt (o)"_fix_rigid.html, "rigid/nve (o)"_fix_rigid.html, "rigid/nvt (o)"_fix_rigid.html, -<"rigid/small (o)"_fix_rigid.html, -"rigid/small/nph"_fix_rigid.html, -"rigid/small/npt"_fix_rigid.html, -"rigid/small/nve"_fix_rigid.html, -"rigid/small/nvt"_fix_rigid.html, +"rigid/small (o)"_fix_rigid.html, +"rigid/small/nph (o)"_fix_rigid.html, +"rigid/small/npt (o)"_fix_rigid.html, +"rigid/small/nve (o)"_fix_rigid.html, +"rigid/small/nvt (o)"_fix_rigid.html, "setforce (k)"_fix_setforce.html, "shake"_fix_shake.html, "spring"_fix_spring.html, From 470908fc939d6dba2c665c4de3b46060dd6e283f Mon Sep 17 00:00:00 2001 From: Axel Kohlmeyer Date: Thu, 24 Nov 2016 05:46:15 -0500 Subject: [PATCH 06/13] explicitly disallow dynamic groups with compute rdf --- src/compute_rdf.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/src/compute_rdf.cpp b/src/compute_rdf.cpp index 0886394068..7b8b808d17 100644 --- a/src/compute_rdf.cpp +++ b/src/compute_rdf.cpp @@ -46,6 +46,7 @@ ComputeRDF::ComputeRDF(LAMMPS *lmp, int narg, char **arg) : array_flag = 1; extarray = 0; + dynamic_group_allow = 0; nbin = force->inumeric(FLERR,arg[3]); if (nbin < 1) error->all(FLERR,"Illegal compute rdf command"); From 02ae2d218af54beb0fe67fc6f55d6e7c33851975 Mon Sep 17 00:00:00 2001 From: Axel Kohlmeyer Date: Mon, 28 Nov 2016 11:34:22 -0500 Subject: [PATCH 07/13] correct broken link to USER-SMD docs PDF --- doc/src/compute_smd_contact_radius.txt | 2 +- doc/src/compute_smd_damage.txt | 2 +- doc/src/compute_smd_hourglass_error.txt | 2 +- doc/src/compute_smd_internal_energy.txt | 2 +- doc/src/compute_smd_plastic_strain.txt | 2 +- doc/src/compute_smd_plastic_strain_rate.txt | 2 +- doc/src/compute_smd_rho.txt | 2 +- doc/src/compute_smd_tlsph_defgrad.txt | 2 +- doc/src/compute_smd_tlsph_dt.txt | 2 +- doc/src/compute_smd_tlsph_num_neighs.txt | 2 +- doc/src/compute_smd_tlsph_shape.txt | 2 +- doc/src/compute_smd_tlsph_strain.txt | 2 +- doc/src/compute_smd_tlsph_strain_rate.txt | 2 +- doc/src/compute_smd_tlsph_stress.txt | 2 +- doc/src/compute_smd_triangle_mesh_vertices.txt | 2 +- doc/src/compute_smd_ulsph_num_neighs.txt | 2 +- doc/src/compute_smd_ulsph_strain.txt | 2 +- doc/src/compute_smd_ulsph_strain_rate.txt | 2 +- doc/src/compute_smd_ulsph_stress.txt | 2 +- doc/src/compute_smd_vol.txt | 2 +- doc/src/fix_smd_adjust_dt.txt | 2 +- doc/src/fix_smd_integrate_tlsph.txt | 2 +- doc/src/fix_smd_integrate_ulsph.txt | 2 +- doc/src/fix_smd_move_triangulated_surface.txt | 2 +- doc/src/fix_smd_wall_surface.txt | 2 +- doc/src/pair_smd_tlsph.txt | 2 +- doc/src/pair_smd_ulsph.txt | 2 +- 27 files changed, 27 insertions(+), 27 deletions(-) diff --git a/doc/src/compute_smd_contact_radius.txt b/doc/src/compute_smd_contact_radius.txt index a2cb378be0..69fe453343 100644 --- a/doc/src/compute_smd_contact_radius.txt +++ b/doc/src/compute_smd_contact_radius.txt @@ -27,7 +27,7 @@ contact radius is used only to prevent particles belonging to different physical bodies from penetrating each other. It is used by the contact pair styles, e.g., smd/hertz and smd/tri_surface. -See "this PDF guide"_USER/smd/SMD_LAMMPS_userguide.pdf to using Smooth +See "this PDF guide"_PDF/SMD_LAMMPS_userguide.pdf to using Smooth Mach Dynamics in LAMMPS. The value of the contact radius will be 0.0 for particles not in the diff --git a/doc/src/compute_smd_damage.txt b/doc/src/compute_smd_damage.txt index 30ca114fb3..b6c75a3b20 100644 --- a/doc/src/compute_smd_damage.txt +++ b/doc/src/compute_smd_damage.txt @@ -24,7 +24,7 @@ compute 1 all smd/damage :pre Define a computation that calculates the damage status of SPH particles according to the damage model which is defined via the SMD SPH pair styles, e.g., the maximum plastic strain failure criterion. -See "this PDF guide"_USER/smd/SMD_LAMMPS_userguide.pdf to use Smooth Mach Dynamics in LAMMPS. +See "this PDF guide"_PDF/SMD_LAMMPS_userguide.pdf to use Smooth Mach Dynamics in LAMMPS. [Output Info:] diff --git a/doc/src/compute_smd_hourglass_error.txt b/doc/src/compute_smd_hourglass_error.txt index 36978cc9ef..a15b79e64e 100644 --- a/doc/src/compute_smd_hourglass_error.txt +++ b/doc/src/compute_smd_hourglass_error.txt @@ -32,7 +32,7 @@ configuration. This compute is only really useful for debugging the hourglass control mechanim which is part of the Total-Lagrangian SPH pair style. -See "this PDF guide"_USER/smd/SMD_LAMMPS_userguide.pdf to use Smooth +See "this PDF guide"_PDF/SMD_LAMMPS_userguide.pdf to use Smooth Mach Dynamics in LAMMPS. [Output Info:] diff --git a/doc/src/compute_smd_internal_energy.txt b/doc/src/compute_smd_internal_energy.txt index f556b79c3e..bc6f9e0f20 100644 --- a/doc/src/compute_smd_internal_energy.txt +++ b/doc/src/compute_smd_internal_energy.txt @@ -24,7 +24,7 @@ compute 1 all smd/internal/energy :pre Define a computation which outputs the per-particle enthalpy, i.e., the sum of potential energy and heat. -See "this PDF guide"_USER/smd/SMD_LAMMPS_userguide.pdf to use Smooth +See "this PDF guide"_PDF/SMD_LAMMPS_userguide.pdf to use Smooth Mach Dynamics in LAMMPS. [Output Info:] diff --git a/doc/src/compute_smd_plastic_strain.txt b/doc/src/compute_smd_plastic_strain.txt index c149bc96c7..af5b164453 100644 --- a/doc/src/compute_smd_plastic_strain.txt +++ b/doc/src/compute_smd_plastic_strain.txt @@ -25,7 +25,7 @@ Define a computation that outputs the equivalent plastic strain per particle. This command is only meaningful if a material model with plasticity is defined. -See "this PDF guide"_USER/smd/SMD_LAMMPS_userguide.pdf to use Smooth +See "this PDF guide"_PDF/SMD_LAMMPS_userguide.pdf to use Smooth Mach Dynamics in LAMMPS. [Output Info:] diff --git a/doc/src/compute_smd_plastic_strain_rate.txt b/doc/src/compute_smd_plastic_strain_rate.txt index 2b222b9a78..ba7b3176db 100644 --- a/doc/src/compute_smd_plastic_strain_rate.txt +++ b/doc/src/compute_smd_plastic_strain_rate.txt @@ -25,7 +25,7 @@ Define a computation that outputs the time rate of the equivalent plastic strain. This command is only meaningful if a material model with plasticity is defined. -See "this PDF guide"_USER/smd/SMD_LAMMPS_userguide.pdf to use Smooth +See "this PDF guide"_PDF/SMD_LAMMPS_userguide.pdf to use Smooth Mach Dynamics in LAMMPS. [Output Info:] diff --git a/doc/src/compute_smd_rho.txt b/doc/src/compute_smd_rho.txt index 1d4ca6329f..ae50526725 100644 --- a/doc/src/compute_smd_rho.txt +++ b/doc/src/compute_smd_rho.txt @@ -26,7 +26,7 @@ The mass density is the mass of a particle which is constant during the course of a simulation, divided by its volume, which can change due to mechanical deformation. -See "this PDF guide"_USER/smd/SMD_LAMMPS_userguide.pdf to use Smooth +See "this PDF guide"_PDF/SMD_LAMMPS_userguide.pdf to use Smooth Mach Dynamics in LAMMPS. [Output info:] diff --git a/doc/src/compute_smd_tlsph_defgrad.txt b/doc/src/compute_smd_tlsph_defgrad.txt index 86351e42f7..68b5dffa1c 100644 --- a/doc/src/compute_smd_tlsph_defgrad.txt +++ b/doc/src/compute_smd_tlsph_defgrad.txt @@ -25,7 +25,7 @@ Define a computation that calculates the deformation gradient. It is only meaningful for particles which interact according to the Total-Lagrangian SPH pair style. -See "this PDF guide"_USER/smd/SMD_LAMMPS_userguide.pdf to use Smooth +See "this PDF guide"_PDF/SMD_LAMMPS_userguide.pdf to use Smooth Mach Dynamics in LAMMPS. [Output info:] diff --git a/doc/src/compute_smd_tlsph_dt.txt b/doc/src/compute_smd_tlsph_dt.txt index 1f1aa5bcfc..560a9b6fd8 100644 --- a/doc/src/compute_smd_tlsph_dt.txt +++ b/doc/src/compute_smd_tlsph_dt.txt @@ -30,7 +30,7 @@ time step. This calculation is performed automatically in the relevant SPH pair styles and this compute only serves to make the stable time increment accessible for output purposes. -See "this PDF guide"_USER/smd/SMD_LAMMPS_userguide.pdf to using Smooth +See "this PDF guide"_PDF/SMD_LAMMPS_userguide.pdf to using Smooth Mach Dynamics in LAMMPS. [Output info:] diff --git a/doc/src/compute_smd_tlsph_num_neighs.txt b/doc/src/compute_smd_tlsph_num_neighs.txt index 7c64342012..0420d1903d 100644 --- a/doc/src/compute_smd_tlsph_num_neighs.txt +++ b/doc/src/compute_smd_tlsph_num_neighs.txt @@ -25,7 +25,7 @@ Define a computation that calculates the number of particles inside of the smoothing kernel radius for particles interacting via the Total-Lagrangian SPH pair style. -See "this PDF guide"_USER/smd/SMD_LAMMPS_userguide.pdf to using Smooth +See "this PDF guide"_PDF/SMD_LAMMPS_userguide.pdf to using Smooth Mach Dynamics in LAMMPS. [Output info:] diff --git a/doc/src/compute_smd_tlsph_shape.txt b/doc/src/compute_smd_tlsph_shape.txt index d95d95acf1..02bd0c50dd 100644 --- a/doc/src/compute_smd_tlsph_shape.txt +++ b/doc/src/compute_smd_tlsph_shape.txt @@ -26,7 +26,7 @@ associated with a particle as a rotated ellipsoid. It is only meaningful for particles which interact according to the Total-Lagrangian SPH pair style. -See "this PDF guide"_USER/smd/SMD_LAMMPS_userguide.pdf to use Smooth +See "this PDF guide"_PDF/SMD_LAMMPS_userguide.pdf to use Smooth Mach Dynamics in LAMMPS. [Output info:] diff --git a/doc/src/compute_smd_tlsph_strain.txt b/doc/src/compute_smd_tlsph_strain.txt index 68d446b3be..f25d1b77db 100644 --- a/doc/src/compute_smd_tlsph_strain.txt +++ b/doc/src/compute_smd_tlsph_strain.txt @@ -24,7 +24,7 @@ compute 1 all smd/tlsph/strain :pre Define a computation that calculates the Green-Lagrange strain tensor for particles interacting via the Total-Lagrangian SPH pair style. -See "this PDF guide"_USER/smd/SMD_LAMMPS_userguide.pdf to using Smooth +See "this PDF guide"_PDF/SMD_LAMMPS_userguide.pdf to using Smooth Mach Dynamics in LAMMPS. [Output info:] diff --git a/doc/src/compute_smd_tlsph_strain_rate.txt b/doc/src/compute_smd_tlsph_strain_rate.txt index 88224ea0e3..13ca57ac4d 100644 --- a/doc/src/compute_smd_tlsph_strain_rate.txt +++ b/doc/src/compute_smd_tlsph_strain_rate.txt @@ -24,7 +24,7 @@ compute 1 all smd/tlsph/strain/rate :pre Define a computation that calculates the rate of the strain tensor for particles interacting via the Total-Lagrangian SPH pair style. -See "this PDF guide"_USER/smd/SMD_LAMMPS_userguide.pdf to using Smooth +See "this PDF guide"_PDF/SMD_LAMMPS_userguide.pdf to using Smooth Mach Dynamics in LAMMPS. [Output info:] diff --git a/doc/src/compute_smd_tlsph_stress.txt b/doc/src/compute_smd_tlsph_stress.txt index 0929e5ea07..5d707d4c2f 100644 --- a/doc/src/compute_smd_tlsph_stress.txt +++ b/doc/src/compute_smd_tlsph_stress.txt @@ -24,7 +24,7 @@ compute 1 all smd/tlsph/stress :pre Define a computation that outputs the Cauchy stress tensor for particles interacting via the Total-Lagrangian SPH pair style. -See "this PDF guide"_USER/smd/SMD_LAMMPS_userguide.pdf to using Smooth +See "this PDF guide"_PDF/SMD_LAMMPS_userguide.pdf to using Smooth Mach Dynamics in LAMMPS. [Output info:] diff --git a/doc/src/compute_smd_triangle_mesh_vertices.txt b/doc/src/compute_smd_triangle_mesh_vertices.txt index 1cec0090b5..5b0f0afc4c 100644 --- a/doc/src/compute_smd_triangle_mesh_vertices.txt +++ b/doc/src/compute_smd_triangle_mesh_vertices.txt @@ -25,7 +25,7 @@ Define a computation that returns the coordinates of the vertices corresponding to the triangle-elements of a mesh created by the "fix smd/wall_surface"_fix_smd_wall_surface.html. -See "this PDF guide"_USER/smd/SMD_LAMMPS_userguide.pdf to using Smooth +See "this PDF guide"_PDF/SMD_LAMMPS_userguide.pdf to using Smooth Mach Dynamics in LAMMPS. [Output info:] diff --git a/doc/src/compute_smd_ulsph_num_neighs.txt b/doc/src/compute_smd_ulsph_num_neighs.txt index 1e08e0cca4..95af1b2163 100644 --- a/doc/src/compute_smd_ulsph_num_neighs.txt +++ b/doc/src/compute_smd_ulsph_num_neighs.txt @@ -25,7 +25,7 @@ Define a computation that returns the number of neighbor particles inside of the smoothing kernel radius for particles interacting via the updated Lagrangian SPH pair style. -See "this PDF guide"_USER/smd/SMD_LAMMPS_userguide.pdf to using Smooth +See "this PDF guide"_PDF/SMD_LAMMPS_userguide.pdf to using Smooth Mach Dynamics in LAMMPS. [Output info:] diff --git a/doc/src/compute_smd_ulsph_strain.txt b/doc/src/compute_smd_ulsph_strain.txt index 1eb6bc7c2b..b7d425b12b 100644 --- a/doc/src/compute_smd_ulsph_strain.txt +++ b/doc/src/compute_smd_ulsph_strain.txt @@ -24,7 +24,7 @@ compute 1 all smd/ulsph/strain :pre Define a computation that outputs the logarithmic strain tensor. for particles interacting via the updated Lagrangian SPH pair style. -See "this PDF guide"_USER/smd/SMD_LAMMPS_userguide.pdf to using Smooth +See "this PDF guide"_PDF/SMD_LAMMPS_userguide.pdf to using Smooth Mach Dynamics in LAMMPS. [Output info:] diff --git a/doc/src/compute_smd_ulsph_strain_rate.txt b/doc/src/compute_smd_ulsph_strain_rate.txt index eb9318e072..e2c349c265 100644 --- a/doc/src/compute_smd_ulsph_strain_rate.txt +++ b/doc/src/compute_smd_ulsph_strain_rate.txt @@ -25,7 +25,7 @@ Define a computation that outputs the rate of the logarithmic strain tensor for particles interacting via the updated Lagrangian SPH pair style. -See "this PDF guide"_USER/smd/SMD_LAMMPS_userguide.pdf to using Smooth +See "this PDF guide"_PDF/SMD_LAMMPS_userguide.pdf to using Smooth Mach Dynamics in LAMMPS. [Output info:] diff --git a/doc/src/compute_smd_ulsph_stress.txt b/doc/src/compute_smd_ulsph_stress.txt index 115a4d14bb..47f903d3b8 100644 --- a/doc/src/compute_smd_ulsph_stress.txt +++ b/doc/src/compute_smd_ulsph_stress.txt @@ -23,7 +23,7 @@ compute 1 all smd/ulsph/stress :pre Define a computation that outputs the Cauchy stress tensor. -See "this PDF guide"_USER/smd/SMD_LAMMPS_userguide.pdf to using Smooth +See "this PDF guide"_PDF/SMD_LAMMPS_userguide.pdf to using Smooth Mach Dynamics in LAMMPS. [Output info:] diff --git a/doc/src/compute_smd_vol.txt b/doc/src/compute_smd_vol.txt index 239ab1a1d5..fc736a5bf5 100644 --- a/doc/src/compute_smd_vol.txt +++ b/doc/src/compute_smd_vol.txt @@ -24,7 +24,7 @@ compute 1 all smd/vol :pre Define a computation that provides the per-particle volume and the sum of the per-particle volumes of the group for which the fix is defined. -See "this PDF guide"_USER/smd/SMD_LAMMPS_userguide.pdf to using Smooth +See "this PDF guide"_PDF/SMD_LAMMPS_userguide.pdf to using Smooth Mach Dynamics in LAMMPS. [Output info:] diff --git a/doc/src/fix_smd_adjust_dt.txt b/doc/src/fix_smd_adjust_dt.txt index 04a0a7becd..86b7363300 100644 --- a/doc/src/fix_smd_adjust_dt.txt +++ b/doc/src/fix_smd_adjust_dt.txt @@ -36,7 +36,7 @@ stable maximum time step. This fix inquires the minimum stable time increment across all particles contained in the group for which this fix is defined. An additional safety factor {s_fact} is applied to the time increment. -See "this PDF guide"_USER/smd/SMD_LAMMPS_userguide.pdf to use Smooth Mach Dynamics in LAMMPS. +See "this PDF guide"_PDF/SMD_LAMMPS_userguide.pdf to use Smooth Mach Dynamics in LAMMPS. [Restart, fix_modify, output, run start/stop, minimize info:] diff --git a/doc/src/fix_smd_integrate_tlsph.txt b/doc/src/fix_smd_integrate_tlsph.txt index 8948acbb3b..24d319bdb9 100644 --- a/doc/src/fix_smd_integrate_tlsph.txt +++ b/doc/src/fix_smd_integrate_tlsph.txt @@ -32,7 +32,7 @@ fix 1 all smd/integrate_tlsph limit_velocity 1000 :pre The fix performs explicit time integration for particles which interact according with the Total-Lagrangian SPH pair style. -See "this PDF guide"_USER/smd/SMD_LAMMPS_userguide.pdf to using Smooth Mach Dynamics in LAMMPS. +See "this PDF guide"_PDF/SMD_LAMMPS_userguide.pdf to using Smooth Mach Dynamics in LAMMPS. The {limit_velocity} keyword will control the velocity, scaling the norm of the velocity vector to max_vel in case it exceeds this velocity limit. diff --git a/doc/src/fix_smd_integrate_ulsph.txt b/doc/src/fix_smd_integrate_ulsph.txt index dfbdf51cce..0dfb9451de 100644 --- a/doc/src/fix_smd_integrate_ulsph.txt +++ b/doc/src/fix_smd_integrate_ulsph.txt @@ -34,7 +34,7 @@ fix 1 all smd/integrate_ulsph limit_velocity 1000 :pre [Description:] The fix performs explicit time integration for particles which interact with the updated Lagrangian SPH pair style. -See "this PDF guide"_USER/smd/SMD_LAMMPS_userguide.pdf to using Smooth Mach Dynamics in LAMMPS. +See "this PDF guide"_PDF/SMD_LAMMPS_userguide.pdf to using Smooth Mach Dynamics in LAMMPS. The {adjust_radius} keyword activates dynamic adjustment of the per-particle SPH smoothing kernel radius such that the number of neighbors per particles remains within the interval {min_nn} to {max_nn}. The parameter {adjust_radius_factor} determines the amount of adjustment per timestep. Typical values are diff --git a/doc/src/fix_smd_move_triangulated_surface.txt b/doc/src/fix_smd_move_triangulated_surface.txt index 9fa6947ff5..2cba001267 100644 --- a/doc/src/fix_smd_move_triangulated_surface.txt +++ b/doc/src/fix_smd_move_triangulated_surface.txt @@ -55,7 +55,7 @@ specified. This style also sets the velocity of each particle to (omega cross Rperp) where omega is its angular velocity around the rotation axis and Rperp is a perpendicular vector from the rotation axis to the particle. -See "this PDF guide"_USER/smd/SMD_LAMMPS_userguide.pdf to using Smooth Mach Dynamics in LAMMPS. +See "this PDF guide"_PDF/SMD_LAMMPS_userguide.pdf to using Smooth Mach Dynamics in LAMMPS. [Restart, fix_modify, output, run start/stop, minimize info:] diff --git a/doc/src/fix_smd_wall_surface.txt b/doc/src/fix_smd_wall_surface.txt index 19f0f3d80b..4ea592be1b 100644 --- a/doc/src/fix_smd_wall_surface.txt +++ b/doc/src/fix_smd_wall_surface.txt @@ -37,7 +37,7 @@ It is possible to move the triangulated surface via the "smd/move_tri_surf"_fix_ Immediately after a .STL file has been read, the simulation needs to be run for 0 timesteps in order to properly register the new particles in the system. See the "funnel_flow" example in the USER-SMD examples directory. -See "this PDF guide"_USER/smd/SMD_LAMMPS_userguide.pdf to use Smooth Mach Dynamics in LAMMPS. +See "this PDF guide"_PDF/SMD_LAMMPS_userguide.pdf to use Smooth Mach Dynamics in LAMMPS. [Restart, fix_modify, output, run start/stop, minimize info:] diff --git a/doc/src/pair_smd_tlsph.txt b/doc/src/pair_smd_tlsph.txt index a81d2e25c1..f73acf74ee 100644 --- a/doc/src/pair_smd_tlsph.txt +++ b/doc/src/pair_smd_tlsph.txt @@ -39,7 +39,7 @@ invocation of the {tlsph} for a solid body would consist of an equation of state the pressure (the diagonal components of the stress tensor), and a material model to compute shear stresses (the off-diagonal components of the stress tensor). Damage and failure models can also be added. -Please see the "SMD user guide"_USER/smd/SMD_LAMMPS_userguide.pdf for a complete listing of the possible keywords and material models. +Please see the "SMD user guide"_PDF/SMD_LAMMPS_userguide.pdf for a complete listing of the possible keywords and material models. :line diff --git a/doc/src/pair_smd_ulsph.txt b/doc/src/pair_smd_ulsph.txt index d4c9fc41fa..b9efeb8fc3 100644 --- a/doc/src/pair_smd_ulsph.txt +++ b/doc/src/pair_smd_ulsph.txt @@ -43,7 +43,7 @@ stresses (the off-diagonal components of the stress tensor). Note that the use of *GRADIENT_CORRECTION can lead to severe numerical instabilities. For a general fluid simulation, *NO_GRADIENT_CORRECTION is recommended. -Please see the "SMD user guide"_USER/smd/SMD_LAMMPS_userguide.pdf for a complete listing of the possible keywords and material models. +Please see the "SMD user guide"_PDF/SMD_LAMMPS_userguide.pdf for a complete listing of the possible keywords and material models. :line From 5ff5bc2a6ce2c49530d149470c3d9513ed09561e Mon Sep 17 00:00:00 2001 From: Axel Kohlmeyer Date: Mon, 28 Nov 2016 21:34:35 -0500 Subject: [PATCH 08/13] avoid issues detected by coverity scan --- src/REPLICA/temper.cpp | 2 ++ src/USER-MISC/pair_agni.cpp | 1 + src/USER-MISC/temper_grem.cpp | 14 ++++++++------ 3 files changed, 11 insertions(+), 6 deletions(-) diff --git a/src/REPLICA/temper.cpp b/src/REPLICA/temper.cpp index ebc26d6061..667f2893c6 100644 --- a/src/REPLICA/temper.cpp +++ b/src/REPLICA/temper.cpp @@ -84,6 +84,8 @@ void Temper::command(int narg, char **arg) my_set_temp = universe->iworld; if (narg == 7) my_set_temp = force->inumeric(FLERR,arg[6]); + if ((my_set_temp < 0) || (my_set_temp >= universe->nworlds)) + error->universe_one(FLERR,"Illegal temperature index"); // swap frequency must evenly divide total # of timesteps diff --git a/src/USER-MISC/pair_agni.cpp b/src/USER-MISC/pair_agni.cpp index 57f0a9cd4c..03bb22c713 100644 --- a/src/USER-MISC/pair_agni.cpp +++ b/src/USER-MISC/pair_agni.cpp @@ -85,6 +85,7 @@ PairAGNI::PairAGNI(LAMMPS *lmp) : Pair(lmp) nparams = 0; params = NULL; map = NULL; + cutmax = 0.0; } /* ---------------------------------------------------------------------- diff --git a/src/USER-MISC/temper_grem.cpp b/src/USER-MISC/temper_grem.cpp index aedd74414f..28fea49689 100644 --- a/src/USER-MISC/temper_grem.cpp +++ b/src/USER-MISC/temper_grem.cpp @@ -113,6 +113,8 @@ void TemperGrem::command(int narg, char **arg) my_set_lambda = universe->iworld; if (narg == 8) my_set_lambda = force->inumeric(FLERR,arg[7]); + if ((my_set_lambda < 0) || (my_set_lambda >= universe->nworlds)) + error->universe_one(FLERR,"Illegal temperature index"); // swap frequency must evenly divide total # of timesteps @@ -271,12 +273,6 @@ void TemperGrem::command(int narg, char **arg) partner = world2root[partner_world]; } - // compute weights - volume = domain->xprd * domain->yprd * domain->zprd; - enth = pe + (pressref * volume); - weight = log(set_lambda[my_set_lambda] + (eta*(enth + h0))); - weight_cross = log(set_lambda[partner_set_lambda] + (eta*(enth + h0))); - // swap with a partner, only root procs in each world participate // hi proc sends PE to low proc // lo proc make Boltzmann decision on whether to swap @@ -284,6 +280,12 @@ void TemperGrem::command(int narg, char **arg) swap = 0; if (partner != -1) { + // compute weights + volume = domain->xprd * domain->yprd * domain->zprd; + enth = pe + (pressref * volume); + weight = log(set_lambda[my_set_lambda] + (eta*(enth + h0))); + weight_cross = log(set_lambda[partner_set_lambda] + (eta*(enth + h0))); + if (me_universe > partner) { MPI_Send(&weight,1,MPI_DOUBLE,partner,0,universe->uworld); MPI_Send(&weight_cross,1,MPI_DOUBLE,partner,0,universe->uworld); From 42d430168b8affa057d864915db39a2d63c17f46 Mon Sep 17 00:00:00 2001 From: Axel Kohlmeyer Date: Tue, 29 Nov 2016 07:24:09 -0500 Subject: [PATCH 09/13] fix typo in compute cluster/atom docs this closes #292 --- doc/src/compute_cluster_atom.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/src/compute_cluster_atom.txt b/doc/src/compute_cluster_atom.txt index 3ebf1e600e..147d06c2a8 100644 --- a/doc/src/compute_cluster_atom.txt +++ b/doc/src/compute_cluster_atom.txt @@ -37,7 +37,7 @@ The neighbor list needed to compute this quantity is constructed each time the calculation is performed (i.e. each time a snapshot of atoms is dumped). Thus it can be inefficient to compute/dump this quantity too frequently or to have multiple compute/dump commands, each of a -{clsuter/atom} style. +{cluster/atom} style. NOTE: If you have a bonded system, then the settings of "special_bonds"_special_bonds.html command can remove pairwise From 1d970d3cdf5031fcf448cb3cb2f5e63895c34da5 Mon Sep 17 00:00:00 2001 From: Jakub Krajniak Date: Tue, 29 Nov 2016 12:15:39 +0100 Subject: [PATCH 10/13] dihedral_nharmonic: added writing coefficient by write_data (cherry picked from commit 618f5c6aa52a41035391654af74c335dd0adf33e) --- src/USER-MISC/dihedral_nharmonic.cpp | 20 +++++++++++++++++++- src/USER-MISC/dihedral_nharmonic.h | 1 + 2 files changed, 20 insertions(+), 1 deletion(-) diff --git a/src/USER-MISC/dihedral_nharmonic.cpp b/src/USER-MISC/dihedral_nharmonic.cpp index ba8af7e65b..25049b8ec2 100644 --- a/src/USER-MISC/dihedral_nharmonic.cpp +++ b/src/USER-MISC/dihedral_nharmonic.cpp @@ -35,7 +35,9 @@ using namespace LAMMPS_NS; /* ---------------------------------------------------------------------- */ -DihedralNHarmonic::DihedralNHarmonic(LAMMPS *lmp) : Dihedral(lmp) {} +DihedralNHarmonic::DihedralNHarmonic(LAMMPS *lmp) : Dihedral(lmp) { + writedata = 1; +} /* ---------------------------------------------------------------------- */ @@ -334,3 +336,19 @@ void DihedralNHarmonic::read_restart(FILE *fp) for (int i = 1; i <= atom->ndihedraltypes; i++) setflag[i] = 1; } +/* ---------------------------------------------------------------------- + proc 0 writes to data file +------------------------------------------------------------------------- */ + +void DihedralNHarmonic::write_data(FILE *fp) +{ + fwrite(&nterms[1],sizeof(int),atom->ndihedraltypes,fp); + for (int i = 1; i <= atom->ndihedraltypes; i++) { + fprintf(fp, "%d %d ", i, nterms[i]); + for (int j = 0; j < nterms[i]; j++ ) { + fprintf(fp, "%f ", a[i][j]); + } + fprintf(fp, "\n"); + } + +} diff --git a/src/USER-MISC/dihedral_nharmonic.h b/src/USER-MISC/dihedral_nharmonic.h index c347f37cbd..2e8050feb9 100644 --- a/src/USER-MISC/dihedral_nharmonic.h +++ b/src/USER-MISC/dihedral_nharmonic.h @@ -33,6 +33,7 @@ class DihedralNHarmonic : public Dihedral { void coeff(int, char **); void write_restart(FILE *); void read_restart(FILE *); + void write_data(FILE *); protected: int *nterms; From 7d098bff90d4d28fb3df22f0fcbb2d5edfda0746 Mon Sep 17 00:00:00 2001 From: Jakub Krajniak Date: Tue, 29 Nov 2016 12:47:19 +0100 Subject: [PATCH 11/13] update format (cherry picked from commit 2597185afb212cfa31c5d8364a9d059d8d216807) --- src/USER-MISC/dihedral_nharmonic.cpp | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/USER-MISC/dihedral_nharmonic.cpp b/src/USER-MISC/dihedral_nharmonic.cpp index 25049b8ec2..8def32bb35 100644 --- a/src/USER-MISC/dihedral_nharmonic.cpp +++ b/src/USER-MISC/dihedral_nharmonic.cpp @@ -342,11 +342,10 @@ void DihedralNHarmonic::read_restart(FILE *fp) void DihedralNHarmonic::write_data(FILE *fp) { - fwrite(&nterms[1],sizeof(int),atom->ndihedraltypes,fp); for (int i = 1; i <= atom->ndihedraltypes; i++) { fprintf(fp, "%d %d ", i, nterms[i]); for (int j = 0; j < nterms[i]; j++ ) { - fprintf(fp, "%f ", a[i][j]); + fprintf(fp, (j < nterms[i] - 1) ? "%f " : "%f", a[i][j]); } fprintf(fp, "\n"); } From 789e62388f4444761991f26975ef02e68e0ee1f4 Mon Sep 17 00:00:00 2001 From: Axel Kohlmeyer Date: Tue, 29 Nov 2016 09:03:53 -0500 Subject: [PATCH 12/13] simplify code --- src/USER-MISC/dihedral_nharmonic.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/USER-MISC/dihedral_nharmonic.cpp b/src/USER-MISC/dihedral_nharmonic.cpp index 8def32bb35..87f7b0775b 100644 --- a/src/USER-MISC/dihedral_nharmonic.cpp +++ b/src/USER-MISC/dihedral_nharmonic.cpp @@ -343,10 +343,10 @@ void DihedralNHarmonic::read_restart(FILE *fp) void DihedralNHarmonic::write_data(FILE *fp) { for (int i = 1; i <= atom->ndihedraltypes; i++) { - fprintf(fp, "%d %d ", i, nterms[i]); - for (int j = 0; j < nterms[i]; j++ ) { - fprintf(fp, (j < nterms[i] - 1) ? "%f " : "%f", a[i][j]); - } + fprintf(fp, "%d %d", i, nterms[i]); + for (int j = 0; j < nterms[i]; j++ ) + fprintf(fp, " %g", a[i][j]); + fprintf(fp, "\n"); } From 7ddb6670c02a11b28b0afa336c47746f32e78d81 Mon Sep 17 00:00:00 2001 From: Axel Kohlmeyer Date: Wed, 30 Nov 2016 00:12:35 -0500 Subject: [PATCH 13/13] fix typo --- tools/msi2lmp/frc_files/README | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/msi2lmp/frc_files/README b/tools/msi2lmp/frc_files/README index ee6749f404..a453e39666 100644 --- a/tools/msi2lmp/frc_files/README +++ b/tools/msi2lmp/frc_files/README @@ -5,6 +5,6 @@ for use with msi2lmp. Note that LAMMPS does not distribute Accelrys (or old BioSym) force field files, since they are proprietary. All the files in this directory that are part of the LAMMPS distribution -are are openly available files that are in the public domain. +are openly available files that are in the public domain.