CASM  1.1.0
A Clusters Approach to Statistical Mechanics
CASM::DoF::Base Class Reference

#include <DoF.hh>

+ Inheritance diagram for CASM::DoF::Base:

Detailed Description

A class that represents an individual Degree of Freedom.

Base DoF class associates three pieces of data that identify the degree of freedom

  1. type_name: The type of DoF (e.g., occupation ("occ"), displacement ("disp"), etc.
  2. variable_name: The name that will be associated with the individual DoF. This depends on usage case (e.g., "x", "y", or "z" for displacement)
  3. ID: Integer subscript that identifies variables of the same name and type. For local DoF's, this is the site index; for global DoFs it denotes a subscript (e.g., for a strain component).

The type_name and variable_name must be set at construction. For local DoF's, the ID can be updated as needed, but IDs of global DoFs persist throughout their lifetime. Optionally, the ID can be 'locked' which prevents it from being changed

Definition at line 119 of file DoF.hh.

Public Types

using RemoteHandle = DoF::RemoteHandle
 

Public Member Functions

 Base ()
 
 Base (BasicTraits const &traits, std::string const &_var_name, Index _ID)
 
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...
 

Private Attributes

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

◆ RemoteHandle

Definition at line 121 of file DoF.hh.

Constructor & Destructor Documentation

◆ Base() [1/2]

CASM::DoF::Base::Base ( )
inline

Definition at line 123 of file DoF.hh.

◆ Base() [2/2]

Base::Base ( BasicTraits const &  traits,
std::string const &  _var_name,
Index  _ID 
)

Definition at line 9 of file DoF.cc.

Member Function Documentation

◆ handle()

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

Create a RemoteHandle that refers to this DoF.

Definition at line 143 of file DoF.hh.

◆ ID()

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

Const access of integer ID.

Definition at line 140 of file DoF.hh.

◆ is_locked()

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

true if ID is locked

Definition at line 148 of file DoF.hh.

◆ lock_ID()

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

mutator to lock integer ID

Definition at line 159 of file DoF.hh.

◆ set_ID()

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

mutator to set integer ID if it is unlocked

Definition at line 151 of file DoF.hh.

◆ traits()

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

Definition at line 131 of file DoF.hh.

◆ type_name()

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

Const access of DoF type name.

Definition at line 134 of file DoF.hh.

◆ unlock_ID()

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

mutator to unlock integer ID

Definition at line 162 of file DoF.hh.

◆ var_name()

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

Const access of variable name.

Definition at line 137 of file DoF.hh.

Member Data Documentation

◆ m_dof_ID

Index CASM::DoF::Base::m_dof_ID
private

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_ID_lock

bool CASM::DoF::Base::m_ID_lock
private

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_traits

BasicTraits CASM::DoF::Base::m_traits
private

Definition at line 165 of file DoF.hh.

◆ m_var_name

std::string CASM::DoF::Base::m_var_name
private

Definition at line 166 of file DoF.hh.


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