GalacticPotentialAllen Class Reference

#include <orsa_interaction.h>

Inheritance diagram for GalacticPotentialAllen:

Inheritance graph
[legend]
Collaboration diagram for GalacticPotentialAllen:

Collaboration graph
[legend]
List of all members.

Public Member Functions

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

Protected Attributes

bool skip_JPL_planets

Constructor & Destructor Documentation

GalacticPotentialAllen  ) 
 

Definition at line 831 of file orsa_interaction.cc.

References orsa::FromUnits(), orsa::GetG(), orsa::MSUN, and orsa::PARSEC.

Referenced by GalacticPotentialAllen::clone().

00831                                                  : Interaction() {
00832     
00833     g = GetG();
00834     
00835     mb = FromUnits(1.40592e10,   MSUN);
00836     bb = FromUnits(0.3873e3,     PARSEC);
00837     md = FromUnits(8.5608e10,    MSUN);     
00838     ad = FromUnits(5.3178e3,     PARSEC);     
00839     bd = FromUnits(0.25e3,       PARSEC);
00840     mh = FromUnits(10.3836745e10,MSUN);
00841     ah = FromUnits(12.0e3,       PARSEC); 
00842     
00843   }

Here is the call graph for this function:

GalacticPotentialAllen const GalacticPotentialAllen  ) 
 

Definition at line 846 of file orsa_interaction.cc.

References orsa::FromUnits(), orsa::GetG(), orsa::MSUN, and orsa::PARSEC.

00846                                                                                : Interaction() {
00847     
00848     g = GetG();
00849     
00850     mb = FromUnits(1.40592e10,   MSUN);
00851     bb = FromUnits(0.3873e3,     PARSEC);
00852     md = FromUnits(8.5608e10,    MSUN);     
00853     ad = FromUnits(5.3178e3,     PARSEC);     
00854     bd = FromUnits(0.25e3,       PARSEC);
00855     mh = FromUnits(10.3836745e10,MSUN);
00856     ah = FromUnits(12.0e3,       PARSEC); 
00857     
00858   }

Here is the call graph for this function:


Member Function Documentation

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

Implements Interaction.

Definition at line 864 of file orsa_interaction.cc.

References Vector::Length(), orsa::secure_pow(), Vector::Set(), Vector::x, Vector::y, and Vector::z.

00864                                                                              {
00865     
00866     a.resize(f.size());
00867     
00868     unsigned int i;
00869     for (i=0;i<a.size();++i) a[i].Set(0,0,0);
00870     
00871     double r2,z2,r,rho;
00872     double fbr,fdr,fhr,fhrc;
00873     double fbz,fdz,fhz,fhzc;
00874     double fr,fz;
00875     Vector x;
00876     
00877     for (i=0;i<f.size();++i) {
00878       
00879       // if (!f[i].StillAlive()) continue;
00880       
00881       x = f[i].position();
00882       
00883       // auxiliary components
00884       r2  = x.x*x.x+x.y*x.y;
00885       z2  = x.z*x.z;
00886       r   = sqrt(r2);
00887       rho = x.Length();
00888       
00889       // accel. components along the r direction
00890       fbr  = -(mb*r/(secure_pow(r2+z2+bb*bb,1.5)));
00891       fdr  = -(md*r/(secure_pow(r2+secure_pow(ad+sqrt(z2+bd*bd),2),1.5)));
00892       fhr  = 1.02*mh*r/(ah*ah*secure_pow(1+1.0/secure_pow(rho/ah,1.02),2)*secure_pow(rho/ah,2.02)*rho);
00893       fhrc = -(mh/(1.02*ah)*(1.0404*(r*secure_pow(rho/ah,0.02))/(ah*rho*secure_pow(1.0+secure_pow(rho/ah,1.02),2))+1.02*(r*secure_pow(rho/ah,0.02))/(ah*rho*(1.0+secure_pow(rho/ah,1.02)))));
00894       
00895       // accel. components along the z direction
00896       fbz  = -(mb*x.z/(secure_pow(r2+z2+bb*bb,1.5)));
00897       fdz  = -(md*x.z*(ad+sqrt(z2+bd*bd))/(sqrt(z2+bd*bd)*secure_pow(r2+secure_pow(ad+sqrt(z2+bd*bd),2),1.5)));
00898       fhz  = 1.02*mh*x.z/(ah*ah*secure_pow(1.0+1.0/secure_pow(rho/ah,1.02),2)*secure_pow(rho/ah,2.02)*rho);
00899       fhzc = -(mh/(1.02*ah)*(1.0404*(x.z*secure_pow(rho/ah,0.02))/(ah*rho*secure_pow(1.0+secure_pow(rho/ah,1.02),2))+1.02*(x.z*secure_pow(rho/ah,0.02))/(ah*rho*(1.0+secure_pow(rho/ah,1.02)))));
00900       
00901       fr=fbr+fdr+fhr+fhrc;
00902       fz=fbz+fdz+fhz+fhzc;
00903       
00904       a[i].x = fr*x.x/r;
00905       a[i].y = fr*x.y/r;
00906       a[i].z = fz;
00907     } 
00908     
00909     for (i=0;i<a.size();++i) a[i] *= g;
00910     
00911     // for (i=0;i<a.size();++i) printf("a[%i] = %g %g %g\n",i,a[i].x,a[i].y,a[i].z);
00912     
00913   }

Here is the call graph for this function:

Interaction * clone  )  const [virtual]
 

Implements Interaction.

Definition at line 860 of file orsa_interaction.cc.

References GalacticPotentialAllen::GalacticPotentialAllen().

00860                                                     {
00861     return new GalacticPotentialAllen(*this);
00862   }

Here is the call graph for this function:

virtual bool depends_on_velocity  )  const [inline, virtual, inherited]
 

Reimplemented in Newton, and Relativistic.

Definition at line 92 of file orsa_interaction.h.

00092 { return false; }

InteractionType GetType  )  const [inline, virtual]
 

Implements Interaction.

Definition at line 434 of file orsa_interaction.h.

References orsa::GALACTIC_POTENTIAL_ALLEN.

00434                                     {
00435       return GALACTIC_POTENTIAL_ALLEN;
00436     }

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 915 of file orsa_interaction.cc.

References Vector::Length(), orsa::secure_pow(), Vector::x, Vector::y, and Vector::z.

00915                                                                {
00916     
00917     // to be tested...
00918     
00919     double energy = 0.0;
00920     
00921     double pb,pd,ph;
00922     double r2,z2,r,rho;
00923     unsigned int i;
00924     Vector x;
00925     
00926     for (i=0;i<f.size();++i) {
00927       
00928       x = f[i].position();
00929       
00930       // auxiliary components
00931       r2  = x.x*x.x+x.y*x.y;
00932       z2  = x.z*x.z;
00933       r   = sqrt(r2);
00934       rho = x.Length();
00935       
00936       pb = mb/sqrt(r2+z2+bb*bb);
00937       pd = md/sqrt(r2+secure_pow(ad+sqrt(z2+bd*bd),2));
00938       ph = (mh/(rho/ah))*(secure_pow(rho/ah,2.02))/(1.0+secure_pow(rho/ah,1.02));
00939       
00940       energy -= (pb+pd+ph);
00941       
00942     } 
00943     
00944     return (energy*g);
00945   }

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:22 2005 for liborsa by  doxygen 1.4.0