fixed (dank rolf)
[physik/posic.git] / posic.c
diff --git a/posic.c b/posic.c
index 2b18c79..c185d16 100644 (file)
--- a/posic.c
+++ b/posic.c
@@ -34,7 +34,8 @@ int main(int argc,char **argv) {
         * - random init
         *
         */
-       moldyn_init(&md,argc,argv);
+       a=moldyn_init(&md,argc,argv);
+       if(a<0) return a;
 
        /*
         * the following overrides possibly set interaction methods by argv !!
@@ -95,17 +96,17 @@ int main(int argc,char **argv) {
        printf("created silicon lattice (#atoms = %d)\n",md.count);
 #else
        md.count=2;
-       moldyn->atom=malloc(2*sizeof(t_atom));
-       moldyn->atom[0].r.x=0.13*sqrt(3.0)*LC_SI/2.0;
-       moldyn->atom[0].r.y=0;
-       moldyn->atom[0].r.z=0;
-       moldyn->atom[0].element=SI;
-       moldyn->atom[0].mass=M_SI;
-       moldyn->atom[1].r.x=-si[0].r.x;
-       moldyn->atom[1].r.y=0;
-       moldyn->atom[1].r.z=0;
-       moldyn->atom[1].element=SI;
-       moldyn->atom[1].mass=M_SI;
+       md.atom=malloc(2*sizeof(t_atom));
+       md.atom[0].r.x=0.13*sqrt(3.0)*LC_SI/2.0;
+       md.atom[0].r.y=0;
+       md.atom[0].r.z=0;
+       md.atom[0].element=SI;
+       md.atom[0].mass=M_SI;
+       md.atom[1].r.x=-md.atom[0].r.x;
+       md.atom[1].r.y=0;
+       md.atom[1].r.z=0;
+       md.atom[1].element=SI;
+       md.atom[1].mass=M_SI;
 #endif
 
        /* initial thermal fluctuations of particles */
@@ -114,7 +115,7 @@ int main(int argc,char **argv) {
        printf("setting thermal fluctuations (T=%f K)\n",md.t);
        thermal_init(&md);
 #else
-       for(a=0;a<md.count;a++) v3_zero(&(si[0].v));
+       for(a=0;a<md.count;a++) v3_zero(&(md.atom[0].v));
 #endif
 
        /* check kinetic energy */
@@ -132,7 +133,6 @@ int main(int argc,char **argv) {
               estimate_time_step(&md,3.0,md.t));
 
        /* initialize linked list / cell method */
-       printf("initializing linked cells\n");
        link_cell_init(&md);
 
        /*