CASM  1.1.0
A Clusters Approach to Statistical Mechanics
CASM::OccupantDoF< T > Class Template Reference

#include <DoF.hh>

+ Inheritance diagram for CASM::OccupantDoF< T >:

Detailed Description

template<typename T>
class CASM::OccupantDoF< T >

Definition at line 263 of file DoF.hh.

Public Types

using Base = DoF::Base
 
using BasicTraits = DoF::BasicTraits
 
using RemoteHandle = DoF::RemoteHandle
 

Public Member Functions

 OccupantDoF (BasicTraits const &_traits, std::string const &_var_name, SymGroupRepID symrep_ID, std::vector< T > const &_domain, int _current_state=0)
 
const T & occ () const
 
void set_value (int occ_index) override
 Set occupant by index. More...
 
void set_current_state (T const &new_state)
 Set occupant by value. More...
 
bool compare (OccupantDoF const &RHS, bool compare_value) const
 Returns true if (*this) is equivalent to RHS,. More...
 
bool operator== (OccupantDoF const &RHS) const
 Equivalent to (*this).compare(RHS,true) More...
 
void set_domain (std::vector< T > new_dom)
 
const std::vector< T > & domain () const
 
T & operator[] (Index i)
 
const T & operator[] (Index i) const
 
Index size () const override
 
void print (std::ostream &out) const
 
std::unique_ptr< OccupantDoFclone () const
 
SymGroupRepID symrep_ID () const
 
void set_symrep_ID (SymGroupRepID _id)
 
bool is_specified () const
 
void invalidate ()
 
int value () const
 
int remote_value () const
 
int const * remote_ptr () const
 
void register_remote (RemoteHandle const &handle) const
 
virtual bool operator== (DiscreteDoF const &RHS) const
 
BasicTraits const & traits () const
 
std::string type_name () const
 Const access of DoF type name. More...
 
std::string var_name () const
 Const access of variable name. More...
 
Index ID () const
 Const access of integer ID. More...
 
RemoteHandle handle () const
 Create a RemoteHandle that refers to this DoF. More...
 
bool is_locked () const
 true if ID is locked More...
 
void set_ID (Index new_ID)
 mutator to set integer ID if it is unlocked More...
 
void lock_ID ()
 mutator to lock integer ID More...
 
void unlock_ID ()
 mutator to unlock integer ID More...
 

Protected Attributes

int m_current_state
 index into domain of the current state, -1 if unspecified More...
 
int const * m_remote_state
 Allows DoF to point to a remote value for faster/easier evaluation. More...
 
SymGroupRepID m_symrep_ID
 ID for the permutation representation for occupants. More...
 

Private Member Functions

DiscreteDoF_clone () const override
 

Private Attributes

std::vector< T > m_domain
 Allowed values, assume class T has method 'T.name()()'. More...
 
BasicTraits m_traits
 
std::string m_var_name
 
Index m_dof_ID
 
bool m_ID_lock
 Locks the ID so that it can't be updated. Is used for global DoF's. More...
 

Member Typedef Documentation

◆ Base

Definition at line 182 of file DoF.hh.

◆ BasicTraits

Definition at line 183 of file DoF.hh.

◆ RemoteHandle

Definition at line 121 of file DoF.hh.

Constructor & Destructor Documentation

◆ OccupantDoF()

template<typename T >
CASM::OccupantDoF< T >::OccupantDoF ( BasicTraits const &  _traits,
std::string const &  _var_name,
SymGroupRepID  symrep_ID,
std::vector< T > const &  _domain,
int  _current_state = 0 
)
inline

Definition at line 265 of file DoF.hh.

Member Function Documentation

◆ _clone()

template<typename T >
DiscreteDoF* CASM::OccupantDoF< T >::_clone ( ) const
inlineoverrideprivatevirtual

Implements CASM::DiscreteDoF.

Definition at line 344 of file DoF.hh.

◆ clone()

template<typename T >
std::unique_ptr<OccupantDoF> CASM::OccupantDoF< T >::clone ( ) const
inline

Definition at line 338 of file DoF.hh.

◆ compare()

template<typename T >
bool CASM::OccupantDoF< T >::compare ( OccupantDoF< T > const &  RHS,
bool  compare_value 
) const
inline

Returns true if (*this) is equivalent to RHS,.

Parameters
compare_valuespecifies whether to compare occupation values

Definition at line 297 of file DoF.hh.

◆ domain()

template<typename T >
const std::vector<T>& CASM::OccupantDoF< T >::domain ( ) const
inline

Definition at line 321 of file DoF.hh.

◆ handle()

RemoteHandle CASM::DoF::Base::handle ( ) const
inlineinherited

Create a RemoteHandle that refers to this DoF.

Definition at line 143 of file DoF.hh.

◆ ID()

Index CASM::DoF::Base::ID ( ) const
inlineinherited

Const access of integer ID.

Definition at line 140 of file DoF.hh.

◆ invalidate()

void CASM::DiscreteDoF::invalidate ( )
inlineinherited

Definition at line 206 of file DoF.hh.

◆ is_locked()

bool CASM::DoF::Base::is_locked ( ) const
inlineinherited

true if ID is locked

Definition at line 148 of file DoF.hh.

◆ is_specified()

bool CASM::DiscreteDoF::is_specified ( ) const
inlineinherited

Definition at line 204 of file DoF.hh.

◆ lock_ID()

void CASM::DoF::Base::lock_ID ( )
inlineinherited

mutator to lock integer ID

Definition at line 159 of file DoF.hh.

◆ occ()

template<typename T >
const T& CASM::OccupantDoF< T >::occ ( ) const
inline

Definition at line 271 of file DoF.hh.

◆ operator==() [1/2]

virtual bool CASM::DiscreteDoF::operator== ( DiscreteDoF const &  RHS) const
inlinevirtualinherited

Definition at line 236 of file DoF.hh.

◆ operator==() [2/2]

template<typename T >
bool CASM::OccupantDoF< T >::operator== ( OccupantDoF< T > const &  RHS) const
inline

Equivalent to (*this).compare(RHS,true)

Definition at line 310 of file DoF.hh.

◆ operator[]() [1/2]

template<typename T >
T& CASM::OccupantDoF< T >::operator[] ( Index  i)
inline

Definition at line 323 of file DoF.hh.

◆ operator[]() [2/2]

template<typename T >
const T& CASM::OccupantDoF< T >::operator[] ( Index  i) const
inline

Definition at line 325 of file DoF.hh.

◆ print()

template<typename T >
void CASM::OccupantDoF< T >::print ( std::ostream &  out) const
inline

Definition at line 329 of file DoF.hh.

◆ register_remote()

void CASM::DiscreteDoF::register_remote ( RemoteHandle const &  handle) const
inlineinherited

Definition at line 218 of file DoF.hh.

◆ remote_ptr()

int const* CASM::DiscreteDoF::remote_ptr ( ) const
inlineinherited

Definition at line 216 of file DoF.hh.

◆ remote_value()

int CASM::DiscreteDoF::remote_value ( ) const
inlineinherited

Definition at line 210 of file DoF.hh.

◆ set_current_state()

template<typename T >
void CASM::OccupantDoF< T >::set_current_state ( T const &  new_state)
inline

Set occupant by value.

Definition at line 284 of file DoF.hh.

◆ set_domain()

template<typename T >
void CASM::OccupantDoF< T >::set_domain ( std::vector< T >  new_dom)
inline

Definition at line 312 of file DoF.hh.

◆ set_ID()

void CASM::DoF::Base::set_ID ( Index  new_ID)
inlineinherited

mutator to set integer ID if it is unlocked

Definition at line 151 of file DoF.hh.

◆ set_symrep_ID()

void CASM::DiscreteDoF::set_symrep_ID ( SymGroupRepID  _id)
inlineinherited

Definition at line 202 of file DoF.hh.

◆ set_value()

template<typename T >
void CASM::OccupantDoF< T >::set_value ( int  occ_index)
inlineoverridevirtual

Set occupant by index.

Reimplemented from CASM::DiscreteDoF.

Definition at line 274 of file DoF.hh.

◆ size()

template<typename T >
Index CASM::OccupantDoF< T >::size ( ) const
inlineoverridevirtual

Implements CASM::DiscreteDoF.

Definition at line 327 of file DoF.hh.

◆ symrep_ID()

SymGroupRepID CASM::DiscreteDoF::symrep_ID ( ) const
inlineinherited

Definition at line 200 of file DoF.hh.

◆ traits()

BasicTraits const& CASM::DoF::Base::traits ( ) const
inlineinherited

Definition at line 131 of file DoF.hh.

◆ type_name()

std::string CASM::DoF::Base::type_name ( ) const
inlineinherited

Const access of DoF type name.

Definition at line 134 of file DoF.hh.

◆ unlock_ID()

void CASM::DoF::Base::unlock_ID ( )
inlineinherited

mutator to unlock integer ID

Definition at line 162 of file DoF.hh.

◆ value()

int CASM::DiscreteDoF::value ( ) const
inlineinherited

Definition at line 208 of file DoF.hh.

◆ var_name()

std::string CASM::DoF::Base::var_name ( ) const
inlineinherited

Const access of variable name.

Definition at line 137 of file DoF.hh.

Member Data Documentation

◆ m_current_state

int CASM::DiscreteDoF::m_current_state
protectedinherited

index into domain of the current state, -1 if unspecified

Definition at line 248 of file DoF.hh.

◆ m_dof_ID

Index CASM::DoF::Base::m_dof_ID
privateinherited

dof_ID is a way to distinguish between DoFs with the same name but different identities dof_ID for now usually refers to the site index of a cluster (e.g., 0, 1, 2 of a triplet) or an index into the primitive cell neighbor list. Other usage cases may be introduced later

Definition at line 172 of file DoF.hh.

◆ m_domain

template<typename T >
std::vector<T> CASM::OccupantDoF< T >::m_domain
private

Allowed values, assume class T has method 'T.name()()'.

Definition at line 354 of file DoF.hh.

◆ m_ID_lock

bool CASM::DoF::Base::m_ID_lock
privateinherited

Locks the ID so that it can't be updated. Is used for global DoF's.

Definition at line 175 of file DoF.hh.

◆ m_remote_state

int const* CASM::DiscreteDoF::m_remote_state
mutableprotectedinherited

Allows DoF to point to a remote value for faster/easier evaluation.

Definition at line 251 of file DoF.hh.

◆ m_symrep_ID

SymGroupRepID CASM::DiscreteDoF::m_symrep_ID
protectedinherited

ID for the permutation representation for occupants.

Definition at line 254 of file DoF.hh.

◆ m_traits

BasicTraits CASM::DoF::Base::m_traits
privateinherited

Definition at line 165 of file DoF.hh.

◆ m_var_name

std::string CASM::DoF::Base::m_var_name
privateinherited

Definition at line 166 of file DoF.hh.


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