Skip to content

Commit 6647e7b

Browse files
committed
const& and use functions in test
1 parent bb0b8e6 commit 6647e7b

2 files changed

Lines changed: 12 additions & 5 deletions

File tree

SU2_CFD/include/drivers/CDriverBase.hpp

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -124,13 +124,13 @@ class CDriverBase {
124124
* \brief Get the list of available outputs.
125125
* \return List of output names.
126126
*/
127-
inline vector<string> GetOutputNames() const { return output_container[MESH_0]->GetHistoryOutput_List(); }
127+
inline vector<string> GetOutputNames() const { return output_container[MESH_0]->GetHistoryOutputList(); }
128128

129129
/*!
130130
* \brief Get the value of one of the available history outputs.
131131
* \return Value of the output.
132132
*/
133-
inline passivedouble GetOutputValue(std::string output_name) const {
133+
inline passivedouble GetOutputValue(const std::string& output_name) const {
134134
return SU2_TYPE::GetValue(output_container[MESH_0]->GetHistoryFieldValue(output_name));
135135
}
136136

@@ -139,14 +139,15 @@ class CDriverBase {
139139
* \return List of surface output names.
140140
*/
141141
inline vector<string> GetMarkerOutputNames() const {
142-
return output_container[MESH_0]->GetHistoryOutputPerSurface_List();
142+
return output_container[MESH_0]->GetHistoryOutputPerSurfaceList();
143143
}
144144

145145
/*!
146146
* \brief Get the value of one of the available surface outputs at a given MARKER_MONITORING.
147147
* \return Value of the output.
148148
*/
149-
inline passivedouble GetMarkerMonitoringOutputValue(std::string output_name, std::string marker_monitoring) const {
149+
inline passivedouble GetMarkerMonitoringOutputValue(const std::string& output_name,
150+
const std::string& marker_monitoring) const {
150151
for (auto iMarker = 0u; iMarker < main_config->GetnMarker_Monitoring(); ++iMarker) {
151152
if (marker_monitoring == main_config->GetMarker_Monitoring_TagBound(iMarker))
152153
return SU2_TYPE::GetValue(output_container[MESH_0]->GetHistoryFieldValuePerSurface(output_name, iMarker));
@@ -159,7 +160,8 @@ class CDriverBase {
159160
* \brief Get the value of one of the available surface outputs at a given MARKER_ANALYZE.
160161
* \return Value of the output.
161162
*/
162-
inline passivedouble GetMarkerAnalyzeOutputValue(std::string output_name, std::string marker_analyze) const {
163+
inline passivedouble GetMarkerAnalyzeOutputValue(const std::string& output_name,
164+
const std::string& marker_analyze) const {
163165
for (auto iMarker = 0u; iMarker < main_config->GetnMarker_Analyze(); ++iMarker) {
164166
if (marker_analyze == main_config->GetMarker_Analyze_TagBound(iMarker))
165167
return SU2_TYPE::GetValue(output_container[MESH_0]->GetHistoryFieldValuePerSurface(output_name, iMarker));

TestCases/py_wrapper/deforming_bump_in_channel/run.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -88,6 +88,11 @@ def main():
8888
TimeIter += 1
8989
time += deltaT
9090

91+
# Check the value of an output to cover the functionality in a regression test.
92+
assert 'DRAG' in SU2Driver.GetOutputNames()
93+
assert abs(SU2Driver.GetOutputValue('DRAG') -
94+
SU2Driver.GetMarkerMonitoringOutputValue('DRAG_ON_SURFACE', MarkerName)) < np.finfo(float).eps
95+
9196
# Finalize the solver and exit cleanly
9297
SU2Driver.Finalize()
9398

0 commit comments

Comments
 (0)