Skip to content

Commit c3831fa

Browse files
committed
fix lgtm warnings
1 parent 3afaeef commit c3831fa

2 files changed

Lines changed: 9 additions & 13 deletions

File tree

Common/include/toolboxes/C1DInterpolation.hpp

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -38,8 +38,6 @@ using namespace std;
3838
class C1DInterpolation{
3939
protected:
4040
bool Point_Match = false; /*!< \brief to make sure all points from the inlet data match the vertex coordinates */
41-
vector<su2double> X; /*!< \brief x for inlet data */
42-
vector<su2double> Data; /*!< \brief f(x) for inlet data */
4341

4442
public:
4543
/*!
@@ -52,7 +50,7 @@ class C1DInterpolation{
5250
* \param[in] X - the x values.
5351
* \param[in] Data - the f(x) values.
5452
*/
55-
virtual void SetSpline(const vector<su2double> &X, const vector<su2double> &Data){}
53+
virtual void SetSpline(const vector<su2double> &X, const vector<su2double> &Data) = 0;
5654

5755
/*!
5856
* \brief virtual method for evaluating the value of the respective Spline.
@@ -80,7 +78,7 @@ class CAkimaInterpolation final: public C1DInterpolation{
8078
* \param[in] Data - the f(x) values.
8179
*/
8280
CAkimaInterpolation(vector<su2double> &X, vector<su2double> &Data){
83-
SetSpline(X,Data);
81+
SetSpline(X,Data);
8482
}
8583

8684
/*!
@@ -110,7 +108,7 @@ class CLinearInterpolation final: public C1DInterpolation{
110108
* \param[in] Data - the f(x) values.
111109
*/
112110
CLinearInterpolation(vector<su2double> &X, vector<su2double> &Data){
113-
SetSpline(X,Data);
111+
SetSpline(X,Data);
114112
}
115113

116114
/*!

SU2_CFD/src/solvers/CSolver.cpp

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -3379,7 +3379,7 @@ void CSolver::LoadInletProfile(CGeometry **geometry,
33793379
vector<su2double> InletRadii = profileReader.GetColumnForProfile(jMarker, radius_index);
33803380
vector<su2double> Interpolation_Column (nRows);
33813381

3382-
bool Interpolate = false;
3382+
bool Interpolate = true;
33833383

33843384
switch(config->GetKindInletInterpolationFunction()){
33853385

@@ -3388,21 +3388,19 @@ void CSolver::LoadInletProfile(CGeometry **geometry,
33883388
break;
33893389

33903390
case (AKIMA_1D):
3391-
for (unsigned short iCol=0; iCol < nColumns; iCol++){
3391+
for (auto iCol=0ul; iCol < nColumns; iCol++){
33923392
Interpolation_Column = profileReader.GetColumnForProfile(jMarker, iCol);
33933393
interpolator[iCol] = new CAkimaInterpolation(InletRadii,Interpolation_Column);
3394-
interpolation_function = "AKIMA";
3395-
Interpolate = true;
33963394
}
3395+
interpolation_function = "AKIMA";
33973396
break;
33983397

33993398
case (LINEAR_1D):
3400-
for (unsigned short iCol=0; iCol < nColumns; iCol++){
3399+
for (auto iCol=0ul; iCol < nColumns; iCol++){
34013400
Interpolation_Column = profileReader.GetColumnForProfile(jMarker, iCol);
34023401
interpolator[iCol] = new CLinearInterpolation(InletRadii,Interpolation_Column);
3403-
interpolation_function = "LINEAR";
3404-
Interpolate = true;
34053402
}
3403+
interpolation_function = "LINEAR";
34063404
break;
34073405

34083406
default:
@@ -3496,7 +3494,7 @@ void CSolver::LoadInletProfile(CGeometry **geometry,
34963494
const su2double Theta = atan2(Coord[1],Coord[0]);
34973495

34983496
/* --- Evaluating and saving the final spline data ---*/
3499-
for (unsigned short iVar=0; iVar < nColumns; iVar++){
3497+
for (auto iVar=0ul; iVar < nColumns; iVar++){
35003498

35013499
/*---Evaluate spline will get the respective value of the Data set (column) specified
35023500
for that interpolator[iVar], cycling through all columns to get all the

0 commit comments

Comments
 (0)