From c5c7e6fb744ab9ba1aa065b0e8a82f790fd563f7 Mon Sep 17 00:00:00 2001 From: Jacob Gissinger Date: Sat, 11 May 2024 16:40:40 -0400 Subject: [PATCH] bond/break: direct type label support --- doc/src/fix_bond_break.rst | 2 +- src/MC/fix_bond_break.cpp | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/doc/src/fix_bond_break.rst b/doc/src/fix_bond_break.rst index a0f7fad581..cfa29d8275 100644 --- a/doc/src/fix_bond_break.rst +++ b/doc/src/fix_bond_break.rst @@ -13,7 +13,7 @@ Syntax * ID, group-ID are documented in :doc:`fix ` command * bond/break = style name of this fix command * Nevery = attempt bond breaking every this many steps -* bondtype = type of bonds to break +* bondtype = type of bonds to break (integer or type label) * Rmax = bond longer than Rmax can break (distance units) * zero or more keyword/value pairs may be appended * keyword = *prob* diff --git a/src/MC/fix_bond_break.cpp b/src/MC/fix_bond_break.cpp index bb3e725c96..94ec5a89bb 100644 --- a/src/MC/fix_bond_break.cpp +++ b/src/MC/fix_bond_break.cpp @@ -46,8 +46,8 @@ FixBondBreak::FixBondBreak(LAMMPS *lmp, int narg, char **arg) : MPI_Comm_rank(world,&me); MPI_Comm_size(world,&nprocs); - nevery = utils::inumeric(FLERR,arg[3],false,lmp); - if (nevery <= 0) error->all(FLERR,"Illegal fix bond/break command"); + nevery = utils::inumeric(FLERR, arg[3], false, lmp); + if (nevery <= 0) error->all(FLERR, "Illegal fix bond/break command"); force_reneighbor = 1; next_reneighbor = -1; @@ -56,8 +56,8 @@ FixBondBreak::FixBondBreak(LAMMPS *lmp, int narg, char **arg) : global_freq = 1; extvector = 0; - btype = utils::inumeric(FLERR,arg[4],false,lmp); - cutoff = utils::numeric(FLERR,arg[5],false,lmp); + btype = utils::expand_type_int(FLERR, arg[4], Atom::BOND, lmp); + cutoff = utils::numeric(FLERR, arg[5], false, lmp); if (btype < 1 || btype > atom->nbondtypes) error->all(FLERR,"Invalid bond type in fix bond/break command");