MOOSE - Multiscale Object Oriented Simulation Environment
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
VoxelPools.h
Go to the documentation of this file.
1 /**********************************************************************
2 ** This program is part of 'MOOSE', the
3 #include <boost/numeric/odeint.hpp>
4 ** Messaging Object Oriented Simulation Environment.
5 ** Copyright (C) 2003-2014 Upinder S. Bhalla. and NCBS
6 ** It is made available under the terms of the
7 ** GNU Lesser General Public License version 2.1
8 ** See the file COPYING.LIB for the full notice.
9 **********************************************************************/
10 
11 #ifndef _VOXEL_POOLS_H
12 #define _VOXEL_POOLS_H
13 
14 #include "OdeSystem.h"
15 #include "VoxelPoolsBase.h"
16 
17 #ifdef USE_BOOST_ODE
18 #include "BoostSys.h"
19 #endif
20 
21 
22 class Stoich;
23 class ProcInfo;
24 
30 {
31 public:
32  VoxelPools();
33  virtual ~VoxelPools();
34 
36  void reinit( double dt );
38  // Solver interface functions
40 
45  void setStoich( Stoich* stoich, const OdeSystem* ode );
46 
47  const Stoich* getStoich( );
48 
50  void advance( const ProcInfo* p );
51 
53  void setInitDt( double dt );
54 
55 #ifdef USE_GSL /* ----- not USE_BOOST_ODE ----- */
56  static int gslFunc( double t, const double* y, double *dydt, void* params);
57 #elif USE_BOOST_ODE
58  static void evalRates( const vector_type_& y
59  , vector_type_& dydt
60  , const double t
61  , VoxelPools* vp
62  );
63 #endif /* ----- not USE_BOOST_ODE ----- */
64 
66  // Rate manipulation and calculation functions
69  void setVolumeAndDependencies( double vol );
70 
72  void updateAllRateTerms( const vector< RateTerm* >& rates,
73  unsigned int numCoreRates );
80  void updateRateTerms( const vector< RateTerm* >& rates,
81  unsigned int numCoreRates, unsigned int index );
82 
87  void updateRates( const double* s, double* yprime ) const;
88 
96  const double* s, vector< double >& v ) const;
97 
99  void print() const;
100 private:
101 
102 #ifdef USE_GSL
103  gsl_odeiv2_driver* driver_;
104  gsl_odeiv2_system sys_;
105 #elif USE_BOOST_ODE
106  BoostSys sys_;
107 #endif
108 
109 };
110 
111 #endif // _VOXEL_POOLS_H
void advance(const ProcInfo *p)
Do the numerical integration. Advance the simulation.
Definition: VoxelPools.cpp:89
void updateRateTerms(const vector< RateTerm * > &rates, unsigned int numCoreRates, unsigned int index)
Definition: VoxelPools.cpp:300
void setStoich(Stoich *stoich, const OdeSystem *ode)
Definition: VoxelPools.cpp:67
Definition: Stoich.h:49
virtual ~VoxelPools()
Definition: VoxelPools.cpp:43
void updateRates(const double *s, double *yprime) const
Definition: VoxelPools.cpp:318
void print() const
Used for debugging.
Definition: VoxelPools.cpp:369
const Stoich * getStoich()
void updateReacVelocities(const double *s, vector< double > &v) const
Definition: VoxelPools.cpp:350
void updateAllRateTerms(const vector< RateTerm * > &rates, unsigned int numCoreRates)
Updates all the rate constants from the reference rates vector.
Definition: VoxelPools.cpp:282
void setVolumeAndDependencies(double vol)
Handles volume change and subsequent cascading updates.
Definition: VoxelPools.cpp:380
void setInitDt(double dt)
Set initial timestep to use by the solver.
Definition: VoxelPools.cpp:234