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 */
54 memset(&r,0,sizeof(t_3dvec));
55 memset(&v,0,sizeof(t_3dvec));
57 /* initialize moldyn */
58 moldyn_init(&md,argc,argv);
60 /* choose integration algorithm */
61 set_int_alg(&md,MOLDYN_INTEGRATE_VERLET);
63 /* choose potential */
64 set_potential1b(&md,tersoff_mult_1bp);
65 set_potential2b(&md,tersoff_mult_2bp);
66 set_potential2b_post(&md,tersoff_mult_post_2bp);
67 set_potential3b(&md,tersoff_mult_3bp);
68 //set_potential2b(&md,lennard_jones);
69 //set_potential2b(&md,harmonic_oscillator);
70 set_potential_params(&md,&tp);
71 //set_potential_params(&md,&lj);
72 //set_potential_params(&md,&ho);
75 set_cutoff(&md,TM_S_SI);
76 //set_cutoff(&md,LC_SI*sqrt(3.0));
77 //set_cutoff(&md,2.0*LC_SI);
80 * potential parameters
84 lj.sigma6=LJ_SIGMA_SI*LJ_SIGMA_SI*LJ_SIGMA_SI;
86 lj.sigma12=lj.sigma6*lj.sigma6;
87 lj.epsilon4=4.0*LJ_EPSILON_SI;
88 lj.uc=lj.epsilon4*(lj.sigma12/pow(md.cutoff,12.0)-lj.sigma6/pow(md.cutoff,6));
90 /* harmonic oscillator */
91 ho.equilibrium_distance=0.25*sqrt(3.0)*LC_SI;
92 //ho.equilibrium_distance=LC_SI;
93 ho.spring_constant=LJ_EPSILON_SI;
96 * tersoff mult potential parameters for SiC
102 tp.lambda[0]=TM_LAMBDA_SI;
104 tp.beta[0]=TM_BETA_SI;
114 tp.lambda[1]=TM_LAMBDA_C;
116 tp.beta[1]=TM_BETA_C;
124 tersoff_mult_complete_params(&tp);
126 /* set (initial) dimensions of simulation volume */
127 set_dim(&md,6*LC_SI,6*LC_SI,6*LC_SI,TRUE);
129 /* set periodic boundary conditions in all directions */
130 set_pbc(&md,TRUE,TRUE,TRUE);
132 /* create the lattice / place atoms */
133 //create_lattice(&md,CUBIC,LC_SI,SI,M_SI,
134 //create_lattice(&md,FCC,LC_SI,SI,M_SI,
135 create_lattice(&md,DIAMOND,LC_SI,SI,M_SI,
136 ATOM_ATTR_1BP|ATOM_ATTR_2BP|ATOM_ATTR_3BP|ATOM_ATTR_HB,
137 // ATOM_ATTR_2BP|ATOM_ATTR_HB,
139 moldyn_bc_check(&md);
141 /* testing configuration */
142 //r.x=0.27*sqrt(3.0)*LC_SI/2.0; v.x=0;
143 //r.x=(TM_S_SI+TM_R_SI)/4.0; v.x=0;
146 //add_atom(&md,SI,M_SI,0,
147 // ATOM_ATTR_1BP|ATOM_ATTR_2BP|ATOM_ATTR_3BP|ATOM_ATTR_HB,
148 // ATOM_ATTR_2BP|ATOM_ATTR_HB,
150 //r.x=-r.x; v.x=-v.x;
153 //add_atom(&md,SI,M_SI,0,
154 // ATOM_ATTR_1BP|ATOM_ATTR_2BP|ATOM_ATTR_3BP|ATOM_ATTR_HB,
155 // ATOM_ATTR_2BP|ATOM_ATTR_HB,
159 //r.z=sin(M_PI*60.0/180.0)*(TM_S_SI+TM_R_SI)/4.0; v.z=0;
160 //add_atom(&md,SI,M_SI,0,
161 // ATOM_ATTR_1BP|ATOM_ATTR_2BP|ATOM_ATTR_3BP|ATOM_ATTR_HB,
162 // ATOM_ATTR_2BP|ATOM_ATTR_HB,
165 /* set temperature & pressure */
166 set_temperature(&md,atof(argv[2])+273.0);
167 set_pressure(&md,ATM);
169 /* set p/t scaling */
170 //set_pt_scale(&md,P_SCALE_BERENDSEN,0.001,
171 // T_SCALE_BERENDSEN,100.0);
172 //set_pt_scale(&md,0,0,T_SCALE_DIRECT,1.0);
173 //set_pt_scale(&md,P_SCALE_BERENDSEN,0.001,0,0);
175 /* initial thermal fluctuations of particles (in equilibrium) */
176 thermal_init(&md,TRUE);
178 /* create the simulation schedule */
179 moldyn_add_schedule(&md,10001,1.0);
180 //moldyn_add_schedule(&md,501,1.0);
181 //moldyn_add_schedule(&md,501,1.0);
183 /* schedule hook function */
184 //moldyn_set_schedule_hook(&md,&hook,NULL);
186 /* activate logging */
187 moldyn_set_log_dir(&md,argv[1]);
188 moldyn_set_report(&md,"Frank Zirkelbach","Test 1");
189 moldyn_set_log(&md,LOG_TOTAL_ENERGY,1);
190 moldyn_set_log(&md,VISUAL_STEP,100);
191 moldyn_set_log(&md,CREATE_REPORT,0);
194 * let's do the actual md algorithm now
196 * integration of newtons equations
198 moldyn_integrate(&md);
201 moldyn_shutdown(&md);