PackedColumn::PackedColumn(const std::string & name, InputParameters parameters) : Material(name, parameters), // Get the one parameter from the input file _ball_radius(getParam<Real>("ball_radius")), // Declare two material properties. This returns references that we // hold onto as member variables _permeability(declareProperty<Real>("permeability")), _porosity(declareProperty<Real>("porosity")), _viscosity(declareProperty<Real>("viscosity")), _thermal_conductivity(declareProperty<Real>("thermal_conductivity")), _heat_capacity(declareProperty<Real>("heat_capacity")), _density(declareProperty<Real>("density")) { // Sigh: Still can't depend on C++11.... std::vector<Real> ball_sizes(2); ball_sizes[0] = 1; ball_sizes[1] = 3; // From the paper: Table 1 std::vector<Real> permeability(2); permeability[0] = 0.8451e-9; permeability[1] = 8.968e-9; // Set the x,y data on the LinearInterpolation object. _permeability_interpolation.setData(ball_sizes, permeability); }
const Cinfo* ChanBase::initCinfo() { ///////////////////////////////////////////////////////////////////// // Shared messages ///////////////////////////////////////////////////////////////////// static DestFinfo process( "process", "Handles process call", new ProcOpFunc< ChanBase >( &ChanBase::process ) ); static DestFinfo reinit( "reinit", "Handles reinit call", new ProcOpFunc< ChanBase >( &ChanBase::reinit ) ); static Finfo* processShared[] = { &process, &reinit }; static SharedFinfo proc( "proc", "Shared message to receive Process message from scheduler", processShared, sizeof( processShared ) / sizeof( Finfo* ) ); ///////////////////////////////////////////////////////////////////// /// ChannelOut SrcFinfo defined above. static DestFinfo Vm( "Vm", "Handles Vm message coming in from compartment", new OpFunc1< ChanBase, double >( &ChanBase::handleVm ) ); static Finfo* channelShared[] = { channelOut(), &Vm }; static SharedFinfo channel( "channel", "This is a shared message to couple channel to compartment. " "The first entry is a MsgSrc to send Gk and Ek to the compartment " "The second entry is a MsgDest for Vm from the compartment.", channelShared, sizeof( channelShared ) / sizeof( Finfo* ) ); /////////////////////////////////////////////////////// // Here we reuse the Vm DestFinfo declared above. /// Permability SrcFinfo defined above. static Finfo* ghkShared[] = { &Vm, permeability() }; static SharedFinfo ghk( "ghk", "Message to Goldman-Hodgkin-Katz object", ghkShared, sizeof( ghkShared ) / sizeof( Finfo* ) ); /////////////////////////////////////////////////////// // Field definitions /////////////////////////////////////////////////////// static ElementValueFinfo< ChanBase, double > Gbar( "Gbar", "Maximal channel conductance", &ChanBase::setGbar, &ChanBase::getGbar ); static ElementValueFinfo< ChanBase, double > modulation( "modulation", "Modulation, i.e, scale factor for channel conductance." "Note that this is a regular parameter, it is not " "recomputed each timestep. Thus one can use a slow update, " "say, from a molecule pool, to send a message to set " "the modulation, and it will stay at the set value even if " "the channel runs many timesteps before the next assignment. " "This differs from the GENESIS semantics of a similar message," "which required update each timestep. ", &ChanBase::setModulation, &ChanBase::getModulation ); static ElementValueFinfo< ChanBase, double > Ek( "Ek", "Reversal potential of channel", &ChanBase::setEk, &ChanBase::getEk ); static ElementValueFinfo< ChanBase, double > Gk( "Gk", "Channel conductance variable", &ChanBase::setGk, &ChanBase::getGk ); static ReadOnlyElementValueFinfo< ChanBase, double > Ik( "Ik", "Channel current variable", &ChanBase::getIk ); /////////////////////////////////////////////////////// // MsgSrc definitions /////////////////////////////////////////////////////// // IkOut SrcFinfo defined above. /////////////////////////////////////////////////////// // MsgDest definitions /////////////////////////////////////////////////////// /////////////////////////////////////////////////////// static Finfo* ChanBaseFinfos[] = { &channel, // Shared &ghk, // Shared &Gbar, // Value &modulation, // Value &Ek, // Value &Gk, // Value &Ik, // ReadOnlyValue IkOut(), // Src &proc, // Shared }; static string doc[] = { "Name", "ChanBase", "Author", "Upinder S. Bhalla, 2007-2014, NCBS", "Description", "ChanBase: Base class for assorted ion channels." "Presents a common interface for all of them. ", }; static ZeroSizeDinfo< int > dinfo; static Cinfo ChanBaseCinfo( "ChanBase", Neutral::initCinfo(), ChanBaseFinfos, sizeof( ChanBaseFinfos )/sizeof(Finfo *), &dinfo, doc, sizeof(doc)/sizeof(string) ); return &ChanBaseCinfo; }
nec_float em::impedance() // was (ETA in old nec2) { nec_float ret = sqrt(permeability() / permittivity()); return ret; // 376.8 }
nec_float em::speed_of_light() // was (CVEL in old nec2) but we have changed it to be in meters per second { nec_float ret = 1.0 / sqrt(permeability() * permittivity()); return ret; // 299.8e6; }