15 namespace clex_SimpleStructureTools_impl {
22 std::vector<DoFKey> which_dofs);
28 std::vector<DoFKey>
const &_which_dofs) {
34 Configuration const &_config, std::vector<DoFKey>
const &_which_dofs,
38 _config.calc_properties(), _which_dofs,
true);
55 for (
Index v = 0; v < _dof.
n_vol(); ++v, ++l) {
65 for (
Index v = 0; v < _dof.
n_vol(); ++v, ++l) {
77 Eigen::MatrixXd::Zero(attr.second.traits().dim(),
81 it->second.col(l) = attr.second.value();
98 std::vector<std::set<Index> > result;
101 result.push_back({});
102 for (
Index l = 0; l < _config.
size(); ++l) {
103 if (_config.
mol(l).
name() == sp) {
104 result.back().insert(l);
113 std::vector<std::set<Index> > result;
116 result.push_back({});
117 for (
Index l = 0; l < _config.
size(); ++l) {
119 result.back().insert(l);
126 namespace clex_SimpleStructureTools_impl {
157 std::set<std::string> &_result)
const;
161 std::set<std::string> &_result)
const;
172 std::vector<DoFKey> which_dofs) {
174 if (which_dofs.empty()) {
176 which_dofs.push_back(dof);
178 which_dofs.push_back(dof);
181 for (
DoFKey const &dof : which_dofs) {
182 if (dof !=
"none" && dof !=
"occ") tformers.insert(dof);
186 tformer.transform(_config, _reference, _sstruc);
191 : m_name(_name), m_traits_ptr(nullptr) {
192 if (
name() !=
"atomize") {
211 std::set<std::string>
const &_queue, std::set<std::string> &_result)
const {
212 for (std::string
const &el : _queue) {
213 if (el !=
name()) _result.insert(el);
220 std::set<std::string>
const &_queue, std::set<std::string> &_result)
const {
221 for (std::string
const &el : _queue) {
222 if (el !=
name()) _result.insert(el);
Specifies traits of (possibly) anisotropic crystal properties.
bool global() const
Returns true if type is global.
Index size() const
Number of sites in the ConfigDoF.
Index n_vol() const
Integer volume of ConfigDoF.
Index n_sublat() const
Number of sublattices in ConfigDoF.
GlobalContinuousConfigDoFValues const & global_dof(DoFKey const &_key) const
Eigen::VectorXi const & occupation() const
Const reference occupation values.
int & occ(Index i)
Reference occupation value on site i.
LocalContinuousConfigDoFValues const & local_dof(DoFKey const &_key) const
const ConfigDoF & configdof() const
const Access the DoF
const Molecule & mol(Index site_l) const
Molecule on site l.
const Supercell & supercell() const
Get the Supercell for this Configuration.
Index size() const
Returns number of sites, NOT the number of primitives that fit in here.
Collection of all the traits specific to a DoF type.
AnisoValTraits const & val_traits() const
virtual void apply_dof(ConfigDoF const &_dof, BasicStructure const &_reference, SimpleStructure &_struc) const
Transforms SimpleSructure.
std::string const & name() const
Eigen::MatrixXd standard_values() const
Get global DoF values as standard DoF values.
Eigen::MatrixXd standard_values() const
Get local DoF values as standard DoF values.
const std::vector< xtal::Site > & basis() const
Represents a supercell of the primitive parent crystal structure.
Coordinate coord(Index linear_index) const
Return the linear index corresponding to integral coordinates.
const Lattice & lattice() const
The super lattice.
const Structure & prim() const
BasicStructure specifies the lattice and atomic basis of a crystal.
const vector_type & const_cart() const
user override to force const Access the Cartesian coordinate vector
const Eigen::Matrix3d & lat_column_mat() const
3x3 matrix with lattice vectors as its columne
Class representing a Molecule.
Representation of a crystal of molecular and/or atomic occupants, and any additional properties....
std::map< std::string, Eigen::MatrixXd > properties
Eigen::Matrix3d lat_column_mat
std::string const & name() const
Designated name of Molecule (may be unrelated to constituent species)
bool contains(std::string const &atom_name) const
Returns true of molecule contains atom of specified name.
std::map< std::string, SpeciesAttribute > const & attributes() const
Returns dictionary of all constituent attributes of the Molecule Does not include attributes associat...
std::vector< DoFKey > continuous_local_dof_types(BasicStructure const &_struc)
std::vector< DoFKey > global_dof_types(BasicStructure const &_struc)
Traits const & traits(std::string const &dof_key)
Lookup DoFType::Traits in the global dictionary.
void _atomize(SimpleStructure &_sstruc, Eigen::Ref< const Eigen::VectorXi > const &_mol_occ, BasicStructure const &_reference)
use information in _reference to initialize atom_info from mol_info
std::vector< std::set< Index > > atom_site_compatibility(xtal::SimpleStructure const &sstruc, Configuration const &_config)
Determine which sites of a Configuration can host each atom of a SimpleStructure result[i] is set of ...
std::vector< std::set< Index > > mol_site_compatibility(xtal::SimpleStructure const &sstruc, Configuration const &_config)
Determine which sites of a Configuration can host each molecule of a SimpleStructure result[i] is set...
xtal::SimpleStructure make_simple_structure(Supercell const &_scel, ConfigDoF const &_dof, std::vector< DoFKey > const &_which_dofs={})
Construct from ConfigDoF _dof belonging to provided Supercell _scel.
bool is_calculated(const ConfigType &config, std::string calctype="")
Return true if all required properties have been been calculated for the configuration.
INDEX_TYPE Index
For long integer indexing:
std::map< std::string, Eigen::MatrixXd > site
std::map< std::string, Eigen::MatrixXd > global
Eigen::MatrixXd coords
(3 x names.size()) matrix of coordinates. coords.col(i) is Cartesian coordinate of site 'i'
std::vector< std::string > names
names[i] is name of species that occupies sites 'i'
Coord cart_coord(Index i)
Access coordinate of site 'i'.
std::map< std::string, Eigen::MatrixXd > properties
map of [property name, (m x names.size()) matrix] for all numerical site properties properties are as...
void resize(Index N)
Resize to hold N sites. All coordinates set to zero, all occupants set to "Va".