#include "Head.h" #include /* Scalar times tensor */ static tri operator*(float e, tri f) {tri v; int i; for (i=0; i<3; i++) v.A[i] = e*f.A[i]; return v;} /* Tensor times Vector */ static vec operator*(tri a, vec b) {vec c; int i; for (i=0; i<3; i++) c.a[i] = a.A[i]* b; return c;} /* Push on a vertex. */ static void shove(int i, vec f) {u[i].mom = u[i].mom + f;} static tri push(lt sh, tri or) {tri b=tp(or), v, w; int i, j; for (i=0; i<3; i++) w.A[i] = sh*b.A[i]; for (i=0; i<3; i++) for (j=0; j<=i; j++) v.A[j].a[i] = v.A[i].a[j] = w.A[i]*w.A[j]; return v;} void physics() {/*float lam = -.2, mu = -.05; float mu_dt = lam*dt, lambda_dt = mu*dt;*/ int i; if(damp){int i; for (i=0; i