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;i<strlen(word[8]);i++) {
switch(word[8][i]) {
}
}
*/
- imp.attr1=ATOM_ATTR_HB|ATOM_ATTR_VA|ATOM_ATTR_1BP|ATOM_ATTR_2BP|ATOM_ATTR_3BP;
- imp.attr2=ATOM_ATTR_HB|ATOM_ATTR_VA|ATOM_ATTR_1BP|ATOM_ATTR_2BP|ATOM_ATTR_3BP;
+ imp.attr1=ATOM_ATTR_HB|ATOM_ATTR_VA|ATOM_ATTR_1BP|ATOM_ATTR_2BP|ATOM_ATTR_3BP|ATOM_ATTR_FP;
+ imp.attr2=ATOM_ATTR_HB|ATOM_ATTR_VA|ATOM_ATTR_1BP|ATOM_ATTR_2BP|ATOM_ATTR_3BP|ATOM_ATTR_FP;
add_stage(mdrun,STAGE_INSERT_MIXED_ATOMS,&imp);
}
t_insert_mixed_atoms_params *imp;
t_atom *atom;
double x,x0,y,y0,z,z0;
- double dmin,d,c;
+ double dmin,d,cmin,cmax;
u8 retry;
t_3dvec r,v,dist;
int i;
v.y=0.0;
v.z=0.0;
- c=imp->cr*imp->cr;
+ cmin=imp->crmin*imp->crmin;
+ cmax=imp->crmax*imp->crmax;
while(imp->amount1|imp->amount2) {
if(imp->amount1) {
v3_sub(&dist,&(atom->r),&r);
check_per_bound(moldyn,&dist);
d=v3_absolute_square(&dist);
- if(d<c) {
+ if(d<cmin) {
retry=1;
break;
}
if(d<dmin)
dmin=d;
-
}
+ if(dmin!=1000.0)
+ if(dmin>cmax)
+ 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) {
v3_sub(&dist,&(atom->r),&r);
check_per_bound(moldyn,&dist);
d=v3_absolute_square(&dist);
- if(d<c) {
+ if(d<cmin) {
retry=1;
break;
}
if(d<dmin)
dmin=d;
-
}
+ if(dmin!=1000.0)
+ if(dmin>cmax)
+ 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;
}
}
stage_print(" -> insert mixed atoms\n\n");
imp=stage->params;
insert_mixed_atoms(moldyn,mdrun);
+ change_stage=TRUE;
break;