Commit 38a998c0 authored by Daniel Schwen's avatar Daniel Schwen
Browse files

Fix misc. warnings (#1076)

parent 92a4dc25
Loading
Loading
Loading
Loading
+3 −3
Original line number Diff line number Diff line
@@ -96,7 +96,7 @@ int BodyRoundedPolyhedron::nedges(AtomVecBody::Bonus *bonus)
{
  int nvertices = bonus->ivalue[0];
  int nedges = bonus->ivalue[1];
  int nfaces = bonus->ivalue[2];
  //int nfaces = bonus->ivalue[2];
  if (nvertices == 1) return 0;
  else if (nvertices == 2) return 1;
  return nedges; //(nvertices+nfaces-2); // Euler's polyon formula: V-E+F=2
@@ -463,7 +463,7 @@ void BodyRoundedPolyhedron::output(int ibonus, int m, double *values)
int BodyRoundedPolyhedron::image(int ibonus, double flag1, double /*flag2*/,
                              int *&ivec, double **&darray)
{
  int j, nelements;
  int nelements;
  double p[3][3];
  double *x, rrad;

@@ -488,7 +488,7 @@ int BodyRoundedPolyhedron::image(int ibonus, double flag1, double /*flag2*/,

    nelements = nvertices;
  } else {
    int nfaces = bonus->ivalue[2];
    //int nfaces = bonus->ivalue[2];
    int nedges = bonus->ivalue[1]; //nvertices + nfaces - 2;
    if (nvertices == 2) nedges = 1; // special case: rods
    double* edge_ends = &bonus->dvalue[3*nvertices];
+6 −10
Original line number Diff line number Diff line
@@ -310,9 +310,6 @@ void FixWallBodyPolygon::post_force(int /*vflag*/)
      rsq = dx*dx + dy*dy + dz*dz;
      if (rsq > radius[i]*radius[i]) continue;

      double r = sqrt(rsq);
      double rsqinv = 1.0 / rsq;

      if (dnum[i] == 0) body2space(i);
      npi = dnum[i];
      ifirst = dfirst[i];
@@ -478,9 +475,8 @@ int FixWallBodyPolygon::vertex_against_wall(int i, double wall_pos,
                Contact* contact_list, int &num_contacts, double* /*facc*/)
{
  int ni, npi, ifirst, interact;
  double xpi[3], xpj[3], dist, eradi, rradi;
  double fx, fy, fz, rx, ry, rz;
  int nlocal = atom->nlocal;
  double xpi[3], eradi, rradi;
  double fx, fy, fz;

  npi = dnum[i];
  ifirst = dfirst[i];
@@ -499,9 +495,9 @@ int FixWallBodyPolygon::vertex_against_wall(int i, double wall_pos,
    xpi[1] = x[i][1] + discrete[ifirst+ni][1];
    xpi[2] = x[i][2] + discrete[ifirst+ni][2];

    int mode, contact, p2vertex;
    double d, R, hi[3], t, delx, dely, delz, fpair, shift;
    double xj[3], rij;
    int mode, contact;
    double d, R, hi[3], delx, dely, delz, fpair;
    double rij;

    // compute the distance from the vertex xpi to the wall

@@ -671,7 +667,7 @@ void FixWallBodyPolygon::contact_forces(Contact& contact, double j_a,
                      double** x, double** v, double** angmom, double** f,
                      double** torque, double* vwall, double* facc)
{
  int ibody,ibonus,ifirst, jefirst, ni;
  int ibody,ibonus,ifirst, ni;
  double fx,fy,fz,delx,dely,delz,rsq,rsqinv;
  double vr1,vr2,vr3,vnnr,vn1,vn2,vn3,vt1,vt2,vt3;
  double fn[3],ft[3],vi[3];
+5 −10
Original line number Diff line number Diff line
@@ -213,7 +213,7 @@ void FixWallBodyPolyhedron::setup(int vflag)

void FixWallBodyPolyhedron::post_force(int /*vflag*/)
{
  double vwall[3],dx,dy,dz,del1,del2,delxy,delr,rsq,eradi,rradi,wall_pos;
  double vwall[3],dx,dy,dz,del1,del2,rsq,eradi,rradi,wall_pos;
  int i,ni,npi,ifirst,nei,iefirst,nfi,iffirst,side;
  double facc[3];

@@ -325,9 +325,6 @@ void FixWallBodyPolyhedron::post_force(int /*vflag*/)
      rsq = dx*dx + dy*dy + dz*dz;
      if (rsq > radius[i]*radius[i]) continue;

      double r = sqrt(rsq);
      double rsqinv = 1.0 / rsq;

      if (dnum[i] == 0) body2space(i);
      npi = dnum[i];
      ifirst = dfirst[i];
@@ -359,8 +356,7 @@ void FixWallBodyPolyhedron::post_force(int /*vflag*/)
        edge[iefirst+ni][5] = 0;
      }

      int interact, num_contacts, done;
      double delta_a, delta_ua, j_a;
      int interact, num_contacts;
      Contact contact_list[MAX_CONTACTS];

      num_contacts = 0;
@@ -550,7 +546,6 @@ int FixWallBodyPolyhedron::edge_against_wall(int i, double wall_pos,
{
  int ni, nei, mode, contact;
  double rradi;
  int nlocal = atom->nlocal;

  nei = ednum[i];
  rradi = rounded_radius[i];
@@ -702,10 +697,10 @@ void FixWallBodyPolyhedron::contact_forces(int ibody,
  double fx, double fy, double fz, double** x, double** v, double** angmom,
  double** f, double** torque, double* vwall)
{
  int ibonus,jbonus;
  int ibonus;
  double fxt,fyt,fzt,rsq,rsqinv;
  double vr1,vr2,vr3,vnnr,vn1,vn2,vn3,vt1,vt2,vt3;
  double fn[3],ft[3],vi[3],vj[3];
  double fn[3],ft[3],vi[3];
  double *quat, *inertia;
  AtomVecBody::Bonus *bonus;

@@ -787,7 +782,7 @@ void FixWallBodyPolyhedron::contact_forces(Contact& contact, double j_a,
                      double** x, double** v, double** angmom, double** f,
                      double** torque, double* vwall, double* facc)
{
  int ibody,ibonus,ifirst, jefirst, ni;
  int ibody,ibonus,ifirst,ni;
  double fx,fy,fz,delx,dely,delz,rsq,rsqinv;
  double vr1,vr2,vr3,vnnr,vn1,vn2,vn3,vt1,vt2,vt3;
  double fn[3],ft[3],vi[3];
+5 −6
Original line number Diff line number Diff line
@@ -105,10 +105,9 @@ void PairBodyRoundedPolygon::compute(int eflag, int vflag)
  int i,j,ii,jj,inum,jnum,itype,jtype;
  int ni,nj,npi,npj,ifirst,jfirst;
  int nei,nej,iefirst,jefirst;
  double xtmp,ytmp,ztmp,delx,dely,delz,evdwl,fx,fy,fz;
  double xtmp,ytmp,ztmp,delx,dely,delz,evdwl;
  double rsq,rsqinv,r,radi,radj,eradi,eradj,rradi,rradj,k_nij,k_naij;
  double xi[3],xj[3],fi[3],fj[3],ti[3],tj[3],facc[3];
  double *dxi,*dxj;
  double xi[3],xj[3],facc[3];
  int *ilist,*jlist,*numneigh,**firstneigh;

  evdwl = 0.0;
@@ -709,9 +708,8 @@ int PairBodyRoundedPolygon::vertex_against_edge(int i, int j,
  int ni, npi, ifirst, nei, iefirst;
  int nj, npj, jfirst, nej, jefirst;
  double xpi[3], xpj[3], dist, eradi, eradj, rradi, rradj;
  double fx, fy, fz, rx, ry, rz, energy;
  double fx, fy, fz, energy;
  int interact;
  int nlocal = atom->nlocal;

  npi = dnum[i];
  ifirst = dfirst[i];
@@ -758,7 +756,7 @@ int PairBodyRoundedPolygon::vertex_against_edge(int i, int j,

    int mode, contact, p2vertex;
    double d, R, hi[3], t, delx, dely, delz, fpair, shift;
    double xj[3], rij;
    double rij;

    // loop through body j's edges

@@ -781,6 +779,7 @@ int PairBodyRoundedPolygon::vertex_against_edge(int i, int j,
        if (mode == VERTEXI) p2vertex = edge[jefirst+nj][0];
        else if (mode == VERTEXJ) p2vertex = edge[jefirst+nj][1];

        // double xj[3];
        // p2.body2space(p2vertex, xj);
        xpj[0] = x[j][0] + discrete[jfirst+p2vertex][0];
        xpj[1] = x[j][1] + discrete[jfirst+p2vertex][1];
+10 −9
Original line number Diff line number Diff line
@@ -603,7 +603,7 @@ void PairBodyRoundedPolyhedron::sphere_against_sphere(int ibody, int jbody,
{
  double rradi,rradj,contact_dist;
  double vr1,vr2,vr3,vnnr,vn1,vn2,vn3,vt1,vt2,vt3;
  double rij,rsqinv,R,fx,fy,fz,fn[3],ft[3],fpair,shift,energy;
  double rij,rsqinv,R,fx,fy,fz,fn[3],ft[3],fpair,energy;
  int nlocal = atom->nlocal;
  int newton_pair = force->newton_pair;

@@ -685,7 +685,7 @@ void PairBodyRoundedPolyhedron::sphere_against_edge(int ibody, int jbody,
{
  int ni,nei,ifirst,iefirst,npi1,npi2,ibonus;
  double xi1[3],xi2[3],vti[3],h[3],fn[3],ft[3],d,t;
  double delx,dely,delz,rsq,rij,rsqinv,R,fx,fy,fz,fpair,shift,energy;
  double delx,dely,delz,rsq,rij,rsqinv,R,fx,fy,fz,fpair,energy;
  double rradi,rradj,contact_dist;
  double vr1,vr2,vr3,vnnr,vn1,vn2,vn3,vt1,vt2,vt3;
  double *quat, *inertia;
@@ -835,7 +835,7 @@ void PairBodyRoundedPolyhedron::sphere_against_face(int ibody, int jbody,
{
  int ni,nfi,inside,ifirst,iffirst,npi1,npi2,npi3,ibonus,tmp;
  double xi1[3],xi2[3],xi3[3],ui[3],vi[3],vti[3],n[3],h[3],fn[3],ft[3],d;
  double delx,dely,delz,rsq,rij,rsqinv,R,fx,fy,fz,fpair,shift,energy;
  double delx,dely,delz,rsq,rij,rsqinv,R,fx,fy,fz,fpair,energy;
  double rradi,rradj,contact_dist;
  double vr1,vr2,vr3,vnnr,vn1,vn2,vn3,vt1,vt2,vt3;
  double *quat, *inertia;
@@ -988,7 +988,7 @@ int PairBodyRoundedPolyhedron::edge_against_edge(int ibody, int jbody,
  int itype, int jtype, double** x, Contact* contact_list, int &num_contacts,
  double &evdwl, double* facc)
{
  int ni,nei,nj,nej,contact,interact;
  int ni,nei,nj,nej,interact;
  double rradi,rradj,energy;

  nei = ednum[ibody];
@@ -1045,7 +1045,7 @@ int PairBodyRoundedPolyhedron::edge_against_face(int ibody, int jbody,
  int itype, int jtype, double** x, Contact* contact_list, int &num_contacts,
  double &evdwl, double* facc)
{
  int ni,nei,nj,nfj,contact,interact;
  int ni,nei,nj,nfj,interact;
  double rradi,rradj,energy;

  nei = ednum[ibody];
@@ -1118,7 +1118,7 @@ int PairBodyRoundedPolyhedron::interaction_edge_to_edge(int ibody,
  int ifirst,iefirst,jfirst,jefirst,npi1,npi2,npj1,npj2,interact;
  double xi1[3],xi2[3],xpj1[3],xpj2[3];
  double r,t1,t2,h1[3],h2[3];
  double contact_dist, shift;
  double contact_dist;

  double** x = atom->x;
  double** v = atom->v;
@@ -1314,7 +1314,7 @@ int PairBodyRoundedPolyhedron::interaction_face_to_edge(int ibody,

  // determine the intersection of the edge to the face

  double hi1[3], hi2[3], d1, d2, contact_dist, shift;
  double hi1[3], hi2[3], d1, d2, contact_dist;
  int inside1 = 0;
  int inside2 = 0;

@@ -2345,9 +2345,8 @@ void PairBodyRoundedPolyhedron::find_unique_contacts(Contact* contact_list,
void PairBodyRoundedPolyhedron::sanity_check()
{

  double x1[3],x2[3],x3[3],x4[3],h_a[3],h_b[3],d_a,d_b,u[3],v[3],n[3];
  double x1[3],x2[3],x3[3],x4[3],h_a[3],h_b[3],d_a,d_b;
  double a[3],b[3],t_a,t_b;
  int inside_a, inside_b;

  x1[0] = 0; x1[1] = 3; x1[2] = 0;
  x2[0] = 3; x2[1] = 0; x2[2] = 0;
@@ -2364,9 +2363,11 @@ void PairBodyRoundedPolyhedron::sanity_check()
    h_a[0], h_a[1], h_a[2], h_b[0], h_b[1], h_b[2], t_a, t_b, d_a, d_b);
*/
/*
  int inside_a, inside_b;
  int mode = edge_face_intersect(x1, x2, x3, a, b, h_a, h_b, d_a, d_b,
                                 inside_a, inside_b);

  double u[3],v[3],n[3];
  MathExtra::sub3(x2, x1, u);
  MathExtra::sub3(x3, x1, v);
  MathExtra::cross3(u, v, n);
Loading