Exemplo n.º 1
0
void DifShell::localProcess_0( const Eref & e, ProcPtr p )
{
	/**
	 * Send ion concentration and thickness to adjacent DifShells. They will
	 * then compute their incoming fluxes.
	 */
    innerDifSourceOut()->send( e, C_, thickness_ );
    outerDifSourceOut()->send( e, C_, thickness_ );
	
	/**
	 * Send ion concentration to ion buffers. They will send back information on
	 * the reaction (forward / backward rates ; free / bound buffer concentration)
	 * immediately, which this DifShell will use to find amount of ion captured
	 * or released in the current time-step.
	 */
    concentrationOut()->send( e, C_ );
}
Exemplo n.º 2
0
const Cinfo* DifShellBase::initCinfo()
{

  static DestFinfo process( "process",
			    "Handles process call",
			    new ProcOpFunc< DifShellBase>(&DifShellBase::process ) );
  static DestFinfo reinit( "reinit",
			   "Reinit happens only in stage 0",
			   new ProcOpFunc< DifShellBase>( &DifShellBase::reinit ));

  static Finfo* processShared[] = {
    &process, &reinit
  };

  static SharedFinfo proc(
			  "proc",
			  "Shared message to receive Process message from scheduler",
			  processShared, sizeof( processShared ) / sizeof( Finfo* ));




  static DestFinfo reaction( "reaction",
			     "Here the DifShell receives reaction rates (forward and backward), and concentrations for the "
			     "free-buffer and bound-buffer molecules.",
			     new EpFunc4< DifShellBase, double, double, double, double >( &DifShellBase::buffer ));

  static Finfo* bufferShared[] = {
    DifShellBase::concentrationOut(), &reaction
  };

  static SharedFinfo buffer( "buffer",
			     "This is a shared message from a DifShell to a Buffer (FixBuffer or DifBuffer). " ,
			     bufferShared,
			     sizeof( bufferShared ) / sizeof( Finfo* ));
  /////




  static DestFinfo fluxFromOut( "fluxFromOut",
				"Destination message",
				new EpFunc2< DifShellBase, double, double > ( &DifShellBase::fluxFromOut ));

  static Finfo* innerDifShared[] = {
    &fluxFromOut,  DifShellBase::innerDifSourceOut(),
  };
  static SharedFinfo innerDif( "innerDif",
			       "This shared message (and the next) is between DifShells: adjoining shells exchange information to "
			       "find out the flux between them. "
			       "Using this message, an inner shell sends to, and receives from its outer shell." ,
			       innerDifShared,
			       sizeof( innerDifShared ) / sizeof( Finfo* ));

  static DestFinfo fluxFromIn( "fluxFromIn", "",
			       new EpFunc2< DifShellBase, double, double> ( &DifShellBase::fluxFromIn ) );

  static Finfo* outerDifShared[] = {
    &fluxFromIn,  DifShellBase::outerDifSourceOut(),
  };

  static  SharedFinfo outerDif( "outerDif",
				"Using this message, an outer shell sends to, and receives from its inner shell." ,
				outerDifShared,
				sizeof( outerDifShared ) / sizeof( Finfo* ));

  static ElementValueFinfo< DifShellBase, double> C( "C",
						     "Concentration C",// is computed by the DifShell",
						     &DifShellBase::setC,
						     &DifShellBase::getC);
  static ElementValueFinfo< DifShellBase, double> Ceq( "Ceq", "",
						       &DifShellBase::setCeq,
						       &DifShellBase::getCeq);
  static ElementValueFinfo< DifShellBase, double> D( "D", "",
						     &DifShellBase::setD,
						     &DifShellBase::getD);
  static ElementValueFinfo< DifShellBase, double> valence( "valence", "",
							   &DifShellBase::setValence,
							   &DifShellBase::getValence);
  static ElementValueFinfo< DifShellBase, double> leak( "leak", "",
							&DifShellBase::setLeak,
							&DifShellBase::getLeak);
  static ElementValueFinfo< DifShellBase, unsigned int> shapeMode( "shapeMode", "",
								   &DifShellBase::setShapeMode,
								   &DifShellBase::getShapeMode);
  static ElementValueFinfo< DifShellBase, double> length( "length", "",
							  &DifShellBase::setLength,
							  &DifShellBase::getLength);
  static ElementValueFinfo< DifShellBase, double> diameter( "diameter", "",
							    &DifShellBase::setDiameter,
							    &DifShellBase::getDiameter );
  static ElementValueFinfo< DifShellBase, double> thickness( "thickness", "",
							     &DifShellBase::setThickness,
							     &DifShellBase::getThickness );
  static ElementValueFinfo< DifShellBase, double> volume( "volume", "",
							  &DifShellBase::setVolume,
							  &DifShellBase::getVolume );
  static ElementValueFinfo< DifShellBase, double> outerArea( "outerArea", "",
							     &DifShellBase::setOuterArea,
							     &DifShellBase::getOuterArea);
  static ElementValueFinfo< DifShellBase, double> innerArea( "innerArea", "",
							     &DifShellBase::setInnerArea,
							     &DifShellBase::getInnerArea );

  static DestFinfo mmPump( "mmPump", "Here DifShell receives pump outflux",
			   new EpFunc2< DifShellBase, double, double >( &DifShellBase::mmPump ) );
  static DestFinfo influx( "influx", "",
			   new EpFunc1< DifShellBase, double > (&DifShellBase::influx ));
  static DestFinfo outflux( "outflux", "",
			    new EpFunc1< DifShellBase, double >( &DifShellBase::influx ));
  static DestFinfo fInflux( "fInflux", "",
			    new EpFunc2< DifShellBase, double, double >( &DifShellBase::fInflux ));
  static DestFinfo fOutflux( "fOutflux", "",
			     new EpFunc2< DifShellBase, double, double> (&DifShellBase::fOutflux ));
  static DestFinfo storeInflux( "storeInflux", "",
				new EpFunc1< DifShellBase, double >( &DifShellBase::storeInflux ) );
  static DestFinfo storeOutflux( "storeOutflux", "",
				 new EpFunc1< DifShellBase, double > ( &DifShellBase::storeOutflux ) );
  static DestFinfo tauPump( "tauPump","",
			    new EpFunc2< DifShellBase, double, double >( &DifShellBase::tauPump ) );
  static DestFinfo eqTauPump( "eqTauPump", "",
			      new EpFunc1< DifShellBase, double >( &DifShellBase::eqTauPump ) );
  static DestFinfo hillPump( "hillPump", "",
			     new EpFunc3< DifShellBase, double, double, unsigned int >( &DifShellBase::hillPump ) );
  static Finfo* difShellBaseFinfos[] = {
    //////////////////////////////////////////////////////////////////
    // Field definitions
    //////////////////////////////////////////////////////////////////
    &C,
    &Ceq,
    &D,
    &valence,
    &leak,
    &shapeMode,
    &length,
    &diameter,
    &thickness,
    &volume,
    &outerArea,
    &innerArea,
    //////////////////////////////////////////////////////////////////
    // MsgSrc definitions
    //////////////////////////////////////////////////////////////////

    //////////////////////////////////////////////////////////////////
    // SharedFinfo definitions
    //////////////////////////////////////////////////////////////////
    &proc,
    &buffer,
    concentrationOut(),
    innerDifSourceOut(),
    outerDifSourceOut(),
    &innerDif,
    &outerDif,
    //////////////////////////////////////////////////////////////////
    // DestFinfo definitions
    //////////////////////////////////////////////////////////////////
    &influx,
    &outflux,
    &fInflux,
    &fOutflux,
    &storeInflux,
    &storeOutflux,
    &tauPump,
    &eqTauPump,
    &mmPump,
    &hillPump,
  };

  static string doc[] =
    {
      "Name", "DifShellBase",
      "Author", "Niraj Dudani. Ported to async13 by Subhasis Ray/Asia Jedrzejewska-Szmek",
      "Description", "DifShell object: Models diffusion of an ion (typically calcium) within an "
      "electric compartment. A DifShell is an iso-concentration region with respect to "
      "the ion. Adjoining DifShells exchange flux of this ion, and also keep track of "
      "changes in concentration due to pumping, buffering and channel currents, by "
      "talking to the appropriate objects.",
    };
  static ZeroSizeDinfo< int > dinfo;
  //static Dinfo< DifShellBase> dinfo;
  static Cinfo difShellBaseCinfo(
				 "DifShellBase",
				 Neutral::initCinfo(),
				 difShellBaseFinfos,
				 sizeof( difShellBaseFinfos ) / sizeof( Finfo* ),
				 &dinfo,
				 doc,
				 sizeof( doc ) / sizeof( string ));

  return &difShellBaseCinfo;
}
Exemplo n.º 3
0
const Cinfo* DifShell::initCinfo()
{
    
    static DestFinfo process( "process",
                              "Handles process call",
                              new ProcOpFunc< DifShell >(  &DifShell::process_0 ) );
    static DestFinfo reinit( "reinit",
                             "Reinit happens only in stage 0",
                             new ProcOpFunc< DifShell >( &DifShell::reinit_0 ));
    
    static Finfo* processShared_0[] = {
        &process,
        &reinit
    };

    static SharedFinfo process_0(
        "process_0", 
        "Here we create 2 shared finfos to attach with the Ticks. This is because we want to perform DifShell "
        "computations in 2 stages, much as in the Compartment object. "
        "In the first stage we send out the concentration value to other DifShells and Buffer elements. We also "
        "receive fluxes and currents and sum them up to compute ( dC / dt ). "
        "In the second stage we find the new C value using an explicit integration method. "
        "This 2-stage procedure eliminates the need to store and send prev_C values, as was common in GENESIS.",
        processShared_0,
        sizeof( processShared_0 ) / sizeof( Finfo* ));
	
    static DestFinfo process1( "process",
                               "Handle process call",
                               new ProcOpFunc< DifShell >( &DifShell::process_1 ) );
    static DestFinfo reinit1( "reinit", 
                              "Reinit happens only in stage 0",
                              new ProcOpFunc< DifShell >( &DifShell::reinit_1)
                              );
    static Finfo* processShared_1[] = {
        &process1, &reinit1        
    };
    
    static SharedFinfo process_1( "process_1",
                                  "Second process call",
                                  processShared_1,
                                  sizeof( processShared_1 ) / sizeof( Finfo* ) );
	
    
    static DestFinfo reaction( "reaction",
                               "Here the DifShell receives reaction rates (forward and backward), and concentrations for the "
                               "free-buffer and bound-buffer molecules.",
                               new OpFunc4< DifShell, double, double, double, double >( &DifShell::buffer ));
    static Finfo* bufferShared[] = {
        concentrationOut(), &reaction
    };
    static SharedFinfo buffer( "buffer",
                        "This is a shared message from a DifShell to a Buffer (FixBuffer or DifBuffer). "
			"During stage 0:\n "
			"- DifShell sends ion concentration \n"
			"- Buffer updates buffer concentration and sends it back immediately using a call-back.\n"
			"- DifShell updates the time-derivative ( dC / dt ) \n"
	 		"During stage 1: \n"
			"- DifShell advances concentration C \n"
			"This scheme means that the Buffer does not need to be scheduled, and it does its computations when "
			"it receives a cue from the DifShell. May not be the best idea, but it saves us from doing the above "
			"computations in 3 stages instead of 2." ,
                        bufferShared,
			sizeof( bufferShared ) / sizeof( Finfo* ));

    static DestFinfo fluxFromOut( "fluxFromOut",
                                  "Destination message",
                                  new OpFunc2< DifShell, double, double > ( &DifShell::fluxFromOut ));
    
    static Finfo* innerDifShared[] = {
        innerDifSourceOut(),
        &fluxFromOut
    };
    static SharedFinfo innerDif( "innerDif",
                                 "This shared message (and the next) is between DifShells: adjoining shells exchange information to "
                                 "find out the flux between them. "
                                 "Using this message, an inner shell sends to, and receives from its outer shell." ,
                                 innerDifShared,
                                 sizeof( innerDifShared ) / sizeof( Finfo* ));

    static DestFinfo fluxFromIn( "fluxFromIn", "",
                                 new OpFunc2< DifShell, double, double> ( &DifShell::fluxFromIn ) );
    static Finfo* outerDifShared[] = {
        &fluxFromIn,
        outerDifSourceOut(),
    };

    static  SharedFinfo outerDif( "outerDif",
                                  "Using this message, an outer shell sends to, and receives from its inner shell." ,
                                  outerDifShared,
                                  sizeof( outerDifShared ) / sizeof( Finfo* ));

    static ReadOnlyValueFinfo< DifShell, double> C( "C", 
                                 "Concentration C is computed by the DifShell and is read-only",
                                 &DifShell::getC);
    static ValueFinfo< DifShell, double> Ceq( "Ceq", "",
                           &DifShell::setCeq,
                           &DifShell::getCeq);
    static ValueFinfo< DifShell, double> D( "D", "",
                         &DifShell::setD,
                         &DifShell::getD);
    static ValueFinfo< DifShell, double> valence( "valence", "",
                               &DifShell::setValence,
                               &DifShell::getValence);
    static ValueFinfo< DifShell, double> leak( "leak", "",
                            &DifShell::setLeak,
                            &DifShell::getLeak);
    static ValueFinfo< DifShell, unsigned int> shapeMode( "shapeMode", "",
                       &DifShell::setShapeMode,
                       &DifShell::getShapeMode);
    static ValueFinfo< DifShell, double> length( "length", "",
                              &DifShell::setLength,
                              &DifShell::getLength);
    static ValueFinfo< DifShell, double> diameter( "diameter", "",
                       &DifShell::setDiameter,
                       &DifShell::getDiameter );
    static ValueFinfo< DifShell, double> thickness( "thickness", "",
                                 &DifShell::setThickness,
                                 &DifShell::getThickness );
    static ValueFinfo< DifShell, double> volume( "volume", "",
                              &DifShell::setVolume,
                              &DifShell::getVolume );
    static ValueFinfo< DifShell, double> outerArea( "outerArea", "",
                                                    &DifShell::setOuterArea,
                                                    &DifShell::getOuterArea);
    static ValueFinfo< DifShell, double> innerArea( "innerArea", "",
                                 &DifShell::setInnerArea,
                                 &DifShell::getInnerArea );

    
    static DestFinfo influx( "influx", "",
                             new OpFunc1< DifShell, double > (&DifShell::influx ));
    static DestFinfo outflux( "outflux", "",
                              new OpFunc1< DifShell, double >( &DifShell::influx ));
    static DestFinfo fInflux( "fInflux", "",
                              new OpFunc2< DifShell, double, double >( &DifShell::fInflux ));
    static DestFinfo fOutflux( "fOutflux", "",
                               new OpFunc2< DifShell, double, double> (&DifShell::fOutflux ));
    static DestFinfo storeInflux( "storeInflux", "",
                                 new OpFunc1< DifShell, double >( &DifShell::storeInflux ) );
    static DestFinfo storeOutflux( "storeOutflux", "",
                                   new OpFunc1< DifShell, double > ( &DifShell::storeOutflux ) );
    static DestFinfo tauPump( "tauPump","",
                              new OpFunc2< DifShell, double, double >( &DifShell::tauPump ) );
    static DestFinfo eqTauPump( "eqTauPump", "",
                                new OpFunc1< DifShell, double >( &DifShell::eqTauPump ) );
    static DestFinfo mmPump( "mmPump", "",
                             new OpFunc2< DifShell, double, double >( &DifShell::mmPump ) );
    static DestFinfo hillPump( "hillPump", "",
                               new OpFunc3< DifShell, double, double, unsigned int >( &DifShell::hillPump ) );
    static Finfo* difShellFinfos[] = {
	//////////////////////////////////////////////////////////////////
	// Field definitions
	//////////////////////////////////////////////////////////////////
        &C,
        &Ceq,
        &D,
        &valence,
        &leak,
        &shapeMode,
        &length,
        &diameter,
        &thickness,
        &volume,
        &outerArea,
        &innerArea,
	//////////////////////////////////////////////////////////////////
	// MsgSrc definitions
	//////////////////////////////////////////////////////////////////

	//////////////////////////////////////////////////////////////////
	// SharedFinfo definitions
	//////////////////////////////////////////////////////////////////
        &process_0,
        &process_1,
        &buffer,
        &innerDif,
        &outerDif,
	//////////////////////////////////////////////////////////////////
	// DestFinfo definitions
	//////////////////////////////////////////////////////////////////
        &influx,
        &outflux,
        &fInflux,
        &fOutflux,
        &storeInflux,
        &storeOutflux,
        &tauPump,
        &eqTauPump,
        &mmPump,
        &hillPump,
	};

	static string doc[] =
	{
		"Name", "DifShell",
		"Author", "Niraj Dudani. Ported to async13 by Subhasis Ray.",
		"Description", "DifShell object: Models diffusion of an ion (typically calcium) within an "
				"electric compartment. A DifShell is an iso-concentration region with respect to "
				"the ion. Adjoining DifShells exchange flux of this ion, and also keep track of "
				"changes in concentration due to pumping, buffering and channel currents, by "
				"talking to the appropriate objects.",
	};
        static Dinfo< DifShell > dinfo;
	static Cinfo difShellCinfo(
            "DifShell",
            Neutral::initCinfo(),
            difShellFinfos,
            sizeof( difShellFinfos ) / sizeof( Finfo* ),
            &dinfo,
            doc,
            sizeof( doc ) / sizeof( string ));

	return &difShellCinfo;
}
Exemplo n.º 4
0
const Cinfo * DifBufferBase::initCinfo()
{
  static DestFinfo process( "process",
                            "Handles process call",
                            new ProcOpFunc< DifBufferBase >(  &DifBufferBase::process) );
  static DestFinfo reinit( "reinit",
                           "Reinit happens only in stage 0",
                           new ProcOpFunc< DifBufferBase >( &DifBufferBase::reinit));

  static Finfo* processShared[] = {
    &process,
    &reinit
  };

  static SharedFinfo proc(
			  "proc",
			  "Here we create 2 shared finfos to attach with the Ticks. This is because we want to perform DifBufferBase "
			  "computations in 2 stages, much as in the Compartment object. "
			  "In the first stage we send out the concentration value to other DifBufferBases and Buffer elements. We also",
			  processShared,
			  sizeof( processShared ) / sizeof( Finfo* ));

  static DestFinfo concentration("concentration",
                                 "Receives concentration (from DifShell).",
                                 new EpFunc1<DifBufferBase, double>(&DifBufferBase::buffer));
  static Finfo* bufferShared[] = {
    &concentration, DifBufferBase::reactionOut()
  };
  static SharedFinfo buffer( "buffer",
                             "This is a shared message with DifShell. "
                             "During stage 0:\n "
                             " - DifBufferBase sends ion concentration\n"
                             " - Buffer updates buffer concentration and sends it back immediately using a call-back.\n"
                             " - DifShell updates the time-derivative ( dC / dt ) \n"
                             "\n"
                             "During stage 1: \n"
                             " - DifShell advances concentration C \n\n"
                             "This scheme means that the Buffer does not need to be scheduled, and it does its computations when "
                             "it receives a cue from the DifShell. May not be the best idea, but it saves us from doing the above "
                             "computations in 3 stages instead of 2." ,
                             bufferShared,
                             sizeof( bufferShared ) / sizeof( Finfo* ));

  static DestFinfo fluxFromOut( "fluxFromOut",
                                "Destination message",
                                new EpFunc2< DifBufferBase, double, double > ( &DifBufferBase::fluxFromOut ));

  static Finfo* innerDifShared[] = {
    &fluxFromOut,
    DifBufferBase::innerDifSourceOut()

  };

  static SharedFinfo innerDif( "innerDif",
                               "This shared message (and the next) is between DifBufferBases: adjoining shells exchange information to "
                               "find out the flux between them. "
                               "Using this message, an inner shell sends to, and receives from its outer shell." ,
                               innerDifShared,
                               sizeof( innerDifShared ) / sizeof( Finfo* ));

  static DestFinfo fluxFromIn( "fluxFromIn", "",
                               new EpFunc2< DifBufferBase, double, double> ( &DifBufferBase::fluxFromIn) );

  static Finfo* outerDifShared[] = {
    &fluxFromIn,
    DifBufferBase::outerDifSourceOut(),

  };

  static  SharedFinfo outerDif( "outerDif",
                                "Using this message, an outer shell sends to, and receives from its inner shell." ,
                                outerDifShared,
                                sizeof( outerDifShared ) / sizeof( Finfo* ));

  ////////////////////////////
  // Field defs
  ////////////////////////////
  static ElementValueFinfo<DifBufferBase, double> activation("activation",
							     "Ion concentration from incoming conc message.",
							     &DifBufferBase::setActivation,
							     &DifBufferBase::getActivation);
  static ElementValueFinfo<DifBufferBase, double> kf("kf",
						     "Forward rate constant of buffer molecules 1/mM/s (?)",
						     &DifBufferBase::setKf,
						     &DifBufferBase::getKf);
  static ElementValueFinfo<DifBufferBase, double> kb("kb",
						     "Backward rate constant of buffer molecules. 1/s",
						     &DifBufferBase::setKb,
						     &DifBufferBase::getKb);
  static ElementValueFinfo<DifBufferBase, double> D("D",
						    "Diffusion constant of buffer molecules. m^2/s",
						    &DifBufferBase::setD,
						    &DifBufferBase::getD);
  static ElementValueFinfo<DifBufferBase, double> bFree("bFree",
							"Free buffer concentration",
							&DifBufferBase::setBFree,
							&DifBufferBase::getBFree);
  static ElementValueFinfo<DifBufferBase, double> bBound("bBound",
							 "Bound buffer concentration",
							 &DifBufferBase::setBBound,
							 &DifBufferBase::getBBound);
  static ElementValueFinfo<DifBufferBase, double> bTot("bTot",
						       "Total buffer concentration.",
						       &DifBufferBase::setBTot,
						       &DifBufferBase::getBTot);
  static ElementValueFinfo<DifBufferBase, double> length("length",
							 "Length of shell",
							 &DifBufferBase::setLength,
							 &DifBufferBase::getLength);
  static ElementValueFinfo<DifBufferBase, double> diameter("diameter",
							   "Diameter of shell",
							   &DifBufferBase::setDiameter,
							   &DifBufferBase::getDiameter);
  static ElementValueFinfo<DifBufferBase, unsigned int> shapeMode("shapeMode",
								  "shape of the shell: SHELL=0, SLICE=SLAB=1, USERDEF=3",
								  &DifBufferBase::setShapeMode,
								  &DifBufferBase::getShapeMode);

  static ElementValueFinfo<DifBufferBase, double> thickness("thickness",
							    "Thickness of shell",
							    &DifBufferBase::setThickness,
							    &DifBufferBase::getThickness);

  static ElementValueFinfo<DifBufferBase, double> innerArea("innerArea",
							    "Inner area of shell",
							    &DifBufferBase::setInnerArea,
							    &DifBufferBase::getInnerArea);
  static ElementValueFinfo<DifBufferBase, double> outerArea("outerArea",
							    "Outer area of shell",
							    &DifBufferBase::setOuterArea,
							    &DifBufferBase::getOuterArea);
  static ElementValueFinfo< DifBufferBase, double> volume( "volume", "",
							   &DifBufferBase::setVolume,
							   &DifBufferBase::getVolume );

  ////
  // DestFinfo
  ////
  static Finfo * difBufferFinfos[] = {
    //////////////////////////////////////////////////////////////////
    // Field definitions
    //////////////////////////////////////////////////////////////////

    &activation,
    &D,
    &bFree,
    &bBound,
    &bTot,
    &kf,
    &kb,
    //&prevFree,
    //&prevBound,
    &length,
    &diameter,
    &shapeMode,
    &thickness,
    &innerArea,
    &outerArea,
    &volume,
    //////////////////////////////////////////////////////////////////
    // SharedFinfo definitions
    /////////////////////////////////////////////////////////////////
    &proc,
    &buffer,
    &innerDif,
    &outerDif,
    //
    reactionOut(),
    innerDifSourceOut(),
    outerDifSourceOut(),
    //////////////////////////////////////////////////////////////////
    // DestFinfo definitions
    //////////////////////////////////////////////////////////////////
    &concentration,
  };

  static string doc[] = {
    "Name", "DifBufferBase",
    "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 difBufferCinfo(
			      "DifBufferBase",
			      Neutral::initCinfo(),
			      difBufferFinfos,
			      sizeof(difBufferFinfos)/sizeof(Finfo*),
			      &dinfo,
			      doc,
			      sizeof(doc)/sizeof(string));

  return &difBufferCinfo;
}