From 9381a13d9f94457ff481657f8a192b3ea159f89e Mon Sep 17 00:00:00 2001 From: Jinzhe Zeng Date: Thu, 19 Sep 2024 00:06:38 -0400 Subject: [PATCH] fix compile errors Signed-off-by: Jinzhe Zeng --- source/api_cc/tests/test_deeppot_dpa_pt.cc | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/source/api_cc/tests/test_deeppot_dpa_pt.cc b/source/api_cc/tests/test_deeppot_dpa_pt.cc index 29bf560748..7bf4cbf376 100644 --- a/source/api_cc/tests/test_deeppot_dpa_pt.cc +++ b/source/api_cc/tests/test_deeppot_dpa_pt.cc @@ -171,7 +171,7 @@ class TestInferDeepPotDpaPtNopbc : public ::testing::Test { 00.25, 3.32, 1.68, 3.36, 3.00, 1.81, 3.51, 2.51, 2.60, 4.27, 3.22, 1.56}; std::vector atype = {0, 1, 1, 0, 1, 1}; - std::vector box = nullptr; + std::vector box = {}; // Generated by the following Python code: // import numpy as np // from deepmd.infer import DeepPot @@ -329,11 +329,11 @@ TYPED_TEST(TestInferDeepPotDpaPtNopbc, cpu_lmp_nlist) { std::vector > nlist_data = { {1, 2, 3, 4, 5}, {0, 2, 3, 4, 5}, {0, 1, 3, 4, 5}, {0, 1, 2, 4, 5}, {0, 1, 2, 3, 5}, {0, 1, 2, 3, 4}}; - std::vector ilist(nloc), numneigh(nloc); - std::vector firstneigh(nloc); - deepmd::InputNlist inlist(nloc, &ilist[0], &numneigh[0], &firstneigh[0]); + std::vector ilist(natoms), numneigh(natoms); + std::vector firstneigh(natoms); + deepmd::InputNlist inlist(natoms, &ilist[0], &numneigh[0], &firstneigh[0]); convert_nlist(inlist, nlist_data); - dp.compute(ener, force, virial, coord, atype, box, 0, nlist, 0); + dp.compute(ener, force, virial, coord, atype, box, 0, inlist, 0); EXPECT_EQ(force.size(), natoms * 3); EXPECT_EQ(virial.size(), 9); @@ -365,12 +365,12 @@ TYPED_TEST(TestInferDeepPotDpaPtNopbc, cpu_lmp_nlist_atomic) { std::vector > nlist_data = { {1, 2, 3, 4, 5}, {0, 2, 3, 4, 5}, {0, 1, 3, 4, 5}, {0, 1, 2, 4, 5}, {0, 1, 2, 3, 5}, {0, 1, 2, 3, 4}}; - std::vector ilist(nloc), numneigh(nloc); - std::vector firstneigh(nloc); - deepmd::InputNlist inlist(nloc, &ilist[0], &numneigh[0], &firstneigh[0]); + std::vector ilist(natoms), numneigh(natoms); + std::vector firstneigh(natoms); + deepmd::InputNlist inlist(natoms, &ilist[0], &numneigh[0], &firstneigh[0]); convert_nlist(inlist, nlist_data); dp.compute(ener, force, virial, atom_ener, atom_vir, coord, atype, box, 0, - nlist, 0); + inlist, 0); EXPECT_EQ(force.size(), natoms * 3); EXPECT_EQ(virial.size(), 9);