CASM
AClustersApproachtoStatisticalMechanics
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules
Clexulator_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 
10 #include <boost/filesystem.hpp>
11 
12 using namespace CASM;
13 
14 BOOST_AUTO_TEST_SUITE(ClexulatorTest)
15 
16 BOOST_AUTO_TEST_CASE(MakeClexulatorTest) {
17  namespace fs = boost::filesystem;
18 
19  std::string compile_opt = RuntimeLibrary::default_cxx().first + " " + RuntimeLibrary::default_cxxflags().first + " -Iinclude";
20  std::string so_opt = RuntimeLibrary::default_cxx().first + " " + RuntimeLibrary::default_soflags().first;
21 
22  if(!RuntimeLibrary::default_boost_includedir().first.empty()) {
23  compile_opt += " " + include_path(RuntimeLibrary::default_boost_includedir().first);
24  }
25 
26  if(!RuntimeLibrary::default_boost_libdir().first.empty()) {
27  so_opt += " " + link_path(RuntimeLibrary::default_boost_libdir().first);
28  }
29 
30  std::vector<int> sublat_indices = {0};
32  W.row(0) << 2, 1, 1;
33  W.row(1) << 1, 2, 1;
34  W.row(2) << 1, 1, 2;
35 
36  PrimNeighborList nlist(W, sublat_indices.begin(), sublat_indices.end());
37 
38  Log dumblog = null_log();
39 
40  Clexulator clexulator("test_Clexulator",
41  "tests/unit/clex",
42  nlist,
43  dumblog,
44  compile_opt,
45  so_opt);
46 
47  BOOST_CHECK_EQUAL(clexulator.corr_size(), 75);
48 
49 }
50 
51 BOOST_AUTO_TEST_SUITE_END()
static std::pair< std::string, std::string > default_cxxflags()
Default c++ compiler options.
std::string include_path(const fs::path &dir)
std::string link_path(const fs::path &dir)
static std::pair< std::string, std::string > default_cxx()
Return default compiler.
size_type corr_size() const
Number of correlations.
Definition: Clexulator.hh:370
Main CASM namespace.
Definition: complete.cpp:8
Log & null_log()
Definition: Log.hh:211
static std::pair< fs::path, std::string > default_boost_libdir()
Return default libdir for boost.
Evaluates correlations.
Definition: Clexulator.hh:240
static std::pair< std::string, std::string > default_soflags()
Default c++ compiler options.
The PrimNeighborList gives the coordinates of UnitCell that are neighbors of the origin UnitCell...
Definition: NeighborList.hh:24
BOOST_AUTO_TEST_CASE(MakeClexulatorTest)
static std::pair< fs::path, std::string > default_boost_includedir()
Return default includedir for boost.
Definition: Log.hh:9
Eigen::Matrix3l Matrix3Type
Definition: NeighborList.hh:31