2 * sic.c - investigation of the sic precipitation process of silicon carbide
4 * author: Frank Zirkelbach <frank.zirkelbach@physik.uni-augsburg.de>
14 #include "potentials/harmonic_oscillator.h"
15 #include "potentials/lennard_jones.h"
16 #include "potentials/tersoff.h"
18 int hook(void *moldyn,void *hook_params) {
24 /* switch to direct scaling in first hook */
25 if(md->schedule.count==0)
26 set_pt_scale(md,0,0,T_SCALE_BERENDSEN,100.0);
27 /* switch off temp scaling in second hook */
28 if(md->schedule.count==1)
29 set_pt_scale(md,0,0,0,0);
31 //set_temperature(md,md->t_ref-100.0);
36 int main(int argc,char **argv) {
40 printf("[sic] usage: %s <logdir> <temperatur>\n",argv[0]);
44 /* main moldyn structure */
47 /* potential parameters */
50 t_tersoff_mult_params tp;
52 /* testing location & velocity vector */
55 /* initialize moldyn */
56 moldyn_init(&md,argc,argv);
58 /* choose integration algorithm */
59 set_int_alg(&md,MOLDYN_INTEGRATE_VERLET);
61 /* choose potential */
62 //set_potential1b(&md,tersoff_mult_1bp,&tp);
63 //set_potential2b(&md,tersoff_mult_2bp,&tp);
64 //set_potential2b_post(&md,tersoff_mult_post_2bp,&tp);
65 //set_potential3b(&md,tersoff_mult_3bp,&tp);
66 set_potential2b(&md,lennard_jones,&lj);
67 //set_potential2b(&md,harmonic_oscillator,&ho);
70 //set_cutoff(&md,TM_S_SI);
71 //set_cutoff(&md,2*LC_SI*0.5*sqrt(1.5));
72 set_cutoff(&md,2.0*LC_SI);
75 * potential parameters
79 lj.sigma6=LJ_SIGMA_SI*LJ_SIGMA_SI*LJ_SIGMA_SI;
81 lj.sigma12=lj.sigma6*lj.sigma6;
82 lj.epsilon4=4.0*LJ_EPSILON_SI;
83 lj.uc=lj.epsilon4*(lj.sigma12/pow(md.cutoff,12.0)-lj.sigma6/pow(md.cutoff,6));
85 /* harmonic oscillator */
86 //ho.equilibrium_distance=0.25*sqrt(3.0)*LC_SI;
87 ho.equilibrium_distance=LC_SI;
88 ho.spring_constant=LJ_EPSILON_SI;
91 * tersoff mult potential parameters for SiC
97 tp.lambda[0]=TM_LAMBDA_SI;
99 tp.beta[0]=TM_BETA_SI;
109 tp.lambda[1]=TM_LAMBDA_C;
111 tp.beta[1]=TM_BETA_C;
119 tersoff_mult_complete_params(&tp);
121 /* set (initial) dimensions of simulation volume */
122 set_dim(&md,6*LC_SI,6*LC_SI,6*LC_SI,TRUE);
124 /* set periodic boundary conditions in all directions */
125 set_pbc(&md,TRUE,TRUE,TRUE);
127 /* create the lattice / place atoms */
128 //create_lattice(&md,CUBIC,LC_SI,SI,M_SI,
129 create_lattice(&md,FCC,LC_SI,SI,M_SI,
130 //create_lattice(&md,DIAMOND,LC_SI,SI,M_SI,
131 // ATOM_ATTR_1BP|ATOM_ATTR_2BP|ATOM_ATTR_3BP|ATOM_ATTR_HB,
132 ATOM_ATTR_2BP|ATOM_ATTR_HB,
134 moldyn_bc_check(&md);
136 /* testing configuration */
137 //r.x=0.28*sqrt(3)*LC_SI/2; v.x=0;
138 //r.x=1.75*LC_SI; v.x=-0.01;
141 //add_atom(&md,SI,M_SI,0,
142 // ATOM_ATTR_1BP|ATOM_ATTR_2BP|ATOM_ATTR_3BP|ATOM_ATTR_HB,
143 // ATOM_ATTR_2BP|ATOM_ATTR_HB,
145 //r.x=-r.x; v.x=-v.x;
148 //add_atom(&md,SI,M_SI,0,
149 // ATOM_ATTR_1BP|ATOM_ATTR_2BP|ATOM_ATTR_3BP|ATOM_ATTR_HB,
150 // ATOM_ATTR_2BP|ATOM_ATTR_HB,
153 /* set temperature & pressure */
154 set_temperature(&md,atof(argv[2])+273.0);
155 set_pressure(&md,ATM);
157 /* set p/t scaling */
158 //set_pt_scale(&md,P_SCALE_BERENDSEN,0.001,
159 // T_SCALE_BERENDSEN,100.0);
160 //set_pt_scale(&md,0,0,T_SCALE_DIRECT,1.0);
161 //set_pt_scale(&md,P_SCALE_BERENDSEN,0.001,0,0);
163 /* initial thermal fluctuations of particles (in equilibrium) */
164 thermal_init(&md,TRUE);
166 /* create the simulation schedule */
167 moldyn_add_schedule(&md,101,1.0);
168 //moldyn_add_schedule(&md,501,1.0);
169 //moldyn_add_schedule(&md,501,1.0);
171 /* schedule hook function */
172 //moldyn_set_schedule_hook(&md,&hook,NULL);
174 /* activate logging */
175 moldyn_set_log_dir(&md,argv[1]);
176 moldyn_set_report(&md,"Frank Zirkelbach","Test 1");
177 moldyn_set_log(&md,LOG_TOTAL_ENERGY,1);
178 moldyn_set_log(&md,VISUAL_STEP,1);
179 moldyn_set_log(&md,CREATE_REPORT,0);
182 * let's do the actual md algorithm now
184 * integration of newtons equations
186 moldyn_integrate(&md);
189 moldyn_shutdown(&md);