Merge pull request from akohlmey/collected-small-changes

Collected small changes and bugfixes for next patch
This commit is contained in:
Steve Plimpton 2017-11-13 09:00:26 -07:00 committed by GitHub
commit c4c59b909e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
13 changed files with 63 additions and 26 deletions

View File

@ -637,10 +637,10 @@ USER-INTEL, k = KOKKOS, o = USER-OMP, t = OPT.
"rigid/nve (o)"_fix_rigid.html,
"rigid/nvt (o)"_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,
"rigid/small/nph"_fix_rigid.html,
"rigid/small/npt"_fix_rigid.html,
"rigid/small/nve"_fix_rigid.html,
"rigid/small/nvt"_fix_rigid.html,
"setforce (k)"_fix_setforce.html,
"shake"_fix_shake.html,
"spring"_fix_spring.html,

View File

@ -27,8 +27,8 @@ compute 1 all dihedral/local phi :pre
Define a computation that calculates properties of individual dihedral
interactions. The number of datums generated, aggregated across all
processors, equals the number of angles in the system, modified by the
group parameter as explained below.
processors, equals the number of dihedral angles in the system, modified
by the group parameter as explained below.
The value {phi} is the dihedral angle, as defined in the diagram on
the "dihedral_style"_dihedral_style.html doc page.

View File

@ -227,16 +227,18 @@ the sinusoid would appear to be "smoother". Also note the use of the
converts lattice spacings to distance. Click on the image for a
larger version.
dimension 2
variable x equal 100
variable y equal 25
lattice hex 0.8442
region box block 0 $x 0 $y -0.5 0.5
create_box 1 box :pre
variable xx equal 0.0
variable yy equal 0.0
variable xx internal 0.0
variable yy internal 0.0
variable v equal "(0.2*v_y*ylat * cos(v_xx/xlat * 2.0*PI*4.0/v_x) + 0.5*v_y*ylat - v_yy) > 0.0"
create_atoms 1 box var v set x xx set y yy :pre
create_atoms 1 box var v set x xx set y yy
write_dump all atom sinusoid.lammpstrj :pre
:c,image(JPG/sinusoid_small.jpg,JPG/sinusoid.jpg)

View File

@ -7,11 +7,17 @@
:line
fix rigid command :h3
fix rigid/omp command :h3
fix rigid/nve command :h3
fix rigid/nve/omp command :h3
fix rigid/nvt command :h3
fix rigid/nvt/omp command :h3
fix rigid/npt command :h3
fix rigid/npt/omp command :h3
fix rigid/nph command :h3
fix rigid/nph/omp command :h3
fix rigid/small command :h3
fix rigid/small/omp command :h3
fix rigid/nve/small command :h3
fix rigid/nvt/small command :h3
fix rigid/npt/small command :h3
@ -28,7 +34,7 @@ bodystyle = {single} or {molecule} or {group} :l
{molecule} args = none
{custom} args = {i_propname} or {v_varname}
i_propname = an integer property defined via fix property/atom
v_varname = an atom-style or atomfile-style variable
v_varname = an atom-style or atomfile-style variable
{group} args = N groupID1 groupID2 ...
N = # of groups
groupID1, groupID2, ... = list of N group IDs :pre
@ -93,7 +99,7 @@ fix 1 clump rigid custom v_bodyid :pre
fix 0 all property/atom i_bodyid
read_restart data.rigid fix 0 NULL Bodies
fix 1 clump rigid/small custom i_bodyid :pre
[Description:]
Treat one or more sets of atoms as independent rigid bodies. This

View File

@ -14,10 +14,11 @@ print string keyword value :pre
string = text string to print, which may contain variables :ulb,l
zero or more keyword/value pairs may be appended :l
keyword = {file} or {append} or {screen} :l
keyword = {file} or {append} or {screen} or {universe} :l
{file} value = filename
{append} value = filename
{screen} value = {yes} or {no} :pre
{screen} value = {yes} or {no}
{universe} value = {yes} or {no} :pre
:ule
[Examples:]
@ -26,6 +27,7 @@ print "Done with equilibration" file info.dat
print Vol=$v append info.dat screen no
print "The system volume is now $v"
print 'The system volume is now $v'
print "NEB calculation 1 complete" screen no universe yes
print """
System volume = $v
System temperature = $t
@ -49,6 +51,11 @@ it does not exist.
If the {screen} keyword is used, output to the screen and logfile can
be turned on or off as desired.
If the {universe} keyword is used, output to the global screen and
logfile can be turned on or off as desired. In multi-partition
calculations, the {screen} option and the corresponding output only
apply to the screen and logfile of the individual partition.
If you want the print command to be executed multiple times (with
changing variable values), there are 3 options. First, consider using
the "fix print"_fix_print.html command, which will print a string
@ -74,4 +81,4 @@ thermodynamic properties, global values calculated by a
[Default:]
The option defaults are no file output and screen = yes.
The option defaults are no file output, screen = yes, and universe = no.

View File

@ -92,7 +92,7 @@ int lje_gpu_init(const int ntypes, double **cutsq, double **host_lj1,
// ---------------------------------------------------------------------------
// Copy updated coeffs from host to device
// ---------------------------------------------------------------------------
int lje_gpu_reinit(const int ntypes, double **cutsq, double **host_lj1,
void lje_gpu_reinit(const int ntypes, double **cutsq, double **host_lj1,
double **host_lj2, double **host_lj3, double **host_lj4,
double **offset, double **shift) {
int world_me=LJEMF.device->world_me();

View File

@ -43,7 +43,7 @@ int gauss_gpu_init(const int ntypes, double **cutsq, double **host_a,
double **b, double **offset, double *special_lj, const int nlocal,
const int nall, const int max_nbors, const int maxspecial,
const double cell_size, int &gpu_mode, FILE *screen);
int gauss_gpu_reinit(const int ntypes, double **cutsq, double **host_a,
void gauss_gpu_reinit(const int ntypes, double **cutsq, double **host_a,
double **b, double **offset);
void gauss_gpu_clear();
int ** gauss_gpu_compute_n(const int ago, const int inum,

View File

@ -56,7 +56,7 @@ int ljcl_gpu_init(const int ntypes, double **cutsq, double **host_lj1,
double **host_cut_ljsq, double host_cut_coulsq,
double *host_special_coul, const double qqrd2e,
const double g_ewald);
int ljcl_gpu_reinit(const int ntypes, double **cutsq, double **host_lj1,
void ljcl_gpu_reinit(const int ntypes, double **cutsq, double **host_lj1,
double **host_lj2, double **host_lj3, double **host_lj4,
double **offset, double **host_lj_cutsq);
void ljcl_gpu_clear();

View File

@ -45,7 +45,7 @@ int ljl_gpu_init(const int ntypes, double **cutsq, double **host_lj1,
const int nall, const int max_nbors, const int maxspecial,
const double cell_size, int &gpu_mode, FILE *screen);
int ljl_gpu_reinit(const int ntypes, double **cutsq, double **host_lj1,
void ljl_gpu_reinit(const int ntypes, double **cutsq, double **host_lj1,
double **host_lj2, double **host_lj3, double **host_lj4,
double **offset);

View File

@ -45,7 +45,7 @@ int lje_gpu_init(const int ntypes, double **cutsq, double **host_lj1,
const int nlocal, const int nall, const int max_nbors,
const int maxspecial, const double cell_size, int &gpu_mode,
FILE *screen);
int lje_gpu_reinit(const int ntypes, double **cutsq, double **host_lj1,
void lje_gpu_reinit(const int ntypes, double **cutsq, double **host_lj1,
double **host_lj2, double **host_lj3, double **host_lj4,
double **offset, double **shift);
void lje_gpu_clear();

View File

@ -1345,7 +1345,7 @@ int DumpImage::modify_param(int narg, char **arg)
if (atom->nbondtypes == 0)
error->all(FLERR,"Dump modify bdiam not allowed with no bond types");
int nlo,nhi;
force->bounds(FLERR,arg[1],atom->ntypes,nlo,nhi);
force->bounds(FLERR,arg[1],atom->nbondtypes,nlo,nhi);
double diam = force->numeric(FLERR,arg[2]);
if (diam <= 0.0) error->all(FLERR,"Illegal dump_modify command");
for (int i = nlo; i <= nhi; i++) bdiamtype[i] = diam;

View File

@ -115,10 +115,10 @@ void Error::all(const char *file, int line, const char *str)
if (me == 0) {
if (input && input->line) lastcmd = input->line;
if (screen) fprintf(screen,"ERROR: %s (%s:%d)\n"
"Last command: %s\n",
"Last command: %s\n",
str,file,line,lastcmd);
if (logfile) fprintf(logfile,"ERROR: %s (%s:%d)\n"
"Last command: %s\n",
"Last command: %s\n",
str,file,line,lastcmd);
}
@ -152,9 +152,17 @@ void Error::all(const char *file, int line, const char *str)
void Error::one(const char *file, int line, const char *str)
{
int me;
const char *lastcmd = (const char*)"(unknown)";
MPI_Comm_rank(world,&me);
if (screen) fprintf(screen,"ERROR on proc %d: %s (%s:%d)\n",
me,str,file,line);
if (input && input->line) lastcmd = input->line;
if (screen) fprintf(screen,"ERROR on proc %d: %s (%s:%d)\n"
"Last command: %s\n",
me,str,file,line,lastcmd);
if (logfile) fprintf(logfile,"ERROR on proc %d: %s (%s:%d)\n"
"Last command: %s\n",
me,str,file,line,lastcmd);
if (universe->nworlds > 1)
if (universe->uscreen)
fprintf(universe->uscreen,"ERROR on proc %d: %s (%s:%d)\n",

View File

@ -530,8 +530,11 @@ void Input::substitute(char *&str, char *&str2, int &max, int &max2, int flag)
value = variable->retrieve(var);
}
if (value == NULL) error->one(FLERR,"Substitution for illegal variable");
if (value == NULL) {
char str[128];
sprintf(str,"Substitution for illegal variable %s",var);
error->one(FLERR,str);
}
// check if storage in str2 needs to be expanded
// re-initialize ptr and ptr2 to the point beyond the variable.
@ -1172,6 +1175,7 @@ void Input::print()
FILE *fp = NULL;
int screenflag = 1;
int universeflag = 0;
int iarg = 1;
while (iarg < narg) {
@ -1194,6 +1198,12 @@ void Input::print()
else if (strcmp(arg[iarg+1],"no") == 0) screenflag = 0;
else error->all(FLERR,"Illegal print command");
iarg += 2;
} else if (strcmp(arg[iarg],"universe") == 0) {
if (iarg+2 > narg) error->all(FLERR,"Illegal print command");
if (strcmp(arg[iarg+1],"yes") == 0) universeflag = 1;
else if (strcmp(arg[iarg+1],"no") == 0) universeflag = 0;
else error->all(FLERR,"Illegal print command");
iarg += 2;
} else error->all(FLERR,"Illegal print command");
}
@ -1205,6 +1215,10 @@ void Input::print()
fclose(fp);
}
}
if (universeflag && (universe->me == 0)) {
if (universe->uscreen) fprintf(universe->uscreen, "%s\n",line);
if (universe->ulogfile) fprintf(universe->ulogfile,"%s\n",line);
}
}
/* ---------------------------------------------------------------------- */