From: hackbard Date: Thu, 14 Oct 2010 15:01:46 +0000 (+0200) Subject: oups, forgot the basis trafo stuff X-Git-Url: https://hackdaworld.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=4bf1f296842f64f5d99de024201192a704e1539a;p=physik%2Fposic.git oups, forgot the basis trafo stuff --- 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)] */