Nbody6
 All Files Functions Variables
reflct.f
Go to the documentation of this file.
1  SUBROUTINE reflct(I,RI2)
2 *
3 *
4 * Boundary reflection.
5 * --------------------
6 *
7  include 'common6.h'
8 *
9 *
10  rdot = x(1,i)*xdot(1,i) + x(2,i)*xdot(2,i) + x(3,i)*xdot(3,i)
11 *
12 * Avoid multiple reflections for inward moving particles.
13  IF (rdot.LT.0.0) go to 50
14 *
15 * Obtain radial velocity with respect to the inertial centre.
16  ri = sqrt(ri2)
17  rdot = rdot/ri
18 *
19 * Form radial velocity for mirror reflection.
20  rdot = -2.0*rdot
21 *
22 * Set reflected velocity at the boundary and initialize X0DOT.
23  DO 10 k = 1,3
24  xdot(k,i) = xdot(k,i) + rdot*x(k,i)/ri
25  x0dot(k,i) = xdot(k,i)
26  10 CONTINUE
27 *
28 * Predict current coordinates & velocities for all neighbours.
29  nnb = list(1,i)
30  CALL xvpred(i,nnb)
31 *
32 * Initialize force polynomials & time-steps.
33  CALL fpoly1(i,i,0)
34  CALL fpoly2(i,i,0)
35 *
36  ri2 = -1.0
37 * Return of negative argument indicates new polynomials & steps.
38 *
39  50 RETURN
40 *
41  END