first init of new albe implementation (still warnings!)
[physik/posic.git] / potentials / albe.h
1 /*
2  * albe.h - albe potential header file
3  *
4  * author: Frank Zirkelbach <frank.zirkelbach@physik.uni-augsburg.de>
5  *
6  */
7
8 #ifndef ALBE_H
9 #define ALBE_H
10
11 #define ALBE_MAXN       16*27
12
13 /* albe exchange type */
14 typedef struct s_albe_exchange {
15
16         t_3dvec dist[ALBE_MAXN];
17         double d2[ALBE_MAXN];
18         double d[ALBE_MAXN];
19
20         double f_c[ALBE_MAXN];
21         double df_c[ALBE_MAXN];
22
23         double zeta[ALBE_MAXN];
24         t_3dvec dzeta[ALBE_MAXN][ALBE_MAXN];
25
26         u8 skip[ALBE_MAXN];
27
28         double *gamma_[ALBE_MAXN];
29         double *c_[ALBE_MAXN];
30         double *d_[ALBE_MAXN];
31         double c2_[ALBE_MAXN];
32         double d2_[ALBE_MAXN];
33         double c2d2_[ALBE_MAXN];
34         double *h_[ALBE_MAXN];
35
36         double pre_dzeta;
37
38         int jcnt;
39         int j2cnt;
40         int kcnt;
41 } t_albe_exchange;
42
43 /* albe mult (2!) potential parameters */
44 typedef struct s_albe_mult_params {
45         double S[2];            /* albe cutoff radii */
46         double S2[2];           /* albe cutoff radii squared */
47         double R[2];            /* albe cutoff radii */
48         double Smixed;          /* mixed S radius */
49         double S2mixed;         /* mixed S radius squared */
50         double Rmixed;          /* mixed R radius */
51         double A[2];            /* factor of albe attractive part */
52         double B[2];            /* factor of albe repulsive part */
53         double r0[2];           /* r_0 */
54         double Amixed;          /* mixed A factor */
55         double Bmixed;          /* mixed B factor */
56         double r0_mixed;        /* mixed r_0 */
57         double lambda[2];       /* albe lambda */
58         double lambda_m;        /* mixed lambda */
59         double mu[2];           /* albe mu */
60         double mu_m;            /* mixed mu */
61
62         double gamma[2];
63         double gamma_m;
64         double c[2];
65         double c_mixed;
66         double d[2];
67         double d_mixed;
68         double h[2];
69         double h_mixed;
70
71         t_albe_exchange exchange;       /* exchange between 2bp and 3bp calc */
72 } t_albe_mult_params;
73
74 /* function prototypes */
75 int albe_mult_set_params(t_moldyn *moldyn,int element1,int elemnt2);
76 int albe_mult_i0(t_moldyn *moldyn,t_atom *ai);
77 int albe_mult_i0_j0(t_moldyn *moldyn,t_atom *ai,t_atom *aj,u8 bc);
78 int albe_mult_i0_j0_k0(t_moldyn *moldyn,
79                        t_atom *ai,t_atom *aj,t_atom *ak,u8 bc);
80 int albe_mult_i0_j1(t_moldyn *moldyn,t_atom *ai,t_atom *aj,u8 bc);
81 int albe_mult_i0_j2(t_moldyn *moldyn,t_atom *ai,t_atom *aj,u8 bc);
82 int albe_mult_i0_j2_k0(t_moldyn *moldyn,
83                        t_atom *ai,t_atom *aj,t_atom *ak,u8 bc);
84 int albe_mult_i0_j3(t_moldyn *moldyn,t_atom *ai,t_atom *aj,u8 bc);
85 int albe_mult_check_2b_bond(t_moldyn *moldyn,t_atom *itom,t_atom *jtom,u8 bc);
86
87 /* albe potential parameter defines */
88
89 // silicon
90 #define ALBE_R_SI               (2.82-0.14)
91 #define ALBE_S_SI               (2.82+0.14)
92 #define ALBE_A_SI               (3.24*EV/0.842)
93 #define ALBE_B_SI               (-1.842*3.24*EV/0.842)
94 #define ALBE_R0_SI              2.232
95 #define ALBE_LAMBDA_SI          (1.4761*sqrt(2.0*1.842))
96 #define ALBE_MU_SI              (1.4761*sqrt(2.0/1.842))
97 #define ALBE_GAMMA_SI           0.114354
98 #define ALBE_C_SI               2.00494
99 #define ALBE_D_SI               0.81472
100 #define ALBE_H_SI               0.259
101 #define ALBE_LC_SI              5.429
102
103 // carbon
104 #define ALBE_R_C                (2.00-0.15)
105 #define ALBE_S_C                (2.00+0.15)
106 #define ALBE_A_C                (6.00*EV/1.167)
107 #define ALBE_B_C                (-2.167*6.00*EV/1.167)
108 #define ALBE_R0_C               1.4276
109 #define ALBE_LAMBDA_C           (2.0099*sqrt(2.0*2.167))
110 #define ALBE_MU_C               (2.0099*sqrt(2.0/2.167))
111 #define ALBE_GAMMA_C            0.11233
112 #define ALBE_C_C                181.910
113 #define ALBE_D_C                6.28433
114 #define ALBE_H_C                0.5556
115 #define ALBE_LC_C               3.566
116
117 // mixed: silicon carbide
118 #define ALBE_R_SIC              (2.40-0.20)
119 #define ALBE_S_SIC              (2.40+0.20)
120 #define ALBE_A_SIC              (4.36*EV/0.847)
121 #define ALBE_B_SIC              (-1.847*4.36*EV/0.847)
122 #define ALBE_R0_SIC             1.79
123 #define ALBE_LAMBDA_SIC         (1.6991*sqrt(2.0*1.847))
124 #define ALBE_MU_SIC             (1.6991*sqrt(2.0/1.847))
125 #define ALBE_GAMMA_SIC          0.011877
126 #define ALBE_C_SIC              273987
127 #define ALBE_D_SIC              180.314
128 #define ALBE_H_SIC              0.68
129 #define ALBE_LC_SIC             4.359
130
131 #endif