Skip to content
Snippets Groups Projects
Commit 378c5071 authored by Axel Kohlmeyer's avatar Axel Kohlmeyer
Browse files

protect library interface from issuing lammps commands during run and minimize

parent 776f5887
No related branches found
No related tags found
No related merge requests found
......@@ -203,7 +203,10 @@ void lammps_file(void *ptr, char *str)
BEGIN_CAPTURE
{
lmp->input->file(str);
if (lmp->update->whichflag != 0)
lmp->error->all(FLERR,"Library error: issuing LAMMPS command during run");
else
lmp->input->file(str);
}
END_CAPTURE
}
......@@ -221,7 +224,10 @@ char *lammps_command(void *ptr, char *str)
BEGIN_CAPTURE
{
result = lmp->input->one(str);
if (lmp->update->whichflag != 0)
lmp->error->all(FLERR,"Library error: issuing LAMMPS command during run");
else
result = lmp->input->one(str);
}
END_CAPTURE
......@@ -270,6 +276,13 @@ void lammps_commands_string(void *ptr, char *str)
{
LAMMPS *lmp = (LAMMPS *) ptr;
BEGIN_CAPTURE
{
if (lmp->update->whichflag != 0)
lmp->error->all(FLERR,"Library error: issuing LAMMPS command during run");
}
END_CAPTURE
// make copy of str so can strtok() it
int n = strlen(str) + 1;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment