本文整理汇总了C++中teuchos::RCP::NumColors方法的典型用法代码示例。如果您正苦于以下问题:C++ RCP::NumColors方法的具体用法?C++ RCP::NumColors怎么用?C++ RCP::NumColors使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类teuchos::RCP
的用法示例。
在下文中一共展示了RCP::NumColors方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: main
//.........这里部分代码省略.........
utils.out() << "Test passed!" << std::endl;
exit(0);
#else
// Create a timer for performance
Epetra_Time fillTime(Comm);
EpetraExt::CrsGraph_MapColoring::ColoringAlgorithm algType =
EpetraExt::CrsGraph_MapColoring::JONES_PLASSMAN;
bool colorParallel = true;
int reordering = 0;
int verbosityLevel = 0;
bool distance1 = false;
EpetraExt::CrsGraph_MapColoring tmpMapColoring(
algType, reordering, distance1, verbosityLevel);
Teuchos::RCP<Epetra_MapColoring> colorMap =
Teuchos::rcp(&tmpMapColoring(*(Problem->getGraph())));
EpetraExt::CrsGraph_MapColoringIndex colorMapIndex(*colorMap);
Teuchos::RCP< std::vector<Epetra_IntVector> > columns =
Teuchos::rcp(&colorMapIndex(*(Problem->getGraph())));
Teuchos::RCP<NOX::Epetra::Interface::Required> iReq = interface;
Teuchos::RCP<NOX::Epetra::FiniteDifferenceColoring> FDC =
Teuchos::rcp(new NOX::Epetra::FiniteDifferenceColoring(printParams,
iReq,
noxSoln,
Problem->getGraph(),
colorMap,
columns,
colorParallel,
distance1));
if (verbose)
printf("\n[%d]\tTime to color Jacobian --> %e sec. for %d colors.\n\n",
MyPID,fillTime.ElapsedTime(), colorMap->NumColors());
FDC->setDifferenceMethod(NOX::Epetra::FiniteDifference::Centered);
// -------------- End of block needed to use coloring --------------- */
// Create the Linear System
Teuchos::RCP<NOX::Epetra::Interface::Jacobian> iJac = FDC;
Teuchos::RCP<NOX::Epetra::LinearSystemAztecOO> linSys =
Teuchos::rcp(new NOX::Epetra::LinearSystemAztecOO(printParams, lsParams,
iReq, iJac, FDC,
noxSoln));
// Create the Group
Teuchos::RCP<NOX::Epetra::Group> grpPtr =
Teuchos::rcp(new NOX::Epetra::Group(printParams,
iReq,
noxSoln,
linSys));
NOX::Epetra::Group& grp = *(grpPtr.get());
// Create the convergence tests
Teuchos::RCP<NOX::StatusTest::NormF> absresid =
Teuchos::rcp(new NOX::StatusTest::NormF(1.0e-5, NOX::StatusTest::NormF::Unscaled));
Teuchos::RCP<NOX::StatusTest::MaxIters> maxiters =
Teuchos::rcp(new NOX::StatusTest::MaxIters(25));
Teuchos::RCP<NOX::StatusTest::FiniteValue> finiteval =
Teuchos::rcp(new NOX::StatusTest::FiniteValue());
Teuchos::RCP<NOX::StatusTest::Combo> combo =
Teuchos::rcp(new NOX::StatusTest::Combo(NOX::StatusTest::Combo::OR));
combo->addStatusTest(absresid);
combo->addStatusTest(maxiters);