CASM  1.1.0
A Clusters Approach to Statistical Mechanics
Reference.cc
Go to the documentation of this file.
1 #include "casm/clex/Reference.hh"
2 
4 #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 // --- HyperPlaneReferenceBase implementations -----------
15 
21  const Configuration &config) const {
22  auto c_it = m_config_ref.find(config.name());
23  if (c_it != m_config_ref.end()) {
24  return c_it->second;
25  }
26 
27  auto s_it = m_supercell_ref.find(config.supercell().name());
28  if (s_it != m_supercell_ref.end()) {
29  return s_it->second;
30  }
31 
32  return m_global_ref;
33 }
34 
35 // --- HyperPlaneReference implementations -----------
36 
37 const std::string HyperPlaneReference::Name = "HyperPlaneReference";
38 
39 const std::string HyperPlaneReference::Desc =
40  "Returns a reference value based on the value of a hyperplane.";
41 
42 } // namespace CASM
static const std::string Desc
Definition: Reference.hh:31
static const std::string Name
Definition: Reference.hh:30
Eigen::VectorXd m_global_ref
Definition: Reference.hh:186
Eigen::VectorXd hyperplane(const Configuration &config) const
Return the reference hyperplane used for a particular configuration.
Definition: Reference.cc:20
std::map< std::string, Eigen::VectorXd > m_config_ref
Definition: Reference.hh:182
std::map< std::string, Eigen::VectorXd > m_supercell_ref
Definition: Reference.hh:184
const std::map< std::string, Eigen::VectorXd > & config() const
const Access a map of configname to reference for Configuration specialized references
Definition: Reference.hh:126
static const std::string Name
Definition: Reference.hh:200
static const std::string Desc
Definition: Reference.hh:201
ConfigIO::GenericConfigFormatter< jsonParser > config()
Definition: ConfigIO.cc:777
Main CASM namespace.
Definition: APICommand.hh:8
Eigen::VectorXd VectorXd