Commit db6d2723 authored by Steve Plimpton's avatar Steve Plimpton
Browse files

more additions to USER atom styles and bug fixes

parent 9af08f2d
Loading
Loading
Loading
Loading
+5 −0
Original line number Diff line number Diff line
@@ -40,6 +40,7 @@ using namespace MathConst;

enum{ATOM,MOLECULE};
enum{ONE,RANGE,POLY};
enum{CONSTANT,EQUAL};    // same as FixGravity

#define EPSILON 0.001
#define SMALL 1.0e-10
@@ -318,6 +319,10 @@ void FixPour::init()
  if (ifix == -1)
    error->all(FLERR,"No fix gravity defined for fix pour");

  int varflag = ((FixGravity *) modify->fix[ifix])->varflag;
  if (varflag != CONSTANT) 
    error->all(FLERR,"Fix gravity for fix pour must be constant");

  double xgrav = ((FixGravity *) modify->fix[ifix])->xgrav;
  double ygrav = ((FixGravity *) modify->fix[ifix])->ygrav;
  double zgrav = ((FixGravity *) modify->fix[ifix])->zgrav;
+18 −4
Original line number Diff line number Diff line
@@ -60,6 +60,20 @@ AtomVecBond::~AtomVecBond()
  delete [] bond_negative;
}

/* ----------------------------------------------------------------------
   grow atom arrays
   must set local copy of body ptr
   needed in replicate when 2 atom classes exist and pack_restart() is called
------------------------------------------------------------------------- */

void AtomVecBond::grow(int n)
{
  AtomVec::grow(n);
  num_bond = atom->num_bond;
  bond_type = atom->bond_type;
}


/* ----------------------------------------------------------------------
   modify values for AtomVec::pack_restart() to pack
------------------------------------------------------------------------- */
@@ -76,8 +90,8 @@ void AtomVecBond::pack_restart_pre(int ilocal)

  // flip any negative types to positive and flag which ones

  int *num_bond = atom->num_bond;
  int **bond_type = atom->bond_type;
  //int *num_bond = atom->num_bond;
  //int **bond_type = atom->bond_type;

  any_bond_negative = 0;
  for (int m = 0; m < num_bond[ilocal]; m++) {
@@ -98,8 +112,8 @@ void AtomVecBond::pack_restart_post(int ilocal)
  // restore the flagged types to their negative values

  if (any_bond_negative) {
    int *num_bond = atom->num_bond;
    int **bond_type = atom->bond_type;
    //int *num_bond = atom->num_bond;
    //int **bond_type = atom->bond_type;
    for (int m = 0; m < num_bond[ilocal]; m++)
      if (bond_negative[m]) bond_type[ilocal][m] = -bond_type[ilocal][m];
  }
+4 −0
Original line number Diff line number Diff line
@@ -28,6 +28,7 @@ class AtomVecBond : public AtomVec {
 public:
  AtomVecBond(class LAMMPS *);
  ~AtomVecBond();
  void grow(int);
  void pack_restart_pre(int);
  void pack_restart_post(int);
  void unpack_restart_init(int);
@@ -37,6 +38,9 @@ class AtomVecBond : public AtomVec {
  int any_bond_negative;
  int bond_per_atom;
  int *bond_negative;

  int *num_bond;
  int **bond_type;
};

}
+4 −4
Original line number Diff line number Diff line
@@ -128,7 +128,7 @@ void AtomVecFull::pack_restart_pre(int ilocal)
  int *num_improper = atom->num_improper;
  int **improper_type = atom->improper_type;

  int any_bond_negative = 0;
  any_bond_negative = 0;
  for (int m = 0; m < num_bond[ilocal]; m++) {
    if (bond_type[ilocal][m] < 0) {
      bond_negative[m] = 1;
@@ -137,7 +137,7 @@ void AtomVecFull::pack_restart_pre(int ilocal)
    } else bond_negative[m] = 0;
  }

  int any_angle_negative = 0;
  any_angle_negative = 0;
  for (int m = 0; m < num_angle[ilocal]; m++) {
    if (angle_type[ilocal][m] < 0) {
      angle_negative[m] = 1;
@@ -146,7 +146,7 @@ void AtomVecFull::pack_restart_pre(int ilocal)
    } else angle_negative[m] = 0;
  }

  int any_dihedral_negative = 0;
  any_dihedral_negative = 0;
  for (int m = 0; m < num_dihedral[ilocal]; m++) {
    if (dihedral_type[ilocal][m] < 0) {
      dihedral_negative[m] = 1;
@@ -155,7 +155,7 @@ void AtomVecFull::pack_restart_pre(int ilocal)
    } else dihedral_negative[m] = 0;
  }

  int any_improper_negative = 0;
  any_improper_negative = 0;
  for (int m = 0; m < num_improper[ilocal]; m++) {
    if (improper_type[ilocal][m] < 0) {
      improper_negative[m] = 1;
+4 −4
Original line number Diff line number Diff line
@@ -128,7 +128,7 @@ void AtomVecMolecular::pack_restart_pre(int ilocal)
  int *num_improper = atom->num_improper;
  int **improper_type = atom->improper_type;

  int any_bond_negative = 0;
  any_bond_negative = 0;
  for (int m = 0; m < num_bond[ilocal]; m++) {
    if (bond_type[ilocal][m] < 0) {
      bond_negative[m] = 1;
@@ -137,7 +137,7 @@ void AtomVecMolecular::pack_restart_pre(int ilocal)
    } else bond_negative[m] = 0;
  }

  int any_angle_negative = 0;
  any_angle_negative = 0;
  for (int m = 0; m < num_angle[ilocal]; m++) {
    if (angle_type[ilocal][m] < 0) {
      angle_negative[m] = 1;
@@ -146,7 +146,7 @@ void AtomVecMolecular::pack_restart_pre(int ilocal)
    } else angle_negative[m] = 0;
  }

  int any_dihedral_negative = 0;
  any_dihedral_negative = 0;
  for (int m = 0; m < num_dihedral[ilocal]; m++) {
    if (dihedral_type[ilocal][m] < 0) {
      dihedral_negative[m] = 1;
@@ -155,7 +155,7 @@ void AtomVecMolecular::pack_restart_pre(int ilocal)
    } else dihedral_negative[m] = 0;
  }

  int any_improper_negative = 0;
  any_improper_negative = 0;
  for (int m = 0; m < num_improper[ilocal]; m++) {
    if (improper_type[ilocal][m] < 0) {
      improper_negative[m] = 1;
Loading