runtime schedule adding and injection of c atoms
[physik/posic.git] / posic.c
diff --git a/posic.c b/posic.c
index c185d16..cd1a2e2 100644 (file)
--- a/posic.c
+++ b/posic.c
@@ -18,14 +18,15 @@ int main(int argc,char **argv) {
 
        t_moldyn md;
 
+       t_lj_params lj;
+       t_ho_params ho;
+       t_tersoff_mult_params tp;
+
        int a,b,c;
        double e;
        double help;
        t_3dvec p;
 
-       t_lj_params lj;
-       t_ho_params ho;
-
        /*
         *  moldyn init
         *
@@ -48,7 +49,7 @@ int main(int argc,char **argv) {
        lj.sigma12=lj.sigma6*lj.sigma6;
        lj.epsilon4=4.0*LJ_EPSILON_SI;
        ho.equilibrium_distance=0.25*sqrt(3.0)*LC_SI;
-       ho.spring_constant=1.0;
+       ho.spring_constant=1;
        /* assignement */
        md.potential_force_function=lennard_jones;
        //md.potential_force_function=harmonic_oscillator;
@@ -96,8 +97,8 @@ int main(int argc,char **argv) {
        printf("created silicon lattice (#atoms = %d)\n",md.count);
 #else
        md.count=2;
-       md.atom=malloc(2*sizeof(t_atom));
-       md.atom[0].r.x=0.13*sqrt(3.0)*LC_SI/2.0;
+       md.atom=malloc(md.count*sizeof(t_atom));
+       md.atom[0].r.x=0.23*sqrt(3.0)*LC_SI/2.0;
        md.atom[0].r.y=0;
        md.atom[0].r.z=0;
        md.atom[0].element=SI;
@@ -107,6 +108,18 @@ int main(int argc,char **argv) {
        md.atom[1].r.z=0;
        md.atom[1].element=SI;
        md.atom[1].mass=M_SI;
+
+       //md.atom[2].r.x=0.5*(a-1)*LC_SI;
+       //md.atom[2].r.y=0.5*(b-1)*LC_SI;
+       //md.atom[2].r.z=0;
+       //md.atom[2].element=C;
+       //md.atom[2].mass=M_C;
+
+       //md.atom[3].r.x=0.5*(a-1)*LC_SI;
+       //md.atom[3].r.y=0;
+       //md.atom[3].r.z=0;
+       //md.atom[3].element=SI;
+       //md.atom[3].mass=M_SI;
 #endif
 
        /* initial thermal fluctuations of particles */
@@ -116,6 +129,8 @@ int main(int argc,char **argv) {
        thermal_init(&md);
 #else
        for(a=0;a<md.count;a++) v3_zero(&(md.atom[0].v));
+       md.atom[2].v.x=-320;
+       md.atom[2].v.y=-320;
 #endif
 
        /* check kinetic energy */
@@ -132,9 +147,6 @@ int main(int argc,char **argv) {
        printf("estimated accurate time step: %.30f [s]\n",
               estimate_time_step(&md,3.0,md.t));
 
-       /* initialize linked list / cell method */
-       link_cell_init(&md);
-
        /*
         * let's do the actual md algorithm now
         *