Unverified Commit 34fdfb6b authored by Axel Kohlmeyer's avatar Axel Kohlmeyer
Browse files

allow fix nvt/body npt/body and nph/body to be used for groups other than "all"

parent 92f194ac
Loading
Loading
Loading
Loading
+4 −1
Original line number Diff line number Diff line
@@ -18,8 +18,10 @@
#include "fix_nph_body.h"
#include <cstring>
#include <string>
#include "group.h"
#include "modify.h"
#include "error.h"
#include "fmt/format.h"

using namespace LAMMPS_NS;
using namespace FixConst;
@@ -43,7 +45,8 @@ FixNPHBody::FixNPHBody(LAMMPS *lmp, int narg, char **arg) :
  id_temp = new char[tcmd.size()+1];
  strcpy(id_temp,tcmd.c_str());

  modify->add_compute(tcmd + " all temp/body");
  tcmd += fmt::format(" {} temp/body",group->names[igroup]);
  modify->add_compute(tcmd);
  tcomputeflag = 1;

  // create a new compute pressure style
+4 −1
Original line number Diff line number Diff line
@@ -18,8 +18,10 @@
#include "fix_npt_body.h"
#include <cstring>
#include <string>
#include "group.h"
#include "modify.h"
#include "error.h"
#include "fmt/format.h"

using namespace LAMMPS_NS;
using namespace FixConst;
@@ -43,7 +45,8 @@ FixNPTBody::FixNPTBody(LAMMPS *lmp, int narg, char **arg) :
  id_temp = new char[tcmd.size()+1];
  strcpy(id_temp,tcmd.c_str());

  modify->add_compute(tcmd + " all temp/body");
  tcmd += fmt::format(" {} temp/body",group->names[igroup]);
  modify->add_compute(tcmd);
  tcomputeflag = 1;

  // create a new compute pressure style
+3 −1
Original line number Diff line number Diff line
@@ -21,6 +21,7 @@
#include "group.h"
#include "modify.h"
#include "error.h"
#include "fmt/format.h"

using namespace LAMMPS_NS;
using namespace FixConst;
@@ -42,6 +43,7 @@ FixNVTBody::FixNVTBody(LAMMPS *lmp, int narg, char **arg) :
  id_temp = new char[tcmd.size()+1];
  strcpy(id_temp,tcmd.c_str());

  modify->add_compute(tcmd + " all temp/body");
  tcmd += fmt::format(" {} temp/body",group->names[igroup]);
  modify->add_compute(tcmd);
  tcomputeflag = 1;
}