1 #ifndef PARAMCOMPOSITION_HH
2 #define PARAMCOMPOSITION_HH
5 using boost::property_tree::ptree;
53 std::cerr <<
"WARNING in ParamComposition, you have not initialized a PrimClex. Things could go horribly wrong if you dont. I hope you know what you are doing." << std::endl;
72 rank_of_space = _rank_of_space;
73 components = _components;
97 std::ifstream comp_json_file;
98 comp_json_file.open(json_filename.c_str());
100 std::cout <<
"ERROR\n";
103 read(comp_json_file);
142 void print(std::ostream &stream,
bool print_comp_axes_flag =
false)
const {
143 if(print_comp_axes_flag) {
144 stream <<
"/*" << std::endl;
146 stream <<
"*/" << std::endl;
149 write_json(stream, comp_ptree);
153 stream <<
"SUBLATTICE MAP" << std::endl <<
"-------------" << std::endl;
154 stream << sublattice_map << std::endl;
157 stream <<
"Number of end members: " << prim_end_members.rows() << std::endl;
158 stream << components << std::endl <<
"------" << std::endl;
159 stream << prim_end_members << std::endl;
162 stream <<
"Components: " << components << std::endl;
173 stream <<
"components: ";
175 stream <<
"comp[PARAM_COMP] " << comp[
PARAM_COMP] << std::endl;
176 stream <<
"comp[NUMBER_ATOMS] " << comp[
NUMBER_ATOMS] << std::endl;
177 stream <<
"origin: " << origin << std::endl;
182 void read(
const std::string &comp_filename);
183 void read(std::istream &stream);
184 void read(ptree comp_ptree);
188 void max_out(
const int &component_index, Eigen::MatrixXi &sublat_comp)
const;
242 if(rank_of_space <= 0 || components.
size() == 0 || origin.size() != components.
size()) {
245 if(comp.
size() == 2) {
246 return (comp[0].rows() == components.
size() && comp[0].cols() == components.
size() &&
247 comp[1].rows() == components.
size() && comp[1].cols() == components.
size());
ParamComposition calc_composition_object(const Eigen::VectorXd &torigin, const Array< Eigen::VectorXd > tspanning)
Array< ParamComposition > allowed_list
void read(const std::string &comp_filename)
Structure specifies the lattice and atomic basis of a crystal.
Eigen::MatrixXd prim_end_members
void print(std::ostream &stream, bool print_comp_axes_flag=false) const
const Structure * prim_struc
void print_composition_matrices(std::ostream &stream) const
const Array< ParamComposition > & get_allowed_list() const
Array< Eigen::VectorXd > spanning_end_members
std::string get_composition_formula() const
ParamComposition(const Array< std::string > &_components, const Eigen::MatrixXd &transf_mat, const Eigen::VectorXd &_origin, const int &_rank_of_space, const Structure &_prim, const int &COMP_TYPE)
void select_composition_axes(const Index &choice)
void print_member_formula(const Eigen::VectorXd &member, std::ostream &stream, const int &stream_width) const
std::vector< std::pair< std::string, Index > > fixed_components()
void print_composition_axes(std::ostream &stream) const
const int & get_rank_of_space() const
void print_composition_formula(std::ostream &stream, const int &stream_width) const
void calc_spanning_end_members()
Eigen::MatrixXi sublattice_map
Eigen::VectorXd calc_param_composition(const Eigen::VectorXd &num_atoms_per_prim) const
void calc_transformation_matrices()
EigenIndex Index
For long integer indexing:
ptree calc_composition_ptree() const
ParamComposition(const std::string &json_filename, const Structure &_prim)
const Array< Eigen::VectorXd > & get_spanning_end_members() const
Eigen::VectorXd calc(const Eigen::VectorXd &tcomp, const int &MODE)
void generate_composition_space(bool verbose=false)
void generate_prim_end_members()
void print_curr_composition_axes(std::ostream &stream) const
void generate_sublattice_map()
void generate_components()
ParamComposition(ptree comp_ptree, const Structure &_prim)
const int & get_number_of_references() const
void print_sublattice_map(std::ostream &stream) const
void print_origin_formula(std::ostream &stream, const int &stream_width) const
void max_out(const int &component_index, Eigen::MatrixXi &sublat_comp) const
void generate_composition_transf()
const Eigen::VectorXd & get_origin() const
Array< std::string > components
void print_prim_end_members(std::ostream &stream) const
const Structure & get_prim() const
void print_end_member_formula(const int &end_member_index, std::ostream &stream, const int &stream_width) const
Eigen::MatrixXd get_prim_end_members() const
Return all possible end members as row matrix.
const Array< Eigen::MatrixXd > & get_comp() const
ParamComposition(const Structure &_prim)
void print_components(std::ostream &stream) const
Eigen::VectorXd calc_num_atoms(const Eigen::VectorXd ¶m_composition) const
const Array< std::string > & get_components() const
Components are ordered as in Structure::get_struc_molecule.
Array< Eigen::MatrixXd > comp