Commit 59af51ca authored by Aidan Thompson's avatar Aidan Thompson
Browse files

Added code to create pressure compute snap_press behind the scenes

parent 11961084
Loading
Loading
Loading
Loading
+0 −1
Original line number Diff line number Diff line
@@ -70,7 +70,6 @@ compute vbsum all reduce sum c_vb[*]
# set up new-style global compute

compute 	snap all snap ${rcutfac} ${rfac0} ${twojmax} ${radelem1} ${radelem2} ${wj1} ${wj2} rmin0 ${rmin0} quadraticflag 0 bzeroflag 0 switchflag 0
compute 	snap_press all pressure NULL virial
fix 		snap all ave/time 1 1 1 c_snap[*] file compute.snap.dat mode vector

thermo 		100
+11 −0
Original line number Diff line number Diff line
@@ -207,10 +207,21 @@ void ComputeSnap::init()
  // add compute for reference virial tensor

  char *id_virial = (char *) "snap_press";

  char **newarg = new char*[5];
  newarg[0] = id_virial;
  newarg[1] = (char *) "all";
  newarg[2] = (char *) "pressure";
  newarg[3] = (char *) "NULL";
  newarg[4] = (char *) "virial";
  modify->add_compute(5,newarg);
  delete [] newarg;

  int ivirial = modify->find_compute(id_virial);
  if (ivirial == -1)
    error->all(FLERR,"compute snap requires that compute snap_press exists.");
  c_virial = modify->compute[ivirial];

}