add flag to disable writing log.cite

This commit is contained in:
Axel Kohlmeyer
2013-07-28 07:30:40 +02:00
parent c1791fc96d
commit 079a3196ac
3 changed files with 8 additions and 2 deletions

View File

@ -45,7 +45,7 @@ CiteMe::CiteMe(LAMMPS *lmp) : Pointers(lmp) {
_pubs = (void *)c;
if ((universe->me == 0) && ((fp = fopen("log.cite","w")))) {
if (lmp->cite_enable && (universe->me == 0) && ((fp = fopen("log.cite","w")))) {
fputs(dashline,fp);
fputs(lammps_version,fp);
fputs(dashline,fp);
@ -86,7 +86,7 @@ void CiteMe::add(const char *ref)
CiteMe::~CiteMe()
{
if (comm->me == 0) {
if (lmp->cite_enable && (comm->me == 0)) {
if (screen)
fputs(nagline,screen);

View File

@ -87,6 +87,7 @@ LAMMPS::LAMMPS(int narg, char **arg, MPI_Comm communicator)
int helpflag = 0;
suffix = NULL;
suffix_enable = 0;
cite_enable = 1;
int iarg = 1;
while (iarg < narg) {
@ -167,6 +168,10 @@ LAMMPS::LAMMPS(int narg, char **arg, MPI_Comm communicator)
error->universe_all(FLERR,"Cannot use -reorder after -partition");
universe->reorder(arg[iarg+1],arg[iarg+2]);
iarg += 3;
} else if (strcmp(arg[iarg],"-nocite") == 0 ||
strcmp(arg[iarg],"-nc") == 0) {
cite_enable = 0;
++iarg;
} else if (strcmp(arg[iarg],"-help") == 0 ||
strcmp(arg[iarg],"-h") == 0) {
if (iarg+1 > narg)

View File

@ -46,6 +46,7 @@ class LAMMPS {
char *suffix; // suffix to add to input script style names
int suffix_enable; // 1 if suffix enabled, 0 if disabled
int cite_enable; // 1 if generating log.cite, 0 if disabled
class Cuda *cuda; // CUDA accelerator class
LAMMPS(int, char **, MPI_Comm);