X-Git-Url: https://hackdaworld.org/gitweb/?a=blobdiff_plain;f=potentials%2Ftersoff.c;h=d322b69af72f083af2b6a891b4e92091f73bf208;hb=155e1cfea83209d09c2a06ae4fb7f5e1652fc00a;hp=b83bfd60bd871be79ddf3a06cd48966e67cd0ccc;hpb=4c2140b0f76fb191bdd9b9c2a329877eb0aae531;p=physik%2Fposic.git diff --git a/potentials/tersoff.c b/potentials/tersoff.c index b83bfd6..d322b69 100644 --- a/potentials/tersoff.c +++ b/potentials/tersoff.c @@ -24,6 +24,12 @@ int tersoff_mult_set_params(t_moldyn *moldyn,int element1,int element2) { t_tersoff_mult_params *p; + // set cutoff before parameters (actually only necessary for some pots) + if(moldyn->cutoff==0.0) { + printf("[tersoff] WARNING: no cutoff!\n"); + return -1; + } + /* alloc mem for potential parameters */ moldyn->pot_params=malloc(sizeof(t_tersoff_mult_params)); if(moldyn->pot_params==NULL) {