remove include/using/enum's no longer needed
This commit is contained in:
@ -22,23 +22,8 @@
|
|||||||
#include "atom_kokkos.h"
|
#include "atom_kokkos.h"
|
||||||
#include "atom_masks.h"
|
#include "atom_masks.h"
|
||||||
#include "domain_kokkos.h"
|
#include "domain_kokkos.h"
|
||||||
#include "force.h"
|
|
||||||
#include "input.h"
|
|
||||||
#include "irregular.h"
|
|
||||||
#include "kspace.h"
|
|
||||||
#include "math_const.h"
|
|
||||||
#include "modify.h"
|
|
||||||
#include "update.h"
|
|
||||||
#include "variable.h"
|
|
||||||
|
|
||||||
#include <cmath>
|
|
||||||
|
|
||||||
using namespace LAMMPS_NS;
|
using namespace LAMMPS_NS;
|
||||||
using namespace FixConst;
|
|
||||||
using namespace MathConst;
|
|
||||||
|
|
||||||
enum{NONE=0,FINAL,DELTA,SCALE,VEL,ERATE,TRATE,VOLUME,WIGGLE,VARIABLE};
|
|
||||||
enum{ONE_FROM_ONE,ONE_FROM_TWO,TWO_FROM_ONE};
|
|
||||||
|
|
||||||
/* ---------------------------------------------------------------------- */
|
/* ---------------------------------------------------------------------- */
|
||||||
|
|
||||||
|
|||||||
@ -90,10 +90,15 @@ bool verbose = false;
|
|||||||
|
|
||||||
static const double EPSILON = 5.0e-14;
|
static const double EPSILON = 5.0e-14;
|
||||||
|
|
||||||
|
|
||||||
namespace LAMMPS_NS {
|
namespace LAMMPS_NS {
|
||||||
using ::testing::Eq;
|
using ::testing::Eq;
|
||||||
|
using ::testing::TestWithParam;
|
||||||
|
using ::testing::Values;
|
||||||
|
|
||||||
class AtomStyleTest : public LAMMPSTest {
|
enum ACCELERATOR { PLAIN, KOKKOS_OMP };
|
||||||
|
|
||||||
|
class AtomStyleTest : public LAMMPSTest, public ::testing::WithParamInterface<ACCELERATOR> {
|
||||||
protected:
|
protected:
|
||||||
static void SetUpTestSuite() { create_molecule_files("h2o.mol", "co2.mol"); }
|
static void SetUpTestSuite() { create_molecule_files("h2o.mol", "co2.mol"); }
|
||||||
|
|
||||||
@ -105,15 +110,18 @@ protected:
|
|||||||
|
|
||||||
void SetUp() override
|
void SetUp() override
|
||||||
{
|
{
|
||||||
|
if( GetParam() == KOKKOS_OMP )
|
||||||
|
args = {"-k","on","t","4","-sf","kk"};
|
||||||
|
|
||||||
testbinary = "AtomStyleTest";
|
testbinary = "AtomStyleTest";
|
||||||
LAMMPSTest::SetUp();
|
LAMMPSTest::SetUp();
|
||||||
ASSERT_NE(lmp, nullptr);
|
ASSERT_NE(lmp, nullptr);
|
||||||
BEGIN_HIDE_OUTPUT();
|
//BEGIN_HIDE_OUTPUT();
|
||||||
command("units real");
|
command("units real");
|
||||||
command("dimension 3");
|
command("dimension 3");
|
||||||
command("pair_style zero 4.0");
|
command("pair_style zero 4.0");
|
||||||
command("region box block -4 4 -4 4 -4 4");
|
command("region box block -4 4 -4 4 -4 4");
|
||||||
END_HIDE_OUTPUT();
|
//END_HIDE_OUTPUT();
|
||||||
}
|
}
|
||||||
|
|
||||||
void TearDown() override
|
void TearDown() override
|
||||||
@ -261,6 +269,11 @@ struct AtomState {
|
|||||||
|
|
||||||
void ASSERT_ATOM_STATE_EQ(Atom *atom, const AtomState &expected)
|
void ASSERT_ATOM_STATE_EQ(Atom *atom, const AtomState &expected)
|
||||||
{
|
{
|
||||||
|
std::string suffix = "/kk";
|
||||||
|
|
||||||
|
if( GetParam() == KOKKOS_OMP )
|
||||||
|
ASSERT_THAT(std::string(atom->atom_style), Eq(expected.atom_style.append(suffix)));
|
||||||
|
else
|
||||||
ASSERT_THAT(std::string(atom->atom_style), Eq(expected.atom_style));
|
ASSERT_THAT(std::string(atom->atom_style), Eq(expected.atom_style));
|
||||||
|
|
||||||
ASSERT_NE(atom->avec, nullptr);
|
ASSERT_NE(atom->avec, nullptr);
|
||||||
@ -466,7 +479,7 @@ void ASSERT_ATOM_STATE_EQ(Atom *atom, const AtomState &expected)
|
|||||||
ASSERT_EQ(atom->map_tag_max, expected.map_tag_max);
|
ASSERT_EQ(atom->map_tag_max, expected.map_tag_max);
|
||||||
}
|
}
|
||||||
|
|
||||||
TEST_F(AtomStyleTest, atomic_is_default)
|
TEST_P(AtomStyleTest, atomic_is_default)
|
||||||
{
|
{
|
||||||
AtomState expected;
|
AtomState expected;
|
||||||
expected.atom_style = "atomic";
|
expected.atom_style = "atomic";
|
||||||
@ -482,7 +495,7 @@ TEST_F(AtomStyleTest, atomic_is_default)
|
|||||||
ASSERT_ATOM_STATE_EQ(lmp->atom, expected);
|
ASSERT_ATOM_STATE_EQ(lmp->atom, expected);
|
||||||
}
|
}
|
||||||
|
|
||||||
TEST_F(AtomStyleTest, atomic_after_charge)
|
TEST_P(AtomStyleTest, atomic_after_charge)
|
||||||
{
|
{
|
||||||
AtomState expected;
|
AtomState expected;
|
||||||
expected.atom_style = "atomic";
|
expected.atom_style = "atomic";
|
||||||
@ -503,7 +516,7 @@ TEST_F(AtomStyleTest, atomic_after_charge)
|
|||||||
ASSERT_ATOM_STATE_EQ(lmp->atom, expected);
|
ASSERT_ATOM_STATE_EQ(lmp->atom, expected);
|
||||||
}
|
}
|
||||||
|
|
||||||
TEST_F(AtomStyleTest, atomic)
|
TEST_P(AtomStyleTest, atomic)
|
||||||
{
|
{
|
||||||
BEGIN_HIDE_OUTPUT();
|
BEGIN_HIDE_OUTPUT();
|
||||||
command("atom_modify map hash");
|
command("atom_modify map hash");
|
||||||
@ -693,7 +706,9 @@ TEST_F(AtomStyleTest, atomic)
|
|||||||
EXPECT_NEAR(x[GETIDX(16)][2], 7.9, EPSILON);
|
EXPECT_NEAR(x[GETIDX(16)][2], 7.9, EPSILON);
|
||||||
}
|
}
|
||||||
|
|
||||||
TEST_F(AtomStyleTest, no_tags)
|
/*
|
||||||
|
|
||||||
|
TEST_P(AtomStyleTest, no_tags)
|
||||||
{
|
{
|
||||||
BEGIN_HIDE_OUTPUT();
|
BEGIN_HIDE_OUTPUT();
|
||||||
command("atom_modify id no");
|
command("atom_modify id no");
|
||||||
@ -5376,8 +5391,14 @@ TEST_F(AtomStyleTest, oxdna)
|
|||||||
END_HIDE_OUTPUT();
|
END_HIDE_OUTPUT();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
*/
|
||||||
|
|
||||||
|
INSTANTIATE_TEST_SUITE_P( TestSuite, AtomStyleTest,
|
||||||
|
::testing::Values(PLAIN, KOKKOS_OMP) );
|
||||||
|
|
||||||
} // namespace LAMMPS_NS
|
} // namespace LAMMPS_NS
|
||||||
|
|
||||||
|
|
||||||
int main(int argc, char **argv)
|
int main(int argc, char **argv)
|
||||||
{
|
{
|
||||||
MPI_Init(&argc, &argv);
|
MPI_Init(&argc, &argv);
|
||||||
@ -5398,3 +5419,5 @@ int main(int argc, char **argv)
|
|||||||
MPI_Finalize();
|
MPI_Finalize();
|
||||||
return rv;
|
return rv;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user