本文整理汇总了C++中teuchos::RCP::GetProjectedNode方法的典型用法代码示例。如果您正苦于以下问题:C++ RCP::GetProjectedNode方法的具体用法?C++ RCP::GetProjectedNode怎么用?C++ RCP::GetProjectedNode使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类teuchos::RCP
的用法示例。
在下文中一共展示了RCP::GetProjectedNode方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: ReportError
//.........这里部分代码省略.........
if (ok) // the projection is good
{
// create a projected node and store it in snode
MoertelT::MOERTEL_TEMPLATE_CLASS(ProjectedNodeT)* pnode =
new MoertelT::MOERTEL_TEMPLATE_CLASS(ProjectedNodeT)(
*snode, xi, msegs[i], ssegs[j]->Id());
snode->SetProjectedNode(pnode);
snode->SetGap(gap);
#if 0
std::cout << " snode id: " << pnode->Id()
<< " projects on mseg: " << msegs[i]->Id()
<< " orth to sseg " << ssegs[j]->Id() << std::endl;
#endif
}
} // for (int j=0; j<nsseg; ++j)
} // for (int i=0; i<nmseg; ++i)
} // for (scurr=rnode_[sside].begin(); scurr!=rnode_[sside].end(); ++scurr)
// loop all slave nodes again and make projections redundant
if (lcomm_->getSize() > 1) {
std::vector<double> bcast(10 * rnode_[sside].size());
for (int proc = 0; proc < lcomm_->getSize(); ++proc) {
int blength = 0;
if (proc == lcomm_->getRank()) {
for (scurr = rnode_[sside].begin(); scurr != rnode_[sside].end();
++scurr) {
Teuchos::RCP<MoertelT::MOERTEL_TEMPLATE_CLASS(NodeT)> snode =
scurr->second;
if (proc != NodePID(snode->Id()))
continue; // cannot have a projection on a node i don't own
int npnode = 0;
Teuchos::RCP<MoertelT::MOERTEL_TEMPLATE_CLASS(ProjectedNodeT)>*
pnode = snode->GetProjectedNode(npnode);
if (!pnode) continue; // no projection on this one
bcast[blength] = (double)snode->Id();
++blength;
bcast[blength] = (double)npnode;
++blength;
for (int j = 0; j < npnode; ++j) {
bcast[blength] = (double)pnode[j]->Segment()->Id();
++blength;
const double* xi = pnode[j]->Xi();
bcast[blength] = xi[0];
++blength;
bcast[blength] = xi[1];
++blength;
bcast[blength] = pnode[j]->OrthoSegment();
++blength;
bcast[blength] = pnode[j]->Gap();
++blength;
}
if ((int)bcast.size() < blength + 20) bcast.resize(bcast.size() + 40);
} // for (mcurr=rnode_[mside].begin(); mcurr!=rnode_[mside].end();
// ++mcurr)
if (blength >= (int)bcast.size()) {
std::stringstream oss;
oss << "***ERR*** "
"MoertelT::Interface::ProjectNodes_SlavetoMaster_Orthogonal:\n"
<< "***ERR*** Overflow in communication buffer occured\n"
<< "***ERR*** file/line: " << __FILE__ << "/" << __LINE__ << "\n";
throw MoertelT::ReportError(oss);
}
} // if (proc==lComm()->MyPID())
Teuchos::broadcast<LO, int>(*lcomm_, proc, 1, &blength);