CASM  1.1.0
A Clusters Approach to Statistical Mechanics
DisplacementDoFTraits.cc
Go to the documentation of this file.
2 
6 #include "casm/clex/ClexBasis.hh"
18 
19 namespace CASM {
20 namespace DoF_impl {
22  return new DisplacementDoFTraits(*this);
23 }
24 
28  Structure const &_prim,
29  std::vector<Orbit<PrimPeriodicSymCompare<IntegralCluster> > > &_asym_unit,
30  BasisFunctionSpecs const &_basis_function_specs) const {
31  std::vector<BasisSet> result(_prim.basis().size());
32 
33  // std::cout << "Using " << func_type << " site basis functions." << std::endl
34  // << std::endl;
35 
36  for (Index b = 0; b < _prim.basis().size(); b++) {
37  if (!_prim.basis()[b].has_dof(name())) continue;
38 
39  CASM::DoFSet adapted_dofset =
41  _prim.basis()[b].dof(name()),
42  _prim.site_dof_symrep_IDs()[b].at(name()), b);
43  result[b].set_variable_basis(adapted_dofset);
44  // std::cout << "+:+:+:+Created variable set for site " << b << ", size " <<
45  // result[b].size() << "\n";
46  }
47  return result;
48 }
49 
50 // Apply DoF values for this DoF to _struc
52  BasicStructure const &_reference,
53  SimpleStructure &_struc) const {
54  _struc.mol_info.coords += _dof.local_dof(name()).standard_values();
55  // Any considerations here for Selective Dynamics?
56 }
57 
58 } // namespace DoF_impl
59 
60 namespace DoFType {
63 }
64 } // namespace DoFType
65 
66 } // namespace CASM
LocalContinuousConfigDoFValues const & local_dof(DoFKey const &_key) const
Definition: ConfigDoF.cc:124
DoFType::Traits * _clone() const override
void apply_dof(ConfigDoF const &_dof, BasicStructure const &_reference, SimpleStructure &_struc) const override
Apply DoF values for this DoF to _struc.
std::vector< BasisSet > construct_site_bases(Structure const &_prim, std::vector< Orbit< PrimPeriodicSymCompare< IntegralCluster > > > &_asym_unit, BasisFunctionSpecs const &_basis_function_specs) const override
Construct the site basis (if DOF_MODE is LOCAL) for a DoF, given its site.
Collection of all the traits specific to a DoF type.
Definition: DoFTraits.hh:59
std::string const & name() const
Definition: DoFTraits.hh:69
Eigen::MatrixXd standard_values() const
Get local DoF values as standard DoF values.
An Orbit of Element.
Definition: Orbit.hh:43
Structure specifies the lattice and atomic basis of a crystal.
Definition: Structure.hh:30
std::vector< std::map< DoFKey, SymGroupRepID > > site_dof_symrep_IDs() const
Definition: Structure.cc:132
const std::vector< xtal::Site > & basis() const
Definition: Structure.hh:102
BasicStructure specifies the lattice and atomic basis of a crystal.
Representation of a crystal of molecular and/or atomic occupants, and any additional properties....
DoF_impl::DisplacementDoFTraits displacement()
Main CASM namespace.
Definition: APICommand.hh:8
INDEX_TYPE Index
For long integer indexing:
Definition: definitions.hh:39
Specify how to construct basis functions.
Eigen::MatrixXd coords
(3 x names.size()) matrix of coordinates. coords.col(i) is Cartesian coordinate of site 'i'