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


C++ CConfig::GetRestart_FlowFileName方法代码示例

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


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

示例1: main


//.........这里部分代码省略.........
				grid_adaptation->GetAdjSolution(geometry, config);
				grid_adaptation->SetIndicator_Adj(geometry, config, 1);
				break;
			case GRAD_FLOW_ADJ:
				grid_adaptation->GetAdjSolution(geometry, config);
				grid_adaptation->SetIndicator_FlowAdj(geometry, config);
				break;
			case COMPUTABLE:
				grid_adaptation->GetAdjSolution(geometry, config);
				grid_adaptation->GetFlowResidual(geometry, config);
				grid_adaptation->SetIndicator_Computable(geometry, config);
				break;
			case REMAINING:
				cout << "Adaptation method not implemented."<< endl;
				cout << "Press any key to exit..." << endl;
				cin.get();
				exit(1);
				break;
			case ROBUST:
				grid_adaptation->GetFlowResidual(geometry, config);
				grid_adaptation->GetAdjResidual(geometry, config);
				grid_adaptation->SetIndicator_Robust(geometry, config);
				break;
			case COMPUTABLE_ROBUST:
				grid_adaptation->GetAdjSolution(geometry, config);
				grid_adaptation->GetLinResidual(geometry, config);
				grid_adaptation->SetIndicator_Computable_Robust(geometry, config);
				break;
			default :
				cout << "The adaptation is not defined" << endl;
		}
		
		/*--- Perform an homothetic adaptation of the grid ---*/
		CPhysicalGeometry *geo_adapt; geo_adapt = new CPhysicalGeometry;
		
		cout << "Homothetic grid adaptation" << endl;
		if (geometry->GetnDim() == 2) grid_adaptation->SetHomothetic_Adaptation2D(geometry, geo_adapt, config);
		if (geometry->GetnDim() == 3) grid_adaptation->SetHomothetic_Adaptation3D(geometry, geo_adapt, config);
    
		/*--- Smooth the numerical grid coordinates ---*/
		if (config->GetSmoothNumGrid()) {
			cout << "Preprocessing for doing the implicit smoothing." << endl;
			geo_adapt->SetEsuP(); geo_adapt->SetPsuP(); geo_adapt->SetEsuE();
			geo_adapt->SetBoundVolume(); geo_adapt->Check_Orientation(config);
			geo_adapt->SetEdges(); geo_adapt->SetVertex(config);
			cout << "Implicit smoothing of the numerical grid coordinates." << endl;
			geo_adapt->SetCoord_Smoothing(5, 1.5, config);
		}
		
		/*--- Original and adapted grid ---*/
    strcpy (file_name, "original_grid.plt");
    geometry->SetTecPlot(file_name);
    
		/*--- Write the adaptation sensor ---*/
		grid_adaptation->WriteAdaptSensor(geometry, file_name);
		
    strcpy (file_name, "adapted_grid.plt");
    geo_adapt->SetTecPlot(file_name);
    strcpy (file_name, "adapted_surface.plt");
    geo_adapt->SetBoundTecPlot(config,file_name);
		
		/*--- Write the new adapted grid, including the modified boundaries surfaces ---*/
		geo_adapt->SetMeshFile(config, config->GetMesh_Out_FileName());
    
    
		/*--- Write the restart file ---*/
		if ((config->GetKind_Adaptation() != SMOOTHING) && (config->GetKind_Adaptation() != FULL) &&
				(config->GetKind_Adaptation() != WAKE) && (config->GetKind_Adaptation() != TWOPHASE) &&
				(config->GetKind_Adaptation() != SUPERSONIC_SHOCK))
			grid_adaptation->SetRestart_FlowSolution(config, geo_adapt, config->GetRestart_FlowFileName());
		
		if ((config->GetKind_Adaptation() == GRAD_FLOW_ADJ) || (config->GetKind_Adaptation() == GRAD_ADJOINT)
				|| (config->GetKind_Adaptation() == FULL_ADJOINT) || (config->GetKind_Adaptation() == ROBUST)
				|| (config->GetKind_Adaptation() == COMPUTABLE) || (config->GetKind_Adaptation() == COMPUTABLE_ROBUST) ||
				(config->GetKind_Adaptation() == REMAINING))
			grid_adaptation->SetRestart_AdjSolution(config, geo_adapt, config->GetRestart_AdjFileName());
		
		if ((config->GetKind_Adaptation() == FULL_LINEAR) || (config->GetKind_Adaptation() == COMPUTABLE_ROBUST)) {
			grid_adaptation->SetRestart_LinSolution(config, geo_adapt, config->GetRestart_LinFileName());
		}
	}
	else {
    strcpy (file_name, "original_grid.plt");
    geometry->SetTecPlot(file_name);
		geometry->SetMeshFile (config, config->GetMesh_Out_FileName());
	}
  
#ifndef NO_MPI
#ifdef WINDOWS
	MPI_Finalize();
#else
	MPI::Finalize();
#endif
#endif
	
	/*--- End solver ---*/
	cout << endl <<"------------------------- Exit Success (SU2_MAC) ------------------------" << endl << endl;
  
	return EXIT_SUCCESS;
}
开发者ID:shyang5,项目名称:SU2,代码行数:101,代码来源:SU2_MAC.cpp


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