CASM  1.1.0
A Clusters Approach to Statistical Mechanics
CASM::Supercell Class Reference

#include <Supercell.hh>

+ Inheritance diagram for CASM::Supercell:

Detailed Description

Represents a supercell of the primitive parent crystal structure.

Definition at line 49 of file Supercell.hh.

Public Types

using permute_const_iterator = SupercellSymInfo::permute_const_iterator
 
typedef Base::MostDerived MostDerived
 

Public Member Functions

 Supercell (const Supercell &RHS)
 
 Supercell (std::shared_ptr< Structure const > const &_shared_prim, const Lattice &superlattice)
 
 Supercell (std::shared_ptr< Structure const > const &_shared_prim, Eigen::Matrix3l const &superlattice_matrix)
 
 Supercell (const PrimClex *_prim, const Lattice &superlattice)
 
 Supercell (const PrimClex *_prim, const Eigen::Ref< const Eigen::Matrix3l > &superlattice_matrix)
 
 ~Supercell ()
 
Index sublat (Index linear_index) const
 Return the sublattice index for a linear index. More...
 
Index linear_index (const Coordinate &coord, double tol=TOL) const
 Given a Coordinate and tolerance, return linear index into Configuration. More...
 
Index linear_index (const UnitCellCoord &bijk) const
 Return the linear index corresponding to integral coordinates. More...
 
Coordinate coord (Index linear_index) const
 Return the linear index corresponding to integral coordinates. More...
 
UnitCellCoord uccoord (Index linear_index) const
 Return the integral coordinates corresponding to a linear index. More...
 
Eigen::VectorXi max_allowed_occupation () const
 returns maximum allowed occupation bitstring – used for initializing enumeration counters More...
 
const Structureprim () const
 
std::shared_ptr< Structure const > const & shared_prim () const
 
double crystallography_tol () const
 
bool has_primclex () const
 Use while transitioning Supercell to no longer need a PrimClex const * More...
 
void set_primclex (PrimClex const *primclex_ptr) const
 Use while transitioning Supercell to no longer need a PrimClex const * More...
 
const PrimClexprimclex () const
 Use while transitioning Supercell to no longer need a PrimClex const * More...
 
Index volume () const
 Return number of primitive cells that fit inside of *this. More...
 
Index basis_size () const
 
Index num_sites () const
 
SymGroupRep const & permutation_symrep () const
 
Eigen::Matrix3l transf_mat () const
 
const Latticelattice () const
 The super lattice. More...
 
const SuperNeighborListnlist () const
 Returns the SuperNeighborList. More...
 
const SymGroupfactor_group () const
 
const SupercellSymInfosym_info () const
 
bool operator< (const Supercell &B) const
 
std::pair< DB::DatabaseIterator< Supercell >, bool > insert () const
 Insert the canonical form of this into the database. More...
 
std::string name () const
 
std::string alias () const
 Return "alias" if object stored in database and alias exists, return empty string otherwise. More...
 
bool operator> (const MostDerived &B) const
 
bool operator<= (const MostDerived &B) const
 
bool operator>= (const MostDerived &B) const
 
bool operator== (const MostDerived &B) const
 
bool operator!= (const MostDerived &B) const
 

Protected Member Functions

void clear_name () const
 Unset "name", if object is modified. More...
 
void regenerate_name () const
 Regenerate "name". More...
 
void set_name (std::string _name) const
 Set "name", explicity. More...
 
bool eq_impl (const MostDerived &B) const
 
bool ne_impl (const MostDerived &B) const
 

Private Member Functions

bool eq_impl (const Supercell &B) const
 
std::string generate_name_impl () const
 Return supercell name. More...
 

Private Attributes

friend Comparisons< SupercellCanonicalForm< CRTPBase< Supercell > > >
 
PrimClex const * m_primclex
 
std::shared_ptr< Structure const > m_shared_prim
 
SupercellSymInfo m_sym_info
 
notstd::cloneable_ptr< SuperNeighborListm_nlist
 SuperNeighborList, mutable for lazy construction. More...
 
Index m_nlist_size_at_construction
 
std::string m_name
 

Member Typedef Documentation

◆ MostDerived

typedef Base::MostDerived CASM::DB::Named< Comparisons< SupercellCanonicalForm< CRTPBase< Supercell > > > >::MostDerived
inherited

Definition at line 25 of file Named.hh.

◆ permute_const_iterator

Constructor & Destructor Documentation

◆ Supercell() [1/5]

CASM::Supercell::Supercell ( const Supercell RHS)

Definition at line 36 of file Supercell.cc.

◆ Supercell() [2/5]

CASM::Supercell::Supercell ( std::shared_ptr< Structure const > const &  _shared_prim,
const Lattice superlattice 
)

Definition at line 52 of file Supercell.cc.

◆ Supercell() [3/5]

CASM::Supercell::Supercell ( std::shared_ptr< Structure const > const &  _shared_prim,
Eigen::Matrix3l const &  superlattice_matrix 
)

Definition at line 42 of file Supercell.cc.

◆ Supercell() [4/5]

CASM::Supercell::Supercell ( const PrimClex _prim,
const Lattice superlattice 
)

Definition at line 87 of file Supercell.cc.

◆ Supercell() [5/5]

CASM::Supercell::Supercell ( const PrimClex _prim,
const Eigen::Ref< const Eigen::Matrix3l > &  superlattice_matrix 
)

Definition at line 77 of file Supercell.cc.

◆ ~Supercell()

CASM::Supercell::~Supercell ( )

Definition at line 111 of file Supercell.cc.

Member Function Documentation

◆ alias()

std::string CASM::DB::Named< Comparisons< SupercellCanonicalForm< CRTPBase< Supercell > > > >::alias
inherited

Return "alias" if object stored in database and alias exists, return empty string otherwise.

Definition at line 34 of file Named_impl.hh.

◆ basis_size()

Index CASM::Supercell::basis_size ( ) const

Definition at line 231 of file Supercell.cc.

◆ clear_name()

void CASM::DB::Named< Comparisons< SupercellCanonicalForm< CRTPBase< Supercell > > > >::clear_name
protectedinherited

Unset "name", if object is modified.

Definition at line 38 of file Named_impl.hh.

◆ coord()

Coordinate CASM::Supercell::coord ( Index  linear_index) const

Return the linear index corresponding to integral coordinates.

Return the coordinate corresponding to linear index in the supercell.

Definition at line 199 of file Supercell.cc.

◆ crystallography_tol()

double CASM::Supercell::crystallography_tol ( ) const

Definition at line 119 of file Supercell.cc.

◆ eq_impl() [1/2]

template<typename Base >
bool notstd::Comparisons< Base >::eq_impl ( const MostDerived B) const
inlineprotectedinherited

Definition at line 40 of file Comparisons.hh.

◆ eq_impl() [2/2]

bool CASM::Supercell::eq_impl ( const Supercell B) const
private

Definition at line 289 of file Supercell.cc.

◆ factor_group()

const SymGroup & CASM::Supercell::factor_group ( ) const

Definition at line 260 of file Supercell.cc.

◆ generate_name_impl()

std::string CASM::Supercell::generate_name_impl ( ) const
private

Return supercell name.

For supercells that are equivalent to the canonical supercell:

  • EQUIV_SCEL_NAME = $CANON_SCELNAME = SCELV_A_B_C_D_E_F
  • where 'V' is supercell volume (number of unit cells), and 'A-F' are the six non-zero elements of the hermite normal form of the supercell transformation matrix (T00*T11*T22, T00, T11, T22, T12, T02, T01)
  • CANON_SCEL is found in the supercell database (or constructed using the HNF for the tranformation matrix and then making the lattice canonical) For supercells that are not equivalent to the canonical supercell:
  • NONEQUIV_SCEL_NAME = $CANON_SCELNAME.$FG_INDEX
  • The CANON_SCEL is constructed, then the FG_INDEX-th prim factor_group operation is applied

Definition at line 317 of file Supercell.cc.

◆ has_primclex()

bool CASM::Supercell::has_primclex ( ) const

Use while transitioning Supercell to no longer need a PrimClex const *

Use while transitioning Supercell to no longer need a PrimClex const *

Note:

Definition at line 127 of file Supercell.cc.

◆ insert()

std::pair< DB::DatabaseIterator< Supercell >, bool > CASM::Supercell::insert ( ) const

Insert the canonical form of this into the database.

Insert the canonical form of this into the database [deprecated].

Note: prefer using make_canonical_and_insert Note: does not commit the change in the database

Definition at line 283 of file Supercell.cc.

◆ lattice()

const Lattice & CASM::Supercell::lattice ( ) const

The super lattice.

Definition at line 239 of file Supercell.cc.

◆ linear_index() [1/2]

Index CASM::Supercell::linear_index ( const Coordinate coord,
double  tol = TOL 
) const

Given a Coordinate and tolerance, return linear index into Configuration.

This may be slow, first converts Coordinate -> UnitCellCoord, then gets linear_index from UnitCellCoord

Implementation:

Coordinate tcoord(coord);
tcoord.within();
return linear_index(UnitCellCoord(prim(), coord, tol));
Index linear_index(const Coordinate &coord, double tol=TOL) const
Given a Coordinate and tolerance, return linear index into Configuration.
Definition: Supercell.cc:183
Coordinate coord(Index linear_index) const
Return the linear index corresponding to integral coordinates.
Definition: Supercell.cc:199
const Structure & prim() const
Definition: Supercell.cc:113

Definition at line 183 of file Supercell.cc.

◆ linear_index() [2/2]

Index CASM::Supercell::linear_index ( const UnitCellCoord bijk) const

Return the linear index corresponding to integral coordinates.

Linear indices are grouped by sublattice, then ordered as determined by xtal::OrderedLatticePointGenerator.

Definition at line 193 of file Supercell.cc.

◆ max_allowed_occupation()

Eigen::VectorXi CASM::Supercell::max_allowed_occupation ( ) const

returns maximum allowed occupation bitstring – used for initializing enumeration counters

Definition at line 213 of file Supercell.cc.

◆ name()

std::string CASM::DB::Named< Comparisons< SupercellCanonicalForm< CRTPBase< Supercell > > > >::name
inherited

Definition at line 30 of file Named_impl.hh.

◆ ne_impl()

template<typename Base >
bool notstd::Comparisons< Base >::ne_impl ( const MostDerived B) const
inlineprotectedinherited

Definition at line 44 of file Comparisons.hh.

◆ nlist()

const SuperNeighborList & CASM::Supercell::nlist ( ) const

Returns the SuperNeighborList.

Requires that the prim_nlist has been set by one of:

At each access, the underlying PrimNeighborList will be checked and if it has been expanded then the SuperNeighborList will be extended also. References obtained from this function will be out of date if the underlying PrimNeighborList has been expanded, so it is prudent to only access the SuperNeighborList for immediate use.

Definition at line 244 of file Supercell.cc.

◆ num_sites()

Index CASM::Supercell::num_sites ( ) const

Definition at line 233 of file Supercell.cc.

◆ operator!=()

template<typename Base >
bool notstd::Comparisons< Base >::operator!= ( const MostDerived B) const
inlineinherited

Definition at line 37 of file Comparisons.hh.

◆ operator<()

bool CASM::Supercell::operator< ( const Supercell B) const

Definition at line 267 of file Supercell.cc.

◆ operator<=()

template<typename Base >
bool notstd::Comparisons< Base >::operator<= ( const MostDerived B) const
inlineinherited

Definition at line 31 of file Comparisons.hh.

◆ operator==()

template<typename Base >
bool notstd::Comparisons< Base >::operator== ( const MostDerived B) const
inlineinherited

Definition at line 35 of file Comparisons.hh.

◆ operator>()

template<typename Base >
bool notstd::Comparisons< Base >::operator> ( const MostDerived B) const
inlineinherited

Definition at line 29 of file Comparisons.hh.

◆ operator>=()

template<typename Base >
bool notstd::Comparisons< Base >::operator>= ( const MostDerived B) const
inlineinherited

Definition at line 33 of file Comparisons.hh.

◆ permutation_symrep()

SymGroupRep const& CASM::Supercell::permutation_symrep ( ) const

◆ prim()

const Structure & CASM::Supercell::prim ( ) const

Definition at line 113 of file Supercell.cc.

◆ primclex()

const PrimClex & CASM::Supercell::primclex ( ) const

Use while transitioning Supercell to no longer need a PrimClex const *

Use while transitioning Supercell to no longer need a PrimClex const *

Note:

Definition at line 150 of file Supercell.cc.

◆ regenerate_name()

void CASM::DB::Named< Comparisons< SupercellCanonicalForm< CRTPBase< Supercell > > > >::regenerate_name
protectedinherited

Regenerate "name".

Definition at line 41 of file Named_impl.hh.

◆ set_name()

void CASM::DB::Named< Comparisons< SupercellCanonicalForm< CRTPBase< Supercell > > > >::set_name ( std::string  _name) const
protectedinherited

Set "name", explicity.

Set "name", explicity modified.

Definition at line 44 of file Named_impl.hh.

◆ set_primclex()

void CASM::Supercell::set_primclex ( PrimClex const *  _primclex) const

Use while transitioning Supercell to no longer need a PrimClex const *

Use while transitioning Supercell to no longer need a PrimClex const *

Note:

Definition at line 136 of file Supercell.cc.

◆ shared_prim()

std::shared_ptr< Structure const > const & CASM::Supercell::shared_prim ( ) const

Definition at line 115 of file Supercell.cc.

◆ sublat()

Index CASM::Supercell::sublat ( Index  linear_index) const

Return the sublattice index for a linear index.

Linear indices are grouped by sublattice, then ordered as determined by xtal::OrderedLatticePointGenerator. This function is equivalent to:

Index volume() const
Return number of primitive cells that fit inside of *this.
Definition: Supercell.cc:227

Definition at line 165 of file Supercell.cc.

◆ sym_info()

const SupercellSymInfo & CASM::Supercell::sym_info ( ) const

Definition at line 265 of file Supercell.cc.

◆ transf_mat()

Eigen::Matrix3l CASM::Supercell::transf_mat ( ) const

Definition at line 235 of file Supercell.cc.

◆ uccoord()

UnitCellCoord CASM::Supercell::uccoord ( Index  linear_index) const

Return the integral coordinates corresponding to a linear index.

Linear indices are grouped by sublattice, then ordered as determined by xtal::OrderedLatticePointGenerator.

Definition at line 209 of file Supercell.cc.

◆ volume()

Index CASM::Supercell::volume ( ) const

Return number of primitive cells that fit inside of *this.

Definition at line 227 of file Supercell.cc.

Member Data Documentation

◆ Comparisons< SupercellCanonicalForm< CRTPBase< Supercell > > >

friend CASM::Supercell::Comparisons< SupercellCanonicalForm< CRTPBase< Supercell > > >
private

Definition at line 148 of file Supercell.hh.

◆ m_name

std::string CASM::DB::Named< Comparisons< SupercellCanonicalForm< CRTPBase< Supercell > > > >::m_name
mutableprivateinherited

Definition at line 47 of file Named.hh.

◆ m_nlist

notstd::cloneable_ptr<SuperNeighborList> CASM::Supercell::m_nlist
mutableprivate

SuperNeighborList, mutable for lazy construction.

Definition at line 173 of file Supercell.hh.

◆ m_nlist_size_at_construction

Index CASM::Supercell::m_nlist_size_at_construction
mutableprivate

Store size of PrimNeighborList at time of construction of SuperNeighborList to enable checking if SuperNeighborList should be re-constructed

Definition at line 178 of file Supercell.hh.

◆ m_primclex

PrimClex const* CASM::Supercell::m_primclex
mutableprivate

Definition at line 166 of file Supercell.hh.

◆ m_shared_prim

std::shared_ptr<Structure const> CASM::Supercell::m_shared_prim
private

Definition at line 168 of file Supercell.hh.

◆ m_sym_info

SupercellSymInfo CASM::Supercell::m_sym_info
private

Definition at line 170 of file Supercell.hh.


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