Skip to content

Commit 5f0af78

Browse files
author
nbe0dev
committed
fixed initialization of volumeoutputfrequencies
1 parent 5a80ab7 commit 5f0af78

3 files changed

Lines changed: 15 additions & 3 deletions

File tree

Common/include/CConfig.hpp

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9468,7 +9468,13 @@ class CConfig {
94689468
/*!
94699469
* \brief GetVolumeOutputFrequencies
94709470
*/
9471-
unsigned short *GetVolumeOutputFrequencies() const { return VolumeOutputFrequencies; }
9471+
unsigned short* GetVolumeOutputFrequencies() const { return VolumeOutputFrequencies; }
9472+
9473+
/*!
9474+
* \brief GetVolumeOutputFrequency
9475+
* \param[in] iFile: index of file number for which the writing frequency needs to be returned.
9476+
*/
9477+
unsigned short GetVolumeOutputFrequency(unsigned short iFile) const { return VolumeOutputFrequencies[iFile]; }
94729478

94739479
/*!
94749480
* \brief GetnVolumeOutputFrequencies

Common/src/CConfig.cpp

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3334,8 +3334,14 @@ void CConfig::SetPostprocessing(SU2_COMPONENT val_software, unsigned short val_i
33343334
} else {
33353335
/*--- check how many frequencies. If 1 then use it for all output ---*/
33363336
if (nVolumeOutputFrequencies == 1) {
3337+
unsigned short outputWriteFreq = VolumeOutputFrequencies[0];
3338+
/*--- we recreate the OutputFrequencies ---*/
3339+
nVolumeOutputFrequencies = nVolumeOutputFiles;
3340+
delete [] VolumeOutputFrequencies;
3341+
VolumeOutputFrequencies = new unsigned short [nVolumeOutputFrequencies];
3342+
33373343
for (auto iVolumeFreq = 0; iVolumeFreq < nVolumeOutputFrequencies; iVolumeFreq++){
3338-
VolumeOutputFrequencies[iVolumeFreq] = VolumeOutputFrequencies[0];
3344+
VolumeOutputFrequencies[iVolumeFreq] = outputWriteFreq;
33393345
}
33403346
} else if (nVolumeOutputFrequencies != nVolumeOutputFiles) {
33413347
SU2_MPI::Error(string("Number of entries in OUTPUT_WRT_FREQ is not equal to number of entries in OUTPUT_FILES.\n"), CURRENT_FUNCTION);

SU2_CFD/src/output/CFlowOutput.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3280,7 +3280,7 @@ void CFlowOutput::WriteForcesBreakdown(const CConfig* config, const CSolver* flo
32803280
bool CFlowOutput::WriteVolume_Output(CConfig *config, unsigned long Iter, bool force_writing, unsigned short iFile){
32813281

32823282
bool writeRestart = false;
3283-
const unsigned short *VolumeFrequencies = config->GetVolumeOutputFrequencies();
3283+
unsigned short *VolumeFrequencies = config->GetVolumeOutputFrequencies();
32843284
auto FileFormat = config->GetVolumeOutputFiles();
32853285

32863286
if (config->GetTime_Domain()){

0 commit comments

Comments
 (0)