Skip to content

Commit 99e1551

Browse files
committed
Turn OUTPUT_WRT_FREQ error for disc. adj. multizone into a warning.
1 parent bb0f66e commit 99e1551

File tree

3 files changed

+21
-5
lines changed

3 files changed

+21
-5
lines changed

Common/include/CConfig.hpp

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9605,6 +9605,11 @@ class CConfig {
96059605
*/
96069606
unsigned short GetnVolumeOutputFiles() const { return nVolumeOutputFiles; }
96079607

9608+
/*!
9609+
* \brief GetnVolumeOutputFrequencies
9610+
*/
9611+
unsigned short GetnVolumeOutputFrequencies() const { return nVolumeOutputFrequencies; }
9612+
96089613
/*!
96099614
* \brief GetVolumeOutputFrequency
96109615
* \param[in] iFile: index of file number for which the writing frequency needs to be returned.

Common/src/CConfig.cpp

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3418,16 +3418,12 @@ void CConfig::SetPostprocessing(SU2_COMPONENT val_software, unsigned short val_i
34183418
/*--- Using default frequency of 250 for all files when steady, and 1 for unsteady. ---*/
34193419
for (auto iVolumeFreq = 0; iVolumeFreq < nVolumeOutputFrequencies; iVolumeFreq++){
34203420
if (Multizone_Problem && DiscreteAdjoint) {
3421-
VolumeOutputFrequencies[iVolumeFreq] = nOuterIter;
3421+
VolumeOutputFrequencies[iVolumeFreq] = Time_Domain ? 1 : nOuterIter;
34223422
}
34233423
else {
34243424
VolumeOutputFrequencies[iVolumeFreq] = Time_Domain ? 1 : 250;
34253425
}
34263426
}
3427-
} else if (Multizone_Problem && DiscreteAdjoint) {
3428-
SU2_MPI::Error(string("OUTPUT_WRT_FREQ cannot be specified for this solver "
3429-
"(writing of restart and sensitivity files not possible for multizone discrete adjoint during runtime yet).\n"
3430-
"Please remove this option from the config file, output files will be written when solver finalizes.\n"), CURRENT_FUNCTION);
34313427
} else if (nVolumeOutputFrequencies < nVolumeOutputFiles) {
34323428
/*--- If there are fewer frequencies than files, repeat the last frequency.
34333429
* This is useful to define 1 frequency for the restart file and 1 frequency for all the visualization files. ---*/

SU2_CFD/src/drivers/CDiscAdjMultizoneDriver.cpp

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -344,6 +344,21 @@ void CDiscAdjMultizoneDriver::Run() {
344344
const bool time_domain = driver_config->GetTime_Domain();
345345
driver_config->Set_StartTime(SU2_MPI::Wtime());
346346

347+
/*--- Temporary warning because we need to test writing intermediate output to file (requires re-recording). ---*/
348+
for(iZone = 0; iZone < nZone; iZone++) {
349+
for (auto iVolumeFreq = 0; iVolumeFreq < config_container[iZone]->GetnVolumeOutputFrequencies(); iVolumeFreq++){
350+
if (config_container[iZone]->GetVolumeOutputFrequency(iVolumeFreq) < nOuterIter) {
351+
if (rank == MASTER_NODE) {
352+
cout << "\nWARNING (iZone = " << iZone
353+
<< "): "
354+
"Writing out restart files during solver iterations is not tested for the discrete adjoint multizone solver.\n"
355+
"It is recommended to remove OUTPUT_WRT_FREQ from the config file, output files will be written when solver finalizes." << std::endl;
356+
}
357+
break;
358+
}
359+
}
360+
}
361+
347362
/*--- If the gradient of the objective function is 0 so are the adjoint variables.
348363
* Unless in unsteady problems where there are other contributions to the RHS. ---*/
349364

0 commit comments

Comments
 (0)