Skip to content

Commit b69bd5d

Browse files
committed
codeQL
1 parent 875bfc1 commit b69bd5d

2 files changed

Lines changed: 39 additions & 40 deletions

File tree

Common/include/grid_movement/CRadialBasisFunctionNode.hpp

Lines changed: 33 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -35,55 +35,54 @@
3535
* \author F. van Steen
3636
*/
3737

38-
class CRadialBasisFunctionNode{
38+
class CRadialBasisFunctionNode {
3939
protected:
40-
unsigned long idx; /*!< \brief Global index. */
41-
unsigned short marker_idx; /*!< \brief Marker index. */
42-
unsigned long vertex_idx; /*!< \brief Vertex index. */
43-
44-
su2double error[3]; /*!< \brief Nodal data reduction error; */
45-
46-
public:
40+
unsigned long idx; /*!< \brief Global index. */
41+
unsigned short marker_idx; /*!< \brief Marker index. */
42+
unsigned long vertex_idx; /*!< \brief Vertex index. */
4743

44+
su2double error[3]; /*!< \brief Nodal data reduction error. */
45+
46+
public:
4847
/*!
49-
* \brief Constructor of the class.
50-
* \param[in] idx_val - Local node index.
51-
* \param[in] marker_val - Local marker index.
52-
* \param[in] vertex_val - Local vertex index.
53-
*/
48+
* \brief Constructor of the class.
49+
* \param[in] idx_val - Local node index.
50+
* \param[in] marker_val - Local marker index.
51+
* \param[in] vertex_val - Local vertex index.
52+
*/
5453
CRadialBasisFunctionNode(unsigned long idx_val, unsigned short marker_val, unsigned long vertex_val);
5554

5655
/*!
57-
* \brief Returns local global index.
58-
* \return Local node index.
59-
*/
60-
inline unsigned long GetIndex(){return idx;}
56+
* \brief Returns local global index.
57+
* \return Local node index.
58+
*/
59+
inline unsigned long GetIndex() { return idx; }
6160

6261
/*!
63-
* \brief Returns local vertex index.
64-
* \return Local vertex index.
65-
*/
66-
inline unsigned long GetVertex(){return vertex_idx;}
62+
* \brief Returns local vertex index.
63+
* \return Local vertex index.
64+
*/
65+
inline unsigned long GetVertex() { return vertex_idx; }
6766

6867
/*!
69-
* \brief Returns local marker index.
70-
* \return Local marker index.
71-
*/
72-
inline unsigned short GetMarker(){return marker_idx;}
68+
* \brief Returns local marker index.
69+
* \return Local marker index.
70+
*/
71+
inline unsigned short GetMarker() { return marker_idx; }
7372

7473
/*!
75-
* \brief Set error of the RBF node.
76-
* \param val_error - Nodal error.
77-
* \param nDim - Number of dimensions.
78-
*/
74+
* \brief Set error of the RBF node.
75+
* \param val_error - Nodal error.
76+
* \param nDim - Number of dimensions.
77+
*/
7978

8079
inline void SetError(const su2double* val_error, unsigned short nDim) {
8180
for (auto iDim = 0u; iDim < nDim; iDim++) error[iDim] = val_error[iDim];
8281
}
8382

8483
/*!
85-
* \brief Get nodal error.
86-
* \return Nodal error.
87-
*/
88-
inline su2double* GetError(){ return error;}
89-
};
84+
* \brief Get nodal error.
85+
* \return Nodal error.
86+
*/
87+
inline su2double* GetError() { return error; }
88+
};

Common/src/grid_movement/CLinearElasticity.cpp

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -419,8 +419,8 @@ void CLinearElasticity::SetFEA_StiffMatrix2D(CGeometry* geometry, CConfig* confi
419419
su2double Location[4][3], Weight[4];
420420
unsigned short nVar = geometry->GetnDim();
421421

422-
for (iVar = 0; iVar < nNodes * nVar; iVar++) {
423-
for (jVar = 0; jVar < nNodes * nVar; jVar++) {
422+
for (iVar = 0; iVar < static_cast<unsigned short>(nNodes * nVar); iVar++) {
423+
for (jVar = 0; jVar < static_cast<unsigned short>(nNodes * nVar); jVar++) {
424424
StiffMatrix_Elem[iVar][jVar] = 0.0;
425425
}
426426
}
@@ -465,7 +465,7 @@ void CLinearElasticity::SetFEA_StiffMatrix2D(CGeometry* geometry, CConfig* confi
465465
/*--- Compute the B Matrix ---*/
466466

467467
for (iVar = 0; iVar < 3; iVar++)
468-
for (jVar = 0; jVar < nNodes * nVar; jVar++) B_Matrix[iVar][jVar] = 0.0;
468+
for (jVar = 0; jVar < static_cast<unsigned short>(nNodes * nVar); jVar++) B_Matrix[iVar][jVar] = 0.0;
469469

470470
for (iNode = 0; iNode < nNodes; iNode++) {
471471
B_Matrix[0][0 + iNode * nVar] = DShapeFunction[iNode][0];
@@ -507,7 +507,7 @@ void CLinearElasticity::SetFEA_StiffMatrix2D(CGeometry* geometry, CConfig* confi
507507

508508
/*--- Compute the BT.D Matrix ---*/
509509

510-
for (iVar = 0; iVar < nNodes * nVar; iVar++) {
510+
for (iVar = 0; iVar < static_cast<unsigned short>(nNodes * nVar); iVar++) {
511511
for (jVar = 0; jVar < 3; jVar++) {
512512
Aux_Matrix[iVar][jVar] = 0.0;
513513
for (kVar = 0; kVar < 3; kVar++) Aux_Matrix[iVar][jVar] += B_Matrix[kVar][iVar] * D_Matrix[kVar][jVar];
@@ -517,8 +517,8 @@ void CLinearElasticity::SetFEA_StiffMatrix2D(CGeometry* geometry, CConfig* confi
517517
/*--- Compute the BT.D.B Matrix (stiffness matrix), and add to the original
518518
matrix using Gauss integration ---*/
519519

520-
for (iVar = 0; iVar < nNodes * nVar; iVar++) {
521-
for (jVar = 0; jVar < nNodes * nVar; jVar++) {
520+
for (iVar = 0; iVar < static_cast<unsigned short>(nNodes * nVar); iVar++) {
521+
for (jVar = 0; jVar < static_cast<unsigned short>(nNodes * nVar); jVar++) {
522522
for (kVar = 0; kVar < 3; kVar++) {
523523
StiffMatrix_Elem[iVar][jVar] += Weight[iGauss] * Aux_Matrix[iVar][kVar] * B_Matrix[kVar][jVar] * fabs(Det);
524524
}

0 commit comments

Comments
 (0)