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);
86 printf("[sic] check: there are %d atoms\n",md.count);
87 printf("[sic] check: atoms x pos: %.15f %.15f\n",md.atom[0].r.x,md.atom[1].r.x);
88 printf("[sic] check: atoms x vel: %.15f %.15f\n",md.atom[0].v.x,md.atom[1].v.x);
89 printf("[sic] check: atoms mass: %.35f %.35f\n",md.atom[0].mass,md.atom[1].mass);
92 printf("[sic] setting temperature\n");
93 set_temperature(&md,0.0);
95 /* initial thermal fluctuations of particles */
96 printf("[sic] thermal init\n");
98 printf("[sic] check: there are %d atoms\n",md.count);
99 printf("[sic] check: atoms x pos: %.15f %.15f\n",md.atom[0].r.x,md.atom[1].r.x);
100 printf("[sic] check: atoms x vel: %.15f %.15f\n",md.atom[0].v.x,md.atom[1].v.x);
102 /* create the simulation schedule */
103 printf("[sic] adding schedule\n");
104 moldyn_add_schedule(&md,10000,1.0e-12);
106 /* activate logging */
107 printf("[sic] activate logging\n");
108 moldyn_set_log(&md,LOG_TOTAL_ENERGY,"saves/test-energy",1);
109 moldyn_set_log(&md,VISUAL_STEP,"saves/test-visual",1);
112 * let's do the actual md algorithm now
114 * integration of newtons equations
117 printf("[sic] integration start, go get a coffee ...\n");
118 moldyn_integrate(&md);
122 printf("[sic] shutdown\n");
123 moldyn_shutdown(&md);