CASM
1.1.0
A Clusters Approach to Statistical Mechanics
|
#include <DoFSet.hh>
DoFSet: A set of degrees of freedom (DoF)
DoFSet specifies all identifying information for a vector of continuous independent variables (may be site or global variables). For example, a DoFSet may be used to represent allowed displacements on one site, or allowed lattice strains.
A DoFSet has:
std::vector<ContinuousDoF>
. The ContinuousDoF
are used for constructing basis functions.Examples of standard basis specified by AnisoValTraits:
Public Types | |
using | BasicTraits = AnisoValTraits |
using | TypeFunc = std::function< notstd::cloneable_ptr< AnisoValTraits >()> |
using | Container = std::vector< ContinuousDoF > |
using | const_iterator = std::vector< ContinuousDoF >::const_iterator |
Public Member Functions | |
DoFSet (AnisoValTraits const &_type, std::vector< std::string > components, DoFSetInfo _info, std::unordered_set< std::string > excluded_occupants={}) | |
Index | size () const |
Returns the number of components in this DoFSet. More... | |
std::string const & | type_name () const |
AnisoValTraits const & | traits () const |
Returns the AnisoValTraits object for the DoF type of this DoFSet. More... | |
void | set_ID (Index _ID) |
void | lock_IDs () |
Locks IDs of components in this DoFSet so they can no longer be updated. More... | |
void | set_sequential_IDs () |
DoFSetInfo const & | info () const |
ContinuousDoF const & | operator[] (Index i) const |
const_iterator | begin () const |
Iterator pointing to the first ContinuousDoF component. More... | |
const_iterator | end () const |
Iterator pointing one past last ContinuousDoF component. More... | |
const_iterator | cbegin () const |
Const iterator to first ContinuousDoF component. More... | |
const_iterator | cend () const |
Const iterator pointing one past last ContinuousDoF component. More... | |
bool | is_excluded_occ (std::string const &_occ_name) const |
Index | dim () const |
Dimension of the DoFSet, equivalent to basis().cols() More... | |
Eigen::MatrixXd const & | basis () const |
SymGroupRepID const & | symrep_ID () const |
bool | identical (DoFSet const &rhs) const |
Returns true if "rhs" has identical components and basis to this DoFSet. More... | |
void | transform_basis (Eigen::Ref< const Eigen::MatrixXd > const &trans_mat) |
Equivalent to m_basis=trans_mat*m_basis . Invalidates SymGroupRepID. More... | |
bool | update_IDs (const std::vector< Index > &before_IDs, const std::vector< Index > &after_IDs) |
Static Public Member Functions | |
static DoFSet | make_default (AnisoValTraits const &_type) |
Private Attributes | |
BasicTraits | m_traits |
std::vector< ContinuousDoF > | m_components |
ContinuousDoF components, one for each column in m_info->basis() More... | |
DoFSetInfo | m_info |
std::unordered_set< std::string > | m_excluded_occs |
A list of site occupants for which the DoF does not apply. More... | |
using CASM::DoFSet::const_iterator = std::vector<ContinuousDoF>::const_iterator |
using CASM::DoFSet::Container = std::vector<ContinuousDoF> |
using CASM::DoFSet::TypeFunc = std::function<notstd::cloneable_ptr<AnisoValTraits>()> |
CASM::DoFSet::DoFSet | ( | AnisoValTraits const & | _type, |
std::vector< std::string > | components, | ||
DoFSetInfo | _info, | ||
std::unordered_set< std::string > | excluded_occupants = {} |
||
) |
General case DoFSet constructor
_type | AnisoValTraits specifying the type of DoF. |
components | Name of each component of the DoFSet. (i.e. "dx", "dy", "dz" for "disp" DoF) |
_info | DoFSetInfo containing the SymGroupRepID and DoFSet coordinate axes matrix (basis) |
excluded_occupants | A list of site occupants for which the DoF does not apply |
Note: Use the static function DoFSet::make_default
to construct a DoFSet having standard dimension and coordinate basis.
|
inline |
Const reference to the DoFSet coordinate axes
A particular DoFSet column-vector value, 'v', can be represented in the standard coordinate space by:
v_standard = basis * v
Note:
|
inline |
Iterator pointing to the first ContinuousDoF component.
|
inline |
Const iterator to first ContinuousDoF component.
|
inline |
Const iterator pointing one past last ContinuousDoF component.
|
inline |
|
inline |
Iterator pointing one past last ContinuousDoF component.
bool CASM::DoFSet::identical | ( | DoFSet const & | rhs | ) | const |
|
inline |
Returns reference to DoFSetInfo (which contains SymGroupRepID and basis vectors of the DoFSet coordinate system)
|
inline |
void CASM::DoFSet::lock_IDs | ( | ) |
|
static |
Construct a DoFSet having standard dimension and coordinate basis for given type.
Example usage:
|
inline |
Return i'th component of DoFSet
DoFSet components are represented as ContinuousDoF, which, in addition to a type_name also has a variable name.
|
inline |
Set identifying index (ID) of components in this DoFSet
Notes:
void CASM::DoFSet::set_sequential_IDs | ( | ) |
|
inline |
|
inline |
SymGroupRepID of this DoFSet
Note:
|
inline |
Returns the AnisoValTraits object for the DoF type of this DoFSet.
void CASM::DoFSet::transform_basis | ( | Eigen::Ref< const Eigen::MatrixXd > const & | trans_mat | ) |
Equivalent to m_basis=trans_mat*m_basis
. Invalidates SymGroupRepID.
|
inline |
bool CASM::DoFSet::update_IDs | ( | const std::vector< Index > & | before_IDs, |
const std::vector< Index > & | after_IDs | ||
) |
Update component IDs
Notes:
before_IDs[i]
will get changed to the corresponding ID in after_IDs[i]
.
|
private |
ContinuousDoF components, one for each column in m_info->basis()
|
private |
|
private |
DoFSetInfo containing the SymGroupRepID and DoFSet coordinate axes matrix (basis)
|
private |
AnisoValTraits. Describes the type of DoF, and can convert Cartesian symmetry representations into the appropriate representation