]> hackdaworld.org Git - physik/posic.git/commitdiff
feature to del atoms outside a spherical volume
authorhackbard <hackbard@sage.physik.uni-augsburg.de>
Mon, 11 Jul 2011 11:38:08 +0000 (13:38 +0200)
committerhackbard <hackbard@sage.physik.uni-augsburg.de>
Mon, 11 Jul 2011 11:38:08 +0000 (13:38 +0200)
mdrun.c

diff --git a/mdrun.c b/mdrun.c
index 76e6c4d82b7cd8fbf0bb9372e04bdbd9be3abf9e..fb1cbe0233e3b62265755df993303143f4f910cc 100644 (file)
--- a/mdrun.c
+++ b/mdrun.c
@@ -803,18 +803,35 @@ int del_atoms(t_moldyn *moldyn,t_mdrun *mdrun) {
        t_del_atoms_params *delp;
        int i;
        t_3dvec dist;
-       
+       u8 outer;
+
+       outer=0;        
        stage=mdrun->stage.current->data;
        delp=stage->params;
 
+       if(delp->r<0)
+               outer=1;
+
        for(i=0;i<moldyn->count;i++) {
                v3_sub(&dist,&(delp->o),&(moldyn->atom[i].r));
 //printf("%d ----> %f %f %f = %f | %f\n",i,dist.x,dist.y,dist.z,v3_absolute_square(&dist),delp->r*delp->r);
                if(v3_absolute_square(&dist)<=(delp->r*delp->r)) {
-                       del_atom(moldyn,moldyn->atom[i].tag);
-                       printf("%s atom deleted: %d %d %d\n",ME,
-                               moldyn->atom[i].tag,moldyn->atom[i].element,
-                              moldyn->atom[i].brand);
+                       if(!outer) {
+                               del_atom(moldyn,moldyn->atom[i].tag);
+                               printf("%s atom deleted: %d %d %d\n",ME,
+                                      moldyn->atom[i].tag,
+                                      moldyn->atom[i].element,
+                                      moldyn->atom[i].brand);
+                       }
+               }
+               else {
+                       if(outer) {
+                               del_atom(moldyn,moldyn->atom[i].tag);
+                               printf("%s atom deleted: %d %d %d\n",ME,
+                                      moldyn->atom[i].tag,
+                                      moldyn->atom[i].element,
+                                      moldyn->atom[i].brand);
+                       }
                }
        }