Smooth Particle Applied Mechanics: The State of the Art

A research code for smooth particles can be developed relatively easily. The primary ingredients are (i) a main program; (ii) a subroutine to implement the initial conditions, initial; (iii) a Runge-Kutta time integration routine, rk2 or rk4; and (iv) a routine for evaluating the righthandsides of the smooth particle equations, rhs. The use of subroutines can simplify complex repetitious programming tasks. Typically we have the following structure for a smooth particle program:
program SPAMc This is a template for the main program and its subprogramsc in a smooth-particle program called SPAM implicit double precision (a-h,o-z) parameter (nx=80,ny=40,n=nx*ny,neq=(9*n)) dimension x(n),y(n),vx(n),vy(n),rho(n) dimension e(n),sxx(n),sxy(n),syy(n) dimension p(n),tke(n),pot(n)<span class="beginpage"> pagenum="106"><a name="206"></a><a name="IDX-106"></a></span> dimension yy(neq),yyp(neq) ... call initial(x,y,vx,vy,rho,sxx,sxy,syy,e) ... call rk4(dt,yy,yyp) ... ... stop end subroutine initial(x,y,vx,vy,rho,sxx,sxy,syy,e) parameter...