CASM
AClustersApproachtoStatisticalMechanics
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules
CASM::BasicStructure< CoordType > Class Template Reference

#include <Cluster.hh>

Detailed Description

template<typename CoordType>
class CASM::BasicStructure< CoordType >

BasicStructure specifies the lattice and atomic basis of a crystal.

Definition at line 16 of file Cluster.hh.

Public Member Functions

 BasicStructure (const Lattice &init_lat)
 
 BasicStructure ()
 
 BasicStructure (const fs::path &filepath)
 
 BasicStructure (const BasicStructure &RHS)
 
virtual ~BasicStructure ()
 
template<typename CoordType2 >
Index find (const CoordType2 &test_site, double tol=TOL) const
 
template<typename CoordType2 >
Index find (const CoordType2 &test_site, const Coordinate &shift, double tol) const
 
const Latticelattice () const
 
template<typename CoordType2 >
UnitCellCoord get_unit_cell_coord (const CoordType2 &test_site, double tol=TOL) const
 
virtual BasicStructureoperator= (const BasicStructure &RHS)
 
void copy_attributes_from (const BasicStructure &RHS)
 
void update ()
 
virtual void reset ()
 
void set_site_internals ()
 Associate each site with its basis index by setting its internal flags (asym_ind -> -1) More...
 
void within ()
 Translate all basis sites so that they are inside the unit cell. More...
 
CoordType get_site (const UnitCellCoord &ucc) const
 
void set_lattice (const Lattice &lattice, COORD_TYPE mode)
 
void set_basis (Array< CoordType > basis_in)
 Manually set the basis sites. More...
 
void generate_factor_group (SymGroup &factor_group, double map_tol) const
 apply a symmetry operation to the current structure (may change lattice vectors and order of basis atoms) More...
 
void generate_factor_group_slow (SymGroup &factor_group, double map_tol) const
 
void fg_converge (double small_tol, double large_tol, double increment)
 
void fg_converge (SymGroup &factor_group, double small_tol, double large_tol, double increment)
 
SymGroupRepID generate_basis_permutation_representation (const MasterSymGroup &factor_group, bool verbose) const
 
void symmetrize (const SymGroup &relaxed_factors)
 
void symmetrize (const double &tolerance)
 
bool is_primitive (double prim_tol=TOL) const
 
bool is_primitive (BasicStructure &new_prim, double prim_tol=TOL) const
 
void fill_supercell (const BasicStructure &prim, double map_tol=TOL)
 fill an empty structure with the basis of its corresponding primitive cell More...
 
BasicStructure create_superstruc (const Lattice &scel_lat, double map_tol=TOL) const
 Shortcut routine to create a supercell structure and fill it with sites. More...
 
void generate_flowertrees_safe (const SiteOrbitree &in_tree, Array< SiteOrbitree > &out_trees)
 Gets clusters of every size radiating from one site and saves them to a flowertree. A garland for each site is constructed. More...
 
void generate_flowertrees (const SiteOrbitree &in_tree, Array< SiteOrbitree > &out_trees)
 
void map_superstruc_to_prim (BasicStructure &prim, const SymGroup &point_group)
 Figures out which prim basis each superstructure basis corresponds to. More...
 
void merge_sites (double maxdist)
 If atoms are too close together, average their distance and make them one. More...
 
void add_vacuum_shift (BasicStructure &new_surface_struc, double vacuum_thickness, Eigen::Vector3d shift, COORD_TYPE mode) const
 Add vacuum and shift c vector. The vacuum is always added parallel to c, and the shift vector should also be parallel to the ab plane (x,y,0) More...
 
void add_vacuum_shift (BasicStructure &new_surface_struc, double vacuum_thickness, Coordinate shift) const
 
void add_vacuum (BasicStructure &new_surface_struc, double vacuum_thickness) const
 Adds vacuum layer on top of ab plane. 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...
 
const Latticeget_lattice () const
 Return a reference to the lattice. More...
 
virtual void read (std::istream &stream)
 Print intpolated images in seperate directries. More...
 
void print_xyz (std::ostream &stream) const
 Output other formats. More...
 
void print_cif (std::ostream &stream) const
 
jsonParserto_json (jsonParser &json) const
 
void from_json (const jsonParser &json)
 

Public Attributes

std::string title
 User-specified name of this Structure. More...
 
Array< CoordType > basis
 Lattice vectors that specifies periodicity of the crystal. More...
 

Protected Attributes

Lattice m_lattice
 
bool SD_flag
 Specifies whether selectice dynamics is on or of for DFT calculations. More...
 

Private Member Functions

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

Constructor & Destructor Documentation

template<typename CoordType>
CASM::BasicStructure< CoordType >::BasicStructure ( const Lattice init_lat)
inline

Definition at line 52 of file BasicStructure.hh.

template<typename CoordType>
CASM::BasicStructure< CoordType >::BasicStructure ( )
inline

Definition at line 53 of file BasicStructure.hh.

template<typename CoordType >
CASM::BasicStructure< CoordType >::BasicStructure ( const fs::path &  filepath)

Definition at line 16 of file BasicStructure_impl.hh.

template<typename CoordType >
CASM::BasicStructure< CoordType >::BasicStructure ( const BasicStructure< CoordType > &  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 30 of file BasicStructure_impl.hh.

template<typename CoordType>
virtual CASM::BasicStructure< CoordType >::~BasicStructure ( )
inlinevirtual

Definition at line 60 of file BasicStructure.hh.

Member Function Documentation

template<typename CoordType >
void CASM::BasicStructure< CoordType >::add_vacuum ( BasicStructure< CoordType > &  new_surface_struc,
double  vacuum_thickness 
) const

Adds vacuum layer on top of ab plane.

Definition at line 886 of file BasicStructure_impl.hh.

template<typename CoordType >
void CASM::BasicStructure< CoordType >::add_vacuum_shift ( BasicStructure< CoordType > &  new_surface_struc,
double  vacuum_thickness,
Eigen::Vector3d  shift,
COORD_TYPE  mode 
) const

Add vacuum and shift c vector. The vacuum is always added parallel to c, and the shift vector should also be parallel to the ab plane (x,y,0)

Call this on a structure to get new_surface_struc: the structure with a layer of vacuum added parallel to the ab plane. vacuum_thickness: thickness of vacuum layer (Angstroms) shift: shift vector from layer to layer, assumes FRAC unless specified. The shift vector should only have values relative to a and b vectors (eg x, y, 0). Default shift is zero.

Definition at line 850 of file BasicStructure_impl.hh.

template<typename CoordType >
void CASM::BasicStructure< CoordType >::add_vacuum_shift ( BasicStructure< CoordType > &  new_surface_struc,
double  vacuum_thickness,
Coordinate  shift 
) const

Definition at line 874 of file BasicStructure_impl.hh.

template<typename CoordType >
void CASM::BasicStructure< CoordType >::copy_attributes_from ( const BasicStructure< CoordType > &  RHS)

Use this is the copy interface for things that derive from BasicStructure<> It should be overloaded in derived classes so that all important attributes besides lattice, basis, and title get copied

Definition at line 55 of file BasicStructure_impl.hh.

template<typename CoordType >
BasicStructure< CoordType > CASM::BasicStructure< CoordType >::create_superstruc ( const Lattice scel_lat,
double  map_tol = TOL 
) const

Shortcut routine to create a supercell structure and fill it with sites.

Operates on the primitive structure and takes as an argument the supercell lattice. It then returns a new superstructure.

This is similar to the Lattice*Primitive routine which returns a new superstructure. Unlike the fill_supercell routine which takes the primitive structure, this WILL fill the sites.

Definition at line 365 of file BasicStructure_impl.hh.

template<typename CoordType >
void CASM::BasicStructure< CoordType >::fg_converge ( double  small_tol,
double  large_tol,
double  increment 
)

Definition at line 230 of file BasicStructure_impl.hh.

template<typename CoordType >
void CASM::BasicStructure< CoordType >::fg_converge ( SymGroup factor_group,
double  small_tol,
double  large_tol,
double  increment 
)

Definition at line 238 of file BasicStructure_impl.hh.

template<typename CoordType >
void CASM::BasicStructure< CoordType >::fill_supercell ( const BasicStructure< CoordType > &  prim,
double  map_tol = TOL 
)

fill an empty structure with the basis of its corresponding primitive cell

It is NOT wise to use this function unless you have already initialized a superstructure with lattice vectors.

It is more wise to use the two methods that call this method: Either the overloaded * operator which does: SCEL_Lattice * Prim_Structrue = New_Superstructure — or — New_Superstructure=Prim_BasicStructure<CoordType>.create_superstruc(SCEL_Lattice);

Both of these will return NEW superstructures.

Definition at line 322 of file BasicStructure_impl.hh.

template<typename CoordType >
template<typename CoordType2 >
Index CASM::BasicStructure< CoordType >::find ( const CoordType2 &  test_site,
double  tol = TOL 
) const

return basis index of site that matches test_coord, if it is in basis otherwise, returns basis.size()

Definition at line 613 of file BasicStructure_impl.hh.

template<typename CoordType >
template<typename CoordType2 >
Index CASM::BasicStructure< CoordType >::find ( const CoordType2 &  test_site,
const Coordinate shift,
double  tol 
) const

return basis index of site that matches test_site+shift, if it is in basis otherwise, returns basis.size()

Definition at line 625 of file BasicStructure_impl.hh.

template<typename CoordType >
void CASM::BasicStructure< CoordType >::from_json ( const jsonParser json)

re-throw exceptions

Definition at line 1201 of file BasicStructure_impl.hh.

template<typename CoordType >
SymGroupRepID CASM::BasicStructure< CoordType >::generate_basis_permutation_representation ( const MasterSymGroup factor_group,
bool  verbose 
) const

Definition at line 275 of file BasicStructure_impl.hh.

template<typename CoordType >
void CASM::BasicStructure< CoordType >::generate_factor_group ( SymGroup factor_group,
double  map_tol 
) const

apply a symmetry operation to the current structure (may change lattice vectors and order of basis atoms)

Definition at line 188 of file BasicStructure_impl.hh.

template<typename CoordType >
void CASM::BasicStructure< CoordType >::generate_factor_group_slow ( SymGroup factor_group,
double  map_tol 
) const

Definition at line 103 of file BasicStructure_impl.hh.

template<typename CoordType>
void CASM::BasicStructure< CoordType >::generate_flowertrees ( const SiteOrbitree in_tree,
Array< SiteOrbitree > &  out_trees 
)
template<typename CoordType>
void CASM::BasicStructure< CoordType >::generate_flowertrees_safe ( const SiteOrbitree in_tree,
Array< SiteOrbitree > &  out_trees 
)

Gets clusters of every size radiating from one site and saves them to a flowertree. A garland for each site is constructed.

template<typename CoordType>
const Lattice& CASM::BasicStructure< CoordType >::get_lattice ( ) const
inline

Return a reference to the lattice.

Definition at line 177 of file BasicStructure.hh.

template<typename CoordType >
CoordType CASM::BasicStructure< CoordType >::get_site ( const UnitCellCoord ucc) const

Definition at line 671 of file BasicStructure_impl.hh.

template<typename CoordType >
template<typename CoordType2 >
UnitCellCoord CASM::BasicStructure< CoordType >::get_unit_cell_coord ( const CoordType2 &  bsite,
double  tol = TOL 
) const

Return the UnitCellCoord corresponding to test_site (i.e., finds the basis index and the lattice translation)

Using the lattice of (*this), this function will return a UnitCellCoord that corresponds to a site passed to it within a given tolerance. This function is useful for making a nearest neighbor table from sites that land outside of the primitive cell.

Definition at line 646 of file BasicStructure_impl.hh.

template<typename CoordType >
bool CASM::BasicStructure< CoordType >::is_primitive ( double  prim_tol = TOL) const

Returns true if the structure describes a crystal primitive cell i.e., no translation smaller than a lattice vector can map the structure onto itself

Determines if structure is primitive description of the crystal

Definition at line 379 of file BasicStructure_impl.hh.

template<typename CoordType >
bool CASM::BasicStructure< CoordType >::is_primitive ( BasicStructure< CoordType > &  new_prim,
double  prim_tol = TOL 
) const

Returns true if the structure describes a crystal primitive cell and finds the primitive cell and stores it in 'new_prim'

Determines if structure is primitive description of the crystal If not, finds primitive cell and copies to new_prim

Definition at line 421 of file BasicStructure_impl.hh.

template<typename CoordType>
const Lattice& CASM::BasicStructure< CoordType >::lattice ( ) const
inline

Definition at line 74 of file BasicStructure.hh.

template<typename CoordType>
void CASM::BasicStructure< CoordType >::main_print ( std::ostream &  stream,
COORD_TYPE  mode,
bool  version5,
int  option 
) const
private
template<typename CoordType >
void CASM::BasicStructure< CoordType >::map_superstruc_to_prim ( BasicStructure< CoordType > &  prim,
const SymGroup point_group 
)

Figures out which prim basis each superstructure basis corresponds to.

Definition at line 550 of file BasicStructure_impl.hh.

template<typename CoordType >
Index CASM::BasicStructure< CoordType >::max_possible_vacancies ( ) const

Counts sites that allow vacancies.

Definition at line 897 of file BasicStructure_impl.hh.

template<typename CoordType>
void CASM::BasicStructure< CoordType >::merge_sites ( double  maxdist)

If atoms are too close together, average their distance and make them one.

template<typename CoordType >
BasicStructure< CoordType > & CASM::BasicStructure< CoordType >::operator+= ( const Coordinate shift)

Translates all atoms in cell.

Definition at line 1137 of file BasicStructure_impl.hh.

template<typename CoordType >
BasicStructure< CoordType > & CASM::BasicStructure< CoordType >::operator-= ( const Coordinate shift)

Definition at line 1152 of file BasicStructure_impl.hh.

template<typename CoordType >
BasicStructure< CoordType > & CASM::BasicStructure< CoordType >::operator= ( const BasicStructure< CoordType > &  RHS)
virtual

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

Definition at line 40 of file BasicStructure_impl.hh.

template<typename CoordType >
void CASM::BasicStructure< CoordType >::print_cif ( std::ostream &  stream) const

Definition at line 1076 of file BasicStructure_impl.hh.

template<typename CoordType >
void CASM::BasicStructure< CoordType >::print_xyz ( std::ostream &  stream) const

Output other formats.

Definition at line 1059 of file BasicStructure_impl.hh.

template<typename CoordType >
void CASM::BasicStructure< CoordType >::read ( std::istream &  stream)
virtual

Print intpolated images in seperate directries.

Definition at line 912 of file BasicStructure_impl.hh.

template<typename CoordType >
void CASM::BasicStructure< CoordType >::reset ( )
virtual

Reimplemented in CASM::Structure.

Definition at line 72 of file BasicStructure_impl.hh.

template<typename CoordType>
void CASM::BasicStructure< CoordType >::set_basis ( Array< CoordType >  basis_in)

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 704 of file BasicStructure_impl.hh.

template<typename CoordType >
void CASM::BasicStructure< CoordType >::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 685 of file BasicStructure_impl.hh.

template<typename CoordType >
void CASM::BasicStructure< CoordType >::set_site_internals ( )

Associate each site with its basis index by setting its internal flags (asym_ind -> -1)

Definition at line 536 of file BasicStructure_impl.hh.

template<typename CoordType >
void CASM::BasicStructure< CoordType >::symmetrize ( const SymGroup relaxed_factors)

Goes to a specified site of the basis and makes a flower tree of pairs. It then stores the length and multiplicity of the pairs in a double array, giving you a strict nearest neighbor table. This version also fills up a SiteOrbitree in case you want to keep it. Blatantly copied from Anna's routine in old new CASM Goes to a specified site of the basis and makes a flower tree of pairs. It then stores the length and multiplicity of the pairs in a double array, giving you a strict nearest neighbor table. The bouquet used for this falls into the void. Given a symmetry group, the basis of the structure will have each operation applied to it. The resulting set of basis from performing these operations will be averaged out, yielding a new average basis that will replace the current one.

Definition at line 782 of file BasicStructure_impl.hh.

template<typename CoordType >
void CASM::BasicStructure< CoordType >::symmetrize ( const double &  tolerance)

Same as the other symmetrize routine, except this one assumes that the symmetry group you mean to use is the factor group of your structure within a certain tolerance.

Notice that the tolerance is also used on your point group!!

Definition at line 831 of file BasicStructure_impl.hh.

template<typename CoordType >
jsonParser & CASM::BasicStructure< CoordType >::to_json ( jsonParser json) const

Definition at line 1182 of file BasicStructure_impl.hh.

template<typename CoordType >
void CASM::BasicStructure< CoordType >::update ( )

Definition at line 86 of file BasicStructure_impl.hh.

template<typename CoordType >
void CASM::BasicStructure< CoordType >::within ( )

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

Definition at line 93 of file BasicStructure_impl.hh.

Member Data Documentation

template<typename CoordType>
Array<CoordType> CASM::BasicStructure< CoordType >::basis

Lattice vectors that specifies periodicity of the crystal.

Definition at line 42 of file BasicStructure.hh.

template<typename CoordType>
Lattice CASM::BasicStructure< CoordType >::m_lattice
protected

Definition at line 32 of file BasicStructure.hh.

template<typename CoordType>
bool CASM::BasicStructure< CoordType >::SD_flag
protected

Specifies whether selectice dynamics is on or of for DFT calculations.

Definition at line 35 of file BasicStructure.hh.

template<typename CoordType>
std::string CASM::BasicStructure< CoordType >::title

User-specified name of this Structure.

Definition at line 39 of file BasicStructure.hh.


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