]> www.hackdaworld.org Git - physik/posic.git/commitdiff
extended debugging, implemented fixed position attribute
authorhackbard <hackbard@sage.physik.uni-augsburg.de>
Tue, 12 Feb 2008 16:56:35 +0000 (17:56 +0100)
committerhackbard <hackbard@sage.physik.uni-augsburg.de>
Tue, 12 Feb 2008 16:56:35 +0000 (17:56 +0100)
moldyn.c
potentials/albe.c

index e2c84a524928a9ab12f7b18cf53cdbca18843208..80cf5721a195991a0fa0bdf7a7aca18c83ea8337 100644 (file)
--- a/moldyn.c
+++ b/moldyn.c
@@ -1738,6 +1738,9 @@ int velocity_verlet(t_moldyn *moldyn) {
        tau_square=moldyn->tau_square;
 
        for(i=0;i<count;i++) {
+               /* check whether fixed atom */
+               if(atom[i].attr&ATOM_ATTR_FP)
+                       continue;
                /* new positions */
                h=0.5/atom[i].mass;
                v3_scale(&delta,&(atom[i].v),tau);
@@ -1761,6 +1764,9 @@ int velocity_verlet(t_moldyn *moldyn) {
        potential_force_calc(moldyn);
 
        for(i=0;i<count;i++) {
+               /* check whether fixed atom */
+               if(atom[i].attr&ATOM_ATTR_FP)
+                       continue;
                /* again velocities [actually v(t+tau)] */
                v3_scale(&delta,&(atom[i].f),0.5*tau/atom[i].mass);
                v3_add(&(atom[i].v),&(atom[i].v),&delta);
@@ -2088,9 +2094,9 @@ int potential_force_calc(t_moldyn *moldyn) {
        //printf("\nATOM 0: %f %f %f\n\n",itom->f.x,itom->f.y,itom->f.z);
        if(moldyn->time>DSTART&&moldyn->time<DEND) {
                printf("force:\n");
-               printf("  x: %0.40f\n",moldyn->atom[5832].f.x);
-               printf("  y: %0.40f\n",moldyn->atom[5832].f.y);
-               printf("  z: %0.40f\n",moldyn->atom[5832].f.z);
+               printf("  x: %0.40f\n",moldyn->atom[DATOM].f.x);
+               printf("  y: %0.40f\n",moldyn->atom[DATOM].f.y);
+               printf("  z: %0.40f\n",moldyn->atom[DATOM].f.z);
        }
 #endif
 
index fea7ba818fdeb9562e895166ef181c078a740929..bab0e27ce156f74c8d1a8771980ee69a0d00e7bb 100644 (file)
@@ -81,8 +81,6 @@ int albe_mult_3bp_j1(t_moldyn *moldyn,t_atom *ai,t_atom *aj,u8 bc) {
                moldyn->run3bp=0;
                return 0;
        }
-//if(ai==&(moldyn->atom[5832]))
-//     printf(" %d: %d (%f)\n",ai->tag,aj->tag,moldyn->time);
 
        /* d_ij */
        d_ij=sqrt(d_ij2);
@@ -285,16 +283,16 @@ int albe_mult_3bp_j2(t_moldyn *moldyn,t_atom *ai,t_atom *aj,u8 bc) {
 
 #ifdef DEBUG
 if(moldyn->time>DSTART&&moldyn->time<DEND) {
-       if((ai==&(moldyn->atom[5832]))|(aj==&(moldyn->atom[5832]))) {
+       if((ai==&(moldyn->atom[DATOM]))|(aj==&(moldyn->atom[DATOM]))) {
                printf("force 3bp (j2): [%d %d sum]\n",ai->tag,aj->tag);
-               printf("adding %f %f %f\n",force.x,force.y,force.z);
+               printf("  adding %f %f %f\n",force.x,force.y,force.z);
                if(ai==&(moldyn->atom[0]))
-                       printf("total i: %f %f %f\n",ai->f.x,ai->f.y,ai->f.z);
+                       printf("  total i: %f %f %f\n",ai->f.x,ai->f.y,ai->f.z);
                if(aj==&(moldyn->atom[0]))
-                       printf("total j: %f %f %f\n",aj->f.x,aj->f.y,aj->f.z);
-               printf("energy: %f = %f %f %f %f\n",0.5*f_c*(b*f_a+f_r),
+                       printf("  total j: %f %f %f\n",aj->f.x,aj->f.y,aj->f.z);
+               printf("  energy: %f = %f %f %f %f\n",0.5*f_c*(b*f_a+f_r),
                                                    f_c,b,f_a,f_r);
-               printf("        %f %f %f\n",exchange->zeta_ij,.0,.0);
+               printf("          %f %f %f\n",exchange->zeta_ij,.0,.0);
        }
 }
 #endif
@@ -403,10 +401,12 @@ int albe_mult_3bp_k2(t_moldyn *moldyn,
        
 #ifdef DEBUG
 if(moldyn->time>DSTART&&moldyn->time<DEND) {
-       if(ai==&(moldyn->atom[5832])) {
+       if(ai==&(moldyn->atom[DATOM])) {
                printf("force 3bp (k2): [%d %d %d]\n",ai->tag,aj->tag,ak->tag);
-               printf("adding %f %f %f\n",force.x,force.y,force.z);
-               printf("total i: %f %f %f\n",ai->f.x,ai->f.y,ai->f.z);
+               printf("  adding %f %f %f\n",force.x,force.y,force.z);
+               printf("  total i: %f %f %f\n",ai->f.x,ai->f.y,ai->f.z);
+               printf("  angle: %f\n",acos(cos_theta)*360.0/(2*M_PI));
+               printf("    d ij ik = %f %f\n",d_ij,d_ik);
        }
 }
 #endif
@@ -422,10 +422,12 @@ if(moldyn->time>DSTART&&moldyn->time<DEND) {
 
 #ifdef DEBUG
 if(moldyn->time>DSTART&&moldyn->time<DEND) {
-       if(aj==&(moldyn->atom[5832])) {
+       if(aj==&(moldyn->atom[DATOM])) {
                printf("force 3bp (k2): [%d %d %d]\n",ai->tag,aj->tag,ak->tag);
-               printf("adding %f %f %f\n",force.x,force.y,force.z);
-               printf("total j: %f %f %f\n",aj->f.x,aj->f.y,aj->f.z);
+               printf("  adding %f %f %f\n",force.x,force.y,force.z);
+               printf("  total j: %f %f %f\n",aj->f.x,aj->f.y,aj->f.z);
+               printf("  angle: %f\n",acos(cos_theta)*360.0/(2*M_PI));
+               printf("    d ij ik = %f %f\n",d_ij,d_ik);
        }
 }
 #endif
@@ -445,10 +447,12 @@ if(moldyn->time>DSTART&&moldyn->time<DEND) {
 
 #ifdef DEBUG
 if(moldyn->time>DSTART&&moldyn->time<DEND) {
-       if(ak==&(moldyn->atom[5832])) {
+       if(ak==&(moldyn->atom[DATOM])) {
                printf("force 3bp (k2): [%d %d %d]\n",ai->tag,aj->tag,ak->tag);
-               printf("adding %f %f %f\n",force.x,force.y,force.z);
-               printf("total k: %f %f %f\n",ak->f.x,ak->f.y,ak->f.z);
+               printf("  adding %f %f %f\n",force.x,force.y,force.z);
+               printf("  total k: %f %f %f\n",ak->f.x,ak->f.y,ak->f.z);
+               printf("  angle: %f\n",acos(cos_theta)*360.0/(2*M_PI));
+               printf("    d ij ik = %f %f\n",d_ij,d_ik);
        }
 }
 #endif