CASM
AClustersApproachtoStatisticalMechanics
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules
CASM::Clexulator_impl::Base Class Referenceabstract

#include <Clexulator.hh>

+ Inheritance diagram for CASM::Clexulator_impl::Base:

Detailed Description

Abstract base class for cluster expansion correlation calculations.

Definition at line 16 of file Clexulator.hh.

Public Types

typedef unsigned int size_type
 

Public Member Functions

 Base (size_type _nlist_size, size_type _corr_size)
 
virtual ~Base ()
 
size_type nlist_size () const
 Neighbor list size. More...
 
size_type corr_size () const
 Number of correlations. More...
 
std::unique_ptr< Baseclone () const
 Clone the Clexulator. More...
 
const std::set< UnitCellCoord > & neighborhood () const
 The UnitCellCoord involved in calculating the basis functions, relative origin UnitCell. More...
 
const std::set< UnitCellCoord > & neighborhood (size_type linear_orbit_index) const
 The UnitCellCoord involved in calculating the basis functions for a particular orbit, relative origin UnitCell. More...
 
const
PrimNeighborList::Matrix3Type
weight_matrix () const
 The weight matrix used for ordering the neighbor list. More...
 
void set_config_occ (const int *_occ_ptr)
 Set pointer to data structure containing occupation variables. More...
 
void set_nlist (const long int *_nlist_ptr)
 Set pointer to neighbor list. More...
 
virtual void calc_global_corr_contribution (double *corr_begin) const =0
 Calculate contribution to global correlations from one unit cell. More...
 
virtual void calc_restricted_global_corr_contribution (double *corr_begin, size_type const *ind_list_begin, size_type const *ind_list_end) const =0
 Calculate contribution to select global correlations from one unit cell. More...
 
virtual void calc_point_corr (int b_index, double *corr_begin) const =0
 Calculate point correlations about basis site 'b_index'. More...
 
virtual void calc_restricted_point_corr (int b_index, double *corr_begin, size_type const *ind_list_begin, size_type const *ind_list_end) const =0
 Calculate select point correlations about basis site 'b_index'. More...
 
virtual void calc_delta_point_corr (int b_index, int occ_i, int occ_f, double *corr_begin) const =0
 Calculate the change in point correlations due to changing an occupant. More...
 
virtual void calc_restricted_delta_point_corr (int b_index, int occ_i, int occ_f, double *corr_begin, size_type const *ind_list_begin, size_type const *ind_list_end) const =0
 Calculate the change in select point correlations due to changing an occupant. More...
 

Protected Attributes

const int * m_occ_ptr
 Pointer to beginning of data structure containing occupation variables. More...
 
const long int * m_nlist_ptr
 Pointer to neighbor list. More...
 
std::set< UnitCellCoordm_neighborhood
 The UnitCellCoord involved in calculating the basis functions, relative origin UnitCell. More...
 
std::vector< std::set
< UnitCellCoord > > 
m_orbit_neighborhood
 The UnitCellCoord involved in calculating the basis functions for a particular orbit, relative origin UnitCell. More...
 
PrimNeighborList::Matrix3Type m_weight_matrix
 The weight matrix used for ordering the neighbor list. More...
 

Private Member Functions

virtual Base_clone () const =0
 Clone the Clexulator. More...
 

Private Attributes

size_type m_nlist_size
 The neighbor list size. More...
 
size_type m_corr_size
 The number of correlations. More...
 

Member Typedef Documentation

Definition at line 20 of file Clexulator.hh.

Constructor & Destructor Documentation

CASM::Clexulator_impl::Base::Base ( size_type  _nlist_size,
size_type  _corr_size 
)
inline

Definition at line 23 of file Clexulator.hh.

virtual CASM::Clexulator_impl::Base::~Base ( )
inlinevirtual

Definition at line 27 of file Clexulator.hh.

Member Function Documentation

virtual Base* CASM::Clexulator_impl::Base::_clone ( ) const
privatepure virtual
virtual void CASM::Clexulator_impl::Base::calc_delta_point_corr ( int  b_index,
int  occ_i,
int  occ_f,
double *  corr_begin 
) const
pure virtual

Calculate the change in point correlations due to changing an occupant.

b_index Basis site index about which to calculate correlations occ_i,occ_f Initial and final occupant variable corr_begin Pointer to beginning of data structure where difference in correlations are written

Call using:

myclexulator.set_config_occ(my_configdof.occupation().begin());
UnitCellCoord bijk(b,i,j,k); // b,i,j,k of site to get delta point correlations
int l_index = my_supercell.find(bijk); // Linear index of site in Configuration
myclexulator.set_nlist(my_supercell.get_nlist(l_index).begin());
int occ_i=0, occ_f=1; // Swap from occupant 0 to occupant 1
myclexulator.calc_delta_point_corr(b, occ_i, occ_f, correlation_array.begin());

Implemented in CASM::ZrO_Clexulator, CASM::ZrO_Clexulator, CASM::ZrO_Clexulator, CASM::test_Clexulator, and CASM::FCC_ternary_Clexulator.

virtual void CASM::Clexulator_impl::Base::calc_global_corr_contribution ( double *  corr_begin) const
pure virtual

Calculate contribution to global correlations from one unit cell.

Parameters
corr_beginPointer to beginning of data structure where correlations are written

Call using:

myclexulator.set_config_occ(my_configdof.occupation().begin());
UnitCellCoord bijk(0,i,j,k); // i,j,k of unit cell to get contribution from
int l_index = my_supercell.find(bijk); // Linear index of site in Configuration
myclexulator.set_nlist(my_supercell.get_nlist(l_index).begin());
myclexulator.calc_global_corr_contribution(correlation_array.begin());

Implemented in CASM::ZrO_Clexulator, CASM::ZrO_Clexulator, CASM::ZrO_Clexulator, CASM::test_Clexulator, and CASM::FCC_ternary_Clexulator.

virtual void CASM::Clexulator_impl::Base::calc_point_corr ( int  b_index,
double *  corr_begin 
) const
pure virtual

Calculate point correlations about basis site 'b_index'.

b_index Basis site index about which to calculate correlations corr_begin Pointer to beginning of data structure where correlations are written

Call using:

myclexulator.set_config_occ(my_configdof.occupation().begin());
UnitCellCoord bijk(b,i,j,k); // b,i,j,k of site to get point correlations
int l_index = my_supercell.find(bijk); // Linear index of site in Configuration
myclexulator.set_nlist(my_supercell.get_nlist(l_index).begin());
myclexulator.calc_point_corr(b, correlation_array.begin());

Implemented in CASM::ZrO_Clexulator, CASM::ZrO_Clexulator, CASM::ZrO_Clexulator, CASM::test_Clexulator, and CASM::FCC_ternary_Clexulator.

virtual void CASM::Clexulator_impl::Base::calc_restricted_delta_point_corr ( int  b_index,
int  occ_i,
int  occ_f,
double *  corr_begin,
size_type const *  ind_list_begin,
size_type const *  ind_list_end 
) const
pure virtual

Calculate the change in select point correlations due to changing an occupant.

b_index Basis site index about which to calculate correlations occ_i,occ_f Initial and final occupant variable corr_begin Pointer to beginning of data structure where difference in correlations are written

Parameters
ind_list_begin,ind_list_endPointers to range indicating which correlations should be calculated

Call using:

myclexulator.set_config_occ(my_configdof.occupation().begin());
UnitCellCoord bijk(b,i,j,k); // b,i,j,k of site to get delta point correlations
int l_index = my_supercell.find(bijk); // Linear index of site in Configuration
myclexulator.set_nlist(my_supercell.get_nlist(l_index).begin());
int occ_i=0, occ_f=1; // Swap from occupant 0 to occupant 1
std::vector<int> ind_list = {0, 2, 4, 6}; // Get contribution to correlations 0, 2, 4, and 6
myclexulator.calc_restricted_delta_point_corr(b, occ_i, occ_f, correlation_array.begin(), ind_list.begin(), ind_list.end());

Implemented in CASM::ZrO_Clexulator, CASM::ZrO_Clexulator, CASM::ZrO_Clexulator, CASM::test_Clexulator, and CASM::FCC_ternary_Clexulator.

virtual void CASM::Clexulator_impl::Base::calc_restricted_global_corr_contribution ( double *  corr_begin,
size_type const *  ind_list_begin,
size_type const *  ind_list_end 
) const
pure virtual

Calculate contribution to select global correlations from one unit cell.

Parameters
corr_beginPointer to beginning of data structure where correlations are written
ind_list_begin,ind_list_endPointers to range indicating which correlations should be calculated

Call using:

myclexulator.set_config_occ(my_configdof.occupation().begin());
UnitCellCoord bijk(0,i,j,k); // i,j,k of unit cell to get contribution from
int l_index = my_supercell.find(bijk); // Linear index of site in Configuration
myclexulator.set_nlist(my_supercell.get_nlist(l_index).begin());
std::vector<int> ind_list = {0, 2, 4, 6}; // Get contribution to correlations 0, 2, 4, and 6
myclexulator.calc_restricted_global_corr_contribution(correlation_array.begin(), ind_list.begin(), ind_list.end());

Implemented in CASM::ZrO_Clexulator, CASM::ZrO_Clexulator, CASM::ZrO_Clexulator, CASM::test_Clexulator, and CASM::FCC_ternary_Clexulator.

virtual void CASM::Clexulator_impl::Base::calc_restricted_point_corr ( int  b_index,
double *  corr_begin,
size_type const *  ind_list_begin,
size_type const *  ind_list_end 
) const
pure virtual

Calculate select point correlations about basis site 'b_index'.

b_index Basis site index about which to calculate correlations corr_begin Pointer to beginning of data structure where correlations are written

Parameters
ind_list_begin,ind_list_endPointers to range indicating which correlations should be calculated

Call using:

myclexulator.set_config_occ(my_configdof.occupation().begin());
UnitCellCoord bijk(b,i,j,k); // b,i,j,k of site to get point correlations
int l_index = my_supercell.find(bijk); // Linear index of site in Configuration
myclexulator.set_nlist(my_supercell.get_nlist(l_index).begin());
std::vector<int> ind_list = {0, 2, 4, 6}; // Get contribution to correlations 0, 2, 4, and 6
myclexulator.calc_restricted_point_corr(b, correlation_array.begin(), ind_list.begin(), ind_list.end());

Implemented in CASM::ZrO_Clexulator, CASM::ZrO_Clexulator, CASM::ZrO_Clexulator, CASM::test_Clexulator, and CASM::FCC_ternary_Clexulator.

std::unique_ptr<Base> CASM::Clexulator_impl::Base::clone ( ) const
inline

Clone the Clexulator.

Definition at line 40 of file Clexulator.hh.

size_type CASM::Clexulator_impl::Base::corr_size ( ) const
inline

Number of correlations.

Definition at line 35 of file Clexulator.hh.

const std::set<UnitCellCoord>& CASM::Clexulator_impl::Base::neighborhood ( ) const
inline

The UnitCellCoord involved in calculating the basis functions, relative origin UnitCell.

Definition at line 46 of file Clexulator.hh.

const std::set<UnitCellCoord>& CASM::Clexulator_impl::Base::neighborhood ( size_type  linear_orbit_index) const
inline

The UnitCellCoord involved in calculating the basis functions for a particular orbit, relative origin UnitCell.

Definition at line 52 of file Clexulator.hh.

size_type CASM::Clexulator_impl::Base::nlist_size ( ) const
inline

Neighbor list size.

Definition at line 30 of file Clexulator.hh.

void CASM::Clexulator_impl::Base::set_config_occ ( const int *  _occ_ptr)
inline

Set pointer to data structure containing occupation variables.

Parameters
_occ_ptrPointer to beginning of data structure containing occupation variables

Call using:

myclexulator.set_config_occ(my_configdof.occupation().begin());

Definition at line 70 of file Clexulator.hh.

void CASM::Clexulator_impl::Base::set_nlist ( const long int *  _nlist_ptr)
inline

Set pointer to neighbor list.

Call using:

UnitCellCoord bijk(b,i,j,k); // UnitCellCoord of site in Configuration
int l_index = my_supercell.find(bijk); // Linear index of site in Configuration
myclexulator.set_nlist(my_supercell.get_nlist(l_index).begin());

Definition at line 83 of file Clexulator.hh.

const PrimNeighborList::Matrix3Type& CASM::Clexulator_impl::Base::weight_matrix ( ) const
inline

The weight matrix used for ordering the neighbor list.

Definition at line 57 of file Clexulator.hh.

Member Data Documentation

size_type CASM::Clexulator_impl::Base::m_corr_size
private

The number of correlations.

Definition at line 207 of file Clexulator.hh.

std::set<UnitCellCoord> CASM::Clexulator_impl::Base::m_neighborhood
protected

The UnitCellCoord involved in calculating the basis functions, relative origin UnitCell.

Definition at line 220 of file Clexulator.hh.

const long int* CASM::Clexulator_impl::Base::m_nlist_ptr
protected

Pointer to neighbor list.

Definition at line 216 of file Clexulator.hh.

size_type CASM::Clexulator_impl::Base::m_nlist_size
private

The neighbor list size.

Definition at line 204 of file Clexulator.hh.

const int* CASM::Clexulator_impl::Base::m_occ_ptr
protected

Pointer to beginning of data structure containing occupation variables.

Definition at line 213 of file Clexulator.hh.

std::vector<std::set<UnitCellCoord> > CASM::Clexulator_impl::Base::m_orbit_neighborhood
protected

The UnitCellCoord involved in calculating the basis functions for a particular orbit, relative origin UnitCell.

Definition at line 224 of file Clexulator.hh.

PrimNeighborList::Matrix3Type CASM::Clexulator_impl::Base::m_weight_matrix
protected

The weight matrix used for ordering the neighbor list.

Definition at line 227 of file Clexulator.hh.


The documentation for this class was generated from the following file: