本文整理汇总了C++中Eref::index方法的典型用法代码示例。如果您正苦于以下问题:C++ Eref::index方法的具体用法?C++ Eref::index怎么用?C++ Eref::index使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Eref
的用法示例。
在下文中一共展示了Eref::index方法的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1:
OneToAllMsg::OneToAllMsg( MsgId mid, Eref e1, Element* e2 )
:
Msg( mid, e1.element(), e2, OneToAllMsg::managerId_ ),
i1_( e1.index() )
{
;
}
示例2: vRemesh
void Pool::vRemesh( const Eref& e, const Qinfo* q,
double oldvol,
unsigned int numTotalEntries, unsigned int startEntry,
const vector< unsigned int >& localIndices,
const vector< double >& vols )
{
if ( e.index().value() != 0 )
return;
/*
if ( q->addToStructuralQ() )
return;
*/
Neutral* n = reinterpret_cast< Neutral* >( e.data() );
assert( vols.size() > 0 );
double concInit = nInit_ / ( NA * oldvol );
if ( vols.size() != e.element()->dataHandler()->localEntries() )
n->setLastDimension( e, q, vols.size() );
// Note that at this point the Pool pointer may be invalid!
// But we need to update the concs anyway.
assert( e.element()->dataHandler()->localEntries() == vols.size() );
Pool* pooldata = reinterpret_cast< Pool* >( e.data() );
for ( unsigned int i = 0; i < vols.size(); ++i ) {
pooldata[i].nInit_ = pooldata[i].n_ = concInit * vols[i] * NA;
}
}
示例3: getNinit
double GslStoich::getNinit( const Eref& e ) const
{
unsigned int i = e.index().value();
unsigned int j = coreStoich()->convertIdToPoolIndex( e.id() );
assert( i < pools_.size() );
assert( j < pools_[i].size() );
return pools_[i].Sinit()[j];
}
示例4: setNinit
void GslStoich::setNinit( const Eref& e, double v )
{
unsigned int i = e.index().value();
unsigned int j = coreStoich()->convertIdToPoolIndex( e.id() );
assert( i < pools_.size() );
assert( j < pools_[i].size() );
pools_[i].varSinit()[j] = v;
}
示例5: setN
void GslStoich::setN( const Eref& e, double v )
{
unsigned int i = e.index().value(); // Later: Handle node location.
unsigned int j = coreStoich()->convertIdToPoolIndex( e.id() );
assert( i < pools_.size() );
assert( j < pools_[i].size() );
pools_[i].varS()[j] = v;
assert( i < y_.size() );
assert( j < y_[i].size() );
y_[i][j] = v;
}
示例6: vRemesh
// vRemesh: All the work is done by the message from the compartment to the
// Stoich. None of the ZPools is remeshed directly. However, their
// DataHandlers need updating.
void ZPool::vRemesh( const Eref& e, const Qinfo* q,
double oldvol,
unsigned int numTotalEntries, unsigned int startEntry,
const vector< unsigned int >& localIndices,
const vector< double >& vols )
{
;
if ( e.index().value() != 0 )
return;
Neutral* n = reinterpret_cast< Neutral* >( e.data() );
if ( vols.size() != e.element()->dataHandler()->localEntries() )
n->setLastDimension( e, q, vols.size() );
}
示例7: vProcess
void Pool::vProcess( const Eref& e, ProcPtr p )
{
// double A = e.sumBuf( aSlot );
// double B = e.sumBuf( bSlot );
if ( n_ < 0 )
cout << "nugh" << e.index() << endl;
if ( B_ < 0 )
cout << "bugh" << e.index() << endl;
if ( p->dt < 0 )
cout << "tugh" << e.index() << endl;
if ( n_ > EPSILON && B_ > EPSILON ) {
double C = exp( -B_ * p->dt / n_ );
n_ *= C + (A_ / B_ ) * ( 1.0 - C );
} else {
n_ += ( A_ - B_ ) * p->dt;
if ( n_ < 0.0 )
n_ = 0.0;
}
A_ = B_ = 0.0;
nOut.send( e, p->threadIndexInGroup, n_ );
}
示例8: getDiffConst
double GslStoich::getDiffConst( const Eref& e ) const
{
unsigned int j = coreStoich()->convertIdToPoolIndex( e.id() );
assert( j < pools_[ e.index().value() ].size() );
return coreStoich()->getDiffConst( j );
}
示例9: setDiffConst
void GslStoich::setDiffConst( const Eref& e, double v )
{
unsigned int j = coreStoich()->convertIdToPoolIndex( e.id() );
assert( j < pools_[ e.index().value() ].size() );
coreStoich_.setDiffConst( j, v );
}
示例10: getSpecies
unsigned int GslStoich::getSpecies( const Eref& e )
{
unsigned int j = coreStoich()->convertIdToPoolIndex( e.id() );
assert( j < pools_[ e.index().value() ].size() );
return coreStoich()->getSpecies( j );
}