Skip to content
Snippets Groups Projects
Commit 94d43fd8 authored by Van Herck, Walter's avatar Van Herck, Walter
Browse files

Added unit test for HCP lattice

parent 0df38835
No related branches found
No related tags found
No related merge requests found
......@@ -44,3 +44,22 @@ TEST_F(LatticeUtilsTest, diagonalAlignedFCCTest)
EXPECT_EQ(a1.x(), a2.x());
EXPECT_EQ(a1.y(), -a2.y());
}
// tests the creation of an HCP lattice
TEST_F(LatticeUtilsTest, trivialAlignedHCPTest)
{
MillerIndexOrientation trivial_aligned(MillerIndexOrientation::QZ, { 0, 0, 1},
MillerIndexOrientation::QX, { 2, -1, 0});
auto lattice = LatticeUtils::CreateHCPLattice(2.0, 4.0, trivial_aligned);
auto a1 = lattice.getBasisVectorA();
auto a2 = lattice.getBasisVectorB();
auto a3 = lattice.getBasisVectorC();
kvector_t v1 { 2.0, 0.0, 0.0 };
kvector_t v2 { -1.0, std::sqrt(3.0), 0.0 };
kvector_t v3 { 1.0, 1.0/std::sqrt(3.0), 2.0 };
EXPECT_EQ(a1, v1);
EXPECT_EQ(a2, v2);
EXPECT_EQ(a3, v3);
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment