CASM  1.1.0
A Clusters Approach to Statistical Mechanics
DoFTraits.cc
Go to the documentation of this file.
2 
3 #include <memory>
4 
11 #include "casm/clex/ClexBasis.hh"
12 #include "casm/clex/ConfigDoF.hh"
22 
23 namespace CASM {
24 
25 template <>
26 DoFType::TraitsDictionary make_parsing_dictionary<DoFType::Traits>() {
28 
30  DoFType::magspin("C"), DoFType::magspin("Cunit"),
31  DoFType::magspin("NC"), DoFType::magspin("NCunit"),
32  DoFType::magspin("SO"), DoFType::magspin("SOunit"),
34  return dict;
35 }
36 
37 namespace DoFType {
38 
40  static TraitsDictionary static_dict = make_parsing_dictionary<Traits>();
41  return static_dict;
42 }
43 
44 void register_traits(Traits const &_traits) { traits_dict().insert(_traits); }
45 
46 Traits const &traits(std::string const &dof_key) {
47  return traits_dict().lookup(dof_key);
48 }
49 
50 DoF::BasicTraits const &basic_traits(std::string const &dof_key) {
51  return traits(dof_key).val_traits();
52 }
53 
58 std::pair<Eigen::MatrixXd, std::set<std::string> > Traits::find_values(
59  std::map<std::string, Eigen::MatrixXd> const &values) const {
60  std::pair<Eigen::MatrixXd, std::set<std::string> > result;
61  for (auto const &val : values) {
62  if (AnisoValTraits::name_suffix(val.first) == this->name()) {
63  result.first = val.second;
64  result.second.insert(val.first);
65  return result;
66  }
67  }
68  throw std::runtime_error(
69  "Could not identify DoF values for DoF '" + (this->name()) +
70  "' from provided list of tabulated structure properties.");
71  return result;
72 }
73 
74 void Traits::to_json(DoFSet const &_out, jsonParser &_json) const {
75  bool simple = false;
76  if (_out.dim() == val_traits().standard_var_names().size() &&
77  _out.basis().isIdentity()) {
78  simple = true;
79  for (Index i = 0; i < _out.dim(); ++i) {
80  if (_out[i].var_name() != val_traits().standard_var_names()[i]) {
81  simple = false;
82  break;
83  }
84  }
85  }
86 
87  if (simple)
88  _json.put_obj();
89  else {
90  _json["axes"] = _out.basis().transpose();
91  _json["axis_names"].put_array();
92  for (Index i = 0; i < _out.dim(); ++i) {
93  _json["axis_names"].push_back(_out[i].var_name());
94  }
95  }
96 }
97 
98 //************************************************************
99 void Traits::apply_dof(ConfigDoF const &_dof, BasicStructure const &_reference,
100  SimpleStructure &_struc) const {
101  return;
102 }
103 
104 //************************************************************
106  BasicStructure const &_reference) const {
107  jsonParser result;
108  result.put_obj();
109 
110  if (val_traits().global())
111  result["value"] = _dof.global_dof(name()).standard_values();
112  else
113  result["value"] = _dof.local_dof(name()).standard_values().transpose();
114  return result;
115 }
116 
117 //************************************************************
119  Structure const &_prim,
120  std::map<UnitCellCoord, std::set<UnitCellCoord> > const &_nhood,
121  PrimNeighborList &_nlist, std::vector<BasisSet> const &site_bases,
122  std::string const &indent) const {
123  std::stringstream ss;
124  if (val_traits().global()) {
125  ss << indent << " if(m_params.eval_mode(m_" << name()
126  << "_var_param_key) != ParamPack::READ) {\n";
127  for (Index a = 0; a < _prim.structure().global_dof(name()).dim(); ++a) {
128  ss << indent << " ParamPack::Val<Scalar>::set(m_params, m_" << name()
129  << "_var_param_key, " << a << ", eval_" << name() << "_var(" << a
130  << "));\n";
131  }
132  ss << indent << " }\n";
133 
134  if (requires_site_basis()) {
135  ss << indent << " if(m_params.eval_mode(m_" << site_basis_name()
136  << "_param_key) != ParamPack::READ) {\n";
137  for (Index f = 0; f < site_bases[0].size(); f++) {
138  ss << indent << " ParamPack::Val<Scalar>::set(m_params, m_"
139  << site_basis_name() << "_param_key, " << f << ", eval_"
140  << site_basis_name() << "_" << f << "<Scalar>());\n";
141  }
142  ss << indent << " }\n";
143  }
144  } else {
145  ss << indent << "switch(nlist_ind) {\n";
146  for (auto const &nbor : _nhood) {
147  std::stringstream ssvar, ssfunc;
148  ss << indent << "case " << _nlist.neighbor_index(nbor.first) << ":\n";
149  // Index n = nbor.first;
150  // std::cout << "neighborhood of nbor.first: " << nbor.first << ": \n";
151 
152  // Put neighborhood in a sensible order:
153  std::map<Index, std::set<Index> > sublat_nhood;
154  for (auto const &ucc : nbor.second) {
155  sublat_nhood[ucc.sublattice()].insert(_nlist.neighbor_index(ucc));
156  // std::cout << "ucc : " << ucc << "; n: " << _nlist.neighbor_index(ucc)
157  // << "\n";
158  }
159 
160  for (auto const &sublat : sublat_nhood) {
161  Index b = sublat.first;
162  for (Index n : sublat.second) {
163  if (!_prim.basis()[b].has_dof(name())) continue;
164 
165  for (Index a = 0; a < _prim.basis()[b].dof(name()).dim(); ++a) {
166  ssvar << indent << " ParamPack::Val<Scalar>::set(m_params, m_"
167  << name() << "_var_param_key, " << a << ", " << n << ", eval_"
168  << name() << "_var_" << b << "_" << a << "(" << n << "));\n";
169  }
170 
171  if (requires_site_basis()) {
172  for (Index f = 0; f < site_bases[b].size(); f++) {
173  ssfunc << indent << " ParamPack::Val<Scalar>::set(m_params, m_"
174  << site_basis_name() << "_param_key, " << f << ", " << n
175  << ", eval_" << site_basis_name() << '_' << b << '_' << f
176  << "<Scalar>(" << n << "));\n";
177  }
178  }
179  }
180  }
181 
182  ss << indent << " if(m_params.eval_mode(m_" << name()
183  << "_var_param_key) != ParamPack::READ) {\n"
184  << ssvar.str() << indent << " }\n";
185 
186  if (requires_site_basis()) {
187  ss << indent << " if(m_params.eval_mode(m_" << site_basis_name()
188  << "_param_key) != ParamPack::READ) {\n"
189  << ssfunc.str() << indent << " }\n";
190  }
191  ss << indent << " break;\n";
192  }
193  ss << indent << "}\n";
194  }
195  return ss.str();
196 }
197 
198 //************************************************************
199 
201  Structure const &_prim,
202  std::map<UnitCellCoord, std::set<UnitCellCoord> > const &_nhood,
203  PrimNeighborList &_nlist, std::vector<BasisSet> const &site_bases,
204  std::string const &indent) const {
205  std::stringstream ss;
206 
207  if (val_traits().global()) {
208  ss << indent << " if(m_params.eval_mode(m_" << name()
209  << "_var_param_key) != ParamPack::READ) {\n";
210  for (Index a = 0; a < _prim.structure().global_dof(name()).dim(); ++a) {
211  ss << indent << " ParamPack::Val<Scalar>::set(m_params, m_" << name()
212  << "_var_param_key, " << a << ", eval_" << name() << "_var(" << a
213  << "));\n";
214  }
215  ss << indent << " }\n";
216 
217  if (requires_site_basis()) {
218  ss << indent << " if(m_params.eval_mode(m_" << site_basis_name()
219  << "_param_key) != ParamPack::READ) {\n";
220  for (Index f = 0; f < site_bases[0].size(); f++) {
221  ss << indent << " ParamPack::Val<Scalar>::set(m_params, m_"
222  << site_basis_name() << "_param_key, " << f << ", eval_"
223  << site_basis_name() << "_" << f << "<Scalar>());\n";
224  }
225  ss << indent << " }\n";
226  }
227  } else {
228  std::map<Index, std::set<Index> > tot_nhood;
229  for (auto const &nbor : _nhood)
230  for (auto const &ucc : nbor.second)
231  tot_nhood[ucc.sublattice()].insert(_nlist.neighbor_index(ucc));
232 
233  std::stringstream ssvar, ssfunc;
234 
235  for (auto const &nbor : tot_nhood) {
236  Index b = nbor.first;
237  for (Index n : nbor.second) {
238  if (!_prim.basis()[b].has_dof(name())) continue;
239 
240  for (Index a = 0; a < _prim.basis()[b].dof(name()).dim(); ++a) {
241  ssvar << indent << " ParamPack::Val<Scalar>::set(m_params, m_"
242  << name() << "_var_param_key, " << a << ", " << n << ", eval_"
243  << name() << "_var_" << b << "_" << a << "(" << n << "));\n";
244  }
245 
246  if (requires_site_basis()) {
247  for (Index f = 0; f < site_bases[b].size(); f++) {
248  ssfunc << indent << " ParamPack::Val<Scalar>::set(m_params, m_"
249  << site_basis_name() << "_param_key, " << f << ", " << n
250  << ", eval_" << site_basis_name() << "_" << b << "_" << f
251  << "<Scalar>(" << n << "));\n";
252  }
253  }
254  }
255  }
256  ss << indent << " if(m_params.eval_mode(m_" << name()
257  << "_var_param_key) != ParamPack::READ) {\n"
258  << ssvar.str() << indent << " }\n";
259  if (requires_site_basis()) {
260  ss << indent << " if(m_params.eval_mode(m_" << site_basis_name()
261  << "_param_key) != ParamPack::READ) {\n"
262  << ssfunc.str() << indent << " }\n";
263  }
264  }
265  return ss.str();
266 }
267 //************************************************************
268 
270  Structure const &_prim, std::vector<BasisSet> const &_site_bases,
271  std::string const &indent) const {
272  std::stringstream stream;
273  std::vector<Orbit<PrimPeriodicSymCompare<IntegralCluster> > > asym_unit;
274  std::ostream nullstream(0);
275 
276  // TODO: It is not ideal to make a copy of the prim, but everything generated
277  // in this function should go out of scope. Solving this will involve
278  // rethinking which parts of the prim are needed for the function call, and
279  // will affect the implementation of the SymCompare classes
280  auto _prim_ptr =
281  std::shared_ptr<const Structure>(&_prim, [](const Structure *) {});
282  make_prim_periodic_asymmetric_unit(_prim_ptr,
284  std::back_inserter(asym_unit), nullstream);
285  /*
286  for(Index no = 0; no < asym_unit.size(); no++) {
287  Index nb = asym_unit[no][0][0].sublattice();
288  if(_site_bases[nb].size() == 0)
289  continue;
290  stream <<
291  indent << "// Occupation Function tables for basis sites in
292  asymmetric unit " << no << ":\n"; for(Index ne = 0; ne < asym_unit[no].size();
293  ne++) { nb = asym_unit[no][ne][0].sublattice(); stream << indent << "// -
294  basis site " << nb << ":\n"; for(Index f = 0; f < _site_bases[nb].size(); f++)
295  { stream << indent << "double " << "m_" << site_basis_name() << "_" << nb <<
296  '_' << f << '[' << _prim.basis()[nb].occupant_dof().size() << "];\n";
297  }
298  stream << '\n';
299  }
300 
301  }*/
302  return stream.str();
303 }
304 
305 //************************************************************
306 
308  Structure const &_prim, std::vector<BasisSet> const &_site_bases,
309  const std::string &indent) const {
310  return "";
311 }
312 
313 //************************************************************
314 
316  Structure const &_prim, std::vector<BasisSet> const &site_bases,
317  std::string const &indent) const {
318  return "";
319 }
320 
321 //************************************************************
322 
324  Structure const &_prim, std::vector<BasisSet> const &site_bases,
325  std::string const &indent) const {
326  return "";
327 }
328 
329 //************************************************************
330 
332  Structure const &_prim, std::vector<BasisSet> const &_site_bases,
333  const std::string &indent) const {
334  // std::cout << "PRIVATE METHOD DECLARATIONS FOR DOF " << name() << "\n";
335  std::stringstream stream;
336  if (val_traits().global()) {
337  // std::cout << "**GLOBAL PRIVATE METHOD DECLARATIONS FOR DOF " << name() <<
338  // "\n";
339  stream << indent << "double eval_" << name()
340  << "_var(const int &ind) const {\n"
341  << indent << " return m_global_dof_ptrs[m_" << name()
342  << "_var_param_key.index()]->values()[ind];\n"
343  << indent << "}\n\n";
344 
345  stream << indent << "template<typename Scalar>\n"
346  << indent << "Scalar const &" << name()
347  << "_var(const int &ind) const {\n"
348  << indent << " return "
349  << "ParamPack::Val<Scalar>::get(m_params, m_" << name()
350  << "_var_param_key, ind);\n"
351  << indent << "}\n";
352 
353  if (requires_site_basis()) {
354  auto visitors = site_function_visitors("nlist_ind");
355  BasisSet site_basis = _site_bases[0];
356  for (auto const &vis : visitors) site_basis.accept(*vis);
357 
358  for (Index f = 0; f < site_basis.size(); f++) {
359  stream << indent << "template<typename Scalar>\n"
360  << indent << "Scalar eval_" << site_basis_name() << '_' << f
361  << "() const {\n"
362  << indent << " return " << site_basis[f]->formula() << ";\n"
363  << indent << "}\n\n";
364  }
365  }
366  return stream.str();
367  }
368 
369  std::vector<Orbit<PrimPeriodicSymCompare<IntegralCluster> > > asym_unit;
370  std::ostream nullstream(0);
371 
372  // TODO: It is not ideal to make a copy of the prim, but everything generated
373  // in this function should go out of scope. Solving this will involve
374  // rethinking which parts of the prim are needed for the function call, and
375  // will affect the implementation of the SymCompare classes
376  auto _prim_ptr =
377  std::shared_ptr<const Structure>(&_prim, [](const Structure *) {});
378  make_prim_periodic_asymmetric_unit(_prim_ptr,
380  std::back_inserter(asym_unit), nullstream);
381 
382  Index max_nf = 0;
383  Index max_na = 0;
384  for (Index no = 0; no < asym_unit.size(); no++) {
385  Index nb = asym_unit[no][0][0].sublattice();
386  if (_site_bases[nb].size() == 0) continue;
387 
388  for (Index ne = 0; ne < asym_unit[no].size(); ne++) {
389  nb = asym_unit[no][ne][0].sublattice();
390  if (!_prim.basis()[nb].has_dof(name())) continue;
391  stream << indent << "// " << name()
392  << " evaluators and accessors for basis site " << nb << ":\n";
393  max_na = max(max_na, _prim.basis()[nb].dof(name()).dim());
394  for (Index a = 0; a < _prim.basis()[nb].dof(name()).dim(); ++a) {
395  stream << indent << "double eval_" << name() << "_var_" << nb << '_'
396  << a << "(const int &nlist_ind) const {\n"
397  << indent << " return m_local_dof_ptrs[m_" << name()
398  << "_var_param_key.index()]->site_value(_l(nlist_ind))[" << a
399  << "];\n"
400  << indent << "}\n\n";
401  }
402 
403  if (requires_site_basis()) {
404  max_nf = max(max_nf, _site_bases[nb].size());
405  auto visitors = site_function_visitors("nlist_ind");
406  BasisSet site_basis = _site_bases[nb];
407  for (auto const &vis : visitors) site_basis.accept(*vis);
408 
409  for (Index f = 0; f < site_basis.size(); f++) {
410  stream << indent << "template<typename Scalar>\n"
411  << indent << "Scalar eval_" << site_basis_name() << "_" << nb
412  << '_' << f << "(const int &nlist_ind) const {\n"
413  << indent << " return " << site_basis[f]->formula() << ";\n"
414  << indent << "}\n\n";
415  }
416  stream << '\n';
417  }
418  }
419  }
420  for (Index a = 0; a < max_na; ++a) {
421  stream << indent << "template<typename Scalar>\n"
422  << indent << "Scalar const &" << name() << "_var_" << a
423  << "(const int &nlist_ind) const {\n"
424  << indent << " return "
425  << "ParamPack::Val<Scalar>::get(m_params, m_" << name()
426  << "_var_param_key, " << a << ", nlist_ind);\n"
427  << indent << "}\n";
428  }
429  for (Index f = 0; f < max_nf; ++f) {
430  stream << indent << "template<typename Scalar>\n"
431  << indent << "Scalar const &" << site_basis_name() << "_" << f
432  << "(const int &nlist_ind) const {\n"
433  << indent << " return "
434  << "ParamPack::Val<Scalar>::get(m_params, m_" << site_basis_name()
435  << "_param_key, " << f << ", nlist_ind);\n"
436  << indent << "}\n";
437  }
438  return stream.str();
439 }
440 
441 //************************************************************
442 
443 std::vector<ParamAllocation> Traits::param_pack_allocation(
444  Structure const &_prim, std::vector<BasisSet> const &_bases) const {
445  std::vector<ParamAllocation> result;
446 
447  if (val_traits().global() && _bases.size()) {
448  result.push_back(ParamAllocation(std::string(name() + "_var"),
449  _bases[0].size(), Index(1), true));
450  return result;
451  }
452 
453  Index NB = 0, NV = 0;
454  bool basis_allocation = false;
455  for (BasisSet const &basis : _bases) {
456  NB = max(basis.size(), NB);
457  for (Index f = 0; f < basis.size() && !basis_allocation; ++f) {
458  if (basis[f] && basis[f]->type_name() != "Variable")
459  basis_allocation = true;
460  }
461  }
462 
463  for (Site const &site : _prim.basis()) {
464  if (site.has_dof(name())) NV = max(NV, site.dof(name()).dim());
465  }
466  // for(Index i = 0; i < NB; i++)
467  result.push_back(ParamAllocation(std::string(name() + "_var"), Index(NV),
468  Index(-1), true));
469 
470  if (basis_allocation)
471  result.push_back(
472  ParamAllocation(site_basis_name(), Index(NB), Index(-1), false));
473 
474  return result;
475 }
476 
477 //************************************************************
478 
480  Structure const &_prim, std::vector<BasisSet> const &_site_bases,
481  const std::string &indent) const {
482  std::stringstream stream;
483  stream.flags(std::ios::showpoint | std::ios::fixed | std::ios::right);
484  stream.precision(10);
485 
486  std::ostream nullstream(0);
487 
488  return stream.str();
489 }
490 
491 std::vector<std::unique_ptr<FunctionVisitor> > Traits::site_function_visitors(
492  std::string const &nlist_specifier) const {
493  std::vector<std::unique_ptr<FunctionVisitor> > result;
494  result.push_back(std::unique_ptr<FunctionVisitor>(new VariableLabeler(
495  name(), "%p_var_%f<Scalar>(" + nlist_specifier + ")")));
496  return result;
497 }
498 
499 std::vector<std::unique_ptr<FunctionVisitor> > Traits::clust_function_visitors()
500  const {
501  std::vector<std::unique_ptr<FunctionVisitor> > result;
502  if (val_traits().global()) {
503  result.push_back(std::unique_ptr<FunctionVisitor>(
504  new VariableLabeler(name(), "%p_var<Scalar>(%f)")));
505  } else {
506  if (requires_site_basis())
507  result.push_back(
508  std::unique_ptr<FunctionVisitor>(new SubExpressionLabeler(
509  site_basis_name(), site_basis_name() + "_%l<Scalar>(%n)")));
510  else
511  result.push_back(std::unique_ptr<FunctionVisitor>(
512  new VariableLabeler(name(), "%p_var_%f<Scalar>(%n)")));
513  }
514  return result;
515 }
516 
517 std::string Traits::site_basis_description(BasisSet site_bset, Site site,
518  Index site_ix) const {
519  return std::string();
520 }
521 
522 } // namespace DoFType
523 
524 } // namespace CASM
Specifies traits of (possibly) anisotropic crystal properties.
static std::string name_suffix(std::string const &_name, char delim='_')
Index size() const
Definition: Array.hh:131
bool accept(const FunctionVisitor &visitor)
Definition: BasisSet.cc:234
GlobalContinuousConfigDoFValues const & global_dof(DoFKey const &_key) const
Definition: ConfigDoF.cc:69
LocalContinuousConfigDoFValues const & local_dof(DoFKey const &_key) const
Definition: ConfigDoF.cc:124
Index dim() const
Dimension of the DoFSet, equivalent to basis().cols()
Definition: DoFSet.hh:254
Eigen::MatrixXd const & basis() const
Definition: DoFSet.hh:268
Collection of all the traits specific to a DoF type.
Definition: DoFTraits.hh:59
AnisoValTraits const & val_traits() const
Definition: DoFTraits.hh:67
virtual std::string clexulator_private_method_definitions_string(Structure const &_prim, std::vector< BasisSet > const &site_bases, std::string const &indent) const
Definition: DoFTraits.cc:307
virtual jsonParser dof_to_json(ConfigDoF const &_dof, BasicStructure const &_reference) const
Serialize type-specific DoF values from ConfigDoF.
Definition: DoFTraits.cc:105
virtual std::string clexulator_global_prepare_string(Structure const &_prim, std::map< UnitCellCoord, std::set< UnitCellCoord > > const &_nhood, PrimNeighborList &_nlist, std::vector< BasisSet > const &site_bases, std::string const &indent) const
Definition: DoFTraits.cc:200
virtual std::string clexulator_public_method_declarations_string(Structure const &_prim, std::vector< BasisSet > const &site_bases, std::string const &indent) const
Definition: DoFTraits.cc:315
virtual void apply_dof(ConfigDoF const &_dof, BasicStructure const &_reference, SimpleStructure &_struc) const
Transforms SimpleSructure.
Definition: DoFTraits.cc:99
virtual std::pair< Eigen::MatrixXd, std::set< std::string > > find_values(std::map< std::string, Eigen::MatrixXd > const &values) const
Retrieve the standard values for a DoF from dictionary of properties from properties....
Definition: DoFTraits.cc:58
virtual std::string clexulator_private_method_declarations_string(Structure const &_prim, std::vector< BasisSet > const &site_bases, std::string const &indent) const
Definition: DoFTraits.cc:331
virtual std::string clexulator_member_declarations_string(Structure const &_prim, std::vector< BasisSet > const &site_bases, std::string const &indent) const
Definition: DoFTraits.cc:269
virtual std::string clexulator_point_prepare_string(Structure const &_prim, std::map< UnitCellCoord, std::set< UnitCellCoord > > const &_nhood, PrimNeighborList &_nlist, std::vector< BasisSet > const &site_bases, std::string const &indent) const
Definition: DoFTraits.cc:118
virtual std::string site_basis_description(BasisSet site_bset, Site site, Index site_ix) const
Definition: DoFTraits.cc:517
virtual std::string clexulator_public_method_definitions_string(Structure const &_prim, std::vector< BasisSet > const &site_bases, std::string const &indent) const
Definition: DoFTraits.cc:323
bool requires_site_basis() const
Definition: DoFTraits.hh:73
virtual std::vector< ParamAllocation > param_pack_allocation(Structure const &_prim, std::vector< BasisSet > const &_bases) const
Definition: DoFTraits.cc:443
virtual void to_json(DoFSet const &_out, jsonParser &_json) const
Output.
Definition: DoFTraits.cc:74
virtual std::vector< std::unique_ptr< FunctionVisitor > > clust_function_visitors() const
Definition: DoFTraits.cc:499
virtual std::vector< std::unique_ptr< FunctionVisitor > > site_function_visitors(std::string const &nlist_specifier="%n") const
Definition: DoFTraits.cc:491
std::string site_basis_name() const
Definition: DoFTraits.hh:71
virtual std::string clexulator_constructor_string(Structure const &_prim, std::vector< BasisSet > const &site_bases, std::string const &indent) const
Definition: DoFTraits.cc:479
std::string const & name() const
Definition: DoFTraits.hh:69
Eigen::MatrixXd standard_values() const
Get global DoF values as standard DoF values.
Eigen::MatrixXd standard_values() const
Get local DoF values as standard DoF values.
Parsing dictionary for obtaining the correct MoleculeAttribute given a name.
T const & lookup(const key_type &_name) const
Equivalent to find, but set 'home' and throws error with suggestion if.
std::pair< iterator, bool > insert(const value_type &value)
Insert single value.
Definition: unique_map.hh:149
The PrimNeighborList gives the coordinates of UnitCell that are neighbors of the origin UnitCell.
Definition: NeighborList.hh:39
Scalar neighbor_index(UnitCellCoord const &_ucc)
Get neighborlist index of UnitCellCoord.
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
jsonParser & put_obj()
Puts new empty JSON object.
Definition: jsonParser.hh:354
jsonParser & put_array()
Puts new empty JSON array.
Definition: jsonParser.hh:362
BasicStructure specifies the lattice and atomic basis of a crystal.
Representation of a crystal of molecular and/or atomic occupants, and any additional properties....
Unit Cell Coordinates.
jsonParser & push_back(const T &value, Args &&... args)
Definition: jsonParser.hh:684
void register_traits(Traits const &_traits)
Insert new DoFType::Traits into the global dictionary.
Definition: DoFTraits.cc:44
DoF_impl::DisplacementDoFTraits displacement()
DoF_impl::StrainDoFTraits GLstrain()
DoF_impl::StrainDoFTraits Hstrain()
DoF_impl::OccupationDoFTraits occupation()
TraitsDictionary & traits_dict()
Definition: DoFTraits.cc:39
DoF_impl::MagSpinDoFTraits magspin(std::string const &flavor_name)
Traits const & traits(std::string const &dof_key)
Lookup DoFType::Traits in the global dictionary.
Definition: DoFTraits.cc:46
DoF::BasicTraits const & basic_traits(std::string const &dof_key)
Access DoF::BasicTraits for a given DoF type.
Definition: DoFTraits.cc:50
DoF_impl::StrainDoFTraits EAstrain()
Main CASM namespace.
Definition: APICommand.hh:8
std::string type_name()
Definition: TypeInfo.hh:19
const double TOL
Definition: definitions.hh:30
INDEX_TYPE Index
For long integer indexing:
Definition: definitions.hh:39
T max(const T &A, const T &B)
Definition: CASM_math.hh:95
N-nary function that behaves as a constant (i.e. transform(arg1,arg2,...) == constant is true)
Definition: CASM_TMP.hh:92