CASM  1.1.0
A Clusters Approach to Statistical Mechanics
CompositionAxes.cc
Go to the documentation of this file.
3 
4 namespace CASM {
5 
7  for (std::string const &el : enumerated) {
8  all_axes.erase(el);
9  if (curr_key == el) curr_key.clear();
10  }
11  enumerated.clear();
12 }
13 
15 void CompositionAxes::select(std::string key) {
16  auto it = all_axes.find(key);
17  if (it == all_axes.end()) {
18  std::stringstream ss;
19  ss << "Warning: The composition axes " << key
20  << " cannot be found among the posible composition axes.\n\n"
21  << "Please use 'casm composition --select' to re-select your "
22  "composition axes,\n"
23  << "use 'casm composition --calc' to re-calc your standard axes,\n"
24  << "or add custom composition axes manually.";
25 
26  err_message = ss.str();
27 
28  err_code = 2;
29  } else {
30  curr = it->second;
31  curr_key = key;
32  }
33 }
34 
35 } // namespace CASM
Main CASM namespace.
Definition: APICommand.hh:8
std::set< std::string > enumerated
void select(std::string key)
Set this->curr using key.
CompositionConverter curr
std::map< std::string, CompositionConverter > all_axes
void erase_enumerated()
Erase all enumerated axes and clear this->enumerated.