#include <orsa_integrator.h>
Inheritance diagram for RungeKutta:
Public Member Functions | |
RungeKutta () | |
RungeKutta (const RungeKutta &) | |
~RungeKutta () | |
void | Step (const Frame &, Frame &, Interaction *) |
Integrator * | clone () 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 |
Definition at line 179 of file orsa_integrator.h.
RungeKutta | ( | ) |
Definition at line 34 of file orsa_integrator_runge_kutta.cc.
References orsa::RUNGEKUTTA, and Integrator::type.
Referenced by RungeKutta::clone().
00034 : FixedTimestepIntegrator() { 00035 type = RUNGEKUTTA; 00036 }
RungeKutta | ( | const RungeKutta & | ) |
Definition at line 38 of file orsa_integrator_runge_kutta.cc.
References Integrator::accuracy, Integrator::timestep, and Integrator::type.
00038 : FixedTimestepIntegrator() { 00039 type = i.type; 00040 timestep = i.timestep; 00041 accuracy = i.accuracy; 00042 // m = i.m; 00043 }
~RungeKutta | ( | ) |
void Step | ( | const Frame & | , | |
Frame & | , | |||
Interaction * | ||||
) | [virtual] |
Implements Integrator.
Definition at line 53 of file orsa_integrator_runge_kutta.cc.
References Interaction::Acceleration(), Frame::ForceJPLEphemerisData(), UniverseTypeAwareTimeStep::GetDouble(), Interaction::IsSkippingJPLPlanets(), UniverseTypeAwareTime::SetTime(), Frame::size(), and Integrator::timestep.
00053 { 00054 00055 // NON-DISSIPATIVE (velocity indipendent) version 00056 00057 const unsigned int n = frame_in.size(); 00058 00059 const double h = timestep.GetDouble(); 00060 00061 vector<Vector> acc(n); 00062 00063 vector<Vector> b1(n), b2(n), b3(n), b4(n); 00064 00065 unsigned int j; 00066 00067 interaction->Acceleration(frame_in,acc); 00068 // 00069 b1 = acc; 00070 00071 Frame tmp_frame = frame_in; 00072 for (j=0;j<tmp_frame.size();++j) { 00073 tmp_frame[j].AddToPosition(frame_in[j].velocity() * h / 2.0); 00074 } 00075 // 00076 if (interaction->IsSkippingJPLPlanets()) { 00077 tmp_frame.SetTime(frame_in + h / 2.0); 00078 tmp_frame.ForceJPLEphemerisData(); 00079 } 00080 // 00081 interaction->Acceleration(tmp_frame,acc); 00082 // 00083 b2 = acc; 00084 00085 tmp_frame = frame_in; 00086 for (j=0;j<tmp_frame.size();++j) { 00087 tmp_frame[j].AddToPosition(frame_in[j].velocity() * h / 2.0 + b1[j] * h * h / 4.0); 00088 } 00089 // 00090 if (interaction->IsSkippingJPLPlanets()) { 00091 tmp_frame.SetTime(frame_in + h / 2.0); 00092 tmp_frame.ForceJPLEphemerisData(); 00093 } 00094 // 00095 interaction->Acceleration(tmp_frame,acc); 00096 // 00097 b3 = acc; 00098 00099 tmp_frame = frame_in; 00100 for (j=0;j<tmp_frame.size();++j) { 00101 tmp_frame[j].AddToPosition(frame_in[j].velocity() * h + b2[j] * h * h / 2.0); 00102 } 00103 // 00104 if (interaction->IsSkippingJPLPlanets()) { 00105 tmp_frame.SetTime(frame_in + timestep); 00106 tmp_frame.ForceJPLEphemerisData(); 00107 } 00108 // 00109 interaction->Acceleration(tmp_frame,acc); 00110 // 00111 b4 = acc; 00112 00113 frame_out = frame_in; 00114 for (j=0;j<frame_out.size();++j) { 00115 frame_out[j].AddToPosition(frame_in[j].velocity() * h + h * h / 6.0 * ( b1[j] + b2[j] + b3[j] )); 00116 frame_out[j].AddToVelocity(h / 6.0 * ( b1[j] + 2 * b2[j] + 2 * b3[j] + b4[j] )); 00117 } 00118 00119 frame_out += timestep; 00120 }
Here is the call graph for this function:
Integrator * clone | ( | ) | const [virtual] |
Implements Integrator.
Definition at line 49 of file orsa_integrator_runge_kutta.cc.
References RungeKutta::RungeKutta().
00049 { 00050 return new RungeKutta(*this); 00051 }
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.
IntegratorType GetType | ( | ) | const [inline, inherited] |
Definition at line 98 of file orsa_integrator.h.
References Integrator::type.
Referenced by OrsaFile::Write().
00098 { return type; }
UniverseTypeAwareTimeStep timestep [inherited] |
Definition at line 84 of file orsa_integrator.h.
Referenced by DissipativeRungeKutta::DissipativeRungeKutta(), Evolution::GetIntegratorTimeStep(), Evolution::Integrate(), Leapfrog::Leapfrog(), OptimizedOrbitPositions::PropagatedOrbit(), orsa::PropagatedSky_J2000(), Radau15::Radau15(), RungeKutta::RungeKutta(), Evolution::SetIntegratorTimeStep(), orsa::StartFrame(), Stoer::Step(), DissipativeRungeKutta::Step(), RungeKutta::Step(), Radau15::Step(), Leapfrog::Step(), Stoer::Stoer(), and OrsaFile::Write().
UniverseTypeAwareTimeStep timestep_done [protected, inherited] |
double accuracy [inherited] |
Definition at line 91 of file orsa_integrator.h.
Referenced by DissipativeRungeKutta::DissipativeRungeKutta(), Evolution::GetIntegratorAccuracy(), Leapfrog::Leapfrog(), OptimizedOrbitPositions::PropagatedOrbit(), orsa::PropagatedSky_J2000(), Radau15::Radau15(), RungeKutta::RungeKutta(), Evolution::SetIntegratorAccuracy(), Radau15::Step(), Stoer::Stoer(), and OrsaFile::Write().
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] |
Definition at line 101 of file orsa_integrator.h.
Referenced by DissipativeRungeKutta::DissipativeRungeKutta(), Integrator::GetType(), Leapfrog::Leapfrog(), Radau15::Radau15(), RungeKutta::RungeKutta(), and Stoer::Stoer().