Leapfrog Class Reference

#include <orsa_integrator.h>

Inheritance diagram for Leapfrog:

Inheritance graph
[legend]
Collaboration diagram for Leapfrog:

Collaboration graph
[legend]

List of all members.

Public Member Functions

 Leapfrog ()
 Leapfrog (const Leapfrog &)
 ~Leapfrog ()
void Step (const Frame &, Frame &, Interaction *)
Integratorclone () const
virtual bool can_handle_velocity_dependant_interactions () const
 substeps for multisteps integrators
IntegratorType GetType () const

Public Attributes

UniverseTypeAwareTimeStep timestep
double accuracy
unsigned int m
 used only with variable step size integrators

Protected Attributes

UniverseTypeAwareTimeStep timestep_done
IntegratorType type


Detailed Description

Definition at line 266 of file orsa_integrator.h.


Constructor & Destructor Documentation

Leapfrog (  ) 

Definition at line 46 of file orsa_integrator.cc.

References orsa::LEAPFROG, and Integrator::type.

Referenced by Leapfrog::clone().

00046                      : FixedTimestepIntegrator() {
00047     type = LEAPFROG;
00048   }

Leapfrog ( const Leapfrog i  ) 

Definition at line 50 of file orsa_integrator.cc.

References Integrator::accuracy, Integrator::timestep, and Integrator::type.

00050                                        : FixedTimestepIntegrator() {
00051     type     = i.type;
00052     timestep = i.timestep;
00053     accuracy = i.accuracy;
00054     // m        = i.m;
00055   }

~Leapfrog (  ) 

Definition at line 61 of file orsa_integrator.cc.

00061                       {
00062     
00063   }


Member Function Documentation

void Step ( const Frame frame_in,
Frame frame_out,
Interaction interaction 
) [virtual]

Implements Integrator.

Definition at line 107 of file orsa_integrator.cc.

References Interaction::Acceleration(), Frame::ForceJPLEphemerisData(), UniverseTypeAwareTimeStep::GetDouble(), Interaction::IsSkippingJPLPlanets(), Frame::size(), and Integrator::timestep.

00107                                                                                           {
00108     
00109     // NON-DISSIPATIVE (velocity indipendent) version
00110     
00111     const unsigned int n = frame_in.size();
00112     
00113     const double h  = timestep.GetDouble();
00114     const double h2 = 0.5*h;
00115     
00116     frame_out = frame_in;
00117     
00118     frame_out += 0.5*timestep;
00119     for (unsigned int j=0;j<n;++j) {
00120       frame_out[j].AddToPosition(frame_out[j].velocity()*h2);
00121     }
00122     
00123     std::vector<Vector> acc(n);
00124     //
00125     if (interaction->IsSkippingJPLPlanets()) {
00126       frame_out.ForceJPLEphemerisData();
00127     }
00128     //
00129     interaction->Acceleration(frame_out,acc);
00130     
00131     for (unsigned int j=0;j<n;++j) {
00132       frame_out[j].AddToVelocity(acc[j]*h);
00133     }
00134     
00135     frame_out += 0.5*timestep;
00136     for (unsigned int j=0;j<n;++j) {
00137       frame_out[j].AddToPosition(frame_out[j].velocity()*h2);
00138     }
00139     
00140   }

Here is the call graph for this function:

Integrator * clone (  )  const [virtual]

Implements Integrator.

Definition at line 57 of file orsa_integrator.cc.

References Leapfrog::Leapfrog().

00057                                      {
00058     return new Leapfrog(*this);
00059   }

Here is the call graph for this function:

virtual bool can_handle_velocity_dependant_interactions (  )  const [inline, virtual, inherited]

substeps for multisteps integrators

Reimplemented in DissipativeRungeKutta, and Radau15.

Definition at line 95 of file orsa_integrator.h.

00095 { return false; }

IntegratorType GetType (  )  const [inline, inherited]

Definition at line 98 of file orsa_integrator.h.

References Integrator::type.

Referenced by OrsaFile::Write().

00098 { return type; }


Member Data Documentation

UniverseTypeAwareTimeStep timestep_done [protected, inherited]

Definition at line 87 of file orsa_integrator.h.

Referenced by Radau15::Step().

double accuracy [inherited]

unsigned int m [inherited]

used only with variable step size integrators

Definition at line 92 of file orsa_integrator.h.

Referenced by Stoer::Step(), Stoer::Stoer(), and OrsaFile::Write().

IntegratorType type [protected, inherited]


The documentation for this class was generated from the following files:

Generated on Mon Apr 28 20:04:21 2008 for liborsa by  doxygen 1.5.5