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