From e696254bc52f1e1574cfeb7808aa535d43af37de Mon Sep 17 00:00:00 2001 From: "Penn, John M 047828115" Date: Wed, 24 Feb 2021 22:38:35 -0600 Subject: [PATCH] SAIntegrator: Add getLastStepSize() method to RKF45Integrator. #1114 --- trick_source/trick_utils/SAIntegrator/include/SAIntegrator.hh | 1 + trick_source/trick_utils/SAIntegrator/src/SAIntegrator.cpp | 3 +++ 2 files changed, 4 insertions(+) diff --git a/trick_source/trick_utils/SAIntegrator/include/SAIntegrator.hh b/trick_source/trick_utils/SAIntegrator/include/SAIntegrator.hh index 7ff7723d..17415c06 100644 --- a/trick_source/trick_utils/SAIntegrator/include/SAIntegrator.hh +++ b/trick_source/trick_utils/SAIntegrator/include/SAIntegrator.hh @@ -164,6 +164,7 @@ namespace SA { void step(); // Returns the next suggested step-size. double adaptive_step( double h); + double getLastStepSize(); friend std::ostream& operator<<(std::ostream& os, const SA::RKF45Integrator& I); }; diff --git a/trick_source/trick_utils/SAIntegrator/src/SAIntegrator.cpp b/trick_source/trick_utils/SAIntegrator/src/SAIntegrator.cpp index d422e5e6..8f114b68 100644 --- a/trick_source/trick_utils/SAIntegrator/src/SAIntegrator.cpp +++ b/trick_source/trick_utils/SAIntegrator/src/SAIntegrator.cpp @@ -614,6 +614,9 @@ void SA::RKF45Integrator::advanceIndyVar(double h) { void SA::RKF45Integrator::step() { adaptive_step( next_h ); } + +double SA::RKF45Integrator::getLastStepSize() {return last_h;} + double SA::RKF45Integrator::adaptive_step(double h) { double wstate[5][state_size]; double derivs[6][state_size];