CASM
AClustersApproachtoStatisticalMechanics
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules
Reference.cc
Go to the documentation of this file.
1 #include "casm/clex/Reference.hh"
2 
3 #include "casm/clex/Supercell.hh"
5 
6 namespace CASM {
7 
8  // --- ConstantReference implementations -----------
9 
10  const std::string ConstantReference::Name = "ConstantReference";
11 
12  const std::string ConstantReference::Desc = "Returns a constant scalar.";
13 
14 
15  // --- HyperPlaneReferenceBase implementations -----------
16 
22 
23  auto c_it = m_config_ref.find(config.name());
24  if(c_it != m_config_ref.end()) {
25  return c_it->second;
26  }
27 
28  auto s_it = m_supercell_ref.find(config.get_supercell().get_name());
29  if(s_it != m_supercell_ref.end()) {
30  return s_it->second;
31  }
32 
33  return m_global_ref;
34  }
35 
36 
37  // --- HyperPlaneReference implementations -----------
38 
39  const std::string HyperPlaneReference::Name = "HyperPlaneReference";
40 
41  const std::string HyperPlaneReference::Desc = "Returns a reference value based on the value of a hyperplane.";
42 
43 
44 
45 
46 }
Eigen::VectorXd m_global_ref
Definition: Reference.hh:204
std::string get_name() const
Return supercell name.
Definition: Supercell.cc:123
static const std::string Desc
Definition: Reference.hh:33
Eigen::VectorXd hyperplane(const Configuration &config) const
Return the reference hyperplane used for a particular configuration.
Definition: Reference.cc:21
std::map< std::string, Eigen::VectorXd > m_config_ref
Definition: Reference.hh:200
Main CASM namespace.
Definition: complete.cpp:8
static const std::string Desc
Definition: Reference.hh:221
static const std::string Name
Definition: Reference.hh:32
std::map< std::string, Eigen::VectorXd > m_supercell_ref
Definition: Reference.hh:202
Eigen::VectorXd VectorXd
std::string name() const
SCELV_A_B_C_D_E_F/i.
static const std::string Name
Definition: Reference.hh:220
Supercell & get_supercell() const
Get the Supercell for this Configuration.
A Configuration represents the values of all degrees of freedom in a Supercell.