Unverified Commit 0b02108b authored by Axel Kohlmeyer's avatar Axel Kohlmeyer
Browse files

add add check to refuse running with 2d systems and document it.

parent 859f6444
Loading
Loading
Loading
Loading
+2 −0
Original line number Diff line number Diff line
@@ -137,6 +137,8 @@ Restrictions
""""""""""""

This command is only available when LAMMPS was built with the USER-MISC package.
This this depends on :doc:`fix accelerate/cos <fix_accelerate_cos>` which can
only work for 3d systems, this compute cannot be used for 2d systems.

Related commands
""""""""""""""""
+1 −0
Original line number Diff line number Diff line
@@ -86,6 +86,7 @@ Restrictions
""""""""""""

This command is only available when LAMMPS was built with the USER-MISC package.
Since this fix depends on the z-coordinate of atoms, it cannot be used in 2d simulations.

Related commands
""""""""""""""""
+2 −10
Original line number Diff line number Diff line
@@ -38,11 +38,8 @@ FixAccelerateCos::FixAccelerateCos(LAMMPS *lmp, int narg, char **arg) :
    Fix(lmp, narg, arg) {
  if (narg < 4) error->all(FLERR, "Illegal fix accelerate/cos command");
  acceleration = force->numeric(FLERR, arg[3]);
}

/* ---------------------------------------------------------------------- */

FixAccelerateCos::~FixAccelerateCos() {
  if (domain->dimension == 2)
    error->all(FLERR,"Fix accelerate/cos cannot be used with 2d systems");
}

/* ---------------------------------------------------------------------- */
@@ -55,11 +52,6 @@ int FixAccelerateCos::setmask() {

/* ---------------------------------------------------------------------- */

void FixAccelerateCos::init() {
}

/* ---------------------------------------------------------------------- */

void FixAccelerateCos::setup(int vflag) {
  post_force(vflag);
}
+6 −2
Original line number Diff line number Diff line
@@ -31,9 +31,9 @@ namespace LAMMPS_NS {
class FixAccelerateCos: public Fix {
 public:
  FixAccelerateCos(class LAMMPS *, int, char **);
  virtual ~FixAccelerateCos();
  virtual ~FixAccelerateCos() {};
  int setmask();
  virtual void init();
  virtual void init() {};
  void setup(int);
  virtual void post_force(int);

@@ -54,4 +54,8 @@ Self-explanatory. Check the input script syntax and compare to the
documentation for the command.  You can use -echo screen as a
command-line option when running LAMMPS to see the offending line.

E: Fix accelerate/cos cannot be used with 2d systems

Self-explanatory.

*/