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


C++ Param::PrintAllParams方法代码示例

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


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

示例1: main

int main(int argc, char* argv[]){

#ifdef _DEBUG
  //enable exceptions so we can trap NaNs, etc.
  feenableexcept(FE_INVALID | FE_OVERFLOW);
#endif

  Int rank, np;
  Int mode = 0;
  Int ndv = 0;
  Real* dObjdBeta = NULL;
  
  std::vector<Param<Real>* > paramList; 
  SolutionOrdering<Real> operations;
  TemporalControl<Real> temporalControl;

  string tempname;
  stringstream temposs;

  TimerList timers(5);
  timers.CreateTimer("MPI_InitTimer");
  timers.CreateTimer("SolveTimer");
  timers.CreateTimer("DesignTimer");
  timers.CreateTimer("MovementTimer");

  //create parallel object for comms
  timers.StartTimer("MPI_InitTimer");
  MPI_Init(&argc, &argv);
  MPI_Comm_rank(MPI_COMM_WORLD, &rank);
  MPI_Comm_size(MPI_COMM_WORLD, &np);
  timers.StopTimer("MPI_InitTimer");

  PObj<Real> pobj;
  rank = pobj.GetRank();
  //remove Abort.Log if its present
  if(rank == 0){
    remove("Abort.Log");
  }
  
  if(!((argc == 2) || (argc == 3))){
    cerr << "Invalid arguments!!!" << endl;
    cerr << "USE: " << argv[0] << " <casename>" << endl;
    cerr << "OR" << endl;
    cerr << "USE: " << argv[0] << " <casename> <design type>" << endl;
    cerr << "<design type> - none = 0" << endl;
    cerr << "<design type> - objective f-n evaluation = 1" << endl;
    cerr << "<design type> - direct = 2" << endl;
    cerr << "<design type> - adjoint = 3" << endl;
    cerr << "<design type> - CTSE = 4" << endl;
    cerr << "<design type> - GRID SMOOTHING = 5" << endl;
    cerr << "<design type> - Compute Mesh Sensitivity = 6" << endl;
    cerr << "<design type> - Finite Difference = 7" << endl;

    //dumps all options in param file to output
    Param<Real> tmp;
    tmp.PrintAllParams();

    MPI_Finalize();
    return (1);
  }

  std::string casestring = argv[1];
  size_t pos = casestring.rfind('/');
  std::string pathname;
  if(pos != std::string::npos){
    pathname = casestring.substr(0, pos+1);
    casestring = casestring.substr(pos);
  }
  else{
    pathname = "./";
  }

  //set pathname in abort class
  Abort.rootDirectory = pathname;

  if(argc == 3){
    temposs.clear();
    temposs.str("");
    temposs << argv[2];
    temposs >> mode;
  }
开发者ID:,项目名称:,代码行数:81,代码来源:


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