Merge branch 'collected-small-changes' into collected-post-stable-patches

This commit is contained in:
Axel Kohlmeyer 2018-12-29 12:05:30 -05:00
commit 89ca07c76e
8 changed files with 48 additions and 31 deletions

View File

@ -6,7 +6,7 @@ choices the LAMMPS developers have agreed on. Git and GitHub provide the
tools, but do not set policies, so it is up to the developers to come to
an agreement as to how to define and interpret policies. This document
is likely to change as our experiences and needs change and we try to
adapt accordingly. Last change 2018-11-15.
adapt accordingly. Last change 2018-12-19.
## Table of Contents
@ -129,16 +129,17 @@ Here are some items to check:
* stdlib.h -> cstdlib
* string.h -> cstring
* time.h -> ctime
Do not replace (as they are C++-11): `inttypes.h` and `stdint.h`.
* Do NOT replace (as they are C++-11): `inttypes.h` and `stdint.h`.
* Code should follow the C++-98 standard. C++-11 is only accepted
in individual special purpose packages
* indentation is two spaces per level
* there should be no tabs and no trailing whitespace
* indentation is 2 spaces per level
* there should be NO tabs and no trailing whitespace
* header files, especially of new styles, should not include any
other headers, except the header with the base class or cstdio.
Forward declarations should be used instead when possible.
* iostreams should be avoided. LAMMPS uses stdio from the C-library.
* use of STL in headers and class definitions should be avoided.
* there MUST NOT be any "using namespace XXX;" statements in headers.
* static class members should be avoided at all cost.
* anything storing atom IDs should be using `tagint` and not `int`.
This can be flagged by the compiler only for pointers and only when

View File

@ -16,7 +16,7 @@ functionality for setting up simulations and analyzing their output.
Specifically, LAMMPS was not conceived and designed for:
being run thru a GUI
build molecular systems, or building molecular topologies
building molecular systems, or building molecular topologies
assign force-field coefficients automagically
perform sophisticated analysis of your MD simulation
visualize your MD simulation interactively
@ -24,18 +24,18 @@ plot your output data :ul
Although over the years these limitations have been somewhat
reduced through features added to LAMMPS or external tools
that either interface with LAMMPS or extend LAMMPS.
that either closely interface with LAMMPS or extend LAMMPS.
Here are suggestions on how to perform these tasks:
GUI: LAMMPS can be built as a library and a Python wrapper that wraps
[GUI:] LAMMPS can be built as a library and a Python wrapper that wraps
the library interface is provided. Thus, GUI interfaces can be
written in Python (or C or C++ if desired) that run LAMMPS and
visualize or plot its output. Examples of this are provided in the
python directory and described on the "Python"_Python_head.html doc
page. Also, there are several external wrappers or GUI front ends.:ulb,l
page. Also, there are several external wrappers or GUI front ends. :ulb,l
Builder: Several pre-processing tools are packaged with LAMMPS. Some
[Builder:] Several pre-processing tools are packaged with LAMMPS. Some
of them convert input files in formats produced by other MD codes such
as CHARMM, AMBER, or Insight into LAMMPS input formats. Some of them
are simple programs that will build simple molecular systems, such as
@ -45,15 +45,20 @@ the "Tools"_Tools.html doc page for details on tools packaged with
LAMMPS. The "Pre/post processing
page"_http:/lammps.sandia.gov/prepost.html of the LAMMPS website
describes a variety of 3rd party tools for this task. Furthermore,
some LAMMPS internal commands to reconstruct topology, as well as
the option to insert molecule templates instead of atoms.:l
some LAMMPS internal commands allow to reconstruct, or selectively add
topology information, as well as provide the option to insert molecule
templates instead of atoms for building bulk molecular systems. :l
Force-field assignment: The conversion tools described in the previous
[Force-field assignment:] The conversion tools described in the previous
bullet for CHARMM, AMBER, and Insight will also assign force field
coefficients in the LAMMPS format, assuming you provide CHARMM, AMBER,
or BIOVIA (formerly Accelrys) force field files. :l
or BIOVIA (formerly Accelrys) force field files. The tools
"ParmEd"_https://parmed.github.io/ParmEd/html/index.html and
"InterMol"_https://github.com/shirtsgroup/InterMol are particularly
powerful and flexible in converting force field and topology data
between various MD simulation programs. :l
Simulation analysis: If you want to perform analysis on-the-fly as
[Simulation analysis:] If you want to perform analysis on-the-fly as
your simulation runs, see the "compute"_compute.html and
"fix"_fix.html doc pages, which list commands that can be used in a
LAMMPS input script. Also see the "Modify"_Modify.html doc page for
@ -71,22 +76,22 @@ tools/python directory can extract and massage data in dump files to
make it easier to import into other programs. See the
"Tools"_Tools.html doc page for details on these various options. :l
Visualization: LAMMPS can produce JPG or PNG snapshot images
[Visualization:] LAMMPS can produce NETPBM, JPG or PNG snapshot images
on-the-fly via its "dump image"_dump_image.html command and pass
them to an external program FFmpeg to generate movies from them. For
high-quality, interactive visualization there are many excellent and
free tools available. See the "Other Codes
them to an external program, "FFmpeg"_https://www.ffmpeg.org to generate
movies from them. For high-quality, interactive visualization there are
many excellent and free tools available. See the "Other Codes
page"_http://lammps.sandia.gov/viz.html page of the LAMMPS website for
visualization packages that can use LAMMPS output data. :l
Plotting: See the next bullet about Pizza.py as well as the
[Plotting:] See the next bullet about Pizza.py as well as the
"Python"_Python_head.html doc page for examples of plotting LAMMPS
output. Scripts provided with the {python} tool in the tools
directory will extract and massage data in log and dump files to make
it easier to analyze and plot. See the "Tools"_Tools.html doc page
for more discussion of the various tools. :l
Pizza.py: Our group has also written a separate toolkit called
[Pizza.py:] Our group has also written a separate toolkit called
"Pizza.py"_http://pizza.sandia.gov which can do certain kinds of
setup, analysis, plotting, and visualization (via OpenGL) for LAMMPS
simulations. It thus provides some functionality for several of the

View File

@ -108,9 +108,13 @@ your contribution(s) to be added to main LAMMPS code or one of its
standard packages, it needs to be written in a style compatible with
other LAMMPS source files. This means: 2-character indentation per
level, [no tabs], no lines over 80 characters. I/O is done via
the C-style stdio library, class header files should not import any
system headers outside <stdio.h>, STL containers should be avoided
in headers, and forward declarations used where possible or needed.
the C-style stdio library (mixing of stdio and iostreams is generally
discouraged), class header files should not import any system headers
outside of <cstdio>, STL containers should be avoided in headers,
system header from the C library should use the C++-style names
(<cstdlib>, <cstdio>, or <cstring>) instead of the C-style names
<stdlib.h>, <stdio.h>, or <string.h>), and forward declarations
used where possible or needed to avoid including headers.
All added code should be placed into the LAMMPS_NS namespace or a
sub-namespace; global or static variables should be avoided, as they
conflict with the modular nature of LAMMPS and the C++ class structure.

View File

@ -435,6 +435,9 @@ CSiC
csld
cslib
CSlib
cstdio
cstdlib
cstring
cstyle
csvr
Ctypes
@ -1135,6 +1138,7 @@ inv
invariants
inversed
ionocovalent
iostreams
iparam
ipi
ipp
@ -2507,7 +2511,9 @@ Startstep
statcoul
statcoulombs
statvolt
stdlib
stdin
stdio
steelblue
Stegailov
Steinbach

View File

@ -217,7 +217,9 @@ void PairLJClass2CoulCut::settings(int narg, char **arg)
void PairLJClass2CoulCut::coeff(int narg, char **arg)
{
if (narg < 4 || narg > 6) error->all(FLERR,"Incorrect args for pair coefficients");
if (narg < 4 || narg > 6)
error->all(FLERR,"Incorrect args for pair coefficients");
if (!allocated) allocate();
int ilo,ihi,jlo,jhi;

View File

@ -252,8 +252,9 @@ void PairLJClass2CoulLong::settings(int narg, char **arg)
void PairLJClass2CoulLong::coeff(int narg, char **arg)
{
if (narg < 4 || narg > 6)
if (narg < 4 || narg > 5)
error->all(FLERR,"Incorrect args for pair coefficients");
if (!allocated) allocate();
int ilo,ihi,jlo,jhi;

View File

@ -1886,7 +1886,7 @@ void Atom::setup_sort_bins()
// check if neighbor cutoff = 0.0
// and in that case, disable sorting
double binsize;
double binsize = 0.0;
if (userbinsize > 0.0) binsize = userbinsize;
else if (neighbor->cutneighmax > 0.0) binsize = 0.5 * neighbor->cutneighmax;

View File

@ -88,17 +88,15 @@ class Variable : protected Pointers {
int nvector; // length of array for vector-style variable
int nstride; // stride between atoms if array is a 2d array
int selfalloc; // 1 if array is allocated here, else 0
int ivalue1,ivalue2; // extra values for needed for gmask,rmask,grmask
int ivalue1,ivalue2; // extra values needed for gmask,rmask,grmask
int nextra; // # of additional args beyond first 2
Tree *first,*second; // ptrs further down tree for first 2 args
Tree **extra; // ptrs further down tree for nextra args
Tree() :
array(NULL), iarray(NULL), barray(NULL),
selfalloc(0), nextra(0),
first(NULL), second(NULL), extra(NULL)
{
}
selfalloc(0), ivalue1(0), ivalue2(0), nextra(0),
first(NULL), second(NULL), extra(NULL) {}
};
int compute_python(int);