CASM  1.1.0
A Clusters Approach to Statistical Mechanics
ProtoFuncsPrinter.cc
Go to the documentation of this file.
3 
4 namespace CASM {
5 
6 namespace {
7 double pretty(double value, double tol) {
8  double pretty_value = value;
9  if (std::abs(value) < tol) {
10  return 0.;
11  }
12  if (std::abs(std::round(value) - value) < tol) {
13  pretty_value = std::round(value);
14  }
15  return pretty_value;
16 }
17 } // namespace
18 
20  PrimType_ptr _prim_ptr, bool align,
21  OrbitPrinterOptions const &_opt)
22  : SitesPrinter(_opt),
23  clex_basis(_clex_basis),
24  prim_ptr(_prim_ptr),
25  m_align(align) {
26  for (auto const &dofset : clex_basis.site_bases()) {
27  for (BasisSet const &bset : dofset.second) {
28  if (dofset.first != "occ" && bset.size() &&
29  bset[0]->type_name() != "Variable") {
31  bset.name(), "\\phi^{(" + dofset.first + ")}_{%n,%l}"));
32  }
33  }
34  }
35 }
36 
37 void print_site_basis_funcs(std::shared_ptr<const Structure> prim_ptr,
38  ClexBasis const &clex_basis, Log &out,
39  Index indent_space, COORD_TYPE mode) {
40  std::string indent(indent_space, ' ');
41 
42  std::ostream nullstream(0);
43  xtal::COORD_MODE printer_mode(mode);
44  std::vector<Orbit<PrimPeriodicSymCompare<IntegralCluster>>> asym_unit;
45  make_prim_periodic_asymmetric_unit(prim_ptr,
47  std::back_inserter(asym_unit), nullstream);
48 
49  const Structure &prim = *prim_ptr;
50 
51  for (auto const &dofset : clex_basis.site_bases()) {
52  out << "Site basis functions for DoF \"" << dofset.first << "\":\n\n";
53  for (Index no = 0; no < asym_unit.size(); no++) {
54  out << "Asymmetric unit " << no + 1 << ":\n";
55  for (Index ne = 0; ne < asym_unit[no].size(); ne++) {
56  Index b = asym_unit[no][ne][0].sublattice();
57  out << indent << "Basis site " << b << ": ";
58  if (printer_mode.check() == INTEGRAL) {
59  out << asym_unit[no][ne][0] << ' ';
61  asym_unit[no][ne][0].site(prim).occupant_dof(), out);
62  out << std::endl;
63  } else {
64  asym_unit[no][ne][0].site(prim).print(out);
65  }
66 
67  if (dofset.second[b].size() == 0)
68  out << indent << "[No site basis functions]\n\n";
69  if (dofset.first == "occ") {
70  Index max_length = 0;
71  std::vector<std::vector<std::string>> funcstrs;
72  for (Index f = 0; f < dofset.second[b].size(); f++) {
73  funcstrs.push_back(std::vector<std::string>());
74  BasisSet tbasis(dofset.second[b]);
75 
76  int s;
77  /* std::vector<DoF::RemoteHandle> remote(1, DoF::RemoteHandle("occ",
78  * "s", prim.basis()[b].occupant_dof().ID())); */
79  std::vector<DoF::RemoteHandle> remote(
80  1, DoF::RemoteHandle("occ", "s", b));
81  remote[0] = s;
82  tbasis.register_remotes(remote);
83 
84  for (s = 0; s < prim.basis()[b].occupant_dof().size(); s++) {
85  std::stringstream ss;
86  ss << "\\phi_{" << b << "," << f << "}["
87  << prim.basis()[b].occupant_dof()[s].name()
88  << "] = " << pretty(tbasis[f]->remote_eval(), 1e-10);
89  if (s + 1 != prim.basis()[b].occupant_dof().size()) ss << ",";
90  funcstrs[f].push_back(ss.str());
91  if (ss.str().size() > max_length) {
92  max_length = ss.str().size();
93  }
94  }
95  }
96  for (auto const &sublat_funcstrs : funcstrs) {
97  out << indent << indent;
98  for (auto const &funcstr : sublat_funcstrs) {
99  out << std::setw(max_length + 3) << std::left << funcstr;
100  }
101  out << std::endl;
102  }
103 
104  } else {
105  // std::string formula;
106  // bool relabel=false;
107  for (Index f = 0; f < dofset.second[b].size(); f++) {
108  if (dofset.second[b][f]) {
109  out << indent << indent;
110  if (dofset.second[b][f]->type_name() != "Variable") {
111  out << "\\phi^{" << (dofset.first) << "}_{" << b << "," << f
112  << "} = ";
113  }
114  out << dofset.second[b][f]->tex_formula() << "\n";
115  }
116  }
117  }
118  }
119  }
120 
121  out << std::endl << std::endl;
122  }
123 }
124 
127  xtal::BasicStructure const &prim,
128  COORD_TYPE mode) {
129  if (!cluster.size()) {
130  return;
131  }
132 
133  if (mode == FRAC) {
134  out << "Prototype cluster sites (Fractional coordinates):\n\n";
135  } else if (mode == CART) {
136  out << "Prototype cluster sites (Cartesian coordinates):\n\n";
137  } else if (mode == INTEGRAL) {
138  out << "Prototype cluster sites (Integral coordinates):\n\n";
139  }
140 
141  // for sites in asym_unit:
142  // 'tabular: site index & basis index & u & v & w & occupants \\'
143  out << "\\vspace{2mm}\n"
144  << "\\begin{tabular}{rrrrrr}\n"
145  << "\\hline\n";
146  if (mode == FRAC) {
147  out << "site index & basis index & u & v & w & occupants \\\\\n";
148  } else if (mode == CART) {
149  out << "site index & basis index & x & y & z & occupants \\\\\n";
150  } else if (mode == INTEGRAL) {
151  out << "site index & basis index & i & j & k & occupants \\\\\n";
152  }
153  out << "\\hline\n";
154  // `0 & 0 & 0.0000000& 0.0000000& 0.0000000& A B C \\`
155  // `1 & 2 & 0.0000000& 0.0000000& 0.0000000& A B C \\`
156  for (Index site_index = 0; site_index < cluster.size(); site_index++) {
157  Index b = cluster[site_index].sublattice();
158  Site const &site = cluster[site_index].site(prim);
159 
160  std::stringstream occupants_ss;
161  xtal::Site::print_occupant_dof(site.occupant_dof(), occupants_ss);
162  std::string occupants = occupants_ss.str();
163 
164  if (mode == FRAC) {
165  Eigen::Vector3d frac = site.frac();
166  out << site_index << " & " << b << " & " << frac(0) << " & " << frac(1)
167  << " & " << frac(2) << " & " << occupants << " \\\\\n";
168  } else if (mode == CART) {
169  Eigen::Vector3d cart = site.cart();
170  out << site_index << " & " << b << " & " << cart(0) << " & " << cart(1)
171  << " & " << cart(2) << " & " << occupants << " \\\\\n";
172  } else if (mode == INTEGRAL) {
173  UnitCell ijk = cluster[site_index].unitcell();
174  out << site_index << " & " << b << " & " << ijk(0) << " & " << ijk(1)
175  << " & " << ijk(2) << " & " << occupants << " \\\\\n";
176  }
177  }
178  out << "\\hline\n"
179  << "\\end{tabular}\n"
180  << "\\vspace{2mm}\n\n";
181 }
182 
183 namespace {
184 
185 void print_tex_tabular_asym_unit(
186  Log &out, Orbit<PrimPeriodicSymCompare<IntegralCluster>> const &orbit,
187  Structure const &prim, COORD_TYPE mode) {
188  if (mode == FRAC) {
189  out << "Sites (Fractional coordinates):\n\n";
190  } else if (mode == CART) {
191  out << "Sites (Cartesian coordinates):\n\n";
192  } else if (mode == INTEGRAL) {
193  out << "Sites (Integral coordinates):\n\n";
194  }
195 
196  // for sites in asym_unit:
197  // 'tabular: basis index & u & v & w & occupants \\'
198  out << "\\vspace{2mm}\n"
199  << "\\begin{tabular}{rrrrr}\n"
200  << "\\hline\n";
201  if (mode == FRAC) {
202  out << "basis index & u & v & w & occupants \\\\\n";
203  } else if (mode == CART) {
204  out << "basis index & x & y & z & occupants \\\\\n";
205  } else if (mode == INTEGRAL) {
206  out << "basis index & i & j & k & occupants \\\\\n";
207  }
208  out << "\\hline\n";
209  // `0 & 0.0000000& 0.0000000& 0.0000000& A B C \\`
210  // `2 & 0.0000000& 0.0000000& 0.0000000& A B C \\`
211  for (Index ne = 0; ne < orbit.size(); ne++) {
212  Index b = orbit[ne][0].sublattice();
213  Site const &site = orbit[ne][0].site(prim);
214 
215  std::stringstream occupants_ss;
216  xtal::Site::print_occupant_dof(site.occupant_dof(), occupants_ss);
217  std::string occupants = occupants_ss.str();
218 
219  if (mode == FRAC) {
220  Eigen::Vector3d frac = site.frac();
221  out << b << " & " << frac(0) << " & " << frac(1) << " & " << frac(2)
222  << " & " << occupants << " \\\\\n";
223  } else if (mode == CART) {
224  Eigen::Vector3d cart = site.cart();
225  out << b << " & " << cart(0) << " & " << cart(1) << " & " << cart(2)
226  << " & " << occupants << " \\\\\n";
227  } else if (mode == INTEGRAL) {
228  UnitCell ijk = orbit[ne][0].unitcell();
229  out << b << " & " << ijk(0) << " & " << ijk(1) << " & " << ijk(2) << " & "
230  << occupants << " \\\\\n";
231  }
232  }
233  out << "\\hline\n"
234  << "\\end{tabular}\n"
235  << "\\vspace{2mm}\n\n";
236 }
237 
238 void print_tex_tabular_basis(Log &out, xtal::DoFSet const &dofset,
239  BasisSet const &basis_set) {
240  Index dim = dofset.dim();
241  Index standard_dim = dofset.basis().rows();
242 
243  // DoFSet basis:
244 
245  // \vspace{2mm}
246  // \begin{tabular}{rccrrrc}
247  // & & & dx & dy & dz & \\
248  // da &=& [ & 0.707107 & 0.707107 & 0.0 & ] \\
249  // db &=& [ & -0.707107 & 0.707107 & 0.0 & ]
250  // \end{tabular}
251  // \vspace{2mm}
252 
253  out << "\\vspace{2mm}\n"
254  << "\\begin{tabular}{rcc" << std::string(standard_dim, 'r') << "c}\n";
255 
256  // header line
257  out << " axis name & & & ";
258  for (Index i = 0; i < standard_dim; ++i) {
259  out << "$" << dofset.traits().standard_var_names()[i] << "$ & ";
260  }
261  out << " \\\\\n";
262 
263  for (Index i = 0; i < dim; i++) {
264  out << "$" << dofset.component_names()[i] << "$ &=& [ & ";
265  // basis vectors
266  for (int s = 0; s < standard_dim; s++) {
267  out << pretty(dofset.basis()(s, i), 1e-10) << " & ";
268  }
269  out << " ] ";
270  if (i + 1 != dim) {
271  out << "\\\\\n";
272  } else {
273  out << "\n";
274  }
275  }
276 
277  out << "\\end{tabular}\n"
278  << "\\vspace{2mm}\n\n";
279 }
280 
281 void print_tex_tabular_occ_basis_funcs(Log &out, Site const &site,
282  BasisSet const &basis_set, Index b) {
283  Index occ_dof_size = site.occupant_dof().size();
284 
285  // \vspace{2mm}
286  // \begin{tabular}{rccrrrc}
287  // & & & A & B & C & \\
288  // \phi_{2}_{0} &=& [ & -1.22474 & 0 & 1.22474 & ] \\
289  // \phi_{2}_{1} &=& [ & -0.707107 & 1.41421 & -0.707107 & ]
290  // \end{tabular}
291  // \vspace{2mm}
292 
293  out << "\\vspace{2mm}\n"
294  << "\\begin{tabular}{rcc" << std::string(occ_dof_size, 'r') << "c}\n";
295 
296  // header line
297  out << " & & & ";
298  for (Index i = 0; i < occ_dof_size; ++i) {
299  out << site.occupant_dof()[i].name() << " & ";
300  }
301  out << " \\\\\n";
302 
303  // function (f) lines:
304  for (Index f = 0; f < basis_set.size(); f++) {
305  out << "$\\phi_{" << b << "," << f << "}$ &=& [ & ";
306 
307  // this gets basis function values:
308  BasisSet tbasis(basis_set);
309  int s;
310  std::vector<DoF::RemoteHandle> remote(1, DoF::RemoteHandle("occ", "s", b));
311  remote[0] = s;
312  tbasis.register_remotes(remote);
313  for (s = 0; s < occ_dof_size; s++) {
314  out << pretty(tbasis[f]->remote_eval(), 1e-10) << " & ";
315  }
316 
317  out << " ] ";
318  if (f + 1 != basis_set.size()) {
319  out << "\\\\\n";
320  } else {
321  out << "\n";
322  }
323  }
324  out << "\\end{tabular}\n"
325  << "\\vspace{2mm}\n\n";
326 }
327 
328 void print_site_basis_set(Log &out, std::string dof_key,
329  BasisSet const &basis_set, Index sublattice_index) {
330  Index dim = basis_set.size();
331 
332  Index n_functions = 0;
333  for (Index f = 0; f < dim; f++) {
334  if (basis_set[f]->type_name() != "Variable") {
335  n_functions++;
336  }
337  }
338  if (n_functions) {
339  // continuous basis functions:
340  out << "\\begin{align*}\n";
341  // function (f) lines: (basis vectors)
342  for (Index f = 0; f < dim; f++) {
343  if (basis_set[f]) {
344  if (basis_set[f]->type_name() != "Variable") {
345  out << "\\phi^{" << dof_key << "}_{" << sublattice_index << "," << f
346  << "} = ";
347  }
348  out << basis_set[f]->tex_formula() << "\n";
349  }
350  if (f + 1 != dim) {
351  out << "\\\\\n";
352  }
353  }
354  out << "\\end{align*}\n\n";
355  }
356 }
357 
358 void print_global_basis_set(Log &out, std::string dof_key,
359  BasisSet const &basis_set) {
360  Index dim = basis_set.size();
361 
362  Index n_functions = 0;
363  for (Index f = 0; f < dim; f++) {
364  if (basis_set[f]->type_name() != "Variable") {
365  n_functions++;
366  }
367  }
368  if (n_functions) {
369  // continuous basis functions:
370  out << "\\begin{align}\n";
371  // function (f) lines: (basis vectors)
372  for (Index f = 0; f < dim; f++) {
373  if (basis_set[f]) {
374  if (basis_set[f]->type_name() != "Variable") {
375  out << "\\phi^{" << dof_key << "}_{" << f << "} = ";
376  }
377  out << basis_set[f]->tex_formula() << "\n";
378  }
379  if (f + 1 != dim) {
380  out << "\\\\\n";
381  }
382  }
383  out << "\\end{align}\n\n";
384  }
385 }
386 
387 } // namespace
388 
390 void print_aligned_site_basis_funcs(std::shared_ptr<const Structure> prim_ptr,
391  ClexBasis const &clex_basis, Log &out,
392  Index indent_space, COORD_TYPE mode) {
393  std::string indent(indent_space, ' ');
394 
395  std::ostream nullstream(0);
396  xtal::COORD_MODE printer_mode(mode);
397  std::vector<Orbit<PrimPeriodicSymCompare<IntegralCluster>>> asym_unit;
398  make_prim_periodic_asymmetric_unit(prim_ptr,
400  std::back_inserter(asym_unit), nullstream);
401 
402  const Structure &prim = *prim_ptr;
403  for (auto const &dofset : clex_basis.site_bases()) {
404  out << "\\pagebreak\n";
405  if (dofset.first == "occ") {
406  out << "Site basis functions for DoF ``" << dofset.first << "\":\n\n";
407  } else {
408  out << "Site bases for DoF ``" << dofset.first << "\":\n\n";
409  }
410  out << "\\begin{itemize}\n";
411 
412  for (Index no = 0; no < asym_unit.size(); no++) {
413  out << "\\item Asymmetric unit " << no + 1 << ":\n"
414  << "\n";
415  print_tex_tabular_asym_unit(out, asym_unit[no], prim, mode);
416 
417  // for basis site in asym_unit:
418  for (Index ne = 0; ne < asym_unit[no].size(); ne++) {
419  Index b = asym_unit[no][ne][0].sublattice();
420  Site const &site = asym_unit[no][ne][0].site(prim);
421 
422  if (dofset.second[b].size() == 0) {
423  out << "Basis site " << b << ": [No site basis functions]\n\n";
424  }
425  if (dofset.first == "occ") {
426  // occ site DoF basis:
427  out << "Basis site " << b << ":\n\n";
428  print_tex_tabular_occ_basis_funcs(out, site, dofset.second[b], b);
429  } else {
430  // continuous site DoF basis:
431 
432  CASM::xtal::SiteDoFSet const &current_dofset =
433  site.dofs().find(dofset.first)->second;
434 
435  out << "Basis site " << b << ":\n\n";
436  print_tex_tabular_basis(out, current_dofset, dofset.second[b]);
437  // print_site_basis_set(out, dofset.first, dofset.second[b], b);
438 
439  } // end continuous site DoF basis:
440  }
441  }
442 
443  out << "\\end{itemize}\n\n";
444  } // end local bases
445 
446  for (auto const &dofset : clex_basis.global_bases()) {
447  out << "\\pagebreak\n";
448  out << "Global basis for DoF ``" << dofset.first << "\":\n\n";
449 
450  // continuous global DoF basis:
451  for (Index i = 0; i < dofset.second.size(); ++i) {
452  if (dofset.second.size() > 1) { // this shouldn't happen
453  out << "Basis " << i << ":\n\n";
454  }
455 
456  CASM::xtal::DoFSet const &current_dofset =
457  prim.structure().global_dofs().find(dofset.first)->second;
458 
459  print_tex_tabular_basis(out, current_dofset, dofset.second[i]);
460  // print_global_basis_set(out, dofset.first, dofset.second[i]);
461  }
462  } // end global bases
463 }
464 
465 void write_site_basis_funcs(std::shared_ptr<const Structure> prim_ptr,
466  ClexBasis const &clex_basis, jsonParser &json) {
467  // "site_functions":[
468  // {
469  // "asym_unit": X,
470  // "sublat": 2,
471  // "basis": {
472  // "phi_b_0": {"Va":0.0, "O":1.0},
473  // "phi_b_1": {"Va":0.0, "O":1.0}
474  // }
475  // },
476  // ...
477  // ],
478 
479  jsonParser &sitef = json["site_functions"];
480  sitef = jsonParser::array(prim_ptr->basis().size(), jsonParser::object());
481 
482  std::ostream nullstream(0);
483  std::vector<Orbit<PrimPeriodicSymCompare<IntegralCluster>>> asym_unit;
484  make_prim_periodic_asymmetric_unit(prim_ptr,
486  std::back_inserter(asym_unit), nullstream);
487  const Structure &prim = *prim_ptr;
488 
489  for (auto const &dofset : clex_basis.site_bases()) {
490  for (Index no = 0; no < asym_unit.size(); no++) {
491  for (Index ne = 0; ne < asym_unit[no].size(); ne++) {
492  Index b = asym_unit[no][ne][0].sublattice();
493  sitef[b]["sublat"] = b;
494  sitef[b]["asym_unit"] = no;
495 
496  if (dofset.second[b].size() == 0) {
497  sitef[b][dofset.first]["basis"].put_null();
498  continue;
499  }
500 
501  for (Index f = 0; f < dofset.second[b].size(); f++) {
502  std::stringstream fname;
503 
504  if (dofset.first == "occ") {
505  fname << "\\phi_{" << b << "," << f << "}";
506  BasisSet tbasis(dofset.second[b]);
507  int s;
508  /* std::vector<DoF::RemoteHandle> remote(1, DoF::RemoteHandle("occ",
509  * "s", prim.basis()[b].occupant_dof().ID())); */
510  std::vector<DoF::RemoteHandle> remote(
511  1, DoF::RemoteHandle("occ", "s", b));
512  remote[0] = s;
513  tbasis.register_remotes(remote);
514 
515  for (s = 0; s < prim.basis()[b].occupant_dof().size(); s++) {
516  sitef[b][dofset.first]["basis"][fname.str()]
517  [prim.basis()[b].occupant_dof()[s].name()] =
518  pretty(tbasis[f]->remote_eval(), 1e-10);
519  }
520  } else {
521  if (dofset.second[b][f]) {
522  if (dofset.second[b][f]->type_name() != "Variable") {
523  fname << "\\phi^{" << (dofset.first) << "}_{" << b << "," << f
524  << "}";
525  } else
526  fname << "var_{" << b << "}_{" << f << "}";
527  }
528  sitef[b][dofset.first]["basis"][fname.str()] =
529  dofset.second[b][f]->tex_formula();
530  }
531  }
532  }
533  }
534  }
535 }
536 
537 // // explicit template instantiations
538 //
539 // #define PRINT_CLUST_INST(ITERATOR, INSERTER, PRINTER) \
540 // template void print_clust<ITERATOR, PRINTER>(ITERATOR begin, ITERATOR end,
541 // \
542 // Log & out, PRINTER printer); \
543 // template jsonParser &write_clust<ITERATOR>( \
544 // ITERATOR begin, ITERATOR end, jsonParser & json, PRINTER printer); \
545 // template jsonParser &write_clust<ITERATOR>( \
546 // ITERATOR begin, ITERATOR end, jsonParser & json, PRINTER printer, \
547 // const jsonParser &bspecs);
548 //
549 // #define ORBIT_CONTAINER_INST(ITERATOR, INSERTER, ORBIT) \
550 // PRINT_CLUST_INST(ITERATOR, INSERTER, ProtoSitesPrinter) \
551 // PRINT_CLUST_INST(ITERATOR, INSERTER, FullSitesPrinter) \
552 // PRINT_CLUST_INST(ITERATOR, INSERTER, ProtoFuncsPrinter) \
553 // template void print_clust<ITERATOR>(ITERATOR begin, ITERATOR end, Log &
554 // out, \
555 // const OrbitPrinterOptions &opt); \
556 // template INSERTER read_clust<INSERTER, typename ORBIT::SymCompareType>( \
557 // INSERTER result, const jsonParser &json, const Structure &prim, \
558 // const SymGroup &generating_grp, \ const typename ORBIT::SymCompareType
559 // &sym_compare);
560 //
561 // #define _VECTOR_IT(ORBIT) std::vector<ORBIT>::iterator
562 // #define _VECTOR_INSERTER(ORBIT) std::back_insert_iterator<std::vector<ORBIT>
563 // >
564 //
565 // #define _SET_IT(ORBIT) std::set<ORBIT>::iterator
566 // #define _SET_INSERTER(ORBIT) std::insert_iterator<std::set<ORBIT> >
567 //
568 // #define ORBIT_VECTOR_INST(ORBIT) \
569 // ORBIT_CONTAINER_INST(_VECTOR_IT(ORBIT), _VECTOR_INSERTER(ORBIT), ORBIT)
570 // #define ORBIT_SET_INST(ORBIT) \
571 // ORBIT_CONTAINER_INST(_SET_IT(ORBIT), _SET_INSERTER(ORBIT), ORBIT)
572 //
573 // ORBIT_VECTOR_INST(LocalIntegralClusterOrbit)
574 // ORBIT_VECTOR_INST(PrimPeriodicIntegralClusterOrbit)
575 // ORBIT_VECTOR_INST(ScelPeriodicIntegralClusterOrbit)
576 //
577 // ORBIT_SET_INST(LocalIntegralClusterOrbit)
578 // ORBIT_SET_INST(PrimPeriodicIntegralClusterOrbit)
579 // ORBIT_SET_INST(ScelPeriodicIntegralClusterOrbit)
580 
581 } // namespace CASM
std::set< std::string > & s
int register_remotes(const std::vector< DoF::RemoteHandle > &remote_handles)
Definition: BasisSet.cc:440
std::map< DoFKey, std::vector< BasisSet > > const & site_bases() const
Const access to dictionary of all site BasisSets.
Definition: ClexBasis.hh:95
std::map< DoFKey, std::vector< BasisSet > > const & global_bases() const
Const access to dictionary of all global BasisSets.
Definition: ClexBasis.hh:100
size_type size() const
Number of elements in the cluster.
Definition: Log.hh:48
bool print() const
Definition: Log.cc:260
Structure specifies the lattice and atomic basis of a crystal.
Definition: Structure.hh:30
const xtal::BasicStructure & structure() const
Definition: Structure.hh:92
const std::vector< xtal::Site > & basis() const
Definition: Structure.hh:102
static jsonParser object()
Returns an empty json object.
Definition: jsonParser.hh:395
static jsonParser array()
Returns an empty json array.
Definition: jsonParser.hh:409
jsonParser & put_null()
Puts 'null' JSON value.
Definition: jsonParser.hh:377
BasicStructure specifies the lattice and atomic basis of a crystal.
std::map< DoFKey, DoFSet > const & global_dofs() const
COORD_MODE specifies the current coordinate mode (Fractional or Cartesian)
Coordinate_impl::CartCoordinate cart()
Set Cartesian coordinate vector and update fractional coordinate vector.
Definition: Coordinate.hh:562
Coordinate_impl::FracCoordinate frac()
Set the fractional coordinate vector.
Definition: Coordinate.hh:550
std::map< std::string, SiteDoFSet > const & dofs() const
Definition: Site.hh:78
const std::vector< Molecule > & occupant_dof() const
Definition: Site.cc:68
static void print_occupant_dof(const std::vector< Molecule > &allowed_occupants, std::ostream &out_stream)
Definition: Site.cc:407
Unit Cell Indices.
Eigen::MatrixXd pretty(const Eigen::MatrixXd &M, double tol)
Round entries that are within tol of being integer to that integer value.
Eigen::CwiseUnaryOp< decltype(Local::round_l< typename Derived::Scalar >), const Derived > round(const Eigen::MatrixBase< Derived > &val)
Round Eigen::MatrixXd.
Main CASM namespace.
Definition: APICommand.hh:8
void write_site_basis_funcs(std::shared_ptr< const Structure > prim_ptr, ClexBasis const &clex_basis, jsonParser &json)
std::string type_name()
Definition: TypeInfo.hh:19
COORD_TYPE
Definition: enum.hh:6
void print_tex_tabular_cluster_sites(Log &out, IntegralCluster const &cluster, xtal::BasicStructure const &prim, COORD_TYPE mode)
Print prototype cluster sites as a tex tabular.
const COORD_TYPE FRAC
Definition: enum.hh:8
const double TOL
Definition: definitions.hh:30
const COORD_TYPE INTEGRAL
Definition: enum.hh:10
void print_site_basis_funcs(std::shared_ptr< const Structure > prim_ptr, ClexBasis const &clex_basis, Log &out, Index indent_space=6, COORD_TYPE mode=FRAC)
Print site basis functions, as for 'casm bset –functions'.
const COORD_TYPE CART
Definition: enum.hh:9
INDEX_TYPE Index
For long integer indexing:
Definition: definitions.hh:39
void print_aligned_site_basis_funcs(std::shared_ptr< const Structure > prim_ptr, ClexBasis const &clex_basis, Log &out, Index indent_space=6, COORD_TYPE mode=FRAC)
Print aligned site basis functions, as for 'casm bset –functions –align'.
pair_type bset
Definition: settings.cc:145
N-nary function that behaves as a constant (i.e. transform(arg1,arg2,...) == constant is true)
Definition: CASM_TMP.hh:92
std::shared_ptr< const PrimType > PrimType_ptr
ClexBasis const & clex_basis
std::vector< SubExpressionLabeler > labelers
ProtoFuncsPrinter(ClexBasis const &_clex_basis, PrimType_ptr prim_ptr, bool align, OrbitPrinterOptions const &_opt=OrbitPrinterOptions())