1 #ifndef CASM_ChemicalReference
2 #define CASM_ChemicalReference
11 using xtal::BasicStructure;
45 static const std::string
Name;
46 static const std::string
Desc;
56 template <
typename RefStateIterator>
58 RefStateIterator end,
double tol);
61 std::unique_ptr<ChemicalReference>
clone()
const;
76 template <
typename RefStateIterator>
77 void set_global(RefStateIterator begin, RefStateIterator end,
double tol);
88 const std::map<std::string, Eigen::VectorXd> &
supercell()
const;
94 template <
typename RefStateIterator>
96 RefStateIterator end,
double tol);
110 const std::map<std::string, Eigen::VectorXd> &
config()
const;
116 template <
typename RefStateIterator>
118 RefStateIterator end,
double tol);
129 template <
typename RefStateIterator>
131 RefStateIterator begin,
132 RefStateIterator end,
double tol);
142 std::map<std::string, Eigen::VectorXd> &
_supercell();
147 std::map<std::string, Eigen::VectorXd> &
_config();
180 int _indent = 0,
int _indent_incr = 2);
194 void print(
const std::string &str);
204 void print(
const std::vector<ChemicalReferenceState> &ref_state_vec);
211 void print(
const std::pair<std::string, Eigen::VectorXd> &_pair);
218 void print(
const std::pair<std::string, std::vector<ChemicalReferenceState> >
const std::map< std::string, Eigen::VectorXd > & supercell() const
const Access a map of scelname to reference for Supercell specialized references
size_type erase_supercell(const std::string &scelname)
Erase hyperplane reference specialized for a Supercell.
std::map< std::string, Eigen::VectorXd > & _supercell()
const Access a map of scelname to reference for Supercell specialized references
const BasicStructure * m_prim
static Eigen::VectorXd _calc_hyperplane(const BasicStructure &prim, const std::vector< std::string > &struc_mol_name, Eigen::MatrixXd N, Eigen::VectorXd E, double tol)
Convert a set of ChemicalReferenceState to a hyperplane, including checks.
std::vector< ChemicalReferenceState > RefStateVec
void set_config(const std::string &configname, const Eigen::VectorXd &ref)
Set hyperplane reference specialized for a Configuration.
const RefStateVec & global_ref_states() const
const Access a map of configname to RefStateVec for Supercell specialized references
void set_global(const Eigen::VectorXd &ref)
Set global hyperplane reference.
const RefStateMap & config_ref_states() const
const Access a map of configname to RefStateVec for Configuration specialized references
RefStateMap m_supercell_ref_map
RefStateVec m_global_ref_vec
static const std::string Desc
RefStateMap m_config_ref_map
const std::map< std::string, Eigen::VectorXd > & config() const
const Access a map of configname to reference for Configuration specialized references
static Eigen::VectorXd hyperplane(const BasicStructure &prim, RefStateIterator begin, RefStateIterator end, double tol)
Convert a set of ChemicalReferenceState to a hyperplane, including checks.
size_type erase_config(const std::string &configname)
Erase hyperplane reference specialized for a Configuration.
void set_supercell(const std::string &scelname, const Eigen::VectorXd &ref)
Set hyperplane reference specialized for a Supercell.
const Eigen::VectorXd & global() const
const Access the global reference
std::map< std::string, Eigen::VectorXd > & _config()
const Access a map of configname to reference for Configuration specialized references
std::unique_ptr< ChemicalReference > clone() const
Clone.
ChemicalReference(const BasicStructure &prim, const Eigen::VectorXd &_global_ref, SpecializedRef _supercell_ref=SpecializedRef(), SpecializedRef _config_ref=SpecializedRef())
Constructor.
const RefStateMap & supercell_ref_states() const
const Access a map of configname to RefStateVec for Supercell specialized references
ChemicalReference * _clone() const
Clone.
const BasicStructure & prim() const
Get primitive BasicStructure.
static const std::string Name
std::map< std::string, RefStateVec > RefStateMap
Eigen::VectorXd & _global()
Access the global reference.
Maps a Configuration to a scalar value via a hyperplane.
std::map< std::string, Eigen::VectorXd > SpecializedRef
PrimClex is the top-level data structure for a CASM project.
BasicStructure specifies the lattice and atomic basis of a crystal.
std::string scelname(const Structure &prim, const Lattice &superlat)
Make supercell name name [deprecated].
ConfigIO::GenericConfigFormatter< jsonParser > config()
ConfigIO::GenericConfigFormatter< std::string > configname()
Constructs DataFormmaterDictionary containing all Configuration DatumFormatters.
ChemicalReference auto_chemical_reference(const PrimClex &primclex, double lin_alg_tol)
Automatically set ChemicalReference using calculated Configurations with 'extreme' compositions.
GenericDatumFormatter< std::string, DataObject > name()
INDEX_TYPE Index
For long integer indexing:
BasicStructure to help print ChemicalReference.
std::vector< std::string > struc_mol_name
void print(const std::string &str)
ChemicalReferencePrinter(std::ostream &_stream, const ChemicalReference &_ref, int _indent=0, int _indent_incr=2)
const ChemicalReference & ref
Stores the composition and energy in a single reference state.
std::map< std::string, double > species_num
Map of Molecule name : number of each species in reference state.
double energy_per_species
Energy in this reference state.