52 #include "../utility/numutil.h"
60 static string doc[] = {
62 "Author",
"Subhasis Ray (ported from GENESIS2)",
63 "Description",
"Models diffusible buffer where total concentration is constant. It is"
64 " coupled with a DifShell.",
74 sizeof(doc)/
sizeof(
string));
119 cerr <<
"Error: DifBuffer: Activation cannot be negative!\n";
133 cerr <<
"Error: DifBuffer: Free Buffer cannot be negative!\n";
137 cerr <<
"Error: DifBuffer: Free Buffer cannot exceed total buffer!\n";
155 cerr <<
"Error: DifBuffer: Bound Buffer cannot be negative!\n";
159 cerr <<
"Error: DifBuffer: Bound Buffer cannot exceed total buffer!\n";
177 cerr <<
"Error: DifBuffer: Total buffer concentration cannot be negative!\n";
194 cerr <<
"Error: DifBuffer: Kf cannot be negative!\n";
209 cerr <<
"Error: DifBuffer: Kb cannot be negative!\n";
224 cerr <<
" Error: DifBuffer: Diffusion constant, D, cannot be negative!\n";
233 if ( shapeMode != 0 && shapeMode != 1 && shapeMode != 3 ) {
234 cerr <<
"Error: DifBuffer: I only understand shapeModes 0, 1 and 3.\n";
248 if ( length < 0.0 ) {
249 cerr <<
"Error: DifBuffer: length cannot be negative!\n";
264 if ( diameter < 0.0 ) {
265 cerr <<
"Error: DifBuffer: diameter cannot be negative!\n";
280 if ( thickness < 0.0 ) {
281 cerr <<
"Error: DifBuffer: thickness cannot be negative!\n";
297 cerr <<
"Warning: DifBuffer: Trying to set volume, when shapeMode is not USER-DEFINED\n";
299 if ( volume < 0.0 ) {
300 cerr <<
"Error: DifBuffer: volume cannot be negative!\n";
315 cerr <<
"Warning: DifBuffer: Trying to set outerArea, when shapeMode is not USER-DEFINED\n";
317 if ( outerArea < 0.0 ) {
318 cerr <<
"Error: DifBuffer: outerArea cannot be negative!\n";
333 cerr <<
"Warning: DifBuffer: Trying to set innerArea, when shapeMode is not USER-DEFINED\n";
335 if ( innerArea < 0.0 ) {
336 cerr <<
"Error: DifBuffer: innerArea cannot be negative!\n";
362 double x = exp( -B * dt );
363 return state * x + ( A / B ) * ( 1 - x );
365 return state + A * dt ;
383 volume_ = 4./3.*
M_PI * ( rOut * rOut * rOut - rIn * rIn * rIn );
465 volume_ = 4./3.*
M_PI * ( rOut * rOut * rOut - rIn * rIn * rIn );
static const Cinfo * initCinfo()
unsigned int vGetShapeMode(const Eref &e) const
void vProcess(const Eref &e, ProcPtr p)
double vGetKf(const Eref &e) const
double vGetInnerArea(const Eref &e) const
void vSetDiameter(const Eref &e, double diameter)
double vGetLength(const Eref &e) const
void vSetLength(const Eref &e, double length)
double vGetBBound(const Eref &e) const
double vGetVolume(const Eref &e) const
void vSetKf(const Eref &e, double value)
double integrate(double state, double dt, double A, double B)
static SrcFinfo4< double, double, double, double > * reactionOut()
void vSetBFree(const Eref &e, double value)
static SrcFinfo2< double, double > * outerDifSourceOut()
void vBuffer(const Eref &e, double C)
void vFluxFromIn(const Eref &e, double innerC, double innerThickness)
void vSetOuterArea(const Eref &e, double outerArea)
double vGetOuterArea(const Eref &e) const
static const Cinfo * initCinfo()
void vSetBTot(const Eref &e, double value)
void vSetKb(const Eref &e, double value)
double vGetThickness(const Eref &e) const
double vGetDiameter(const Eref &e) const
void vSetD(const Eref &e, double value)
double vGetKb(const Eref &e) const
void vSetShapeMode(const Eref &e, unsigned int shapeMode)
void vSetActivation(const Eref &e, double value)
void vSetThickness(const Eref &e, double thickness)
double vGetBTot(const Eref &e) const
void vReinit(const Eref &e, ProcPtr p)
double vGetBFree(const Eref &e) const
void vSetVolume(const Eref &e, double volume)
void vFluxFromOut(const Eref &e, double outerC, double outerThickness)
static SrcFinfo2< double, double > * innerDifSourceOut()
void vSetInnerArea(const Eref &e, double innerArea)
static const Cinfo * difBufferCinfo
static const double EPSILON
double vGetActivation(const Eref &e) const
void vSetBBound(const Eref &e, double value)
double vGetD(const Eref &e) const
void calculateVolumeArea(const Eref &e)