insert mixed atoms feature added (will be renamed an cleand up later)
[physik/posic.git] / moldyn.c
index a4fef49..eb3c4b0 100644 (file)
--- a/moldyn.c
+++ b/moldyn.c
@@ -220,7 +220,7 @@ int set_potential(t_moldyn *moldyn,u8 type) {
                        moldyn->func3b_k1=tersoff_mult_3bp_k1;
                        moldyn->func3b_j2=tersoff_mult_3bp_j2;
                        moldyn->func3b_k2=tersoff_mult_3bp_k2;
-                       // missing: check 2b bond func
+                       moldyn->check_2b_bond=tersoff_mult_check_2b_bond;
                        break;
                case MOLDYN_POTENTIAL_AM:
                        moldyn->func3b_j1=albe_mult_3bp_j1;
@@ -485,6 +485,10 @@ int create_lattice(t_moldyn *moldyn,u8 type,double lc,int element,double mass,
        count=moldyn->count;
 
        /* how many atoms do we expect */
+       if(type==NONE) {
+               new*=1;
+               printf("[moldyn] WARNING: create 'none' lattice called");
+       }
        if(type==CUBIC) new*=1;
        if(type==FCC) new*=4;
        if(type==DIAMOND) new*=8;
@@ -1574,9 +1578,11 @@ int moldyn_integrate(t_moldyn *moldyn) {
                printf("[moldyn] WARNING: cutoff > 0.5 x dim.y\n");
        if(moldyn->cutoff>0.5*moldyn->dim.z)
                printf("[moldyn] WARNING: cutoff > 0.5 x dim.z\n");
-       ds=0.5*atom[0].f.x*moldyn->tau_square/atom[0].mass;
-       if(ds>0.05*moldyn->nnd)
+       if(moldyn->count) {
+               ds=0.5*atom[0].f.x*moldyn->tau_square/atom[0].mass;
+               if(ds>0.05*moldyn->nnd)
                printf("[moldyn] WARNING: forces too high / tau too small!\n");
+       }
 
        /* zero absolute time */
        // should have right values!
@@ -1698,6 +1704,7 @@ printf("\rsched:%d, steps:%d/%d, T:%4.1f/%4.1f P:%4.1f/%4.1f V:%6.1f (%d)",
        sched->count,i,moldyn->total_steps,
        moldyn->t,moldyn->t_avg,
        moldyn->p/BAR,moldyn->p_avg/BAR,
+       //moldyn->p/BAR,(moldyn->p-2.0*moldyn->ekin/(3.0*moldyn->volume))/BAR,
        moldyn->volume,
        (int)(t2.tv_sec-t1.tv_sec));