CASM  1.1.0
A Clusters Approach to Statistical Mechanics
CASM::xtal::BasicStructure Class Reference

#include <BasicStructure.hh>

Detailed Description

BasicStructure specifies the lattice and atomic basis of a crystal.

Definition at line 32 of file BasicStructure.hh.

Public Member Functions

 BasicStructure (const Lattice &init_lat)
 
 BasicStructure ()
 
 BasicStructure (const BasicStructure &RHS)
 
 ~BasicStructure ()
 
const Latticelattice () const
 
const std::vector< Site > & basis () const
 
std::vector< Site > & set_basis ()
 
const std::string & title () const
 
DoFSet const & global_dof (std::string const &dof_type) const
 
std::map< DoFKey, DoFSet > const & global_dofs () const
 
BasicStructureoperator= (const BasicStructure &RHS)
 
void within ()
 Translate all basis sites so that they are inside the unit cell. More...
 
void set_lattice (const Lattice &lattice, COORD_TYPE mode)
 
void set_title (std::string const &_title)
 Set the title of the structure. More...
 
void set_global_dofs (std::map< DoFKey, DoFSet > const &new_dof_map)
 Manually set the global DoFs. More...
 
void set_global_dofs (std::vector< DoFSet > const &new_dof_vec)
 Manually set the global DoFs. More...
 
void set_basis (std::vector< Site > const &_basis, COORD_TYPE mode=CART)
 Manually set the basis sites. More...
 
void push_back (Site const &_site, COORD_TYPE mode=CART)
 Manually set the basis sites. More...
 
bool is_time_reversal_active () const
 Returns true if structure has attributes affected by time reversal. More...
 
BasicStructureoperator+= (const Coordinate &shift)
 Translates all atoms in cell. More...
 
BasicStructureoperator-= (const Coordinate &shift)
 
Index max_possible_vacancies () const
 Counts sites that allow vacancies. More...
 
void print_xyz (std::ostream &stream, bool frac=false) const
 Output other formats. More...
 

Static Public Member Functions

static BasicStructure from_poscar_stream (std::istream &poscar_stream, double tol=TOL)
 

Protected Attributes

Lattice m_lattice
 
std::string m_title
 User-specified name of this Structure. More...
 
std::vector< Sitem_basis
 Lattice vectors that specifies periodicity of the crystal. More...
 
std::map< DoFKey, DoFSetm_global_dof_map
 continuous global degrees of freedom More...
 

Private Member Functions

void main_print (std::ostream &stream, COORD_TYPE mode, bool version5, int option) const
 
void read (std::istream &stream, double tol=TOL)
 

Constructor & Destructor Documentation

◆ BasicStructure() [1/3]

CASM::xtal::BasicStructure::BasicStructure ( const Lattice init_lat)
inline

Definition at line 55 of file BasicStructure.hh.

◆ BasicStructure() [2/3]

CASM::xtal::BasicStructure::BasicStructure ( )
inline

Definition at line 56 of file BasicStructure.hh.

◆ BasicStructure() [3/3]

CASM::xtal::BasicStructure::BasicStructure ( const BasicStructure RHS)

Have to explicitly define the copy constructor so that sites in the new structure do not depend on the lattice of 'RHS'

Definition at line 27 of file BasicStructure.cc.

◆ ~BasicStructure()

CASM::xtal::BasicStructure::~BasicStructure ( )
inline

Definition at line 65 of file BasicStructure.hh.

Member Function Documentation

◆ basis()

const std::vector<Site>& CASM::xtal::BasicStructure::basis ( ) const
inline

Definition at line 71 of file BasicStructure.hh.

◆ from_poscar_stream()

BasicStructure CASM::xtal::BasicStructure::from_poscar_stream ( std::istream &  poscar_stream,
double  tol = TOL 
)
static

Definition at line 18 of file BasicStructure.cc.

◆ global_dof()

DoFSet const & CASM::xtal::BasicStructure::global_dof ( std::string const &  dof_type) const

Definition at line 53 of file BasicStructure.cc.

◆ global_dofs()

std::map<DoFKey, DoFSet> const& CASM::xtal::BasicStructure::global_dofs ( ) const
inline

Definition at line 79 of file BasicStructure.hh.

◆ is_time_reversal_active()

bool CASM::xtal::BasicStructure::is_time_reversal_active ( ) const

Returns true if structure has attributes affected by time reversal.

Definition at line 323 of file BasicStructure.cc.

◆ lattice()

const Lattice& CASM::xtal::BasicStructure::lattice ( ) const
inline

Definition at line 69 of file BasicStructure.hh.

◆ main_print()

void CASM::xtal::BasicStructure::main_print ( std::ostream &  stream,
COORD_TYPE  mode,
bool  version5,
int  option 
) const
private

◆ max_possible_vacancies()

Index CASM::xtal::BasicStructure::max_possible_vacancies ( ) const

Counts sites that allow vacancies.

Definition at line 108 of file BasicStructure.cc.

◆ operator+=()

BasicStructure & CASM::xtal::BasicStructure::operator+= ( const Coordinate shift)

Translates all atoms in cell.

Definition at line 292 of file BasicStructure.cc.

◆ operator-=()

BasicStructure & CASM::xtal::BasicStructure::operator-= ( const Coordinate shift)

Definition at line 302 of file BasicStructure.cc.

◆ operator=()

BasicStructure & CASM::xtal::BasicStructure::operator= ( const BasicStructure RHS)

Have to explicitly define the assignment operator so that sites in this structure do not depend on the lattice of 'RHS'

Definition at line 39 of file BasicStructure.cc.

◆ print_xyz()

void CASM::xtal::BasicStructure::print_xyz ( std::ostream &  stream,
bool  frac = false 
) const

Output other formats.

Definition at line 269 of file BasicStructure.cc.

◆ push_back()

void CASM::xtal::BasicStructure::push_back ( Site const &  _site,
COORD_TYPE  mode = CART 
)

Manually set the basis sites.

Definition at line 101 of file BasicStructure.cc.

◆ read()

void CASM::xtal::BasicStructure::read ( std::istream &  stream,
double  tol = TOL 
)
private

Definition at line 121 of file BasicStructure.cc.

◆ set_basis() [1/2]

std::vector<Site>& CASM::xtal::BasicStructure::set_basis ( )
inline

Definition at line 73 of file BasicStructure.hh.

◆ set_basis() [2/2]

void CASM::xtal::BasicStructure::set_basis ( std::vector< Site > const &  _basis,
COORD_TYPE  mode = CART 
)

Manually set the basis sites.

Allows for the basis elements of a basic structure to be manually set, e.g. as in jsonParser.cc.

Definition at line 94 of file BasicStructure.cc.

◆ set_global_dofs() [1/2]

void CASM::xtal::BasicStructure::set_global_dofs ( std::map< DoFKey, DoFSet > const &  new_dof_map)
inline

Manually set the global DoFs.

Definition at line 101 of file BasicStructure.hh.

◆ set_global_dofs() [2/2]

void CASM::xtal::BasicStructure::set_global_dofs ( std::vector< DoFSet > const &  new_dof_vec)
inline

Manually set the global DoFs.

Definition at line 106 of file BasicStructure.hh.

◆ set_lattice()

void CASM::xtal::BasicStructure::set_lattice ( const Lattice lattice,
COORD_TYPE  mode 
)

change the lattice and update site coordinates. Argument 'mode' specifies which mode is preserved e.g.: struc.set_lattice(new_lat, CART) calculates all Cartesian coordinates, invalidates the FRAC coordinates, and changes the lattice

Definition at line 74 of file BasicStructure.cc.

◆ set_title()

void CASM::xtal::BasicStructure::set_title ( std::string const &  _title)

Set the title of the structure.

Definition at line 84 of file BasicStructure.cc.

◆ title()

const std::string& CASM::xtal::BasicStructure::title ( ) const
inline

Definition at line 75 of file BasicStructure.hh.

◆ within()

void CASM::xtal::BasicStructure::within ( )

Translate all basis sites so that they are inside the unit cell.

Definition at line 65 of file BasicStructure.cc.

Member Data Documentation

◆ m_basis

std::vector<Site> CASM::xtal::BasicStructure::m_basis
protected

Lattice vectors that specifies periodicity of the crystal.

Definition at line 40 of file BasicStructure.hh.

◆ m_global_dof_map

std::map<DoFKey, DoFSet> CASM::xtal::BasicStructure::m_global_dof_map
protected

continuous global degrees of freedom

Definition at line 43 of file BasicStructure.hh.

◆ m_lattice

Lattice CASM::xtal::BasicStructure::m_lattice
protected

Definition at line 34 of file BasicStructure.hh.

◆ m_title

std::string CASM::xtal::BasicStructure::m_title
protected

User-specified name of this Structure.

Definition at line 37 of file BasicStructure.hh.


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