#include <orsa_interaction.h>
Public Member Functions | |
Newton () | |
Newton (const Newton &) | |
void | Acceleration (const Frame &, std::vector< Vector > &) |
double | PotentialEnergy (const Frame &) |
bool | depends_on_velocity () const |
Interaction * | clone () const |
InteractionType | GetType () const |
void | IncludeMultipoleMoments (const bool b) |
bool | IsIncludingMultipoleMoments () const |
void | IncludeRelativisticEffects (const bool b) |
bool | IsIncludingRelativisticEffects () const |
void | IncludeFastRelativisticEffects (const bool b) |
bool | IsIncludingFastRelativisticEffects () const |
void | SkipJPLPlanets (const bool b) |
bool | IsSkippingJPLPlanets () const |
Protected Attributes | |
bool | skip_JPL_planets |
Definition at line 240 of file orsa_interaction.h.
Newton | ( | ) |
Definition at line 153 of file orsa_interaction.cc.
References Interaction::skip_JPL_planets.
Referenced by Newton::clone().
00153 : Interaction(), include_multipole_moments(false), include_relativistic_effects(false), include_fast_relativistic_effects(false), one_over_c2(1.0/(GetC()*GetC())) { 00154 skip_JPL_planets = false; 00155 }
Definition at line 157 of file orsa_interaction.cc.
References Interaction::skip_JPL_planets.
00157 : Interaction(), include_multipole_moments(n.include_multipole_moments), include_relativistic_effects(n.include_relativistic_effects), include_fast_relativistic_effects(n.include_fast_relativistic_effects), one_over_c2(1.0/(GetC()*GetC())) { 00158 skip_JPL_planets = n.skip_JPL_planets; 00159 }
double PotentialEnergy | ( | const Frame & | f | ) | [virtual] |
Implements Interaction.
Definition at line 601 of file orsa_interaction.cc.
References Vector::IsZero(), Vector::Length(), ORSA_WARNING, and Frame::size().
Referenced by GalacticPotentialAllenPlusNewton::PotentialEnergy(), JPLPlanetsNewton::PotentialEnergy(), and Relativistic::PotentialEnergy().
00601 { 00602 00603 if (f.size() < 2) return(0.0); 00604 00605 double energy = 0.0; 00606 00607 unsigned int i,j; 00608 00609 Vector d; 00610 00611 double l; 00612 00613 for (i=1;i<f.size();++i) { 00614 00615 if (f[i].mu()==0) continue; 00616 00617 for (j=0;j<i;++j) { 00618 00619 if (f[j].mu()==0) continue; 00620 00621 d = f[i].DistanceVector(f[j]); 00622 00623 l = d.Length(); 00624 00625 if (d.IsZero()) { 00626 ORSA_WARNING("two objects in the same position! (%s and %s)",f[i].name().c_str(),f[j].name().c_str()); 00627 continue; 00628 } 00629 00630 energy -= f[i].mu()*f[j].mass()/l; 00631 00632 } 00633 } 00634 00635 return (energy); 00636 }
bool depends_on_velocity | ( | ) | const [inline, virtual] |
Interaction * clone | ( | ) | const [virtual] |
Implements Interaction.
Definition at line 161 of file orsa_interaction.cc.
References Newton::Newton().
00161 { 00162 return new Newton(*this); 00163 }
InteractionType GetType | ( | ) | const [inline, virtual] |
Implements Interaction.
Definition at line 257 of file orsa_interaction.h.
References orsa::NEWTON.
00257 { 00258 return NEWTON; 00259 }
void IncludeMultipoleMoments | ( | const bool | b | ) | [inline] |
bool IsIncludingMultipoleMoments | ( | ) | const [inline] |
void IncludeRelativisticEffects | ( | const bool | b | ) | [inline] |
bool IsIncludingRelativisticEffects | ( | ) | const [inline] |
void IncludeFastRelativisticEffects | ( | const bool | b | ) | [inline] |
bool IsIncludingFastRelativisticEffects | ( | ) | const [inline] |
void SkipJPLPlanets | ( | const bool | b | ) | [inline, inherited] |
Definition at line 95 of file orsa_interaction.h.
References Interaction::skip_JPL_planets.
00095 { 00096 skip_JPL_planets = b; 00097 }
bool IsSkippingJPLPlanets | ( | ) | const [inline, inherited] |
Definition at line 98 of file orsa_interaction.h.
References Interaction::skip_JPL_planets.
Referenced by Evolution::Integrate(), Stoer::Step(), DissipativeRungeKutta::Step(), RungeKutta::Step(), Radau15::Step(), Leapfrog::Step(), and OrsaFile::Write().
00098 { 00099 return skip_JPL_planets; 00100 }
bool skip_JPL_planets [protected, inherited] |
Definition at line 102 of file orsa_interaction.h.
Referenced by Interaction::IsSkippingJPLPlanets(), Newton::Newton(), and Interaction::SkipJPLPlanets().