Unverified Commit 66274e78 authored by Ryan S. Elliott's avatar Ryan S. Elliott
Browse files

Update pair_kim.cpp so settings() may come before box is defined

Addresses #2215
parent 284b1618
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();