From 11fafa5d1eefeebd32e0996d2544adc39b16d8d1 Mon Sep 17 00:00:00 2001 From: hackbard Date: Tue, 19 Aug 2008 00:41:47 +0200 Subject: [PATCH] introduced critical max (didn't help though!) --- mdrun.c | 29 ++++++++++++++++++----------- mdrun.h | 3 ++- 2 files changed, 20 insertions(+), 12 deletions(-) diff --git a/mdrun.c b/mdrun.c index 31943ef..1368880 100644 --- a/mdrun.c +++ b/mdrun.c @@ -459,7 +459,8 @@ int mdrun_parse_config(t_mdrun *mdrun) { imp.amount2=atoi(word[5]); imp.brand1=atoi(word[6]); imp.brand2=atoi(word[7]); - imp.cr=atof(word[8]); + imp.crmin=atof(word[8]); + imp.crmax=atof(word[9]); /* do this later ... for(i=0;icr*imp->cr; + cmin=imp->crmin*imp->crmin; + cmax=imp->crmax*imp->crmax; while(imp->amount1|imp->amount2) { if(imp->amount1) { @@ -745,20 +747,22 @@ int insert_mixed_atoms(t_moldyn *moldyn,t_mdrun *mdrun) { v3_sub(&dist,&(atom->r),&r); check_per_bound(moldyn,&dist); d=v3_absolute_square(&dist); - if(dcmax) + retry=1; } add_atom(moldyn,imp->element1,pse_mass[imp->element1], imp->brand1,imp->attr1,&r,&v); printf("%s (mixed) atom inserted (%d): %f %f %f\n", ME,imp->amount1,r.x,r.y,r.z); - printf(" -> d2 = %f/%f\n",dmin,c); + printf(" -> d2 = %f/%f/%f\n",dmin,cmin,cmax); imp->amount1-=1; } if(imp->amount2) { @@ -777,20 +781,22 @@ int insert_mixed_atoms(t_moldyn *moldyn,t_mdrun *mdrun) { v3_sub(&dist,&(atom->r),&r); check_per_bound(moldyn,&dist); d=v3_absolute_square(&dist); - if(dcmax) + retry=1; } add_atom(moldyn,imp->element2,pse_mass[imp->element2], imp->brand2,imp->attr2,&r,&v); printf("%s (mixed) atom inserted (%d): %f %f %f\n", ME,imp->amount2,r.x,r.y,r.z); - printf(" -> d2 = %f/%f\n",dmin,c); + printf(" -> d2 = %f/%f/%f\n",dmin,cmin,cmax); imp->amount2-=1; } } @@ -950,6 +956,7 @@ int mdrun_hook(void *ptr1,void *ptr2) { stage_print(" -> insert mixed atoms\n\n"); imp=stage->params; insert_mixed_atoms(moldyn,mdrun); + change_stage=TRUE; break; diff --git a/mdrun.h b/mdrun.h index b1c2e06..acd2331 100644 --- a/mdrun.h +++ b/mdrun.h @@ -129,7 +129,8 @@ typedef struct s_insert_mixed_atoms_params { u8 brand2; u8 attr1; u8 attr2; - double cr; + double crmin; + double crmax; } t_insert_mixed_atoms_params; #define INS_TOTAL 0x01 -- 2.39.2