00001 // RK2ExplicitEulerHybridMover.h: interface for the CRK2ExplicitEulerHybridMover class. 00002 // 00004 00005 #if !defined(AFX_RK2EXPLICITEULERHYBRIDMOVER_H__1134C328_A1E8_432E_9DE0_DEB98F680963__INCLUDED_) 00006 #define AFX_RK2EXPLICITEULERHYBRIDMOVER_H__1134C328_A1E8_432E_9DE0_DEB98F680963__INCLUDED_ 00007 00008 #if _MSC_VER > 1000 00009 #pragma once 00010 #endif // _MSC_VER > 1000 00011 00012 #include <cmath> 00013 #include <iostream> 00014 #include <stdlib.h> 00015 #include "DifferentialEquationMover.h" 00016 using namespace std; 00017 00018 class CRK2ExplicitEulerHybridMover : public CDifferentialEquationMover 00019 { 00020 public: 00021 CRK2ExplicitEulerHybridMover(double tolerance=1.0e-4, double stepSize=1.0e-4); 00022 virtual ~CRK2ExplicitEulerHybridMover(); 00023 void Move(double xInitial, double xFinal, ReactionNetwork *pReactionNetwork); 00024 void HybridStep(int nRHS, double *y, double *dydt); 00025 double SetStepScale(int nRHS); 00026 private: 00027 double *m_pdLocalError; // local error for each variable 00028 double m_dEps; // numerical tolerance 00029 static const double m_scdAlpha; // combination parameter 00030 }; 00031 00032 #endif // !defined(AFX_RK2EXPLICITEULERHYBRIDMOVER_H__1134C328_A1E8_432E_9DE0_DEB98F680963__INCLUDED_)