Skip to content

Commit

Permalink
index cache for compact
Browse files Browse the repository at this point in the history
  • Loading branch information
pcarruscag committed Jan 1, 2025
1 parent 60d7256 commit e599fa1
Show file tree
Hide file tree
Showing 7 changed files with 102 additions and 131 deletions.
47 changes: 25 additions & 22 deletions SU2_CFD/include/output/COutput.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -241,17 +241,16 @@ class COutput {

/*----------------------------- Volume output ----------------------------*/

CParallelDataSorter* volumeDataSorter; //!< Volume data sorter
CParallelDataSorter* volumeDataSorterCompact; //!< Volume data sorter
CParallelDataSorter* surfaceDataSorter; //!< Surface data sorter
CParallelDataSorter* volumeDataSorter; //!< Volume data sorter.
CParallelDataSorter* volumeDataSorterCompact; //!< Volume data sorter for compact files.
CParallelDataSorter* surfaceDataSorter; //!< Surface data sorter.

vector<string> volumeFieldNames; //!< Vector containing the volume field names
vector<string> volumeFieldNames; //!< Vector containing the volume field names.
vector<string> requiredVolumeFieldNames; //!< Vector containing the minimum required volume field names.

vector<string> requiredVolumeFieldNames; //!< Vector containing the minimum required volume field names.

string volumeFilename, //!< Volume output filename
surfaceFilename, //!< Surface output filename
restartFilename; //!< Restart output filename
string volumeFilename, //!< Volume output filename.
surfaceFilename, //!< Surface output filename.
restartFilename; //!< Restart output filename.

/** \brief Structure to store information for a volume output field.
*
Expand All @@ -269,28 +268,32 @@ class COutput {
/*! \brief String containing the description of the field. */
string description;
/*! \brief Default constructor. */
VolumeOutputField () {}
VolumeOutputField() = default;
/*! \brief Constructor to initialize all members. */
VolumeOutputField(string fieldName_, int offset_, string volumeOutputGroup_, string description_):
fieldName(std::move(fieldName_)), offset(std::move(offset_)),
outputGroup(std::move(volumeOutputGroup_)), description(std::move(description_)){}
fieldName(std::move(fieldName_)),
offset(offset_),
outputGroup(std::move(volumeOutputGroup_)),
description(std::move(description_)) {}
};

/*! \brief Associative map to access data stored in the volume output fields by a string identifier. */
std::map<string, VolumeOutputField > volumeOutput_Map;
std::map<string, VolumeOutputField > volumeOutput_Map;
/*! \brief Vector that contains the keys of the ::volumeOutput_Map in the order of their insertion. */
std::vector<string> volumeOutput_List;
std::vector<string> volumeOutput_List;

/*! \brief Whether the field index caches should be build. */
bool buildFieldIndexCache;

/*! \brief Vectors to cache the positions of the fields in the data array. */
std::vector<short> fieldIndexCache, fieldIndexCacheCompact;
/*! \brief Current value of the cache indices. */
unsigned short cachePosition;

/*! \brief Vector to cache the positions of the field in the data array. */
std::vector<short> fieldIndexCache;
/*! \brief Current value of the cache index. */
unsigned short cachePosition;
/*! \brief Boolean to store whether the field index cache should be build. */
bool buildFieldIndexCache;
/*! \brief Vector to cache the positions of the field in the data array. */
std::vector<short> fieldGetIndexCache;
std::vector<short> fieldGetIndexCache;
/*! \brief Current value of the cache index. */
unsigned short curGetFieldIndex;
unsigned short curGetFieldIndex;

/*! \brief Requested volume field names in the config file. */
std::vector<string> requestedVolumeFields;
Expand Down
17 changes: 8 additions & 9 deletions SU2_CFD/src/output/CElasticityOutput.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -235,21 +235,20 @@ void CElasticityOutput::SetVolumeOutputFields(CConfig *config){
// Grid coordinates
AddVolumeOutput("COORD-X", "x", "COORDINATES", "x-component of the coordinate vector");
AddVolumeOutput("COORD-Y", "y", "COORDINATES", "y-component of the coordinate vector");
if (nDim == 3)
AddVolumeOutput("COORD-Z", "z", "COORDINATES", "z-component of the coordinate vector");
if (nDim == 3) AddVolumeOutput("COORD-Z", "z", "COORDINATES", "z-component of the coordinate vector");

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

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

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

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

0 comments on commit e599fa1

Please sign in to comment.