CASM
1.1.0
A Clusters Approach to Statistical Mechanics
|
#include <AnisoValTraits.hh>
Specifies traits of (possibly) anisotropic crystal properties.
CASM needs to know how to use crystal properties in several places:
Examples of various property types, and their name strings, include:
The AnisoValTraits class contains all the necessary information for CASM to deal with different types of properties. For each property type there must exist one AnisoValTraits object which controls how CASM treats the property, including:
Note: Traits for all properties are defined using AnisoValTraits, even isotropic properties.
The AnisoValTraits class contains two constructors. One allows defining a new property type which gets placed in a single static container. The other, with just a "name" argument, returns a copy of the already existing AnisoValTraits object for the property type with the given name.
A particular instance of a property, such as in BasicStructure or SimpleStructure, is labeled with a property name string. Property name strings must end with the property type name (i.e. "occ", "disp", "Ustrain", "energy", etc.) and may also include a modifier describing the particular property (i.e. "formation" in "formation_energy"). If a modifier exists, it must be separated from the property type by an underscore character ('_'). The name of a custom property type may not include an underscore.
Thus, whenever a particular property name is encountered, the property type name can be determined and used to lookup the corresponding AnisoValTraits object.
Examples:
For standard types, AnisoValTraits are pre-defined and can be accessed via the following named constructors:
Definition at line 25 of file AnisoValTraits.hh.
Public Member Functions | |
AnisoValTraits (std::string const &_name, std::vector< std::string > const &_std_var_names, unsigned char _options, SymRepBuilderInterface const &_symrep_builder=NullSymRepBuilder(), std::set< std::string > const &_incompatible={}, std::set< std::string > const &_must_apply_before={}, std::set< std::string > const &_must_apply_after={}, std::vector< std::string > const &_variable_descriptions={}, bool _default=false) | |
Explicit constructor for AnisoValTraits. More... | |
AnisoValTraits (std::string const &_name) | |
Construct a copy of an existing AnisoValTraits with matching name suffix. More... | |
Eigen::MatrixXd | symop_to_matrix (Eigen::Ref< const Eigen::Matrix3d > const &_matrix, Eigen::Ref< const Eigen::Vector3d > const &_tau, bool time_reversal) const |
Generate a symmetry representation for the supporting vector space. More... | |
std::string const & | name () const |
Const access of name. More... | |
bool | is_default () const |
Return true if *this has 'default' designation, meaning it can be overridden. More... | |
unsigned char | options () const |
Return 'options' bitflag. More... | |
bool | extensive () const |
Returns true if type is extensive. More... | |
bool | global () const |
Returns true if type is global. More... | |
bool | unit_length () const |
Returns true if type must always have unit length. More... | |
bool | time_reversal_active () const |
Returns true if time-reversal changes the value. More... | |
bool | describes_occupant_orientation () const |
Index | dim () const |
Conventional dimensionality of this type, returns -1 if always variable. More... | |
bool | operator== (std::string const &other_name) const |
Equality comparison of name. More... | |
bool | operator< (std::string const &other_name) const |
Lexicographic comparison of name. More... | |
operator std::string const & () const | |
Allow implicit conversion to std::string (name) More... | |
std::vector< std::string > const & | standard_var_names () const |
Return standard coordinate axes for continuous variable space. More... | |
std::vector< std::string > const & | variable_descriptions () const |
Returns expanded description of each standard_var_name. More... | |
std::set< std::string > const & | incompatible () const |
When used as a DoF, this is a set of DoFs that are incompatible with this type of DoF. More... | |
std::set< std::string > const & | must_apply_before () const |
When used as a DoF, this is a set of DoFs that must be applied before this DoF is applied. More... | |
std::set< std::string > const & | must_apply_after () const |
When used as a DoF, this is a set of DoFs that must be applied after this DoF is applied. More... | |
std::unique_ptr< AnisoValTraits > | clone () const |
Clone this object. More... | |
std::string | symrep_builder_name () const |
Return name of the SymRepBuilderInterface. More... | |
Static Public Member Functions | |
static AnisoValTraits | null () |
Named constructor for uninitialized AnisoValTraits. More... | |
static AnisoValTraits | occ () |
Named constructor for discrete site occupation AnisoValTraits. More... | |
static AnisoValTraits | energy () |
Named constructor for total energy AnisoValTraits. More... | |
static AnisoValTraits | cost () |
Named constructor for mapping cost AnisoValTraits. More... | |
static AnisoValTraits | selective_dynamics () |
Named constructor for selective_dynamics AnisoValTraits. More... | |
static AnisoValTraits | disp () |
Named constructor for site displacement AnisoValTraits. More... | |
static AnisoValTraits | coordinate () |
Named constructor for site coordinate AnisoValTraits. More... | |
static AnisoValTraits | latvec () |
Named constructor for lattice vector AnisoValTraits. More... | |
static AnisoValTraits | force () |
Named constructor for site force AnisoValTraits. More... | |
static AnisoValTraits | isometry () |
Named constructor for global 'isometry' AnisoValTraits. More... | |
static AnisoValTraits | strain (std::string const &_metric) |
Named constructor for global strain AnisoValTraits. More... | |
static AnisoValTraits | SOmagspin () |
Non-collinear magnetic spin, with spin-orbit coupling. More... | |
static AnisoValTraits | SOunitmagspin () |
Non-collinear magnetic spin, with spin-orbit coupling, constrained to unit length. More... | |
static AnisoValTraits | NCmagspin () |
Non-collinear magnetic spin, without spin-orbit coupling. More... | |
static AnisoValTraits | NCunitmagspin () |
Non-collinear magnetic spin, without spin-orbit coupling, constrained to unit length. More... | |
static AnisoValTraits | Cmagspin () |
Collinear magnetic spin. More... | |
static AnisoValTraits | Cunitmagspin () |
Collinear magnetic spin, constrained to unit length. More... | |
static AnisoValTraits | d_orbital_occupation () |
Named constructor for d-orbital occupation AnisoValTraits. More... | |
static AnisoValTraits | d_orbital_occupation_spin_polarized () |
Named constructor for spin-polarized d-orbital occupation AnisoValTraits. More... | |
static std::string | name_suffix (std::string const &_name, char delim='_') |
static std::string | class_desc () |
Returns "AnisoValTraits". More... | |
Static Public Attributes | |
static const unsigned char | LOCAL = 0 |
static const unsigned char | GLOBAL = (1u << 0) |
static const unsigned char | UNIT_LENGTH = (1u << 1) |
static const unsigned char | DESCRIBES_ORIENTATION = (1u << 2) |
static const unsigned char | EXTENSIVE = (1u << 3) |
Protected Attributes | |
std::string | m_name |
bool | m_default |
std::vector< std::string > | m_standard_var_names |
std::vector< std::string > | m_variable_descriptions |
unsigned char | m_opt |
notstd::cloneable_ptr< const SymRepBuilderInterface > | m_symrep_builder |
std::set< std::string > | m_incompatible |
std::set< std::string > | m_apply_before |
std::set< std::string > | m_apply_after |
CASM::AnisoValTraits::AnisoValTraits | ( | std::string const & | _name, |
std::vector< std::string > const & | _std_var_names, | ||
unsigned char | _options, | ||
SymRepBuilderInterface const & | _symrep_builder = NullSymRepBuilder() , |
||
std::set< std::string > const & | _incompatible = {} , |
||
std::set< std::string > const & | _must_apply_before = {} , |
||
std::set< std::string > const & | _must_apply_after = {} , |
||
std::vector< std::string > const & | _variable_descriptions = {} , |
||
bool | _default = false |
||
) |
Explicit constructor for AnisoValTraits.
Explicit constructor for AnisoValTraits
All attributes must be specified at construction. There is no mutator for AnisoValTraits. Explicitly constructing two AnisoValTraits objects with the same name but non-identical data members will result in a thrown exception, unless this->is_default()==true
.
_name | Name for this type |
_std_var_names | Names for standard coordinate axes of continuous variable space. |
_options | Bitflag describing setting properties (LOCAL, GLOBAL, UNIT_LENGTH, DESCRIBES_ORIENTATION, EXTENSIVE) |
_symrep_builder | Method for constructing symmetry representations |
_incompatible | When used as a DoF, this is a set of DoFs that are incompatible with this type of DoF |
_must_apply_before | When used as a DoF, this is a set of DoFs (by AnisoValTraits name) that must be applied before this DoF is applied when constructing a SimpleStructure from a Configuration. |
_must_apply_after | When used as a DoF, this is a set of DoFs (by AnisoValTraits name) that must be applied after this DoF is applied when constructing a SimpleStructure from a Configuration. |
_variable_descriptions | Expanded description of each standard_var_name |
_default | True if this has 'default' designation, meaning it can be overridden |
The special keyword "atomize" is also valid for _must_apply_before
and _must_apply_after
, indicating the step when molecules are taken and "atomized" (populating SimpleStructure::atom_info from SimpleStructure::mol_info).
Definition at line 229 of file AnisoValTraits.cc.
CASM::AnisoValTraits::AnisoValTraits | ( | std::string const & | _name | ) |
Construct a copy of an existing AnisoValTraits with matching name suffix.
Construct a copy of an existing AnisoValTraits with matching name suffix
Returns a copy of a previously explicitly initialized AnisoValTraits with name AnisoValTraits::name_suffix(_name)
. If no AnisoValTraits with matching name has been initialized, throws an exception.
Definition at line 195 of file AnisoValTraits.cc.
|
inlinestatic |
Returns "AnisoValTraits".
Definition at line 124 of file AnisoValTraits.hh.
|
inline |
Clone this object.
Definition at line 217 of file AnisoValTraits.hh.
|
static |
Collinear magnetic spin.
Required and non-default values:
Definition at line 510 of file AnisoValTraits.cc.
|
static |
Named constructor for site coordinate AnisoValTraits.
Required and non-default values:
Definition at line 345 of file AnisoValTraits.cc.
|
static |
Named constructor for mapping cost AnisoValTraits.
This includes basis_cost, strain_cost, total_cost.
Required and non-default values:
Definition at line 303 of file AnisoValTraits.cc.
|
static |
Collinear magnetic spin, constrained to unit length.
Required and non-default values:
Definition at line 525 of file AnisoValTraits.cc.
|
static |
Named constructor for d-orbital occupation AnisoValTraits.
Required and non-default values:
Definition at line 540 of file AnisoValTraits.cc.
|
static |
Named constructor for spin-polarized d-orbital occupation AnisoValTraits.
Required and non-default values:
Definition at line 560 of file AnisoValTraits.cc.
|
inline |
Returns true if value tracks the orientation of an occupying molecule (not typical)
Definition at line 170 of file AnisoValTraits.hh.
|
inline |
Conventional dimensionality of this type, returns -1 if always variable.
Definition at line 175 of file AnisoValTraits.hh.
|
static |
Named constructor for site displacement AnisoValTraits.
Required and non-default values:
Definition at line 330 of file AnisoValTraits.cc.
|
static |
Named constructor for total energy AnisoValTraits.
Required and non-default values:
Definition at line 288 of file AnisoValTraits.cc.
|
inline |
Returns true if type is extensive.
Definition at line 149 of file AnisoValTraits.hh.
|
static |
Named constructor for site force AnisoValTraits.
Required and non-default values:
Definition at line 382 of file AnisoValTraits.cc.
|
inline |
Returns true if type is global.
Definition at line 158 of file AnisoValTraits.hh.
|
inline |
When used as a DoF, this is a set of DoFs that are incompatible with this type of DoF.
Definition at line 202 of file AnisoValTraits.hh.
|
inline |
Return true if *this has 'default' designation, meaning it can be overridden.
Definition at line 143 of file AnisoValTraits.hh.
|
static |
Named constructor for global 'isometry' AnisoValTraits.
Required and non-default values:
Definition at line 401 of file AnisoValTraits.cc.
|
static |
Named constructor for lattice vector AnisoValTraits.
Required and non-default values:
Definition at line 364 of file AnisoValTraits.cc.
|
inline |
When used as a DoF, this is a set of DoFs that must be applied after this DoF is applied.
Definition at line 212 of file AnisoValTraits.hh.
|
inline |
When used as a DoF, this is a set of DoFs that must be applied before this DoF is applied.
Definition at line 206 of file AnisoValTraits.hh.
|
inline |
Const access of name.
Definition at line 139 of file AnisoValTraits.hh.
|
inlinestatic |
Returns string after final delim
character
Given a string, returns string with all characters before the final delim
character deleted. For example, if a trajectory has properties with key1="step1_force"
, key2="step2_force"
, etc., then AnisoValTraits::name_suffix(key1) will return "force" if ‘delim=’_'`.
Definition at line 98 of file AnisoValTraits.hh.
|
static |
Non-collinear magnetic spin, without spin-orbit coupling.
Required and non-default values:
Definition at line 478 of file AnisoValTraits.cc.
|
static |
Non-collinear magnetic spin, without spin-orbit coupling, constrained to unit length.
Required and non-default values:
Definition at line 495 of file AnisoValTraits.cc.
|
static |
Named constructor for uninitialized AnisoValTraits.
Required and non-default values:
Definition at line 266 of file AnisoValTraits.cc.
|
static |
Named constructor for discrete site occupation AnisoValTraits.
Required and non-default values:
Definition at line 276 of file AnisoValTraits.cc.
|
inline |
Allow implicit conversion to std::string (name)
Definition at line 188 of file AnisoValTraits.hh.
|
inline |
Lexicographic comparison of name.
Definition at line 183 of file AnisoValTraits.hh.
|
inline |
Equality comparison of name.
Definition at line 178 of file AnisoValTraits.hh.
|
inline |
Return 'options' bitflag.
Definition at line 146 of file AnisoValTraits.hh.
|
static |
Named constructor for selective_dynamics AnisoValTraits.
Named constructor for selective dynamics AnisoValTraits.
Required and non-default values:
Definition at line 316 of file AnisoValTraits.cc.
|
static |
Non-collinear magnetic spin, with spin-orbit coupling.
Required and non-default values:
Definition at line 447 of file AnisoValTraits.cc.
|
static |
Non-collinear magnetic spin, with spin-orbit coupling, constrained to unit length.
Required and non-default values:
Definition at line 463 of file AnisoValTraits.cc.
|
inline |
Return standard coordinate axes for continuous variable space.
Definition at line 191 of file AnisoValTraits.hh.
|
static |
Named constructor for global strain AnisoValTraits.
_metric | specifies which strain metric. Choices are:
|
Required and non-default values:
Definition at line 428 of file AnisoValTraits.cc.
|
inline |
Generate a symmetry representation for the supporting vector space.
Definition at line 127 of file AnisoValTraits.hh.
|
inline |
Return name of the SymRepBuilderInterface.
Definition at line 222 of file AnisoValTraits.hh.
|
inline |
Returns true if time-reversal changes the value.
Definition at line 164 of file AnisoValTraits.hh.
|
inline |
Returns true if type must always have unit length.
Definition at line 161 of file AnisoValTraits.hh.
|
inline |
Returns expanded description of each standard_var_name.
Definition at line 196 of file AnisoValTraits.hh.
|
static |
Definition at line 30 of file AnisoValTraits.hh.
|
static |
Definition at line 31 of file AnisoValTraits.hh.
|
static |
Definition at line 28 of file AnisoValTraits.hh.
|
static |
Definition at line 27 of file AnisoValTraits.hh.
|
protected |
Definition at line 238 of file AnisoValTraits.hh.
|
protected |
Definition at line 237 of file AnisoValTraits.hh.
|
protected |
Definition at line 231 of file AnisoValTraits.hh.
|
protected |
Definition at line 236 of file AnisoValTraits.hh.
|
protected |
Definition at line 230 of file AnisoValTraits.hh.
|
protected |
Definition at line 234 of file AnisoValTraits.hh.
|
protected |
Definition at line 232 of file AnisoValTraits.hh.
|
protected |
Definition at line 235 of file AnisoValTraits.hh.
|
protected |
Definition at line 233 of file AnisoValTraits.hh.
|
static |
Definition at line 29 of file AnisoValTraits.hh.