21 template class QueryHandler<Configuration>;
24 typedef std::insert_iterator<std::map<std::string, std::shared_ptr<RuntimeLibrary> > > runtimelib_it_type;
25 typedef std::insert_iterator<DataFormatterDictionary<Configuration> > config_dict_it_type;
29 const ProjectSettings &
set,
30 config_dict_it_type dict_it,
31 runtimelib_it_type lib_it);
37 : id(
"none"), supercell(&_supercell), source_updated(true),
multiplicity(-1),
38 m_configdof(_configdof), prop_updated(true), m_selected(false) {
45 : supercell(&_supercell), source_updated(false),
multiplicity(-1),
46 m_configdof(_supercell.num_sites()), prop_updated(false) {
103 for(
int s = 0; s < source.
size(); s++) {
138 if(new_occupation.
size() != this->
size()) {
142 throw std::runtime_error(
"Error: Configuration::set_occupation with array of the wrong size");
167 if(new_displacement.cols() != this->
size()) {
169 default_err_log() <<
"new_displacement.cols(): " << new_displacement.cols() << std::endl;
171 throw std::runtime_error(
"Error: Configuration::set_displacement with matrix of the wrong size");
228 return std::find_if(begin, end, f);
244 std::unique_ptr<Supercell> next_scel;
250 if(result == tconfig.get_supercell().translate_end()) {
256 tconfig.ideal_lattice(),
270 tconfig.m_supercell_ptr.reset(next_scel.release());
271 tconfig.supercell = tconfig.m_supercell_ptr.get();
392 std::vector<PermuteIterator> fg;
405 std::vector<PermuteIterator> config_factor_group;
408 for(
int i = 0; i < config_factor_group.size(); i++) {
411 if(config_factor_group[i].factor_group_index() == config_factor_group[i - 1].factor_group_index())
415 sym_group.
push_back(config_factor_group[i].sym_op());
445 if(res.first == g.
end()) {
447 std::cerr <<
"Requested supercell transformation matrix: \n"
449 std::cerr <<
"Requested motif Configuration: " <<
451 std::cerr <<
"Configuration transformation matrix: \n"
454 throw std::runtime_error(
455 "Error in 'Configuration::fill_supercell(const Supercell &scel, const SymGroup& g)'\n"
456 " The motif cannot be tiled onto the specified supercell."
479 if(fs::exists(filepath)) {
483 parsed_props[
"data_timestamp"] = fs::last_write_time(filepath);
486 for(
Index i = 0; i < props.size(); i++) {
491 if(props[i] ==
"energy" || props[i] ==
"relaxed_energy" || props[i] ==
"relaxed_magmom") {
495 parsed_props[props[i]] = json[props[i]];
502 if(json.
contains(
"relaxed_magmom")) {
506 if(json.
contains(
"relaxed_forces")) {
507 if(json[
"relaxed_forces"].
size()) {
509 from_json(forces, json[
"relaxed_forces"]);
510 parsed_props[
"rms_force"] = sqrt((forces.transpose() * forces).trace() / double(forces.rows()));
513 parsed_props[
"rms_force"] = 0.;
517 if(json.
contains(
"relaxed_mag_basis")) {
520 std::vector<int> num_each_molecule;
521 std::vector<std::string> name_each_molecule;
522 from_json(num_each_molecule, json[
"atoms_per_type"]);
523 from_json(name_each_molecule, json[
"atom_type"]);
529 Eigen::VectorXd mag_each_molecule = Eigen::VectorXd::Constant(struc_molecule_name.size(), std::nan(
""));
534 double cum_molecule_mag;
536 for(i = 0; i < num_each_molecule.size(); i++) {
537 cum_molecule_mag = 0;
538 for(j = 0; j < num_each_molecule[i]; j++) {
539 cum_molecule_mag += json[
"relaxed_mag_basis"][k].
get<
double>();
542 auto atom_idx =
std::find(struc_molecule_name.begin(), struc_molecule_name.end(), name_each_molecule[i]) - struc_molecule_name.begin();
543 if(atom_idx < struc_molecule_name.size()) {
544 mag_each_molecule[atom_idx] = cum_molecule_mag / num_each_molecule[i];
546 parsed_props[
"relaxed_mag"] = mag_each_molecule;
602 return json[
"status"].get<std::string>();
604 return(
"not_submitted");
612 return json[
"failure_type"].get<std::string>();
707 for(
Index i = 0; i < sublat_num_each_molecule.
size(); i++) {
708 sublattice_composition[i].
resize(sublat_num_each_molecule[i].
size());
709 for(
Index j = 0; j < sublat_num_each_molecule[i].
size(); j++) {
710 sublattice_composition[i][j] = (1.0 * sublat_num_each_molecule[i][j]) /
get_supercell().
volume();
714 return sublattice_composition;
735 for(i = 0; i <
size(); i++) {
736 sublat_num_each_molecule[
get_b(i) ][
occ(i)]++;
739 return sublat_num_each_molecule;
757 for(i = 0; i < struc_molecule.size(); i++) {
760 num_each_molecule[i] = 0;
762 num_atoms += num_each_molecule[i];
767 for(i = 0; i < num_each_molecule.
size(); i++)
768 comp.
push_back((1.0 * num_each_molecule[i]) /
double(num_atoms));
783 for(
Index i = 0; i < num_each_molecule.
size(); i++)
799 std::cerr <<
"Error in Configuration::get_param_composition()" << std::endl;
800 std::cerr <<
" Composition axes are not set." << std::endl;
816 std::vector<std::string> components;
817 for(
auto it = v_components.cbegin(); it != v_components.cend(); ++it) {
818 components.push_back(*it);
822 Eigen::VectorXd num_each_component = Eigen::VectorXd::Zero(components.size());
829 num_each_component[ convert[
get_b(i) ][
occ(i)] ] += 1.0;
833 for(
Index i = 0; i < components.size(); i++) {
837 return num_each_component;
869 jsonParser &json_ref = json_config[calc_string][ref_string];
870 jsonParser &json_prop = json_ref[
"properties"];
872 json_config[
"selected"] =
selected();
898 catch(
const fs::filesystem_error &ex) {
899 std::cerr <<
"Error in Configuration::write_pos()." << std::endl;
900 std::cerr << ex.what() << std::endl;
922 stream.flags(std::ios::left);
926 stream.flags(std::ios::showpoint | std::ios::fixed | std::ios::left);
927 stream <<
name() <<
" ";
930 if(composition_flag == 1) {
933 else if(composition_flag == 2) {
936 else if(composition_flag == 3) {
941 stream.flags(std::ios::showpoint | std::ios::fixed | std::ios::right);
953 for(
Index i = 0; i < mol_list.size(); i++) {
959 stream.flags(std::ios::showpoint | std::ios::fixed | std::ios::right);
960 stream << comp[i] <<
" ";
970 for(
Index i = 0; i < true_comp.
size(); i++) {
973 stream.flags(std::ios::showpoint | std::ios::fixed | std::ios::right);
974 stream << true_comp[i] <<
" ";
984 for(
Index i = 0; i < sublattice_composition.
size(); i++) {
985 for(
Index j = 0; j < sublattice_composition[i].
size(); j++) {
988 stream.flags(std::ios::showpoint | std::ios::fixed | std::ios::right);
989 stream << sublattice_composition[i][j] <<
" ";
1027 const jsonParser &json_scel = json[
"supercells"];
1038 if(!json_config.
contains(calc_string))
1040 const jsonParser &json_calc = json_config[calc_string];
1041 if(!json_calc.
contains(ref_string))
1043 const jsonParser &json_ref = json_calc[ref_string];
1044 if(!json_ref.
contains(
"properties"))
1046 const jsonParser &json_prop = json_ref[
"properties"];
1133 if(!json[
"dof"].is_obj()) {
1140 dof.
erase(
"occupation");
1147 dof.
erase(
"displacement");
1154 dof.
erase(
"deformation");
1185 std::stringstream ss;
1190 json[
"pos"] = ss.str();
1207 json.
erase(
"param_comp_formula");
1208 json.
erase(
"param_composition");
1249 automatic_intensities(i) = i;
1256 for(
int i = 0; i <
size(); i++) {
1257 intensities(i) = component_intensities(convert[
get_b(i)][
occ(i)]);
1273 std::cerr <<
"ERROR in Configuration::calc_sublat_struct_fact. Did you "
1274 <<
"forget to initialize a fourier matrix in Supercell?"
1275 <<
" Quitting" << std::endl;
1281 Eigen::VectorXd int_segment = intensities.segment(i * supercell_volume, supercell_volume);
1289 generated[
"sublat_struct_fact"] = sublat_sf.transpose();
1303 std::cerr <<
"ERROR in Configuration::calc_struct_fact. Did you "
1304 <<
"forget to initialize a phase-factor matrix in Supercell?"
1305 <<
" Quitting" << std::endl;
1309 Eigen::MatrixXcd sublat_sf =
generated[
"sublat_struct_fact"].
get<Eigen::MatrixXcd>();
1317 sf_coords.col(3) = raw_amplitudes.cwiseAbs().transpose() / double(
supercell->
basis_size());
1339 return generated[
"sublat_struct_fact"].
get<Eigen::MatrixXcd>();
1355 std::vector<std::string> splt_vec;
1356 boost::split(splt_vec, configname, boost::is_any_of(
"/"), boost::token_compress_on);
1358 if(splt_vec.size() != 2) {
1360 default_err_log() <<
"configuration '" << configname <<
"' not valid." << std::endl;
1361 throw std::invalid_argument(
"Error in Configuration::split_name(const std::string &configname) const: Not valid");
1365 config_ind = boost::lexical_cast<
Index>(splt_vec[1]);
1367 catch(boost::bad_lexical_cast &e) {
1369 default_err_log() <<
"CRITICAL ERROR: In PrimClex::configuration(), malformed input:" << configname <<
"\n";
1372 return std::make_pair(splt_vec[0], config_ind);
1404 throw std::runtime_error(std::string(
"Error in 'sub_configuration:"
1405 " PrimClex of sub-Supercell and super-configuration are not the same"));
1414 sub_config.configdof().set_deformation(super_config.
deformation());
1421 sub_config.configdof().set_occupation(
Array<int>(sub_config.size(), 0));
1424 sub_config.configdof().set_displacement(
1425 ConfigDoF::displacement_matrix_t::Zero(3, sub_config.size()));
1430 for(
Index i = 0; i < sub_config.size(); i++) {
1441 sub_config.configdof().occ(i) = super_config.
occ(site_index);
1445 sub_config.configdof().disp(i) = super_config.
disp(site_index);
1456 std::vector<std::string> split(std::string s,
char delim) {
1457 typedef boost::tokenizer<boost::char_separator<char> > tokenizer;
1458 boost::char_separator<char> sep(&delim);
1459 tokenizer tok(s, sep);
1460 return std::vector<std::string>(tok.begin(), tok.end());
1485 auto pos = name.find(
"super");
1486 if(name.find(
"super") != std::string::npos) {
1487 std::string format =
"$CANON_SCELNAME.$PRIM_FG_OP1/super.$PRIM_FG_OP2."
1488 "$PRIM_SCELNAME/$PRIM_CANON_INDEX"
1489 ".equiv.$FG_PERM.$TRANS_PERM";
1491 std::vector<std::string> tokens = split(name,
'.');
1492 if(tokens.size() != 7) {
1494 primclex.
err_log() <<
"expected format: " << format <<
"\n";
1495 primclex.
err_log() <<
"name: " << name << std::endl;
1496 primclex.
err_log() <<
"tokens: " << tokens << std::endl;
1497 throw std::invalid_argument(
"Error in make_configuration: configuration name format error");
1503 name.substr(pos + std::string(
"super").size() + 1));
1505 std::string
scelname = name.substr(0, pos - 1);
1506 Index fg_op_index = boost::lexical_cast<
Index>(tokens[1]);
1509 if(sym_op.index() != fg_op_index) {
1511 primclex.
err_log() <<
"expected format: " << format <<
"\n";
1512 primclex.
err_log() <<
"name: " << name << std::endl;
1513 primclex.
err_log() <<
"read fg_op_index: " << fg_op_index << std::endl;
1514 primclex.
err_log() <<
"primclex.get_prim().factor_group()[fg_op_index].index(): "
1516 << std::endl << std::endl;
1517 throw std::runtime_error(
"Error in make_configuration: PRIM_FG_OP index mismatch");
1524 return f(prim_equiv);
1528 pos = name.find(
"equiv");
1529 if(pos != std::string::npos) {
1531 std::string format =
"$PRIM_SCELNAME/$PRIM_CANON_INDEX"
1532 ".equiv.$FG_PERM.$TRANS_PERM";
1535 std::vector<std::string> tokens = split(name,
'.');
1536 std::string primname = tokens[0];
1537 if(tokens.size() != 4) {
1539 primclex.
err_log() <<
"expected format: " << format <<
"\n";
1540 primclex.
err_log() <<
"name: " << name << std::endl;
1541 primclex.
err_log() <<
"tokens: " << tokens << std::endl;
1542 throw std::invalid_argument(
"Error in make_configuration: configuration name format error");
1546 Index fg_index = boost::lexical_cast<
Index>(tokens[2]);
1547 Index trans_index = boost::lexical_cast<
Index>(tokens[3]);
1646 err_log <<
"using cluster expansion: 'formation_energy'" << std::endl;
1647 err_log <<
"basis set size: " << clexulator.
corr_size() << std::endl;
1648 err_log <<
"max eci index: " << eci.
index().back() << std::endl;
1649 throw std::runtime_error(
"Error: bset and eci mismatch");
1665 [&](
const std::string & key) {
1763 m_scel(&_scel), m_op(&_op), m_motif_scel(nullptr) {}
1773 m_scel(&_scel), m_op(find_symop(_motif, _tol)), m_motif_scel(nullptr) {}
1834 auto res =
is_supercell(scel_lat, motif_lat, begin, end, tol);
1835 if(res.first == end) {
1837 std::cerr <<
"Requested supercell transformation matrix: \n"
1839 std::cerr <<
"Requested motif Configuration: "
1840 << motif.
name() <<
"\n";
1841 std::cerr <<
"Configuration transformation matrix: \n"
1844 throw std::runtime_error(
1845 "Error in 'FillSupercell::find_symop':\n"
1846 " The motif cannot be tiled onto the specified supercell."
1850 return &(*res.first);
1880 for(
Index i = 0 ; i < prim_grid.size() ; i++) {
1896 sout << c.
name() <<
"\n";
1898 sout <<
"Deformation:\n" << c.
deformation() << std::endl;
1901 sout <<
"Linear index: " << i <<
" UnitCellCoord: " << c.
get_uccoord(i) << std::endl;
1903 sout <<
" Occupation: " << c.
occ(i) <<
" (" << c.
get_mol(i).
name <<
")\n";
1906 sout <<
" Displacement: " << c.
disp(i).transpose() <<
"\n";
const PrimGrid & prim_grid() const
void clear_deformation()
Clear applied strain.
Clexulator clexulator(const ClexDescription &key) const
void clear_displacement()
Clear displacement.
size_type size() const
Returns array size if *this is a JSON array, object size if *this is a JSON object, 1 otherwise.
bool insert_primitive
True if primitive did not exist before insertion.
Configuration fill_supercell(Supercell &scel, const SymOp &op) const
Fills supercell 'scel' with reoriented configuration, as if by apply(op,*this)
ConfigInsertResult insert(bool primitive_only) const
Insert this in the canonical Supercell.
std::string get_name() const
Return supercell name.
double rms_force(const Configuration &_config)
Root-mean-square forces of relaxed configurations, determined from DFT (eV/Angstr.)
Eigen::VectorXd get_param_composition() const
Returns parametric composition, as calculated using PrimClex::param_comp.
const_displacement_t disp(Index site_l) const
Occupant displacement.
bool selected() const
True if this Configuration is currently selected in the MASTER config list.
static std::pair< std::string, Index > split_name(std::string configname)
Split configuration name string into scelname and config index.
Eigen::MatrixXcd sublat_struct_fact()
void init_occupation()
Set occupant variables to background structure.
static const std::string name
ReturnArray< int > get_num_each_molecule(const ConfigDoF &configdof, const Supercell &scel)
Returns num_each_molecule[ molecule_type], where 'molecule_type' is ordered as Structure::get_struc_m...
void from_json(ClexDescription &desc, const jsonParser &json)
UnitCellCoord get_uccoord(Index site_l) const
Get the UnitCellCoord for a given linear site index.
void set_displacement(const displacement_matrix_t &_displacement)
Eigen::VectorXd relaxed_mag(const Configuration &_config)
Returns the relaxed magnetic moment for each molecule.
const int & occ(Index site_l) const
Occupant variable on site l.
Supercell * supercell
const pointer to the (non-const) Supercell for this Configuration
void set_deformation(const Eigen::Matrix3d &_deformation)
Set applied strain.
PrimClex & get_primclex() const
Get the PrimClex for this Configuration.
double relaxed_magmom(const Configuration &_config)
Returns the relaxed magnetic moment, normalized per unit cell.
void read_dof(const jsonParser &json)
Functions used to perform read()
void read_properties(const jsonParser &json)
const Molecule & get_mol(Index site_l) const
Molecule on site l.
const Eigen::MatrixXcd & fourier_matrix() const
Eigen::VectorXd param_composition(const Eigen::VectorXd &n) const
Convert number of mol per prim, 'n' to parametric composition 'x'.
const DirectoryStructure & dir() const
std::string calc_status() const
bool has_basis_deformation(const Configuration &_config)
bool is_vacancy(const std::string &name)
A vacancy is any Specie/Molecule with (name == "VA" || name == "va" || name == "Va") ...
bool get_if(T &t, const std::string &key, Args...args) const
void push_back(const T &toPush)
bool is_equivalent(const Configuration &B) const
Check if Configuration are equivalent wrt the prim's factor group.
const Structure & get_prim() const
const Array< int > & occupation() const
Occupant variables.
bool has_formation_energy(const Configuration &_config)
Structure specifies the lattice and atomic basis of a crystal.
Configuration make_configuration(PrimClex &primclex, std::string name)
Make Configuration from name string.
Object copy_apply(const Transform &f, Object obj, Args &&...args)
fs::path calc_properties_path() const
config_const_iterator primitive_it
Iterator pointing at primitive.
Configuration canonical_form() const
Returns the canonical form Configuration in the same Supercell.
void print_sublattice_composition(std::ostream &stream) const
std::vector< Molecule > get_struc_molecule() const
Returns an Array of each possible Molecule in this Structure.
fs::path calculated_properties(std::string configname, std::string calctype) const
Return calculated properties file path.
Eigen::MatrixXd struct_fact()
void print_occupation(std::ostream &stream) const
bool has_composition_axes() const
check if CompositionConverter object initialized
bool has_lattice_deformation(const Configuration &_config)
Correlation correlations(const ConfigDoF &configdof, const Supercell &scel, Clexulator &clexulator)
Returns correlations using 'clexulator'. Supercell needs a correctly populated neighbor list...
double clex_formation_energy_per_species(const Configuration &config)
Returns the formation energy, normalized per species.
bool has_relaxed_energy(const Configuration &_config)
const jsonParser & source() const
const ConfigDoF & configdof() const
const Access the DoF
void push_back_source(const jsonParser &source)
config_const_iterator canonical_it
Iterator pointing at canonical, if existing.
const Lattice & get_real_super_lattice() const
const Eigen::MatrixXd & k_mesh() const
Eigen::VectorXd get_num_each_component() const
ConfigDoF m_configdof
Degrees of Freedom.
PermuteIterator inverse() const
void print_true_composition(std::ostream &stream) const
void set_displacement(const displacement_matrix_t &_disp)
Set occupant displacements.
size_type corr_size() const
Number of correlations.
double n_species(const Configuration &config)
Returns the total number species per unit cell.
Lattice get_reduced_cell() const
Find the lattice vectors which give most compact unit cell Compactness is measured by how close lat_c...
Supercell & canonical_form() const
int get_b(Index site_l) const
Get the basis site index for a given linear linear site index.
fs::path calc_status_path() const
Configuration primitive() const
Return the primitive Configuration.
fs::path configuration_calc_dir(std::string configname, std::string calctype) const
Return calculated properties file path.
void set_disp(Index site_l, const Eigen::VectorXd &_disp)
Set occupant displacements.
std::string mol_formula() const
Return formula for x->n.
Eigen::VectorXd comp(const Configuration &config)
Returns parametric composition, as calculated using PrimClex::param_comp.
const Lattice & ideal_lattice() const
Represents a supercell of the primitive parent crystal structure.
jsonParser m_source
a jsonParser object indicating where this Configuration came from
std::string m_name
Remember name.
const Properties & generated_properties() const
ReturnArray< Array< int > > get_sublat_num_each_molecule() const
displacement_t _disp(Index site_l)
PrimClex & get_primclex() const
fs::path calc_dir() const
Index find(const Coordinate &_coord) const
T get(Args...args) const
Get data from json, using one of several alternatives.
Configuration operator()(const Configuration &motif) const
bool read_calc_properties(jsonParser &parsed_props) const
double relaxed_energy_per_species(const Configuration &config)
Returns the relaxed energy, normalized per species.
std::vector< std::string > get_struc_molecule_name() const
Returns an Array of each possible Molecule in this Structure.
Eigen::VectorXd get_struct_fact_intensities() const
bool has_chemical_reference() const
check if ChemicalReference object initialized
bool insert_canonical
True if canonical configuration did not exist before insertion.
void print(std::ostream &sout)
Print POSCAR to stream.
fs::path get_path() const
Return path to supercell directory.
const Structure & get_prim() const
Get the primitive Structure for this Configuration.
ConfigIterator< const Configuration, const PrimClex > config_const_iterator
bool vacancy_allowed() const
returns true if vacancy are an allowed species
SymGroup is a collection of symmetry operations that satisfy the group property The symmetry operatio...
std::vector< std::string > components() const
The order of components in mol composition vectors.
std::string get_id() const
bool _eq(const Configuration &B) const
Equality comparison of Configuration, via ConfigEqual.
Eigen::VectorXd comp_n(const ConfigDoF &configdof, const Supercell &scel)
Returns comp_n, the number of each molecule per primitive cell, ordered as Structure::get_struc_molec...
void _init(Supercell &_motif_scel) const
jsonParser & put_null()
Puts 'null' JSON value.
const matrix_type & matrix() const
Const access of entire cartesian symmetry matrix.
bool has_occupation() const
True if Configuration has occupation DoF.
double formation_energy(const Configuration &config)
Returns the formation energy, normalized per unit cell.
double clex_formation_energy(const Configuration &config)
Returns the formation energy, normalized per unit cell.
const std::vector< std::string > & properties() const
Get current properties.
const ClexDescription & clex(std::string name) const
bool is_canonical() const
Check if Configuration is in the canonical form.
const Properties & calc_properties() const
permute_const_iterator permute_begin() const
bool is_null() const
Check if null type.
size_type erase(const std::string &name)
Erase key:value pair from an object.
std::ostream & operator<<(std::ostream &_stream, const FormattedPrintable &_formatted)
static const int standard
SymOp is the Coordinate representation of a symmetry operation it keeps fraction (FRAC) and Cartesian...
void print_composition(std::ostream &stream) const
const MasterSymGroup & factor_group() const
fs::path get_pos_path() const
Path to various files.
Read/modify settings of an already existing CASM project.
Class for less than comparison of Configurations (with the same Supercell)
std::vector< std::vector< Index > > m_index_table
bool has_relaxed_mag_basis(const Configuration &_config)
EigenIndex Index
For long integer indexing:
void sort()
Default sort is by atom name.
Index volume() const
Return number of primitive cells that fit inside of *this.
bool has_rms_force(const Configuration &_config)
void set_occupation(const Array< int > &newoccupation)
Set occupant variables.
bool has_deformation() const
True if Configuration has strain DoF.
std::string id
Identification.
A container class for the different degrees of freedom a Configuration might have.
ReturnArray< int > get_num_each_molecule() const
Returns num_each_molecule[ molecule_type], where 'molecule_type' is ordered as Structure::get_struc_m...
bool is_canonical(const Configuration &_config)
returns true if _config no symmetry transformation applied to _config will increase its lexicographic...
double volume_relaxation(const Configuration &_config)
Change in volume due to relaxation, expressed as the ratio V/V_0.
bool is_calculated(const Configuration &config)
Return true if all current properties have been been calculated for the configuration.
Array< CoordType > basis
Lattice vectors that specifies periodicity of the crystal.
bool add_canon_config(const Configuration &config, Index &index)
bool add_config(const Configuration &config)
fs::path get_path() const
const SymOp * find_symop(const Configuration &motif, double tol)
Find first SymOp in the prim factor group such that apply(op, motif) can be used to fill the Supercel...
std::pair< DataFormatterDictInserter, RuntimeLibInserter > load_query_plugins(const ProjectSettings &set, DataFormatterDictInserter dict_it, RuntimeLibInserter lib_it)
Load enumerator plugins from a CASM project.
ProjectSettings & settings()
bool get_else(T &t, const std::string &key, const T &default_value, Args...args) const
const std::vector< size_type > & index() const
const Access orbit indices of ECI values
permute_const_iterator translate_begin() const
Begin iterator over pure translational permutations.
void clear_occupation()
Clear occupation.
Iterator find(Iterator begin, Iterator end, const T &value, BinaryCompare q)
Equivalent to std::find(begin, end, value), but with custom comparison.
PrimClex is the top-level data structure for a CASM project.
Holds results of Configuration::insert.
UnitCellCoord uccoord(Index i) const
const CompositionConverter & composition_axes() const
const Access CompositionConverter object
void _generate_name() const
PermuteIterator find_translation() const
Returns a PermuteIterator corresponding to the first non-zero pure translation that maps the Configur...
std::vector< std::vector< Index > > get_index_converter(const Structure &struc, std::vector< Molecule > mol_list)
Helper Functions.
const ChemicalReference & chemical_reference() const
const Access ChemicalReference object
bool is_less() const
Returns less than comparison.
std::string name() const
SCELV_A_B_C_D_E_F/i.
const Configuration & configuration(const std::string &configname) const
access configuration by name (of the form "scellname/[NUMBER]", e.g., ("SCEL1_1_1_1_0_0_0/0") ...
Index find(const UnitCellCoord &bijk) const
double relaxed_magmom_per_species(const Configuration &_config)
Returns the relaxed magnetic moment, normalized per species.
jsonParser & write(jsonParser &json) const
Index size() const
Returns number of sites, NOT the number of primitives that fit in here.
ReturnArray< Array< double > > get_sublattice_composition() const
fs::path calc_status(std::string configname, std::string calctype) const
Return calculation status file path.
void set_deformation(const Eigen::Matrix3d &_deformation)
set_deformation sets ConfigDoF::has_deformation() to true
jsonParser & write_param_composition(jsonParser &json) const
Eigen::VectorXd relaxed_mag_basis(const Configuration &_config)
Returns the relaxed magnetic moment of each basis site.
Configuration(Supercell &_supercell, const jsonParser &source=jsonParser(), const ConfigDoF &_dof=ConfigDoF())
Construct a default Configuration.
fs::path POS(std::string configname) const
Return path to POS file.
ConfigIO::GenericConfigFormatter< std::string > configname()
Constructs DataFormmaterDictionary containing all Configuration DatumFormatters.
FillSupercell(Supercell &_scel, const SymOp &_op)
Constructor.
void calc_sublat_struct_fact()
Eigen::VectorXd Correlation
void set_calc_properties(const jsonParser &json)
Read calculation results into the configuration.
jsonParser & write_properties(jsonParser &json) const
std::vector< PermuteIterator > factor_group() const
Returns the subgroup of the Supercell factor group that leaves the Configuration unchanged.
Class for comparison of Configurations (with the same Supercell)
Eigen::VectorXd site_frac(const Configuration &config)
Returns the composition as site fraction, in the order of Structure::get_struc_molecule.
void write_pos() const
Write the POS file to get_pos_path.
double formation_energy_per_species(const Configuration &config)
Returns the formation energy, normalized per species.
double lattice_deformation(const Configuration &_config)
Cost function that describes the degree to which lattice has relaxed.
Index vacancy_index() const
returns the index of vacancies in composition vectors
ReturnArray< double > get_true_composition() const
PermuteIterator to_canonical() const
Returns the operation that applied to *this returns the canonical form.
permute_const_iterator translate_end() const
End iterator over pure translational permutations.
jsonParser & put_obj()
Puts new empty JSON object.
Configuration in_canonical_supercell() const
Returns the canonical form Configuration in the canonical Supercell.
Print POSCAR with formating options.
virtual void push_back(const SymOp &new_op)
double crystallography_tol() const
Get current project crystallography tolerance.
const Supercell & get_supercell(Index i) const
const Access supercell by index
void set_source(const jsonParser &source)
const displacement_matrix_t & displacement() const
Occupant displacements.
jsonParser & push_back(const T &value)
Puts new valued element at end of array of any type T for which 'jsonParser& to_json( const T &value...
void clear_displacement()
bool contains(const std::string &name) const
Return true if JSON object contains 'name'.
bool has_volume_relaxation(const Configuration &_config)
SymGroup point_group() const
Returns the point group that leaves the Configuration unchanged.
void print_config_list(std::ostream &stream, int composition_flag) const
void set_occ(Index site_l, int val)
Set occupant variable on site l.
double relaxed_energy(const Configuration &config)
Returns the relaxed energy, normalized per unit cell.
const Eigen::Matrix3d & deformation() const
Applied strain.
double basis_deformation(const Configuration &_config)
Cost function that describes the degree to which basis sites have relaxed.
void clear()
Clear all DoF.
const vector_type & tau() const
Const access of the cartesian translation vector, 'tau'.
void set_lattice(const Lattice &new_lat)
std::pair< bool, Eigen::MatrixXi > is_supercell(const Lattice &scel, const Lattice &unit, double tol)
Check if scel is a supercell of unitcell unit and some integer transformation matrix T...
ConfigDoF::displacement_matrix_t displacement_matrix_t
double reference_energy(const Configuration &config)
Returns the reference energy, normalized per unit cell.
bool is_primitive() const
Check if this is a primitive Configuration.
void error(const std::string &what)
bool has_relaxed_magmom(const Configuration &_config)
void set_selected(bool _selected)
double reference_energy_per_species(const Configuration &config)
Returns the reference energy, normalized per species.
UnitCellCoord uccoord(Index i) const
Eigen::MatrixXd displacement_matrix_t
Configuration sub_configuration(Supercell &sub_scel, const Configuration &super_config, const UnitCell &origin=UnitCell(0, 0, 0))
Returns the sub-configuration that fills a particular Supercell.
const Eigen::MatrixXcd & phase_factor() const
Supercell & get_supercell() const
Get the Supercell for this Configuration.
displacement_t disp(Index i)
bool is_array() const
Check if array type.
const Eigen::Matrix3i & get_transf_mat() const
Index get_b(Index i) const
ReturnArray< double > get_composition() const
ConfigIO::GenericConfigFormatter< std::string > scelname()
Lattice replace_vector(const Lattice &lat, const Eigen::Vector3d &new_vector, double tol)
jsonParser & write_dof(jsonParser &json) const
Functions used to perform write to config_list.json:
void read(const jsonParser &json)
Private members:
void init_displacement()
Set all occupant displacements to (0.,0.,0.)
ConfigIO::GenericConfigFormatter< Index > multiplicity()
double n_vacancy(const Configuration &config)
Returns the vacancy composition, as number per unit cell.
bool has_displacement() const
True if Configuration has displacement DoF.
permute_const_iterator permute_end() const
PermuteIterator from_canonical() const
Returns the operation that applied to the the canonical form returns *this.
const ClexDescription & default_clex() const
jsonParser & put_array()
Puts new empty JSON array.
bool is_primitive(const Configuration &_config)
returns true if _config describes primitive cell of the configuration it describes ...
Object & apply(const Transform &f, Object &obj, Args &&...args)
bool operator<(const Configuration &B) const
Compare Configuration, via ConfigCompare.
std::string failure_type() const
Eigen::VectorXd species_frac(const Configuration &config)
Returns the composition as species fraction, with [Va] = 0.0, in the order of Structure::get_struc_mo...
jsonParser & write_source(jsonParser &json) const
permute_const_iterator permute_it(Index fg_index, Index trans_index) const
void set_occupation(const Array< int > &_occupation)
A Configuration represents the values of all degrees of freedom in a Supercell.
const Structure & get_prim() const
const Access to primitive Structure
bool has_reference_energy(const Configuration &_config)
const ECIContainer & eci(const ClexDescription &key) const
void init_deformation()
Set applied strain to Eigen::Matrix3d::Zero()
double crystallography_tol() const
Get the PrimClex crystallography_tol.
A sparse container of ECI values and their corresponding orbit indices.