Unverified Commit f4431d05 authored by Axel Kohlmeyer's avatar Axel Kohlmeyer
Browse files

remove dead code

parent bd4d4bc0
Loading
Loading
Loading
Loading
+0 −39
Original line number Diff line number Diff line
@@ -639,42 +639,3 @@ void BondTable::uf_lookup(int type, double x, double &u, double &f)
      tb->deltasq6;
  }
}

/* ----------------------------------------------------------------------
   calculate potential u at distance x
   insure x is between bond min/max
------------------------------------------------------------------------- */

void BondTable::u_lookup(int type, double x, double &u)
{
  if (!std::isfinite(x)) {
    error->one(FLERR,"Illegal bond in bond style table");
  }

  double fraction,a,b;
  char estr[128];
  const Table *tb = &tables[tabindex[type]];
  const int itable = static_cast<int> ((x - tb->lo) * tb->invdelta);
  if (itable < 0) {
    sprintf(estr,"Bond length < table inner cutoff: "
            "type %d length %g",type,x);
    error->one(FLERR,estr);
  } else if (itable >= tablength) {
    sprintf(estr,"Bond length > table outer cutoff: "
            "type %d length %g",type,x);
    error->one(FLERR,estr);
  }

  if (tabstyle == LINEAR) {
    fraction = (x - tb->r[itable]) * tb->invdelta;
    u = tb->e[itable] + fraction*tb->de[itable];
  } else if (tabstyle == SPLINE) {
    fraction = (x - tb->r[itable]) * tb->invdelta;

    b = (x - tb->r[itable]) * tb->invdelta;
    a = 1.0 - b;
    u = a * tb->e[itable] + b * tb->e[itable+1] +
      ((a*a*a-a)*tb->e2[itable] + (b*b*b-b)*tb->e2[itable+1]) *
      tb->deltasq6;
  }
}