Skip to content

Commit e599fa1

Browse files
committed
index cache for compact
1 parent 60d7256 commit e599fa1

File tree

7 files changed

+102
-131
lines changed

7 files changed

+102
-131
lines changed

SU2_CFD/include/output/COutput.hpp

Lines changed: 25 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -241,17 +241,16 @@ class COutput {
241241

242242
/*----------------------------- Volume output ----------------------------*/
243243

244-
CParallelDataSorter* volumeDataSorter; //!< Volume data sorter
245-
CParallelDataSorter* volumeDataSorterCompact; //!< Volume data sorter
246-
CParallelDataSorter* surfaceDataSorter; //!< Surface data sorter
244+
CParallelDataSorter* volumeDataSorter; //!< Volume data sorter.
245+
CParallelDataSorter* volumeDataSorterCompact; //!< Volume data sorter for compact files.
246+
CParallelDataSorter* surfaceDataSorter; //!< Surface data sorter.
247247

248-
vector<string> volumeFieldNames; //!< Vector containing the volume field names
248+
vector<string> volumeFieldNames; //!< Vector containing the volume field names.
249+
vector<string> requiredVolumeFieldNames; //!< Vector containing the minimum required volume field names.
249250

250-
vector<string> requiredVolumeFieldNames; //!< Vector containing the minimum required volume field names.
251-
252-
string volumeFilename, //!< Volume output filename
253-
surfaceFilename, //!< Surface output filename
254-
restartFilename; //!< Restart output filename
251+
string volumeFilename, //!< Volume output filename.
252+
surfaceFilename, //!< Surface output filename.
253+
restartFilename; //!< Restart output filename.
255254

256255
/** \brief Structure to store information for a volume output field.
257256
*
@@ -269,28 +268,32 @@ class COutput {
269268
/*! \brief String containing the description of the field. */
270269
string description;
271270
/*! \brief Default constructor. */
272-
VolumeOutputField () {}
271+
VolumeOutputField() = default;
273272
/*! \brief Constructor to initialize all members. */
274273
VolumeOutputField(string fieldName_, int offset_, string volumeOutputGroup_, string description_):
275-
fieldName(std::move(fieldName_)), offset(std::move(offset_)),
276-
outputGroup(std::move(volumeOutputGroup_)), description(std::move(description_)){}
274+
fieldName(std::move(fieldName_)),
275+
offset(offset_),
276+
outputGroup(std::move(volumeOutputGroup_)),
277+
description(std::move(description_)) {}
277278
};
278279

279280
/*! \brief Associative map to access data stored in the volume output fields by a string identifier. */
280-
std::map<string, VolumeOutputField > volumeOutput_Map;
281+
std::map<string, VolumeOutputField > volumeOutput_Map;
281282
/*! \brief Vector that contains the keys of the ::volumeOutput_Map in the order of their insertion. */
282-
std::vector<string> volumeOutput_List;
283+
std::vector<string> volumeOutput_List;
284+
285+
/*! \brief Whether the field index caches should be build. */
286+
bool buildFieldIndexCache;
287+
288+
/*! \brief Vectors to cache the positions of the fields in the data array. */
289+
std::vector<short> fieldIndexCache, fieldIndexCacheCompact;
290+
/*! \brief Current value of the cache indices. */
291+
unsigned short cachePosition;
283292

284293
/*! \brief Vector to cache the positions of the field in the data array. */
285-
std::vector<short> fieldIndexCache;
286-
/*! \brief Current value of the cache index. */
287-
unsigned short cachePosition;
288-
/*! \brief Boolean to store whether the field index cache should be build. */
289-
bool buildFieldIndexCache;
290-
/*! \brief Vector to cache the positions of the field in the data array. */
291-
std::vector<short> fieldGetIndexCache;
294+
std::vector<short> fieldGetIndexCache;
292295
/*! \brief Current value of the cache index. */
293-
unsigned short curGetFieldIndex;
296+
unsigned short curGetFieldIndex;
294297

295298
/*! \brief Requested volume field names in the config file. */
296299
std::vector<string> requestedVolumeFields;

SU2_CFD/src/output/CElasticityOutput.cpp

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -235,21 +235,20 @@ void CElasticityOutput::SetVolumeOutputFields(CConfig *config){
235235
// Grid coordinates
236236
AddVolumeOutput("COORD-X", "x", "COORDINATES", "x-component of the coordinate vector");
237237
AddVolumeOutput("COORD-Y", "y", "COORDINATES", "y-component of the coordinate vector");
238-
if (nDim == 3)
239-
AddVolumeOutput("COORD-Z", "z", "COORDINATES", "z-component of the coordinate vector");
238+
if (nDim == 3) AddVolumeOutput("COORD-Z", "z", "COORDINATES", "z-component of the coordinate vector");
240239

241240
AddVolumeOutput("DISPLACEMENT-X", "Displacement_x", "SOLUTION", "x-component of the displacement vector");
242241
AddVolumeOutput("DISPLACEMENT-Y", "Displacement_y", "SOLUTION", "y-component of the displacement vector");
243242
if (nDim == 3) AddVolumeOutput("DISPLACEMENT-Z", "Displacement_z", "SOLUTION", "z-component of the displacement vector");
244243

245-
if(dynamic){
246-
AddVolumeOutput("VELOCITY-X", "Velocity_x", "VELOCITY", "x-component of the velocity vector");
247-
AddVolumeOutput("VELOCITY-Y", "Velocity_y", "VELOCITY", "y-component of the velocity vector");
248-
if (nDim == 3) AddVolumeOutput("VELOCITY-Z", "Velocity_z", "VELOCITY", "z-component of the velocity vector");
244+
if (dynamic) {
245+
AddVolumeOutput("VELOCITY-X", "Velocity_x", "SOLUTION", "x-component of the velocity vector");
246+
AddVolumeOutput("VELOCITY-Y", "Velocity_y", "SOLUTION", "y-component of the velocity vector");
247+
if (nDim == 3) AddVolumeOutput("VELOCITY-Z", "Velocity_z", "SOLUTION", "z-component of the velocity vector");
249248

250-
AddVolumeOutput("ACCELERATION-X", "Acceleration_x", "ACCELERATION", "x-component of the acceleration vector");
251-
AddVolumeOutput("ACCELERATION-Y", "Acceleration_y", "ACCELERATION", "y-component of the acceleration vector");
252-
if (nDim == 3) AddVolumeOutput("ACCELERATION-Z", "Acceleration_z", "ACCELERATION", "z-component of the acceleration vector");
249+
AddVolumeOutput("ACCELERATION-X", "Acceleration_x", "SOLUTION", "x-component of the acceleration vector");
250+
AddVolumeOutput("ACCELERATION-Y", "Acceleration_y", "SOLUTION", "y-component of the acceleration vector");
251+
if (nDim == 3) AddVolumeOutput("ACCELERATION-Z", "Acceleration_z", "SOLUTION", "z-component of the acceleration vector");
253252
}
254253

255254
AddVolumeOutput("STRESS-XX", "Sxx", "STRESS", "x-component of the normal stress vector");

0 commit comments

Comments
 (0)