Beispiel #1
0
        /**
         * Evaluate gravitational field on the body.
         * The original olden version calls a routine named "walkscan",
         * but we use the same name that is in the Barnes code.
         */
        public void hackGravity(double rsize, Node root)
        {
            MathVector pos0 = pos.cloneMathVector();

            HG hg = HG.makeHG(this, pos);

            hg     = root.walkSubTree(rsize * rsize, hg);
            phi    = hg.phi0;
            newAcc = hg.acc0;
        }
Beispiel #2
0
        /**
         * Recursively walk the tree to do hackwalk calculation
         */
        public override HG walkSubTree(double dsq, HG hg)
        {
            if (subdivp(dsq, hg))
            {
                for (int k = 0; k < Cell.NSUB; k++)
                {
                    Node r = this.subp [k];
                    if (r != null)
                    {
                        hg = r.walkSubTree(dsq / 4.0, hg);
                    }
                }
            }
            else
            {
                hg = gravSub(hg);
            }

            return(hg);
        }
Beispiel #3
0
		/**
	 * Evaluate gravitational field on the body.
	 * The original olden version calls a routine named "walkscan",
	 * but we use the same name that is in the Barnes code.
	 */
		public void hackGravity (double rsize, Node root)
		{
			MathVector pos0 = pos.cloneMathVector ();

			HG hg = HG.makeHG (this, pos);
			hg = root.walkSubTree (rsize * rsize, hg);
			phi = hg.phi0;
			newAcc = hg.acc0;
		}