Unverified Commit 18928c66 authored by Axel Kohlmeyer's avatar Axel Kohlmeyer
Browse files

start writing tester for body/nparticle

parent ea1d4477
Loading
Loading
Loading
Loading
+6 −5
Original line number Diff line number Diff line
@@ -214,18 +214,18 @@ int BodyNparticle::pack_data_body(tagint atomID, int ibonus, double *buf)

  if (buf) {

    // ID ninteger ndouble
    // line 1: ID ninteger ndouble

    m = 0;
    buf[m++] = ubuf(atomID).d;
    buf[m++] = ubuf(1).d;
    buf[m++] = ubuf(6 + 3*nsub).d;

    // single integer nsub
    // line 2: single integer nsub

    buf[m++] = ubuf(nsub).d;

    // 6 moments of inertia
    // line 3: 6 moments of inertia

    MathExtra::quat_to_mat(quat,p);
    MathExtra::times3_diag(p,inertia,pdiag);
@@ -265,8 +265,9 @@ int BodyNparticle::write_data_body(FILE *fp, double *buf)
  fmt::print(fp,"{} {} {}\n",ubuf(buf[m]).i,ubuf(buf[m+1]).i,ubuf(buf[m+2]).i);
  m += 3;

  const int nsub = (int) ubuf(buf[m++]).i;
  const int nsub  = (int) ubuf(buf[m]).i;
  fmt::print(fp,"{}\n",nsub);
  m++;

  // inertia

+4 −2
Original line number Diff line number Diff line
@@ -560,8 +560,10 @@ bigint AtomVecBody::memory_usage_bonus()

  int nall = nlocal_bonus + nghost_bonus;
  for (int i = 0; i < nall; i++) {
    bytes += bonus[i].ninteger * sizeof(int);
    bytes += bonus[i].ndouble * sizeof(double);
    if (body[i] >= 0) {
      bytes += bonus[body[i]].ninteger * sizeof(int);
      bytes += bonus[body[i]].ndouble * sizeof(double);
    }
  }

  return bytes;
+605 −1

File changed.

Preview size limit exceeded, changes collapsed.