CASM  1.1.0
A Clusters Approach to Statistical Mechanics
QueryIO_impl.hh
Go to the documentation of this file.
1 #ifndef CASM_app_query_QueryIO_impl
2 #define CASM_app_query_QueryIO_impl
3 
11 
12 namespace CASM {
13 
14 namespace adapter {
15 
16 template <typename DataObject>
17 DataObject const &Adapter<DataObject, QueryData<DataObject>>::operator()(
18  QueryData<DataObject> const &adaptable) const {
19  return adaptable.value;
20 }
21 
22 } // namespace adapter
23 
24 template <typename ValueType>
26  ValueType const &_value,
27  bool _include_equivalents,
28  Index _equivalent_index,
29  PermuteIterator const *_permute_it)
30  : primclex(_primclex),
31  value(_value),
32  include_equivalents(_include_equivalents),
33  equivalent_index(_equivalent_index),
34  permute_it(_permute_it) {}
35 
36 namespace QueryIO {
37 
38 template <typename QueryDataType>
41  "equivalent_index",
42  "[--include-equivalents query only] Index that counts over distinct "
43  "symmetrically equivalent objects",
44  [](QueryDataType const &data) -> Index { return data.equivalent_index; });
45 }
46 
47 template <typename QueryDataType>
50  "permute_scel_factor_group_op",
51  "[--include-equivalents query only] Factor group operation (applied "
52  "before translation operation) of the permutation that generated the "
53  "equivalent object, as its index into the supercell factor group",
54  [](QueryDataType const &data) -> Index {
55  return data.permute_it->factor_group_index();
56  });
57 }
58 
59 template <typename QueryDataType>
62  "permute_factor_group_op",
63  "[--include-equivalents query only] Factor group operation (applied "
64  "before translation operation) of the permutation that generated the "
65  "equivalent object, as its index into the prim factor group",
66  [](QueryDataType const &data) -> Index {
67  return data.permute_it->prim_factor_group_index();
68  });
69 }
70 
71 template <typename QueryDataType>
75  "permute_factor_group_op_desc",
76  "[--include-equivalents query only] Description of prim factor group "
77  "operation that generated the equivalent object in Direct coordinates.",
78  [](QueryDataType const &data) -> std::string {
79  auto const &factor_group_op =
80  data.permute_it
81  ->factor_group()[data.permute_it->factor_group_index()];
82  auto const &lattice = data.primclex.prim().lattice();
83  std::stringstream ss;
84  ss << "'" << brief_description(factor_group_op, lattice) << "'";
85  return ss.str();
86  });
87 }
88 
89 template <typename QueryDataType>
92  "permute_translation",
93  "[--include-equivalents query only] Translation (applied after factor "
94  "group operation) of the permutation that generated the equivalent "
95  "object, as (i, j, k) multiples of the prim lattice vectors.",
96  [](QueryDataType const &data) -> Eigen::Vector3l {
97  return data.permute_it->sym_info().unitcell_index_converter()(
98  data.permute_it->translation_index());
99  });
100 }
101 
102 } // namespace QueryIO
103 
104 } // namespace CASM
105 
106 #endif
A DatumFormatter that returns a 1D value of specified type, via functions that may be specified at ru...
A DatumFormatter that returns a value of specified type, via functions that may be specified at runti...
PrimClex is the top-level data structure for a CASM project.
Definition: PrimClex.hh:55
Generic1DDatumFormatter< Eigen::Vector3l, QueryDataType > permute_translation()
Definition: QueryIO_impl.hh:90
GenericDatumFormatter< Index, QueryDataType > permute_scel_factor_group_op()
Definition: QueryIO_impl.hh:48
GenericDatumFormatter< Index, QueryDataType > equivalent_index()
Definition: QueryIO_impl.hh:39
GenericDatumFormatter< std::string, QueryDataType > permute_factor_group_op_desc()
Description of permute factor group operation in the prim factor group.
Definition: QueryIO_impl.hh:73
GenericDatumFormatter< Index, QueryDataType > permute_factor_group_op()
Definition: QueryIO_impl.hh:60
GenericVectorXdScelFormatter lattice()
Definition: SupercellIO.cc:266
Main CASM namespace.
Definition: APICommand.hh:8
std::string brief_description(const SymOp &op, const xtal::Lattice &lat, SymInfoOptions opt=SymInfoOptions())
Print SymInfo to brief string.
INDEX_TYPE Index
For long integer indexing:
Definition: definitions.hh:39
Matrix< long int, 3, 1 > Vector3l
Definition: eigen.hh:13
PrimClex * primclex
Definition: settings.cc:135
QueryData(PrimClex const &_primclex, ValueType const &_value, bool _include_equivalents=false, Index _equivalent_index=0, PermuteIterator const *_permute_it=nullptr)
Definition: QueryIO_impl.hh:25