1 #ifndef CASMtest_FCCTernaryProj
2 #define CASMtest_FCCTernaryProj
27 struc.title =
"FCC_ternary";
48 "FCC Ternary with A, B, C occupation") {}
52 std::string str = R
"({
54 "site_basis_functions" : "occupation"
56 "orbit_branch_specs" : {
57 "2" : {"max_length" : 4.01},
58 "3" : {"max_length" : 3.01}
62 "coordinate_mode" : "Direct",
64 [ 0.000000000000, 0.000000000000, 0.000000000000 ],
65 [ 1.000000000000, 0.000000000000, 0.000000000000 ],
66 [ 2.000000000000, 0.000000000000, 0.000000000000 ],
67 [ 3.000000000000, 0.000000000000, 0.000000000000 ]
69 "include_subclusters" : true
72 "coordinate_mode" : "Direct",
74 [ 0.000000000000, 0.000000000000, 0.000000000000 ],
75 [ 0.000000000000, 1.000000000000, 0.000000000000 ],
76 [ 0.000000000000, 0.000000000000, 1.000000000000 ],
77 [ 1.000000000000, 1.000000000000, 1.000000000000 ]
79 "include_subclusters" : true
90 std::string str = R
"({
92 "site_basis_functions" : "occupation"
94 "orbit_branch_specs" : {
95 "2" : {"max_length" : 4.01},
96 "3" : {"max_length" : 3.01}
100 "coordinate_mode" : "Direct",
102 [ 0.000000000000, 0.000000000000, 0.000000000000 ],
103 [ 1.000000000000, 0.000000000000, 0.000000000000 ],
104 [ 2.000000000000, 0.000000000000, 0.000000000000 ],
105 [ 3.000000000000, 0.000000000000, 0.000000000000 ],
107 "include_subclusters" : true
110 "coordinate_mode" : "Direct",
112 [ 0.000000000000, 0.000000000000, 0.000000000000 ],
113 [ 0.000000000000, 1.000000000000, 0.000000000000 ],
114 [ 0.000000000000, 0.000000000000, 1.000000000000 ],
115 [ 1.000000000000, 1.000000000000, 1.000000000000 ]
117 "include_subclusters" : true
128 _check_symmetry(48, 10, 48, 10, 48, 10,
"Oh",
"Oh");
132 std::vector<std::string> axes = {
133 R
"(\s+0\s+A\s+B\s+C\s+A\(1-a-b\)B\(a\)C\(b\))",
134 R"(\s+1\s+B\s+A\s+C\s+A\(a\)B\(1-a-b\)C\(b\))",
135 R"(\s+2\s+C\s+A\s+B\s+A\(a\)B\(b\)C\(1-a-b\))"
138 _check_composition_axes(axes.begin(), axes.end());
146 fs::ofstream file(
dir /
"basis_sets" /
"bset.default" /
"bspecs.json");
147 file << invalid_bspecs() <<
"\n";
149 m_p.popen(cd_and() +
"ccasm bset -u");
150 BOOST_CHECK_MESSAGE(m_p.exit_code() == 4, m_p.gets());
153 bspecs().write(
dir /
"basis_sets" /
"bset.default" /
"bspecs.json");
155 m_p.popen(cd_and() +
"ccasm bset -u");
156 BOOST_CHECK_MESSAGE(m_p.exit_code() == 0, m_p.gets());
158 BOOST_CHECK_MESSAGE(boost::regex_search(m_p.gets(), m_match, boost::regex(R
"(write:.*clust\.json)")) == true, m_p.gets());
159 BOOST_CHECK_MESSAGE(boost::regex_search(m_p.gets(), m_match, boost::regex(R
"(write:.*basis\.json)")) == true, m_p.gets());
160 BOOST_CHECK_MESSAGE(boost::regex_search(m_p.gets(), m_match, boost::regex(R
"(write:.*)" + title + R"(_Clexulator\.cc)")) == true, m_p.gets());
162 BOOST_CHECK_MESSAGE(
true == fs::exists(m_dirs.clust(m_set->default_clex().bset)), m_p.gets());
163 BOOST_CHECK_MESSAGE(
true == fs::exists(m_dirs.clexulator_src(m_set->name(), m_set->default_clex().bset)), m_p.gets());
170 std::string pattern = R
"(\*\* Branch [0-9]+ \*\*)";
171 boost::regex re(pattern);
173 std::vector<std::string> checks = {
174 "ccasm bset --orbits",
175 "ccasm bset --clusters",
176 "ccasm bset --functions"
179 for(
auto it = checks.begin(); it != checks.end(); ++it) {
180 m_p.popen(cd_and() + *it);
183 auto begin = boost::sregex_iterator(str.begin(), str.end(), re);
184 auto end = boost::sregex_iterator();
185 auto count = std::distance(begin, end);
187 BOOST_CHECK_MESSAGE(count == 5, m_p.gets());
191 m_p.popen(cd_and() +
"ccasm bset -u");
192 BOOST_CHECK_EQUAL(m_p.exit_code(), 6);
194 m_p.popen(cd_and() +
"ccasm bset -uf");
195 BOOST_CHECK_EQUAL(m_p.exit_code(), 0);
203 m_p.popen(cd_and() +
"ccasm enum --method ScelEnum --max 10");
204 std::stringstream ss;
211 m_p.popen(cd_and() +
"ccasm enum --method ConfigEnumAllOccupations --max 6");
212 std::stringstream ss;
boost::container::stable_vector< Supercell > & get_supercell_list()
Access entire supercell_list.
void check_symmetry() override
Check symmetry.
void check_composition() override
Check "casm composition".
void push_back(const T &toPush)
void check_bset() override
Uses bspecs() and checks that 5 branches are generated, and that –orbits, –clusters, and –functions run without error.
Molecule make_atom(std::string atom_name, const Lattice &lat)
Return an atomic Molecule with specified name and Lattice.
config_iterator config_begin()
Configuration iterator: begin.
config_iterator config_end()
Configuration iterator: end.
fs::path proj_dir(fs::path init)
Create a new project directory, appending ".(#)" to ensure it is a new project.
Represents cartesian and fractional coordinates.
BasicStructure< Site > FCC_ternary_prim()
PrimClex is the top-level data structure for a CASM project.
void check_enum() override
Check "ccasm enum".
std::string invalid_bspecs() const
static jsonParser parse(const std::string &str)
Construct a jsonParser from a string containing JSON data.
static jsonParser bspecs()