CASM  1.1.0
A Clusters Approach to Statistical Mechanics
CASM::ClusterSymCompare< Base > Class Template Reference

#include <ClusterSymCompare.hh>

+ Inheritance diagram for CASM::ClusterSymCompare< Base >:

Detailed Description

template<typename Base>
class CASM::ClusterSymCompare< Base >

CRTP Base class for common cluster symmetry and comparison implementations.

ClusterSymCompare can be used for common implementations of SymCompareType methods for cluster orbits. To do so, it requires that a traits class (traits<SymCompareType>) is implemented with:

  • typedef Element; // type of Cluster, ex: IntegralCluster
  • typedef InvariantsType; // ex: ClusterInvariants
  • static Element copy_apply(SymOp const&, Element, SymCompareType const&);
  • static InvariantsType make_invariants(Element const&, SymCompareType const&);

The orbit element type, Element, is required to implement:

  • 'Element::operator<(Element B)'
  • 'Permutation Element::sort_permutation()'

The orbit invariants type, InvariantsType, is required to implement:

  • 'CASM::compare(InvariantsType, InvariantsType, double tol)'

ClusterSymCompare itself implements:

  • 'make_invariants_impl':
    • uses 'traits<SymCompareType>::make_invariants(Element, SymCompareType)'
  • 'invariants_compare_impl'
    • uses 'CASM::compare(InvariantsType, InvariantsType, double tol)';
  • 'compare_impl':
    • uses 'Element::operator<(Element B)'
  • 'copy_apply_impl':
    • implemented by SymCompareType
    • uses 'traits<SymCompareType>::copy_apply(SymOp, Element, SymCompareType)'
  • 'canonical_transform_impl':
    • uses 'Element::sort_permutation'
  • 'inter_orbit_compare_impl':
    • uses the default implemented by SymCompare
    • uses invariants_compare_impl and compare_impl

The methods ClusterSymCompare implements are overriden if an implementation exists in final SymCompareType implementations.

Final SymCompareType implementations inheriting from ClusterSymCompare still require:

  • spatial_prepare_impl
    • typically uses traits<SymCompareType>::position
  • spatial_transform_impl
  • representation_prepare_impl
    • typically uses Element::sort

Definition at line 76 of file ClusterSymCompare.hh.

Public Types

typedef Base::MostDerived MostDerived
 
typedef Element ClusterType
 

Public Member Functions

ClusterType copy_apply (PermuteIterator const &permute_it, ClusterType obj) const
 Get SymOp from PermuteIterator and apply to cluster. More...
 

Protected Member Functions

InvariantsType make_invariants_impl (const ClusterType &obj) const
 Make orbit invariants from one element in the orbit. More...
 
bool invariants_compare_impl (const InvariantsType &A, const InvariantsType &B) const
 Orders 'prepared' elements in the same orbit. More...
 
bool compare_impl (const ClusterType &A, const ClusterType &B) const
 Compares 'prepared' clusters. More...
 
ClusterType copy_apply_impl (SymOp const &op, ClusterType obj) const
 Applies SymOp to cluster. More...
 
std::unique_ptr< SymOpRepresentationcanonical_transform_impl (ClusterType const &obj) const
 Returns transformation that takes 'obj' to its prepared (canonical) form. More...
 

Member Typedef Documentation

◆ ClusterType

template<typename Base >
typedef Element CASM::ClusterSymCompare< Base >::ClusterType

Element (of orbit) refers to Cluster, not element of Cluster

Definition at line 81 of file ClusterSymCompare.hh.

◆ MostDerived

template<typename Base >
typedef Base::MostDerived CASM::ClusterSymCompare< Base >::MostDerived

Definition at line 78 of file ClusterSymCompare.hh.

Member Function Documentation

◆ canonical_transform_impl()

template<typename Base >
std::unique_ptr< SymOpRepresentation > CASM::ClusterSymCompare< Base >::canonical_transform_impl ( ClusterType const &  obj) const
protected

Returns transformation that takes 'obj' to its prepared (canonical) form.

  • For now returns pointer to SymPermutation object that encodes permutation due to sorting elements

Definition at line 66 of file ClusterSymCompare_impl.hh.

◆ compare_impl()

template<typename Base >
bool CASM::ClusterSymCompare< Base >::compare_impl ( const ClusterType A,
const ClusterType B 
) const
protected

Compares 'prepared' clusters.

  • Returns 'true' to indicate A < B
  • Equivalence is indicated by
    !compare(A,B) && !compare(B,A)
    bool compare(ClusterInvariants const &A, ClusterInvariants const &B, double tol)
    Compare ClusterInvariants.
  • Assumes elements are 'prepared' before being compared

Definition at line 46 of file ClusterSymCompare_impl.hh.

◆ copy_apply()

template<typename Base >
ClusterSymCompare< Base >::ClusterType CASM::ClusterSymCompare< Base >::copy_apply ( PermuteIterator const &  permute_it,
ClusterType  obj 
) const

Get SymOp from PermuteIterator and apply to cluster.

Definition at line 14 of file ClusterSymCompare_impl.hh.

◆ copy_apply_impl()

template<typename Base >
ClusterSymCompare< Base >::ClusterType CASM::ClusterSymCompare< Base >::copy_apply_impl ( SymOp const &  op,
ClusterType  obj 
) const
protected

Applies SymOp to cluster.

Definition at line 54 of file ClusterSymCompare_impl.hh.

◆ invariants_compare_impl()

template<typename Base >
bool CASM::ClusterSymCompare< Base >::invariants_compare_impl ( const InvariantsType &  A,
const InvariantsType &  B 
) const
protected

Orders 'prepared' elements in the same orbit.

  • Returns 'true' to indicate A < B
  • Equivalence is indicated by
    !compare(A,B) && !compare(B,A)
  • Assumes elements are 'prepared' before being compared Implementation:
  • First compares by number of sites in cluster
  • Then compare all displacements, from longest to shortest

Definition at line 35 of file ClusterSymCompare_impl.hh.

◆ make_invariants_impl()

template<typename Base >
ClusterSymCompare< Base >::InvariantsType CASM::ClusterSymCompare< Base >::make_invariants_impl ( const ClusterType obj) const
protected

Make orbit invariants from one element in the orbit.

Definition at line 22 of file ClusterSymCompare_impl.hh.


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