22 if (A.
name() != B.
name())
return false;
25 for (; it_A != end_it; ++it_A) {
28 !(it_A->second).identical(it_B->second, tol))
37 if (
size() != 1)
return false;
57 if (
size() != RHS.
size())
return false;
62 for (j = 0; j <
size(); j++) {
65 if (j ==
size())
return false;
70 for (; it != end_it; ++it) {
73 !(it->second).identical(it_RHS->second, _tol))
82 if (
atom(i).
name() == _name)
return true;
103 std::swap(mutating_atom_pos, transformed_atom_pos);
104 return mutating_atom_pos;
109 Eigen::Vector3d transformed_position =
get_matrix(op) * atom_pos.
cart();
112 std::map<std::string, xtal::SpeciesAttribute> transformed_attribute_map;
113 for (
const auto &name_attr_pr : atom_pos.
attributes()) {
114 transformed_attribute_map.emplace(name_attr_pr.first,
119 return transformed_atom_pos;
123 std::vector<xtal::AtomPosition> transformed_atoms;
125 transformed_atoms.emplace_back(
copy_apply(op, atom_pos));
127 mutating_mol.
set_atoms(transformed_atoms);
129 std::map<std::string, xtal::SpeciesAttribute> transformed_attribute_map;
130 for (
const auto &name_attr_pr : mutating_mol.
attributes()) {
131 transformed_attribute_map.emplace(name_attr_pr.first,
141 return transformed_mol;
An atomic species associated with a position in space.
Class representing a Molecule.
void set_attributes(std::map< std::string, SpeciesAttribute > _attr)
Set all constitutent attributes of Molecule overwrites any existing attributes.
bool identical(Molecule const &RHS, double _tol) const
Check equality of two molecules, within specified tolerance. Compares atoms, irrespective of order,...
std::vector< AtomPosition > const & atoms() const
Const access of all contained AtomPositions.
bool compare_type(AtomPosition const &A, AtomPosition const &B, double tol)
static Molecule make_atom(std::string const &atom_name)
Return an atomic Molecule with specified name.
std::vector< AtomPosition > m_atoms
std::map< std::string, SpeciesAttribute > m_attribute_map
Molecule(std::string const &_name, std::vector< AtomPosition > _atoms={}, bool _divisible=false)
Construct with designated name, a list of atoms, and whether molecule is chemically divisible.
Eigen::Vector3d const & cart() const
Const access of Cartesian position of atom.
bool is_vacancy(const std::string &name)
A vacancy is any Specie/Molecule with (name == "VA" || name == "va" || name == "Va")
bool is_vacancy() const
True if Molecule represents vacancy.
void set_atoms(std::vector< AtomPosition > _atoms)
set all constituent atoms of Molecule overwrites any existing atoms
void set_attributes(std::map< std::string, SpeciesAttribute > _attr)
bool is_atomic() const
True if Molecule is atom with no other attributes.
AtomPosition const & atom(Index i) const
returns i'th atom position
std::string const & name() const
Designated name of Molecule (may be unrelated to constituent species)
static Molecule make_vacancy()
Return a vacancy Molecule.
bool identical(AtomPosition const &RHS, double _tol) const
Comparison with tolerance (max allowed distance between LHS and RHS, in Angstr.)
Index size() const
Number of atoms contained Molecule.
bool contains(std::string const &atom_name) const
Returns true of molecule contains atom of specified name.
std::string const & name() const
Const access of species name.
std::map< std::string, SpeciesAttribute > const & attributes() const
std::map< std::string, SpeciesAttribute > const & attributes() const
Returns dictionary of all constituent attributes of the Molecule Does not include attributes associat...
const SymOp::matrix_type & get_matrix(const SymOp &op)
xtal::Coordinate copy_apply(const xtal::SymOp &op, xtal::Coordinate coord)
Copy and apply SymOp to a Coordinate.
xtal::Coordinate & apply(const xtal::SymOp &op, xtal::Coordinate &coord)
apply SymOp to a Coordinate
bool almost_equal(ClusterInvariants const &A, ClusterInvariants const &B, double tol)
Check if ClusterInvariants are equal.
void swap(ConfigDoF &A, ConfigDoF &B)
INDEX_TYPE Index
For long integer indexing: