Skip to content
Snippets Groups Projects
Commit 91d10224 authored by Asia Jędrzejewska-Szmek's avatar Asia Jędrzejewska-Szmek
Browse files

Implementation of MMPump

parent 8cb32de5
No related branches found
No related tags found
1 merge request!205DifShell and DifBuffer implementation
#include "header.h"
#include "MMPump.h"
#include "ElementValueFinfo.h"
#include "../utility/numutil.h"
#include <cmath>
SrcFinfo2< double,double >* MMPump::PumpOut()
{
static SrcFinfo2< double,double > pumpOut( "PumpOut",
"Sends out MMPump parameters.");
return &pumpOut;
}
const Cinfo * MMPump::initCinfo()
{
static DestFinfo process( "process",
"Handles process call",
new ProcOpFunc< MMPump>(&MMPump::process ) );
static DestFinfo reinit( "reinit",
"Reinit happens only in stage 0",
new ProcOpFunc< MMPump>( &MMPump::reinit ));
static Finfo* processShared[] = {
&process, &reinit
};
static SharedFinfo proc(
"proc",
"Shared message to receive Process message from scheduler",
processShared, sizeof( processShared ) / sizeof( Finfo* ));
////////////////////////////
// Field defs
////////////////////////////
static ElementValueFinfo<MMPump, double> Vmax("Vmax",
"maximum pump velocity, scaled by mebrane"
"surface area. i.e., max ion flux in moles/sec",
&MMPump::setVmax,
&MMPump::getVmax);
static ElementValueFinfo<MMPump, double> Kd("Kd",
"half-maximal activating concentration in mM",
&MMPump::setKd,
&MMPump::getKd);
////
// DestFinfo
////
static Finfo * difBufferFinfos[] = {
//////////////////////////////////////////////////////////////////
// Field definitions
//////////////////////////////////////////////////////////////////
&Vmax,
&Kd,
//////////////////////////////////////////////////////////////////
// SharedFinfo definitions
/////////////////////////////////////////////////////////////////
&proc,
PumpOut(),
//////////////////////////////////////////////////////////////////
// DestFinfo definitions
//////////////////////////////////////////////////////////////////
};
static string doc[] = {
"Name", "MMPump",
"Author", "Subhasis Ray (ported from GENESIS2)",
"Description", "Models diffusible buffer where total concentration is constant. It is"
" coupled with a DifShell.",
};
static ZeroSizeDinfo<int> dinfo;
static Cinfo MMPumpCinfo(
"MMPump",
Neutral::initCinfo(),
difBufferFinfos,
sizeof(difBufferFinfos)/sizeof(Finfo*),
&dinfo,
doc,
sizeof(doc)/sizeof(string));
return &MMPumpCinfo;
}
static const Cinfo * MMpumpCinfo = MMPump::initCinfo();
////////////////////////////////////////////////////////////////////////////////
// Class functions
////////////////////////////////////////////////////////////////////////////////
MMPump::MMPump()
{ ; }
double MMPump::getVmax(const Eref& e) const
{
return Vmax_;
}
void MMPump::setVmax(const Eref& e,double value)
{
if ( value < 0.0 ) {
cerr << "Error: MMPump: Vmax cannot be negative!\n";
return;
}
Vmax_ = value;
}
double MMPump::getKd(const Eref& e) const
{
return Kd_;
}
void MMPump::setKd(const Eref& e,double value)
{
if ( value < 0.0 ) {
cerr << "Error: MMPump: Kd cannot be negative!\n";
return;
}
Kd_ = value;
}
void MMPump::process(const Eref& e, ProcPtr p)
{
PumpOut()->send(e,Vmax_,Kd_);
}
void MMPump::reinit(const Eref& e, ProcPtr p)
{
return;
}
/**********************************************************************
** This program is part of 'MOOSE', the
** Multiscale Object Oriented Simulation Environment.
** copyright (C) 2003-2008
** Upinder S. Bhalla, Niraj Dudani and NCBS
** It is made available under the terms of the
** GNU Lesser General Public License version 2.1
** See the file COPYING.LIB for the full notice.
**********************************************************************/
#ifndef _MMPUMP_H
#define _MMPUMP_H
/*This is base class for MMPump*/
class MMPump
{
public:
MMPump();
void process( const Eref & e, ProcPtr p);
void reinit(const Eref &e, ProcPtr p);
double getVmax(const Eref& e) const; //Vmax of the pump
void setVmax(const Eref& e,double value);
int getVal(const Eref& e) const; //Valence
void setVal(const Eref& e,int value);
double getKd(const Eref& e) const; // Pump's Kd
void setKd(const Eref& e,double value);
static SrcFinfo2< double,double >* PumpOut(); //Pump parameters;
static const Cinfo * initCinfo();
private:
double Vmax_;
double Kd_;
};
#endif //_MMPUMP_BASE_H
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment