Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
BornAgain
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
mlz
BornAgain
Commits
77d35317
Commit
77d35317
authored
3 years ago
by
Wuttke, Joachim
Browse files
Options
Downloads
Patches
Plain Diff
split declarations
parent
35587d89
No related branches found
No related tags found
1 merge request
!454
Further changes suggested by clang-tidy
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
Tests/Unit/Sample/LatticeTest.cpp
+21
-7
21 additions, 7 deletions
Tests/Unit/Sample/LatticeTest.cpp
with
21 additions
and
7 deletions
Tests/Unit/Sample/LatticeTest.cpp
+
21
−
7
View file @
77d35317
...
@@ -38,7 +38,9 @@ TEST_F(LatticeTest, declarationTest)
...
@@ -38,7 +38,9 @@ TEST_F(LatticeTest, declarationTest)
// tests volume of the unit cell
// tests volume of the unit cell
TEST_F
(
LatticeTest
,
volumeTest
)
TEST_F
(
LatticeTest
,
volumeTest
)
{
{
R3
a1
(
4
,
0
,
0
),
a2
(
0
,
2.1
,
0
),
a3
(
0
,
0
,
1
);
R3
a1
(
4
,
0
,
0
);
R3
a2
(
0
,
2.1
,
0
);
R3
a3
(
0
,
0
,
1
);
Lattice3D
l1
(
a1
,
a2
,
a3
);
Lattice3D
l1
(
a1
,
a2
,
a3
);
EXPECT_EQ
(
8.4
,
l1
.
unitCellVolume
());
// 8.4 is the expected volume for the given lattice vectors
EXPECT_EQ
(
8.4
,
l1
.
unitCellVolume
());
// 8.4 is the expected volume for the given lattice vectors
...
@@ -47,7 +49,9 @@ TEST_F(LatticeTest, volumeTest)
...
@@ -47,7 +49,9 @@ TEST_F(LatticeTest, volumeTest)
// tests whether reciprocal lattice basis vectors have been initialized or not
// tests whether reciprocal lattice basis vectors have been initialized or not
TEST_F
(
LatticeTest
,
reciprocalTest
)
TEST_F
(
LatticeTest
,
reciprocalTest
)
{
{
R3
a1
(
1
,
0
,
0
),
a2
(
0
,
1
,
0
),
a3
(
0
,
0
,
1
);
R3
a1
(
1
,
0
,
0
);
R3
a2
(
0
,
1
,
0
);
R3
a3
(
0
,
0
,
1
);
Lattice3D
l1
(
a1
,
a2
,
a3
);
Lattice3D
l1
(
a1
,
a2
,
a3
);
R3
b1
,
b2
,
b3
,
m_ra
,
m_rb
,
m_rc
;
R3
b1
,
b2
,
b3
,
m_ra
,
m_rb
,
m_rc
;
...
@@ -69,7 +73,9 @@ TEST_F(LatticeTest, reciprocalTest)
...
@@ -69,7 +73,9 @@ TEST_F(LatticeTest, reciprocalTest)
// tests whether Lattice has been transformed correctly
// tests whether Lattice has been transformed correctly
TEST_F
(
LatticeTest
,
transformTest
)
TEST_F
(
LatticeTest
,
transformTest
)
{
{
R3
a1
(
1
,
0
,
0
),
a2
(
0
,
1
,
0
),
a3
(
0
,
0
,
1
);
R3
a1
(
1
,
0
,
0
);
R3
a2
(
0
,
1
,
0
);
R3
a3
(
0
,
0
,
1
);
Lattice3D
l1
(
a1
,
a2
,
a3
);
Lattice3D
l1
(
a1
,
a2
,
a3
);
// use rotation by 90 degrees around z axis as a transformation
// use rotation by 90 degrees around z axis as a transformation
...
@@ -90,7 +96,9 @@ TEST_F(LatticeTest, transformTest)
...
@@ -90,7 +96,9 @@ TEST_F(LatticeTest, transformTest)
// tests the nearest REC. LATTICE point to a given REC. SPACE vector
// tests the nearest REC. LATTICE point to a given REC. SPACE vector
TEST_F
(
LatticeTest
,
NearestReciprocalLatticeVectorCoordinatesTest
)
TEST_F
(
LatticeTest
,
NearestReciprocalLatticeVectorCoordinatesTest
)
{
{
R3
a1
(
1
,
0
,
0
),
a2
(
0
,
1
,
0
),
a3
(
0
,
0
,
1
);
R3
a1
(
1
,
0
,
0
);
R3
a2
(
0
,
1
,
0
);
R3
a3
(
0
,
0
,
1
);
Lattice3D
l1
(
a1
,
a2
,
a3
);
Lattice3D
l1
(
a1
,
a2
,
a3
);
// vector_in is in REC. SPACE coordinates
// vector_in is in REC. SPACE coordinates
...
@@ -106,7 +114,9 @@ TEST_F(LatticeTest, NearestReciprocalLatticeVectorCoordinatesTest)
...
@@ -106,7 +114,9 @@ TEST_F(LatticeTest, NearestReciprocalLatticeVectorCoordinatesTest)
// radius of a given REC. SPACE vector
// radius of a given REC. SPACE vector
TEST_F
(
LatticeTest
,
reciprocalLatticeVectorsWithinRadiusTest
)
TEST_F
(
LatticeTest
,
reciprocalLatticeVectorsWithinRadiusTest
)
{
{
R3
a1
(
1
,
0
,
0
),
a2
(
0
,
1
,
0
),
a3
(
0
,
0
,
1
);
R3
a1
(
1
,
0
,
0
);
R3
a2
(
0
,
1
,
0
);
R3
a3
(
0
,
0
,
1
);
Lattice3D
l1
(
a1
,
a2
,
a3
);
Lattice3D
l1
(
a1
,
a2
,
a3
);
R3
b1
,
b2
,
b3
;
R3
b1
,
b2
,
b3
;
...
@@ -134,7 +144,9 @@ TEST_F(LatticeTest, FCCLatticeTest)
...
@@ -134,7 +144,9 @@ TEST_F(LatticeTest, FCCLatticeTest)
// creates FCC lattice onto a new Lattice instance l1
// creates FCC lattice onto a new Lattice instance l1
Lattice3D
l1
=
bake
::
FCCLattice
(
1
);
Lattice3D
l1
=
bake
::
FCCLattice
(
1
);
R3
fcc1
(
0
,
0.5
,
0.5
),
fcc2
(
0.5
,
0
,
0.5
),
fcc3
(
0.5
,
0.5
,
0
);
R3
fcc1
(
0
,
0.5
,
0.5
);
R3
fcc2
(
0.5
,
0
,
0.5
);
R3
fcc3
(
0.5
,
0.5
,
0
);
EXPECT_EQ
(
fcc1
,
l1
.
getBasisVectorA
());
EXPECT_EQ
(
fcc1
,
l1
.
getBasisVectorA
());
EXPECT_EQ
(
fcc2
,
l1
.
getBasisVectorB
());
EXPECT_EQ
(
fcc2
,
l1
.
getBasisVectorB
());
...
@@ -159,7 +171,9 @@ TEST_F(LatticeTest, HexagonalLattice2DTest)
...
@@ -159,7 +171,9 @@ TEST_F(LatticeTest, HexagonalLattice2DTest)
// vectors are manually changed using the setVectorValue method
// vectors are manually changed using the setVectorValue method
TEST_F
(
LatticeTest
,
onChangeTest
)
TEST_F
(
LatticeTest
,
onChangeTest
)
{
{
R3
a1
(
1
,
0
,
0
),
a2
(
0
,
1
,
0
),
a3
(
0
,
0
,
1
);
R3
a1
(
1
,
0
,
0
);
R3
a2
(
0
,
1
,
0
);
R3
a3
(
0
,
0
,
1
);
Lattice3D
l1
(
a1
,
a2
,
a3
);
Lattice3D
l1
(
a1
,
a2
,
a3
);
R3
b1
,
b2
,
b3
,
m_ra
,
m_rb
,
m_rc
;
R3
b1
,
b2
,
b3
,
m_ra
,
m_rb
,
m_rc
;
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment