CASM  1.1.0
A Clusters Approach to Statistical Mechanics
UnitCellCoordIO.cc
Go to the documentation of this file.
2 
4 
5 namespace CASM {
7 jsonParser &to_json(const xtal::UnitCellCoord &ucc_val, jsonParser &fill_json) {
8  fill_json.put_array();
9  fill_json.push_back(ucc_val.sublattice());
10  fill_json.push_back(ucc_val.unitcell()(0));
11  fill_json.push_back(ucc_val.unitcell()(1));
12  fill_json.push_back(ucc_val.unitcell()(2));
13 
14  return fill_json;
15 }
16 
19 void from_json(xtal::UnitCellCoord &fill_value, const jsonParser &read_json) {
20  auto b = read_json[0].get<Index>();
21  auto i = read_json[1].get<Index>();
22  auto j = read_json[2].get<Index>();
23  auto k = read_json[3].get<Index>();
24 
25  fill_value = xtal::UnitCellCoord(b, i, j, k);
26 
27  return;
28 }
29 } // namespace CASM
jsonParser & put_array()
Puts new empty JSON array.
Definition: jsonParser.hh:362
Unit Cell Coordinates.
const UnitCell & unitcell() const
jsonParser & push_back(const T &value, Args &&... args)
Definition: jsonParser.hh:684
T get(Args &&... args) const
Get data from json, using one of several alternatives.
Definition: jsonParser.hh:716
Main CASM namespace.
Definition: APICommand.hh:8
jsonParser & to_json(const ClexDescription &desc, jsonParser &json)
void from_json(ClexDescription &desc, const jsonParser &json)
INDEX_TYPE Index
For long integer indexing:
Definition: definitions.hh:39