diff --git a/src/REACTION/fix_bond_react.cpp b/src/REACTION/fix_bond_react.cpp index e6828b24ab..0c309b9ead 100644 --- a/src/REACTION/fix_bond_react.cpp +++ b/src/REACTION/fix_bond_react.cpp @@ -2625,8 +2625,8 @@ void FixBondReact::unlimit_bond() // let's now unlimit in terms of i_limit_tags // we just run through all nlocal, looking for > limit_duration // then we return i_limit_tag to 0 (which removes from dynamic group) - int flag,cols - int index1 = atom->find_custom("limit_tags",flag,cols); + int flag, cols; + int index1 = atom->find_custom("limit_tags",flag,cols); int *i_limit_tags = atom->ivector[index1]; int *i_statted_tags; diff --git a/src/fix_property_atom.cpp b/src/fix_property_atom.cpp index 47c7475524..0ca8a75632 100644 --- a/src/fix_property_atom.cpp +++ b/src/fix_property_atom.cpp @@ -250,7 +250,7 @@ void FixPropertyAtom::init() void FixPropertyAtom::read_data_section(char *keyword, int n, char *buf, tagint id_offset) { - int j,k,m,iword,ncol,nv; + int j,k,m,ncol; tagint itag; char *next; diff --git a/unittest/formats/test_atom_styles.cpp b/unittest/formats/test_atom_styles.cpp index d416074b81..b091360170 100644 --- a/unittest/formats/test_atom_styles.cpp +++ b/unittest/formats/test_atom_styles.cpp @@ -11,6 +11,7 @@ See the README file in the top-level LAMMPS directory. ------------------------------------------------------------------------- */ +#include "../testing/core.h" #include "atom.h" #include "atom_vec_body.h" #include "atom_vec_ellipsoid.h" @@ -24,7 +25,6 @@ #include "utils.h" #include "gmock/gmock.h" #include "gtest/gtest.h" -#include "../testing/core.h" #include #include @@ -48,7 +48,7 @@ using LAMMPS_NS::utils::split_words; -static void create_molecule_files(const std::string & h2o_filename, const std::string & co2_filename) +static void create_molecule_files(const std::string &h2o_filename, const std::string &co2_filename) { // create molecule files const char h2o_file[] = "# Water molecule. SPC/E model.\n\n3 atoms\n2 bonds\n1 angles\n\n" @@ -95,11 +95,10 @@ using ::testing::Eq; class AtomStyleTest : public LAMMPSTest { protected: - static void SetUpTestSuite() { - create_molecule_files("h2o.mol", "co2.mol"); - } + static void SetUpTestSuite() { create_molecule_files("h2o.mol", "co2.mol"); } - static void TearDownTestSuite() { + static void TearDownTestSuite() + { remove("h2o.mol"); remove("co2.mol"); } @@ -237,8 +236,10 @@ struct AtomState { bool has_dihedral = false; bool has_improper = false; - bool has_iname = false; - bool has_dname = false; + bool has_ivname = false; + bool has_dvname = false; + bool has_ianame = false; + bool has_daname = false; bool has_mass = false; bool has_mass_setflag = false; @@ -444,8 +445,10 @@ void ASSERT_ATOM_STATE_EQ(Atom *atom, const AtomState &expected) ASSERT_EQ(atom->nivector, expected.nivector); ASSERT_EQ(atom->ndvector, expected.ndvector); - ASSERT_ARRAY_ALLOCATED(atom->iname, expected.has_iname); - ASSERT_ARRAY_ALLOCATED(atom->dname, expected.has_dname); + ASSERT_ARRAY_ALLOCATED(atom->ivname, expected.has_ivname); + ASSERT_ARRAY_ALLOCATED(atom->dvname, expected.has_dvname); + ASSERT_ARRAY_ALLOCATED(atom->ianame, expected.has_ianame); + ASSERT_ARRAY_ALLOCATED(atom->daname, expected.has_daname); ASSERT_ARRAY_ALLOCATED(atom->mass, expected.has_mass); ASSERT_ARRAY_ALLOCATED(atom->mass_setflag, expected.has_mass_setflag); @@ -4555,7 +4558,8 @@ TEST_F(AtomStyleTest, property_atom) { BEGIN_HIDE_OUTPUT(); command("atom_modify map array"); - command("fix Properties all property/atom i_one d_two mol d_three q rmass ghost yes"); + command("fix Properties all property/atom " + "i_one d_two mol d_three q rmass i2_four 2 d2_five 3 ghost yes"); END_HIDE_OUTPUT(); AtomState expected; @@ -4570,8 +4574,10 @@ TEST_F(AtomStyleTest, property_atom) expected.has_x = true; expected.has_v = true; expected.has_f = true; - expected.has_iname = true; - expected.has_dname = true; + expected.has_ivname = true; + expected.has_dvname = true; + expected.has_ianame = true; + expected.has_daname = true; expected.has_extra_grow = true; expected.has_extra_restart = true; expected.has_extra_border = true; @@ -4614,7 +4620,12 @@ TEST_F(AtomStyleTest, property_atom) command("set atom 2 d_three -1.0"); command("set atom 3 d_three 0.5"); command("set atom 4 d_three 2.0"); - + command("set atom * d2_five[1] -5.9"); + command("set atom * d2_five[2] 1.1e-2"); + command("set atom * d2_five[3] .1"); + command("set atom 1*2 i2_four[1] -2"); + command("set atom 3*4 i2_four[1] -1"); + command("set atom * i2_four[2] 2"); END_HIDE_OUTPUT(); expected.natoms = 4; expected.nlocal = 4;