2 * sic.c - investigation of the sic precipitation process of silicon carbide
4 * author: Frank Zirkelbach <frank.zirkelbach@physik.uni-augsburg.de>
14 int hook(void *moldyn,void *hook_params) {
20 /* switch to direct scaling in first hook */
21 if(md->schedule.count==0)
22 set_pt_scale(md,0,0,T_SCALE_BERENDSEN,100.0);
23 /* switch off temp scaling in second hook */
24 if(md->schedule.count==1)
25 set_pt_scale(md,0,0,0,0);
27 //set_temperature(md,md->t_ref-100.0);
32 int main(int argc,char **argv) {
36 printf("[sic] usage: %s <logdir> <temperatur>\n",argv[0]);
40 /* main moldyn structure */
43 /* potential parameters */
46 t_tersoff_mult_params tp;
48 /* testing location & velocity vector */
51 /* initialize moldyn */
52 moldyn_init(&md,argc,argv);
54 /* choose integration algorithm */
55 set_int_alg(&md,MOLDYN_INTEGRATE_VERLET);
57 /* choose potential */
58 //set_potential1b(&md,tersoff_mult_1bp,&tp);
59 //set_potential2b(&md,tersoff_mult_2bp,&tp);
60 //set_potential2b_post(&md,tersoff_mult_post_2bp,&tp);
61 //set_potential3b(&md,tersoff_mult_3bp,&tp);
62 set_potential2b(&md,lennard_jones,&lj);
63 //set_potential2b(&md,harmonic_oscillator,&ho);
66 //set_cutoff(&md,TM_S_SI);
67 //set_cutoff(&md,2*LC_SI*0.5*sqrt(1.5));
68 set_cutoff(&md,2.0*LC_SI);
71 * potential parameters
75 lj.sigma6=LJ_SIGMA_SI*LJ_SIGMA_SI*LJ_SIGMA_SI;
77 lj.sigma12=lj.sigma6*lj.sigma6;
78 lj.epsilon4=4.0*LJ_EPSILON_SI;
79 lj.uc=lj.epsilon4*(lj.sigma12/pow(md.cutoff,12.0)-lj.sigma6/pow(md.cutoff,6));
81 /* harmonic oscillator */
82 //ho.equilibrium_distance=0.25*sqrt(3.0)*LC_SI;
83 ho.equilibrium_distance=LC_SI;
84 ho.spring_constant=LJ_EPSILON_SI;
87 * tersoff mult potential parameters for SiC
93 tp.lambda[0]=TM_LAMBDA_SI;
95 tp.beta[0]=TM_BETA_SI;
105 tp.lambda[1]=TM_LAMBDA_C;
107 tp.beta[1]=TM_BETA_C;
115 tersoff_mult_complete_params(&tp);
117 /* set (initial) dimensions of simulation volume */
118 set_dim(&md,6*LC_SI,6*LC_SI,6*LC_SI,TRUE);
120 /* set periodic boundary conditions in all directions */
121 set_pbc(&md,TRUE,TRUE,TRUE);
123 /* create the lattice / place atoms */
124 create_lattice(&md,CUBIC,LC_SI,SI,M_SI,
125 //create_lattice(&md,FCC,LC_SI,SI,M_SI,
126 //create_lattice(&md,DIAMOND,LC_SI,SI,M_SI,
127 // ATOM_ATTR_1BP|ATOM_ATTR_2BP|ATOM_ATTR_3BP|ATOM_ATTR_HB,
128 ATOM_ATTR_2BP|ATOM_ATTR_HB,
130 moldyn_bc_check(&md);
132 /* testing configuration */
133 //r.x=0.28*sqrt(3)*LC_SI/2; v.x=0;
134 //r.x=1.75*LC_SI; v.x=-0.01;
137 //add_atom(&md,SI,M_SI,0,
138 // ATOM_ATTR_1BP|ATOM_ATTR_2BP|ATOM_ATTR_3BP|ATOM_ATTR_HB,
139 // ATOM_ATTR_2BP|ATOM_ATTR_HB,
141 //r.x=-r.x; v.x=-v.x;
144 //add_atom(&md,SI,M_SI,0,
145 // ATOM_ATTR_1BP|ATOM_ATTR_2BP|ATOM_ATTR_3BP|ATOM_ATTR_HB,
146 // ATOM_ATTR_2BP|ATOM_ATTR_HB,
149 /* setting a nearest neighbour distance for the moldyn checks */
150 //set_nn_dist(&md,0.25*sqrt(3.0)*LC_SI); /* diamond ! */
151 set_nn_dist(&md,LC_SI);
153 /* set temperature */
154 //set_temperature(&md,273.0+1410.0);
155 //set_temperature(&md,273.0+450.0);
156 //set_temperature(&md,273.0);
157 //set_temperature(&md,1.0);
158 //set_temperature(&md,0.0);
159 set_temperature(&md,atof(argv[2])+273.0);
162 set_pressure(&md,ATM);
164 /* set p/t scaling */
165 //set_pt_scale(&md,P_SCALE_BERENDSEN,100.0,
166 // T_SCALE_BERENDSEN,100.0);
167 //set_pt_scale(&md,0,0,T_SCALE_DIRECT,1.0);
168 //set_pt_scale(&md,P_SCALE_BERENDSEN,100.0,0,0);
170 /* initial thermal fluctuations of particles (in equilibrium) */
171 thermal_init(&md,TRUE);
173 /* create the simulation schedule */
174 moldyn_add_schedule(&md,100001,1.0);
175 //moldyn_add_schedule(&md,501,1.0);
176 //moldyn_add_schedule(&md,501,1.0);
178 /* schedule hook function */
179 //moldyn_set_schedule_hook(&md,&hook,NULL);
181 /* activate logging */
182 moldyn_set_log_dir(&md,argv[1]);
183 moldyn_set_report(&md,"Frank Zirkelbach","Test 1");
184 moldyn_set_log(&md,LOG_TOTAL_ENERGY,1);
185 moldyn_set_log(&md,VISUAL_STEP,1000);
186 moldyn_set_log(&md,CREATE_REPORT,0);
189 * let's do the actual md algorithm now
191 * integration of newtons equations
193 moldyn_integrate(&md);
196 moldyn_shutdown(&md);