12 template class BaseDatumFormatter<Supercell>;
13 template class DataFormatterOperator<bool, std::string, Supercell>;
14 template class DataFormatterOperator<bool, bool, Supercell>;
15 template class DataFormatterOperator<bool, double, Supercell>;
16 template class DataFormatterOperator<double, double, Supercell>;
17 template class DataFormatterOperator<Index, double, Supercell>;
18 template class DataFormatter<Supercell>;
25 const std::string IsSupercellOf::Name =
"is_supercell_of";
26 const std::string IsSupercellOf::Desc =
27 "Returns true for all supercells that are a supercell the specified "
29 "All re-orientations allowed by the crystal point group are checked. "
30 "Ex: 'is_supercell_of(SCELV_A_B_C_D_E_F)'";
40 return std::unique_ptr<IsSupercellOf>(this->
_clone());
52 "Returns true for all supercells that can tile the specified supercell. "
53 "All re-orientations allowed by the crystal point group are checked. "
54 "Ex: 'is_unitcell_of(SCELV_A_B_C_D_E_F)'";
64 return std::unique_ptr<IsUnitcellOf>(this->
_clone());
74 "For all supercells, S, returns the transformation matrix, T, that can be "
75 "used to create S from the specified unit cell, U, if possible, i.e. "
76 "S.lat = (op*U.lat)*T, where 'op' is an element of the crystal "
77 "point group, and lattices are represented by column vector matrices. "
78 "T is returned in column-major form: (T00, T10, T20, T01, ...) "
79 "If not specified, the primitive cell is used for the unit "
80 "cell. Ex: 'transf_mat', 'transf_mat(SCELV_A_B_C_D_E_F)'";
86 Eigen::Matrix<int, 3, 3, Eigen::ColMajor> T =
88 return Eigen::Map<Eigen::VectorXi>(T.data(), T.size());
98 return std::unique_ptr<TransfMat>(this->
_clone());
103 std::vector<std::string> splt_vec;
104 boost::split(splt_vec, args, boost::is_any_of(
","), boost::token_compress_on);
106 if (splt_vec.size() > 1) {
107 std::stringstream ss;
108 ss << this->
name() <<
" expected 0 or 1 argument. Received: " << args
110 throw std::runtime_error(ss.str());
111 }
else if (args.empty()) {
129 std::vector<std::string> splt_vec;
130 boost::split(splt_vec, args, boost::is_any_of(
","), boost::token_compress_on);
132 if (splt_vec.size() > 1) {
133 std::stringstream ss;
134 ss << this->
name() <<
" expected 0 or 1 argument. Received: " << args
136 throw std::runtime_error(ss.str());
146 return std::vector<std::string>{this->
name() +
"(" +
m_type +
")"};
153 "Number of enumerated configurations of (default) all types, or specified "
154 "type, by supercell. Ex: 'Nconfig', 'Nconfig(config)'";
168 return std::unique_ptr<Nconfig>(this->
_clone());
178 "Number of configurations with completed calculations of (default) all "
179 "types, or specified type, by supercell. Ex: 'Ncalc', 'Ncalc(config)'";
193 return std::unique_ptr<Ncalc>(this->
_clone());
203 "Number of configurations of (default) all types, or specified "
204 "type, which have any data or files, by supercell. Ex: 'Ndata', "
219 return std::unique_ptr<Ndata>(this->
_clone());
229 "pointgroup_name",
"Supercell point group name.",
230 [](
const Supercell &scel) -> std::string {
238 "Supercell volume, given as the integer number of primitive cells",
244 "multiplicity",
"Number of equivalent supercells",
252 "Supercell factor group size",
268 "lattice",
"Lattice vectors, unrolled: (a0, a1, a2, b0, ...)",
270 Eigen::Matrix<double, 3, 3, Eigen::ColMajor> L =
271 scel.
lattice().lat_column_mat();
272 return Eigen::Map<Eigen::VectorXd>(L.data(), L.size());
278 "lattice_params",
"Lattice parameters, as: (a, b, c, alpha, beta, gamma)",
292 using namespace ScelIO;
293 StringAttributeDictionary<Supercell> dict;
295 dict.insert(name<Supercell>(), alias<Supercell>(), alias_or_name<Supercell>(),
303 using namespace ScelIO;
304 BooleanAttributeDictionary<Supercell> dict;
306 dict.insert(DB::Selected<Supercell>(), IsSupercellOf(), IsUnitcellOf());
313 using namespace ScelIO;
314 IntegerAttributeDictionary<Supercell> dict;
324 using namespace ScelIO;
325 ScalarAttributeDictionary<Supercell> dict;
334 using namespace ScelIO;
335 VectorXiAttributeDictionary<Supercell> dict;
337 dict.insert(TransfMat());
344 using namespace ScelIO;
345 VectorXdAttributeDictionary<Supercell> dict;
353 DataFormatterDictionary<Supercell, BaseValueFormatter<jsonParser, Supercell>>
355 return DataFormatterDictionary<Supercell,
356 BaseValueFormatter<jsonParser, Supercell>>();
std::vector< std::string > col_header(const Supercell &_tmplt) const override
col_header returns: {'short_name(refcell_name)'}
std::string m_type
Reference supercell name, given meaning by derived class.
bool parse_args(const std::string &args) override
Expects arguments of the form 'is_supercell_of(scelname)'.
ConfigCountBase(std::string name, std::string desc)
bool evaluate(const Supercell &scel) const override
std::unique_ptr< IsSupercellOf > clone() const
Clone using copy constructor.
IsSupercellOf * _clone() const override
Clone using copy constructor.
static const std::string Name
static const std::string Desc
std::unique_ptr< IsUnitcellOf > clone() const
Clone using copy constructor.
bool evaluate(const Supercell &unit) const override
IsUnitcellOf * _clone() const override
Clone using copy constructor.
static const std::string Desc
Ncalc * _clone() const override
Clone using copy constructor.
std::unique_ptr< Ncalc > clone() const
Clone using copy constructor.
static const std::string Name
Index evaluate(const Supercell &scel) const override
Index evaluate(const Supercell &scel) const override
static const std::string Desc
static const std::string Name
Nconfig * _clone() const override
Clone using copy constructor.
std::unique_ptr< Nconfig > clone() const
Clone using copy constructor.
std::unique_ptr< Ndata > clone() const
Clone using copy constructor.
Index evaluate(const Supercell &scel) const override
static const std::string Name
static const std::string Desc
Ndata * _clone() const override
Clone using copy constructor.
const result_type & _evaluate(const Supercell &scel, const Supercell &unit) const
Supercell const & refcell() const
std::string m_refcell_name
Reference supercell name, given meaning by derived class.
std::unique_ptr< TransfMat > clone() const
Clone using copy constructor.
Eigen::VectorXi evaluate(const Supercell &scel) const override
static const std::string Name
bool validate(const Supercell &scel) const override
bool parse_args(const std::string &args) override
Expects arguments of the form 'transf_mat(unitcell_name)'.
TransfMat * _clone() const override
Clone using copy constructor.
static const std::string Desc
Represents a supercell of the primitive parent crystal structure.
const PrimClex & primclex() const
Use while transitioning Supercell to no longer need a PrimClex const *
const Lattice & lattice() const
The super lattice.
Index volume() const
Return number of primitive cells that fit inside of *this.
const SymGroup & factor_group() const
const Structure & prim() const
double length(Index i) const
Return length of i'th lattice vector.
double angle(Index i) const
Return angle between lattice vectors (*this)[(i+1)%3] and (*this)[(i+2)%3], in degrees.
double volume() const
Return signed volume of this lattice.
Index config_count(std::string scelname, const PrimClex &primclex)
Total number of configs of all types in a supercell.
Index config_data_count(std::string scelname, const PrimClex &primclex)
Total number of configs w/ data or files of all types in a supercell.
Index config_calculated_count(std::string scelname, const PrimClex &primclex)
Total number of calculated configs of all types in a supercell.
Generic1DDatumFormatter< Eigen::VectorXd, Supercell > GenericVectorXdScelFormatter
GenericVectorXdScelFormatter lattice_params()
GenericVectorXdScelFormatter lattice()
GenericScelFormatter< Index > multiplicity()
GenericScelFormatter< std::string > pointgroup_name()
GenericScelFormatter< Index > scel_size()
GenericScelFormatter< double > volume()
GenericScelFormatter< Index > factorgroup_size()
IntegerAttributeDictionary< Supercell > make_integer_dictionary< Supercell >()
DataFormatterDictionary< Supercell, BaseValueFormatter< jsonParser, Supercell > > make_json_dictionary< Supercell >()
BooleanAttributeDictionary< Supercell > make_boolean_dictionary< Supercell >()
VectorXiAttributeDictionary< Supercell > make_vectorxi_dictionary< Supercell >()
GenericDatumFormatter< std::string, DataObject > name()
VectorXdAttributeDictionary< Supercell > make_vectorxd_dictionary< Supercell >()
INDEX_TYPE Index
For long integer indexing:
StringAttributeDictionary< Supercell > make_string_dictionary< Supercell >()
ScalarAttributeDictionary< Supercell > make_scalar_dictionary< Supercell >()