Commit 9915a672 authored by Theophile Chirac's avatar Theophile Chirac
Browse files

Commit JT 020419

- correct in magelec (if ii<n)
- check correct, apply it to other pairs
parent d6eaf73d
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -97,7 +97,7 @@ void PairSpinExchange::settings(int narg, char **arg)
}

/* ----------------------------------------------------------------------
   set coeffs for one or more type spin pairs (only one for now)
   set coeffs for one or more type spin pairs
------------------------------------------------------------------------- */

void PairSpinExchange::coeff(int narg, char **arg)
+42 −35
Original line number Diff line number Diff line
@@ -142,7 +142,6 @@ void PairSpinMagelec::coeff(int narg, char **arg)
  }
  if (count == 0)
    error->all(FLERR,"Incorrect args in pair_style command");

}

/* ----------------------------------------------------------------------
@@ -287,7 +286,7 @@ void PairSpinMagelec::compute(int eflag, int vflag)
      // compute me interaction

      if (rsq <= local_cut2) {
        compute_magelec(i,j,rsq,eij,fmi,spj);
        compute_magelec(i,j,eij,fmi,spj);
        if (lattice_flag) {
          compute_magelec_mech(i,j,fi,spi,spj);
        }
@@ -332,18 +331,24 @@ void PairSpinMagelec::compute_single_pair(int ii, double fmi[3])
  double delx,dely,delz;
  double spj[3];

  int i,j,jnum,itype,jtype;
  int i,j,inum,jnum,itype,jtype;
  int *ilist,*jlist,*numneigh,**firstneigh;

  double rsq, inorm;

  inum = list->inum;
  ilist = list->ilist;
  numneigh = list->numneigh;
  firstneigh = list->firstneigh;

  // compute pair if  

  if (ii < inum) {

    i = ilist[ii];
    itype = type[i];
    
    xi[0] = xi[1] = xi[2] = 0.0;
    xi[0] = x[i][0];
    xi[1] = x[i][1];
    xi[2] = x[i][2];
@@ -372,15 +377,17 @@ void PairSpinMagelec::compute_single_pair(int ii, double fmi[3])
      eij[2] = -inorm*delz;
    
      if (rsq <= local_cut2) {
      compute_magelec(i,j,rsq,eij,fmi,spj);
        compute_magelec(i,j,eij,fmi,spj);
      }
    }
  
    }

}

/* ---------------------------------------------------------------------- */

void PairSpinMagelec::compute_magelec(int i, int j, double /*rsq*/, double eij[3], double fmi[3], double spj[3])
void PairSpinMagelec::compute_magelec(int i, int j, double eij[3], double fmi[3], double spj[3])
{
  int *type = atom->type;
  int itype, jtype;
+1 −1
Original line number Diff line number Diff line
@@ -37,7 +37,7 @@ class PairSpinMagelec : public PairSpin {
  void compute(int, int);
  void compute_single_pair(int, double *);

  void compute_magelec(int, int, double, double *, double *, double *);
  void compute_magelec(int, int, double *, double *, double *);
  void compute_magelec_mech(int, int, double *, double *, double *);

  void write_restart(FILE *);