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

remove tabs and trailing whitespace, adjust source format to closer match LAMMPS style

parent 97bcce77
Loading
Loading
Loading
Loading
+226 −231
Original line number Diff line number Diff line
@@ -160,8 +160,7 @@ void PairMesoCNT::compute(int eflag, int vflag)
      if (endflag == 1) {
        endindex = chain[j][0];
        qe = x[endindex];
      }
      else if (endflag == 2) {
      } else if (endflag == 2) {
        endindex = chain[j][clen-1];
        qe = x[endindex];
      }
@@ -248,19 +247,17 @@ void PairMesoCNT::compute(int eflag, int vflag)
        geometry(r1,r2,p1,p2,NULL,p,m,param,basis);
        if (param[0] > cutoff) continue;
        finf(param,evdwl,flocal);
      }

        // semi-infinite CNT case with end at start of chain

      else if (endflag == 1) {
      } else if (endflag == 1) {
        geometry(r1,r2,p1,p2,qe,p,m,param,basis);
        if (param[0] > cutoff) continue;
        fsemi(param,evdwl,fend,flocal);
      }

        // semi-infinite CNT case with end at end of chain

      else {
      } else {
        geometry(r1,r2,p2,p1,qe,p,m,param,basis);
        if (param[0] > cutoff) continue;
        fsemi(param,evdwl,fend,flocal);
@@ -292,8 +289,7 @@ void PairMesoCNT::compute(int eflag, int vflag)
      if (endflag == 2) {
        add3(ftotal,ftorque,fglobal[3]);
        sub3(ftotal,ftorque,fglobal[2]);
      }
      else {
      } else {
        add3(ftotal,ftorque,fglobal[2]);
        sub3(ftotal,ftorque,fglobal[3]);
      }
@@ -466,6 +462,7 @@ void PairMesoCNT::coeff(int narg, char **arg)
  else if (strcmp(update->unit_style,"electron") == 0) eunit = 3.674932248e-2;
  else if (strcmp(update->unit_style,"micro") == 0) eunit = 1.6021765e-4;
  else if (strcmp(update->unit_style,"nano") == 0) eunit = 1.6021765e2;
  else error->all(FLERR,"Pair style mesocnt does not recognize this units style");
  funit = eunit * ang_inv;

  // potential variables
@@ -624,13 +621,15 @@ void PairMesoCNT::neigh_common(int i1, int i2, int &numred, int *redlist)
  int numneigh1,numneigh2;
  int *neighlist1,*neighlist2;

  if (i1 > nlocal-1) numneigh1 = 0;
  else {
  if (i1 > nlocal-1) {
    numneigh1 = 0;
  } else {
    neighlist1 = firstneigh[i1];
    numneigh1 = numneigh[i1];
  }
  if (i2 > nlocal-1) numneigh2 = 0;
  else {
  if (i2 > nlocal-1) {
    numneigh2 = 0;
  } else {
    neighlist2 = firstneigh[i2];
    numneigh2 = numneigh[i2];
  }
@@ -705,13 +704,15 @@ void PairMesoCNT::chain_split(int *redlist, int numred,
    tagint tagstart = tag[cstart];
    tagint tagend = tag[cend];
    end[j] = 0;
    if (tagstart == 1) end[j] = 1;
    else {
    if (tagstart == 1) {
      end[j] = 1;
    } else {
      int idprev = atom->map(tagstart-1);
      if (mol[cstart] != mol[idprev]) end[j] = 1;
    }
    if (tagend == atom->natoms) end[j] = 2;
    else {
    if (tagend == atom->natoms) {
      end[j] = 2;
    } else {
      int idnext = atom->map(tagend+1);
      if (mol[cend] != mol[idnext]) end[j] = 2;
    }
@@ -847,8 +848,9 @@ void PairMesoCNT::read_data(FILE *fp, double *data,
    }
    if (i > 0) xtemp = x;
    if (2 != sscanf(line,"%lg %lg",&x,&data[i])) cerror++;
    if (i == 0) xstart = x;
    else {
    if (i == 0) {
      xstart = x;
    } else {
      dxtemp = x - xtemp;
      if (i == 1) dx = dxtemp;
      if (fabs(dxtemp - dx)/dx > SMALL) serror++;
@@ -914,8 +916,9 @@ void PairMesoCNT::read_data(FILE *fp, double **data,
              if (fabs(dytemp - dy)/dy > SMALL) syerror++;
      }
    }
    if (i == 0) xstart = x;
    else {
    if (i == 0) {
      xstart = x;
    } else {
      dxtemp = x - xtemp;
      if (i == 1) dx = dxtemp;
      if (fabs(dxtemp - dx)/dx > SMALL) sxerror++;
@@ -1217,11 +1220,12 @@ double PairMesoCNT::spline(double x, double xstart, double dx,

  // linear extrapolation

  if (i < 1) return coeff[1][0] + coeff[1][1]*(x - xstart);
  if (i < 1) {
    return coeff[1][0] + coeff[1][1]*(x - xstart);

  // constant extrapolation

  else if (i > coeff_size-1) {
  } else if (i > coeff_size-1) {
    i = coeff_size - 1;
    x = xstart + (coeff_size-1)*dx;
  }
@@ -1246,11 +1250,12 @@ double PairMesoCNT::dspline(double x, double xstart, double dx,

  // constant extrapolation

  if (i < 1) return coeff[1][1];
  if (i < 1) {
    return coeff[1][1];

  // constant extrapolation

  else if (i > coeff_size-1) {
  } else if (i > coeff_size-1) {
    i = coeff_size - 1;
    x = xstart + (coeff_size-1)*dx;
  }
@@ -1280,8 +1285,7 @@ double PairMesoCNT::spline(double x, double y,
  if (i < 1) {
    i = 1;
    x = xstart;
  }
  else if (i > coeff_size-1) {
  } else if (i > coeff_size-1) {
    i = coeff_size - 1;
    x = xstart + (coeff_size-1)*dx;
  }
@@ -1289,8 +1293,7 @@ double PairMesoCNT::spline(double x, double y,
  if (j < 1) {
    j = 1;
    y = ystart;
  }
  else if (j > coeff_size-1) {
  } else if (j > coeff_size-1) {
    j = coeff_size - 1;
    y = ystart + (coeff_size-1)*dy;
  }
@@ -1339,8 +1342,7 @@ double PairMesoCNT::dxspline(double x, double y,
  if (i < 1) {
    i = 1;
    x = xstart;
  }
  else if (i > coeff_size-1) {
  } else if (i > coeff_size-1) {
    i = coeff_size - 1;
    x = xstart + (coeff_size-1)*dx;
  }
@@ -1348,8 +1350,7 @@ double PairMesoCNT::dxspline(double x, double y,
  if (j < 1) {
    j = 1;
    y = ystart;
  }
  else if (j > coeff_size-1) {
  } else if (j > coeff_size-1) {
    j = coeff_size - 1;
    y = ystart + (coeff_size-1)*dy;
  }
@@ -1398,8 +1399,7 @@ double PairMesoCNT::dyspline(double x, double y,
  if (i < 1) {
    i = 1;
    x = xstart;
  }
  else if (i > coeff_size-1) {
  } else if (i > coeff_size-1) {
    i = coeff_size - 1;
    x = xstart + (coeff_size-1)*dx;
  }
@@ -1407,8 +1407,7 @@ double PairMesoCNT::dyspline(double x, double y,
  if (j < 1) {
    j = 1;
    y = ystart;
  }
  else if (j > coeff_size-1) {
  } else if (j > coeff_size-1) {
    j = coeff_size - 1;
    y = ystart + (coeff_size-1)*dy;
  }
@@ -1478,8 +1477,7 @@ void PairMesoCNT::geometry(const double *r1, const double *r2,
  if (qe) {
    sub3(p,qe,delpqe);
    rhoe = dot3(delpqe,m);
  }
  else rhoe = 0;
  } else rhoe = 0;

  // parallel case

@@ -1487,11 +1485,10 @@ void PairMesoCNT::geometry(const double *r1, const double *r2,
    taur = dot3(delr,l) - rhoe*psi;
    taup = -rhoe;
    etae = 0;
  }

  // non-parallel case

  else {
  } else {
    double frac = 1.0 / denom;
    sub3(l,psim,dell_psim);
    sub3(psil,m,delpsil_m);
@@ -1512,8 +1509,7 @@ void PairMesoCNT::geometry(const double *r1, const double *r2,
  cross3(ez,ex,ey);

  double alpha;
  if (dot3(m,ey) < 0) alpha = acos(psi);
  else alpha = MY_2PI - acos(psi);
  alpha = (dot3(m,ey) < 0) ? acos(psi) : MY_2PI - acos(psi);

  sub3(r1,rbar,delr1);
  sub3(r2,rbar,delr2);
@@ -1567,8 +1563,7 @@ void PairMesoCNT::weight(const double *r1, const double *r2,
    zero3(dr2_w);
    zero3(dp1_w);
    zero3(dp2_w);
  }
  else {
  } else {
    factor = ds(arg) * frac;

    sub3(r,p,dr_rho);
@@ -1618,11 +1613,10 @@ void PairMesoCNT::finf(const double *param, double &evdwl, double **f)
    f[0][2] = ubar * funit;
    f[1][2] = -f[0][2];
    evdwl = ubar * delxi * eunit;
  }

  // non-parallel case

  else {
  } else {
    double sin_alpha_inv = 1.0 / sin_alpha;
    double sin_alphasq_inv = sin_alpha_inv * sin_alpha_inv;
    double cos_alpha = cos(alpha);
@@ -1696,6 +1690,7 @@ void PairMesoCNT::finf(const double *param, double &evdwl, double **f)
      phi1 *= -1;
      dh_phi1 *= -1;
    }

    if (zeta2 < 0) {
      phi2 *= -1;
      dh_phi2 *= -1;
+12 −12

File changed.

Contains only whitespace changes.