diff --git a/src/EFF/fix_nh_eff.cpp b/src/EFF/fix_nh_eff.cpp index 15aaf5deb6..a569932000 100644 --- a/src/EFF/fix_nh_eff.cpp +++ b/src/EFF/fix_nh_eff.cpp @@ -33,7 +33,7 @@ enum{NOBIAS,BIAS}; FixNHEff::FixNHEff(LAMMPS *lmp, int narg, char **arg) : FixNH(lmp, narg, arg) { if (!atom->electron_flag) - error->all(FLERR,"Fix nvt/nph/npt/eff requires atom style electron"); + error->all(FLERR,"Fix {} requires atom style electron", style); } /* ---------------------------------------------------------------------- diff --git a/src/EFF/fix_nvt_sllod_eff.cpp b/src/EFF/fix_nvt_sllod_eff.cpp index 034a240e66..f67684b528 100644 --- a/src/EFF/fix_nvt_sllod_eff.cpp +++ b/src/EFF/fix_nvt_sllod_eff.cpp @@ -42,8 +42,21 @@ FixNVTSllodEff::FixNVTSllodEff(LAMMPS *lmp, int narg, char **arg) : // default values + psllod_flag = 0; if (mtchain_default_flag) mtchain = 1; + // select SLLOD/p-SLLOD/g-SLLOD variant + + int iarg = 3; + + while (iarg < narg) { + if (strcmp(arg[iarg],"psllod") == 0) { + if (iarg+2 > narg) utils::missing_cmd_args(FLERR, "fix nvt/sllod/eff psllod", error); + psllod_flag = utils::logical(FLERR,arg[iarg+1],false,lmp); + iarg += 2; + } else iarg++; + } + // create a new compute temp style // id = fix-ID + temp diff --git a/src/EFF/fix_nvt_sllod_eff.h b/src/EFF/fix_nvt_sllod_eff.h index 3e56638726..7c82eb2ebd 100644 --- a/src/EFF/fix_nvt_sllod_eff.h +++ b/src/EFF/fix_nvt_sllod_eff.h @@ -31,6 +31,7 @@ class FixNVTSllodEff : public FixNHEff { private: int nondeformbias; + int psllod_flag; void nh_v_temp() override; }; diff --git a/src/INTEL/fix_nvt_sllod_intel.cpp b/src/INTEL/fix_nvt_sllod_intel.cpp index cd2bb30338..83cfdc1e88 100644 --- a/src/INTEL/fix_nvt_sllod_intel.cpp +++ b/src/INTEL/fix_nvt_sllod_intel.cpp @@ -35,14 +35,26 @@ FixNVTSllodIntel::FixNVTSllodIntel(LAMMPS *lmp, int narg, char **arg) : FixNHIntel(lmp, narg, arg) { if (!tstat_flag) - error->all(FLERR,"Temperature control must be used with fix nvt/sllod"); + error->all(FLERR,"Temperature control must be used with fix nvt/sllod/intel"); if (pstat_flag) - error->all(FLERR,"Pressure control can not be used with fix nvt/sllod"); + error->all(FLERR,"Pressure control can not be used with fix nvt/sllod/intel"); // default values + psllod_flag = 0; if (mtchain_default_flag) mtchain = 1; + // select SLLOD/p-SLLOD/g-SLLOD variant + + int iarg = 3; + + while (iarg < narg) { + if (strcmp(arg[iarg],"psllod") == 0) { + if (iarg+2 > narg) utils::missing_cmd_args(FLERR, "fix nvt/sllod/intel psllod", error); + psllod_flag = utils::logical(FLERR,arg[iarg+1],false,lmp); + iarg += 2; + } else iarg++; + } // create a new compute temp style // id = fix-ID + temp diff --git a/src/INTEL/fix_nvt_sllod_intel.h b/src/INTEL/fix_nvt_sllod_intel.h index 7221a75fbc..e9332bec5b 100644 --- a/src/INTEL/fix_nvt_sllod_intel.h +++ b/src/INTEL/fix_nvt_sllod_intel.h @@ -36,6 +36,7 @@ class FixNVTSllodIntel : public FixNHIntel { private: int nondeformbias; + int psllod_flag; // 0 for SLLOD, 1 for p-SLLOD void nh_v_temp() override; }; diff --git a/src/KOKKOS/fix_nvt_sllod_kokkos.cpp b/src/KOKKOS/fix_nvt_sllod_kokkos.cpp index 481f80c763..2eab1ba35a 100644 --- a/src/KOKKOS/fix_nvt_sllod_kokkos.cpp +++ b/src/KOKKOS/fix_nvt_sllod_kokkos.cpp @@ -47,12 +47,25 @@ FixNVTSllodKokkos::FixNVTSllodKokkos(LAMMPS *lmp, int narg, char **a this->domainKK = (DomainKokkos *) this->domain; if (!this->tstat_flag) - this->error->all(FLERR,"Temperature control must be used with fix nvt/kk"); + this->error->all(FLERR,"Temperature control must be used with fix nvt/sllod/kk"); if (this->pstat_flag) - this->error->all(FLERR,"Pressure control can not be used with fix nvt/kk"); + this->error->all(FLERR,"Pressure control can not be used with fix nvt/sllod/kk"); + this->psllod_flag = 0; if (this->mtchain_default_flag) this->mtchain = 1; + // select SLLOD/p-SLLOD/g-SLLOD variant + + int iarg = 3; + + while (iarg < narg) { + if (strcmp(arg[iarg],"psllod") == 0) { + if (iarg+2 > narg) utils::missing_cmd_args(FLERR, "fix nvt/sllod/kk psllod", this->error); + this->psllod_flag = utils::logical(FLERR,arg[iarg+1],false,this->lmp); + iarg += 2; + } else iarg++; + } + this->id_temp = utils::strdup(std::string(this->id)+"_temp"); this->modify->add_compute(fmt::format("{} all temp/deform/kk",this->id_temp)); this->tcomputeflag = 1; diff --git a/src/KOKKOS/fix_nvt_sllod_kokkos.h b/src/KOKKOS/fix_nvt_sllod_kokkos.h index 2fc0dd3afd..a4b39b881c 100644 --- a/src/KOKKOS/fix_nvt_sllod_kokkos.h +++ b/src/KOKKOS/fix_nvt_sllod_kokkos.h @@ -50,6 +50,7 @@ class FixNVTSllodKokkos : public FixNHKokkos { private: int nondeformbias; + int psllod_flag; void nh_v_temp() override; diff --git a/src/OPENMP/fix_nvt_sllod_omp.cpp b/src/OPENMP/fix_nvt_sllod_omp.cpp index 5cd8c9fb16..ec96736725 100644 --- a/src/OPENMP/fix_nvt_sllod_omp.cpp +++ b/src/OPENMP/fix_nvt_sllod_omp.cpp @@ -43,14 +43,26 @@ FixNVTSllodOMP::FixNVTSllodOMP(LAMMPS *lmp, int narg, char **arg) : FixNHOMP(lmp, narg, arg) { if (!tstat_flag) - error->all(FLERR,"Temperature control must be used with fix nvt/sllod"); + error->all(FLERR,"Temperature control must be used with fix nvt/sllod/omp"); if (pstat_flag) - error->all(FLERR,"Pressure control can not be used with fix nvt/sllod"); + error->all(FLERR,"Pressure control can not be used with fix nvt/sllod/omp"); // default values + psllod_flag = 0; if (mtchain_default_flag) mtchain = 1; + // select SLLOD/p-SLLOD/g-SLLOD variant + + int iarg = 3; + + while (iarg < narg) { + if (strcmp(arg[iarg],"psllod") == 0) { + if (iarg+2 > narg) utils::missing_cmd_args(FLERR, "fix nvt/sllod/omp psllod", error); + psllod_flag = utils::logical(FLERR,arg[iarg+1],false,lmp); + iarg += 2; + } else iarg++; + } // create a new compute temp style // id = fix-ID + temp diff --git a/src/OPENMP/fix_nvt_sllod_omp.h b/src/OPENMP/fix_nvt_sllod_omp.h index fb5b57455f..261ac0f048 100644 --- a/src/OPENMP/fix_nvt_sllod_omp.h +++ b/src/OPENMP/fix_nvt_sllod_omp.h @@ -31,6 +31,7 @@ class FixNVTSllodOMP : public FixNHOMP { private: int nondeformbias; + int psllod_flag; // 0 for SLLOD, 1 for p-SLLOD void nh_v_temp() override; }; diff --git a/src/fix_nh.cpp b/src/fix_nh.cpp index ac582f8db5..c3cf524f8a 100644 --- a/src/fix_nh.cpp +++ b/src/fix_nh.cpp @@ -363,7 +363,7 @@ FixNH::FixNH(LAMMPS *lmp, int narg, char **arg) : } else if (strcmp(arg[iarg],"psllod") == 0) { iarg += 2; - + } else error->all(FLERR,"Unknown fix nvt/npt/nph keyword: {}", arg[iarg]); }