Relativistic Class Reference

#include <orsa_interaction.h>

Inheritance diagram for Relativistic:

Inheritance graph
[legend]
Collaboration diagram for Relativistic:

Collaboration graph
[legend]
List of all members.

Public Member Functions

 Relativistic ()
 Relativistic (const Relativistic &)
void Acceleration (const Frame &, std::vector< Vector > &)
double PotentialEnergy (const Frame &)
Interactionclone () const
InteractionType GetType () const
bool depends_on_velocity () const
void SkipJPLPlanets (const bool b)
bool IsSkippingJPLPlanets () const

Protected Attributes

bool skip_JPL_planets

Constructor & Destructor Documentation

Relativistic  ) 
 

Definition at line 640 of file orsa_interaction.cc.

References orsa::GetC(), and orsa::GetG().

Referenced by Relativistic::clone().

00640                              : Interaction(), g(GetG()), c_2(GetC()*GetC()) {
00641     
00642   }

Here is the call graph for this function:

Relativistic const Relativistic  ) 
 

Definition at line 644 of file orsa_interaction.cc.

References orsa::GetC(), and orsa::GetG().

00644                                                  : Interaction(), g(GetG()), c_2(GetC()*GetC()) {
00645     
00646   }

Here is the call graph for this function:


Member Function Documentation

void Acceleration const Frame ,
std::vector< Vector > & 
[virtual]
 

Implements Interaction.

Definition at line 656 of file orsa_interaction.cc.

References Vector::IsZero(), Vector::Length(), Vector::LengthSquared(), ORSA_WARNING, and Vector::Set().

00656                                                                    {
00657     
00658     if (f.size() < 2) return;
00659     
00660     a.resize(f.size());
00661     
00662     unsigned int i,j;
00663     
00664     for (i=0;i<a.size();++i)
00665       a[i].Set(0,0,0);
00666     
00667     Vector r;
00668     Vector v;
00669     
00670     double r_1, r_3;
00671     
00672     for (i=1;i<f.size();++i) {
00673       
00674       for (j=0;j<i;++j) {
00675         
00676         /*** acc. on 'i' due to 'j' ***/
00677         
00678         if ((f[i].mass()==0) && (f[j].mass()==0)) continue;
00679         
00680         // 'i' - 'j'
00681         r = f[i].position() - f[j].position();
00682         v = f[i].velocity() - f[j].velocity();
00683         
00684         if (r.IsZero()) {
00685           ORSA_WARNING("two objects in the same position! (%s and %s)",f[i].name().c_str(),f[j].name().c_str());
00686           continue;
00687         }
00688         
00689         r_1 = r.Length();
00690         r_3 = r.LengthSquared()*r_1;
00691         
00692         a[i] -= f[j].mass()/r_3*r + f[j].mass()/(r_3*c_2)*((4.0*g*f[j].mass()/r_1-v.LengthSquared())*r + 4.0*(r*v)*v);
00693         
00694         // now, acc. on 'j' due to 'i' so r -> -r and v -> -v ***/
00695         //
00696         a[j] += f[i].mass()/r_3*r + f[i].mass()/(r_3*c_2)*((4.0*g*f[i].mass()/r_1-v.LengthSquared())*r + 4.0*(r*v)*v);
00697         
00698       } 
00699       
00700     } 
00701     
00702     for (i=0;i<a.size();++i) a[i] *= g;
00703   }

Here is the call graph for this function:

Interaction * clone  )  const [virtual]
 

Implements Interaction.

Definition at line 648 of file orsa_interaction.cc.

References Relativistic::Relativistic().

00648                                           {
00649     return new Relativistic(*this);
00650   }

Here is the call graph for this function:

bool depends_on_velocity  )  const [inline, virtual]
 

Reimplemented from Interaction.

Definition at line 394 of file orsa_interaction.h.

00394 { return true; }

InteractionType GetType  )  const [inline, virtual]
 

Implements Interaction.

Definition at line 389 of file orsa_interaction.h.

References orsa::RELATIVISTIC.

00389                                     {
00390       return RELATIVISTIC;
00391     }

bool IsSkippingJPLPlanets  )  const [inline, inherited]
 

Definition at line 98 of file orsa_interaction.h.

References Interaction::skip_JPL_planets.

Referenced by Evolution::Integrate().

00098                                       {
00099       return skip_JPL_planets;
00100     }

double PotentialEnergy const Frame  )  [virtual]
 

Implements Interaction.

Definition at line 705 of file orsa_interaction.cc.

References Newton::PotentialEnergy().

00705                                                      {
00706     Newton newton;
00707     return (newton.PotentialEnergy(f));
00708   }

Here is the call graph for this function:

void SkipJPLPlanets const bool  b  )  [inline, inherited]
 

Definition at line 95 of file orsa_interaction.h.

References Interaction::skip_JPL_planets.

Referenced by OrsaFile::Read().

00095                                       {
00096       skip_JPL_planets = b;
00097     }


Member Data Documentation

bool skip_JPL_planets [protected, inherited]
 

Definition at line 102 of file orsa_interaction.h.

Referenced by Interaction::IsSkippingJPLPlanets(), and Interaction::SkipJPLPlanets().


The documentation for this class was generated from the following files:
Generated on Tue Jan 11 15:29:20 2005 for liborsa by  doxygen 1.4.0