当前位置: 首页>>代码示例>>C++>>正文


C++ Eref::element方法代码示例

本文整理汇总了C++中Eref::element方法的典型用法代码示例。如果您正苦于以下问题:C++ Eref::element方法的具体用法?C++ Eref::element怎么用?C++ Eref::element使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Eref的用法示例。


在下文中一共展示了Eref::element方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: 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;
	}
}
开发者ID:Vivek-sagar,项目名称:moose-1,代码行数:25,代码来源:Pool.cpp

示例2: getReactantVols

unsigned int getReactantVols( const Eref& reac, const SrcFinfo* pools, 
	vector< double >& vols )
{
	static const unsigned int meshIndex = 0;

	const vector< MsgFuncBinding >* mfb = 
		reac.element()->getMsgAndFunc( pools->getBindIndex() );
	unsigned int smallIndex = 0;

	vols.resize( 0 );
	if ( mfb ) {
		for ( unsigned int i = 0; i < mfb->size(); ++i ) {
			double v = 1;
			Element* pool = Msg::getMsg( (*mfb)[i].mid )->e2();
			if ( pool == reac.element() )
				pool = Msg::getMsg( (*mfb)[i].mid )->e1();
			assert( pool != reac.element() );
			Eref pooler( pool, meshIndex );
			if ( pool->cinfo()->isA( "PoolBase" ) ) {
				v = lookupVolumeFromMesh( pooler );
			} else {
				cout << "Error: getReactantVols: pool is of unknown type\n";
				assert( 0 );
			}
			vols.push_back( v );
			if ( v < vols[0] )
				smallIndex = i;
		}
	}
	return smallIndex;
}
开发者ID:csiki,项目名称:MOOSE,代码行数:31,代码来源:lookupVolumeFromMesh.cpp

示例3: firstTgt

Eref OneToAllMsg::firstTgt( const Eref& src ) const 
{
	if ( src.element() == e1_ )
		return Eref( e2_, 0 );
	else if ( src.element() == e2_ )
		return Eref( e1_, i1_ );
	return Eref( 0, 0 );
}
开发者ID:2pysarthak,项目名称:moose-core-personal,代码行数:8,代码来源:OneToAllMsg.cpp

示例4: firstTgt

Eref SingleMsg::firstTgt( const Eref& src ) const 
{
	if ( src.element() == e1_ )
		return Eref( e2_, i2_, f2_ );
	else if ( src.element() == e2_ )
		return Eref( e1_, i1_ );
	return Eref( 0, 0 );
}
开发者ID:2pysarthak,项目名称:moose-core-personal,代码行数:8,代码来源:SingleMsg.cpp

示例5: firstTgt

/**
 * This is a little tricky because we might be mapping between
 * data entries and field entries here.
 * May wish also to apply to exec operations.
 * At this point, the effect of trying to go between regular
 * data entries and field entries is undefined.
 */
Eref OneToOneDataIndexMsg::firstTgt( const Eref& src ) const
{
	if ( src.element() == e1_ ) {
		return Eref( e2_, src.dataIndex(), 0 );
	} else if ( src.element() == e2_ ) {
		return Eref( e1_, src.dataIndex() );
	}
	return Eref( 0, 0 );
}
开发者ID:pgleeson,项目名称:moose-core,代码行数:16,代码来源:OneToOneDataIndexMsg.cpp

示例6: vSetIsBuffered

/**
 * setIsBuffered is a really nasty operation, made possible only because
 * BufPool is derived from Pool and has no other fields.
 * It uses a low-level replaceCinfo call to just change the 
 * identity of the Cinfo used, leaving everything else as is.
 */
void Pool::vSetIsBuffered( const Eref& e, bool v )
{
	static const Cinfo* bufPoolCinfo = Cinfo::find( "BufPool" );
	if (vGetIsBuffered( e ) == v)
		return;
	if (v) {
		e.element()->replaceCinfo( bufPoolCinfo );
	} else {
		e.element()->replaceCinfo( poolCinfo );
	}
}
开发者ID:subhacom,项目名称:moose-core,代码行数:17,代码来源:Pool.cpp

示例7: ret

vector< string > Neutral::getDestFields( const Eref& e ) const
{
	unsigned int num = e.element()->cinfo()->getNumDestFinfo();
	vector< string > ret( num );
	for ( unsigned int i = 0; i < num; ++i ) {
		const Finfo *f = e.element()->cinfo()->getDestFinfo( i );
		assert( f );
		ret[i] = f->name();
	}
	return ret;
}
开发者ID:NeuroArchive,项目名称:moose,代码行数:11,代码来源:Neutral.cpp

示例8:

vector< Id > Neutral::getNeighbors( const Eref& e, string field ) const
{
	vector< Id > ret;
	const Finfo* finfo = e.element()->cinfo()->findFinfo( field );
	if ( finfo )
		e.element()->getNeighbors( ret, finfo );
	else
		cout << "Warning: Neutral::getNeighbors: Id.Field '" << 
				e.id().path() << "." << field <<
				"' not found\n";
	return ret;
}
开发者ID:NeuroArchive,项目名称:moose,代码行数:12,代码来源:Neutral.cpp

示例9: firstTgt

/**
 * This is a little tricky because we might be mapping between
 * data entries and field entries here.
 * May wish also to apply to exec operations.
 * At this point, the effect of trying to go between regular
 * data entries and field entries is undefined.
 */
Eref OneToOneMsg::firstTgt( const Eref& src ) const 
{
	if ( src.element() == e1_ ) {
		if ( e2_->hasFields() )
			return Eref( e2_, i2_, src.dataIndex() );
		else 
			return Eref( e2_, src.dataIndex(), 0 );
	} else if ( src.element() == e2_ ) {
		return Eref( e1_, src.dataIndex() );
	}
	return Eref( 0, 0 );
}
开发者ID:2pysarthak,项目名称:moose-core-personal,代码行数:19,代码来源:OneToOneMsg.cpp

示例10: zombify

void HSolve::zombify( Eref hsolve ) const
{
	vector< Id >::const_iterator i;
	
	for ( i = compartmentId_.begin(); i != compartmentId_.end(); ++i )
		ZombieCompartment::zombify( hsolve.element(), i->eref().element() );
	
	for ( i = caConcId_.begin(); i != caConcId_.end(); ++i )
		ZombieCaConc::zombify( hsolve.element(), i->eref().element() );
	
	for ( i = channelId_.begin(); i != channelId_.end(); ++i )
		ZombieHHChannel::zombify( hsolve.element(), i->eref().element() );
}
开发者ID:Vivek-sagar,项目名称:moose-1,代码行数:13,代码来源:HSolve.cpp

示例11: buildTree

unsigned int Neutral::buildTree( const Eref& e, vector< Id >& tree )
	const 
{
	unsigned int ret = 1;
	Eref er( e.element(), ALLDATA );
	vector< Id > kids = getChildren( er );
	sort( kids.begin(), kids.end() );
	kids.erase( unique( kids.begin(), kids.end() ), kids.end() );
	for ( vector< Id >::iterator i = kids.begin(); i != kids.end(); ++i )
		ret += buildTree( i->eref(), tree );
	tree.push_back( e.element()->id() );
	return ret;
}
开发者ID:NeuroArchive,项目名称:moose,代码行数:13,代码来源:Neutral.cpp

示例12: Msg

OneToOneDataIndexMsg::OneToOneDataIndexMsg(
				const Eref& e1, const Eref& e2,
				unsigned int msgIndex )
	: Msg( ObjId( managerId_, (msgIndex != 0) ? msgIndex: msg_.size() ),
					e1.element(), e2.element() )
{
	if ( msgIndex == 0 ) {
		msg_.push_back( this );
	} else {
		if ( msg_.size() <= msgIndex )
			msg_.resize( msgIndex + 1 );
		msg_[ msgIndex ] = this;
	}
}
开发者ID:pgleeson,项目名称:moose-core,代码行数:14,代码来源:OneToOneDataIndexMsg.cpp

示例13: Msg

SingleMsg::SingleMsg( const Eref& e1, const Eref& e2, unsigned int msgIndex)
	: Msg( ObjId( managerId_, (msgIndex != 0 ) ? msgIndex: msg_.size() ), 
					e1.element(), e2.element() ),
	i1_( e1.dataIndex() ), 
	i2_( e2.dataIndex() ),
	f2_( e2.fieldIndex() )
{
	if ( msgIndex == 0 ) {
		msg_.push_back( this );
		return;
	} else if ( msg_.size() <= msgIndex ) {
		msg_.resize( msgIndex + 1 );
	}
	msg_[ msgIndex ] = this;
}
开发者ID:2pysarthak,项目名称:moose-core-personal,代码行数:15,代码来源:SingleMsg.cpp

示例14:

OneToAllMsg::OneToAllMsg( MsgId mid, Eref e1, Element* e2 )
	: 
		Msg( mid, e1.element(), e2, OneToAllMsg::managerId_ ),
		i1_( e1.index() )
{
	;
}
开发者ID:Vivek-sagar,项目名称:moose-1,代码行数:7,代码来源:OneToAllMsg.cpp

示例15: getNumSub

unsigned int EnzBase::getNumSub( const Eref& e, const Qinfo* q ) const
{
	const vector< MsgFuncBinding >* mfb = 
		e.element()->getMsgAndFunc( toSub()->getBindIndex() );
	assert( mfb );
	return ( mfb->size() );
}
开发者ID:Vivek-sagar,项目名称:moose-1,代码行数:7,代码来源:EnzBase.cpp


注:本文中的Eref::element方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。