X-Git-Url: https://hackdaworld.org/gitweb/?p=physik%2Fposic.git;a=blobdiff_plain;f=moldyn.c;fp=moldyn.c;h=33224a69f82fd62c175ea6e300f757f70b8851bb;hp=d715c52a11f91aa9f43244b014c281f3c2a00cc4;hb=4bf1f296842f64f5d99de024201192a704e1539a;hpb=c4a2ca467fd4157107bdde0706c2394962b68ee3 diff --git a/moldyn.c b/moldyn.c index d715c52..33224a6 100644 --- a/moldyn.c +++ b/moldyn.c @@ -2319,6 +2319,7 @@ int velocity_verlet(t_moldyn *moldyn) { /* constraint relaxation */ if(crtt) { + // forces basis_trafo(&(atom[i].f),FORWARD, trafo_angle[2*i],trafo_angle[2*i+1]); if(constraints[3*i]) @@ -2329,6 +2330,17 @@ int velocity_verlet(t_moldyn *moldyn) { atom[i].f.z=0; basis_trafo(&(atom[i].f),BACKWARD, trafo_angle[2*i],trafo_angle[2*i+1]); + // velocities + basis_trafo(&(atom[i].v),FORWARD, + trafo_angle[2*i],trafo_angle[2*i+1]); + if(constraints[3*i]) + atom[i].v.x=0; + if(constraints[3*i+1]) + atom[i].v.y=0; + if(constraints[3*i+2]) + atom[i].v.z=0; + basis_trafo(&(atom[i].v),BACKWARD, + trafo_angle[2*i],trafo_angle[2*i+1]); } #ifndef QUENCH @@ -2369,6 +2381,7 @@ int velocity_verlet(t_moldyn *moldyn) { /* constraint relaxation */ if(crtt) { + // forces basis_trafo(&(atom[i].f),FORWARD, trafo_angle[2*i],trafo_angle[2*i+1]); if(constraints[3*i]) @@ -2379,6 +2392,17 @@ int velocity_verlet(t_moldyn *moldyn) { atom[i].f.z=0; basis_trafo(&(atom[i].f),BACKWARD, trafo_angle[2*i],trafo_angle[2*i+1]); + // velocities + basis_trafo(&(atom[i].v),FORWARD, + trafo_angle[2*i],trafo_angle[2*i+1]); + if(constraints[3*i]) + atom[i].v.x=0; + if(constraints[3*i+1]) + atom[i].v.y=0; + if(constraints[3*i+2]) + atom[i].v.z=0; + basis_trafo(&(atom[i].v),BACKWARD, + trafo_angle[2*i],trafo_angle[2*i+1]); } /* again velocities [actually v(t+tau)] */