本文整理汇总了C++中teuchos::RCP::NodeIds方法的典型用法代码示例。如果您正苦于以下问题:C++ RCP::NodeIds方法的具体用法?C++ RCP::NodeIds怎么用?C++ RCP::NodeIds使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类teuchos::RCP
的用法示例。
在下文中一共展示了RCP::NodeIds方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: ReportError
/*----------------------------------------------------------------------*
| finalize construction of this interface |
*----------------------------------------------------------------------*/
bool MOERTEL::Interface::Complete()
{
if (IsComplete())
{
if (OutLevel()>0)
std::cout << "MOERTEL: ***WRN*** MOERTEL::Interface::InterfaceComplete:\n"
<< "MOERTEL: ***WRN*** InterfaceComplete() was called before, do nothing\n"
<< "MOERTEL: ***WRN*** file/line: " << __FILE__ << "/" << __LINE__ << "\n";
return true;
}
//-------------------------------------------------------------------
// check for NULL entries in maps
bool ok = true;
for (int i=0; i<2; ++i)
{
std::map<int,Teuchos::RCP<MOERTEL::Node> >::const_iterator curr;
for (curr=node_[i].begin(); curr!=node_[i].end(); ++curr)
{
if (curr->second == Teuchos::null)
{
std::cout << "***ERR*** MOERTEL::Interface::Complete:\n"
<< "***ERR*** Interface # " << Id_ << ":\n"
<< "***ERR*** found NULL entry in map of nodes\n"
<< "***ERR*** file/line: " << __FILE__ << "/" << __LINE__ << "\n";
ok = false;
}
}
}
for (int i=0; i<2; ++i)
{
std::map<int,Teuchos::RCP<MOERTEL::Segment> >::const_iterator curr;
for (curr=seg_[i].begin(); curr!=seg_[i].end(); ++curr)
{
if (curr->second == Teuchos::null)
{
std::cout << "***ERR*** MOERTEL::Interface::Complete:\n"
<< "***ERR*** Interface # " << Id_ << ":\n"
<< "***ERR*** found NULL entry in map of segments\n"
<< "***ERR*** file/line: " << __FILE__ << "/" << __LINE__ << "\n";
ok = false;
}
}
}
int lok = ok;
int gok = 1;
gcomm_.MinAll(&lok,&gok,1);
if (!gok) return false;
//-------------------------------------------------------------------
// check whether all nodes for segments are present
// (take in account that node might be on different processor)
// this test is expensive and does not scale. It is therefore only performed
// when user requests a high output level
#if 1
if (OutLevel()>9)
{
for (int proc=0; proc<gcomm_.NumProc(); ++proc)
{
for (int side=0; side<2; ++side)
{
// create length of list of all nodes adjacent to segments on proc
int sendsize = 0;
if (proc==gcomm_.MyPID())
{
std::map<int,Teuchos::RCP<MOERTEL::Segment> >::const_iterator curr;
for (curr=seg_[side].begin(); curr!=seg_[side].end(); ++curr)
sendsize += curr->second->Nnode();
}
gcomm_.Broadcast(&sendsize,1,proc);
// create list of all nodes adjacent to segments on proc
std::vector<int> ids(sendsize);
if (proc==gcomm_.MyPID())
{
std::map<int,Teuchos::RCP<MOERTEL::Segment> >::const_iterator curr;
int counter=0;
for (curr=seg_[side].begin(); curr!=seg_[side].end(); ++curr)
{
const int* segids = curr->second->NodeIds();
for (int i=0; i<curr->second->Nnode(); ++i)
ids[counter++] = segids[i];
}
}
gcomm_.Broadcast(&ids[0],sendsize,proc);
// check on all processors for nodes in ids
std::vector<int> foundit(sendsize);
std::vector<int> gfoundit(sendsize);
for (int i=0; i<sendsize; ++i)
{
foundit[i] = 0;
if (node_[side].find(ids[i]) != node_[side].end())
foundit[i] = 1;
}
gcomm_.MaxAll(&foundit[0],&gfoundit[0],sendsize);
for (int i=0; i<sendsize; ++i)
//.........这里部分代码省略.........