本文整理汇总了C++中COutput::SetBaselineResult_Files方法的典型用法代码示例。如果您正苦于以下问题:C++ COutput::SetBaselineResult_Files方法的具体用法?C++ COutput::SetBaselineResult_Files怎么用?C++ COutput::SetBaselineResult_Files使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类COutput
的用法示例。
在下文中一共展示了COutput::SetBaselineResult_Files方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: main
//.........这里部分代码省略.........
/*--- Check several conditions in order to merge the correct time step files. ---*/
Physical_dt = config[ZONE_0]->GetDelta_UnstTime();
Physical_t = (iExtIter+1)*Physical_dt;
if (Physical_t >= config[ZONE_0]->GetTotal_UnstTime())
StopCalc = true;
if ((iExtIter+1 == config[ZONE_0]->GetnExtIter()) ||
((iExtIter % config[ZONE_0]->GetWrt_Sol_Freq() == 0) && (iExtIter != 0) &&
!((config[ZONE_0]->GetUnsteady_Simulation() == DT_STEPPING_1ST) ||
(config[ZONE_0]->GetUnsteady_Simulation() == DT_STEPPING_2ND))) ||
(StopCalc) ||
(((config[ZONE_0]->GetUnsteady_Simulation() == DT_STEPPING_1ST) ||
(config[ZONE_0]->GetUnsteady_Simulation() == DT_STEPPING_2ND)) &&
((iExtIter == 0) || (iExtIter % config[ZONE_0]->GetWrt_Sol_Freq_DualTime() == 0)))) {
/*--- Set the current iteration number in the config class. ---*/
config[ZONE_0]->SetExtIter(iExtIter);
/*--- Read in the restart file for this time step ---*/
for (iZone = 0; iZone < nZone; iZone++) {
/*--- Either instantiate the solution class or load a restart file. ---*/
if (SolutionInstantiated == false && (iExtIter == 0 ||
(config[ZONE_0]->GetRestart() && (iExtIter == config[ZONE_0]->GetUnst_RestartIter() ||
iExtIter % config[ZONE_0]->GetWrt_Sol_Freq_DualTime() == 0 ||
iExtIter+1 == config[ZONE_0]->GetnExtIter())))) {
solver[iZone] = new CBaselineSolver(geometry[iZone], config[iZone], MESH_0);
SolutionInstantiated = true;
}
else
solver[iZone]->LoadRestart(geometry, &solver, config[iZone], int(MESH_0));
}
if (rank == MASTER_NODE)
cout << "Writing the volume solution for time step " << iExtIter << "." << endl;
output->SetBaselineResult_Files(solver, geometry, config, iExtIter, nZone);
}
iExtIter++;
if (StopCalc) break;
}
} else if (config[ZONE_0]->GetUnsteady_Simulation() == TIME_SPECTRAL) {
/*--- Time-spectral simulation: merge files for each time instance (each zone). ---*/
unsigned short nTimeSpectral = config[ZONE_0]->GetnTimeInstances();
unsigned short iTimeSpectral;
for (iTimeSpectral = 0; iTimeSpectral < nTimeSpectral; iTimeSpectral++) {
/*--- Set the current instance number in the config class to "ExtIter." ---*/
config[ZONE_0]->SetExtIter(iTimeSpectral);
/*--- Read in the restart file for this time step ---*/
/*--- N.B. In SU2_SOL, nZone != nTimeInstances ---*/
for (iZone = 0; iZone < nZone; iZone++) {
/*--- Either instantiate the solution class or load a restart file. ---*/
if (iTimeSpectral == 0)
solver[iZone] = new CBaselineSolver(geometry[iZone], config[iZone], MESH_0);
else
solver[iZone]->LoadRestart(geometry, &solver, config[iZone], int(MESH_0));
}
/*--- Print progress in solution writing to the screen. ---*/
if (rank == MASTER_NODE) {
cout << "Writing the volume solution for time instance " << iTimeSpectral << "." << endl;
}
output->SetBaselineResult_Files(solver, geometry, config, iTimeSpectral, nZone);
}
} else {
/*--- Steady simulation: merge the single solution file. ---*/
for (iZone = 0; iZone < nZone; iZone++) {
/*--- Definition of the solution class ---*/
solver[iZone] = new CBaselineSolver(geometry[iZone], config[iZone], MESH_0);
}
output->SetBaselineResult_Files(solver, geometry, config, 0, nZone);
}
#ifndef NO_MPI
/*--- Finalize MPI parallelization ---*/
#ifdef WINDOWS
MPI_Finalize();
#else
MPI::Finalize();
#endif
#endif
/*--- End solver ---*/
if (rank == MASTER_NODE)
cout << endl <<"------------------------- Exit Success (SU2_SOL) ------------------------" << endl << endl;
return EXIT_SUCCESS;
}
示例2: main
//.........这里部分代码省略.........
}
/*--- Instantiate the solvers for each zone. ---*/
for (iZone = 0; iZone < nZone; iZone++){
config_container[iZone]->SetiInst(INST_0);
config_container[iZone]->SetExtIter(TimeIter);
solver_container[iZone][INST_0] = new CBaselineSolver(geometry_container[iZone][INST_0], config_container[iZone]);
}
/*--- Loop over the whole time domain ---*/
while (TimeIter < driver_config->GetnTime_Iter()) {
/*--- Check if the maximum time has been surpassed. ---*/
Physical_t = (TimeIter+1)*Physical_dt;
if (Physical_t >= driver_config->GetMax_Time())
StopCalc = true;
if ((TimeIter+1 == driver_config->GetnTime_Iter()) || // The last time iteration
(StopCalc) || // We have surpassed the requested time
((TimeIter == 0) || (TimeIter % config_container[ZONE_0]->GetWrt_Sol_Freq_DualTime() == 0)) // The iteration has been requested
){
/*--- Load the restart for all the zones. ---*/
for (iZone = 0; iZone < nZone; iZone++){
/*--- Set the current iteration number in the config class. ---*/
config_container[iZone]->SetExtIter(TimeIter);
/*--- So far, only enabled for single-instance problems ---*/
config_container[iZone]->SetiInst(INST_0);
solver_container[iZone][INST_0]->LoadRestart(geometry_container[iZone], &solver_container[iZone], config_container[iZone], SU2_TYPE::Int(MESH_0), true);
}
if (rank == MASTER_NODE) cout << "Writing the volume solution for time step " << TimeIter << ", t = " << Physical_t << " s ." << endl;
output->SetBaselineResult_Files(solver_container, geometry_container, config_container, TimeIter, nZone);
}
TimeIter++;
if (StopCalc) break;
}
}
else {
/*--- Steady simulation: merge the solution files for each zone. ---*/
for (iZone = 0; iZone < nZone; iZone++) {
config_container[iZone]->SetiInst(INST_0);
/*--- Definition of the solution class ---*/
solver_container[iZone][INST_0] = new CBaselineSolver(geometry_container[iZone][INST_0], config_container[iZone]);
solver_container[iZone][INST_0]->LoadRestart(geometry_container[iZone], &solver_container[iZone], config_container[iZone], SU2_TYPE::Int(MESH_0), true);
}
output->SetBaselineResult_Files(solver_container, geometry_container, config_container, 0, nZone);
}
}
else if (fsi){
if (nZone < 2){
SU2_MPI::Error("For multizone computations, please add the number of zones as a second argument for SU2_SOL.", CURRENT_FUNCTION);
}
su2double Physical_dt, Physical_t;
unsigned long iExtIter = 0, iExtIterFlow = 0, iExtIterFEM = 0;
bool StopCalc = false;
bool SolutionInstantiatedFlow = false, SolutionInstantiatedFEM = false;
/*--- Check for an unsteady restart. Update ExtIter if necessary. ---*/
if (config_container[ZONE_0]->GetRestart()){
示例3: main
//.........这里部分代码省略.........
Physical_t = (iExtIter+1)*Physical_dt;
if (Physical_t >= config_container[ZONE_0]->GetTotal_UnstTime())
StopCalc = true;
if ((iExtIter+1 == config_container[ZONE_0]->GetnExtIter()) ||
((iExtIter % config_container[ZONE_0]->GetWrt_Sol_Freq() == 0) && (iExtIter != 0) &&
!((config_container[ZONE_0]->GetUnsteady_Simulation() == DT_STEPPING_1ST) ||
(config_container[ZONE_0]->GetUnsteady_Simulation() == DT_STEPPING_2ND))) ||
(StopCalc) ||
(((config_container[ZONE_0]->GetUnsteady_Simulation() == DT_STEPPING_1ST) ||
(config_container[ZONE_0]->GetUnsteady_Simulation() == DT_STEPPING_2ND)) &&
((iExtIter == 0) || (iExtIter % config_container[ZONE_0]->GetWrt_Sol_Freq_DualTime() == 0)))) {
/*--- Set the current iteration number in the config class. ---*/
config_container[ZONE_0]->SetExtIter(iExtIter);
/*--- Read in the restart file for this time step ---*/
for (iZone = 0; iZone < nZone; iZone++) {
/*--- Either instantiate the solution class or load a restart file. ---*/
if (SolutionInstantiated == false && (iExtIter == 0 ||
(config_container[ZONE_0]->GetRestart() && (iExtIter == config_container[ZONE_0]->GetUnst_RestartIter() ||
iExtIter % config_container[ZONE_0]->GetWrt_Sol_Freq_DualTime() == 0 ||
iExtIter+1 == config_container[ZONE_0]->GetnExtIter())))) {
solver_container[iZone] = new CBaselineSolver(geometry_container[iZone], config_container[iZone], MESH_0);
SolutionInstantiated = true;
}
else
solver_container[iZone]->LoadRestart(geometry_container, &solver_container, config_container[iZone], int(MESH_0));
}
if (rank == MASTER_NODE)
cout << "Writing the volume solution for time step " << iExtIter << "." << endl;
output->SetBaselineResult_Files(solver_container, geometry_container, config_container, iExtIter, nZone);
}
iExtIter++;
if (StopCalc) break;
}
} else if (config_container[ZONE_0]->GetUnsteady_Simulation() == TIME_SPECTRAL) {
/*--- Time-spectral simulation: merge files for each time instance (each zone). ---*/
unsigned short nTimeSpectral = config_container[ZONE_0]->GetnTimeInstances();
unsigned short iTimeSpectral;
for (iTimeSpectral = 0; iTimeSpectral < nTimeSpectral; iTimeSpectral++) {
/*--- Set the current instance number in the config class to "ExtIter." ---*/
config_container[ZONE_0]->SetExtIter(iTimeSpectral);
/*--- Read in the restart file for this time step ---*/
/*--- N.B. In SU2_SOL, nZone != nTimeInstances ---*/
for (iZone = 0; iZone < nZone; iZone++) {
/*--- Either instantiate the solution class or load a restart file. ---*/
if (iTimeSpectral == 0)
solver_container[iZone] = new CBaselineSolver(geometry_container[iZone], config_container[iZone], MESH_0);
else
solver_container[iZone]->LoadRestart(geometry_container, &solver_container, config_container[iZone], int(MESH_0));
}
/*--- Print progress in solution writing to the screen. ---*/
if (rank == MASTER_NODE) {
cout << "Writing the volume solution for time instance " << iTimeSpectral << "." << endl;
}
示例4: main
//.........这里部分代码省略.........
){
/*--- Set the current iteration number in the config class. ---*/
config_container[ZONE_0]->SetExtIter(iExtIter);
config_container[ZONE_1]->SetExtIter(iExtIter);
/*--- Read in the restart file for this time step ---*/
/*--- For the fluid zone (ZONE_0) ---*/
/*--- Either instantiate the solution class or load a restart file. ---*/
if (SolutionInstantiatedFlow == false &&
(iExtIter == 0 || ((config_container[ZONE_0]->GetRestart() && (SU2_TYPE::Int(iExtIter) == config_container[ZONE_0]->GetUnst_RestartIter())) ||
iExtIter % config_container[ZONE_0]->GetWrt_Sol_Freq_DualTime() == 0 ||
iExtIter+1 == config_container[ZONE_0]->GetnExtIter()))) {
solver_container[ZONE_0] = new CBaselineSolver(geometry_container[ZONE_0], config_container[ZONE_0]);
SolutionInstantiatedFlow = true;
}
solver_container[ZONE_0]->LoadRestart_FSI(geometry_container[ZONE_0], &solver_container, config_container[ZONE_0], SU2_TYPE::Int(MESH_0));
/*--- For the structural zone (ZONE_1) ---*/
/*--- Either instantiate the solution class or load a restart file. ---*/
/*--- Either instantiate the solution class or load a restart file. ---*/
if (SolutionInstantiatedFEM == false &&
(iExtIter == 0 || ((config_container[ZONE_1]->GetRestart() && (SU2_TYPE::Int(iExtIter) == config_container[ZONE_1]->GetDyn_RestartIter())) ||
iExtIter % config_container[ZONE_1]->GetWrt_Sol_Freq_DualTime() == 0 ||
iExtIter+1 == config_container[ZONE_1]->GetnExtIter()))) {
solver_container[ZONE_1] = new CBaselineSolver(geometry_container[ZONE_1], config_container[ZONE_1]);
SolutionInstantiatedFEM = true;
}
solver_container[ZONE_1]->LoadRestart_FSI(geometry_container[ZONE_1], &solver_container, config_container[ZONE_1], SU2_TYPE::Int(MESH_0));
if (rank == MASTER_NODE) cout << "Writing the volume solution for time step " << iExtIter << "." << endl;
output->SetBaselineResult_Files(solver_container, geometry_container, config_container, iExtIter, nZone);
}
iExtIter++;
if (StopCalc) break;
}
}
else {
if (config_container[ZONE_0]->GetWrt_Unsteady()) {
/*--- Unsteady simulation: merge all unsteady time steps. First,
find the frequency and total number of files to write. ---*/
su2double Physical_dt, Physical_t;
unsigned long iExtIter = 0;
bool StopCalc = false;
bool *SolutionInstantiated = new bool[nZone];
for (iZone = 0; iZone < nZone; iZone++)
SolutionInstantiated[iZone] = false;
/*--- Check for an unsteady restart. Update ExtIter if necessary. ---*/
if (config_container[ZONE_0]->GetWrt_Unsteady() && config_container[ZONE_0]->GetRestart())
iExtIter = config_container[ZONE_0]->GetUnst_RestartIter();
while (iExtIter < config_container[ZONE_0]->GetnExtIter()) {
/*--- Check several conditions in order to merge the correct time step files. ---*/
Physical_dt = config_container[ZONE_0]->GetDelta_UnstTime();
Physical_t = (iExtIter+1)*Physical_dt;
if (Physical_t >= config_container[ZONE_0]->GetTotal_UnstTime())