Merge remote-tracking branch 'lammps-ro/master' into lammps-icms
This commit is contained in:
@ -135,7 +135,7 @@
|
||||
<H1></H1><div class="section" id="lammps-icms-documentation">
|
||||
<h1>LAMMPS-ICMS Documentation</h1>
|
||||
<div class="section" id="aug-2016-version">
|
||||
<h2>13 Aug 2016 version</h2>
|
||||
<h2>20 Aug 2016 version</h2>
|
||||
</div>
|
||||
<div class="section" id="version-info">
|
||||
<h2>Version info:</h2>
|
||||
|
||||
@ -5,7 +5,7 @@
|
||||
LAMMPS Documentation
|
||||
====================
|
||||
|
||||
13 Aug 2016 version
|
||||
20 Aug 2016 version
|
||||
-------------------
|
||||
|
||||
Version info:
|
||||
|
||||
@ -169,6 +169,9 @@ or multiple smaller files).
|
||||
Because periodic boundary conditions are enforced only on
|
||||
timesteps when neighbor lists are rebuilt, the coordinates of an atom
|
||||
written to a dump file may be slightly outside the simulation box.
|
||||
Re-neighbor timesteps will not typically coincide with the timesteps
|
||||
dump snapshots are written. See the :doc:`dump_modify pbc <dump_modify>` command if you with to force coordinates to be
|
||||
strictly inside the simulation box.
|
||||
|
||||
.. note::
|
||||
|
||||
|
||||
@ -36,6 +36,7 @@ Syntax
|
||||
*nfile* arg = Nf
|
||||
Nf = write this many files, one from each of Nf processors
|
||||
*pad* arg = Nchar = # of characters to convert timestep to
|
||||
*pbc* arg = *yes* or *no* = remap atoms via periodic boundary conditions
|
||||
*precision* arg = power-of-10 value from 10 to 1000000
|
||||
*region* arg = region-ID or "none"
|
||||
*scale* arg = *yes* or *no*
|
||||
@ -428,6 +429,21 @@ timestep order.
|
||||
----------
|
||||
|
||||
|
||||
The *pbc* keyword applies to all the dump styles. As explained on the
|
||||
:doc:`dump <dump>` doc page, atom coordinates in a dump file may be
|
||||
slightly outside the simulation box. This is because periodic
|
||||
boundary conditions are enforced only on timesteps when neighbor lists
|
||||
are rebuilt, which will not typically coincide with the timesteps dump
|
||||
snapshots are written. If the setting of this keyword is set to
|
||||
*yes*\ , then all atoms will be remapped to the periodic box before the
|
||||
snapshot is written, then restored to their original position. If it
|
||||
is set to *no* they will not be. The *no* setting is the default
|
||||
because it requires no extra computation.
|
||||
|
||||
|
||||
----------
|
||||
|
||||
|
||||
The *precision* keyword only applies to the dump *xtc* style. A
|
||||
specified value of N means that coordinates are stored to 1/N
|
||||
nanometer accuracy, e.g. for N = 1000, the coordinates are written to
|
||||
@ -846,6 +862,7 @@ The option defaults are
|
||||
* label = ENTRIES
|
||||
* nfile = 1
|
||||
* pad = 0
|
||||
* pbc = no
|
||||
* precision = 1000
|
||||
* region = none
|
||||
* scale = yes
|
||||
|
||||
@ -145,8 +145,9 @@ length. The first value (a scalar or vector) is what is histogrammed
|
||||
into bins, in the same manner the fix ave/histo command operates. The
|
||||
second value (a scalar or vector) is used as a "weight". This means
|
||||
that instead of each value tallying a "1" to its bin, the
|
||||
corresponding weight is tallied. E.g. the Nth entry in the first
|
||||
vector tallies the Nth entry (weight) in the second vector.
|
||||
corresponding weight is tallied. E.g. The Nth entry (weight) in the
|
||||
second vector is tallied to the bin corresponding to the Nth entry in
|
||||
the first vector.
|
||||
|
||||
|
||||
----------
|
||||
|
||||
@ -274,7 +274,10 @@ or multiple smaller files).</p>
|
||||
<p class="first admonition-title">Note</p>
|
||||
<p class="last">Because periodic boundary conditions are enforced only on
|
||||
timesteps when neighbor lists are rebuilt, the coordinates of an atom
|
||||
written to a dump file may be slightly outside the simulation box.</p>
|
||||
written to a dump file may be slightly outside the simulation box.
|
||||
Re-neighbor timesteps will not typically coincide with the timesteps
|
||||
dump snapshots are written. See the <a class="reference internal" href="dump_modify.html"><span class="doc">dump_modify pbc</span></a> command if you with to force coordinates to be
|
||||
strictly inside the simulation box.</p>
|
||||
</div>
|
||||
<div class="admonition note">
|
||||
<p class="first admonition-title">Note</p>
|
||||
|
||||
@ -158,6 +158,7 @@
|
||||
<em>nfile</em> arg = Nf
|
||||
Nf = write this many files, one from each of Nf processors
|
||||
<em>pad</em> arg = Nchar = # of characters to convert timestep to
|
||||
<em>pbc</em> arg = <em>yes</em> or <em>no</em> = remap atoms via periodic boundary conditions
|
||||
<em>precision</em> arg = power-of-10 value from 10 to 1000000
|
||||
<em>region</em> arg = region-ID or "none"
|
||||
<em>scale</em> arg = <em>yes</em> or <em>no</em>
|
||||
@ -468,6 +469,17 @@ yield 0000100, 0012000, 2000000. This can be useful so that
|
||||
post-processing programs can easily read the files in ascending
|
||||
timestep order.</p>
|
||||
<hr class="docutils" />
|
||||
<p>The <em>pbc</em> keyword applies to all the dump styles. As explained on the
|
||||
<a class="reference internal" href="dump.html"><span class="doc">dump</span></a> doc page, atom coordinates in a dump file may be
|
||||
slightly outside the simulation box. This is because periodic
|
||||
boundary conditions are enforced only on timesteps when neighbor lists
|
||||
are rebuilt, which will not typically coincide with the timesteps dump
|
||||
snapshots are written. If the setting of this keyword is set to
|
||||
<em>yes</em>, then all atoms will be remapped to the periodic box before the
|
||||
snapshot is written, then restored to their original position. If it
|
||||
is set to <em>no</em> they will not be. The <em>no</em> setting is the default
|
||||
because it requires no extra computation.</p>
|
||||
<hr class="docutils" />
|
||||
<p>The <em>precision</em> keyword only applies to the dump <em>xtc</em> style. A
|
||||
specified value of N means that coordinates are stored to 1/N
|
||||
nanometer accuracy, e.g. for N = 1000, the coordinates are written to
|
||||
@ -790,6 +802,7 @@ images less frequently.</p>
|
||||
<li>label = ENTRIES</li>
|
||||
<li>nfile = 1</li>
|
||||
<li>pad = 0</li>
|
||||
<li>pbc = no</li>
|
||||
<li>precision = 1000</li>
|
||||
<li>region = none</li>
|
||||
<li>scale = yes</li>
|
||||
|
||||
@ -254,8 +254,9 @@ length. The first value (a scalar or vector) is what is histogrammed
|
||||
into bins, in the same manner the fix ave/histo command operates. The
|
||||
second value (a scalar or vector) is used as a “weight”. This means
|
||||
that instead of each value tallying a “1” to its bin, the
|
||||
corresponding weight is tallied. E.g. the Nth entry in the first
|
||||
vector tallies the Nth entry (weight) in the second vector.</p>
|
||||
corresponding weight is tallied. E.g. The Nth entry (weight) in the
|
||||
second vector is tallied to the bin corresponding to the Nth entry in
|
||||
the first vector.</p>
|
||||
<hr class="docutils" />
|
||||
<p>The <em>Nevery</em>, <em>Nrepeat</em>, and <em>Nfreq</em> arguments specify on what
|
||||
timesteps the input values will be used in order to contribute to the
|
||||
|
||||
File diff suppressed because one or more lines are too long
@ -1,7 +1,7 @@
|
||||
<!-- HTML_ONLY -->
|
||||
<HEAD>
|
||||
<TITLE>LAMMPS-ICMS Users Manual</TITLE>
|
||||
<META NAME="docnumber" CONTENT="13 Aug 2016 version">
|
||||
<META NAME="docnumber" CONTENT="20 Aug 2016 version">
|
||||
<META NAME="author" CONTENT="http://lammps.sandia.gov - Sandia National Laboratories">
|
||||
<META NAME="copyright" CONTENT="Copyright (2003) Sandia Corporation. This software and manual is distributed under the GNU General Public License.">
|
||||
</HEAD>
|
||||
@ -21,7 +21,7 @@
|
||||
<H1></H1>
|
||||
|
||||
LAMMPS-ICMS Documentation :c,h3
|
||||
13 Aug 2016 version :c,h4
|
||||
20 Aug 2016 version :c,h4
|
||||
|
||||
Version info: :h4
|
||||
|
||||
|
||||
@ -130,6 +130,10 @@ or multiple smaller files).
|
||||
NOTE: Because periodic boundary conditions are enforced only on
|
||||
timesteps when neighbor lists are rebuilt, the coordinates of an atom
|
||||
written to a dump file may be slightly outside the simulation box.
|
||||
Re-neighbor timesteps will not typically coincide with the timesteps
|
||||
dump snapshots are written. See the "dump_modify
|
||||
pbc"_dump_modify.html command if you with to force coordinates to be
|
||||
strictly inside the simulation box.
|
||||
|
||||
NOTE: Unless the "dump_modify sort"_dump_modify.html option is
|
||||
invoked, the lines of atom information written to dump files
|
||||
|
||||
@ -36,6 +36,7 @@ keyword = {append} or {buffer} or {element} or {every} or {fileper} or {first} o
|
||||
{nfile} arg = Nf
|
||||
Nf = write this many files, one from each of Nf processors
|
||||
{pad} arg = Nchar = # of characters to convert timestep to
|
||||
{pbc} arg = {yes} or {no} = remap atoms via periodic boundary conditions
|
||||
{precision} arg = power-of-10 value from 10 to 1000000
|
||||
{region} arg = region-ID or "none"
|
||||
{scale} arg = {yes} or {no}
|
||||
@ -377,6 +378,19 @@ timestep order.
|
||||
|
||||
:line
|
||||
|
||||
The {pbc} keyword applies to all the dump styles. As explained on the
|
||||
"dump"_dump.html doc page, atom coordinates in a dump file may be
|
||||
slightly outside the simulation box. This is because periodic
|
||||
boundary conditions are enforced only on timesteps when neighbor lists
|
||||
are rebuilt, which will not typically coincide with the timesteps dump
|
||||
snapshots are written. If the setting of this keyword is set to
|
||||
{yes}, then all atoms will be remapped to the periodic box before the
|
||||
snapshot is written, then restored to their original position. If it
|
||||
is set to {no} they will not be. The {no} setting is the default
|
||||
because it requires no extra computation.
|
||||
|
||||
:line
|
||||
|
||||
The {precision} keyword only applies to the dump {xtc} style. A
|
||||
specified value of N means that coordinates are stored to 1/N
|
||||
nanometer accuracy, e.g. for N = 1000, the coordinates are written to
|
||||
@ -755,6 +769,7 @@ image = no
|
||||
label = ENTRIES
|
||||
nfile = 1
|
||||
pad = 0
|
||||
pbc = no
|
||||
precision = 1000
|
||||
region = none
|
||||
scale = yes
|
||||
|
||||
@ -136,8 +136,9 @@ length. The first value (a scalar or vector) is what is histogrammed
|
||||
into bins, in the same manner the fix ave/histo command operates. The
|
||||
second value (a scalar or vector) is used as a "weight". This means
|
||||
that instead of each value tallying a "1" to its bin, the
|
||||
corresponding weight is tallied. E.g. the Nth entry in the first
|
||||
vector tallies the Nth entry (weight) in the second vector.
|
||||
corresponding weight is tallied. E.g. The Nth entry (weight) in the
|
||||
second vector is tallied to the bin corresponding to the Nth entry in
|
||||
the first vector.
|
||||
|
||||
:line
|
||||
|
||||
|
||||
75
src/dump.cpp
75
src/dump.cpp
@ -81,7 +81,8 @@ Dump::Dump(LAMMPS *lmp, int narg, char **arg) : Pointers(lmp)
|
||||
buffer_allow = 0;
|
||||
buffer_flag = 0;
|
||||
padflag = 0;
|
||||
|
||||
pbcflag = 0;
|
||||
|
||||
maxbuf = maxids = maxsort = maxproc = 0;
|
||||
buf = bufsort = NULL;
|
||||
ids = idsort = NULL;
|
||||
@ -91,6 +92,10 @@ Dump::Dump(LAMMPS *lmp, int narg, char **arg) : Pointers(lmp)
|
||||
maxsbuf = 0;
|
||||
sbuf = NULL;
|
||||
|
||||
maxpbc = 0;
|
||||
xpbc = vpbc = NULL;
|
||||
imagepbc = NULL;
|
||||
|
||||
// parse filename for special syntax
|
||||
// if contains '%', write one file per proc and replace % with proc-ID
|
||||
// if contains '*', write one file per timestep and replace * with timestep
|
||||
@ -163,7 +168,13 @@ Dump::~Dump()
|
||||
delete irregular;
|
||||
|
||||
memory->destroy(sbuf);
|
||||
|
||||
|
||||
if (pbcflag) {
|
||||
memory->destroy(xpbc);
|
||||
memory->destroy(vpbc);
|
||||
memory->destroy(imagepbc);
|
||||
}
|
||||
|
||||
if (multiproc) MPI_Comm_free(&clustercomm);
|
||||
|
||||
// XTC style sets fp to NULL since it closes file in its destructor
|
||||
@ -262,6 +273,10 @@ void Dump::init()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// preallocation for PBC copies if requested
|
||||
|
||||
if (pbcflag && atom->nlocal > maxpbc) pbc_allocate();
|
||||
}
|
||||
|
||||
/* ---------------------------------------------------------------------- */
|
||||
@ -283,6 +298,9 @@ int Dump::count()
|
||||
|
||||
void Dump::write()
|
||||
{
|
||||
imageint *imagehold;
|
||||
double **xhold,**vhold;
|
||||
|
||||
// if file per timestep, open new file
|
||||
|
||||
if (multifile) openfile();
|
||||
@ -352,6 +370,25 @@ void Dump::write()
|
||||
memory->create(ids,maxids,"dump:ids");
|
||||
}
|
||||
|
||||
// apply PBC on copy of x,v,image if requested
|
||||
|
||||
if (pbcflag) {
|
||||
int nlocal = atom->nlocal;
|
||||
if (nlocal > maxpbc) pbc_allocate();
|
||||
if (nlocal) {
|
||||
memcpy(&xpbc[0][0],&atom->x[0][0],3*nlocal*sizeof(double));
|
||||
memcpy(&vpbc[0][0],&atom->v[0][0],3*nlocal*sizeof(double));
|
||||
memcpy(imagepbc,atom->image,nlocal*sizeof(imageint));
|
||||
}
|
||||
xhold = atom->x;
|
||||
vhold = atom->v;
|
||||
imagehold = atom->image;
|
||||
atom->x = xpbc;
|
||||
atom->v = vpbc;
|
||||
atom->image = imagepbc;
|
||||
domain->pbc();
|
||||
}
|
||||
|
||||
// pack my data into buf
|
||||
// if sorting on IDs also request ID list from pack()
|
||||
// sort buf as needed
|
||||
@ -430,6 +467,14 @@ void Dump::write()
|
||||
}
|
||||
}
|
||||
|
||||
// restore original x,v,image unaltered by PBC
|
||||
|
||||
if (pbcflag) {
|
||||
atom->x = xhold;
|
||||
atom->v = vhold;
|
||||
atom->image = imagehold;
|
||||
}
|
||||
|
||||
// if file per timestep, close file if I am filewriter
|
||||
|
||||
if (multifile) {
|
||||
@ -887,6 +932,13 @@ void Dump::modify_params(int narg, char **arg)
|
||||
if (padflag < 0) error->all(FLERR,"Illegal dump_modify command");
|
||||
iarg += 2;
|
||||
|
||||
} else if (strcmp(arg[iarg],"pbc") == 0) {
|
||||
if (iarg+2 > narg) error->all(FLERR,"Illegal dump_modify command");
|
||||
if (strcmp(arg[iarg+1],"yes") == 0) pbcflag = 1;
|
||||
else if (strcmp(arg[iarg+1],"no") == 0) pbcflag = 0;
|
||||
else error->all(FLERR,"Illegal dump_modify command");
|
||||
iarg += 2;
|
||||
|
||||
} else if (strcmp(arg[iarg],"sort") == 0) {
|
||||
if (iarg+2 > narg) error->all(FLERR,"Illegal dump_modify command");
|
||||
if (strcmp(arg[iarg+1],"off") == 0) sort_flag = 0;
|
||||
@ -919,6 +971,21 @@ void Dump::modify_params(int narg, char **arg)
|
||||
return # of bytes of allocated memory
|
||||
------------------------------------------------------------------------- */
|
||||
|
||||
void Dump::pbc_allocate()
|
||||
{
|
||||
memory->destroy(xpbc);
|
||||
memory->destroy(vpbc);
|
||||
memory->destroy(imagepbc);
|
||||
maxpbc = atom->nmax;
|
||||
memory->create(xpbc,maxpbc,3,"dump:xbpc");
|
||||
memory->create(vpbc,maxpbc,3,"dump:vbpc");
|
||||
memory->create(imagepbc,maxpbc,"dump:imagebpc");
|
||||
}
|
||||
|
||||
/* ----------------------------------------------------------------------
|
||||
return # of bytes of allocated memory
|
||||
------------------------------------------------------------------------- */
|
||||
|
||||
bigint Dump::memory_usage()
|
||||
{
|
||||
bigint bytes = memory->usage(buf,size_one*maxbuf);
|
||||
@ -931,5 +998,9 @@ bigint Dump::memory_usage()
|
||||
bytes += memory->usage(proclist,maxproc);
|
||||
if (irregular) bytes += irregular->memory_usage();
|
||||
}
|
||||
if (pbcflag) {
|
||||
bytes += 6*maxpbc * sizeof(double);
|
||||
bytes += maxpbc * sizeof(imageint);
|
||||
}
|
||||
return bytes;
|
||||
}
|
||||
|
||||
@ -71,6 +71,7 @@ class Dump : protected Pointers {
|
||||
int buffer_allow; // 1 if style allows for buffer_flag, 0 if not
|
||||
int buffer_flag; // 1 if buffer output as one big string, 0 if not
|
||||
int padflag; // timestep padding in filename
|
||||
int pbcflag; // 1 if remap dumped atoms via PBC, 0 if not
|
||||
int singlefile_opened; // 1 = one big file, already opened, else 0
|
||||
int sortcol; // 0 to sort on ID, 1-N on columns
|
||||
int sortcolm1; // sortcol - 1
|
||||
@ -116,6 +117,10 @@ class Dump : protected Pointers {
|
||||
tagint *idsort;
|
||||
int *index,*proclist;
|
||||
|
||||
double **xpbc,**vpbc;
|
||||
int *imagepbc;
|
||||
int maxpbc;
|
||||
|
||||
class Irregular *irregular;
|
||||
|
||||
virtual void init_style() = 0;
|
||||
@ -126,7 +131,8 @@ class Dump : protected Pointers {
|
||||
virtual void pack(tagint *) = 0;
|
||||
virtual int convert_string(int, double *) {return 0;}
|
||||
virtual void write_data(int, double *) = 0;
|
||||
|
||||
void pbc_allocate();
|
||||
|
||||
void sort();
|
||||
static int idcompare(const void *, const void *);
|
||||
static int bufcompare(const void *, const void *);
|
||||
|
||||
@ -1 +1 @@
|
||||
#define LAMMPS_VERSION "13 Aug 2016"
|
||||
#define LAMMPS_VERSION "20 Aug 2016"
|
||||
|
||||
Reference in New Issue
Block a user