Skip to content

Commit f8187ef

Browse files
committed
Adds const specifier to member functions and also const to some function args.
1 parent 25d2e0f commit f8187ef

45 files changed

Lines changed: 419 additions & 419 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

Common/include/CConfig.hpp

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1322,13 +1322,13 @@ class CConfig {
13221322
* \brief Print the header to screen
13231323
* \param val_software - Kind of software component
13241324
*/
1325-
void SetHeader(unsigned short val_software);
1325+
void SetHeader(unsigned short val_software) const;
13261326

13271327
/*!
13281328
* \brief Get the MPI communicator of SU2.
13291329
* \return MPI communicator of SU2.
13301330
*/
1331-
SU2_MPI::Comm GetMPICommunicator();
1331+
SU2_MPI::Comm GetMPICommunicator() const;
13321332

13331333
/*!
13341334
* \brief Set the MPI communicator for SU2.
@@ -3937,7 +3937,7 @@ class CConfig {
39373937
* \brief Get flag for whether a second gradient calculation is required for upwind reconstruction alone.
39383938
* \return <code>TRUE</code> means that a second gradient will be calculated for upwind reconstruction.
39393939
*/
3940-
bool GetReconstructionGradientRequired(void) { return ReconstructionGradientRequired; }
3940+
bool GetReconstructionGradientRequired(void) const { return ReconstructionGradientRequired; }
39413941

39423942
/*!
39433943
* \brief Get flag for whether a least-squares gradient method is being applied.
@@ -5403,13 +5403,13 @@ class CConfig {
54035403
* \brief Append the zone index to the restart or the solution files.
54045404
* \return Name of the restart file for the flow variables.
54055405
*/
5406-
string GetMultizone_FileName(string val_filename, int val_iZone, string ext);
5406+
string GetMultizone_FileName(string val_filename, int val_iZone, string ext) const;
54075407

54085408
/*!
54095409
* \brief Append the zone index to the restart or the solution files.
54105410
* \return Name of the restart file for the flow variables.
54115411
*/
5412-
string GetMultizone_HistoryFileName(string val_filename, int val_iZone, string ext);
5412+
string GetMultizone_HistoryFileName(string val_filename, int val_iZone, string ext) const;
54135413

54145414
/*!
54155415
* \brief Append the instance index to the restart or the solution files.
@@ -5483,7 +5483,7 @@ class CConfig {
54835483
* \param[in] val_iter - Unsteady iteration number or time instance.
54845484
* \return Name of the file with the iteration number for an unsteady solution file.
54855485
*/
5486-
string GetUnsteady_FileName(string val_filename, int val_iter, string ext);
5486+
string GetUnsteady_FileName(string val_filename, int val_iter, string ext) const;
54875487

54885488
/*!
54895489
* \brief Append the input filename string with the appropriate objective function extension.
@@ -5688,7 +5688,7 @@ class CConfig {
56885688
* \param[in] val - new value of the origin
56895689
* \return The mesh motion origin.
56905690
*/
5691-
void SetMotion_Origin(su2double* val) { for (int iDim = 0; iDim < 3; iDim++) Motion_Origin[iDim] = val[iDim]; }
5691+
void SetMotion_Origin(const su2double* val) { for (int iDim = 0; iDim < 3; iDim++) Motion_Origin[iDim] = val[iDim]; }
56925692

56935693
/*!
56945694
* \brief Get the mesh motion origin.
@@ -5703,7 +5703,7 @@ class CConfig {
57035703
* \param[in] val - new value of the origin
57045704
* \param[in] iMarkerMoving - Index of the moving marker (as specified in Marker_Moving)
57055705
*/
5706-
void SetMarkerMotion_Origin(su2double* val, unsigned short iMarkerMoving) {
5706+
void SetMarkerMotion_Origin(const su2double* val, unsigned short iMarkerMoving) {
57075707
for (int iDim = 0; iDim < 3; iDim++) MarkerMotion_Origin[3*iMarkerMoving + iDim] = val[iDim];
57085708
}
57095709

@@ -8338,7 +8338,7 @@ class CConfig {
83388338
* \brief Get the current number of non-physical reconstructions for 2nd-order upwinding.
83398339
* \return Current number of non-physical reconstructions for 2nd-order upwinding.
83408340
*/
8341-
unsigned long GetNonphysical_Reconstr(void) { return Nonphys_Reconstr; }
8341+
unsigned long GetNonphysical_Reconstr(void) const { return Nonphys_Reconstr; }
83428342

83438343
/*!
83448344
* \brief Given arrays x[1..n] and y[1..n] containing a tabulated function, i.e., yi = f(xi), with
@@ -8401,7 +8401,7 @@ class CConfig {
84018401
*
84028402
* \brief Set freestream turbonormal for initializing solution.
84038403
*/
8404-
void SetFreeStreamTurboNormal(su2double* turboNormal);
8404+
void SetFreeStreamTurboNormal(const su2double* turboNormal);
84058405

84068406
/*!
84078407
*

Common/include/fem_gauss_jacobi_quadrature.hpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -175,15 +175,15 @@ class CGaussJacobiQuadrature {
175175
* \brief Function in the original implementation of John Burkardt to compute
176176
the integration points of the Gauss-Jacobi quadrature rule.
177177
*/
178-
void scqf(int nt, passivedouble t[], int mlt[], passivedouble wts[], int nwts, int ndx[],
178+
void scqf(int nt, const passivedouble t[], const int mlt[], const passivedouble wts[], int nwts, int ndx[],
179179
passivedouble swts[], passivedouble st[], int kind, passivedouble alpha,
180180
passivedouble beta, passivedouble a, passivedouble b);
181181

182182
/*!
183183
* \brief Function in the original implementation of John Burkardt to compute
184184
the integration points of the Gauss-Jacobi quadrature rule.
185185
*/
186-
void sgqf(int nt, passivedouble aj[], passivedouble bj[], passivedouble zemu, passivedouble t[],
186+
void sgqf(int nt, const passivedouble aj[], passivedouble bj[], passivedouble zemu, passivedouble t[],
187187
passivedouble wts[]);
188188
};
189189

Common/include/fem_geometry_structure.hpp

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -109,26 +109,26 @@ class CReorderElements {
109109
* \brief Function to make available the variable commSolution.
110110
* \return Whether or not the solution of the element must be communicated.
111111
*/
112-
bool GetCommSolution(void);
112+
bool GetCommSolution(void) const;
113113

114114
/*!
115115
* \brief Function to make available the element type of the element.
116116
* \return The value of elemType, which stores the VTK type, polynomial degree
117117
and whether or not the Jacobian is constant.
118118
*/
119-
unsigned short GetElemType(void);
119+
unsigned short GetElemType(void) const;
120120

121121
/*!
122122
* \brief Function to make available the global element ID.
123123
* \return The global element ID of the element.
124124
*/
125-
unsigned long GetGlobalElemID(void);
125+
unsigned long GetGlobalElemID(void) const;
126126

127127
/*!
128128
* \brief Function to make available the time level.
129129
* \return The time level of the element.
130130
*/
131-
unsigned short GetTimeLevel(void);
131+
unsigned short GetTimeLevel(void) const;
132132

133133
/*!
134134
* \brief Function, which sets the value of commSolution.
@@ -675,13 +675,13 @@ class CMeshFEM: public CGeometry {
675675
* \brief Function, which makes available the number of owned volume elements in the local FEM mesh.
676676
* \return Number of owned volume elements of the local FEM mesh.
677677
*/
678-
unsigned long GetNVolElemOwned(void);
678+
unsigned long GetNVolElemOwned(void) const;
679679

680680
/*!
681681
* \brief Function, which makes available the total number of volume elements in the local FEM mesh.
682682
* \return Total number of volume elements of the local FEM mesh.
683683
*/
684-
unsigned long GetNVolElemTot(void);
684+
unsigned long GetNVolElemTot(void) const;
685685

686686
/*!
687687
* \brief Function, which makes available the volume elements in the local FEM mesh.

Common/include/fem_geometry_structure.inl

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -43,13 +43,13 @@ inline CReorderElements::CReorderElements(const CReorderElements &other) { Copy(
4343

4444
inline CReorderElements& CReorderElements::operator=(const CReorderElements &other) { Copy(other); return (*this); }
4545

46-
inline bool CReorderElements::GetCommSolution(void) { return commSolution; }
46+
inline bool CReorderElements::GetCommSolution(void) const { return commSolution; }
4747

48-
inline unsigned short CReorderElements::GetElemType(void) { return elemType; }
48+
inline unsigned short CReorderElements::GetElemType(void) const { return elemType; }
4949

50-
inline unsigned long CReorderElements::GetGlobalElemID(void) { return globalElemID; }
50+
inline unsigned long CReorderElements::GetGlobalElemID(void) const { return globalElemID; }
5151

52-
inline unsigned short CReorderElements::GetTimeLevel(void) { return timeLevel; }
52+
inline unsigned short CReorderElements::GetTimeLevel(void) const { return timeLevel; }
5353

5454
inline void CReorderElements::SetCommSolution(const bool val_CommSolution) { commSolution = val_CommSolution; }
5555

@@ -108,9 +108,9 @@ inline CPointFEM* CMeshFEM::GetMeshPoints(void) {return meshPoints.data();}
108108

109109
inline unsigned long CMeshFEM::GetNMeshPoints(void) {return meshPoints.size();}
110110

111-
inline unsigned long CMeshFEM::GetNVolElemOwned(void) {return nVolElemOwned;}
111+
inline unsigned long CMeshFEM::GetNVolElemOwned(void) const {return nVolElemOwned;}
112112

113-
inline unsigned long CMeshFEM::GetNVolElemTot(void) {return nVolElemTot;}
113+
inline unsigned long CMeshFEM::GetNVolElemTot(void) const {return nVolElemTot;}
114114

115115
inline CVolumeElementFEM* CMeshFEM::GetVolElem(void) {return volElem.data();}
116116

Common/include/fem_standard_element.hpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -119,7 +119,7 @@ class CFEMStandardElementBase {
119119
* \brief Function, which makes available the polynomial order that must be integrated exactly.
120120
* \return The polynomial order that must be integrated exactly.
121121
*/
122-
unsigned short GetOrderExact(void);
122+
unsigned short GetOrderExact(void) const;
123123

124124
/*!
125125
* \brief Static function, which computes the inverse of the given square matrix.
@@ -698,7 +698,7 @@ class CFEMStandardElementBase {
698698
* \return The value of the viscous penalty parameter.
699699
*/
700700
su2double ViscousPenaltyParameter(const unsigned short VTK_TypeElem,
701-
const unsigned short nPolyElem);
701+
const unsigned short nPolyElem) const;
702702
private:
703703
/*!
704704
* \brief Function, which determines the 1D Gauss Legendre integration points and weights.
@@ -1127,7 +1127,7 @@ class CFEMStandardElement : public CFEMStandardElementBase {
11271127
unsigned short vert0,
11281128
unsigned short vert1,
11291129
unsigned short vert2,
1130-
unsigned short vert3);
1130+
unsigned short vert3) const;
11311131

11321132
/*!
11331133
* \brief Function, which changes the given triangular connectivity, such that the direction coincides
@@ -1140,7 +1140,7 @@ class CFEMStandardElement : public CFEMStandardElementBase {
11401140
void ChangeDirectionTriangleConn(vector<unsigned short> &connTriangle,
11411141
unsigned short vert0,
11421142
unsigned short vert1,
1143-
unsigned short vert2);
1143+
unsigned short vert2) const;
11441144

11451145
/*!
11461146
* \brief Function, which copies the data of the given object into the current object.

Common/include/fem_standard_element.inl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ inline const su2double* CFEMStandardElementBase::GetWeightsIntegration(void) con
3737

3838
inline unsigned short CFEMStandardElementBase::GetNIntegration(void) const {return nIntegration;}
3939

40-
inline unsigned short CFEMStandardElementBase::GetOrderExact(void){return orderExact;}
40+
inline unsigned short CFEMStandardElementBase::GetOrderExact(void) const{return orderExact;}
4141

4242
inline CFEMStandardElement::CFEMStandardElement(){}
4343

0 commit comments

Comments
 (0)