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


C++ COutput::SetCp_InverseDesign方法代码示例

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


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

示例1: main


//.........这里部分代码省略.........
  if (rank == MASTER_NODE)
    cout << endl <<"------------------------------ Begin Solver -----------------------------" << endl;
  
  /*--- Set up a timer for performance benchmarking (preprocessing time is not included) ---*/
  
#ifndef HAVE_MPI
  StartTime = su2double(clock())/su2double(CLOCKS_PER_SEC);
#else
  StartTime = MPI_Wtime();
#endif

  /*--- This is temporal and just to check. It will have to be added to the regular history file ---*/
  
  ofstream historyFile_FSI;
  bool writeHistFSI = config_container[ZONE_0]->GetWrite_Conv_FSI();
  if (writeHistFSI && (rank == MASTER_NODE)){
    char cstrFSI[200];
    string filenameHistFSI = config_container[ZONE_0]->GetConv_FileName_FSI();
    strcpy (cstrFSI, filenameHistFSI.data());
    historyFile_FSI.open (cstrFSI);
    historyFile_FSI << "Time,Iteration,Aitken,URes,logResidual,orderMagnResidual" << endl;
    historyFile_FSI.close();
  }

  while (ExtIter < config_container[ZONE_0]->GetnExtIter()) {
    
    /*--- Set the value of the external iteration. ---*/
	for (iZone = 0; iZone < nZone; iZone++) config_container[iZone]->SetExtIter(ExtIter);

    
    /*--- Read the target pressure ---*/
    
    if (config_container[ZONE_0]->GetInvDesign_Cp() == YES)
      output->SetCp_InverseDesign(solver_container[ZONE_0][MESH_0][FLOW_SOL],
                                  geometry_container[ZONE_0][MESH_0], config_container[ZONE_0], ExtIter);
    
    /*--- Read the target heat flux ---*/
    
    if (config_container[ZONE_0]->GetInvDesign_HeatFlux() == YES)
      output->SetHeat_InverseDesign(solver_container[ZONE_0][MESH_0][FLOW_SOL],
                                    geometry_container[ZONE_0][MESH_0], config_container[ZONE_0], ExtIter);
    
    /*--- Perform a single iteration of the chosen PDE solver. ---*/

      /*--- Run a single iteration of the problem using the driver class. ---*/

      driver->Run(iteration_container, output, integration_container,
                  geometry_container, solver_container, numerics_container,
                  config_container, surface_movement, grid_movement, FFDBox,
                  interpolator_container, transfer_container);
      
    
    /*--- Synchronization point after a single solver iteration. Compute the
     wall clock time required. ---*/
    
#ifndef HAVE_MPI
    StopTime = su2double(clock())/su2double(CLOCKS_PER_SEC);
#else
    StopTime = MPI_Wtime();
#endif
    
    UsedTime = (StopTime - StartTime);
    
    /*--- For specific applications, evaluate and plot the equivalent area. ---*/
    
    if (config_container[ZONE_0]->GetEquivArea() == YES) {
开发者ID:sravya91,项目名称:SU2_HBDiscAdj,代码行数:67,代码来源:SU2_CFD.cpp

示例2: main


//.........这里部分代码省略.........
  
  /*--- Check for an unsteady restart. Update ExtIter if necessary. ---*/
  if (config_container[ZONE_0]->GetWrt_Unsteady() && config_container[ZONE_0]->GetRestart())
    ExtIter = config_container[ZONE_0]->GetUnst_RestartIter();
  
  /*--- Main external loop of the solver. Within this loop, each iteration ---*/
  
  if (rank == MASTER_NODE)
    cout << endl <<"------------------------------ Begin Solver -----------------------------" << endl;
  
  /*--- Set up a timer for performance benchmarking (preprocessing time is not included) ---*/
  
#ifndef HAVE_MPI
  StartTime = double(clock())/double(CLOCKS_PER_SEC);
#else
  MPI_Barrier(MPI_COMM_WORLD);
  StartTime = MPI_Wtime();
#endif
  
  while (ExtIter < config_container[ZONE_0]->GetnExtIter()) {
    
    /*--- Set a timer for each iteration. Store the current iteration and
     update  the value of the CFL number (if there is CFL ramping specified)
     in the config class. ---*/
    
    for (iZone = 0; iZone < nZone; iZone++) {
      config_container[iZone]->SetExtIter(ExtIter);
      config_container[iZone]->UpdateCFL(ExtIter);
    }
    
    /*--- Read the target pressure ---*/
    
    if (config_container[ZONE_0]->GetInvDesign_Cp() == YES)
      output->SetCp_InverseDesign(solver_container[ZONE_0][MESH_0][FLOW_SOL],
                                  geometry_container[ZONE_0][MESH_0], config_container[ZONE_0], ExtIter);
    
    /*--- Read the target heat flux ---*/

    if (config_container[ZONE_0]->GetInvDesign_HeatFlux() == YES)
      output->SetHeat_InverseDesign(solver_container[ZONE_0][MESH_0][FLOW_SOL],
                                    geometry_container[ZONE_0][MESH_0], config_container[ZONE_0], ExtIter);
    
    /*--- Perform a single iteration of the chosen PDE solver. ---*/
    switch (config_container[ZONE_0]->GetKind_Solver()) {
        
      case EULER: case NAVIER_STOKES: case RANS:
        MeanFlowIteration(output, integration_container, geometry_container,
                          solver_container, numerics_container, config_container,
                          surface_movement, grid_movement, FFDBox);
        break;
        
      case TNE2_EULER: case TNE2_NAVIER_STOKES:
        TNE2Iteration(output, integration_container,
                      geometry_container, solver_container,
                      numerics_container, config_container,
                      surface_movement, grid_movement, FFDBox);
        break;
        
      case FLUID_STRUCTURE_EULER: case FLUID_STRUCTURE_NAVIER_STOKES:
        FluidStructureIteration(output, integration_container, geometry_container,
                                solver_container, numerics_container, config_container,
                                surface_movement, grid_movement, FFDBox);
        break;
        
      case WAVE_EQUATION:
        WaveIteration(output, integration_container, geometry_container,
开发者ID:Pagliof,项目名称:SU2,代码行数:67,代码来源:SU2_CFD.cpp


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