293
294
/* ---------------------------------------------------------------------- */
295
void Update::create_integrate(int narg, char **arg, char *suffix)
296
void Update::create_integrate(int narg, char **arg, int trysuffix)
297
298
if (narg < 1) error->all(FLERR,"Illegal run_style command");
300
301
delete integrate;
303
new_integrate(arg[0],narg-1,&arg[1],suffix,sflag);
304
new_integrate(arg[0],narg-1,&arg[1],trysuffix,sflag);
306
307
char estyle[256];
307
sprintf(estyle,"%s/%s",arg[0],suffix);
308
if (sflag == 1) sprintf(estyle,"%s/%s",arg[0],lmp->suffix);
309
else sprintf(estyle,"%s/%s",arg[0],lmp->suffix2);
308
310
int n = strlen(estyle) + 1;
309
311
integrate_style = new char[n];
310
312
strcpy(integrate_style,estyle);
320
322
------------------------------------------------------------------------- */
322
324
void Update::new_integrate(char *style, int narg, char **arg,
323
char *suffix, int &sflag)
325
int trysuffix, int &sflag)
327
if (suffix && lmp->suffix_enable) {
330
sprintf(estyle,"%s/%s",style,suffix);
335
#define INTEGRATE_CLASS
336
#define IntegrateStyle(key,Class) \
337
else if (strcmp(estyle,#key) == 0) integrate = new Class(lmp,narg,arg);
338
#include "style_integrate.h"
339
#undef IntegrateStyle
340
#undef INTEGRATE_CLASS
350
#define INTEGRATE_CLASS
351
#define IntegrateStyle(key,Class) \
352
else if (strcmp(style,#key) == 0) integrate = new Class(lmp,narg,arg);
353
#include "style_integrate.h"
354
#undef IntegrateStyle
355
#undef INTEGRATE_CLASS
357
else error->all(FLERR,"Illegal integrate style");
327
if (trysuffix && lmp->suffix_enable) {
331
sprintf(estyle,"%s/%s",style,lmp->suffix);
336
#define INTEGRATE_CLASS
337
#define IntegrateStyle(key,Class) \
338
else if (strcmp(estyle,#key) == 0) integrate = new Class(lmp,narg,arg);
339
#include "style_integrate.h"
340
#undef IntegrateStyle
341
#undef INTEGRATE_CLASS
350
sprintf(estyle,"%s/%s",style,lmp->suffix2);
355
#define INTEGRATE_CLASS
356
#define IntegrateStyle(key,Class) \
357
else if (strcmp(estyle,#key) == 0) integrate = new Class(lmp,narg,arg);
358
#include "style_integrate.h"
359
#undef IntegrateStyle
360
#undef INTEGRATE_CLASS
370
#define INTEGRATE_CLASS
371
#define IntegrateStyle(key,Class) \
372
else if (strcmp(style,#key) == 0) integrate = new Class(lmp,narg,arg);
373
#include "style_integrate.h"
374
#undef IntegrateStyle
375
#undef INTEGRATE_CLASS
377
else error->all(FLERR,"Illegal integrate style");
361
380
/* ---------------------------------------------------------------------- */
389
408
void Update::reset_timestep(int narg, char **arg)
391
410
if (narg != 1) error->all(FLERR,"Illegal reset_timestep command");
392
bigint newstep = ATOBIGINT(arg[0]);
411
bigint newstep = force->bnumeric(FLERR,arg[0]);
393
412
reset_timestep(newstep);
396
415
/* ----------------------------------------------------------------------
398
set atimestep to new timestep, so future update_time() calls will be correct
399
trigger reset of timestep for output and for fixes that require it
400
do not allow any timestep-dependent fixes to be defined
401
reset eflag/vflag global so nothing will think eng/virial are current
402
reset invoked flags of computes,
403
so nothing will think they are current between runs
404
clear timestep list of computes that store future invocation times
405
417
called from rerun command and input script (indirectly)
406
418
------------------------------------------------------------------------- */
411
423
if (ntimestep < 0) error->all(FLERR,"Timestep must be >= 0");
412
424
if (ntimestep > MAXBIGINT) error->all(FLERR,"Too big a timestep");
426
// set atimestep to new timestep
427
// so future update_time() calls will be correct
414
429
atimestep = ntimestep;
431
// trigger reset of timestep for output and for fixes that require it
432
// do not allow any timestep-dependent fixes to be already defined
416
434
output->reset_timestep(ntimestep);
418
436
for (int i = 0; i < modify->nfix; i++) {
422
440
modify->fix[i]->reset_timestep(ntimestep);
443
// reset eflag/vflag global so no commands will think eng/virial are current
425
445
eflag_global = vflag_global = -1;
447
// reset invoked flags of computes,
448
// so no commands will think they are current between runs
427
450
for (int i = 0; i < modify->ncompute; i++) {
428
451
modify->compute[i]->invoked_scalar = -1;
429
452
modify->compute[i]->invoked_vector = -1;
432
455
modify->compute[i]->invoked_local = -1;
458
// clear timestep list of computes that store future invocation times
435
460
for (int i = 0; i < modify->ncompute; i++)
436
461
if (modify->compute[i]->timeflag) modify->compute[i]->clearstep();
463
// set last_build of all neigh lists to -1 to force rebuild
465
for (int i = 0; i < neighbor->nlist; i++)
466
neighbor->lists[i]->last_build = -1;
438
468
// NOTE: 7Jun12, adding rerun command, don't think this is required
440
470
//for (int i = 0; i < domain->nregion; i++)