CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
List of all members | Public Member Functions | Protected Attributes | Private Member Functions | Private Attributes
ConstantStepOdeSolver Class Referenceabstract

#include <ConstantStepOdeSolver.h>

Inheritance diagram for ConstantStepOdeSolver:
EulerOdeSolver RK2 RK4

Public Member Functions

 ConstantStepOdeSolver ()
 
 ConstantStepOdeSolver (const AbsODERHS &rhs)
 
 ConstantStepOdeSolver (const ConstantStepOdeSolver &r)
 
double getCoordinate (const unsigned which, const unsigned idx) const
 
double getIntegrated (unsigned which, unsigned idx) const
 
double getPeakTime (unsigned which) const
 
const AbsODERHSgetRHS () const
 
AbsODERHSgetRHS ()
 
double getTime (const unsigned idx) const
 
double interpolateCoordinate (unsigned which, double t, bool cubic=false) const
 
double interpolateIntegrated (unsigned which, double t, bool cubic=false) const
 
double lastDeltaT () const
 
unsigned lastDim () const
 
double lastMaxT () const
 
unsigned lastRunLength () const
 
virtual const char * methodName () const =0
 
ConstantStepOdeSolveroperator= (const ConstantStepOdeSolver &r)
 
void run (const double *initialConditions, unsigned lenConditions, double dt, unsigned nSteps)
 
void setHistory (double dt, const double *data, unsigned dim, unsigned runLen)
 
void setRHS (const AbsODERHS &rhs)
 
void truncateCoordinate (unsigned which, double minValue, double maxValue)
 
void writeHistory (std::ostream &os, double dt, bool cubic=false) const
 
void writeIntegrated (std::ostream &os, unsigned which, double dt, bool cubic=false) const
 
virtual ~ConstantStepOdeSolver ()
 

Protected Attributes

AbsODERHSrhs_
 

Private Member Functions

void integrateCoordinate (const unsigned which)
 
virtual void step (double t, double dt, const double *x, unsigned lenX, double *coordIncrement) const =0
 

Private Attributes

std::vector< double > chargeBuffer_
 
unsigned dim_
 
double dt_
 
std::vector< double > historyBuffer_
 
unsigned lastIntegrated_
 
unsigned runLen_
 

Detailed Description

Definition at line 14 of file ConstantStepOdeSolver.h.

Constructor & Destructor Documentation

ConstantStepOdeSolver::ConstantStepOdeSolver ( )
inline
ConstantStepOdeSolver::ConstantStepOdeSolver ( const AbsODERHS rhs)
inline

Definition at line 20 of file ConstantStepOdeSolver.h.

References AbsODERHS::clone(), and rhs_.

20  :
21  rhs_(0), dt_(0.0), dim_(0), runLen_(0), lastIntegrated_(0)
22  {
23  rhs_ = rhs.clone();
24  }
virtual AbsODERHS * clone() const =0
ConstantStepOdeSolver::ConstantStepOdeSolver ( const ConstantStepOdeSolver r)

Definition at line 145 of file ConstantStepOdeSolver.cc.

virtual ConstantStepOdeSolver::~ConstantStepOdeSolver ( )
inlinevirtual

Definition at line 30 of file ConstantStepOdeSolver.h.

References rhs_.

30 {delete rhs_;}

Member Function Documentation

double ConstantStepOdeSolver::getCoordinate ( const unsigned  which,
const unsigned  idx 
) const
inline

Definition at line 54 of file ConstantStepOdeSolver.h.

References dim_, Exception, historyBuffer_, runLen_, and eostools::which().

55  {
56  if (which >= dim_ || idx >= runLen_) throw cms::Exception(
57  "In ConstantStepOdeSolver::getCoordinate: index out of range");
58  return historyBuffer_[dim_*idx + which];
59  }
def which
Definition: eostools.py:335
std::vector< double > historyBuffer_
tuple idx
DEBUGGING if hasattr(process,&quot;trackMonIterativeTracking2012&quot;): print &quot;trackMonIterativeTracking2012 D...
double ConstantStepOdeSolver::getIntegrated ( unsigned  which,
unsigned  idx 
) const

Definition at line 39 of file ConstantStepOdeSolver.cc.

double ConstantStepOdeSolver::getPeakTime ( unsigned  which) const

Definition at line 11 of file ConstantStepOdeSolver.cc.

const AbsODERHS* ConstantStepOdeSolver::getRHS ( ) const
inline

Definition at line 38 of file ConstantStepOdeSolver.h.

References rhs_.

38 {return rhs_;}
AbsODERHS* ConstantStepOdeSolver::getRHS ( )
inline

Definition at line 39 of file ConstantStepOdeSolver.h.

References rhs_.

39 {return rhs_;}
double ConstantStepOdeSolver::getTime ( const unsigned  idx) const
inline

Definition at line 47 of file ConstantStepOdeSolver.h.

References dt_, Exception, and runLen_.

48  {
49  if (idx >= runLen_) throw cms::Exception(
50  "In ConstantStepOdeSolver::getTime: index out of range");
51  return idx*dt_;
52  }
tuple idx
DEBUGGING if hasattr(process,&quot;trackMonIterativeTracking2012&quot;): print &quot;trackMonIterativeTracking2012 D...
void ConstantStepOdeSolver::integrateCoordinate ( const unsigned  which)
private

Definition at line 49 of file ConstantStepOdeSolver.cc.

double ConstantStepOdeSolver::interpolateCoordinate ( unsigned  which,
double  t,
bool  cubic = false 
) const

Definition at line 195 of file ConstantStepOdeSolver.cc.

double ConstantStepOdeSolver::interpolateIntegrated ( unsigned  which,
double  t,
bool  cubic = false 
) const

Definition at line 241 of file ConstantStepOdeSolver.cc.

double ConstantStepOdeSolver::lastDeltaT ( ) const
inline

Definition at line 44 of file ConstantStepOdeSolver.h.

References dt_.

Referenced by operator<<().

44 {return dt_;}
unsigned ConstantStepOdeSolver::lastDim ( ) const
inline

Definition at line 42 of file ConstantStepOdeSolver.h.

References dim_.

42 {return dim_;}
double ConstantStepOdeSolver::lastMaxT ( ) const
inline

Definition at line 45 of file ConstantStepOdeSolver.h.

References dt_, and runLen_.

unsigned ConstantStepOdeSolver::lastRunLength ( ) const
inline

Definition at line 43 of file ConstantStepOdeSolver.h.

References runLen_.

43 {return runLen_;}
virtual const char* ConstantStepOdeSolver::methodName ( ) const
pure virtual

Implemented in RK4, RK2, and EulerOdeSolver.

ConstantStepOdeSolver & ConstantStepOdeSolver::operator= ( const ConstantStepOdeSolver r)

Definition at line 158 of file ConstantStepOdeSolver.cc.

void ConstantStepOdeSolver::run ( const double *  initialConditions,
unsigned  lenConditions,
double  dt,
unsigned  nSteps 
)

Definition at line 312 of file ConstantStepOdeSolver.cc.

void ConstantStepOdeSolver::setHistory ( double  dt,
const double *  data,
unsigned  dim,
unsigned  runLen 
)

Definition at line 289 of file ConstantStepOdeSolver.cc.

void ConstantStepOdeSolver::setRHS ( const AbsODERHS rhs)
inline

Definition at line 33 of file ConstantStepOdeSolver.h.

References AbsODERHS::clone(), and rhs_.

34  {
35  delete rhs_;
36  rhs_ = rhs.clone();
37  }
virtual AbsODERHS * clone() const =0
virtual void ConstantStepOdeSolver::step ( double  t,
double  dt,
const double *  x,
unsigned  lenX,
double *  coordIncrement 
) const
privatepure virtual

Implemented in RK4, RK2, and EulerOdeSolver.

void ConstantStepOdeSolver::truncateCoordinate ( unsigned  which,
double  minValue,
double  maxValue 
)

Definition at line 176 of file ConstantStepOdeSolver.cc.

void ConstantStepOdeSolver::writeHistory ( std::ostream &  os,
double  dt,
bool  cubic = false 
) const

Definition at line 84 of file ConstantStepOdeSolver.cc.

Referenced by operator<<().

void ConstantStepOdeSolver::writeIntegrated ( std::ostream &  os,
unsigned  which,
double  dt,
bool  cubic = false 
) const

Definition at line 118 of file ConstantStepOdeSolver.cc.

Member Data Documentation

std::vector<double> ConstantStepOdeSolver::chargeBuffer_
private

Definition at line 118 of file ConstantStepOdeSolver.h.

unsigned ConstantStepOdeSolver::dim_
private

Definition at line 113 of file ConstantStepOdeSolver.h.

Referenced by getCoordinate(), and lastDim().

double ConstantStepOdeSolver::dt_
private

Definition at line 112 of file ConstantStepOdeSolver.h.

Referenced by getTime(), lastDeltaT(), and lastMaxT().

std::vector<double> ConstantStepOdeSolver::historyBuffer_
private

Definition at line 117 of file ConstantStepOdeSolver.h.

Referenced by getCoordinate().

unsigned ConstantStepOdeSolver::lastIntegrated_
private

Definition at line 115 of file ConstantStepOdeSolver.h.

AbsODERHS* ConstantStepOdeSolver::rhs_
protected
unsigned ConstantStepOdeSolver::runLen_
private

Definition at line 114 of file ConstantStepOdeSolver.h.

Referenced by getCoordinate(), getTime(), lastMaxT(), and lastRunLength().