CASM  1.1.0
A Clusters Approach to Statistical Mechanics
CASM::LocalDiscreteConfigDoFValues Class Reference

#include <ConfigDoFValues.hh>

+ Inheritance diagram for CASM::LocalDiscreteConfigDoFValues:

Detailed Description

Stores a vector with local discrete (occupation) DoF values

Notes:

  • Values are stored in a vector of size=n_vol()*n_sublat()
  • The value at site_index l indicates the type of Molecule occupying the site, via prim.basis()[b].occupant_dof()[this->occ(l)], where the sublattice, b = l / this->n_vol().

See ConfigDoF documentation for more details on how DoF values are stored.

The vector size is fixed at construction and attempts to change it, other than via a complete copy, will cause an exception to be thrown.

Definition at line 38 of file ConfigDoFValues.hh.

Public Types

typedef Eigen::VectorXi ValueType
 
typedef Eigen::VectorXi & Reference
 
typedef Eigen::VectorXi const & ConstReference
 
typedef ValueType::Scalar SiteValueType
 
typedef int & SiteReference
 
typedef const int & ConstSiteReference
 
typedef ValueType SublatValueType
 
typedef ValueType::SegmentReturnType SublatReference
 
typedef ValueType::ConstSegmentReturnType ConstSublatReference
 

Public Member Functions

 LocalDiscreteConfigDoFValues (DoF::BasicTraits const &_traits, Index _n_sublat, Index _n_vol, std::vector< SymGroupRepID > const &_symrep_IDs)
 
int & occ (Index i)
 Reference occupation value on site i. More...
 
void set_values (Eigen::Ref< ValueType const > const &_values)
 Set occupation values (values are indices into Site::occupant_dof()) More...
 
void setZero ()
 Set occupation values to zero. More...
 
Eigen::VectorXi const & values () const
 
SublatReference sublat (Index b)
 Access vector block of values for all sites on one sublattice. More...
 
ConstSublatReference sublat (Index b) const
 Const access vector block of values for all sites on one sublattice. More...
 
std::vector< SymGroupRepID > const & symrep_IDs () const
 
std::string const & type_name () const
 
Index n_vol () const
 
Index n_sublat () const
 

Private Member Functions

void _throw_if_invalid_size (Eigen::Ref< ValueType const > const &_values) const
 

Private Attributes

ValueType m_vals
 
std::vector< SymGroupRepIDm_symrep_IDs
 
DoFKey m_type
 
Index m_n_sublat
 
Index m_n_vol
 

Member Typedef Documentation

◆ ConstReference

Definition at line 42 of file ConfigDoFValues.hh.

◆ ConstSiteReference

Definition at line 46 of file ConfigDoFValues.hh.

◆ ConstSublatReference

typedef ValueType::ConstSegmentReturnType CASM::LocalDiscreteConfigDoFValues::ConstSublatReference

Definition at line 50 of file ConfigDoFValues.hh.

◆ Reference

Definition at line 41 of file ConfigDoFValues.hh.

◆ SiteReference

◆ SiteValueType

Definition at line 44 of file ConfigDoFValues.hh.

◆ SublatReference

typedef ValueType::SegmentReturnType CASM::LocalDiscreteConfigDoFValues::SublatReference

Definition at line 49 of file ConfigDoFValues.hh.

◆ SublatValueType

◆ ValueType

Definition at line 40 of file ConfigDoFValues.hh.

Constructor & Destructor Documentation

◆ LocalDiscreteConfigDoFValues()

CASM::LocalDiscreteConfigDoFValues::LocalDiscreteConfigDoFValues ( DoF::BasicTraits const &  _traits,
Index  _n_sublat,
Index  _n_vol,
std::vector< SymGroupRepID > const &  _symrep_IDs 
)

Definition at line 15 of file ConfigDoFValues.cc.

Member Function Documentation

◆ _throw_if_invalid_size()

void CASM::LocalDiscreteConfigDoFValues::_throw_if_invalid_size ( Eigen::Ref< ValueType const > const &  _values) const
private

Definition at line 64 of file ConfigDoFValues.cc.

◆ n_sublat()

Index CASM::ConfigDoFValues::n_sublat ( ) const
inherited

Definition at line 13 of file ConfigDoFValues.cc.

◆ n_vol()

Index CASM::ConfigDoFValues::n_vol ( ) const
inherited

Definition at line 11 of file ConfigDoFValues.cc.

◆ occ()

int & CASM::LocalDiscreteConfigDoFValues::occ ( Index  i)

Reference occupation value on site i.

Definition at line 23 of file ConfigDoFValues.cc.

◆ set_values()

void CASM::LocalDiscreteConfigDoFValues::set_values ( Eigen::Ref< ValueType const > const &  _values)

Set occupation values (values are indices into Site::occupant_dof())

Set occupation values (values are indices into Site::occupant_dof())

Exceptions
std::runtime_error("Invalid size in LocalDiscreteConfigDoFValues...") if size does not match _n_sublat * _n_vol

Definition at line 30 of file ConfigDoFValues.cc.

◆ setZero()

void CASM::LocalDiscreteConfigDoFValues::setZero ( )

Set occupation values to zero.

Definition at line 37 of file ConfigDoFValues.cc.

◆ sublat() [1/2]

LocalDiscreteConfigDoFValues::SublatReference CASM::LocalDiscreteConfigDoFValues::sublat ( Index  b)

Access vector block of values for all sites on one sublattice.

Definition at line 47 of file ConfigDoFValues.cc.

◆ sublat() [2/2]

LocalDiscreteConfigDoFValues::ConstSublatReference CASM::LocalDiscreteConfigDoFValues::sublat ( Index  b) const

Const access vector block of values for all sites on one sublattice.

Definition at line 53 of file ConfigDoFValues.cc.

◆ symrep_IDs()

std::vector< SymGroupRepID > const & CASM::LocalDiscreteConfigDoFValues::symrep_IDs ( ) const

Provides the symmetry representations for transforming values (i.e. due to molecule orientation, not for permuting sites)

Definition at line 59 of file ConfigDoFValues.cc.

◆ type_name()

std::string const & CASM::ConfigDoFValues::type_name ( ) const
inherited

Definition at line 9 of file ConfigDoFValues.cc.

◆ values()

Eigen::VectorXi const & CASM::LocalDiscreteConfigDoFValues::values ( ) const

Const access occupation values (values are indices into Site::occupant_dof())

Definition at line 41 of file ConfigDoFValues.cc.

Member Data Documentation

◆ m_n_sublat

Index CASM::ConfigDoFValues::m_n_sublat
privateinherited

Definition at line 21 of file ConfigDoFValues.hh.

◆ m_n_vol

Index CASM::ConfigDoFValues::m_n_vol
privateinherited

Definition at line 22 of file ConfigDoFValues.hh.

◆ m_symrep_IDs

std::vector<SymGroupRepID> CASM::LocalDiscreteConfigDoFValues::m_symrep_IDs
private

Definition at line 83 of file ConfigDoFValues.hh.

◆ m_type

DoFKey CASM::ConfigDoFValues::m_type
privateinherited

Definition at line 20 of file ConfigDoFValues.hh.

◆ m_vals

ValueType CASM::LocalDiscreteConfigDoFValues::m_vals
private

Definition at line 82 of file ConfigDoFValues.hh.


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