CASM
AClustersApproachtoStatisticalMechanics
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules
Clexulator_Draft.hh
Go to the documentation of this file.
1 #ifndef MYCLEX1_CLEXULATOR_HH
2 #define MYCLEX1_CLEXULATOR_HH
3 
4 
5 namespace CASM {
6  class Configuration;
7  // PROJECTNAME: MYCLEX1
8 
9  namespace MYCLEX1 {
10 
11  /**** PRIM ***
12  cubic ZrH2
13  4.821393
14  0.000 0.500 0.500
15  0.500 0.000 0.500
16  0.500 0.500 0.000
17  Zr H
18  1 2
19  Selective Dynamics
20  Direct
21  0.0000000000000000 0.0000000000000000 0.0000000000000000 Zr Ni Ti
22  0.2500000000000000 0.2500000000000000 0.2500000000000000 H Va
23  0.7500000000000000 0.7500000000000000 0.7500000000000000 H Va
24  **/
25 
26  class Clexulator {
27  private:
28  // number of sites in the supercell, and number of sites in the neighborhood
29  int m_site_N, m_nlist_N;
30 
31  // Pointer to memory block that holds current nlist
32  const int *m_nlist_ptr;
33 
34  // Define const lookup table for discrete variables.
35  // they get initialized in constructor
36  // occfunc_B_M -> B is basis index and M is basis function index
37  const double[3] m_occfunc_0_0, m_occfunc_0_1;
38  const double[2] m_occfunc_1_0;
39  const double[2] m_occfunc_2_0;
40 
41  // Pointer to memory block that hold occupation DoF values
42  const int *m_occ_ptr;
43 
44  // Pointers to memory blocks that hold occupation DoF values
45  const double *m_xdisp_ptr;
46  const double *m_ydisp_ptr;
47  const double *m_zdisp_ptr;
48 
49  // Pointer to memory block that holds cluster variables
50  // These should probably get calculated externally in a separate Clexulator
51  const double *m_c_var_ptr;
52 
53  public:
54  int nlist_size() const {
55  return m_nlist_N;
56  };
57  int supercell_size() const {
58  return m_site_N;
59  };
60  void set_supercell_size(int _site_N) {
61  m_site_N = _site_N
62  };
63 
64  // populate internal nlist pointer for
65  void set_nlist(const int *_nlist_ptr) const;
66 
67  void calc_point_corr(double *corr_out);
68 
69  void set_occ(const int *_occ_ptr) const;
70  void set_xdisp(const double *_occ_ptr) const;
71  void set_ydisp(const double *_occ_ptr) const;
72  void set_zdisp(const double *_occ_ptr) const;
73  void set_cvar(const int *_occ_ptr) const;
74 
75 
76 
77  double eval_0_bfunc_2_4_0_0();
78  double eval_0_bfunc_2_4_0_1();
79  double eval_0_bfunc_2_4_0_2();
80  double eval_0_bfunc_2_4_0_3();
81 
82  double eval_0_docc_func_0_0_bfunc_2_4_0_3();
83  double eval_0_docc_func_0_1_bfunc_2_4_0_3();
84 
85  };
86 
87  const double ClexClust::sitefunc_0_0 = { -1.0, 0.0, 1.0};
88  const double ClexClust::sitefunc_0_1 = {1.0, 0.0, 1.0};
89  const double ClexClust::sitefunc_1_0 = { -1.0, 1.0};
90  const double ClexClust::sitefunc_2_0 = { -1.0, 1.0};
91 
92 
104  // ClustClust_W_X_Y -> W is number of sites, X is linear orbit index, Y is equiv index
105  class ClexClust_3_5_0 : public ClexClust {
106  private:
107  int[3] nlist_ind;
108  int[3] b_ind;
109  double[6] clustvar1;
110  public:
111  void preprocess(Configuration &config, int site_ind);
112  double eval(Configuration &config, int site_ind);
113  double dp1_1_eval(Configuration &config, int site_ind);
114  double dp1_1_eval(Configuration &config, int site_ind);
115  double dp1_1_eval(Configuration &config, int site_ind);
116 
117  }
118 #endif
Main CASM namespace.
Definition: complete.cpp:8