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

#include <ConfigDoFValues.hh>

+ Inheritance diagram for CASM::LocalContinuousConfigDoFValues:

Detailed Description

Stores a matrix with local continuous DoF values

Notes:

  • Values are stored in a matrix of size rows=dim(), cols=n_vol()*n_sublat(),
    • The value of dim() is the maximum, over all sublattices in the prim, of the site basis dimension for this type of DoF. In case the site basis dimension varies from site to site (for example, displacements are restricted to a 2d plane on some sites, but not others), the columns corresponding to sublattices with a basis dimension less than dim() have a tail of zeros which should not be modified.
  • Each column represents a site DoF value in the prim DoF basis
  • The prim DoF basis for each sublattice can be accessed by this->info()[b], where b is the sublattice index, b = column_index / this->n_vol()

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

The matrix 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 106 of file ConfigDoFValues.hh.

Public Types

typedef Eigen::MatrixXd ValueType
 
typedef Eigen::MatrixXd & Reference
 
typedef Eigen::MatrixXd const & ConstReference
 
typedef Eigen::VectorXd SiteValueType
 
typedef ValueType::ColXpr SiteReference
 
typedef const ValueType::ConstColXpr ConstSiteReference
 
typedef ValueType SublatValueType
 
typedef Eigen::Block< ValueTypeSublatReference
 
typedef const Eigen::Block< const ValueTypeConstSublatReference
 

Public Member Functions

 LocalContinuousConfigDoFValues (DoF::BasicTraits const &_traits, Index _n_sublat, Index _n_vol, std::vector< DoFSetInfo > const &_info)
 
Index dim () const
 maximum DoF vector representation size (max of DoFSetInfo::dim()) More...
 
void set_values (Eigen::Ref< const ValueType > const &_values)
 Access site DoF values (prim DoF basis, matrix representing all sites) More...
 
void setZero ()
 Set DoF values to zero. More...
 
Eigen::MatrixXd const & values () const
 Const access DoF values (prim DoF basis, matrix representing all sites) More...
 
void from_standard_values (Eigen::Ref< const Eigen::MatrixXd > const &_standard_values)
 Set local DoF values from standard DoF values. More...
 
Eigen::MatrixXd standard_values () const
 Get local DoF values as standard DoF values. More...
 
SiteReference site_value (Index l)
 Access site DoF value vector. More...
 
ConstSiteReference site_value (Index l) const
 Const access site DoF value vector. More...
 
SublatReference sublat (Index b)
 Access matrix block of values for all sites on one sublattice. More...
 
ConstSublatReference sublat (Index b) const
 Const access matrix block of values for all sites on one sublattice. More...
 
std::vector< DoFSetInfo > const & info () const
 DoFSetInfo provides the basis and symmetry representations for values More...
 
std::string const & type_name () const
 
Index n_vol () const
 
Index n_sublat () const
 

Static Public Member Functions

static Index matrix_dim (std::vector< DoFSetInfo > const &_info)
 local continuous DoF values matrix has #rows == max( DoFSetInfo::dim() ) More...
 

Private Member Functions

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

Private Attributes

Index m_dim
 
std::vector< DoFSetInfom_info
 
ValueType m_vals
 
DoFKey m_type
 
Index m_n_sublat
 
Index m_n_vol
 

Member Typedef Documentation

◆ ConstReference

Definition at line 110 of file ConfigDoFValues.hh.

◆ ConstSiteReference

typedef const ValueType::ConstColXpr CASM::LocalContinuousConfigDoFValues::ConstSiteReference

Definition at line 114 of file ConfigDoFValues.hh.

◆ ConstSublatReference

Definition at line 118 of file ConfigDoFValues.hh.

◆ Reference

Definition at line 109 of file ConfigDoFValues.hh.

◆ SiteReference

Definition at line 113 of file ConfigDoFValues.hh.

◆ SiteValueType

Definition at line 112 of file ConfigDoFValues.hh.

◆ SublatReference

◆ SublatValueType

◆ ValueType

Definition at line 108 of file ConfigDoFValues.hh.

Constructor & Destructor Documentation

◆ LocalContinuousConfigDoFValues()

CASM::LocalContinuousConfigDoFValues::LocalContinuousConfigDoFValues ( DoF::BasicTraits const &  _traits,
Index  _n_sublat,
Index  _n_vol,
std::vector< DoFSetInfo > const &  _info 
)

Definition at line 85 of file ConfigDoFValues.cc.

Member Function Documentation

◆ _throw_if_invalid_size()

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

Definition at line 226 of file ConfigDoFValues.cc.

◆ dim()

Index CASM::LocalContinuousConfigDoFValues::dim ( ) const

maximum DoF vector representation size (max of DoFSetInfo::dim())

Definition at line 96 of file ConfigDoFValues.cc.

◆ from_standard_values()

void CASM::LocalContinuousConfigDoFValues::from_standard_values ( Eigen::Ref< const Eigen::MatrixXd > const &  _standard_values)

Set local DoF values from standard DoF values.

Set local DoF values from standard DoF values

Notes:

Definition at line 146 of file ConfigDoFValues.cc.

◆ info()

std::vector< DoFSetInfo > const & CASM::LocalContinuousConfigDoFValues::info ( ) const

DoFSetInfo provides the basis and symmetry representations for values

Definition at line 222 of file ConfigDoFValues.cc.

◆ matrix_dim()

Index CASM::LocalContinuousConfigDoFValues::matrix_dim ( std::vector< DoFSetInfo > const &  _info)
static

local continuous DoF values matrix has #rows == max( DoFSetInfo::dim() )

Definition at line 76 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.

◆ set_values()

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

Access site DoF values (prim DoF basis, matrix representing all sites)

Access site DoF values (prim DoF basis, matrix representing all sites)

Notes:

  • Matrix of size:
    • rows=dim() (the max, over all sublattices, prim DoF basis dimension)
    • cols=n_vol()*n_sublat()
  • Each column represents a site DoF value in the prim DoF basis
  • The prim DoF basis can be accessed by this->info()[b].basis(), where b is the sublattice index, b = column_index / this->n_vol()
  • If the prim DoF basis dimension (this->info()[b].basis().cols()) is less than the standard DoF basis dimension, the matrix includes blocks of zeros for the corresponding sublattice.
Exceptions
std::runtime_error("Invalid size in LocalContinuousConfigDoFValues...") if size is not valid

Definition at line 113 of file ConfigDoFValues.cc.

◆ setZero()

void CASM::LocalContinuousConfigDoFValues::setZero ( )

Set DoF values to zero.

Definition at line 120 of file ConfigDoFValues.cc.

◆ site_value() [1/2]

LocalContinuousConfigDoFValues::SiteReference CASM::LocalContinuousConfigDoFValues::site_value ( Index  l)

Access site DoF value vector.

Access site DoF value vector

Note:

  • This is the vector of DoF values associated with a single site, in the prim DoF basis
  • If the prim DoF basis dimension for this site is less than dim(), this includes a tail of zeros (for rows >= this->info()[b].dim(), where b is the sublattice index for site_index l). The tail of zeros should not be modified.

Definition at line 191 of file ConfigDoFValues.cc.

◆ site_value() [2/2]

LocalContinuousConfigDoFValues::ConstSiteReference CASM::LocalContinuousConfigDoFValues::site_value ( Index  l) const

Const access site DoF value vector.

Const access site DoF value vector

Note:

  • This is the vector of DoF values associated with a single site, in the prim DoF basis
  • If the prim DoF basis dimension for this site is less than dim(), this includes a tail of zeros (for rows >= this->info()[b].dim(), where b is the sublattice index for site_index l). The tail of zeros should not be modified.

Definition at line 205 of file ConfigDoFValues.cc.

◆ standard_values()

Eigen::MatrixXd CASM::LocalContinuousConfigDoFValues::standard_values ( ) const

Get local DoF values as standard DoF values.

Get local DoF values as standard DoF values

Notes:

Definition at line 171 of file ConfigDoFValues.cc.

◆ sublat() [1/2]

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

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

Definition at line 211 of file ConfigDoFValues.cc.

◆ sublat() [2/2]

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

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

Definition at line 217 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::MatrixXd const & CASM::LocalContinuousConfigDoFValues::values ( ) const

Const access DoF values (prim DoF basis, matrix representing all sites)

Const access DoF values (prim DoF basis, matrix representing all sites)

Notes:

  • Matrix of size rows=dim(), cols=n_vol()*n_sublat(),
    • In case the site basis dimension varies from site to site (for example, displacements are restricted to a 2d plane on some sites, but not others), the value of dim() is the maximum site basis dimension for this DoF. The columns corresponding to sublattices with a smaller basis dimension than dim() have a tail of zeros which should not be modified.
  • Each column represents a site DoF value in the prim DoF basis
  • The prim DoF basis can be accessed by this->info()[b], where b is the sublattice index, b = column_index / this->n_vol()

Definition at line 136 of file ConfigDoFValues.cc.

Member Data Documentation

◆ m_dim

Index CASM::LocalContinuousConfigDoFValues::m_dim
private

Definition at line 164 of file ConfigDoFValues.hh.

◆ m_info

std::vector<DoFSetInfo> CASM::LocalContinuousConfigDoFValues::m_info
private

Definition at line 165 of file ConfigDoFValues.hh.

◆ 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_type

DoFKey CASM::ConfigDoFValues::m_type
privateinherited

Definition at line 20 of file ConfigDoFValues.hh.

◆ m_vals

ValueType CASM::LocalContinuousConfigDoFValues::m_vals
private

Definition at line 166 of file ConfigDoFValues.hh.


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