本文整理汇总了C++中teuchos::CommandLineProcessor::printHelpMessage方法的典型用法代码示例。如果您正苦于以下问题:C++ CommandLineProcessor::printHelpMessage方法的具体用法?C++ CommandLineProcessor::printHelpMessage怎么用?C++ CommandLineProcessor::printHelpMessage使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类teuchos::CommandLineProcessor
的用法示例。
在下文中一共展示了CommandLineProcessor::printHelpMessage方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: main
int main(int argc,char * argv[])
{
typedef panzer::unit_test::CartesianConnManager<int,panzer::Ordinal64> CCM;
typedef panzer::DOFManager<int,panzer::Ordinal64> DOFManager;
using Teuchos::RCP;
using Teuchos::rcp;
Teuchos::GlobalMPISession mpiSession(&argc, &argv);
Kokkos::initialize(argc,argv);
Teuchos::MpiComm<int> comm(MPI_COMM_WORLD);
int np = comm.getSize(); // number of processors
// timings output
std::string timingsFile = "timings.yaml";
// mesh description
int nx = 10, ny = 7, nz = 4;
int px = np, py = 1, pz = 1;
int bx = 1, by = 2, bz = 1;
// parse command line arguments
Teuchos::CommandLineProcessor clp;
clp.setOption("nx",&nx);
clp.setOption("ny",&ny);
clp.setOption("nz",&nz);
clp.setOption("px",&px);
clp.setOption("py",&py);
clp.setOption("pz",&pz);
clp.setOption("timings-file",&timingsFile);
auto cmdResult = clp.parse(argc,argv);
if(cmdResult!=Teuchos::CommandLineProcessor::PARSE_SUCCESSFUL) {
clp.printHelpMessage(argv[0],std::cout);
return -1;
}
// build velocity, temperature and pressure fields
RCP<const panzer::FieldPattern> pattern_U = buildFieldPattern<Intrepid2::Basis_HGRAD_HEX_C2_FEM<PHX::Device::execution_space,double,double>>();
RCP<const panzer::FieldPattern> pattern_P = buildFieldPattern<Intrepid2::Basis_HGRAD_HEX_C1_FEM<PHX::Device::execution_space,double,double>>();
RCP<const panzer::FieldPattern> pattern_T = buildFieldPattern<Intrepid2::Basis_HGRAD_HEX_C1_FEM<PHX::Device::execution_space,double,double>>();
RCP<const panzer::FieldPattern> pattern_B = buildFieldPattern<Intrepid2::Basis_HDIV_HEX_I1_FEM<PHX::Device::execution_space,double,double>>();
RCP<const panzer::FieldPattern> pattern_E = buildFieldPattern<Intrepid2::Basis_HCURL_HEX_I1_FEM<PHX::Device::execution_space,double,double>>();
// repeatedly construct DOFManager timing the buildGlobalUnknowns
for(int repeats=0;repeats<100;repeats++) {
// build the topology
RCP<CCM> connManager = rcp(new CCM);
connManager->initialize(comm,
Teuchos::as<panzer::Ordinal64>(nx),
Teuchos::as<panzer::Ordinal64>(ny),
Teuchos::as<panzer::Ordinal64>(nz),
px,py,pz,bx,by,bz);
// build the dof manager, and assocaite with the topology
RCP<DOFManager> dofManager = rcp(new DOFManager);
dofManager->setConnManager(connManager,*comm.getRawMpiComm());
// add velocity (U) and PRESSURE fields to the MHD element block
dofManager->addField("eblock-0_0_0","UX",pattern_U);
dofManager->addField("eblock-0_0_0","UY",pattern_U);
dofManager->addField("eblock-0_0_0","UZ",pattern_U);
dofManager->addField("eblock-0_0_0","PRESSURE",pattern_P);
dofManager->addField("eblock-0_0_0","B",pattern_B);
dofManager->addField("eblock-0_0_0","E",pattern_E);
// add velocity (U) fields to the solid element block
dofManager->addField("eblock-0_1_0","UX",pattern_U);
dofManager->addField("eblock-0_1_0","UY",pattern_U);
dofManager->addField("eblock-0_1_0","UZ",pattern_U);
// try to get them all synced up
comm.barrier();
{
PANZER_FUNC_TIME_MONITOR("panzer::ScalingTest::buildGlobalUnknowns");
dofManager->buildGlobalUnknowns();
}
}
Teuchos::TimeMonitor::summarize(std::cout,false,true,false);
if ( timingsFile != "" ){
std::ofstream fout(timingsFile.c_str());
Teuchos::RCP<Teuchos::ParameterList> reportParams = parameterList(* (Teuchos::TimeMonitor::getValidReportParameters()));
reportParams->set("Report format", "YAML");
reportParams->set("YAML style", "spacious");
Teuchos::TimeMonitor::report(fout,reportParams);
}
// this confirms the application passes
std::cout << "Scaling test completed" << std::endl;
return 0;
}