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 #ifdef INTEGRATE_CLASS
47 
48 IntegrateStyle(respa,Respa)
49 
50 #else
51 
52 #ifndef LMP_RESPA_H
53 #define LMP_RESPA_H
54 
55 #include "integrate.h"
56 
57 namespace LAMMPS_NS {
58 
59 class Respa : public Integrate {
60  public:
61                           // public so Fixes, Pairs, Neighbor can see them
62   int nlevels;            // number of rRESPA levels
63                           // 0 = innermost level, nlevels-1 = outermost level
64   double *step;           // timestep at each level
65   int *loop;              // sub-cycling factor at each level
66   double cutoff[4];       // cutoff[0] and cutoff[1] = between inner and middle
67                           // cutoff[2] and cutoff[3] = between middle and outer
68                           // if no middle then 0,1 = 2,3
69 
70   int level_bond,level_angle,level_dihedral;   // level to compute forces at
71   int level_improper,level_pair,level_kspace;
72   int level_inner,level_middle,level_outer;
73 
74   Respa(class LAMMPS *, int, char **);
75   virtual ~Respa();
76   virtual void init();
77   virtual void setup();
78   virtual void setup_minimal(int);
79   virtual void run(int);
80   virtual void cleanup();
81   virtual void reset_dt();
82 
83   void copy_f_flevel(int);
84   void copy_flevel_f(int);
85 
86  protected:
87   int triclinic;                    // 0 if domain is orthog, 1 if triclinic
88   int torqueflag,erforceflag;
89   int e_flag,rho_flag;
90 
91   int *newton;                      // newton flag at each level
92   class FixRespa *fix_respa;        // Fix to store the force level array
93 
94   virtual void recurse(int);
95   void force_clear(int);
96   void sum_flevel_f();
97 };
98 
99 }
100 
101 #endif
102 #endif
103 
104 /* ERROR/WARNING messages:
105 
106 E: Illegal ... command
107 
108 Self-explanatory.  Check the input script syntax and compare to the
109 documentation for the command.  You can use -echo screen as a
110 command-line option when running LAMMPS to see the offending line.
111 
112 E: Respa levels must be >= 1
113 
114 Self-explanatory.
115 
116 E: Cannot set both respa pair and inner/middle/outer
117 
118 In the rRESPA integrator, you must compute pairwise potentials either
119 all together (pair), or in pieces (inner/middle/outer).  You can't do
120 both.
121 
122 E: Must set both respa inner and outer
123 
124 Cannot use just the inner or outer option with respa without using the
125 other.
126 
127 E: Cannot set respa middle without inner/outer
128 
129 In the rRESPA integrator, you must define both a inner and outer
130 setting in order to use a middle setting.
131 
132 E: Invalid order of forces within respa levels
133 
134 For respa, ordering of force computations within respa levels must
135 obey certain rules.  E.g. bonds cannot be compute less frequently than
136 angles, pairwise forces cannot be computed less frequently than
137 kspace, etc.
138 
139 W: One or more respa levels compute no forces
140 
141 This is computationally inefficient.
142 
143 E: Respa inner cutoffs are invalid
144 
145 The first cutoff must be <= the second cutoff.
146 
147 E: Respa middle cutoffs are invalid
148 
149 The first cutoff must be <= the second cutoff.
150 
151 W: No fixes defined, atoms won't move
152 
153 If you are not using a fix like nve, nvt, npt then atom velocities and
154 coordinates will not be updated during timestepping.
155 
156 W: Fix shake with rRESPA computes invalid pressures
157 
158 This is a known bug in LAMMPS that has not yet been fixed.  If you use
159 SHAKE with rRESPA and perform a constant volume simulation (e.g. using
160 fix npt) this only affects the output pressure, not the dynamics of
161 the simulation.  If you use SHAKE with rRESPA and perform a constant
162 pressure simulation (e.g. using fix npt) then you will be
163 equilibrating to the wrong volume.
164 
165 E: Pair style does not support rRESPA inner/middle/outer
166 
167 You are attempting to use rRESPA options with a pair style that
168 does not support them.
169 
170 */
171