CASM  1.1.0
A Clusters Approach to Statistical Mechanics
SimpleStrucMapCalculator.cc
Go to the documentation of this file.
2 
14 #include "casm/misc/algorithm.hh"
15 
16 namespace CASM {
17 namespace xtal {
18 namespace Local {
20  Index ijk_ix, const Superlattice &superlattice,
21  impl::OrderedLatticePointGenerator index_to_ijk_f) {
22  UnitCell ijk = index_to_ijk_f(ijk_ix);
23  return make_superlattice_coordinate(ijk, superlattice);
24 }
25 
26 } // namespace Local
27 
28 std::vector<Eigen::Vector3d> SimpleStrucMapCalculator::translations(
29  MappingNode const &_node, SimpleStructure const &ichild_struc) const {
30  SimpleStructure::Info const &p_info(this->struc_info(parent()));
31  SimpleStructure::Info const &c_info(this->struc_info(ichild_struc));
32 
33  std::vector<Eigen::Vector3d> result;
34 
35  // Find a site in child whose occupant has the lowest number of
36  // compatible sites in the parent. This will minimize translations
37  Index i_trans(c_info.size()), n_best(p_info.size() + 2);
38  for (Index i = 0; i < c_info.size() && n_best > 1; ++i) {
39  auto it = _max_n_species().find(c_info.names[i]);
40  if (it != _max_n_species().end()) {
41  if (it->second < n_best) {
42  n_best = it->second;
43  i_trans = i;
44  }
45  } else {
46  // child species not known in parent -- incompatible
47  return result;
48  }
49  }
50 
51  std::string sp = c_info.names[i_trans];
52 
53  result.reserve(n_best);
54 
55  // Try translating child atom at i_trans onto each chemically compatible site
56  // of parent
57  Coordinate equiv_trans(_node.lattice_node.parent.superlattice());
58  Coordinate t_trans(equiv_trans);
59  Eigen::Vector3d best_equiv_trans;
60  for (Index j = 0; j < _allowed_species().size(); ++j) {
61  if (contains(_allowed_species()[j], sp)) {
62  Eigen::Vector3d translation =
63  p_info.cart_coord(j) - c_info.cart_coord(i_trans);
64  best_equiv_trans = translation;
65  bool unique_trans = true;
66  if (this->internal_translations().size() > 1) {
67  {
68  double best_dist = 1e20;
69  for (auto const &itrans : this->internal_translations()) {
70  // equivalent translation is internal_translation + translation
71  equiv_trans.cart() = itrans + translation;
72 
73  // See if equiv_trans is equivalent to any found translation, to
74  // within a lattice translation
75  for (auto const &rtrans : result) {
76  t_trans.cart() = rtrans;
77  if (equiv_trans.min_dist(t_trans) < this->xtal_tol()) {
78  unique_trans = false;
79  break;
80  }
81  }
82 
83  if (!unique_trans) break;
84 
85  // keep track of shortest equivalent translation
86  equiv_trans.voronoi_within();
87  double tdist = equiv_trans.const_cart().norm();
88  if (tdist < best_dist) {
89  best_dist = tdist;
90  best_equiv_trans = equiv_trans.const_cart();
91  }
92  }
93  }
94  }
95  if (unique_trans) {
96  result.push_back(best_equiv_trans);
97  }
98  }
99  }
100  return result;
101 }
102 
103 //*******************************************************************************************
104 
109  MappingNode const &_node, SimpleStructure const &_child_struc) const {
110  SimpleStructure::Info const &c_info(_child_struc.atom_info);
111  SimpleStructure::Info const &p_info((this->parent()).mol_info);
112  auto const &cgrid = _node.lattice_node.child;
113  auto const &pgrid = _node.lattice_node.parent;
114 
115  Index csize = c_info.size();
116 
117  SimpleStructure result;
118 
119  // Resolve setting of deformed lattice vectors
120  // Symmetric deformation of parent lattice that takes it to de-rotated child
121  // lattice:
122  Eigen::Matrix3d U =
123  (_node.lattice_node.stretch)
124  .inverse(); // * _node.lattice_node.isometry).inverse();
125  result.lat_column_mat = U * pgrid.superlattice().lat_column_mat();
126 
127  // Match number of sites in result to number of sites in supercell of parent
128  SimpleStructure::Info &r_info(result.mol_info);
129  r_info.resize(_node.mol_map.size());
130 
131  Eigen::MatrixXd mol_displacement;
132  mol_displacement.setZero(3, _node.mol_map.size());
133 
134  impl::OrderedLatticePointGenerator parent_index_to_unitcell(
135  pgrid.transformation_matrix_to_super());
136 
137  // transform and expand the coordinates of child to fill the resolved
138  // structure
139  {
140  for (Index i = 0; i < _node.mol_map.size(); ++i) {
141  std::set<Index> const &mol = _node.mol_map[i];
142 
143  for (Index j : mol) {
144  if (_node.atom_permutation[j] < (csize * cgrid.size())) {
145  mol_displacement.col(i) +=
146  _node.atom_displacement.col(j) / double(mol.size());
147 
148  r_info.names[i] =
149  _node.mol_labels[i]
150  .first; //_child_struc.mol_info.names[j / cgrid.size()];
151  } else if (mol.size() > 1)
152  throw std::runtime_error(
153  "SimpleStrucMapCalculator found multi-atom molecule with "
154  "vacancy. This should not occur");
155  }
156  r_info.cart_coord(i) =
157  U * (p_info.cart_coord(i / pgrid.size()) +
158  Local::_make_superlattice_coordinate(i % pgrid.size(), pgrid,
159  parent_index_to_unitcell)
160  .const_cart() +
161  mol_displacement.col(i));
162  }
163  result.within();
164  } // End coordinate transform
165 
166  // Transform and expand properties of child to fill resolved structure
167  // global properties first
168  for (auto const &el : _child_struc.properties) {
170  _node.lattice_node.isometry, U * _node.atomic_node.translation,
171  _node.atomic_node.time_reversal);
172  result.properties.emplace(el.first, trans * el.second);
173  }
174 
175  // site properties second
176  for (auto const &el : c_info.properties) {
177  AnisoValTraits ttraits(el.first);
179  _node.lattice_node.isometry, U * _node.atomic_node.translation,
180  _node.atomic_node.time_reversal);
181  Eigen::MatrixXd tprop = trans * el.second;
182 
183  auto it = r_info.properties
184  .emplace(el.first, Eigen::MatrixXd::Zero(el.second.rows(),
185  r_info.size()))
186  .first;
187  for (Index i = 0; i < _node.mol_map.size(); ++i) {
188  for (Index j : _node.mol_map[i]) {
189  Index k = _node.atom_permutation[j];
190  if (k < (csize * cgrid.size())) {
191  (it->second).col(i) += tprop.col(k / cgrid.size());
192  }
193  // else -- already checked for improper vacancy conditions above
194  }
195  if (ttraits.extensive())
196  (it->second).col(i) / double(_node.mol_map[i].size());
197  }
198  } // End properties transform
199 
200  // Add new local property -- site displacement of child relative to parent, at
201  // parent strain state
202  r_info.properties["disp"] = mol_displacement;
203 
204  // Add new global property -- right stretch tensor of child relative to
205  // parent:
206  {
207  // Use AnisoValTraits constructor to get dimension, etc--will throw
208  // exception if "Ustrain" is not recognized
209  AnisoValTraits ttraits("Ustrain");
210  Eigen::VectorXd Uvec(ttraits.dim());
211  // Do conversion here for now, since StrainConverter is outside
212  // crystallography module.
213  Uvec << U(0, 0), U(1, 1), U(2, 2), sqrt(2.) * U(1, 2), sqrt(2.) * U(0, 2),
214  sqrt(2.) * U(0, 1);
215  result.properties[ttraits.name()] = Uvec;
216  }
217 
218  // Add new global property -- isometry
219  {
220  AnisoValTraits ttraits("isometry");
221  // unroll to 9-element vector
222  result.properties[ttraits.name()] = Eigen::Map<const Eigen::VectorXd>(
223  _node.lattice_node.isometry.data(), ttraits.dim());
224  }
225 
226  return result;
227 }
228 
229 //***************************************************************************************************
230 
232  MappingNode &node, SimpleStructure const &_child_struc,
233  bool const &symmetrize_atomic_cost) const {
234  populate_displacement(node, _child_struc);
235  node.is_valid = this->_assign_molecules(node, _child_struc);
236  if (!symmetrize_atomic_cost ||
237  this->sym_invariant_displacement_modes().size() == 0)
238  node.atomic_node.cost =
239  StrucMapping::atomic_cost(node, this->struc_info(_child_struc).size());
240  else {
241  // Get the parent site indices for each site in the supercell
242  auto basis_idx = superstructure_basis_idx(
243  (node.lattice_node).parent.transformation_matrix_to_super().cast<int>(),
244  parent());
245  // Expand the sym invariant basis into this supercell
246  std::vector<Eigen::MatrixXd> supercell_sym_invariant_modes(
247  this->sym_invariant_displacement_modes().size(),
248  Eigen::MatrixXd::Zero(3, basis_idx.size()));
249 
250  Eigen::Map<Eigen::VectorXd> disp_map(node.atom_displacement.data(),
251  node.atom_displacement.size());
252  Eigen::MatrixXd sym_removed_disp = node.atom_displacement;
253  for (int sym_idx = 0;
254  sym_idx < this->sym_invariant_displacement_modes().size(); ++sym_idx) {
255  for (int scel_idx = 0; scel_idx < basis_idx.size(); ++scel_idx)
256  supercell_sym_invariant_modes[sym_idx].col(scel_idx) =
257  this->sym_invariant_displacement_modes()[sym_idx].col(
258  basis_idx[scel_idx]);
259  supercell_sym_invariant_modes[sym_idx] =
260  supercell_sym_invariant_modes[sym_idx] /
261  supercell_sym_invariant_modes[sym_idx].norm();
262  // Project the displacement mode on to this symmetry invariant mode
263  Eigen::VectorXd unrolled_sym_mode = Eigen::Map<Eigen::VectorXd>(
264  supercell_sym_invariant_modes[sym_idx].data(),
265  supercell_sym_invariant_modes[sym_idx].size());
266  double projected_comp = disp_map.dot(unrolled_sym_mode);
267  sym_removed_disp =
268  sym_removed_disp -
269  projected_comp * supercell_sym_invariant_modes[sym_idx];
270  }
271  node.atom_displacement = sym_removed_disp;
272  node.atomic_node.cost =
273  StrucMapping::atomic_cost(node, this->struc_info(_child_struc).size());
274  }
275  node.cost = node.atomic_weight * node.atomic_node.cost +
276  node.lattice_weight * node.lattice_node.cost;
277 
278  return;
279 }
280 
281 //****************************************************************************************************************
282 // Assignment Problem methods
283 //****************************************************************************************************************
284 
286  MappingNode &_node, SimpleStructure const &child_struc) const {
287  const auto &pgrid = _node.lattice_node.parent;
288  const auto &cgrid = _node.lattice_node.child;
289  SimpleStructure::Info const &p_info(this->struc_info(parent()));
290  SimpleStructure::Info const &c_info(this->struc_info(child_struc));
291  // TODO: Just use linear index converter? could make things more obvious
292  impl::OrderedLatticePointGenerator child_index_to_unitcell(
293  cgrid.transformation_matrix_to_super());
294  impl::OrderedLatticePointGenerator parent_index_to_unitcell(
295  pgrid.transformation_matrix_to_super());
296 
297  _node.atom_permutation = _node.atomic_node.permutation();
298 
299  // initialize displacement matrix with all zeros
300  _node.atom_displacement.setZero(3, pgrid.size() * p_info.size());
301 
302  Index cN = c_info.size() * cgrid.size();
303  // Populate displacements given as the difference in the Coordinates
304  // as described by node.permutation.
305  for (Index i = 0; i < _node.atom_permutation.size(); i++) {
306  // If we are dealing with a vacancy, its displacment must be zero.
307  // if(_node.atom_permutation(i) >= child_struc.n_mol()) {
308  // --DO NOTHING--
309  //}
310 
311  // Using min_dist routine to calculate the displacement vector that
312  // corresponds to the distance used in the Cost Matrix and Hungarian
313  // Algorithm The method returns the displacement vector pointing from the
314  // IDEAL coordinate to the RELAXED coordinate
315  Index j = _node.atom_permutation[i];
316  if (j < cN) {
317  // Initialize displacement as child coordinate
318  Coordinate disp_coord(
319  Local::_make_superlattice_coordinate(j % cgrid.size(), cgrid,
320  child_index_to_unitcell)
321  .const_cart(),
322  pgrid.superlattice(), CART);
323 
324  disp_coord.cart() +=
325  c_info.cart_coord(j / cgrid.size()) + _node.atomic_node.translation;
326 
328  i % pgrid.size(), pgrid, parent_index_to_unitcell);
329  parent_coord.cart() += p_info.cart_coord(i / pgrid.size());
330 
331  // subtract parent_coord to get displacement
332  disp_coord -= parent_coord;
333  disp_coord.voronoi_within();
334 
335  _node.atom_displacement.col(i) = disp_coord.const_cart();
336  }
337  }
338 
339  Eigen::Vector3d avg_disp =
340  _node.atom_displacement.rowwise().sum() / max<double>(double(cN), 1.);
341 
342  for (Index i = 0; i < _node.atom_permutation.size(); i++) {
343  if (_node.atom_permutation[i] < cN) {
344  _node.atom_displacement.col(i) -= avg_disp;
345  }
346  }
347 
348  _node.atomic_node.translation -= avg_disp;
349  // End of filling displacements
350 }
351 
352 //****************************************************************************************
353 /*
354  * Finding the cost_matrix given the relaxed structure
355  * This will always return a square matrix with the extra elements
356  * reflecting the vacancies specified in the ideal supercell.
357  * Costs are calculated in context of the lattice.
358  * cost_matrix(i,j) is cost of mapping child site 'j' onto parent site 'i'
359  */
360 //****************************************************************************************
362  MappingNode &_node, SimpleStructure const &child_struc) const {
363  const auto &pgrid = _node.lattice_node.parent;
364  const auto &cgrid = _node.lattice_node.child;
365 
366  Eigen::Vector3d const &translation(_node.atomic_node.translation);
367  Eigen::MatrixXd &cost_matrix(_node.atomic_node.cost_mat);
368  Eigen::Matrix3d metric =
369  ((_node.lattice_node.stretch * _node.lattice_node.stretch).inverse() +
371  2.;
372  impl::OrderedLatticePointGenerator child_index_to_unitcell(
373  cgrid.transformation_matrix_to_super());
374  impl::OrderedLatticePointGenerator parent_index_to_unitcell(
375  pgrid.transformation_matrix_to_super());
376 
377  SimpleStructure::Info const &p_info(this->struc_info(parent()));
378  SimpleStructure::Info const &c_info(this->struc_info(child_struc));
379 
380  Index pN = p_info.size() * pgrid.size();
381  Index cN = c_info.size() * cgrid.size();
382 
383  cost_matrix = Eigen::MatrixXd::Constant(pN, pN, StrucMapping::small_inf());
384 
385  if (pN < cN) {
386  // std::cout << "Insufficient number of parent sites to accept child
387  // atoms\n";
388  return false;
389  }
390  Index residual = pN - cN;
391  if (residual > this->max_n_va() * pgrid.size()) {
392  // std::cout << "Parent cannot accommodate enough vacancies to make mapping
393  // possible.\n";
394  return false;
395  }
396 
397  // index of basis atom in child_struc
398  Index bc = 0;
399  // index of atom in child supercell
400  Index ac = 0;
401 
402  Coordinate shifted_parent_coord(pgrid.superlattice());
403  Coordinate shifted_child_coord(pgrid.superlattice());
404 
405  // loop through all the sites of the child structure
406  // As always, each sublattice is traversed contiguously
407  for (; bc < c_info.size(); bc++) {
408  auto it = this->_max_n_species().find(c_info.names[bc]);
409  if (it == this->_max_n_species().end() ||
410  (it->second * pgrid.size()) < cgrid.size()) {
411  // std::cout << "Parent structure cannot accommodate enough atoms of type
412  // '" << c_info.names[bc] << "'.\n"
413  // << "Must accommodate at least " <<cgrid.size()<<" but only
414  // accommodates " << (it->second*pgrid.size()) << "\n";
415  return false;
416  }
417 
418  // For each sublattice, loop over lattice points, 'n'. 'ac' tracks linear
419  // index of atoms in child supercell
420  for (Index lc = 0; lc < cgrid.size(); ++lc, ++ac) {
421  shifted_child_coord.cart() = c_info.cart_coord(bc) +
423  lc, cgrid, child_index_to_unitcell)
424  .const_cart() +
425  translation;
426 
427  // loop through all the sites in the parent supercell
428  Index ap = 0;
429  for (Index bp = 0; bp < p_info.size(); ++bp) {
430  if (!contains(_allowed_species()[bp], c_info.names[bc])) {
431  ap += pgrid.size();
432  continue;
433  }
434 
435  for (Index lp = 0; lp < pgrid.size(); ++lp, ++ap) {
436  shifted_parent_coord.cart() =
438  lp, pgrid, parent_index_to_unitcell)
439  .const_cart();
440  cost_matrix(ap, ac) =
441  shifted_parent_coord.min_dist2(shifted_child_coord, metric);
442  }
443  }
444  }
445  }
446 
447  // If there are unvisited columns of cost_mat (because fewer sites in the
448  // child structure than in parent), we will treat them as a vacant species in
449  // the child struc and set them to zero cost for mapping onto parent sites
450  // that allow vacancies
451 
452  if (residual) {
453  // loop over parent sublats that allow Va, set corresponding block to zero
454  // cost
455  for (Index bp : this->va_allowed()) {
456  cost_matrix.block(bp * pgrid.size(), ac, pgrid.size(), residual)
457  .setZero();
458  }
459  }
460 
461  // JCT: I'm not sure if there's an easy way to check if the cost matrix is
462  // viable in all cases
463  // Some of the simpler checks I could think of failed for edge cases with
464  // vacancies. If we return an invalid cost matrix, the Hungarian routines
465  // will detect that it is invalid, so maybe there's no point in doing
466  // additional checks here.
467  return true;
468 }
469 
470 //****************************************************************************************
471 
473  MappingNode &node, SimpleStructure const &_child_struc) const {
474  auto const &cgrid(node.lattice_node.child);
475  auto const &pgrid(node.lattice_node.parent);
476  node.mol_map.clear();
477  node.mol_map.reserve(node.atom_permutation.size());
478  node.mol_labels.clear();
479  node.mol_labels.reserve(node.atom_permutation.size());
480  Index j = 0;
481  for (Index i : node.atom_permutation) {
482  node.mol_map.emplace_back(MappingNode::AtomIndexSet({j}));
483  Index bc = i / cgrid.size();
484  std::string sp = "Va";
485  if (bc < _child_struc.atom_info.size())
486  sp = _child_struc.atom_info.names[bc];
487  auto occ_itr =
488  std::find(this->_allowed_species()[j / pgrid.size()].begin(),
489  this->_allowed_species()[j / pgrid.size()].end(), sp);
490  // Index occ_i = find_index(this->_allowed_species()[j / pgrid.size()], sp);
491  // if (occ_i == this->_allowed_species()[j / pgrid.size()].size())
492  // return false;
493  if (occ_itr == this->_allowed_species()[j / pgrid.size()].end())
494  return false;
495 
496  node.mol_labels.emplace_back(
497  sp, occ_itr - this->_allowed_species()[j / pgrid.size()].begin());
498  ++j;
499  }
500 
501  return true;
502 }
503 } // namespace xtal
504 } // namespace CASM
Specifies traits of (possibly) anisotropic crystal properties.
bool extensive() const
Returns true if type is extensive.
std::string const & name() const
Const access of name.
Eigen::MatrixXd symop_to_matrix(Eigen::Ref< const Eigen::Matrix3d > const &_matrix, Eigen::Ref< const Eigen::Vector3d > const &_tau, bool time_reversal) const
Generate a symmetry representation for the supporting vector space.
Index dim() const
Conventional dimensionality of this type, returns -1 if always variable.
Represents cartesian and fractional coordinates.
Definition: Coordinate.hh:34
double min_dist2(const Coordinate &neighbor, const Eigen::Ref< const Eigen::Matrix3d > &metric) const
Definition: Coordinate.cc:178
Coordinate_impl::CartCoordinate cart()
Set Cartesian coordinate vector and update fractional coordinate vector.
Definition: Coordinate.hh:562
bool voronoi_within()
Map coordinate into the voronoi cell using a lattice translation.
Definition: Coordinate.cc:274
double min_dist(const Coordinate &neighbor) const
Returns distance (in Angstr) to nearest periodic image of neighbor.
Definition: Coordinate.cc:152
const vector_type & const_cart() const
user override to force const Access the Cartesian coordinate vector
Definition: Coordinate.hh:90
bool populate_cost_mat(MappingNode &_node, SimpleStructure const &child_struc) const override
virtual bool _assign_molecules(MappingNode &_node, SimpleStructure const &child_struc) const
Initializes child_struc.mol_info based on child_struc.atom_info and _node. Default behavior simply co...
void populate_displacement(MappingNode &_node, SimpleStructure const &child_struc) const
void finalize(MappingNode &_node, SimpleStructure const &child_struc, bool const &symmetrize_atomic_cost=false) const override
Calculates final mapping score and sets _node.is_valid.
std::vector< Eigen::Vector3d > translations(MappingNode const &_node, SimpleStructure const &child_struc) const override
construct list of prospective mapping translations
virtual SimpleStructure resolve_setting(MappingNode const &_node, SimpleStructure const &_child_struc) const override
Creates copy of _child_struc by applying isometry, lattice transformation, translation,...
Representation of a crystal of molecular and/or atomic occupants, and any additional properties....
std::map< std::string, Eigen::MatrixXd > properties
void within(double tol=TOL)
Map all coordinates within the unit cell.
std::map< std::string, Index > const & _max_n_species() const
maximum allowed number of each species
Index max_n_va() const
Return maximum possible number of vacancies in underlying primitive structure.
const std::vector< Eigen::MatrixXd > & sym_invariant_displacement_modes() const
StrucMapping::AllowedSpecies const & _allowed_species() const
SimpleStructure::Info const & struc_info(SimpleStructure const &_struc) const
std::vector< Eigen::Vector3d > const & internal_translations() const
List of internal translations that map parent onto itself.
double xtal_tol() const
Crystallographic tolerance, for now just return CASM::TOL.
std::unordered_set< Index > const & va_allowed() const
const Lattice & superlattice() const
Definition: Superlattice.hh:18
Unit Cell Indices.
Eigen::Matrix< typename Derived::Scalar, Derived::RowsAtCompileTime, Derived::ColsAtCompileTime > inverse(const Eigen::MatrixBase< Derived > &M)
Return the integer inverse matrix of an invertible integer matrix.
IdentitySymRepBuilder Identity()
static Coordinate _make_superlattice_coordinate(Index ijk_ix, const Superlattice &superlattice, impl::OrderedLatticePointGenerator index_to_ijk_f)
double atomic_cost(const MappingNode &mapped_config, Index Nsites)
Calculate the basis cost function of a MappingNode as the average of atomic_cost_child and atomic_cos...
Definition: StrucMapping.cc:59
double small_inf()
use as default value to initialize mapping costs. Does not indicate ivalidity
Definition: StrucMapping.hh:39
std::vector< Index > superstructure_basis_idx(Eigen::Ref< const Eigen::Matrix3i > const &_T, SimpleStructure const &_sstruc)
Constructs a vector containing the basis index of the ith site in the supercell.
Coordinate make_superlattice_coordinate(const UnitCell &ijk, const Superlattice &superlattice)
Main CASM namespace.
Definition: APICommand.hh:8
Eigen::MatrixXd MatrixXd
Eigen::Matrix3d Matrix3d
Iterator find(Iterator begin, Iterator end, const T &value, BinaryCompare q)
Equivalent to std::find(begin, end, value), but with custom comparison.
Definition: algorithm.hh:16
bool contains(const Container &container, const T &value)
Equivalent to container.end() != std::find(container.begin(), container.end(), value)
Definition: algorithm.hh:83
const COORD_TYPE CART
Definition: enum.hh:9
INDEX_TYPE Index
For long integer indexing:
Definition: definitions.hh:39
Eigen::VectorXd VectorXd
Eigen::Vector3d translation
Mapping translation from child to parent Defined such that translation=parent_coord....
double cost
Total cost of best solution to the constrained assignment problem having some forced_on assignments.
std::vector< Index > permutation() const
Combines constrained vector HungarianNode::assignment and HungarianNode::forced_on to obtain total pe...
Eigen::MatrixXd cost_mat
Cost matrix for an assignment problem, which may be a reduced assignment problem if forced_on....
bool time_reversal
time_reversal relationship between child and parent
double cost
strain_cost of the LatticeNode
Superlattice parent
PrimGrid for supercell of parent structure The parent structure defines the ideal strain state,...
Superlattice child
PrimGrid for supercell of child structure The child lattice is recorded in its idealized state (de-ro...
Eigen::Matrix3d stretch
stretch tensor that takes child superlattice from its de-rotated, deformed state to its ideal,...
Definition: StrucMapping.hh:87
Eigen::Matrix3d isometry
cartesian rotation/reflection/rotoreflection that rotates the child superlattice to its de-rotated,...
Definition: StrucMapping.hh:91
AssignmentNode atomic_node
std::vector< Index > atom_permutation
Eigen::MatrixXd atom_displacement
3xN matrix of displacements for all sites in parent supercell (Va are included, but set to Zero)
std::set< Index > AtomIndexSet
std::vector< MoleculeLabel > mol_labels
list of assigned molecule names
double cost
total, finalized cost, populated by a StrucMapCalculator. Not guaranteed to be a linear function of l...
bool is_valid
true if assignment has been checked for physical validity and passes – default false
Struct to encode all information about the crystal basis Info may describe the basis in a atomic cont...
std::vector< std::string > names
names[i] is name of species that occupies sites 'i'
Coord cart_coord(Index i)
Access coordinate of site 'i'.
Index size() const
Number of sites is defined as names.size()
std::map< std::string, Eigen::MatrixXd > properties
map of [property name, (m x names.size()) matrix] for all numerical site properties properties are as...
void resize(Index N)
Resize to hold N sites. All coordinates set to zero, all occupants set to "Va".