Main Page   Class Hierarchy   Alphabetical List   Compound List   File List   Compound Members   Related Pages  

rdIntegRKF.h

00001 // rdIntegRKF.h
00002 //+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
00003 // Copyright 2000-2003 Realistic Dynamics, Inc.
00004 // All rights reserved.
00005 //
00006 // Please do not read, copy, distribute, or use without permission.
00007 // Contact: Frank C. Anderson, fca@RealisticDynamics.com
00008 //+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
00009 #ifndef __rdIntegRKF_h__
00010 #define __rdIntegRKF_h__
00011 
00012 // INCLUDES
00013 #include "rdIntegrator.h"
00014 #include <rdTools.h>
00015 #include <rdArray.h>
00016 #include <rdStorage.h>
00017 #include <rdMath.h>
00018 #include "rdModel.h"
00019 #include "rdControlSet.h"
00020 #include "rdController.h"
00021 #include "rdRKF.h"
00022 
00023 
00024 // DLL SPECIFICATIONS FOR TEMPLATES
00025 template class RDSIMULATION_API rdArray<double>;
00026 
00027 
00028 //=============================================================================
00029 //=============================================================================
00042 class RDSIMULATION_API rdIntegRKF
00043    : public rdRKF
00044 {
00045 
00046 //=============================================================================
00047 // DATA
00048 //=============================================================================
00049 private:
00051    rdController *_controller;
00053    int _status;
00055    int _steps;
00057    int _trys;
00059    int _maxSteps;
00061    bool _halt;
00063    double _dtMin;
00065    double _dtMax;
00067    double *_x;
00069    double *_xPrev;
00071    double *_yPrev;
00073    double *_yp;
00078    bool _specifiedDT;
00082    bool _constantDT;
00084    double _dt;
00086    rdArray<double> _tArray;
00088    rdArray<double> _dtArray;
00090    rdStorage *_controlStorage;
00092    rdStorage *_stateStorage;
00094    rdStorage *_pseudoStorage;
00095 
00096 //=============================================================================
00097 // METHODS
00098 //=============================================================================
00099 public:
00100    rdIntegRKF(rdModel *aModel=NULL,
00101       double aTol=1.0e-4,double aTolFine=-1.0);
00102    virtual ~rdIntegRKF();
00103 private:
00104    void setNull();
00105 
00106 public:
00107    //--------------------------------------------------------------------------
00108    // GET AND SET
00109    //--------------------------------------------------------------------------
00110    // MIN DT
00111    void setMinDT(double aMin);
00112    double getMinDT();
00113    // MIN DT
00114    void setMaxDT(double aMax);
00115    double getMaxDT();
00116    // MAX STEPS
00117    void setMaximumNumberOfSteps(int aMaxSteps);
00118    int getMaximumNumberOfSteps();
00119    // STATUS
00120    int getStatus();
00121    // SEPECIFIED TIME STEP
00122    void setUseSpecifiedDT(bool aTrueFalse);
00123    bool getUseSpecifiedDT() const;
00124    // CONSTANT TIME STEP
00125    void setUseConstantDT(bool aTrueFalse);
00126    bool getUseConstantDT() const;
00127    // DT
00128    void setDT(double aDT);
00129    double getDT() const;
00130    // DT VECTOR
00131    const rdArray<double>& getDTArray();
00132    void setDTArray(int aN,const double aDT[],double aTI=0.0);
00133    double getDTArrayDT(int aStep);
00134    void printDTArray(const char *aFileName=NULL);
00135    // TIME VECTOR
00136    const rdArray<double>& getTimeArray();
00137    double getTimeArrayTime(int aStep);
00138    int getTimeArrayStep(double aTime);
00139    void printTimeArray(const char *aFileName=NULL);
00140    void resetTimeAndDTArrays(double aTime);
00141    // CONTROL STORAGE
00142    void setControlStorage(rdStorage *aStorage);
00143    rdStorage* getControlStorage();
00144    // STATE STORAGE
00145    void setStateStorage(rdStorage *aStorage);
00146    rdStorage* getStateStorage();
00147    // PSEUDO-STATE STORAGE
00148    void setPseudoStateStorage(rdStorage *aStorage);
00149    rdStorage* getPseudoStateStorage();
00150    // CONTROLLER
00151    void setController(rdController *aController);
00152    rdController* getController();
00153 
00154    //--------------------------------------------------------------------------
00155    // INTEGRATION
00156    //--------------------------------------------------------------------------
00157    bool integrate(double ti,double tf,rdControlSet &x,double *y,
00158             double dtFirst=1.0e-3);
00159 
00160    //--------------------------------------------------------------------------
00161    // INTERRUPT
00162    //--------------------------------------------------------------------------
00163    void halt();
00164    void clearHalt();
00165    bool checkHalt();
00166 
00167 //=============================================================================
00168 }; // END class rdIntegRKF
00169 //=============================================================================
00170 //=============================================================================
00171 
00172 
00173 #endif // __rdIntegRKF_h__

Generated on Wed Aug 20 02:17:06 2003 for Simulation Software by doxygen1.3