Unverified Commit 9068d17a authored by Axel Kohlmeyer's avatar Axel Kohlmeyer Committed by GitHub
Browse files

Merge pull request #2229 from ellio167/pair_kim_before_box

Update pair_kim.cpp so settings() may come before box is defined
parents 284b1618 66274e78
Loading
Loading
Loading
Loading
+0 −16
Original line number Diff line number Diff line
@@ -285,13 +285,6 @@ void PairKIM::allocate()

void PairKIM::settings(int narg, char **arg)
{
  // some of the code below needs to know the number of atom types,
  // but that is not set until the simulation box is created.

  if (domain->box_exist == 0)
    error->all(FLERR,"May not use 'pair_style kim' command before "
               "simulation box is defined");

  // This is called when "pair_style kim ..." is read from input
  // may be called multiple times
  ++settings_call_count;
@@ -312,15 +305,6 @@ void PairKIM::settings(int narg, char **arg)
  // first time called will do nothing...
  kim_free();

  // make sure things are allocated
  if (allocated != 1) allocate();

  // clear setflag to ensure coeff() is called after settings()
  int n = atom->ntypes;
  for (int i = 1; i <= n; i++)
    for (int j = i; j <= n; j++)
      setflag[i][j] = 0;

  // set lmps_* bool flags
  set_lmps_flags();