CASM
AClustersApproachtoStatisticalMechanics
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules
ScelEnumEquivalents_test.cpp
Go to the documentation of this file.
1 #define BOOST_TEST_DYN_LINK
2 #include <boost/test/unit_test.hpp>
3 
6 
8 
9 #include "Common.hh"
10 #include "FCCTernaryProj.hh"
11 
12 using namespace CASM;
13 
14 BOOST_AUTO_TEST_SUITE(ScelEnumEquivalentsTest)
15 
17 
18  test::ZrOProj proj;
19  proj.check_init();
20 
21  PrimClex primclex(proj.dir, null_log());
22 
23  Eigen::Vector3d a, b, c;
24  std::tie(a, b, c) = primclex.get_prim().lattice().vectors();
25 
26  {
27  Supercell scel {&primclex, Lattice(a, b, c)};
28  ScelEnumEquivalents e(scel);
29  BOOST_CHECK_EQUAL(1, std::distance(e.begin(), e.end()));
30  }
31 
32  {
33  Supercell scel {&primclex, Lattice(2.*a, b, c)};
34  ScelEnumEquivalents e(scel);
35  BOOST_CHECK_EQUAL(3, std::distance(e.begin(), e.end()));
36  }
37 
38  {
39  Supercell scel {&primclex, Lattice(2.*a, 2.*b, c)};
40  ScelEnumEquivalents e(scel);
41  BOOST_CHECK_EQUAL(1, std::distance(e.begin(), e.end()));
42  }
43 
44 }
45 
47 
49  proj.check_init();
50 
51  PrimClex primclex(proj.dir, null_log());
52 
53  Eigen::Vector3d a, b, c;
54  std::tie(a, b, c) = primclex.get_prim().lattice().vectors();
55 
56  {
57  Supercell scel {&primclex, Lattice(a, b, c)};
58  ScelEnumEquivalents e(scel);
59  BOOST_CHECK_EQUAL(1, std::distance(e.begin(), e.end()));
60  }
61 
62  {
63  Supercell scel {&primclex, Lattice(2.*a, b, c)};
64  ScelEnumEquivalents e(scel);
65  BOOST_CHECK_EQUAL(4, std::distance(e.begin(), e.end()));
66  }
67 
68  {
69  Supercell scel {&primclex, Lattice(c, a - b, a + b - c)};
70  ScelEnumEquivalents e(scel);
71  BOOST_CHECK_EQUAL(3, std::distance(e.begin(), e.end()));
72  }
73 
74  {
75  Supercell scel {&primclex, Lattice(2.*a, 2.*b, c)};
76  ScelEnumEquivalents e(scel);
77  BOOST_CHECK_EQUAL(6, std::distance(e.begin(), e.end()));
78  }
79 
80  {
81  Supercell scel {&primclex, Lattice(2.*a, 2.*b, 2.*c)};
82  ScelEnumEquivalents e(scel);
83  BOOST_CHECK_EQUAL(1, std::distance(e.begin(), e.end()));
84  }
85 
86  {
87  Supercell scel {&primclex, Lattice(4.*a, 2.*b, 1.*c)};
88  ScelEnumEquivalents e(scel);
89  BOOST_CHECK_EQUAL(12, std::distance(e.begin(), e.end()));
90  }
91 
92 }
93 
94 BOOST_AUTO_TEST_SUITE_END()
fs::path dir
Definition: Proj.hh:34
PrimClex * primclex
Definition: settings.cc:101
Main CASM namespace.
Definition: complete.cpp:8
const Lattice & lattice() const
Log & null_log()
Definition: Log.hh:211
Represents a supercell of the primitive parent crystal structure.
Definition: Supercell.hh:37
PrimClex is the top-level data structure for a CASM project.
Definition: PrimClex.hh:52
std::tuple< LatVec, LatVec, LatVec > vectors()
Definition: Lattice.hh:65
BOOST_AUTO_TEST_CASE(Test1)
Enumerate equivalent Supercell.
virtual void check_init()
Check project initialization.
const Structure & get_prim() const
const Access to primitive Structure
Definition: PrimClex.cc:260