2 * sic.c - investigation of the sic precipitation process of silicon carbide
4 * author: Frank Zirkelbach <frank.zirkelbach@physik.uni-augsburg.de>
14 int main(int argc,char **argv) {
18 printf("[sic] usage: %s <logdir> <temperatur>\n",argv[0]);
22 /* main moldyn structure */
25 /* potential parameters */
28 t_tersoff_mult_params tp;
33 /* testing location & velocity vector */
37 tau=1.0e-15; /* delta t = 1 fs */
39 /* initialize moldyn */
40 printf("[sic] moldyn init\n");
41 moldyn_init(&md,argc,argv);
43 /* choose integration algorithm */
44 printf("[sic] setting integration algorithm\n");
45 set_int_alg(&md,MOLDYN_INTEGRATE_VERLET);
47 /* choose potential */
48 printf("[sic] selecting potential\n");
49 //set_potential1b(&md,tersoff_mult_1bp,&tp);
50 //set_potential2b(&md,tersoff_mult_2bp,&tp);
51 //set_potential2b_post(&md,tersoff_mult_post_2bp,&tp);
52 //set_potential3b(&md,tersoff_mult_3bp,&tp);
53 set_potential2b(&md,lennard_jones,&lj);
54 //set_potential2b(&md,harmonic_oscillator,&ho);
57 printf("[sic] setting cutoff radius\n");
58 //set_cutoff(&md,TM_S_SI);
59 set_cutoff(&md,3*LC_SI);
62 * potential parameters
66 lj.sigma6=LJ_SIGMA_SI*LJ_SIGMA_SI*LJ_SIGMA_SI;
68 lj.sigma12=lj.sigma6*lj.sigma6;
69 lj.epsilon4=4.0*LJ_EPSILON_SI;
70 lj.uc=lj.epsilon4*(lj.sigma12/pow(md.cutoff,12.0)-lj.sigma6/pow(md.cutoff,6));
72 /* harmonic oscillator */
73 ho.equilibrium_distance=0.25*sqrt(3.0)*LC_SI;
74 ho.spring_constant=.1;
77 * tersoff mult potential parameters for SiC
83 tp.lambda[0]=TM_LAMBDA_SI;
85 tp.beta[0]=TM_BETA_SI;
95 tp.lambda[1]=TM_LAMBDA_C;
105 tersoff_mult_complete_params(&tp);
107 /* set (initial) dimensions of simulation volume */
108 printf("[sic] setting dimensions\n");
109 set_dim(&md,10*LC_SI,10*LC_SI,10*LC_SI,TRUE);
111 /* set periodic boundary conditions in all directions */
112 printf("[sic] setting periodic boundary conditions\n");
113 set_pbc(&md,TRUE,TRUE,TRUE);
115 /* create the lattice / place atoms */
116 printf("[sic] creating atoms\n");
117 create_lattice(&md,DIAMOND,LC_SI,SI,M_SI,
118 // ATOM_ATTR_1BP|ATOM_ATTR_2BP|ATOM_ATTR_3BP|ATOM_ATTR_HB,
119 ATOM_ATTR_2BP|ATOM_ATTR_HB,
121 moldyn_bc_check(&md);
123 /* testing configuration */
124 //r.x=0.28*sqrt(3)*LC_SI/2; v.x=0;
125 //r.x=1.75*LC_SI; v.x=-0.01;
128 //add_atom(&md,SI,M_SI,0,
129 // ATOM_ATTR_1BP|ATOM_ATTR_2BP|ATOM_ATTR_3BP|ATOM_ATTR_HB,
130 // ATOM_ATTR_2BP|ATOM_ATTR_HB,
132 //r.x=-r.x; v.x=-v.x;
135 //add_atom(&md,SI,M_SI,0,
136 // ATOM_ATTR_1BP|ATOM_ATTR_2BP|ATOM_ATTR_3BP|ATOM_ATTR_HB,
137 // ATOM_ATTR_2BP|ATOM_ATTR_HB,
140 /* setting a nearest neighbour distance for the moldyn checks */
141 set_nn_dist(&md,0.25*sqrt(3.0)*LC_SI); /* diamond ! */
143 /* set temperature */
144 printf("[sic] setting temperature -> %f\n",273+atof(argv[2]));
145 //set_temperature(&md,273.0+1410.0);
146 //set_temperature(&md,273.0+450.0);
147 //set_temperature(&md,273.0);
148 //set_temperature(&md,1.0);
149 //set_temperature(&md,0.0);
150 set_temperature(&md,atof(argv[2])+273.0);
153 printf("[sic] setting pressure\n");
154 set_pressure(&md,ATM);
156 /* set p/t scaling */
157 printf("[sic] set p/t scaling\n");
158 //set_pt_scale(&md,P_SCALE_BERENDSEN,100.0,
159 // T_SCALE_BERENDSEN,100.0);
160 //set_pt_scale(&md,0,0,T_SCALE_BERENDSEN,100.0);
161 //set_pt_scale(&md,P_SCALE_BERENDSEN,100.0,0,0);
163 /* initial thermal fluctuations of particles (in equilibrium) */
164 printf("[sic] thermal init\n");
165 thermal_init(&md,TRUE);
167 /* create the simulation schedule */
168 printf("[sic] adding schedule\n");
169 moldyn_add_schedule(&md,10001,1.0);
171 /* activate logging */
172 printf("[sic] activate logging\n");
173 moldyn_set_log_dir(&md,argv[1]);
174 moldyn_set_log(&md,LOG_TOTAL_ENERGY,10);
175 moldyn_set_log(&md,VISUAL_STEP,100);
178 * let's do the actual md algorithm now
180 * integration of newtons equations
183 printf("[sic] integration start, go get a coffee ...\n");
184 moldyn_integrate(&md);
188 printf("[sic] shutdown\n");
189 moldyn_shutdown(&md);