2 * sic.c - investigation of the sic precipitation process of silicon carbide
4 * author: Frank Zirkelbach <frank.zirkelbach@physik.uni-augsburg.de>
11 #include "math/math.h"
12 #include "init/init.h"
13 #include "visual/visual.h"
20 int main(int argc,char **argv) {
22 /* main moldyn structure */
25 /* potential parameters */
28 t_tersoff_mult_params tp;
30 /* misc variables, mainly to initialize stuff */
36 /* initialize moldyn */
37 printf("[sic] moldyn init\n");
38 moldyn_init(&md,argc,argv);
40 /* choose integration algorithm */
41 printf("[sic] setting integration algorithm\n");
42 set_int_alg(&md,MOLDYN_INTEGRATE_VERLET);
44 /* choose potential */
45 printf("[sic] selecting potential\n");
46 //set_potential1b(&md,tersoff_mult_1bp,&tp);
47 //set_potential2b(&md,tersoff_mult_2bp,&tp);
48 //set_potential3b(&md,tersoff_mult_3bp,&tp);
49 set_potential2b(&md,lennard_jones,&lj);
52 * potential parameters
56 lj.sigma6=LJ_SIGMA_SI*LJ_SIGMA_SI*LJ_SIGMA_SI;
58 lj.sigma12=lj.sigma6*lj.sigma6;
59 lj.epsilon4=4.0*LJ_EPSILON_SI;
61 /* harmonic oscillator */
62 ho.equilibrium_distance=0.25*sqrt(3.0)*LC_SI;
66 printf("[sic] setting cutoff radius\n");
67 set_cutoff(&md,LC_SI);
69 /* set (initial) dimensions of simulation volume */
70 printf("[sic] setting dimensions\n");
71 set_dim(&md,10*LC_SI,10*LC_SI,10*LC_SI,TRUE);
73 /* set periodic boundary conditions in all directions */
74 printf("[sic] setting periodic boundary conditions\n");
75 set_pbc(&md,TRUE,TRUE,TRUE);
77 /* create the lattice / place atoms */
78 printf("[sic] creating atoms\n");
79 memset(&v,0,sizeof(t_3dvec));
82 r.x=0.23*sqrt(3.0)*LC_SI/2.0;
83 add_atom(&md,SI,M_SI,0,ATOM_ATTR_2BP,&r,&v);
85 add_atom(&md,SI,M_SI,0,ATOM_ATTR_2BP,&r,&v);
88 printf("[sic] setting temperature\n");
89 set_temperature(&md,0.0);
91 /* initial thermal fluctuations of particles */
92 printf("[sic] thermal init\n");
95 /* create the simulation schedule */
96 printf("[sic] adding schedule\n");
97 moldyn_add_schedule(&md,10000,1.0e-12);
99 /* activate logging */
100 printf("[sic] activate logging\n");
101 moldyn_set_log(&md,LOG_TOTAL_ENERGY,"saves/test-energy",100);
102 moldyn_set_log(&md,VISUAL_STEP,"saves/test-visual",100);
105 * let's do the actual md algorithm now
107 * integration of newtons equations
110 printf("[sic] integration start, go get a coffee ...\n");
111 moldyn_integrate(&md);
115 printf("[sic] shutdown\n");
116 moldyn_shutdown(&md);