git-svn-id: svn://svn.icms.temple.edu/lammps-ro/trunk@15250 f3b2605a-c512-4ea7-a41b-209d697bcdaa

This commit is contained in:
sjplimp
2016-07-01 23:31:09 +00:00
parent a99c922a14
commit 88812c44fb
9 changed files with 40 additions and 6 deletions

View File

@ -87,9 +87,10 @@ ComputeRigidLocal::ComputeRigidLocal(LAMMPS *lmp, int narg, char **arg) :
else error->all(FLERR,"Invalid keyword in compute rigid/local command");
}
nmax = 0;
ncount = nmax = 0;
vector = NULL;
array = NULL;
fixrigid = NULL;
}
/* ---------------------------------------------------------------------- */

View File

@ -64,6 +64,7 @@ enum { CONST, EQUAL }; // For treating the variables.
static const char* cite_fix_nve_manifold_rattle =
"fix nve/manifold/rattle command:\n\n"
"@article{paquay-2016,\n"
" author = {Paquay, Stefan and Kusters, Remy},\n"
" doi = {10.1016/j.bpj.2016.02.017},\n"
" issn = {0006-3495},\n"

View File

@ -66,6 +66,7 @@ enum {NOBIAS,BIAS};
static const char* cite_fix_nvt_manifold_rattle =
"fix nvt/manifold/rattle command:\n\n"
"@article{paquay-2016,\n"
" author = {Paquay, Stefan and Kusters, Remy},\n"
" doi = {10.1016/j.bpj.2016.02.017},\n"
" issn = {0006-3495},\n"

View File

@ -1705,6 +1705,8 @@ void ReadData::pairIJcoeffs()
void ReadData::bondcoeffs()
{
if (!nbondtypes) return;
char *next;
char *buf = new char[nbondtypes*MAXLINE];
@ -1727,6 +1729,8 @@ void ReadData::bondcoeffs()
void ReadData::anglecoeffs(int which)
{
if (!nangletypes) return;
char *next;
char *buf = new char[nangletypes*MAXLINE];
@ -1751,6 +1755,8 @@ void ReadData::anglecoeffs(int which)
void ReadData::dihedralcoeffs(int which)
{
if (!ndihedraltypes) return;
char *next;
char *buf = new char[ndihedraltypes*MAXLINE];
@ -1778,6 +1784,8 @@ void ReadData::dihedralcoeffs(int which)
void ReadData::impropercoeffs(int which)
{
if (!nimpropertypes) return;
char *next;
char *buf = new char[nimpropertypes*MAXLINE];

View File

@ -55,7 +55,7 @@ using namespace MathConst;
// customize a new keyword by adding to this list:
// step, elapsed, elaplong, dt, time, cpu, tpcpu, spcpu, cpuremain, part
// step, elapsed, elaplong, dt, time, cpu, tpcpu, spcpu, cpuremain, part, timeremain
// atoms, temp, press, pe, ke, etotal, enthalpy
// evdwl, ecoul, epair, ebond, eangle, edihed, eimp, emol, elong, etail
// vol, density, lx, ly, lz, xlo, xhi, ylo, yhi, zlo, zhi, xy, xz, yz,
@ -672,6 +672,8 @@ void Thermo::parse_fields(char *str)
addfield("CPULeft",&Thermo::compute_cpuremain,FLOAT);
} else if (strcmp(word,"part") == 0) {
addfield("Part",&Thermo::compute_part,INT);
} else if (strcmp(word,"timeremain") == 0) {
addfield("TimeoutLeft",&Thermo::compute_timeremain,FLOAT);
} else if (strcmp(word,"atoms") == 0) {
addfield("Atoms",&Thermo::compute_atoms,BIGINT);
@ -1069,6 +1071,10 @@ int Thermo::evaluate_keyword(char *word, double *answer)
compute_part();
dvalue = ivalue;
} else if (strcmp(word,"timeremain") == 0) {
compute_timeremain();
} else if (strcmp(word,"atoms") == 0) {
compute_atoms();
dvalue = bivalue;
@ -1598,6 +1604,13 @@ void Thermo::compute_part()
/* ---------------------------------------------------------------------- */
void Thermo::compute_timeremain()
{
dvalue = timer->get_timeout_remain();
}
/* ---------------------------------------------------------------------- */
void Thermo::compute_atoms()
{
bivalue = atom->natoms;

View File

@ -127,6 +127,7 @@ class Thermo : protected Pointers {
void compute_spcpu();
void compute_cpuremain();
void compute_part();
void compute_timeremain();
void compute_atoms();
void compute_temp();

View File

@ -263,6 +263,12 @@ bool Timer::_check_timeout()
}
}
/* ---------------------------------------------------------------------- */
double Timer::get_timeout_remain()
{
return (_timeout < 0.0) ? 0.0 : _timeout + timeout_start - MPI_Wtime();
}
/* ----------------------------------------------------------------------
modify parameters of the Timer class
------------------------------------------------------------------------- */

View File

@ -66,6 +66,9 @@ class Timer : protected Pointers {
// trigger enforced timeout
void force_timeout() { _timeout = 0.0; };
// get remaining time in seconds. 0.0 if inactive, negative if expired
double get_timeout_remain();
// print timeout message
void print_timeout(FILE *);

View File

@ -286,19 +286,19 @@ void WriteData::force_fields()
force->pair->write_data_all(fp);
}
}
if (force->bond && force->bond->writedata) {
if (force->bond && force->bond->writedata && atom->nbondtypes) {
fprintf(fp,"\nBond Coeffs # %s\n\n", force->bond_style);
force->bond->write_data(fp);
}
if (force->angle && force->angle->writedata) {
if (force->angle && force->angle->writedata && atom->nangletypes) {
fprintf(fp,"\nAngle Coeffs # %s\n\n", force->angle_style);
force->angle->write_data(fp);
}
if (force->dihedral && force->dihedral->writedata) {
if (force->dihedral && force->dihedral->writedata && atom->ndihedraltypes) {
fprintf(fp,"\nDihedral Coeffs # %s\n\n", force->dihedral_style);
force->dihedral->write_data(fp);
}
if (force->improper && force->improper->writedata) {
if (force->improper && force->improper->writedata && atom->nimpropertypes) {
fprintf(fp,"\nImproper Coeffs # %s\n\n", force->improper_style);
force->improper->write_data(fp);
}