Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Test: update cmake and support files in module_cell #1849

Merged
merged 1 commit into from
Feb 3, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 4 additions & 5 deletions source/module_cell/test/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -9,16 +9,15 @@ AddTest(
SOURCES read_pp_upf_test.cpp ../read_pp.cpp ../read_pp_upf201.cpp ../read_pp_upf100.cpp ../read_pp_vwr.cpp ../read_pp_blps.cpp ../../src_parallel/parallel_reduce.cpp ../../src_parallel/parallel_kpoints.cpp ../../src_parallel/parallel_global.cpp ../../src_parallel/parallel_common.cpp ../../module_io/output.cpp
)

install(DIRECTORY support DESTINATION ${CMAKE_CURRENT_BINARY_DIR})

AddTest(
TARGET klist_test
LIBS ${math_libs} base device
SOURCES klist_test.cpp ../klist.cpp
../../src_parallel/parallel_reduce.cpp ../../src_parallel/parallel_kpoints.cpp
../../src_parallel/parallel_global.cpp ../../src_parallel/parallel_common.cpp
../../module_io/output.cpp ../../module_cell/module_symmetry/symm_other.cpp
../../module_cell/module_symmetry/symmetry_basic.cpp ../../module_cell/module_symmetry/symmetry.cpp
../../module_io/output.cpp ../module_symmetry/symm_other.cpp
../module_symmetry/symmetry_basic.cpp ../module_symmetry/symmetry.cpp
)

install(FILES KPT KPT1 KPT2 KPT4 KPT5 DESTINATION ${CMAKE_CURRENT_BINARY_DIR})
install(DIRECTORY support DESTINATION ${CMAKE_CURRENT_BINARY_DIR})

26 changes: 13 additions & 13 deletions source/module_cell/test/klist_test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -115,33 +115,33 @@ TEST_F(KlistTest, MP)

TEST_F(KlistTest, ReadMesh)
{
std::string k_file = "KPT";
std::string k_file = "./support/KPT";
kv.nspin = 1;
kv.read_kpoints(k_file);
EXPECT_EQ(kv.nkstot,512);
remove("KPT");
//remove("KPT");
}

TEST_F(KlistTest, ReadMP)
{
K_Vectors kv;
std::string k_file = "KPT1";
std::string k_file = "./support/KPT1";
kv.nspin = 1;
kv.read_kpoints(k_file);
EXPECT_EQ(kv.nkstot,512);
remove("KPT1");
//remove("KPT1");
}

TEST_F(KlistTest, ReadList)
{
ModuleSymmetry::Symmetry::symm_flag=0;
// symm_flag is required in read_kpoints for a k list
K_Vectors kv;
std::string k_file = "KPT2";
std::string k_file = "./support/KPT2";
kv.nspin = 1;
kv.read_kpoints(k_file);
EXPECT_EQ(kv.nkstot,122);
remove("KPT2");
//remove("KPT2");
}

TEST_F(KlistTest, Kspacing)
Expand All @@ -154,18 +154,18 @@ TEST_F(KlistTest, Kspacing)
GlobalC::ucell.G = GlobalC::ucell.GT.Transpose();
GlobalC::ucell.lat0 = 1.8897261254578281;
GlobalV::KSPACING = 0.052918; // 0.52918/Bohr = 1/A
std::string k_file = "KPT3";
std::string k_file = "./support/KPT3";
kv.read_kpoints(k_file);
EXPECT_EQ(kv.nkstot,343);
remove("KPT3");
//remove("KPT3");
GlobalV::KSPACING=0.0;

}

TEST_F(KlistTest, Renew)
{
K_Vectors kv;
std::string k_file = "KPT4";
std::string k_file = "./support/KPT4";
//Cartesian: non-spin case nspin=1
kv.nspin = 1;
kv.read_kpoints(k_file);
Expand All @@ -182,7 +182,7 @@ TEST_F(KlistTest, Renew)
TEST_F(KlistTest, LineCartesian)
{
K_Vectors kv;
std::string k_file = "KPT5";
std::string k_file = "./support/KPT5";
//Line Cartesian: non-spin case nspin=1
kv.nspin = 1;
kv.set_kup_and_kdw_after_vc();
Expand All @@ -196,15 +196,15 @@ TEST_F(KlistTest, LineCartesian)
kv.read_kpoints(k_file);
EXPECT_EQ(kv.nkstot,51);
EXPECT_EQ(kv.kvec_c.size(),102);
remove("KPT5");
//remove("KPT5");


}

TEST_F(KlistTest, SetKupKdownAfterXC)
{
K_Vectors kv;
std::string k_file = "KPT4";
std::string k_file = "./support/KPT4";
//Cartesian: non-spin case nspin=1
kv.nspin = 1;
kv.read_kpoints(k_file);
Expand Down Expand Up @@ -238,7 +238,7 @@ TEST_F(KlistTest, SetKupKdownAfterXC)
EXPECT_EQ(kv.isk[ik+5],1);
}

remove("KPT4");
//remove("KPT4");


}
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.