34 std::string so_options)
39 (dirpath /
name).
string(), compile_options, so_options,
40 "compile time depends on how many basis functions are included");
41 }
catch (std::exception &e) {
42 log() <<
"Clexulator construction failed: could not construct runtime "
57 std::cerr <<
"Error in Clexulator constructor: weight matrix of neighbor "
58 "list does not match the weight matrix used to print the "
61 std::cerr <<
"nlist weight matrix: \n"
63 std::cerr <<
"clexulator weight matrix: \n"
64 <<
m_clex->weight_matrix() << std::endl;
65 throw std::runtime_error(
66 "Error in Clexulator constructor: weight matrix of neighbor list does "
67 "not match the weight matrix used to print the clexulator. Try 'casm "
98 std::string
const &_param_name)
const {
99 return m_clex->param_key(_param_name);
106 std::vector<std::function<
double(
ConfigDoF const &)> >
const &_basis_set) {
107 m_clex->set_evaluation(_param_key, _basis_set);
114 std::vector<std::function<
double(std::vector<double>
const &)> >
const
116 m_clex->set_evaluation(_param_key, _basis_set);
124 std::string _eval_type) {
125 m_clex->set_evaluation(_param_key, _eval_type);
132 return m_clex->check_evaluation(_param_key);
135 namespace Clexulator_impl {
138 : m_nlist_size(_nlist_size),
139 m_corr_size(_corr_size),
140 m_n_point_corr(_n_point_corr),
141 m_config_ptr(nullptr) {}
147 return std::unique_ptr<Base>(
_clone());
154 std::vector<std::function<
double(
ConfigDoF const &)> >
const &_basis_set) {}
160 std::vector<std::function<
double(std::vector<double>
const &)> >
const
168 std::string
const &_eval_type) {}
Key for indexing clexulator parameters Contains pointer to implementation of the Key.
ClexParamKey const & key(std::string const &_name) const
Obtain key for managed data block by name.
Abstract base class for cluster expansion correlation calculations.
ClexParamKey const & param_key(std::string const &_param_name) const
Obtain ClexParamKey for a particular parameter.
Base(size_type _nlist_size, size_type _corr_size, size_type _n_point_corr)
std::string check_evaluation(ClexParamKey const &_param_key) const
Check evaluation mode of parameters specified by.
std::unique_ptr< Base > clone() const
Clone the Clexulator.
virtual ClexParamPack const & param_pack() const =0
Obtain const reference to abstract ClexParamPack object.
virtual Base * _clone() const =0
Clone the Clexulator.
void set_evaluation(ClexParamKey const &_param_key, std::vector< std::function< double(ConfigDoF const &)> > const &_basis_set)
Alter evaluation of parameters specified by.
Clexulator & operator=(Clexulator B)
Assignment operator.
ClexParamKey const & param_key(std::string const &_param_name) const
Obtain ClexParamKey for a particular parameter.
void set_evaluation(ClexParamKey const _param_key, std::vector< std::function< double(ConfigDoF const &)> > const &_basis_set)
Alter evaluation of parameters specified by.
friend void swap(Clexulator &first, Clexulator &second)
Swap.
std::unique_ptr< Clexulator_impl::Base > m_clex
std::string name() const
Name.
std::string check_evaluation(ClexParamKey const _param_key) const
Check evaluation mode of parameters specified by.
const std::set< UnitCell > & neighborhood() const
The UnitCellCoord involved in calculating the basis functions, relative origin UnitCell.
std::shared_ptr< RuntimeLibrary > m_lib
The PrimNeighborList gives the coordinates of UnitCell that are neighbors of the origin UnitCell.
void expand(UnitCell const &uc)
Expand the neighbor list to include the given UnitCellCoord.
Matrix3Type weight_matrix() const
Return the weighting matrix W used to define the canonical order.
std::shared_ptr< RuntimeLibrary > log_make_shared_runtime_lib(std::string filename_base, std::string compile_options, std::string so_options, std::string compile_msg)
Make shared_ptr<RuntimeLibrary>, logging progress and errors.
GenericDatumFormatter< std::string, DataObject > name()