ROOT logo
// $Id: SolarSystem.cxx 2597 2011-11-13 08:03:06Z matevz $

// Copyright (C) 1999-2008, Matevz Tadel. All rights reserved.
// This file is part of GLED, released under GNU General Public License version 2.
// For the licensing terms see $GLEDSYS/LICENSE or http://www.gnu.org/.

#include "SolarSystem.h"
#include "SolarSystem.c7"

#include "CosmicBall.h"
#include <Glasses/ZQueen.h>

#include <Gled/GThread.h>

#include <TRandom.h>
#include <TMath.h>
#include <TSystem.h>

#include "Gled/XTReqCanvas.h"
#include "TGraph.h"
#include "TCanvas.h"


//==============================================================================
// SolarSystem
//==============================================================================

//__________________________________________________________________________
//
// Simple simulation of a most unrealistic solar system.
//
// The integration of the system can be performed in two modes.
//
// 1) ChunkedStorage
//
//    The integrator runs in a separate thread and stores the results
//    for given past/future in the storage map (see members mKeepPast
//    and mCalcFuture). The time can be selected from outside by
//    calling SetTime().
//
// 2) DirectStep
//
//    The calculation is performed on each TimeTick and results are
//    put directly back into the CosmicBalls. There is no way to set
//    the time otherwise.
//
// Do NOT change the mode after the processing has started ... or you
// will be sorry. Anyway ... they require a completely different setup
// for an efficient update-render loop.
//
//
//
// Notes for further development
// -----------------------------
//
// Collisions are not handled at all. Tried repulsive force on proximity but
// it didn't conserve energy (balls got shot out of the system). This could be
// fixed / hacked, of course.
//
// One could also change R, M of colliding balls ... and modify the velcoities
// accordingly. Also, fragmentation would be an option. The coolest thing
// would be to have moon formation.
// 1. R, M could be intergration variables ... hmmh ... tricky.
// 2. Keep some empty ball-slots for collisions / fragmentations.
// 3. Big / gas giants could swallow the impactor.

ClassImp(SolarSystem);

//==============================================================================

void SolarSystem::_init()
{
  hWarnTimeOutOfRange = true;
  hStepIntegratorDt   = 0;

  mCrawlMode = CM_ChunkedStorage;

  mTime    = 0;
  mTimeFac = 1;

  mBallHistorySize = 0;

  mStarMass   = 0;
  mBallKappa  = 1e-6;

  mPlanetRnd.SetSeed(0);
  mPlanetMinR = 10;
  mPlanetMaxR = 50;
  mOrbitMinR  = 200;
  mOrbitMaxR  = 1000;
  mMaxTheta   = 20;
  mMaxEcc     = 0.2;
  mPlanetColor.rgba(0, 0.7, 1);

  mTimePerChunk  = 1000;
  mKeepPast      = 2000;
  mCalcFuture    = 5000;

  mIntegratorThread = 0;

  bDesiredRHack   = false;
  mDesiredRHackT0 = 5; // This is in real time, time-fac is ignored!
}

SolarSystem::SolarSystem(const Text_t* n, const Text_t* t) :
  ZNode(n, t)
{
  _init();
}

SolarSystem::~SolarSystem()
{
  if (mIntegratorThread)
    mIntegratorThread->Cancel();
}

//==============================================================================

void SolarSystem::AdEnlightenment()
{
  PARENT_GLASS::AdEnlightenment();
  if (mBalls == 0) {
    assign_link<ZVector>(mBalls, FID(), "Balls",
			 GForm("Balls of SolarSystem %s", GetName()));
    mBalls->SetElementFID(CosmicBall::FID());
    mBalls->SetMIRActive(false);
  }
  if (mODECrawler == 0) {
    assign_link<ODECrawler>(mODECrawler, FID(), "ODECrawler",
			    GForm("ODECrawler of SolarSystem %s", GetName()));
    mODECrawler->SetODEMaster(this);
  }
}

//==============================================================================

Int_t SolarSystem::ODEOrder()
{
  static const Exc_t _eh("SolarSystem::ODEOrder ");

  assert_balls(_eh);
  return 6 * mBalls->Size();
}

void SolarSystem::ODEStart(Double_t y[], Double_t& x1, Double_t& x2)
{
  Int_t i = 0;
  Stepper<CosmicBall> stepper(*mBalls);
  while (stepper.step())
  {
    const Double_t *P = stepper->RefTrans().ArrT();
    const HPointD  &V = stepper->RefV();

    y[i++] = P[0]; y[i++] = P[1]; y[i++] = P[2];
    y[i++] = V.x;  y[i++] = V.y;  y[i++] = V.z;
  }

  assert(i == (Int_t) ODEOrder());
}

void SolarSystem::ODEDerivatives(Double_t x, const Double_t y[], Double_t d[])
{
  const Int_t max_i = 6 * mBalls->Size();

  for (Int_t i = 0; i < max_i; i += 6)
  {
    d[i]   = y[i+3];
    d[i+1] = y[i+4];
    d[i+2] = y[i+5];

    d[i+3] = 0;
    d[i+4] = 0;
    d[i+5] = 0;
  }

  HPointD delta;

  // Between cosmic balls: m * kappa / r^2
  // Sum contributions from the tail of mBalls as the biggest
  // contribution will come from Stella, which is usually at position 0.

  const Int_t iMax = mBalls->Size() - 1;
  for (Int_t i = iMax; i >= 0; --i)
  {
    CosmicBall *Bi = (CosmicBall*) (**mBalls)[i];
    if (Bi == 0)
      continue;

    const Int_t a = 6*i;

    for (Int_t j = iMax; j > i; --j)
    {
      CosmicBall *Bj = (CosmicBall*) (**mBalls)[j];
      if (Bj == 0)
	continue;

      const Int_t b = 6*j;

      delta.Set(y[b] - y[a], y[b+1] - y[a+1], y[b+2] - y[a+2]);

      const Double_t rsqr  = delta.Mag2();
      const Double_t R     = Bi->mRadius + Bi->mRadius;
      const Double_t Rsqr  = R * R;
      Double_t rftot;
      if (rsqr > Rsqr)
      {
        rftot = mBallKappa / (rsqr*TMath::Sqrt(rsqr));
      }
      else
      {
        rftot = mBallKappa * TMath::Sqrt(rsqr) / (Rsqr*Rsqr);
      }

      const Double_t fi = Bj->mM * rftot;
      d[a+3] += fi * delta.x;
      d[a+4] += fi * delta.y;
      d[a+5] += fi * delta.z;
      const Double_t fj = Bi->mM * rftot;
      d[b+3] -= fj * delta.x;
      d[b+4] -= fj * delta.y;
      d[b+5] -= fj * delta.z;
    }
  }

  // Brutal fix - keep Stella at the origin.
  // Should calculate SS speed and put this into its gallactic node.
  // Assumes a single star at index 0.
  d[0] = d[1] = d[2] = d[3] = d[4] = d[5] = 0;
}

//------------------------------------------------------------------------------

void SolarSystem::CalculateEnergy(Double_t /*x*/, const Double_t y[],
				  Double_t& kinetic, Double_t& potential)
{
  kinetic = potential = 0;

  HPointD delta;

  const Int_t iMax = mBalls->Size() - 1;
  for (Int_t i = iMax; i >= 0; --i)
  {
    CosmicBall *Bi = (CosmicBall*) (**mBalls)[i];
    if (Bi == 0)
      continue;

    const Int_t a = 6*i;

    kinetic += Bi->mM * (y[a+3]*y[a+3] + y[a+4]*y[a+4] + y[a+5]*y[a+5]);

    for (Int_t j = iMax; j > i; --j)
    {
      CosmicBall *Bj = (CosmicBall*) (**mBalls)[j];
      if (Bj == 0)
	continue;

      const Int_t b = 6*j;

      delta.Set(y[b] - y[a], y[b+1] - y[a+1], y[b+2] - y[a+2]);

      potential -= Bi->mM * Bj->mM / delta.Mag();
    }
  }

  kinetic   *= 0.5;
  potential *= mBallKappa;
}

//==============================================================================

void SolarSystem::TimeTick(Double_t t, Double_t dt)
{
  GLensWriteHolder wrlck(this);

  Double_t tdt = mTimeFac*dt;

  if (tdt == 0)
    return;

  switch (mCrawlMode)
  {
    case CM_ChunkedStorage:
    {
      Double_t new_time = mTime + tdt;

      // Here we could check how much time has elapsed since last position store
      // and decide whether to store this time.
      // But need store dt, last_store_t members.
      mTime = set_time(new_time, true);
      Stamp(FID());
      break;
    }
    case CM_DirectStep:
    {
      {
	GMutexHolder lock_storage(mStorageCond);

	if (bDesiredRHack)
	{
	  hack_desired_r(dt);
	}

	{
	  const Double_t *Y = mODECrawler->RawYArray();
	  Bool_t store_pos  = mBallHistorySize > 0;
	  Stepper<CosmicBall> stepper(*mBalls, true);
	  while (stepper.step())
	  {
	    if (stepper.get_lens() != 0)
	    {
	      stepper->SetPos(Y[0], Y[1], Y[2]);
	      stepper->SetV  (Y[3], Y[4], Y[5]);

	      if (store_pos)
	      {
		stepper->StorePos();
	      }
	    }
	    Y += 6;
	  }
	}

	{
	  GMutexHolder    lock_switcher(mBallSwitchMutex);
	  GLensReadHolder lock_balls   (*mBalls);

	  while ( ! mBallsToRemove.empty())
	  {
	    mBalls->RemoveAll(mBallsToRemove.front());
	    mBallsToRemove.pop_front();
	  }
	  if ( ! mBallsToAdd.empty())
	  {
	    Int_t miss = mBallsToAdd.size() - mBalls->CountEmptyIds();
	    if (miss > 0)
	    {
	      const Int_t new_size = mBalls->Size() + miss;
	      mBalls->Resize(new_size);
	      mODECrawler->ChangeOrderInPlace(6*new_size);
	    }

	    Double_t* arr = mODECrawler->RawYArray();
	    Int_t     idx = 0;
	    while ( ! mBallsToAdd.empty())
	    {
	      idx = mBalls->FindFirstEmptyId(idx);
	      assert(idx != -1);
	      CosmicBall* cb = mBallsToAdd.front();
              cb->ResizeHistory(mBallHistorySize);
	      mBalls->SetElementById(cb, idx);

	      const Double_t *T = cb->RefTrans().ArrT();
	      const HPointD  &V = cb->RefV();
	      const Int_t     i = 6*idx;
	      arr[i]   = T[0]; arr[i+1] = T[1]; arr[i+2] = T[2];
	      arr[i+3] = V.x;  arr[i+4] = V.y;  arr[i+5] = V.z;

	      mBallsToAdd.pop_front();
	    }
	  }
	}

	mTime += hStepIntegratorDt;
	hStepIntegratorDt = tdt;

	mStorageCond.Signal();
      }

      Stamp(FID());
      break;
    }
  }
}

//==============================================================================

void SolarSystem::clear_storage()
{
  // Wipes storage, resets mCurrentStorage.
  // Must be called under storage lock!

  for (mTime2pStorage_i i = mStorageMap.begin(); i != mStorageMap.end(); ++i)
  {
    i->second->DecRefCnt();
  }
  mStorageMap.clear();
  mCurrentStorage = mStorageMap.end();
}

//------------------------------------------------------------------------------

SolarSystem::mTime2pStorage_i SolarSystem::find_storage_from_time(Double_t t)
{
  // Finds storage corresponging to given time.
  // Must be called under storage lock!

  mTime2pStorage_i i = mStorageMap.lower_bound(t);
  if (i != mStorageMap.begin())
  {
    --i;
  }
  return i;
}

SolarSystem::Storage* SolarSystem::set_current_storage_from_time(Double_t t)
{
  GMutexHolder lock_storage(mStorageCond);

  Storage* s = mCurrentStorage->second;
  if (t >= s->GetMinXStored() && t <= s->GetMaxXStored())
    return s;

  mCurrentStorage = find_storage_from_time(t);

  // We switched to another storage, let's kick integrator.
  mStorageCond.Signal();

  return mCurrentStorage->second;
}

Double_t SolarSystem::set_time(Double_t t, Bool_t from_timetick)
{
  // Place balls into position for time t.
  // Linear extrapolation between two stored points is made.
  //
  // When from_timetick is true the history of the balls is updated.
  // Otherwise it is reset to 0.

  static const Exc_t _eh("SolarSystem::set_time ");

  Storage        *S = set_current_storage_from_time(t);
  const Double_t *T = S->GetXArr();
  const Int_t     N = S->Size();

  Int_t i0;
  if (t <= T[0])
  {
    if (t < T[0] && hWarnTimeOutOfRange) {
      ISwarn(_eh + GForm("given time %f below minimum %f. Using minimum.", t, T[0]));
      hWarnTimeOutOfRange = false;
    }
    i0 = 0;
    t  = T[0];
  }
  else if (t >= T[N-1])
  {
    if (t > T[N-1] && hWarnTimeOutOfRange) {
      ISwarn(_eh + GForm("given time %f above maximum %f. Using maximum", t, T[N-1]));
      hWarnTimeOutOfRange = false;
    }
    i0 = N - 2;
    t  = T[N-1];
  }
  else
  {
    hWarnTimeOutOfRange = true;

    i0 = TMath::BinarySearch<Double_t>(N, T, t);
    if (i0 < 0 || i0 > N - 1)
      throw _eh + "index out of range.";
    if (i0 == N - 1) // Happens as storage is in floats.
      i0 = N - 2;
  }

  const Double_t  f0 = (T[i0+1] - t) / (T[i0+1] - T[i0]);
  const Double_t  f1 = 1.0 - f0;

  const Double_t* P0 = S->GetY(i0);
  const Double_t* P1 = S->GetY(i0+1);

  // Assumes contiguous population of balls!
  Int_t  ri        = 0;
  Bool_t store_pos = from_timetick && mBallHistorySize > 0;
  Stepper<CosmicBall> stepper(*mBalls);
  while (stepper.step())
  {
    stepper->SetPos(f0*P0[ri]     + f1*P1[ri],
                    f0*P0[ri + 1] + f1*P1[ri + 1],
                    f0*P0[ri + 2] + f1*P1[ri + 2]);
    ri += 3;
    stepper->SetV  (f0*P0[ri]     + f1*P1[ri],
                    f0*P0[ri + 1] + f1*P1[ri + 1],
                    f0*P0[ri + 2] + f1*P1[ri + 2]);

    if (store_pos)
    {
      stepper->StorePos();
    }

    ri += 3;
  }

  return t;
}

void SolarSystem::SetTime(Double_t t)
{
  static const Exc_t _eh("SolarSystem::SetTime ");

  if (mCrawlMode == CM_DirectStep)
    throw _eh + "Not available in direct-step mode.";

  mTime = set_time(t, false);
  Stepper<CosmicBall> stepper(*mBalls);
  while (stepper.step())
  {
    stepper->ClearHistory();
  }
  Stamp(FID());
}

void SolarSystem::SetBallHistorySize(Int_t history_size)
{
  if (history_size < 0)    history_size = 0;
  if (history_size > 4096) history_size = 4096;
  mBallHistorySize = history_size;

  Stepper<CosmicBall> stepper(*mBalls);
  while (stepper.step())
    stepper->ResizeHistory(mBallHistorySize);

  Stamp(FID());
}

//==============================================================================

void* SolarSystem::tl_IntegratorThread(SolarSystem* ss)
{
  switch (ss->mCrawlMode)
  {
    case CM_ChunkedStorage:
      ss->ChunkIntegratorThread();
      break;
    case CM_DirectStep:
      ss->StepIntegratorThread();
      break;
  }
  return 0;
}

void SolarSystem::ChunkIntegratorThread()
{
  static const Exc_t _eh("SolarSystem::ChunkIntegratorThread ");

  while (true)
  {
    Storage* old_storage = (Storage*) mODECrawler->GetStorage();
    Storage* new_storage = new Storage(*old_storage);

    mODECrawler->SwapStorage(new_storage);
    mODECrawler->AdvanceXLimits(mTimePerChunk);

    mODECrawler->Crawl(false);

    {
      GMutexHolder lock_storage(mStorageCond);

      mStorageMap.insert(make_pair(new_storage->GetMinXStored(), new_storage));
      new_storage->IncRefCnt();

      bool calc_needed = false;
      while (!calc_needed)
      {
        Double_t t_min = mTime - mKeepPast;
        while (mStorageMap.begin()->second->GetMaxXStored() < t_min)
        {
          printf("%sRemoving storage [%f, %f], t=%f, t_min=%f\n",
                 _eh.Data(),
                 mStorageMap.begin()->second->GetMinXStored(),
                 mStorageMap.begin()->second->GetMaxXStored(),
                 mTime, t_min);
	  mStorageMap.begin()->second->DecRefCnt();
          mStorageMap.erase(mStorageMap.begin());
        }

        Double_t t_max = mTime + mCalcFuture;
        if (mStorageMap.rbegin()->second->GetMinXStored() < t_max)
        {
          calc_needed = true;
          printf("%sRequesting calculation, max_available=%f t_max=%f...\n",
                 _eh.Data(),
                 mStorageMap.rbegin()->second->GetMaxXStored(),
                 t_max);
        }
        else
        {
          printf("%sNothing to be done ... waiting.\n", _eh.Data());
          mStorageCond.Wait();
          printf("%sSignal received ... let's see ...\n", _eh.Data());
        }
      }
    }
  }
}

void SolarSystem::StepIntegratorThread()
{
  static const Exc_t _eh("SolarSystem::StepIntegratorThread ");

  GMutexHolder lock_storage(mStorageCond);

  while (true)
  {
    mStorageCond.Wait();

    mODECrawler->AdvanceXLimits(hStepIntegratorDt);
    mODECrawler->Crawl(false);
  }
}

//==============================================================================

void SolarSystem::StartChunkIntegratorThread()
{
  // Start the ODE integrator thread.
  // Throws an exception if the thread is already running.
  //
  // This expects that the CosmicBalls are registered into this object.
  // All existing storage is dropped, the time starts at zero.
  // ODECrawler is initialized and the first chunk is calculated in the
  // calling thread.
  // After that, a new thread is spawned with nice value of 10.

  static const Exc_t _eh("SolarSystem::StartChunkIntegratorThread ");

  assert_odecrawler(_eh);

  if (mCrawlMode != CM_ChunkedStorage)
    throw _eh + "Not in ChunkedStorage mode.";

  if (mIntegratorThread)
    throw _eh + "Integrator thread already running.";

  {
      GMutexHolder lock_storage(mStorageCond);
      clear_storage();
  }

  mODECrawler->SetX1(mTime);
  mODECrawler->SetX2(mTime + mTimePerChunk);

  Storage* s = new Storage(ODEOrder());
  mODECrawler->SetStorage(s);
  mODECrawler->Crawl();

  {
    GMutexHolder lock_storage(mStorageCond);
    mCurrentStorage = mStorageMap.insert(make_pair(0, s)).first;
    mCurrentStorage->second->IncRefCnt();
  }

  mIntegratorThread = new GThread("SolarSystem-ChunkIntegrator",
                                  (GThread_foo) (tl_IntegratorThread), this,
                                  false);
  mIntegratorThread->SetNice(10);
  mIntegratorThread->Spawn();
}

void SolarSystem::StartStepIntegratorThread()
{
  static const Exc_t _eh("SolarSystem::StartStepIntegratorThread ");

  assert_odecrawler(_eh);

  if (mCrawlMode == CM_DirectStep)
    throw _eh + "Already in direct-step mode.";

  if (mIntegratorThread)
    throw _eh + "Integrator thread already running.";

  mCrawlMode = CM_DirectStep;
  {
    GLensReadHolder rdlock(*mODECrawler);

    mODECrawler->SetX1(mTime);
    mODECrawler->SetX2(mTime);
    mODECrawler->SetStoreMax(0);
  }
  // Make a phony step ... with initialization from the balls.
  mODECrawler->Crawl();

  hStepIntegratorDt = 0;

  mIntegratorThread = new GThread("SolarSystem-StepIntegrator",
                                  (GThread_foo) (tl_IntegratorThread), this,
                                  false);
  mIntegratorThread->SetNice(10);
  mIntegratorThread->Spawn();

  Stamp(FID());
}

void SolarSystem::StopIntegratorThread()
{
  // not finished

  static const Exc_t _eh("SolarSystem::StopIntegratorThread ");

  if (mIntegratorThread == 0)
    throw _eh + "not running.";

  mIntegratorThread->Cancel();
  mIntegratorThread->Join();
  mIntegratorThread = 0;
}

//==============================================================================

CosmicBall* SolarSystem::RandomPlanetoid(const TString& name)
{
  // Generate a random planetoid with given name.

  using namespace TMath;

  CosmicBall* cb = new CosmicBall(name);

  Double_t r_planet    = mPlanetRnd.Uniform(mPlanetMinR, mPlanetMaxR);
  Double_t mass_planet = 4.0*Pi()*r_planet*r_planet*r_planet/3.0;

  cb->SetM(mass_planet);
  cb->SetRadius(r_planet);
  cb->SetLOD(16);
  cb->SetColorByRef(mPlanetColor);

  Double_t r_orb     = mPlanetRnd.Uniform(mOrbitMinR, mOrbitMaxR);
  Double_t phi_orb   = mPlanetRnd.Uniform(0, TwoPi());
  Double_t theta_orb = DegToRad() * mPlanetRnd.Uniform(-mMaxTheta, mMaxTheta);
  Double_t cos_theta = Cos(theta_orb);

  const HPointD pos(r_orb * cos_theta * Cos(phi_orb),
		    r_orb * cos_theta * Sin(phi_orb),
		    r_orb * Sin(theta_orb));
  cb->SetPos(pos.x, pos.y, pos.z);

  Double_t ecc     = mPlanetRnd.Uniform(0, mMaxEcc);
  Double_t vel_mag = Sqrt(mBallKappa*mStarMass/r_orb*(1 - ecc));

  const Double_t vfac = vel_mag / pos.Mag();
  cb->SetV(-pos.y*vfac, pos.x*vfac, 0);

  // Older calculation with random phi velocity.
  //
  // Double_t phi_vel = mPlanetRnd.Uniform(0, TwoPi());
  // HPointD xplane(pos.Orthogonal());
  // HPointD yplane(pos.Cross(xplane));
  // xplane *= vel_mag * Cos(phi_vel);
  // yplane *= vel_mag * Sin(phi_vel);
  // cb->SetV(xplane.x + yplane.x, xplane.y + yplane.y, xplane.z + yplane.z);

  return cb;
}

void SolarSystem::MakeStar()
{
  // Not cluster safe.

  static const Exc_t _eh("SolarSystem::MakeStar ");

  assert_balls(_eh);

  CosmicBall* cb = new CosmicBall("Stella");
  cb->SetColor(1, 1, 0);
  cb->SetRadius(100);
  cb->SetLOD(20);

  Double_t mass = 1e9;
  mStarMass += mass;
  cb->SetM(mass);

  mQueen->CheckIn(cb);
  mBalls->Add(cb);
}

void SolarSystem::MakePlanetoid()
{
  // Convenience function to be called from scripts.
  // Not cluster safe.

  static const Exc_t _eh("SolarSystem::MakePlanetoid ");

  assert_balls(_eh);

  Int_t idx = mBalls->Size();
  CosmicBall *cb = RandomPlanetoid(GForm("Planet %d", idx));
  cb->ResizeHistory(mBallHistorySize);

  mQueen->CheckIn(cb);
  mBalls->Add(cb);
  cb->SetParent(this);
}

void SolarSystem::AddPlanetoid(CosmicBall* cb)
{
  // Add planetoid cb.
  // If integrator thread is already running, this is only possible
  // in the direct-step mode.
  // The ball should be already checked-in. Also, its parent should
  // probably be set to this SolarSystem.

  static const Exc_t _eh("SolarSystem::AddPlanetoid ");

  if (mIntegratorThread && mCrawlMode != CM_DirectStep)
    throw _eh + "Balls can be added during thread operation only in direct-step mode.";

  GMutexHolder ball_lock(mBallSwitchMutex);

  mBallsToAdd.push_back(cb);
}

void SolarSystem::RemovePlanetoid(CosmicBall* cb)
{
  // Remove planetoid cb.
  // If integrator thread is already running, this is only possible
  // in the direct-step mode.
  // If the ball is not referenced from anywhere else it is at risk
  // of being auto-destructed.

  static const Exc_t _eh("SolarSystem::RemovePlanetoid ");

  if (mIntegratorThread && mCrawlMode != CM_DirectStep)
    throw _eh + "Balls can be removed during thread operation only in direct-step mode.";

  GMutexHolder ball_lock(mBallSwitchMutex);

  mBallsToRemove.push_back(cb);
}

//==============================================================================

void SolarSystem::hack_desired_r(Double_t dt)
{
  const Double_t eps = 0.01;
  const Double_t tf  = dt / mDesiredRHackT0;

  Double_t *Y  = mODECrawler->RawYArray();

  Stepper<CosmicBall> stepper(*mBalls, true);
  while (stepper.step())
  {
    if (stepper.get_lens() != 0 && stepper->GetDesiredR() != 0)
    {
      const Double_t r_des = stepper->GetDesiredR();
      const Double_t r_mag = TMath::Sqrt(Y[0]*Y[0] + Y[1]*Y[1] + Y[2]*Y[2]);

      Double_t d = (r_des - r_mag) / r_des;
      if (d < -eps || d > eps)
      {
	d *= tf;
	Y[0] += d*Y[0]; Y[1] += d*Y[1]; Y[2] += d*Y[2];

	d = 1.0 / TMath::Sqrt(1 + d);
	Y[3] *= d; Y[4] *= d; Y[5] *= d;
      }
      else
      {
	stepper->SetDesiredR(0);
      }
    }
    Y += 6;
  }

}

//==============================================================================

void SolarSystem::PlotEnergy()
{
  vector<Double_t> tv, kv, pv, sv;

  Double_t k, p;

  vector<Storage*> storages;
  {
    GMutexHolder lock_storage(mStorageCond);

    storages.reserve(mStorageMap.size());
    for (mTime2pStorage_i i = mStorageMap.begin(); i != mStorageMap.end(); ++i)
    {	
      storages.push_back(i->second);
      i->second->IncRefCnt();
    }
  }

  for (vector<Storage*>::iterator i = storages.begin(); i != storages.end(); ++i)
  {
    Int_t ss = (*i)->Size();
    for (Int_t j = 0; j < ss; ++j)
    {
      CalculateEnergy((*i)->GetX(j), (*i)->GetY(j), k, p);

      tv.push_back((*i)->GetX(j));
      kv.push_back(k);
      pv.push_back(p);
      sv.push_back(k + p);
    }
  }

  {
    GMutexHolder lock_storage(mStorageCond);
    for (vector<Storage*>::iterator i = storages.begin(); i != storages.end(); ++i)
    {
      (*i)->DecRefCnt();
    }
  }

  TGraph *kg = new TGraph(tv.size(), &tv[0], &kv[0]);
  TGraph *pg = new TGraph(tv.size(), &tv[0], &pv[0]);
  TGraph *sg = new TGraph(tv.size(), &tv[0], &sv[0]);

  TCanvas *canvas = XTReqCanvas::Request("SolarSystemEnergy", "SolarSystemEnergy",
					 1536, 480, 3, 1);
  canvas->cd(1);
  kg->Draw("al");
  canvas->cd(2);
  pg->Draw("al");
  canvas->cd(3);
  sg->Draw("al");

  XTReqPadUpdate::Update(canvas);
}
 SolarSystem.cxx:1
 SolarSystem.cxx:2
 SolarSystem.cxx:3
 SolarSystem.cxx:4
 SolarSystem.cxx:5
 SolarSystem.cxx:6
 SolarSystem.cxx:7
 SolarSystem.cxx:8
 SolarSystem.cxx:9
 SolarSystem.cxx:10
 SolarSystem.cxx:11
 SolarSystem.cxx:12
 SolarSystem.cxx:13
 SolarSystem.cxx:14
 SolarSystem.cxx:15
 SolarSystem.cxx:16
 SolarSystem.cxx:17
 SolarSystem.cxx:18
 SolarSystem.cxx:19
 SolarSystem.cxx:20
 SolarSystem.cxx:21
 SolarSystem.cxx:22
 SolarSystem.cxx:23
 SolarSystem.cxx:24
 SolarSystem.cxx:25
 SolarSystem.cxx:26
 SolarSystem.cxx:27
 SolarSystem.cxx:28
 SolarSystem.cxx:29
 SolarSystem.cxx:30
 SolarSystem.cxx:31
 SolarSystem.cxx:32
 SolarSystem.cxx:33
 SolarSystem.cxx:34
 SolarSystem.cxx:35
 SolarSystem.cxx:36
 SolarSystem.cxx:37
 SolarSystem.cxx:38
 SolarSystem.cxx:39
 SolarSystem.cxx:40
 SolarSystem.cxx:41
 SolarSystem.cxx:42
 SolarSystem.cxx:43
 SolarSystem.cxx:44
 SolarSystem.cxx:45
 SolarSystem.cxx:46
 SolarSystem.cxx:47
 SolarSystem.cxx:48
 SolarSystem.cxx:49
 SolarSystem.cxx:50
 SolarSystem.cxx:51
 SolarSystem.cxx:52
 SolarSystem.cxx:53
 SolarSystem.cxx:54
 SolarSystem.cxx:55
 SolarSystem.cxx:56
 SolarSystem.cxx:57
 SolarSystem.cxx:58
 SolarSystem.cxx:59
 SolarSystem.cxx:60
 SolarSystem.cxx:61
 SolarSystem.cxx:62
 SolarSystem.cxx:63
 SolarSystem.cxx:64
 SolarSystem.cxx:65
 SolarSystem.cxx:66
 SolarSystem.cxx:67
 SolarSystem.cxx:68
 SolarSystem.cxx:69
 SolarSystem.cxx:70
 SolarSystem.cxx:71
 SolarSystem.cxx:72
 SolarSystem.cxx:73
 SolarSystem.cxx:74
 SolarSystem.cxx:75
 SolarSystem.cxx:76
 SolarSystem.cxx:77
 SolarSystem.cxx:78
 SolarSystem.cxx:79
 SolarSystem.cxx:80
 SolarSystem.cxx:81
 SolarSystem.cxx:82
 SolarSystem.cxx:83
 SolarSystem.cxx:84
 SolarSystem.cxx:85
 SolarSystem.cxx:86
 SolarSystem.cxx:87
 SolarSystem.cxx:88
 SolarSystem.cxx:89
 SolarSystem.cxx:90
 SolarSystem.cxx:91
 SolarSystem.cxx:92
 SolarSystem.cxx:93
 SolarSystem.cxx:94
 SolarSystem.cxx:95
 SolarSystem.cxx:96
 SolarSystem.cxx:97
 SolarSystem.cxx:98
 SolarSystem.cxx:99
 SolarSystem.cxx:100
 SolarSystem.cxx:101
 SolarSystem.cxx:102
 SolarSystem.cxx:103
 SolarSystem.cxx:104
 SolarSystem.cxx:105
 SolarSystem.cxx:106
 SolarSystem.cxx:107
 SolarSystem.cxx:108
 SolarSystem.cxx:109
 SolarSystem.cxx:110
 SolarSystem.cxx:111
 SolarSystem.cxx:112
 SolarSystem.cxx:113
 SolarSystem.cxx:114
 SolarSystem.cxx:115
 SolarSystem.cxx:116
 SolarSystem.cxx:117
 SolarSystem.cxx:118
 SolarSystem.cxx:119
 SolarSystem.cxx:120
 SolarSystem.cxx:121
 SolarSystem.cxx:122
 SolarSystem.cxx:123
 SolarSystem.cxx:124
 SolarSystem.cxx:125
 SolarSystem.cxx:126
 SolarSystem.cxx:127
 SolarSystem.cxx:128
 SolarSystem.cxx:129
 SolarSystem.cxx:130
 SolarSystem.cxx:131
 SolarSystem.cxx:132
 SolarSystem.cxx:133
 SolarSystem.cxx:134
 SolarSystem.cxx:135
 SolarSystem.cxx:136
 SolarSystem.cxx:137
 SolarSystem.cxx:138
 SolarSystem.cxx:139
 SolarSystem.cxx:140
 SolarSystem.cxx:141
 SolarSystem.cxx:142
 SolarSystem.cxx:143
 SolarSystem.cxx:144
 SolarSystem.cxx:145
 SolarSystem.cxx:146
 SolarSystem.cxx:147
 SolarSystem.cxx:148
 SolarSystem.cxx:149
 SolarSystem.cxx:150
 SolarSystem.cxx:151
 SolarSystem.cxx:152
 SolarSystem.cxx:153
 SolarSystem.cxx:154
 SolarSystem.cxx:155
 SolarSystem.cxx:156
 SolarSystem.cxx:157
 SolarSystem.cxx:158
 SolarSystem.cxx:159
 SolarSystem.cxx:160
 SolarSystem.cxx:161
 SolarSystem.cxx:162
 SolarSystem.cxx:163
 SolarSystem.cxx:164
 SolarSystem.cxx:165
 SolarSystem.cxx:166
 SolarSystem.cxx:167
 SolarSystem.cxx:168
 SolarSystem.cxx:169
 SolarSystem.cxx:170
 SolarSystem.cxx:171
 SolarSystem.cxx:172
 SolarSystem.cxx:173
 SolarSystem.cxx:174
 SolarSystem.cxx:175
 SolarSystem.cxx:176
 SolarSystem.cxx:177
 SolarSystem.cxx:178
 SolarSystem.cxx:179
 SolarSystem.cxx:180
 SolarSystem.cxx:181
 SolarSystem.cxx:182
 SolarSystem.cxx:183
 SolarSystem.cxx:184
 SolarSystem.cxx:185
 SolarSystem.cxx:186
 SolarSystem.cxx:187
 SolarSystem.cxx:188
 SolarSystem.cxx:189
 SolarSystem.cxx:190
 SolarSystem.cxx:191
 SolarSystem.cxx:192
 SolarSystem.cxx:193
 SolarSystem.cxx:194
 SolarSystem.cxx:195
 SolarSystem.cxx:196
 SolarSystem.cxx:197
 SolarSystem.cxx:198
 SolarSystem.cxx:199
 SolarSystem.cxx:200
 SolarSystem.cxx:201
 SolarSystem.cxx:202
 SolarSystem.cxx:203
 SolarSystem.cxx:204
 SolarSystem.cxx:205
 SolarSystem.cxx:206
 SolarSystem.cxx:207
 SolarSystem.cxx:208
 SolarSystem.cxx:209
 SolarSystem.cxx:210
 SolarSystem.cxx:211
 SolarSystem.cxx:212
 SolarSystem.cxx:213
 SolarSystem.cxx:214
 SolarSystem.cxx:215
 SolarSystem.cxx:216
 SolarSystem.cxx:217
 SolarSystem.cxx:218
 SolarSystem.cxx:219
 SolarSystem.cxx:220
 SolarSystem.cxx:221
 SolarSystem.cxx:222
 SolarSystem.cxx:223
 SolarSystem.cxx:224
 SolarSystem.cxx:225
 SolarSystem.cxx:226
 SolarSystem.cxx:227
 SolarSystem.cxx:228
 SolarSystem.cxx:229
 SolarSystem.cxx:230
 SolarSystem.cxx:231
 SolarSystem.cxx:232
 SolarSystem.cxx:233
 SolarSystem.cxx:234
 SolarSystem.cxx:235
 SolarSystem.cxx:236
 SolarSystem.cxx:237
 SolarSystem.cxx:238
 SolarSystem.cxx:239
 SolarSystem.cxx:240
 SolarSystem.cxx:241
 SolarSystem.cxx:242
 SolarSystem.cxx:243
 SolarSystem.cxx:244
 SolarSystem.cxx:245
 SolarSystem.cxx:246
 SolarSystem.cxx:247
 SolarSystem.cxx:248
 SolarSystem.cxx:249
 SolarSystem.cxx:250
 SolarSystem.cxx:251
 SolarSystem.cxx:252
 SolarSystem.cxx:253
 SolarSystem.cxx:254
 SolarSystem.cxx:255
 SolarSystem.cxx:256
 SolarSystem.cxx:257
 SolarSystem.cxx:258
 SolarSystem.cxx:259
 SolarSystem.cxx:260
 SolarSystem.cxx:261
 SolarSystem.cxx:262
 SolarSystem.cxx:263
 SolarSystem.cxx:264
 SolarSystem.cxx:265
 SolarSystem.cxx:266
 SolarSystem.cxx:267
 SolarSystem.cxx:268
 SolarSystem.cxx:269
 SolarSystem.cxx:270
 SolarSystem.cxx:271
 SolarSystem.cxx:272
 SolarSystem.cxx:273
 SolarSystem.cxx:274
 SolarSystem.cxx:275
 SolarSystem.cxx:276
 SolarSystem.cxx:277
 SolarSystem.cxx:278
 SolarSystem.cxx:279
 SolarSystem.cxx:280
 SolarSystem.cxx:281
 SolarSystem.cxx:282
 SolarSystem.cxx:283
 SolarSystem.cxx:284
 SolarSystem.cxx:285
 SolarSystem.cxx:286
 SolarSystem.cxx:287
 SolarSystem.cxx:288
 SolarSystem.cxx:289
 SolarSystem.cxx:290
 SolarSystem.cxx:291
 SolarSystem.cxx:292
 SolarSystem.cxx:293
 SolarSystem.cxx:294
 SolarSystem.cxx:295
 SolarSystem.cxx:296
 SolarSystem.cxx:297
 SolarSystem.cxx:298
 SolarSystem.cxx:299
 SolarSystem.cxx:300
 SolarSystem.cxx:301
 SolarSystem.cxx:302
 SolarSystem.cxx:303
 SolarSystem.cxx:304
 SolarSystem.cxx:305
 SolarSystem.cxx:306
 SolarSystem.cxx:307
 SolarSystem.cxx:308
 SolarSystem.cxx:309
 SolarSystem.cxx:310
 SolarSystem.cxx:311
 SolarSystem.cxx:312
 SolarSystem.cxx:313
 SolarSystem.cxx:314
 SolarSystem.cxx:315
 SolarSystem.cxx:316
 SolarSystem.cxx:317
 SolarSystem.cxx:318
 SolarSystem.cxx:319
 SolarSystem.cxx:320
 SolarSystem.cxx:321
 SolarSystem.cxx:322
 SolarSystem.cxx:323
 SolarSystem.cxx:324
 SolarSystem.cxx:325
 SolarSystem.cxx:326
 SolarSystem.cxx:327
 SolarSystem.cxx:328
 SolarSystem.cxx:329
 SolarSystem.cxx:330
 SolarSystem.cxx:331
 SolarSystem.cxx:332
 SolarSystem.cxx:333
 SolarSystem.cxx:334
 SolarSystem.cxx:335
 SolarSystem.cxx:336
 SolarSystem.cxx:337
 SolarSystem.cxx:338
 SolarSystem.cxx:339
 SolarSystem.cxx:340
 SolarSystem.cxx:341
 SolarSystem.cxx:342
 SolarSystem.cxx:343
 SolarSystem.cxx:344
 SolarSystem.cxx:345
 SolarSystem.cxx:346
 SolarSystem.cxx:347
 SolarSystem.cxx:348
 SolarSystem.cxx:349
 SolarSystem.cxx:350
 SolarSystem.cxx:351
 SolarSystem.cxx:352
 SolarSystem.cxx:353
 SolarSystem.cxx:354
 SolarSystem.cxx:355
 SolarSystem.cxx:356
 SolarSystem.cxx:357
 SolarSystem.cxx:358
 SolarSystem.cxx:359
 SolarSystem.cxx:360
 SolarSystem.cxx:361
 SolarSystem.cxx:362
 SolarSystem.cxx:363
 SolarSystem.cxx:364
 SolarSystem.cxx:365
 SolarSystem.cxx:366
 SolarSystem.cxx:367
 SolarSystem.cxx:368
 SolarSystem.cxx:369
 SolarSystem.cxx:370
 SolarSystem.cxx:371
 SolarSystem.cxx:372
 SolarSystem.cxx:373
 SolarSystem.cxx:374
 SolarSystem.cxx:375
 SolarSystem.cxx:376
 SolarSystem.cxx:377
 SolarSystem.cxx:378
 SolarSystem.cxx:379
 SolarSystem.cxx:380
 SolarSystem.cxx:381
 SolarSystem.cxx:382
 SolarSystem.cxx:383
 SolarSystem.cxx:384
 SolarSystem.cxx:385
 SolarSystem.cxx:386
 SolarSystem.cxx:387
 SolarSystem.cxx:388
 SolarSystem.cxx:389
 SolarSystem.cxx:390
 SolarSystem.cxx:391
 SolarSystem.cxx:392
 SolarSystem.cxx:393
 SolarSystem.cxx:394
 SolarSystem.cxx:395
 SolarSystem.cxx:396
 SolarSystem.cxx:397
 SolarSystem.cxx:398
 SolarSystem.cxx:399
 SolarSystem.cxx:400
 SolarSystem.cxx:401
 SolarSystem.cxx:402
 SolarSystem.cxx:403
 SolarSystem.cxx:404
 SolarSystem.cxx:405
 SolarSystem.cxx:406
 SolarSystem.cxx:407
 SolarSystem.cxx:408
 SolarSystem.cxx:409
 SolarSystem.cxx:410
 SolarSystem.cxx:411
 SolarSystem.cxx:412
 SolarSystem.cxx:413
 SolarSystem.cxx:414
 SolarSystem.cxx:415
 SolarSystem.cxx:416
 SolarSystem.cxx:417
 SolarSystem.cxx:418
 SolarSystem.cxx:419
 SolarSystem.cxx:420
 SolarSystem.cxx:421
 SolarSystem.cxx:422
 SolarSystem.cxx:423
 SolarSystem.cxx:424
 SolarSystem.cxx:425
 SolarSystem.cxx:426
 SolarSystem.cxx:427
 SolarSystem.cxx:428
 SolarSystem.cxx:429
 SolarSystem.cxx:430
 SolarSystem.cxx:431
 SolarSystem.cxx:432
 SolarSystem.cxx:433
 SolarSystem.cxx:434
 SolarSystem.cxx:435
 SolarSystem.cxx:436
 SolarSystem.cxx:437
 SolarSystem.cxx:438
 SolarSystem.cxx:439
 SolarSystem.cxx:440
 SolarSystem.cxx:441
 SolarSystem.cxx:442
 SolarSystem.cxx:443
 SolarSystem.cxx:444
 SolarSystem.cxx:445
 SolarSystem.cxx:446
 SolarSystem.cxx:447
 SolarSystem.cxx:448
 SolarSystem.cxx:449
 SolarSystem.cxx:450
 SolarSystem.cxx:451
 SolarSystem.cxx:452
 SolarSystem.cxx:453
 SolarSystem.cxx:454
 SolarSystem.cxx:455
 SolarSystem.cxx:456
 SolarSystem.cxx:457
 SolarSystem.cxx:458
 SolarSystem.cxx:459
 SolarSystem.cxx:460
 SolarSystem.cxx:461
 SolarSystem.cxx:462
 SolarSystem.cxx:463
 SolarSystem.cxx:464
 SolarSystem.cxx:465
 SolarSystem.cxx:466
 SolarSystem.cxx:467
 SolarSystem.cxx:468
 SolarSystem.cxx:469
 SolarSystem.cxx:470
 SolarSystem.cxx:471
 SolarSystem.cxx:472
 SolarSystem.cxx:473
 SolarSystem.cxx:474
 SolarSystem.cxx:475
 SolarSystem.cxx:476
 SolarSystem.cxx:477
 SolarSystem.cxx:478
 SolarSystem.cxx:479
 SolarSystem.cxx:480
 SolarSystem.cxx:481
 SolarSystem.cxx:482
 SolarSystem.cxx:483
 SolarSystem.cxx:484
 SolarSystem.cxx:485
 SolarSystem.cxx:486
 SolarSystem.cxx:487
 SolarSystem.cxx:488
 SolarSystem.cxx:489
 SolarSystem.cxx:490
 SolarSystem.cxx:491
 SolarSystem.cxx:492
 SolarSystem.cxx:493
 SolarSystem.cxx:494
 SolarSystem.cxx:495
 SolarSystem.cxx:496
 SolarSystem.cxx:497
 SolarSystem.cxx:498
 SolarSystem.cxx:499
 SolarSystem.cxx:500
 SolarSystem.cxx:501
 SolarSystem.cxx:502
 SolarSystem.cxx:503
 SolarSystem.cxx:504
 SolarSystem.cxx:505
 SolarSystem.cxx:506
 SolarSystem.cxx:507
 SolarSystem.cxx:508
 SolarSystem.cxx:509
 SolarSystem.cxx:510
 SolarSystem.cxx:511
 SolarSystem.cxx:512
 SolarSystem.cxx:513
 SolarSystem.cxx:514
 SolarSystem.cxx:515
 SolarSystem.cxx:516
 SolarSystem.cxx:517
 SolarSystem.cxx:518
 SolarSystem.cxx:519
 SolarSystem.cxx:520
 SolarSystem.cxx:521
 SolarSystem.cxx:522
 SolarSystem.cxx:523
 SolarSystem.cxx:524
 SolarSystem.cxx:525
 SolarSystem.cxx:526
 SolarSystem.cxx:527
 SolarSystem.cxx:528
 SolarSystem.cxx:529
 SolarSystem.cxx:530
 SolarSystem.cxx:531
 SolarSystem.cxx:532
 SolarSystem.cxx:533
 SolarSystem.cxx:534
 SolarSystem.cxx:535
 SolarSystem.cxx:536
 SolarSystem.cxx:537
 SolarSystem.cxx:538
 SolarSystem.cxx:539
 SolarSystem.cxx:540
 SolarSystem.cxx:541
 SolarSystem.cxx:542
 SolarSystem.cxx:543
 SolarSystem.cxx:544
 SolarSystem.cxx:545
 SolarSystem.cxx:546
 SolarSystem.cxx:547
 SolarSystem.cxx:548
 SolarSystem.cxx:549
 SolarSystem.cxx:550
 SolarSystem.cxx:551
 SolarSystem.cxx:552
 SolarSystem.cxx:553
 SolarSystem.cxx:554
 SolarSystem.cxx:555
 SolarSystem.cxx:556
 SolarSystem.cxx:557
 SolarSystem.cxx:558
 SolarSystem.cxx:559
 SolarSystem.cxx:560
 SolarSystem.cxx:561
 SolarSystem.cxx:562
 SolarSystem.cxx:563
 SolarSystem.cxx:564
 SolarSystem.cxx:565
 SolarSystem.cxx:566
 SolarSystem.cxx:567
 SolarSystem.cxx:568
 SolarSystem.cxx:569
 SolarSystem.cxx:570
 SolarSystem.cxx:571
 SolarSystem.cxx:572
 SolarSystem.cxx:573
 SolarSystem.cxx:574
 SolarSystem.cxx:575
 SolarSystem.cxx:576
 SolarSystem.cxx:577
 SolarSystem.cxx:578
 SolarSystem.cxx:579
 SolarSystem.cxx:580
 SolarSystem.cxx:581
 SolarSystem.cxx:582
 SolarSystem.cxx:583
 SolarSystem.cxx:584
 SolarSystem.cxx:585
 SolarSystem.cxx:586
 SolarSystem.cxx:587
 SolarSystem.cxx:588
 SolarSystem.cxx:589
 SolarSystem.cxx:590
 SolarSystem.cxx:591
 SolarSystem.cxx:592
 SolarSystem.cxx:593
 SolarSystem.cxx:594
 SolarSystem.cxx:595
 SolarSystem.cxx:596
 SolarSystem.cxx:597
 SolarSystem.cxx:598
 SolarSystem.cxx:599
 SolarSystem.cxx:600
 SolarSystem.cxx:601
 SolarSystem.cxx:602
 SolarSystem.cxx:603
 SolarSystem.cxx:604
 SolarSystem.cxx:605
 SolarSystem.cxx:606
 SolarSystem.cxx:607
 SolarSystem.cxx:608
 SolarSystem.cxx:609
 SolarSystem.cxx:610
 SolarSystem.cxx:611
 SolarSystem.cxx:612
 SolarSystem.cxx:613
 SolarSystem.cxx:614
 SolarSystem.cxx:615
 SolarSystem.cxx:616
 SolarSystem.cxx:617
 SolarSystem.cxx:618
 SolarSystem.cxx:619
 SolarSystem.cxx:620
 SolarSystem.cxx:621
 SolarSystem.cxx:622
 SolarSystem.cxx:623
 SolarSystem.cxx:624
 SolarSystem.cxx:625
 SolarSystem.cxx:626
 SolarSystem.cxx:627
 SolarSystem.cxx:628
 SolarSystem.cxx:629
 SolarSystem.cxx:630
 SolarSystem.cxx:631
 SolarSystem.cxx:632
 SolarSystem.cxx:633
 SolarSystem.cxx:634
 SolarSystem.cxx:635
 SolarSystem.cxx:636
 SolarSystem.cxx:637
 SolarSystem.cxx:638
 SolarSystem.cxx:639
 SolarSystem.cxx:640
 SolarSystem.cxx:641
 SolarSystem.cxx:642
 SolarSystem.cxx:643
 SolarSystem.cxx:644
 SolarSystem.cxx:645
 SolarSystem.cxx:646
 SolarSystem.cxx:647
 SolarSystem.cxx:648
 SolarSystem.cxx:649
 SolarSystem.cxx:650
 SolarSystem.cxx:651
 SolarSystem.cxx:652
 SolarSystem.cxx:653
 SolarSystem.cxx:654
 SolarSystem.cxx:655
 SolarSystem.cxx:656
 SolarSystem.cxx:657
 SolarSystem.cxx:658
 SolarSystem.cxx:659
 SolarSystem.cxx:660
 SolarSystem.cxx:661
 SolarSystem.cxx:662
 SolarSystem.cxx:663
 SolarSystem.cxx:664
 SolarSystem.cxx:665
 SolarSystem.cxx:666
 SolarSystem.cxx:667
 SolarSystem.cxx:668
 SolarSystem.cxx:669
 SolarSystem.cxx:670
 SolarSystem.cxx:671
 SolarSystem.cxx:672
 SolarSystem.cxx:673
 SolarSystem.cxx:674
 SolarSystem.cxx:675
 SolarSystem.cxx:676
 SolarSystem.cxx:677
 SolarSystem.cxx:678
 SolarSystem.cxx:679
 SolarSystem.cxx:680
 SolarSystem.cxx:681
 SolarSystem.cxx:682
 SolarSystem.cxx:683
 SolarSystem.cxx:684
 SolarSystem.cxx:685
 SolarSystem.cxx:686
 SolarSystem.cxx:687
 SolarSystem.cxx:688
 SolarSystem.cxx:689
 SolarSystem.cxx:690
 SolarSystem.cxx:691
 SolarSystem.cxx:692
 SolarSystem.cxx:693
 SolarSystem.cxx:694
 SolarSystem.cxx:695
 SolarSystem.cxx:696
 SolarSystem.cxx:697
 SolarSystem.cxx:698
 SolarSystem.cxx:699
 SolarSystem.cxx:700
 SolarSystem.cxx:701
 SolarSystem.cxx:702
 SolarSystem.cxx:703
 SolarSystem.cxx:704
 SolarSystem.cxx:705
 SolarSystem.cxx:706
 SolarSystem.cxx:707
 SolarSystem.cxx:708
 SolarSystem.cxx:709
 SolarSystem.cxx:710
 SolarSystem.cxx:711
 SolarSystem.cxx:712
 SolarSystem.cxx:713
 SolarSystem.cxx:714
 SolarSystem.cxx:715
 SolarSystem.cxx:716
 SolarSystem.cxx:717
 SolarSystem.cxx:718
 SolarSystem.cxx:719
 SolarSystem.cxx:720
 SolarSystem.cxx:721
 SolarSystem.cxx:722
 SolarSystem.cxx:723
 SolarSystem.cxx:724
 SolarSystem.cxx:725
 SolarSystem.cxx:726
 SolarSystem.cxx:727
 SolarSystem.cxx:728
 SolarSystem.cxx:729
 SolarSystem.cxx:730
 SolarSystem.cxx:731
 SolarSystem.cxx:732
 SolarSystem.cxx:733
 SolarSystem.cxx:734
 SolarSystem.cxx:735
 SolarSystem.cxx:736
 SolarSystem.cxx:737
 SolarSystem.cxx:738
 SolarSystem.cxx:739
 SolarSystem.cxx:740
 SolarSystem.cxx:741
 SolarSystem.cxx:742
 SolarSystem.cxx:743
 SolarSystem.cxx:744
 SolarSystem.cxx:745
 SolarSystem.cxx:746
 SolarSystem.cxx:747
 SolarSystem.cxx:748
 SolarSystem.cxx:749
 SolarSystem.cxx:750
 SolarSystem.cxx:751
 SolarSystem.cxx:752
 SolarSystem.cxx:753
 SolarSystem.cxx:754
 SolarSystem.cxx:755
 SolarSystem.cxx:756
 SolarSystem.cxx:757
 SolarSystem.cxx:758
 SolarSystem.cxx:759
 SolarSystem.cxx:760
 SolarSystem.cxx:761
 SolarSystem.cxx:762
 SolarSystem.cxx:763
 SolarSystem.cxx:764
 SolarSystem.cxx:765
 SolarSystem.cxx:766
 SolarSystem.cxx:767
 SolarSystem.cxx:768
 SolarSystem.cxx:769
 SolarSystem.cxx:770
 SolarSystem.cxx:771
 SolarSystem.cxx:772
 SolarSystem.cxx:773
 SolarSystem.cxx:774
 SolarSystem.cxx:775
 SolarSystem.cxx:776
 SolarSystem.cxx:777
 SolarSystem.cxx:778
 SolarSystem.cxx:779
 SolarSystem.cxx:780
 SolarSystem.cxx:781
 SolarSystem.cxx:782
 SolarSystem.cxx:783
 SolarSystem.cxx:784
 SolarSystem.cxx:785
 SolarSystem.cxx:786
 SolarSystem.cxx:787
 SolarSystem.cxx:788
 SolarSystem.cxx:789
 SolarSystem.cxx:790
 SolarSystem.cxx:791
 SolarSystem.cxx:792
 SolarSystem.cxx:793
 SolarSystem.cxx:794
 SolarSystem.cxx:795
 SolarSystem.cxx:796
 SolarSystem.cxx:797
 SolarSystem.cxx:798
 SolarSystem.cxx:799
 SolarSystem.cxx:800
 SolarSystem.cxx:801
 SolarSystem.cxx:802
 SolarSystem.cxx:803
 SolarSystem.cxx:804
 SolarSystem.cxx:805
 SolarSystem.cxx:806
 SolarSystem.cxx:807
 SolarSystem.cxx:808
 SolarSystem.cxx:809
 SolarSystem.cxx:810
 SolarSystem.cxx:811
 SolarSystem.cxx:812
 SolarSystem.cxx:813
 SolarSystem.cxx:814
 SolarSystem.cxx:815
 SolarSystem.cxx:816
 SolarSystem.cxx:817
 SolarSystem.cxx:818
 SolarSystem.cxx:819
 SolarSystem.cxx:820
 SolarSystem.cxx:821
 SolarSystem.cxx:822
 SolarSystem.cxx:823
 SolarSystem.cxx:824
 SolarSystem.cxx:825
 SolarSystem.cxx:826
 SolarSystem.cxx:827
 SolarSystem.cxx:828
 SolarSystem.cxx:829
 SolarSystem.cxx:830
 SolarSystem.cxx:831
 SolarSystem.cxx:832
 SolarSystem.cxx:833
 SolarSystem.cxx:834
 SolarSystem.cxx:835
 SolarSystem.cxx:836
 SolarSystem.cxx:837
 SolarSystem.cxx:838
 SolarSystem.cxx:839
 SolarSystem.cxx:840
 SolarSystem.cxx:841
 SolarSystem.cxx:842
 SolarSystem.cxx:843
 SolarSystem.cxx:844
 SolarSystem.cxx:845
 SolarSystem.cxx:846
 SolarSystem.cxx:847
 SolarSystem.cxx:848
 SolarSystem.cxx:849
 SolarSystem.cxx:850
 SolarSystem.cxx:851
 SolarSystem.cxx:852
 SolarSystem.cxx:853
 SolarSystem.cxx:854
 SolarSystem.cxx:855
 SolarSystem.cxx:856
 SolarSystem.cxx:857
 SolarSystem.cxx:858
 SolarSystem.cxx:859
 SolarSystem.cxx:860
 SolarSystem.cxx:861
 SolarSystem.cxx:862
 SolarSystem.cxx:863
 SolarSystem.cxx:864
 SolarSystem.cxx:865
 SolarSystem.cxx:866
 SolarSystem.cxx:867
 SolarSystem.cxx:868
 SolarSystem.cxx:869
 SolarSystem.cxx:870
 SolarSystem.cxx:871
 SolarSystem.cxx:872
 SolarSystem.cxx:873
 SolarSystem.cxx:874
 SolarSystem.cxx:875
 SolarSystem.cxx:876
 SolarSystem.cxx:877
 SolarSystem.cxx:878
 SolarSystem.cxx:879
 SolarSystem.cxx:880
 SolarSystem.cxx:881
 SolarSystem.cxx:882
 SolarSystem.cxx:883
 SolarSystem.cxx:884
 SolarSystem.cxx:885
 SolarSystem.cxx:886
 SolarSystem.cxx:887
 SolarSystem.cxx:888
 SolarSystem.cxx:889
 SolarSystem.cxx:890
 SolarSystem.cxx:891
 SolarSystem.cxx:892
 SolarSystem.cxx:893
 SolarSystem.cxx:894
 SolarSystem.cxx:895
 SolarSystem.cxx:896
 SolarSystem.cxx:897
 SolarSystem.cxx:898
 SolarSystem.cxx:899
 SolarSystem.cxx:900
 SolarSystem.cxx:901
 SolarSystem.cxx:902
 SolarSystem.cxx:903
 SolarSystem.cxx:904
 SolarSystem.cxx:905
 SolarSystem.cxx:906
 SolarSystem.cxx:907
 SolarSystem.cxx:908
 SolarSystem.cxx:909
 SolarSystem.cxx:910
 SolarSystem.cxx:911
 SolarSystem.cxx:912
 SolarSystem.cxx:913
 SolarSystem.cxx:914
 SolarSystem.cxx:915
 SolarSystem.cxx:916
 SolarSystem.cxx:917
 SolarSystem.cxx:918
 SolarSystem.cxx:919
 SolarSystem.cxx:920