1 /* ---------------------------------------------------------------------- 2 This is the 3 4 ██╗ ██╗ ██████╗ ██████╗ ██████╗ ██╗ ██╗████████╗███████╗ 5 ██║ ██║██╔════╝ ██╔════╝ ██╔════╝ ██║ ██║╚══██╔══╝██╔════╝ 6 ██║ ██║██║ ███╗██║ ███╗██║ ███╗███████║ ██║ ███████╗ 7 ██║ ██║██║ ██║██║ ██║██║ ██║██╔══██║ ██║ ╚════██║ 8 ███████╗██║╚██████╔╝╚██████╔╝╚██████╔╝██║ ██║ ██║ ███████║ 9 ╚══════╝╚═╝ ╚═════╝ ╚═════╝ ╚═════╝ ╚═╝ ╚═╝ ╚═╝ ╚══════╝® 10 11 DEM simulation engine, released by 12 DCS Computing Gmbh, Linz, Austria 13 http://www.dcs-computing.com, office@dcs-computing.com 14 15 LIGGGHTS® is part of CFDEM®project: 16 http://www.liggghts.com | http://www.cfdem.com 17 18 Core developer and main author: 19 Christoph Kloss, christoph.kloss@dcs-computing.com 20 21 LIGGGHTS® is open-source, distributed under the terms of the GNU Public 22 License, version 2 or later. It is distributed in the hope that it will 23 be useful, but WITHOUT ANY WARRANTY; without even the implied warranty 24 of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. You should have 25 received a copy of the GNU General Public License along with LIGGGHTS®. 26 If not, see http://www.gnu.org/licenses . See also top-level README 27 and LICENSE files. 28 29 LIGGGHTS® and CFDEM® are registered trade marks of DCS Computing GmbH, 30 the producer of the LIGGGHTS® software and the CFDEM®coupling software 31 See http://www.cfdem.com/terms-trademark-policy for details. 32 33 ------------------------------------------------------------------------- 34 Contributing author and copyright for this file: 35 This file is from LAMMPS 36 LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator 37 http://lammps.sandia.gov, Sandia National Laboratories 38 Steve Plimpton, sjplimp@sandia.gov 39 40 Copyright (2003) Sandia Corporation. Under the terms of Contract 41 DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains 42 certain rights in this software. This software is distributed under 43 the GNU General Public License. 44 ------------------------------------------------------------------------- */ 45 46 #ifndef LMP_UPDATE_H 47 #define LMP_UPDATE_H 48 49 #include "pointers.h" 50 51 namespace LAMMPS_NS { 52 53 class Update : protected Pointers { 54 public: 55 double dt; // timestep 56 double etol,ftol; // minimizer tolerances on energy/force 57 bigint ntimestep; // current step (dynamics or min iterations) 58 bool ntimestep_reset_since_last_run; 59 bool timestep_set; // flag if time-step set since simulation start (object created) 60 int nsteps; // # of steps to run (dynamics or min iter) 61 int whichflag; // 0 for unset, 1 for dynamics, 2 for min 62 double atime; // simulation time at atime_step 63 bigint atimestep; // last timestep atime was updated 64 bigint firststep,laststep; // 1st & last step of this run 65 bigint beginstep,endstep; // 1st and last step of multiple runs 66 int first_update; // 0 before initial update, 1 after 67 int max_eval; // max force evaluations for minimizer 68 int restrict_output; // 1 if output should not write dump/restart 69 int setupflag; // set when setup() is computing forces 70 int multireplica; // 1 if min across replicas, else 0 71 72 bigint eflag_global,eflag_atom; // timestep global/peratom eng is tallied on 73 bigint vflag_global,vflag_atom; // ditto for virial 74 75 char *unit_style; 76 77 class Integrate *integrate; 78 char *integrate_style; 79 80 class Min *minimize; 81 char *minimize_style; 82 83 Update(class LAMMPS *); 84 ~Update(); 85 void init(); 86 void set_units(const char *); 87 void create_integrate(int, char **, char *); 88 void create_minimize(int, char **); 89 void reset_timestep(int, char **); 90 void reset_timestep(bigint); 91 void update_time(); 92 bigint memory_usage(); 93 set_force_dt_reset(bool value)94 void set_force_dt_reset(bool value) 95 { force_dt_reset_ = value; } 96 get_cur_time()97 double get_cur_time() const 98 { return atime + (ntimestep - atimestep)*dt; } 99 100 private: 101 void new_integrate(char *, int, char **, char *, int &); 102 103 bool force_dt_reset_; 104 }; 105 106 } 107 108 #endif 109 110 /* ERROR/WARNING messages: 111 112 E: USER-CUDA mode requires CUDA variant of run style 113 114 CUDA mode is enabled, so the run style must include a cuda suffix. 115 116 E: USER-CUDA mode requires CUDA variant of min style 117 118 CUDA mode is enabled, so the min style must include a cuda suffix. 119 120 E: Illegal ... command 121 122 Self-explanatory. Check the input script syntax and compare to the 123 documentation for the command. You can use -echo screen as a 124 command-line option when running LAMMPS to see the offending line. 125 126 E: Illegal integrate style 127 128 Self-explanatory. 129 130 E: Timestep must be >= 0 131 132 Specified timestep is invalid. 133 134 E: Too big a timestep 135 136 Specified timestep is too large. 137 138 E: Cannot reset timestep with a time-dependent fix defined 139 140 You cannot reset the timestep when a fix that keeps track of elapsed 141 time is in place. 142 143 E: Cannot reset timestep with a dynamic region defined 144 145 Dynamic regions (see the region command) have a time dependence. 146 Thus you cannot change the timestep when one or more of these 147 are defined. 148 149 */ 150