1 #ifndef CASM_Configuration
2 #define CASM_Configuration
26 template<
typename ConfigType,
typename PrimClexType>
33 template <
bool IsConst>
class ConfigSelection;
36 template<
typename DataObject>
struct QueryTraits;
40 static const std::string
name;
347 m_selected = _selected;
355 std::string
get_id()
const;
365 std::string
name()
const;
574 void print(std::ostream &stream,
COORD_TYPE mode,
int Va_mode = 0,
char term =
'\n',
int prec = 10,
int pad = 5)
const;
614 return m_configdof.
occ(site_l);
618 return m_configdof.
disp(site_l);
void clear_deformation()
Clear applied strain.
void clear_displacement()
Clear displacement.
bool insert_primitive
True if primitive did not exist before insertion.
ConstConfigSelection Selection
Eigen::MatrixXd pad(const Eigen::MatrixXd &M, int n)
Construct a matrix consisting of blocks M and Identity(n,n)
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.
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.
void print(std::ostream &stream, COORD_TYPE mode, int Va_mode=0, char term= '\n', int prec=10, int pad=5) const
void reset_properties(ConfigDoF &_dof)
Eigen::MatrixXcd sublat_struct_fact()
void init_occupation()
Set occupant variables to background structure.
static const std::string name
UnitCellCoord get_uccoord(Index site_l) const
Get the UnitCellCoord for a given linear site index.
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
Implements other comparisons in terms of '<'.
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.
std::string calc_status() const
bool has_basis_deformation(const Configuration &_config)
ConfigIterator< const Configuration, const PrimClex > config_const_iterator
bool is_equivalent(const Configuration &B) const
Check if Configuration are equivalent wrt the prim's factor group.
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.
fs::path calc_properties_path() const
config_const_iterator primitive_it
Iterator pointing at primitive.
const SymOp & symop() const
Configuration canonical_form() const
Returns the canonical form Configuration in the same Supercell.
void print_sublattice_composition(std::ostream &stream) const
Eigen::MatrixXd struct_fact()
void print_occupation(std::ostream &stream) const
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.
Eigen::VectorXd get_num_each_component() const
ConfigDoF m_configdof
Degrees of Freedom.
void print_true_composition(std::ostream &stream) const
void set_displacement(const displacement_matrix_t &_disp)
Set occupant displacements.
double n_species(const Configuration &config)
Returns the total number species per unit cell.
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.
void set_disp(Index site_l, const Eigen::VectorXd &_disp)
Set occupant displacements.
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)
fs::path calc_dir() const
const Eigen::Matrix3d & deformation() const
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.
ConfigDoF & configdof()
Access the DoF.
Eigen::VectorXd get_struct_fact_intensities() const
bool insert_canonical
True if canonical configuration did not exist before insertion.
const Structure & get_prim() const
Get the primitive Structure for this Configuration.
SymGroup is a collection of symmetry operations that satisfy the group property The symmetry operatio...
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...
std::shared_ptr< Supercell > m_supercell_ptr
void _init(Supercell &_motif_scel) const
bool has_occupation() const
True if Configuration has occupation DoF.
displacement_matrix_t::ColXpr displacement_t
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.
bool is_canonical() const
Check if Configuration is in the canonical form.
const Properties & calc_properties() const
std::ostream & operator<<(std::ostream &_stream, const FormattedPrintable &_formatted)
SymOp is the Coordinate representation of a symmetry operation it keeps fraction (FRAC) and Cartesian...
void print_composition(std::ostream &stream) const
displacement_matrix_t::ConstColXpr const_displacement_t
fs::path get_pos_path() const
Path to various files.
ConfigIO::Selected Selected
std::string failure_type(const Configuration &_config)
std::vector< std::vector< Index > > m_index_table
bool has_relaxed_mag_basis(const Configuration &_config)
EigenIndex Index
For long integer indexing:
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.
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...
void clear_occupation()
Clear occupation.
PrimClex is the top-level data structure for a CASM project.
Holds results of Configuration::insert.
void _generate_name() const
PermuteIterator find_translation() const
Returns a PermuteIterator corresponding to the first non-zero pure translation that maps the Configur...
std::string name() const
SCELV_A_B_C_D_E_F/i.
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
jsonParser & write_param_composition(jsonParser &json) const
notstd::cloneable_ptr< FillSupercell > m_fill_canonical
Remember how to copy into the canonical Supercell.
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.
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.
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.
ConfigDoF::displacement_t displacement_t
ReturnArray< double > get_true_composition() const
PermuteIterator to_canonical() const
Returns the operation that applied to *this returns the canonical form.
Configuration in_canonical_supercell() const
Returns the canonical form Configuration in the canonical Supercell.
bool has_failure_type(const Configuration &_config)
void set_source(const jsonParser &source)
const displacement_matrix_t & displacement() const
Occupant displacements.
const displacement_matrix_t & displacement() const
const Array< int > & occupation() const
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.
ConfigDoF::displacement_matrix_t displacement_matrix_t
double reference_energy(const Configuration &config)
Returns the reference energy, normalized per unit cell.
bool has_deformation() const
bool is_primitive() const
Check if this is a primitive Configuration.
ConfigDoF::const_displacement_t const_displacement_t
ConfigSelection< true > ConstConfigSelection
bool has_relaxed_magmom(const Configuration &_config)
void set_selected(bool _selected)
void set_multiplicity(int m)
Construct a Configuration with occupation specified by string 'con_name'.
A 'cloneable_ptr' can be used in place of 'unique_ptr'.
int get_multiplicity() const
Get symmetric multiplicity (i.e., size of configuration's factor_group)
double reference_energy_per_species(const Configuration &config)
Returns the reference energy, normalized per species.
Eigen::MatrixXd displacement_matrix_t
int & _occ(Index site_l)
Convenience accessors:
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.
Supercell & get_supercell() const
Get the Supercell for this Configuration.
displacement_t disp(Index i)
bool has_displacement() const
std::string calc_status(const Configuration &_config)
Status of calculation.
ReturnArray< double > get_composition() const
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.)
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.
PermuteIterator from_canonical() const
Returns the operation that applied to the the canonical form returns *this.
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
A Configuration represents the values of all degrees of freedom in a Supercell.
bool has_reference_energy(const Configuration &_config)
Returns true if configuration is specified in given selection (default: MASTER)
void init_deformation()
Set applied strain to Eigen::Matrix3d::Zero()
bool has_occupation() const
bool has_calc_status(const Configuration &_config)
double crystallography_tol() const
Get the PrimClex crystallography_tol.