@@ -400,6 +400,13 @@ void CConfig::addUShortListOption(const string name, unsigned short & size, unsi
400400 option_map.insert (pair<string, COptionBase *>(name, val));
401401}
402402
403+ void CConfig::addULongListOption (const string name, unsigned short & size, unsigned long * & option_field) {
404+ assert (option_map.find (name) == option_map.end ());
405+ all_options.insert (pair<string, bool >(name, true ));
406+ COptionBase* val = new COptionULongList (name, size, option_field);
407+ option_map.insert (pair<string, COptionBase *>(name, val));
408+ }
409+
403410void CConfig::addStringListOption (const string name, unsigned short & num_marker, string* & option_field) {
404411 assert (option_map.find (name) == option_map.end ());
405412 all_options.insert (pair<string, bool >(name, true ));
@@ -1018,6 +1025,7 @@ void CConfig::SetPointersNull(void) {
10181025 HistoryOutput = nullptr ;
10191026 VolumeOutput = nullptr ;
10201027 VolumeOutputFiles = nullptr ;
1028+ VolumeOutputFrequencies = nullptr ;
10211029 ConvField = nullptr ;
10221030
10231031 /* --- Variable initialization ---*/
@@ -1173,7 +1181,6 @@ void CConfig::SetConfig_Options() {
11731181 addBoolOption (" VT_RESIDUAL_LIMITING" , vt_transfer_res_limit, false );
11741182 /* DESCRIPTION: List of catalytic walls */
11751183 addStringListOption (" CATALYTIC_WALL" , nWall_Catalytic, Wall_Catalytic);
1176- /* !\brief MARKER_MONITORING\n DESCRIPTION: Marker(s) of the surface where evaluate the non-dimensional coefficients \ingroup Config*/
11771184
11781185
11791186 /* --- Options related to VAN der WAALS MODEL and PENG ROBINSON ---*/
@@ -1405,6 +1412,7 @@ void CConfig::SetConfig_Options() {
14051412 addStringListOption (" MARKER_PLOTTING" , nMarker_Plotting, Marker_Plotting);
14061413 /* !\brief MARKER_MONITORING\n DESCRIPTION: Marker(s) of the surface where evaluate the non-dimensional coefficients \ingroup Config*/
14071414 addStringListOption (" MARKER_MONITORING" , nMarker_Monitoring, Marker_Monitoring);
1415+
14081416 /* !\brief MARKER_CONTROL_VOLUME\n DESCRIPTION: Marker(s) of the surface in the surface flow solution file \ingroup Config*/
14091417 addStringListOption (" MARKER_ANALYZE" , nMarker_Analyze, Marker_Analyze);
14101418 /* !\brief MARKER_DESIGNING\n DESCRIPTION: Marker(s) of the surface where objective function (design problem) will be evaluated \ingroup Config*/
@@ -2444,7 +2452,8 @@ void CConfig::SetConfig_Options() {
24442452 /* !\par CONFIG_CATEGORY: Multizone definition \ingroup Config*/
24452453 /* --- Options related to multizone problems ---*/
24462454
2447- /* !\brief MARKER_PLOTTING\n DESCRIPTION: Marker(s) of the surface in the surface flow solution file \ingroup Config*/
2455+ /* DESCRIPTION List of config files for each zone in a multizone setup with SOLVER=MULTIPHYSICS
2456+ * Order here has to match the order in the meshfile if just one is used. */
24482457 addStringListOption (" CONFIG_LIST" , nConfig_Files, Config_Filenames);
24492458
24502459 /* DESCRIPTION: Determines if the multizone problem is solved for time-domain. */
@@ -2814,8 +2823,9 @@ void CConfig::SetConfig_Options() {
28142823 addUnsignedLongOption (" SCREEN_WRT_FREQ_OUTER" , ScreenWrtFreq[1 ], 1 );
28152824 /* DESCRIPTION: Screen writing frequency (TIME_ITER) */
28162825 addUnsignedLongOption (" SCREEN_WRT_FREQ_TIME" , ScreenWrtFreq[0 ], 1 );
2817- /* DESCRIPTION: Volume solution writing frequency */
2818- addUnsignedLongOption (" OUTPUT_WRT_FREQ" , VolumeWrtFreq, 250 );
2826+ /* DESCRIPTION: list of writing frequencies for each file type (length same as nVolumeOutputFiles) */
2827+ addULongListOption (" OUTPUT_WRT_FREQ" , nVolumeOutputFrequencies, VolumeOutputFrequencies);
2828+
28192829 /* DESCRIPTION: Volume solution files */
28202830 addEnumListOption (" OUTPUT_FILES" , nVolumeOutputFiles, VolumeOutputFiles, Output_Map);
28212831
@@ -3302,6 +3312,30 @@ void CConfig::SetPostprocessing(SU2_COMPONENT val_software, unsigned short val_i
33023312 VolumeOutputFiles[2 ] = OUTPUT_TYPE::SURFACE_PARAVIEW_XML;
33033313 }
33043314
3315+ /* --- Set the default output frequencies ---*/
3316+ if (!OptionIsSet (" OUTPUT_WRT_FREQ" )){
3317+ nVolumeOutputFrequencies = nVolumeOutputFiles;
3318+ VolumeOutputFrequencies = new unsigned long [nVolumeOutputFrequencies];
3319+
3320+ /* --- Using default frequency of 250 for all files when steady, and 1 for unsteady. ---*/
3321+ for (auto iVolumeFreq = 0 ; iVolumeFreq < nVolumeOutputFrequencies; iVolumeFreq++){
3322+ VolumeOutputFrequencies[iVolumeFreq] = Time_Domain ? 1 : 250 ;
3323+ }
3324+ } else if (nVolumeOutputFrequencies < nVolumeOutputFiles) {
3325+ /* --- If there are fewer frequencies than files, repeat the last frequency.
3326+ * This is useful to define 1 frequency for the restart file and 1 frequency for all the visualization files. ---*/
3327+ auto * newFrequencies = new unsigned long [nVolumeOutputFiles];
3328+ for (unsigned short i = 0 ; i < nVolumeOutputFrequencies; ++i) {
3329+ newFrequencies[i] = VolumeOutputFrequencies[i];
3330+ }
3331+ for (auto i = nVolumeOutputFrequencies; i < nVolumeOutputFiles; ++i) {
3332+ newFrequencies[i] = newFrequencies[i-1 ];
3333+ }
3334+ delete [] VolumeOutputFrequencies;
3335+ VolumeOutputFrequencies = newFrequencies;
3336+ nVolumeOutputFrequencies = nVolumeOutputFiles;
3337+ }
3338+
33053339 /* --- Check if SU2 was build with TecIO support, as that is required for Tecplot Binary output. ---*/
33063340#ifndef HAVE_TECIO
33073341 for (unsigned short iVolumeFile = 0 ; iVolumeFile < nVolumeOutputFiles; iVolumeFile++){
@@ -3577,9 +3611,6 @@ void CConfig::SetPostprocessing(SU2_COMPONENT val_software, unsigned short val_i
35773611
35783612 if (TimeMarching == TIME_MARCHING::TIME_STEPPING){ InnerIter = 1 ; }
35793613
3580- /* --- Set the default write frequency to 1 if unsteady instead of 250 ---*/
3581- if (!OptionIsSet (" OUTPUT_WRT_FREQ" )) { VolumeWrtFreq = 1 ; }
3582-
35833614 /* --- Set History write freq for inner and outer iteration to zero by default, so only time iterations write. ---*/
35843615 if (!OptionIsSet (" HISTORY_WRT_FREQ_INNER" )) { HistoryWrtFreq[2 ] = 0 ; }
35853616 if (!OptionIsSet (" HISTORY_WRT_FREQ_OUTER" )) { HistoryWrtFreq[1 ] = 0 ; }
@@ -6824,7 +6855,27 @@ void CConfig::SetOutput(SU2_COMPONENT val_software, unsigned short val_izone) {
68246855
68256856 if (val_software == SU2_COMPONENT::SU2_CFD) {
68266857
6827- cout << " Writing solution files every " << VolumeWrtFreq <<" iterations." << endl;
6858+ if (nVolumeOutputFiles != 0 ) {
6859+ cout << " File writing frequency: " << endl;
6860+ PrintingToolbox::CTablePrinter FileFreqTable (&std::cout);
6861+ FileFreqTable.AddColumn (" File" , 25 );
6862+ FileFreqTable.AddColumn (" Frequency" , 10 );
6863+ FileFreqTable.SetAlign (PrintingToolbox::CTablePrinter::RIGHT);
6864+ FileFreqTable.PrintHeader ();
6865+
6866+ for (auto iFreq = 0 ; iFreq < nVolumeOutputFiles; iFreq++){
6867+ /* --- find the key belonging to the value in the map---*/
6868+ for (auto & it : Output_Map) {
6869+ if (it.second == VolumeOutputFiles[iFreq]) {
6870+ FileFreqTable << it.first << VolumeOutputFrequencies[iFreq];
6871+ break ;
6872+ }
6873+ }
6874+ }
6875+
6876+ FileFreqTable.PrintFooter ();
6877+ }
6878+
68286879 cout << " Writing the convergence history file every " << HistoryWrtFreq[2 ] <<" inner iterations." << endl;
68296880 if (Multizone_Problem){
68306881 cout << " Writing the convergence history file every " << HistoryWrtFreq[1 ] <<" outer iterations." << endl;
@@ -7419,10 +7470,10 @@ unsigned short CConfig::GetMarker_CfgFile_TagBound(string val_marker) const {
74197470
74207471 unsigned short iMarker_CfgFile;
74217472
7422- for (iMarker_CfgFile = 0 ; iMarker_CfgFile < nMarker_CfgFile; iMarker_CfgFile++)
7473+ for (iMarker_CfgFile = 0 ; iMarker_CfgFile < nMarker_CfgFile; iMarker_CfgFile++) {
74237474 if (Marker_CfgFile_TagBound[iMarker_CfgFile] == val_marker)
74247475 return iMarker_CfgFile;
7425-
7476+ }
74267477 SU2_MPI::Error (string (" The configuration file doesn't have any definition for marker " ) + val_marker, CURRENT_FUNCTION);
74277478 return 0 ;
74287479}
@@ -7821,7 +7872,6 @@ CConfig::~CConfig() {
78217872
78227873 delete [] nBlades;
78237874 delete [] FreeStreamTurboNormal;
7824-
78257875}
78267876
78277877string CConfig::GetFilename (string filename, string ext, int timeIter) const {
0 commit comments