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] error: arg1 (vis/log/save location) ");
19 printf("must be given!\n");
23 /* main moldyn structure */
26 /* potential parameters */
29 t_tersoff_mult_params tp;
34 /* testing location & velocity vector */
38 tau=1.0e-15; /* delta t = 1 fs */
40 /* initialize moldyn */
41 printf("[sic] moldyn init\n");
42 moldyn_init(&md,argc,argv);
44 /* choose integration algorithm */
45 printf("[sic] setting integration algorithm\n");
46 set_int_alg(&md,MOLDYN_INTEGRATE_VERLET);
48 /* choose potential */
49 printf("[sic] selecting potential\n");
50 set_potential1b(&md,tersoff_mult_1bp,&tp);
51 set_potential2b(&md,tersoff_mult_2bp,&tp);
52 set_potential2b_post(&md,tersoff_mult_post_2bp,&tp);
53 set_potential3b(&md,tersoff_mult_3bp,&tp);
54 //set_potential2b(&md,lennard_jones,&lj);
57 * potential parameters
61 lj.sigma6=LJ_SIGMA_SI*LJ_SIGMA_SI*LJ_SIGMA_SI;
63 lj.sigma12=lj.sigma6*lj.sigma6;
64 lj.epsilon4=4.0*LJ_EPSILON_SI;
66 /* harmonic oscillator */
67 ho.equilibrium_distance=0.25*sqrt(3.0)*LC_SI;
71 * tersoff mult potential parameters for SiC
77 tp.lambda[0]=TM_LAMBDA_SI;
79 tp.beta[0]=TM_BETA_SI;
89 tp.lambda[1]=TM_LAMBDA_C;
99 tersoff_mult_complete_params(&tp);
102 printf("[sic] setting cutoff radius\n");
103 set_cutoff(&md,TM_S_SI);
104 //set_cutoff(&md,2*LC_SI);
106 /* set (initial) dimensions of simulation volume */
107 printf("[sic] setting dimensions\n");
108 set_dim(&md,5*LC_SI,5*LC_SI,5*LC_SI,TRUE);
110 /* set periodic boundary conditions in all directions */
111 printf("[sic] setting periodic boundary conditions\n");
112 set_pbc(&md,TRUE,TRUE,TRUE);
114 /* create the lattice / place atoms */
115 printf("[sic] creating atoms\n");
116 create_lattice(&md,DIAMOND,LC_SI,SI,M_SI,
117 ATOM_ATTR_1BP|ATOM_ATTR_2BP|ATOM_ATTR_3BP|ATOM_ATTR_HB,
119 moldyn_bc_check(&md);
121 /* testing configuration */
125 //add_atom(&md,SI,M_SI,0,
126 // ATOM_ATTR_1BP|ATOM_ATTR_2BP|ATOM_ATTR_3BP|ATOM_ATTR_HB,
128 //r.x=-2.45/2; v.x=0;
131 //add_atom(&md,SI,M_SI,0,
132 // ATOM_ATTR_1BP|ATOM_ATTR_2BP|ATOM_ATTR_3BP|ATOM_ATTR_HB,
135 /* setting a nearest neighbour distance for the moldyn checks */
136 set_nn_dist(&md,0.25*sqrt(3.0)*LC_SI); /* diamond ! */
138 /* set temperature */
139 printf("[sic] setting temperature\n");
140 //set_temperature(&md,273.0+1410.0);
141 set_temperature(&md,273.0+450.0);
142 //set_temperature(&md,273.0);
143 //set_temperature(&md,1.0);
144 //set_temperature(&md,0.0);
147 printf("[sic] setting pressure\n");
148 set_pressure(&md,ATM);
150 /* set p/t scaling */
151 printf("[sic] set p/t scaling\n");
152 //set_pt_scale(&md,P_SCALE_BERENDSEN,100.0,
153 // T_SCALE_BERENDSEN,100.0);
155 /* initial thermal fluctuations of particles (in equilibrium) */
156 printf("[sic] thermal init\n");
157 thermal_init(&md,TRUE);
159 /* create the simulation schedule */
160 printf("[sic] adding schedule\n");
161 moldyn_add_schedule(&md,30001,1.0);
163 /* activate logging */
164 printf("[sic] activate logging\n");
165 moldyn_set_log_dir(&md,argv[1]);
166 moldyn_set_log(&md,LOG_TOTAL_ENERGY,200);
167 moldyn_set_log(&md,VISUAL_STEP,200);
170 * let's do the actual md algorithm now
172 * integration of newtons equations
175 printf("[sic] integration start, go get a coffee ...\n");
176 moldyn_integrate(&md);
180 printf("[sic] shutdown\n");
181 moldyn_shutdown(&md);