1 #define BOOST_TEST_DYN_LINK
2 #include <boost/test/unit_test.hpp>
16 BOOST_AUTO_TEST_SUITE(ScelEnumTest)
26 Eigen::Vector3d a, b, c;
29 std::vector<std::string> m_names;
34 ScelEnumByProps e(primclex, enum_props);
36 BOOST_CHECK_EQUAL(e.name(),
"ScelEnumByProps");
40 BOOST_CHECK_EQUAL(it.name(),
"ScelEnumByProps");
46 for(; it != end; ++it, ++count) {
47 m_names.push_back(it->get_name());
50 it->get_real_super_lattice(),
55 it->get_real_super_lattice().lat_column_mat(),
60 std::cout <<
"superlat: \n" << it->get_real_super_lattice().lat_column_mat() << std::endl;
61 std::cout <<
"canon_check: \n" << canon_check.
lat_column_mat() << std::endl;
64 BOOST_CHECK_EQUAL(check,
true);
66 BOOST_CHECK_EQUAL(it->is_canonical(),
true);
69 BOOST_CHECK_EQUAL(count, 114);
70 BOOST_CHECK(it == end);
76 BOOST_CHECK_EQUAL(e.name(),
"ScelEnumByName");
80 BOOST_CHECK_EQUAL(it.
name(),
"ScelEnumByName");
86 for(; it != end; ++it, ++count) {
89 BOOST_CHECK_EQUAL(count, 114);
90 BOOST_CHECK(it == end);
109 auto exec = [&](
const std::string & args) {
110 CommandArgs cmdargs(args, &primclex, proj.
dir, ss_log, ss_err_log);
117 BOOST_CHECK_EQUAL(exec(
"casm enum -h"), 0);
118 BOOST_CHECK_EQUAL(exec(
"casm enum --method ScelEnum --max 4"), 0);
119 BOOST_CHECK_EQUAL(exec(
"casm enum --method ConfigEnumAllOccupations --all"), 0);
120 BOOST_CHECK_EQUAL(exec(
"casm enum --method ScelEnum --max 8"), 0);
121 BOOST_CHECK_EQUAL(exec(
"casm enum --method ConfigEnumAllOccupations --max 6 -i '{\"existing_only\":true}'"), 0);
125 BOOST_AUTO_TEST_SUITE_END()
Data structure holding basic CASM command info.
BOOST_AUTO_TEST_CASE(Test1)
const SymGroup & point_group() const
std::string name() const override
Derived enumerators must implement name, via ENUM_MEMBERS.
Data structure for holding supercell enumeration properties.
const Lattice & lattice() const
const Eigen::Matrix3d & lat_column_mat() const
3x3 matrix with lattice vectors as its columne
bool set_crystallography_tol(double _tol)
Set crystallography tolerance.
double crystallography_tol() const
EigenIndex Index
For long integer indexing:
Lattice canonical_equivalent_lattice(const Lattice &in_lat, const SymGroup &point_grp, double compare_tol)
Find the niggli, most standard oriented version of the given orbit (defined by the given SymGroup) of...
ProjectSettings & settings()
PrimClex is the top-level data structure for a CASM project.
Enumerate over Supercell.
std::tuple< LatVec, LatVec, LatVec > vectors()
bool check(std::string test, const jsonParser &expected, const jsonParser &calculated, fs::path test_cases_path, bool quiet, double tol=0.0)
Check expected JSON vs calculated JSON using BOOST_CHECK_EQUAL.
virtual void check_init()
Check project initialization.
bool almost_equal(const GenericCluster< CoordType > &LHS, const GenericCluster< CoordType > &RHS, double tol)
const Structure & get_prim() const
const Access to primitive Structure
int casm_api(const CommandArgs &args)
Executes CASM commands specified by args.