コード例 #1
0
ファイル: HHChannel.cpp プロジェクト: asiaszmek/moose-core
/**
 * Here we get the steady-state values for the gate (the 'instant'
 * calculation) as A_/B_.
 */
void HHChannel::vReinit( const Eref& er, ProcPtr info )
{
	g_ = ChanCommon::vGetGbar( er );
	Element* e = er.element();

	double A = 0.0;
	double B = 0.0;
	if ( Xpower_ > 0 ) {
		assert( xGate_ );
		xGate_->lookupBoth( Vm_, &A, &B );
		if ( B < EPSILON ) {
			cout << "Warning: B_ value for " << e->getName() <<
					" is ~0. Check X table\n";
			return;
		}
                if (!xInited_)
                    X_ = A/B;
		g_ *= takeXpower_( X_, Xpower_ );
	}

	if ( Ypower_ > 0 ) {
		assert( yGate_ );
		yGate_->lookupBoth( Vm_, &A, &B );
		if ( B < EPSILON ) {
			cout << "Warning: B value for " << e->getName() <<
					" is ~0. Check Y table\n";
			return;
		}
                if (!yInited_)
                    Y_ = A/B;
		g_ *= takeYpower_( Y_, Ypower_ );
	}

	if ( Zpower_ > 0 ) {
		assert( zGate_ );
		if ( useConcentration_ )
			zGate_->lookupBoth( conc_, &A, &B );
		else
			zGate_->lookupBoth( Vm_, &A, &B );
		if ( B < EPSILON ) {
			cout << "Warning: B value for " << e->getName() <<
					" is ~0. Check Z table\n";
			return;
		}
                if (!zInited_)
                    Z_ = A/B;
		g_ *= takeZpower_( Z_, Zpower_ );
	}

	ChanCommon::vSetGk( er, g_ * HHChannelBase::modulation_ );
	updateIk();
	// Gk_ = g_;
	// Ik_ = ( Ek_ - Vm_ ) * g_;

	// Send out the relevant channel messages.
	// Same for reinit as for process.
	sendReinitMsgs( er, info );
	
	g_ = 0.0;
}
コード例 #2
0
ファイル: HHChannel2D.cpp プロジェクト: Vivek-sagar/moose-1
 /**
  * Here we get the steady-state values for the gate (the 'instant'
  * calculation) as A_/B_.
  */
 void HHChannel2D::reinit( const Eref& er, ProcPtr info )
 {
     g_ = ChanBase::getGbar();
     Element* e = er.element();

     double A = 0.0;
     double B = 0.0;
     if ( Xpower_ > 0 ) {
         xGate_->lookupBoth( depValue( Xdep0_ ), depValue( Xdep1_ ), &A, &B );
         if ( B < EPSILON ) {
             cout << "Warning: B_ value for " << e->getName() <<
                     " is ~0. Check X table\n";
             return;
         }
                 if (!xInited_)
                     X_ = A/B;
         g_ *= takeXpower_( X_, Xpower_ );
     }

     if ( Ypower_ > 0 ) {
         yGate_->lookupBoth( depValue( Ydep0_ ), depValue( Ydep1_ ), &A, &B );
         if ( B < EPSILON ) {
             cout << "Warning: B value for " << e->getName() <<
                     " is ~0. Check Y table\n";
             return;
         }
                 if (!yInited_)
                     Y_ = A/B;
         g_ *= takeYpower_( Y_, Ypower_ );
     }

     if ( Zpower_ > 0 ) {
         zGate_->lookupBoth( depValue( Zdep0_ ), depValue( Zdep1_ ), &A, &B );
         if ( B < EPSILON ) {
             cout << "Warning: B value for " << e->getName() <<
                     " is ~0. Check Z table\n";
             return;
         }
                 if (!zInited_)
                     Z_ = A/B;
         g_ *= takeZpower_( Z_, Zpower_ );
     }

     ChanBase::setGk( g_ );
     ChanBase::updateIk();
     // Gk_ = g_;
     // Ik_ = ( Ek_ - Vm_ ) * g_;

     // Send out the relevant channel messages.
     // Same for reinit as for process.
     ChanBase::reinit( er, info );

     /*
     channelOut.send( er, info, Gk_, Ek_ );
     // Needed by GHK-type objects
     permeability.send( er, info, Gk_ );
     */
	g_ = 0.0;
}
コード例 #3
0
ファイル: HHChannel2D.cpp プロジェクト: Vivek-sagar/moose-1
void HHChannel2D::process( const Eref& e, ProcPtr info )
{
	g_ += ChanBase::getGbar();
	double A = 0;
	double B = 0;
	if ( Xpower_ > 0 ) {
		xGate_->lookupBoth( depValue( Xdep0_ ), depValue( Xdep1_ ), &A, &B );
		if ( instant_ & INSTANT_X )
			X_ = A/B;
		else 
			X_ = integrate( X_, info->dt, A, B );
		g_ *= takeXpower_( X_, Xpower_ );
	}

	if ( Ypower_ > 0 ) {
		yGate_->lookupBoth( depValue( Ydep0_ ), depValue( Ydep1_ ), &A, &B );
		if ( instant_ & INSTANT_Y )
			Y_ = A/B;
		else 
			Y_ = integrate( Y_, info->dt, A, B );

		g_ *= takeYpower_( Y_, Ypower_ );
	}

	if ( Zpower_ > 0 ) {
        zGate_->lookupBoth( depValue( Zdep0_ ), depValue( Zdep1_ ), &A, &B );
		if ( instant_ & INSTANT_Z )
			Z_ = A/B;
		else 
			Z_ = integrate( Z_, info->dt, A, B );

		g_ *= takeZpower_( Z_, Zpower_ );
	}

	ChanBase::setGk( g_ );
	ChanBase::updateIk();
	// Gk_ = g_;
	// Ik_ = ( Ek_ - Vm_ ) * g_;

	// Send out the relevant channel messages.
	ChanBase::process( e, info );
	/*
	channelOut.send( e, info, Gk_, Ek_ );
	
	// This is used if the channel connects up to a conc pool and
	// handles influx of ions giving rise to a concentration change.
	IkOut.send( e, info, Ik_ );
	
	// Needed by GHK-type objects
	permeability.send( e, info, Gk_ );
	*/       
     g_ = 0.0;

 }
コード例 #4
0
ファイル: HSolveStruct.cpp プロジェクト: hrani/moose-core
void ChannelStruct::process( double*& state, CurrentStruct& current )
{
	double fraction = modulation_;

	if( Xpower_ > 0.0 )
		fraction *= takeXpower_( *( state++ ), Xpower_ );
	if( Ypower_ > 0.0 )
		fraction *= takeYpower_( *( state++ ), Ypower_ );
	if( Zpower_ > 0.0 )
		fraction *= takeZpower_( *( state++ ), Zpower_ );

	current.Gk = Gbar_ * fraction;
}
コード例 #5
0
ファイル: HHChannel.cpp プロジェクト: asiaszmek/moose-core
void HHChannel::vProcess( const Eref& e, ProcPtr info )
{
	g_ += ChanCommon::vGetGbar( e );
	double A = 0;
	double B = 0;
	if ( Xpower_ > 0 ) {
		xGate_->lookupBoth( Vm_, &A, &B );
		if ( instant_ & INSTANT_X )
			X_ = A/B;
		else 
			X_ = integrate( X_, info->dt, A, B );
		g_ *= takeXpower_( X_, Xpower_ );
	}

	if ( Ypower_ > 0 ) {
		yGate_->lookupBoth( Vm_, &A, &B );
		if ( instant_ & INSTANT_Y )
			Y_ = A/B;
		else 
			Y_ = integrate( Y_, info->dt, A, B );

		g_ *= takeYpower_( Y_, Ypower_ );
	}

	if ( Zpower_ > 0 ) {
		if ( useConcentration_ )
			zGate_->lookupBoth( conc_, &A, &B );
		else
			zGate_->lookupBoth( Vm_, &A, &B );
		if ( instant_ & INSTANT_Z )
			Z_ = A/B;
		else 
			Z_ = integrate( Z_, info->dt, A, B );

		g_ *= takeZpower_( Z_, Zpower_ );
	}

	ChanCommon::vSetGk( e, g_ * HHChannelBase::modulation_ );
	this->updateIk();
	// Gk_ = g_;
	// Ik_ = ( Ek_ - Vm_ ) * g_;

	// Send out the relevant channel messages.
	sendProcessMsgs( e, info );
	
	g_ = 0.0;
}