Commit b7b70db5 authored by sjplimp's avatar sjplimp
Browse files

git-svn-id: svn://svn.icms.temple.edu/lammps-ro/trunk@2173 f3b2605a-c512-4ea7-a41b-209d697bcdaa
parent c6ae796f
Loading
Loading
Loading
Loading
+8 −0
Original line number Diff line number Diff line
@@ -11,6 +11,7 @@
   See the README file in the top-level LAMMPS directory.
------------------------------------------------------------------------- */

#include "math.h"
#include "string.h"
#include "stdlib.h"
#include "fix_line_force.h"
@@ -30,6 +31,13 @@ FixLineForce::FixLineForce(LAMMPS *lmp, int narg, char **arg) :
  xdir = atof(arg[3]);
  ydir = atof(arg[4]);
  zdir = atof(arg[5]);

  double len = sqrt(xdir*xdir + ydir*ydir + zdir*zdir);
  if (len == 0.0) error->all("Illegal fix lineforce command");

  xdir /= len;
  ydir /= len;
  zdir /= len;
}

/* ---------------------------------------------------------------------- */
+8 −0
Original line number Diff line number Diff line
@@ -11,6 +11,7 @@
   See the README file in the top-level LAMMPS directory.
------------------------------------------------------------------------- */

#include "math.h"
#include "string.h"
#include "stdlib.h"
#include "fix_plane_force.h"
@@ -30,6 +31,13 @@ FixPlaneForce::FixPlaneForce(LAMMPS *lmp, int narg, char **arg) :
  xdir = atof(arg[3]);
  ydir = atof(arg[4]);
  zdir = atof(arg[5]);

  double len = sqrt(xdir*xdir + ydir*ydir + zdir*zdir);
  if (len == 0.0) error->all("Illegal fix planeforce command");

  xdir /= len;
  ydir /= len;
  zdir /= len;
}

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