#include #include void quint(a,b,c,d,e,f,n) /* Subroutine QUINT solves a pentadiagonal system by overwriting the input vectors. The vectors a through e are the five diagonals of A (in Ax = f), in order from second subdiagonal to second superdiagonal. The vectors b, c and d are overwritten in forming the upper tridiagonal system. The solution vector x is written into the input vector f. The nth element of each input vector is the value of matrix element of that diagonal on the nth row of A. */ float *a, *b, *c, *d, *e, *f; int n; { float fac; int k; for( k=1; k=0; k--) { f[k] -= e[k] * f[k+2] + d[k] * f[k+1]; f[k] /= c[k]; } } float *a, *b, *c, *d, *e, *f; struct disp { float u, w; }; void frob(p1,p2,nx,g,u,w) struct disp *p1, *p2; float *g, *u, *w; int nx; { int i; zap(b,nx); zap(d,nx); /* compute A in Ax = f */ /* absorbing b.c. at left and right */ a[0] = 0.; a[1] = 0.; c[0] = -1-u[0]; c[1] = -1-u[1]; d[0] = 1-u[1]; d[1] = 1-u[2]; e[0] = 0.; e[1] = 0.; a[nx-2] = 0.; a[nx-1] = 0.; b[nx-2] = -1+u[3]; b[nx-1] = -1+u[4]; c[nx-2] = 1+u[4]; c[nx-1] = 1+u[5]; e[nx-2] = 0.; e[nx-1] = 0.; for(i=2;i