3 #include <boost/filesystem/path.hpp>
22 namespace Clexulator_impl {
46 std::unique_ptr<Base>
clone()
const;
61 std::vector<std::function<
double(
ConfigDoF const &)> >
const &_basis_set);
67 std::vector<std::function<
double(std::vector<double>
const &)> >
const
75 std::string
const &_eval_type);
113 long int const *_nlist_begin,
114 long int const *_nlist_end,
116 double *_corr_end)
const {
136 long int const *_nlist_begin,
137 long int const *_nlist_end)
const {
164 ConfigDoF const &_input_configdof,
long int const *_nlist_begin,
165 long int const *_nlist_end,
double *_corr_begin,
double *_corr_end,
188 long int const *_nlist_begin,
long int const *_nlist_end,
189 int neighbor_ind,
double *_corr_begin,
190 double *_corr_end)
const {
219 long int const *_nlist_begin,
220 long int const *_nlist_end,
int neighbor_ind,
221 double *_corr_begin,
double *_corr_end,
248 long int const *_nlist_begin,
249 long int const *_nlist_end,
int neighbor_ind,
250 int occ_i,
int occ_f,
double *_corr_begin,
251 double *_corr_end)
const {
283 long int const *_nlist_begin,
284 long int const *_nlist_end,
285 int neighbor_ind,
int occ_i,
int occ_f,
286 double *_corr_begin,
double *_corr_end,
292 _corr_ind_begin, _corr_ind_end);
333 size_type const *_corr_ind_end)
const = 0;
336 double *_corr_begin,
size_type const *_corr_ind_begin,
337 size_type const *_corr_ind_end)
const = 0;
342 double *_corr_begin)
const = 0;
345 int neighbor_ind,
size_type const *_corr_ind_begin,
346 size_type const *_corr_ind_end)
const = 0;
349 int neighbor_ind,
double *_corr_begin,
size_type const *_corr_ind_begin,
350 size_type const *_corr_ind_end)
const = 0;
353 int occ_f)
const = 0;
356 double *_corr_begin)
const = 0;
359 int neighbor_ind,
int occ_i,
int occ_f,
size_type const *_corr_ind_begin,
360 size_type const *_corr_ind_end)
const = 0;
363 int neighbor_ind,
int occ_i,
int occ_f,
double *_corr_begin,
365 size_type const *_corr_ind_end)
const = 0;
396 const long int *_nlist_end)
const {
418 mutable std::vector<GlobalContinuousConfigDoFValues const *>
448 std::string compile_options, std::string so_options);
501 std::vector<std::function<
double(
ConfigDoF const &)> >
const &_basis_set);
507 std::vector<std::function<
double(std::vector<double>
const &)> >
const
524 return m_clex->neighborhood();
530 return m_clex->neighborhood(linear_orbit_index);
535 return m_clex->weight_matrix();
553 long int const *_nlist_begin,
554 long int const *_nlist_end,
556 double *_corr_end)
const {
557 m_clex->calc_global_corr_contribution(_input_configdof, _nlist_begin,
558 _nlist_end, _corr_begin, _corr_end);
577 long int const *_nlist_begin,
578 long int const *_nlist_end)
const {
579 m_clex->calc_global_corr_contribution(_input_configdof, _nlist_begin,
604 ConfigDoF const &_input_configdof,
long int const *_nlist_begin,
605 long int const *_nlist_end,
double *_corr_begin,
double *_corr_end,
607 m_clex->calc_restricted_global_corr_contribution(
608 _input_configdof, _nlist_begin, _nlist_end, _corr_begin, _corr_end,
609 _corr_ind_begin, _corr_ind_end);
627 long int const *_nlist_begin,
long int const *_nlist_end,
628 int neighbor_ind,
double *_corr_begin,
629 double *_corr_end)
const {
630 m_clex->calc_point_corr(_input_configdof, _nlist_begin, _nlist_end,
631 neighbor_ind, _corr_begin, _corr_end);
652 long int const *_nlist_begin,
653 long int const *_nlist_end,
int neighbor_ind,
654 double *_corr_begin,
double *_corr_end,
657 m_clex->calc_restricted_point_corr(
658 _input_configdof, _nlist_begin, _nlist_end, neighbor_ind, _corr_begin,
659 _corr_end, _corr_ind_begin, _corr_ind_end);
680 long int const *_nlist_begin,
681 long int const *_nlist_end,
int neighbor_ind,
682 int occ_i,
int occ_f,
double *_corr_begin,
683 double *_corr_end)
const {
684 m_clex->calc_delta_point_corr(_input_configdof, _nlist_begin, _nlist_end,
685 neighbor_ind, occ_i, occ_f, _corr_begin,
717 long int const *_nlist_begin,
718 long int const *_nlist_end,
719 int neighbor_ind,
int occ_i,
int occ_f,
720 double *_corr_begin,
double *_corr_end,
723 m_clex->calc_restricted_delta_point_corr(
724 _input_configdof, _nlist_begin, _nlist_end, neighbor_ind, occ_i, occ_f,
725 _corr_begin, _corr_end, _corr_ind_begin, _corr_ind_end);
730 std::unique_ptr<Clexulator_impl::Base>
m_clex;
731 std::shared_ptr<RuntimeLibrary>
m_lib;
Key for indexing clexulator parameters Contains pointer to implementation of the Key.
Abstract base class for reading/writing clexulator parameters Parameters are assumed to be stored as,...
Abstract base class for cluster expansion correlation calculations.
size_type m_n_point_corr
Valid range for neighbor_ind argument to calc_point_corr.
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)
virtual void _calc_point_corr(int neighbor_ind) const =0
void _register_local_dof(std::string const &_type_name, Index _ind)
size_type m_nlist_size
The neighbor list size.
const std::set< UnitCell > & neighborhood() const
The UnitCellCoord involved in calculating the basis functions, relative origin UnitCell.
void _register_global_dof(std::string const &_type_name, Index _ind)
long int const * m_nlist_ptr
Pointer to neighbor list.
std::string check_evaluation(ClexParamKey const &_param_key) const
Check evaluation mode of parameters specified by.
virtual void _calc_restricted_global_corr_contribution(size_type const *_corr_ind_begin, size_type const *_corr_ind_end) const =0
const std::set< UnitCell > & neighborhood(size_type linear_orbit_index) const
The UnitCellCoord involved in calculating the basis functions for a particular orbit,...
std::map< std::string, Index > m_global_dof_registry
std::vector< GlobalContinuousConfigDoFValues const * > m_global_dof_ptrs
std::set< UnitCell > m_neighborhood
The UnitCellCoord involved in calculating the basis functions, relative origin UnitCell.
const PrimNeighborList::Matrix3Type & weight_matrix() const
The weight matrix used for ordering the neighbor list.
std::unique_ptr< Base > clone() const
Clone the Clexulator.
virtual ClexParamPack const & param_pack() const =0
Obtain const reference to abstract ClexParamPack object.
void calc_restricted_point_corr(ConfigDoF const &_input_configdof, long int const *_nlist_begin, long int const *_nlist_end, int neighbor_ind, double *_corr_begin, double *_corr_end, size_type const *_corr_ind_begin, size_type const *_corr_ind_end) const
Calculate select point correlations about basis site 'neighbor_ind'.
virtual void _calc_delta_point_corr(int neighbor_ind, int occ_i, int occ_f) const =0
size_type corr_size() const
Number of correlations.
virtual void _calc_delta_point_corr(int neighbor_ind, int occ_i, int occ_f, double *_corr_begin) const =0
ConfigDoF const & _configdof() const
access reference to internally pointed ConfigDoF
void calc_restricted_delta_point_corr(ConfigDoF const &_input_configdof, long int const *_nlist_begin, long int const *_nlist_end, int neighbor_ind, int occ_i, int occ_f, double *_corr_begin, double *_corr_end, size_type const *_corr_ind_begin, size_type const *_corr_ind_end) const
Calculate the change in select point correlations due to changing an occupant.
void calc_restricted_global_corr_contribution(ConfigDoF const &_input_configdof, long int const *_nlist_begin, long int const *_nlist_end, double *_corr_begin, double *_corr_end, size_type const *_corr_ind_begin, size_type const *_corr_ind_end) const
Calculate contribution to select global correlations from one unit cell.
size_type nlist_size() const
Neighbor list size.
std::vector< std::set< UnitCell > > m_orbit_neighborhood
The UnitCellCoord involved in calculating the basis functions for a particular orbit,...
std::vector< LocalContinuousConfigDoFValues const * > m_local_dof_ptrs
ConfigDoF const * m_config_ptr
Pointer to ConfigDoF for which evaluation is occuring.
virtual void _calc_restricted_point_corr(int neighbor_ind, double *_corr_begin, size_type const *_corr_ind_begin, size_type const *_corr_ind_end) const =0
void calc_point_corr(ConfigDoF const &_input_configdof, long int const *_nlist_begin, long int const *_nlist_end, int neighbor_ind, double *_corr_begin, double *_corr_end) const
Calculate point correlations about basis site 'neighbor_ind'.
void calc_global_corr_contribution(ConfigDoF const &_input_configdof, long int const *_nlist_begin, long int const *_nlist_end) const
Calculate contribution to global correlations from one unit cell.
size_type n_point_corr() const
Valid range for neighbor_ind argument to calc_point_corr.
void calc_delta_point_corr(ConfigDoF const &_input_configdof, long int const *_nlist_begin, long int const *_nlist_end, int neighbor_ind, int occ_i, int occ_f, double *_corr_begin, double *_corr_end) const
Calculate the change in point correlations due to changing an occupant.
virtual void _calc_restricted_delta_point_corr(int neighbor_ind, int occ_i, int occ_f, size_type const *_corr_ind_begin, size_type const *_corr_ind_end) const =0
size_type m_corr_size
The number of correlations.
virtual void _calc_global_corr_contribution(double *_corr_begin) const =0
virtual Base * _clone() const =0
Clone the Clexulator.
virtual void _calc_restricted_point_corr(int neighbor_ind, size_type const *_corr_ind_begin, size_type const *_corr_ind_end) const =0
virtual ClexParamPack & param_pack()=0
Obtain reference to abstract ClexParamPack object.
void _set_configdof(ConfigDoF const &_input_configdof) const
Set internal pointers to correct DoFs.
virtual void _calc_global_corr_contribution() const =0
virtual void _calc_restricted_delta_point_corr(int neighbor_ind, int occ_i, int occ_f, double *_corr_begin, size_type const *_corr_ind_begin, size_type const *_corr_ind_end) const =0
Index const & _l(Index nlist_ind) const
access reference to internally pointed ConfigDoF
PrimNeighborList::Matrix3Type m_weight_matrix
The weight matrix used for ordering the neighbor list.
virtual void _calc_point_corr(int neighbor_ind, double *_corr_begin) const =0
virtual void _calc_restricted_global_corr_contribution(double *_corr_begin, size_type const *_corr_ind_begin, size_type const *_corr_ind_end) const =0
void calc_global_corr_contribution(ConfigDoF const &_input_configdof, long int const *_nlist_begin, long int const *_nlist_end, double *_corr_begin, double *_corr_end) const
Calculate contribution to global correlations from one unit cell.
void set_evaluation(ClexParamKey const &_param_key, std::vector< std::function< double(ConfigDoF const &)> > const &_basis_set)
Alter evaluation of parameters specified by.
void _set_nlist(const long int *_nlist_begin, const long int *_nlist_end) const
Set pointer to neighbor list.
std::map< std::string, Index > m_local_dof_registry
const PrimNeighborList::Matrix3Type & weight_matrix() const
The weight matrix used for ordering the neighbor list.
Clexulator & operator=(Clexulator B)
Assignment operator.
size_type corr_size() const
Number of correlations.
void calc_restricted_global_corr_contribution(ConfigDoF const &_input_configdof, long int const *_nlist_begin, long int const *_nlist_end, double *_corr_begin, double *_corr_end, size_type const *_corr_ind_begin, size_type const *_corr_ind_end) const
Calculate contribution to select global correlations from one unit cell.
ClexParamKey const & param_key(std::string const &_param_name) const
Obtain ClexParamKey for a particular parameter.
ClexParamPack const & param_pack() const
Obtain const reference to abstract ClexParamPack object.
Clexulator_impl::Base::size_type size_type
void set_evaluation(ClexParamKey const _param_key, std::vector< std::function< double(ConfigDoF const &)> > const &_basis_set)
Alter evaluation of parameters specified by.
void calc_global_corr_contribution(ConfigDoF const &_input_configdof, long int const *_nlist_begin, long int const *_nlist_end) const
Calculate contribution to global correlations from one unit cell.
ClexParamPack & param_pack()
Obtain reference to abstract ClexParamPack object.
friend void swap(Clexulator &first, Clexulator &second)
Swap.
std::unique_ptr< Clexulator_impl::Base > m_clex
std::string name() const
Name.
void calc_global_corr_contribution(ConfigDoF const &_input_configdof, long int const *_nlist_begin, long int const *_nlist_end, double *_corr_begin, double *_corr_end) const
Calculate contribution to global correlations from one unit cell.
size_type n_point_corr() const
Valid range for neighbor_ind argument to calc_point_corr.
std::string check_evaluation(ClexParamKey const _param_key) const
Check evaluation mode of parameters specified by.
void calc_restricted_point_corr(ConfigDoF const &_input_configdof, long int const *_nlist_begin, long int const *_nlist_end, int neighbor_ind, double *_corr_begin, double *_corr_end, size_type const *_corr_ind_begin, size_type const *_corr_ind_end) const
Calculate select point correlations about basis site 'neighbor_ind'.
void calc_restricted_delta_point_corr(ConfigDoF const &_input_configdof, long int const *_nlist_begin, long int const *_nlist_end, int neighbor_ind, int occ_i, int occ_f, double *_corr_begin, double *_corr_end, size_type const *_corr_ind_begin, size_type const *_corr_ind_end) const
Calculate the change in select point correlations due to changing an occupant.
void calc_point_corr(ConfigDoF const &_input_configdof, long int const *_nlist_begin, long int const *_nlist_end, int neighbor_ind, double *_corr_begin, double *_corr_end) const
Calculate point correlations about basis site 'neighbor_ind'.
void calc_delta_point_corr(ConfigDoF const &_input_configdof, long int const *_nlist_begin, long int const *_nlist_end, int neighbor_ind, int occ_i, int occ_f, double *_corr_begin, double *_corr_end) const
Calculate the change in point correlations due to changing an occupant.
const std::set< UnitCell > & neighborhood() const
The UnitCellCoord involved in calculating the basis functions, relative origin UnitCell.
size_type nlist_size() const
Neighbor list size.
const std::set< UnitCell > & neighborhood(size_type linear_orbit_index) const
The UnitCellCoord involved in calculating the basis functions for a particular orbit,...
std::shared_ptr< RuntimeLibrary > m_lib
bool initialized() const
Is runtime library loaded?
GlobalContinuousConfigDoFValues const & global_dof(DoFKey const &_key) const
LocalContinuousConfigDoFValues const & local_dof(DoFKey const &_key) const
The PrimNeighborList gives the coordinates of UnitCell that are neighbors of the origin UnitCell.
Eigen::Matrix3l Matrix3Type
Write, compile, load and use code at runtime.
void swap(ConfigDoF &A, ConfigDoF &B)
INDEX_TYPE Index
For long integer indexing:
T max(const T &A, const T &B)