X-Git-Url: https://hackdaworld.org/gitweb/?a=blobdiff_plain;f=potentials%2Falbe.c;h=02c254fd745aa863ea3a0cb843c086de0fcddc5e;hb=3b28604c5a5c39b3041771891e4eed1999043341;hp=ddfb3c6c707de47598d4f428f51167158cb7ff1f;hpb=4c2140b0f76fb191bdd9b9c2a329877eb0aae531;p=physik%2Fposic.git diff --git a/potentials/albe.c b/potentials/albe.c index ddfb3c6..02c254f 100644 --- a/potentials/albe.c +++ b/potentials/albe.c @@ -24,6 +24,12 @@ int albe_mult_set_params(t_moldyn *moldyn,int element1,int element2) { t_albe_mult_params *p; + // set cutoff before parameters (actually only necessary for some pots) + if(moldyn->cutoff==0.0) { + printf("[albe] WARNING: no cutoff!\n"); + return -1; + } + /* alloc mem for potential parameters */ moldyn->pot_params=malloc(sizeof(t_albe_mult_params)); if(moldyn->pot_params==NULL) { @@ -349,7 +355,7 @@ int albe_mult_3bp_j2(t_moldyn *moldyn,t_atom *ai,t_atom *aj,u8 bc) { v3_add(&(aj->f),&(aj->f),&force); /* virial */ - virial_calc(aj,&force,&(exchange->dist_ij)); + virial_calc(ai,&force,&(exchange->dist_ij)); #ifdef DEBUG if(moldyn->time>DSTART&&moldyn->timetime>DSTART&&moldyn->timef),&(ai->f),&force); - /* virial */ - virial_calc(ai,&force,&dist_ij); - /* derivative wrt k */ v3_scale(&force,&dist_ik,-1.0*dfcg); // dri rik = - drk rik v3_scale(&tmp,&dcosdrk,fcdg); @@ -501,13 +507,13 @@ if(moldyn->time>DSTART&&moldyn->timef),&(ai->f),&force); - /* virial */ - virial_calc(ai,&force,&dist_ik); - /* increase k counter */ exchange->kcount++;